react-semaphor 0.0.345 → 0.0.347

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { c as R, u as vs, v as M, w as is, x as Se, y as e, z as Cs, A as Ns, H as O, o as Ss, J as ws, K as ks, M as zs, N as Os, O as H, Q as ie, R as ta, V as na, W as la, Y as ra, Z as st, _ as at, $ as tt, a0 as Gs, a1 as Y, a2 as Be, i as nt, a3 as u, a4 as lt, P as ia, F as oa, a5 as Ue, a6 as Ge, a7 as Ds, a8 as ca, a9 as Ms, aa as ue, ab as he, ac as me, ad as xe, ae as ve, af as pe, ag as X, T as Is, ah as Ts, ai as Ls, aj as Fs, ak as da, al as ua, am as ce, an as rt, ao as it, ap as ha, aq as ot, C as ct, ar as dt, as as ma, B as ut, at as fe, au as ht, av as Ke, aw as xa, ax as gs, ay as be, az as ze, aA as Ce, aB as pa, aC as mt, aD as xt, aE as pt, aF as ft, l as gt, aG as jt, aH as bt, aI as De, aJ as ne, aK as fa, aL as yt, aM as os, aN as vt, aO as Ct, aP as js, a as Nt, aQ as ss, aR as ye, aS as as, aT as St, aU as wt, aV as kt, aW as zt, aX as fs, aY as Ot, aZ as Ks, a_ as Dt, a$ as Qs, b0 as Mt, b1 as It, b2 as Tt, b3 as Lt, b4 as ga, b5 as Ft, b6 as Es, b7 as ja, b8 as Et, b9 as At, ba as Xe, bb as Vt, bc as qt, bd as ba, be as Rt, s as _t, bf as Ht, bg as Pt, r as $t, bh as cs, bi as ya, bj as va, bk as Ca, bl as Ze, bm as Na, bn as es, bo as Js, bp as Bt, bq as Ut, br as ds, bs as us, bt as hs, bu as Gt, I as Kt, X as Sa, bv as Qt, bw as Jt, bx as Wt, E as Yt, by as ms, bz as Oe, f as Xt, bA as Pe, bB as As, bC as wa, bD as Zt, bE as en, bF as ts, bG as sn, bH as an, bI as tn, bJ as Ws, bK as ka, bL as nn, bM as ln, bN as rn, bO as on, bP as cn, bQ as dn, bR as un, bS as Me, bT as Q, bU as J, bV as Vs, bW as W, bX as hn, bY as za, bZ as mn, b_ as xn, b$ as pn, c0 as fn, c1 as gn, c2 as jn, c3 as bn, c4 as yn, c5 as vn } from "./index-ggRRMgwy.js";
1
+ import { c as R, u as vs, v as M, w as is, x as Se, y as e, z as Cs, A as Ns, H as O, o as Ss, J as ws, K as ks, M as zs, N as Os, O as H, Q as ie, R as ta, V as na, W as la, Y as ra, Z as st, _ as at, $ as tt, a0 as Gs, a1 as Y, a2 as Be, i as nt, a3 as u, a4 as lt, P as ia, F as oa, a5 as Ue, a6 as Ge, a7 as Ds, a8 as ca, a9 as Ms, aa as ue, ab as he, ac as me, ad as xe, ae as ve, af as pe, ag as Z, T as Is, ah as Fs, ai as Ts, aj as Ls, ak as da, al as ua, am as ce, an as rt, ao as it, ap as ha, aq as ot, C as ct, ar as dt, as as ma, B as ut, at as fe, au as ht, av as Ke, aw as xa, ax as gs, ay as be, az as ze, aA as Ce, aB as pa, aC as mt, aD as xt, aE as pt, aF as ft, l as gt, aG as jt, aH as bt, aI as De, aJ as ne, aK as fa, aL as yt, aM as os, aN as vt, aO as Ct, aP as js, a as Nt, aQ as ss, aR as ye, aS as as, aT as St, aU as wt, aV as kt, aW as zt, aX as fs, aY as Ot, aZ as Ks, a_ as Dt, a$ as Qs, b0 as Mt, b1 as It, b2 as Ft, b3 as Tt, b4 as ga, b5 as Lt, b6 as Es, b7 as ja, b8 as Et, b9 as Vt, ba as Ze, bb as At, bc as qt, bd as ba, be as Rt, s as _t, bf as Ht, bg as $t, r as Pt, bh as cs, bi as ya, bj as va, bk as Ca, bl as Xe, bm as Na, bn as es, bo as Js, bp as Bt, bq as Ut, br as ds, bs as us, bt as hs, bu as Gt, I as Kt, X as Sa, bv as Qt, bw as Jt, bx as Wt, E as Yt, by as ms, bz as Oe, f as Zt, bA as $e, bB as Vs, bC as wa, bD as Xt, bE as en, bF as ts, bG as sn, bH as an, bI as tn, bJ as Ws, bK as ka, bL as nn, bM as ln, bN as rn, bO as on, bP as cn, bQ as dn, bR as un, bS as Me, bT as Q, bU as J, bV as As, bW as W, bX as hn, bY as za, bZ as mn, b_ as xn, b$ as pn, c0 as fn, c1 as gn, c2 as jn, c3 as bn, c4 as yn, c5 as vn } from "./index-CpBdXQXJ.js";
2
2
  import * as Ys from "react";
3
- import Ne, { useState as q, useMemo as bs, useEffect as Z, useRef as ns, useCallback as Oa, Suspense as Cn } from "react";
3
+ import Ne, { useState as q, useMemo as bs, useEffect as X, useRef as ns, useCallback as Oa, Suspense as Cn } from "react";
4
4
  import "react-dom";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
@@ -157,7 +157,7 @@ const On = R("Database", [
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
159
  */
160
- const Ta = R("EllipsisVertical", [
160
+ const Fa = R("EllipsisVertical", [
161
161
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
162
162
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
163
163
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
@@ -211,7 +211,7 @@ const In = R("Glasses", [
211
211
  * This source code is licensed under the ISC license.
212
212
  * See the LICENSE file in the root directory of this source tree.
213
213
  */
214
- const Tn = R("Hammer", [
214
+ const Fn = R("Hammer", [
215
215
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
216
216
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
217
217
  [
@@ -228,7 +228,7 @@ const Tn = R("Hammer", [
228
228
  * This source code is licensed under the ISC license.
229
229
  * See the LICENSE file in the root directory of this source tree.
230
230
  */
231
- const Ln = R("Hash", [
231
+ const Tn = R("Hash", [
232
232
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
233
233
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
234
234
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -240,7 +240,7 @@ const Ln = R("Hash", [
240
240
  * This source code is licensed under the ISC license.
241
241
  * See the LICENSE file in the root directory of this source tree.
242
242
  */
243
- const Fn = R("House", [
243
+ const Ln = R("House", [
244
244
  ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
245
245
  [
246
246
  "path",
@@ -267,7 +267,7 @@ const En = R("Key", [
267
267
  * This source code is licensed under the ISC license.
268
268
  * See the LICENSE file in the root directory of this source tree.
269
269
  */
270
- const An = R("ListEnd", [
270
+ const Vn = R("ListEnd", [
271
271
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
272
272
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
273
273
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -280,7 +280,7 @@ const An = R("ListEnd", [
280
280
  * This source code is licensed under the ISC license.
281
281
  * See the LICENSE file in the root directory of this source tree.
282
282
  */
283
- const Vn = R("ListStart", [
283
+ const An = R("ListStart", [
284
284
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
285
285
  ["path", { d: "M16 18H3", key: "12xzn7" }],
286
286
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -306,7 +306,7 @@ const qn = R("ListX", [
306
306
  * This source code is licensed under the ISC license.
307
307
  * See the LICENSE file in the root directory of this source tree.
308
308
  */
309
- const Ve = R("LoaderCircle", [
309
+ const Ae = R("LoaderCircle", [
310
310
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
311
311
  ]);
312
312
  /**
@@ -315,7 +315,7 @@ const Ve = R("LoaderCircle", [
315
315
  * This source code is licensed under the ISC license.
316
316
  * See the LICENSE file in the root directory of this source tree.
317
317
  */
318
- const La = R("Map", [
318
+ const Ta = R("Map", [
319
319
  [
320
320
  "path",
321
321
  {
@@ -366,7 +366,7 @@ const Hn = R("Play", [
366
366
  * This source code is licensed under the ISC license.
367
367
  * See the LICENSE file in the root directory of this source tree.
368
368
  */
369
- const Pn = R("Plug2", [
369
+ const $n = R("Plug2", [
370
370
  ["path", { d: "M9 2v6", key: "17ngun" }],
371
371
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
372
372
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -379,7 +379,7 @@ const Pn = R("Plug2", [
379
379
  * This source code is licensed under the ISC license.
380
380
  * See the LICENSE file in the root directory of this source tree.
381
381
  */
382
- const $n = R("Save", [
382
+ const Pn = R("Save", [
383
383
  [
384
384
  "path",
385
385
  {
@@ -396,7 +396,7 @@ const $n = R("Save", [
396
396
  * This source code is licensed under the ISC license.
397
397
  * See the LICENSE file in the root directory of this source tree.
398
398
  */
399
- const Fa = R("Shapes", [
399
+ const La = R("Shapes", [
400
400
  [
401
401
  "path",
402
402
  {
@@ -516,7 +516,7 @@ function Ea(s) {
516
516
  var r;
517
517
  return {
518
518
  ...l,
519
- cards: (r = l.cards) == null ? void 0 : r.map((i) => Wn(i))
519
+ cards: (r = l.cards) == null ? void 0 : r.map((o) => Wn(o))
520
520
  };
521
521
  })
522
522
  };
@@ -557,7 +557,7 @@ function Yn(s) {
557
557
  }
558
558
  } : null;
559
559
  }
560
- async function Xn(s, n, a, t) {
560
+ async function Zn(s, n, a, t) {
561
561
  if (!t)
562
562
  return null;
563
563
  const l = JSON.stringify(n);
@@ -571,35 +571,35 @@ async function Xn(s, n, a, t) {
571
571
  async function ys(s, n) {
572
572
  if (!n)
573
573
  return null;
574
- const { id: a, template: t, filterValues: l, isDefault: r, shared: i } = s;
574
+ const { id: a, template: t, filterValues: l, isDefault: r, shared: o } = s;
575
575
  return await vs("https://semaphor.cloud/api/v1/lens", n, {
576
576
  lensId: a,
577
577
  template: t,
578
578
  filterValues: l,
579
579
  isDefault: r,
580
- shared: i,
580
+ shared: o,
581
581
  operation: "update"
582
582
  });
583
583
  }
584
- async function Zn(s, n) {
584
+ async function Xn(s, n) {
585
585
  return n ? await vs("https://semaphor.cloud/api/v1/lens", n, {
586
586
  operation: "delete",
587
587
  lensId: s
588
588
  }) : null;
589
589
  }
590
590
  function el() {
591
- const [s, n] = q(""), [a, t] = q(!1), l = M((p) => p.lenses), { setLenses: r, setSelectedLensId: i } = is(), [o, d] = q(!1), [x, c] = q(!1), b = M((p) => p.dashboard), g = M((p) => p.filterValues), { authToken: h } = Se();
591
+ const [s, n] = q(""), [a, t] = q(!1), l = M((p) => p.lenses), { setLenses: r, setSelectedLensId: o } = is(), [i, d] = q(!1), [x, c] = q(!1), b = M((p) => p.dashboard), g = M((p) => p.filterValues), { authToken: h } = Se();
592
592
  async function f() {
593
593
  d(!0);
594
594
  const p = Ea(
595
595
  b
596
- ), N = await Xn(
596
+ ), N = await Zn(
597
597
  s,
598
598
  p,
599
599
  g,
600
600
  h == null ? void 0 : h.accessToken
601
601
  );
602
- N && (r([...l || [], N]), i(N.id), c(!1)), d(!1);
602
+ N && (r([...l || [], N]), o(N.id), c(!1)), d(!1);
603
603
  }
604
604
  return /* @__PURE__ */ e.jsxs(Cs, { open: x, onOpenChange: c, children: [
605
605
  /* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
@@ -641,20 +641,20 @@ function el() {
641
641
  variant: "outline",
642
642
  type: "submit",
643
643
  onClick: f,
644
- disabled: o,
645
- children: o ? "Creating..." : "Add"
644
+ disabled: i,
645
+ children: i ? "Creating..." : "Add"
646
646
  }
647
647
  ) })
648
648
  ] })
649
649
  ] });
650
650
  }
651
651
  function sl() {
652
- const [s, n] = q(!1), a = M((c) => c.lenses), t = M((c) => c.selectedLensId), { setLenses: l, setSelectedLensId: r } = is(), { authToken: i } = Se();
653
- async function o(c) {
652
+ const [s, n] = q(!1), a = M((c) => c.lenses), t = M((c) => c.selectedLensId), { setLenses: l, setSelectedLensId: r } = is(), { authToken: o } = Se();
653
+ async function i(c) {
654
654
  r(c);
655
655
  }
656
656
  async function d(c) {
657
- if (await Zn(c, i == null ? void 0 : i.accessToken)) {
657
+ if (await Xn(c, o == null ? void 0 : o.accessToken)) {
658
658
  const g = a == null ? void 0 : a.filter((h) => h.id !== c);
659
659
  l(g || []), r("original");
660
660
  }
@@ -672,14 +672,14 @@ function sl() {
672
672
  ...c,
673
673
  isDefault: !c.isDefault
674
674
  };
675
- await ys(g, i == null ? void 0 : i.accessToken);
675
+ await ys(g, o == null ? void 0 : o.accessToken);
676
676
  const h = a == null ? void 0 : a.find((f) => f.isDefault);
677
677
  if (h && h.id !== c.id) {
678
678
  const f = {
679
679
  ...h,
680
680
  isDefault: !1
681
681
  };
682
- await ys(f, i == null ? void 0 : i.accessToken);
682
+ await ys(f, o == null ? void 0 : o.accessToken);
683
683
  }
684
684
  }
685
685
  return /* @__PURE__ */ e.jsxs(na, { open: s, onOpenChange: n, children: [
@@ -691,7 +691,7 @@ function sl() {
691
691
  tt,
692
692
  {
693
693
  value: t,
694
- onValueChange: o,
694
+ onValueChange: i,
695
695
  children: [
696
696
  /* @__PURE__ */ e.jsx(Gs, { value: "original", children: "Original" }),
697
697
  a == null ? void 0 : a.map((c) => /* @__PURE__ */ e.jsxs(
@@ -703,7 +703,7 @@ function sl() {
703
703
  /* @__PURE__ */ e.jsx("p", { children: c.name }),
704
704
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
705
705
  /* @__PURE__ */ e.jsx(
706
- Fn,
706
+ Ln,
707
707
  {
708
708
  onClick: (b) => {
709
709
  b.preventDefault(), x(c);
@@ -742,13 +742,13 @@ function sl() {
742
742
  function al({
743
743
  iconClassName: s
744
744
  }) {
745
- const [n, a] = q(!1), { authToken: t } = Se(), l = M((o) => o.theme), r = M((o) => o.filterValues);
746
- async function i() {
745
+ const [n, a] = q(!1), { authToken: t } = Se(), l = M((i) => i.theme), r = M((i) => i.filterValues);
746
+ async function o() {
747
747
  {
748
748
  a(!0);
749
- const o = new URLSearchParams();
750
- o.set("token", (t == null ? void 0 : t.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(r));
751
- const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, c = await (await fetch(d, {
749
+ const i = new URLSearchParams();
750
+ i.set("token", (t == null ? void 0 : t.accessToken) || ""), i.set("theme", l || "light"), i.set("filterValues", JSON.stringify(r));
751
+ const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(i.toString())}`, c = await (await fetch(d, {
752
752
  method: "GET",
753
753
  headers: {
754
754
  Authorization: `Bearer ${t == null ? void 0 : t.accessToken}`
@@ -763,8 +763,8 @@ function al({
763
763
  variant: "link",
764
764
  className: "group h-7 p-2",
765
765
  size: "sm",
766
- onClick: i,
767
- children: n ? /* @__PURE__ */ e.jsx(Ve, { className: Y("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
766
+ onClick: o,
767
+ children: n ? /* @__PURE__ */ e.jsx(Ae, { className: Y("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
768
768
  nt,
769
769
  {
770
770
  className: Y("size-3.5", s),
@@ -775,16 +775,15 @@ function al({
775
775
  );
776
776
  }
777
777
  function tl() {
778
- q(!1);
779
778
  const { authToken: s } = Se();
780
779
  M((j) => j.theme);
781
780
  const n = M((j) => j.lenses), a = M((j) => j.selectedLensId), t = n == null ? void 0 : n.find((j) => j.id === a), l = M((j) => j.dashboard);
782
781
  M((j) => j.selectedSheetId);
783
782
  const r = M(
784
783
  (j) => j.isDashboardEditing
785
- ), i = u(
784
+ ), o = u(
786
785
  (j) => j.selectedConnectionId
787
- ), [o, d] = q(!1), x = M((j) => j.filterValues), c = M((j) => j.isVisualEditing), b = M((j) => j.showFilters);
786
+ ), [i, d] = q(!1), x = M((j) => j.filterValues), c = M((j) => j.isVisualEditing), b = M((j) => j.showFilters);
788
787
  M(
789
788
  (j) => j.showDashboardJSON
790
789
  );
@@ -792,13 +791,13 @@ function tl() {
792
791
  (j) => j.actions.setShowFilters
793
792
  ), { addFrame: f, setSelectedFrameId: p } = M(
794
793
  (j) => j.actions
795
- ), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON: A } = M((j) => j.actions), I = N(), { tenantId: z, endUserId: T } = bs(
794
+ ), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON: V } = M((j) => j.actions), I = N(), { tenantId: z, endUserId: F } = bs(
796
795
  () => lt(s == null ? void 0 : s.accessToken),
797
796
  [s == null ? void 0 : s.accessToken]
798
- ), L = bs(() => z || T, [z, T]), V = () => {
797
+ ), T = bs(() => z || F, [z, F]), A = () => {
799
798
  if (!r || !I) return;
800
799
  const j = {
801
- connectionId: i,
800
+ connectionId: o,
802
801
  id: Ue(),
803
802
  title: "Title",
804
803
  description: "Description",
@@ -842,8 +841,8 @@ function tl() {
842
841
  !c && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: t == null ? void 0 : t.name }) }),
843
842
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
844
843
  /* @__PURE__ */ e.jsx(al, {}),
845
- r && !c && L && /* @__PURE__ */ e.jsx(el, {}),
846
- !c && L && /* @__PURE__ */ e.jsx(sl, {}),
844
+ r && !c && T && /* @__PURE__ */ e.jsx(el, {}),
845
+ !c && T && /* @__PURE__ */ e.jsx(sl, {}),
847
846
  r && !c && /* @__PURE__ */ e.jsxs(
848
847
  O,
849
848
  {
@@ -851,7 +850,7 @@ function tl() {
851
850
  className: "h-7 p-2",
852
851
  size: "sm",
853
852
  disabled: !r,
854
- onClick: V,
853
+ onClick: A,
855
854
  children: [
856
855
  /* @__PURE__ */ e.jsx(Ss, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
857
856
  "Frame"
@@ -875,21 +874,21 @@ function tl() {
875
874
  role: "close",
876
875
  className: "h-7 p-2",
877
876
  onClick: () => {
878
- y(!1), A(!1);
877
+ y(!1), V(!1);
879
878
  },
880
879
  size: "sm",
881
880
  children: /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4", strokeWidth: 1.5 })
882
881
  }
883
882
  ),
884
- r && !c && L && /* @__PURE__ */ e.jsx(
883
+ r && !c && T && /* @__PURE__ */ e.jsx(
885
884
  O,
886
885
  {
887
886
  className: "h-7 p-2",
888
887
  variant: "ghost",
889
- disabled: o,
888
+ disabled: i,
890
889
  onClick: v,
891
890
  size: "sm",
892
- children: /* @__PURE__ */ e.jsx($n, { className: "h-4 w-4", strokeWidth: 1.5 })
891
+ children: /* @__PURE__ */ e.jsx(Pn, { className: "h-4 w-4", strokeWidth: 1.5 })
893
892
  }
894
893
  ),
895
894
  !b && !c && r && /* @__PURE__ */ e.jsx(
@@ -916,8 +915,8 @@ function He({
916
915
  isLoading: t,
917
916
  isError: l,
918
917
  connectionTooltip: r,
919
- onChange: i,
920
- showNone: o = !1,
918
+ onChange: o,
919
+ showNone: i = !1,
921
920
  className: d,
922
921
  showIcon: x = !0,
923
922
  disabled: c = !1
@@ -925,7 +924,7 @@ function He({
925
924
  const b = t ? "Loading..." : l ? "Error" : a;
926
925
  function g() {
927
926
  if (s === "Connection")
928
- return /* @__PURE__ */ e.jsx(Pn, { className: "size-4 rotate-90" });
927
+ return /* @__PURE__ */ e.jsx($n, { className: "size-4 rotate-90" });
929
928
  if (s === "Database")
930
929
  return /* @__PURE__ */ e.jsx(On, { className: "size-4" });
931
930
  if (s === "Schema")
@@ -940,7 +939,7 @@ function He({
940
939
  /* @__PURE__ */ e.jsx(ca, { children: g() }),
941
940
  /* @__PURE__ */ e.jsx(Ms, { className: "text-xs", align: "start", children: r })
942
941
  ] }) : g() }),
943
- /* @__PURE__ */ e.jsxs(ue, { disabled: c, value: b, onValueChange: i, children: [
942
+ /* @__PURE__ */ e.jsxs(ue, { disabled: c, value: b, onValueChange: o, children: [
944
943
  /* @__PURE__ */ e.jsx(
945
944
  he,
946
945
  {
@@ -959,10 +958,10 @@ function He({
959
958
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
960
959
  t ? /* @__PURE__ */ e.jsx(pe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(pe, { children: s }),
961
960
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
962
- o && /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
963
- n && n.map((h, f) => /* @__PURE__ */ e.jsx(X, { value: h.id, children: h.name }, f))
961
+ i && /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
962
+ n && n.map((h, f) => /* @__PURE__ */ e.jsx(Z, { value: h.id, children: h.name }, f))
964
963
  ] }),
965
- (t || l) && /* @__PURE__ */ e.jsx(X, { value: b, children: b })
964
+ (t || l) && /* @__PURE__ */ e.jsx(Z, { value: b, children: b })
966
965
  ] }) })
967
966
  ] })
968
967
  ] });
@@ -972,12 +971,12 @@ function nl({ column: s }) {
972
971
  (h) => h.selectedSchemaName
973
972
  ), r = u(
974
973
  (h) => h.selectedDatamodelId
975
- ), i = u((h) => h.sqlGen), { modelItems: o } = qe(), d = u((h) => h.actions.setSqlGen), x = u((h) => h.actions.setCardSql), c = u((h) => h.actions.setRunSql);
974
+ ), o = u((h) => h.sqlGen), { modelItems: i } = qe(), d = u((h) => h.actions.setSqlGen), x = u((h) => h.actions.setCardSql), c = u((h) => h.actions.setRunSql);
976
975
  function b(h, f) {
977
- var A;
978
- const p = da(h, i, f), N = (A = o == null ? void 0 : o.find(
976
+ var V;
977
+ const p = da(h, o, f), N = (V = i == null ? void 0 : i.find(
979
978
  (I) => I.id === r
980
- )) == null ? void 0 : A.name;
979
+ )) == null ? void 0 : V.name;
981
980
  d(p);
982
981
  const y = ua(
983
982
  p,
@@ -1031,10 +1030,10 @@ function nl({ column: s }) {
1031
1030
  )
1032
1031
  ] });
1033
1032
  }
1034
- return /* @__PURE__ */ e.jsxs(Ts, { openDelay: 0, open: n, onOpenChange: a, children: [
1035
- /* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ta, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1033
+ return /* @__PURE__ */ e.jsxs(Fs, { openDelay: 0, open: n, onOpenChange: a, children: [
1034
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1036
1035
  /* @__PURE__ */ e.jsx(
1037
- Fs,
1036
+ Ls,
1038
1037
  {
1039
1038
  align: "center",
1040
1039
  className: "w-20 rounded-md p-0 shadow-none",
@@ -1043,15 +1042,9 @@ function nl({ column: s }) {
1043
1042
  )
1044
1043
  ] });
1045
1044
  }
1046
- function Aa({ column: s }) {
1045
+ function Va({ column: s }) {
1047
1046
  return /* @__PURE__ */ e.jsxs(Ds, { children: [
1048
- /* @__PURE__ */ e.jsx(rt, { asChild: !0, children: it.includes(s.data_type.toLowerCase()) ? (
1049
- // <span className=" font-thin">T</span>
1050
- /* @__PURE__ */ e.jsx(_s, { className: "size-3" })
1051
- ) : ha.includes(s.data_type.toLowerCase()) ? (
1052
- //
1053
- /* @__PURE__ */ e.jsx(Ln, { className: "size-3" })
1054
- ) : ot.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(ct, { className: "size-3" }) : dt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Qn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(Sn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Bn, { className: "size-3" }) }),
1047
+ /* @__PURE__ */ e.jsx(rt, { asChild: !0, children: it(s.data_type) ? /* @__PURE__ */ e.jsx(_s, { className: "size-3" }) : ha(s.data_type) ? /* @__PURE__ */ e.jsx(Tn, { className: "size-3" }) : ot(s.data_type) ? /* @__PURE__ */ e.jsx(ct, { className: "size-3" }) : dt(s.data_type) ? /* @__PURE__ */ e.jsx(Qn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(Sn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Bn, { className: "size-3" }) }),
1055
1048
  /* @__PURE__ */ e.jsx(Ms, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1056
1049
  ] });
1057
1050
  }
@@ -1063,9 +1056,9 @@ function ll({
1063
1056
  }) {
1064
1057
  const l = u((m) => m.sqlGen), r = u(
1065
1058
  (m) => m.selectedConnectionId
1066
- ), i = u(
1067
- (m) => m.selectedDatabaseName
1068
1059
  ), o = u(
1060
+ (m) => m.selectedDatabaseName
1061
+ ), i = u(
1069
1062
  (m) => m.selectedSchemaName
1070
1063
  ), d = u((m) => m.selectedTableName), x = u(
1071
1064
  (m) => m.selectedDatamodelId
@@ -1074,7 +1067,7 @@ function ll({
1074
1067
  ), { setAIScopeTables: b } = M((m) => m.actions), g = u((m) => m.actions.setRunSql), h = u((m) => m.actions.setSqlGen), f = u(
1075
1068
  (m) => m.actions.setIsShowingVisual
1076
1069
  ), p = u((m) => m.actions.setCardSql), { connectionType: N, modelItems: y } = qe();
1077
- function A(m) {
1070
+ function V(m) {
1078
1071
  var S;
1079
1072
  const v = da(m, l);
1080
1073
  h(v);
@@ -1093,11 +1086,11 @@ function ll({
1093
1086
  const v = {
1094
1087
  connectinonId: r,
1095
1088
  connectionType: N,
1096
- databaseName: i,
1097
- schemaName: o,
1089
+ databaseName: o,
1090
+ schemaName: i,
1098
1091
  tableName: d
1099
1092
  }, D = [...c || [], v].filter(
1100
- (S, _, $) => $.findIndex(
1093
+ (S, _, P) => P.findIndex(
1101
1094
  (K) => K.connectinonId === S.connectinonId && K.tableName === S.tableName
1102
1095
  ) === _
1103
1096
  );
@@ -1117,7 +1110,7 @@ function ll({
1117
1110
  });
1118
1111
  }
1119
1112
  }
1120
- function T() {
1113
+ function F() {
1121
1114
  var S;
1122
1115
  let m = xa(s, n);
1123
1116
  const v = (S = y == null ? void 0 : y.find(
@@ -1125,16 +1118,16 @@ function ll({
1125
1118
  )) == null ? void 0 : S.name;
1126
1119
  x && x !== "none" && (m = `${gs}.${v}`);
1127
1120
  let j = m;
1128
- return ((_) => /[A-Z]/.test(_))(n) && (j = j.split(".").map(($) => `"${$}"`).join(".")), j;
1121
+ return ((_) => /[A-Z]/.test(_))(n) && (j = j.split(".").map((P) => `"${P}"`).join(".")), j;
1129
1122
  }
1130
- function L() {
1131
- const m = T();
1123
+ function T() {
1124
+ const m = F();
1132
1125
  f(!1);
1133
1126
  const v = N === "MSSQL" ? `SELECT top 10 * FROM ${m}` : `SELECT * FROM ${m} LIMIT 10`;
1134
1127
  p(v), g(!0);
1135
1128
  }
1136
- function V() {
1137
- const m = T();
1129
+ function A() {
1130
+ const m = F();
1138
1131
  p(`SELECT COUNT(*) as count FROM ${m}`), g(!0);
1139
1132
  }
1140
1133
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
@@ -1162,12 +1155,12 @@ function ll({
1162
1155
  O,
1163
1156
  {
1164
1157
  disabled: t !== "Success",
1165
- onClick: L,
1158
+ onClick: T,
1166
1159
  size: "sm",
1167
1160
  variant: "secondary",
1168
1161
  className: "flex",
1169
1162
  children: [
1170
- t !== "Success" ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
1163
+ t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
1171
1164
  "Top 10"
1172
1165
  ]
1173
1166
  }
@@ -1176,12 +1169,12 @@ function ll({
1176
1169
  O,
1177
1170
  {
1178
1171
  disabled: t !== "Success",
1179
- onClick: V,
1172
+ onClick: A,
1180
1173
  size: "sm",
1181
1174
  variant: "secondary",
1182
1175
  className: "flex",
1183
1176
  children: [
1184
- t !== "Success" ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Un, { className: "mr-2 size-4" }),
1177
+ t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Un, { className: "mr-2 size-4" }),
1185
1178
  "Count"
1186
1179
  ]
1187
1180
  }
@@ -1195,7 +1188,7 @@ function ll({
1195
1188
  a == null ? void 0 : a.map((m) => /* @__PURE__ */ e.jsxs(
1196
1189
  "div",
1197
1190
  {
1198
- onClick: () => A(m),
1191
+ onClick: () => V(m),
1199
1192
  className: Y(
1200
1193
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
1201
1194
  {
@@ -1204,7 +1197,7 @@ function ll({
1204
1197
  ),
1205
1198
  children: [
1206
1199
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1207
- /* @__PURE__ */ e.jsx(Aa, { column: m }),
1200
+ /* @__PURE__ */ e.jsx(Va, { column: m }),
1208
1201
  /* @__PURE__ */ e.jsx("span", { children: m.column_name })
1209
1202
  ] }),
1210
1203
  /* @__PURE__ */ e.jsx(
@@ -1212,7 +1205,7 @@ function ll({
1212
1205
  {
1213
1206
  onClick: (v) => v.stopPropagation(),
1214
1207
  className: "flex items-center justify-end",
1215
- children: ha.includes(m.data_type) && /* @__PURE__ */ e.jsx(nl, { column: m })
1208
+ children: ha(m.data_type) && /* @__PURE__ */ e.jsx(nl, { column: m })
1216
1209
  }
1217
1210
  )
1218
1211
  ]
@@ -1227,15 +1220,15 @@ function ll({
1227
1220
  ] });
1228
1221
  }
1229
1222
  function qe(s, n) {
1230
- var Je, Ps, $s, Bs, Us;
1223
+ var Je, $s, Ps, Bs, Us;
1231
1224
  let a = bs(() => [], []);
1232
1225
  const t = Se().authToken || s, l = u(
1233
1226
  (C) => C.selectedConnectionId
1234
1227
  ), r = u(
1235
1228
  (C) => C.selectedDatamodelId
1236
- ), i = u(
1237
- (C) => C.selectedDatabaseName
1238
1229
  ), o = u(
1230
+ (C) => C.selectedDatabaseName
1231
+ ), i = u(
1239
1232
  (C) => C.selectedSchemaName
1240
1233
  ), d = u((C) => C.selectedTableName), x = u(
1241
1234
  (C) => C.actions.setCurrentColumns
@@ -1251,18 +1244,18 @@ function qe(s, n) {
1251
1244
  (C) => C.actions.setSelectedTableName
1252
1245
  ), p = u((C) => C.actions.setCardSql);
1253
1246
  function N(C) {
1254
- return l && i && o && i !== "NA" ? !0 : l && C === "API" ? !1 : !!(l && C === "S3");
1247
+ return l && o && i && o !== "NA" ? !0 : l && C === "API" ? !1 : !!(l && C === "S3");
1255
1248
  }
1256
1249
  function y(C) {
1257
- return !!(l && i && i !== "NA" && o && d || l && (C === "S3" || C === "API") || r && r);
1250
+ return !!(l && o && o !== "NA" && i && d || l && (C === "S3" || C === "API") || r && r);
1258
1251
  }
1259
- function A(C) {
1252
+ function V(C) {
1260
1253
  return l && C ? !(C === "API" || C === "S3") : !1;
1261
1254
  }
1262
1255
  const {
1263
1256
  data: I,
1264
1257
  isLoading: z,
1265
- isError: T
1258
+ isError: F
1266
1259
  } = be({
1267
1260
  queryKey: ["connections"],
1268
1261
  queryFn: () => ze(
@@ -1272,8 +1265,8 @@ function qe(s, n) {
1272
1265
  enabled: !!(t != null && t.accessToken)
1273
1266
  // Only fetch if authToken is present
1274
1267
  }), {
1275
- data: L,
1276
- isLoading: V,
1268
+ data: T,
1269
+ isLoading: A,
1277
1270
  isError: m
1278
1271
  } = be({
1279
1272
  queryKey: ["models", l],
@@ -1291,7 +1284,7 @@ function qe(s, n) {
1291
1284
  ), j = v == null ? void 0 : v.type, D = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
1292
1285
  data: S,
1293
1286
  isLoading: _,
1294
- isFetching: $,
1287
+ isFetching: P,
1295
1288
  isError: K,
1296
1289
  refetch: ee
1297
1290
  } = be({
@@ -1303,29 +1296,29 @@ function qe(s, n) {
1303
1296
  connection_id: l
1304
1297
  }
1305
1298
  ),
1306
- enabled: A(j)
1299
+ enabled: V(j)
1307
1300
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1308
1301
  }), {
1309
1302
  data: G,
1310
1303
  isLoading: se,
1311
1304
  isFetching: k,
1312
- isError: P,
1305
+ isError: $,
1313
1306
  refetch: U
1314
1307
  } = be({
1315
- queryKey: ["schemas", l, i],
1308
+ queryKey: ["schemas", l, o],
1316
1309
  queryFn: () => ze(
1317
1310
  "https://semaphor.cloud/api/v1/schemas",
1318
1311
  (t == null ? void 0 : t.accessToken) || "",
1319
1312
  {
1320
1313
  connection_id: l,
1321
- database_name: i
1314
+ database_name: o
1322
1315
  }
1323
1316
  ),
1324
- enabled: !!l && !!i && !D && i !== "NA"
1317
+ enabled: !!l && !!o && !D && o !== "NA"
1325
1318
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1326
1319
  }), {
1327
1320
  data: E,
1328
- isLoading: F,
1321
+ isLoading: L,
1329
1322
  isFetching: re,
1330
1323
  isError: B,
1331
1324
  refetch: ae
@@ -1333,31 +1326,31 @@ function qe(s, n) {
1333
1326
  queryKey: [
1334
1327
  "tables",
1335
1328
  l,
1336
- i,
1337
- o
1329
+ o,
1330
+ i
1338
1331
  ],
1339
1332
  queryFn: () => ze(
1340
1333
  "https://semaphor.cloud/api/v1/tables",
1341
1334
  (t == null ? void 0 : t.accessToken) || "",
1342
1335
  {
1343
1336
  connection_id: l,
1344
- database_name: i,
1345
- schema_name: o
1337
+ database_name: o,
1338
+ schema_name: i
1346
1339
  }
1347
1340
  ),
1348
1341
  enabled: N(j)
1349
1342
  }), {
1350
1343
  data: te,
1351
1344
  isLoading: je,
1352
- isFetching: Te,
1345
+ isFetching: Fe,
1353
1346
  isError: we
1354
1347
  } = be({
1355
1348
  queryKey: [
1356
1349
  "columns",
1357
1350
  l,
1358
- i,
1359
- r,
1360
1351
  o,
1352
+ r,
1353
+ i,
1361
1354
  d
1362
1355
  ],
1363
1356
  queryFn: () => ze(
@@ -1367,8 +1360,8 @@ function qe(s, n) {
1367
1360
  connection_id: l,
1368
1361
  datamodel_id: r || "",
1369
1362
  // don't pass undefined. Pass empty string
1370
- database_name: i,
1371
- schema_name: o,
1363
+ database_name: o,
1364
+ schema_name: i,
1372
1365
  table_name: d
1373
1366
  }
1374
1367
  ),
@@ -1381,9 +1374,9 @@ function qe(s, n) {
1381
1374
  //currentConnection?.type === 'API',
1382
1375
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1383
1376
  });
1384
- Z(() => {
1377
+ X(() => {
1385
1378
  x(a);
1386
- }, [te, x, a]), Z(() => {
1379
+ }, [te, x, a]), X(() => {
1387
1380
  }, [
1388
1381
  D,
1389
1382
  p,
@@ -1392,11 +1385,11 @@ function qe(s, n) {
1392
1385
  g,
1393
1386
  v
1394
1387
  ]);
1395
- const Le = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() : d || "", Fe = D ? "" : o || "";
1388
+ const Te = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() : d || "", Le = D ? "" : i || "";
1396
1389
  function Ee(C) {
1397
1390
  h(C), f("");
1398
1391
  }
1399
- function Ae(C) {
1392
+ function Ve(C) {
1400
1393
  g(C === "none" ? "" : C), h(""), f(""), C !== "none" && C !== "" && b("");
1401
1394
  }
1402
1395
  function w(C) {
@@ -1405,17 +1398,17 @@ function qe(s, n) {
1405
1398
  function le(C) {
1406
1399
  b(C === "none" ? "" : C), C !== "none" && C !== "" && g("");
1407
1400
  }
1408
- S && ((Ps = S == null ? void 0 : S.databases) == null ? void 0 : Ps.length) > 0, G && (($s = G == null ? void 0 : G.schemas) == null ? void 0 : $s.length) > 0, te && ((Bs = te == null ? void 0 : te.columns) == null ? void 0 : Bs.length) > 0 && (a = te.columns.map((C) => ({
1401
+ S && (($s = S == null ? void 0 : S.databases) == null ? void 0 : $s.length) > 0, G && ((Ps = G == null ? void 0 : G.schemas) == null ? void 0 : Ps.length) > 0, te && ((Bs = te == null ? void 0 : te.columns) == null ? void 0 : Bs.length) > 0 && (a = te.columns.map((C) => ({
1409
1402
  ...C,
1410
1403
  data_type: C.data_type.toLowerCase()
1411
- }))), K && (a = []), (we || T) && (a = []);
1404
+ }))), K && (a = []), (we || F) && (a = []);
1412
1405
  const ke = I == null ? void 0 : I.connections.map(
1413
1406
  (C) => ({
1414
1407
  id: C.id,
1415
1408
  name: C.name,
1416
1409
  type: C.type
1417
1410
  })
1418
- ), oe = (Us = L == null ? void 0 : L.datamodels) == null ? void 0 : Us.map((C) => ({
1411
+ ), oe = (Us = T == null ? void 0 : T.datamodels) == null ? void 0 : Us.map((C) => ({
1419
1412
  id: C.id,
1420
1413
  name: C.name
1421
1414
  })), _e = S == null ? void 0 : S.databases.map((C) => ({
@@ -1431,33 +1424,33 @@ function qe(s, n) {
1431
1424
  return {
1432
1425
  connectionItems: ke,
1433
1426
  isConnectionsLoading: z,
1434
- isConnectionsError: T,
1427
+ isConnectionsError: F,
1435
1428
  modelItems: oe,
1436
- isModelsLoading: V,
1429
+ isModelsLoading: A,
1437
1430
  isModelsError: m,
1438
1431
  databaseItems: _e,
1439
- isDatabasesLoadingOrFetching: _ || $,
1432
+ isDatabasesLoadingOrFetching: _ || P,
1440
1433
  isDatabaseError: K,
1441
1434
  schemaItems: ps,
1442
1435
  isSchemaLoadingOrFetching: se || k,
1443
- isSchemaError: P,
1436
+ isSchemaError: $,
1444
1437
  tableItems: Qe,
1445
- isTableLoadingOrFetching: F || re,
1438
+ isTableLoadingOrFetching: L || re,
1446
1439
  isTableError: B,
1447
1440
  columns: a,
1448
- isColumnsLoadingOrFetching: je || Te,
1441
+ isColumnsLoadingOrFetching: je || Fe,
1449
1442
  isColumnsError: we,
1450
1443
  isNonDbConnection: D,
1451
1444
  connectionType: j,
1452
- tableName: Le,
1453
- schemaName: Fe,
1445
+ tableName: Te,
1446
+ schemaName: Le,
1454
1447
  handleConnectionChange: w,
1455
1448
  handleDatamodelChange: le,
1456
- handleDatabaseChange: Ae,
1449
+ handleDatabaseChange: Ve,
1457
1450
  handleSchemaChange: Ee
1458
1451
  };
1459
1452
  }
1460
- function Va({
1453
+ function Aa({
1461
1454
  ColumnsComponent: s
1462
1455
  }) {
1463
1456
  var re;
@@ -1469,10 +1462,10 @@ function Va({
1469
1462
  (B) => B.selectedDatabaseName
1470
1463
  ), l = u(
1471
1464
  (B) => B.selectedSchemaName
1472
- ), r = u((B) => B.selectedTableName), i = u(
1465
+ ), r = u((B) => B.selectedTableName), o = u(
1473
1466
  (B) => B.actions.setSelectedTableName
1474
1467
  ), {
1475
- connectionItems: o,
1468
+ connectionItems: i,
1476
1469
  modelItems: d,
1477
1470
  schemaItems: x,
1478
1471
  databaseItems: c,
@@ -1483,19 +1476,19 @@ function Va({
1483
1476
  isConnectionsError: p,
1484
1477
  isModelsError: N,
1485
1478
  isDatabasesLoadingOrFetching: y,
1486
- isDatabaseError: A,
1479
+ isDatabaseError: V,
1487
1480
  isSchemaLoadingOrFetching: I,
1488
1481
  isSchemaError: z,
1489
- isColumnsError: T,
1490
- isColumnsLoadingOrFetching: L,
1491
- isTableLoadingOrFetching: V,
1482
+ isColumnsError: F,
1483
+ isColumnsLoadingOrFetching: T,
1484
+ isTableLoadingOrFetching: A,
1492
1485
  isTableError: m,
1493
1486
  connectionType: v,
1494
1487
  isNonDbConnection: j,
1495
1488
  handleConnectionChange: D,
1496
1489
  handleDatabaseChange: S,
1497
1490
  handleSchemaChange: _,
1498
- handleDatamodelChange: $,
1491
+ handleDatamodelChange: P,
1499
1492
  tableName: K,
1500
1493
  schemaName: ee
1501
1494
  } = qe();
@@ -1506,7 +1499,7 @@ function Va({
1506
1499
  schemaName: ee,
1507
1500
  tableName: K,
1508
1501
  columns: g,
1509
- status: L ? "Loading..." : T ? "Error" : "Success"
1502
+ status: T ? "Loading..." : F ? "Error" : "Success"
1510
1503
  }
1511
1504
  );
1512
1505
  }
@@ -1521,7 +1514,7 @@ function Va({
1521
1514
  {
1522
1515
  showNone: !0,
1523
1516
  onChange: S,
1524
- isError: A,
1517
+ isError: V,
1525
1518
  isLoading: y,
1526
1519
  items: c,
1527
1520
  value: t || "",
@@ -1529,7 +1522,7 @@ function Va({
1529
1522
  }
1530
1523
  );
1531
1524
  }
1532
- function P() {
1525
+ function $() {
1533
1526
  if (n && !j && (!t || t === "none") && (!a || a === "none"))
1534
1527
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1535
1528
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ce, {}) }),
@@ -1544,7 +1537,7 @@ function Va({
1544
1537
  He,
1545
1538
  {
1546
1539
  showNone: !0,
1547
- onChange: $,
1540
+ onChange: P,
1548
1541
  isError: N,
1549
1542
  isLoading: f,
1550
1543
  items: d,
@@ -1566,7 +1559,7 @@ function Va({
1566
1559
  }
1567
1560
  );
1568
1561
  }
1569
- function F() {
1562
+ function L() {
1570
1563
  function B() {
1571
1564
  let ae = !1;
1572
1565
  return v === "API" ? (ae = !1, ae) : ((v === "S3" || n && t && t !== "none" && l) && (ae = !0), ae);
@@ -1574,10 +1567,10 @@ function Va({
1574
1567
  return B() ? /* @__PURE__ */ e.jsx(
1575
1568
  He,
1576
1569
  {
1577
- onChange: i,
1570
+ onChange: o,
1578
1571
  isError: m,
1579
1572
  items: b,
1580
- isLoading: V,
1573
+ isLoading: A,
1581
1574
  value: r || "",
1582
1575
  title: "Table"
1583
1576
  }
@@ -1588,22 +1581,22 @@ function Va({
1588
1581
  /* @__PURE__ */ e.jsx(
1589
1582
  He,
1590
1583
  {
1591
- items: o,
1584
+ items: i,
1592
1585
  title: "Connection",
1593
1586
  value: n || "",
1594
1587
  onChange: D,
1595
1588
  isLoading: h,
1596
1589
  isError: p,
1597
- connectionTooltip: ((re = o == null ? void 0 : o.find(
1590
+ connectionTooltip: ((re = i == null ? void 0 : i.find(
1598
1591
  (B) => B.id === n
1599
1592
  )) == null ? void 0 : re.type) || ""
1600
1593
  }
1601
1594
  ),
1602
1595
  U(),
1603
- P(),
1596
+ $(),
1604
1597
  k(),
1605
1598
  E(),
1606
- F()
1599
+ L()
1607
1600
  ] }),
1608
1601
  G(),
1609
1602
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
@@ -1625,16 +1618,16 @@ function rl(s) {
1625
1618
  const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1626
1619
  let r = s.length;
1627
1620
  if (l !== -1 && (r = l), t !== -1 && t < r && (r = t), n !== -1) {
1628
- const i = s.substring(0, n), o = s.substring(n);
1629
- return `${i} {{ filters | where }} AND ${o.substring(
1621
+ const o = s.substring(0, n), i = s.substring(n);
1622
+ return `${o} {{ filters | where }} AND ${i.substring(
1630
1623
  6
1631
1624
  )}`;
1632
1625
  } else if (a !== -1) {
1633
- const i = s.substring(0, a), o = s.substring(a);
1634
- return `${i} {{ filters | where }} ${o}`;
1626
+ const o = s.substring(0, a), i = s.substring(a);
1627
+ return `${o} {{ filters | where }} ${i}`;
1635
1628
  } else {
1636
- const i = s.substring(0, r), o = s.substring(r);
1637
- return `${i} {{ filters | where }} ${o}`;
1629
+ const o = s.substring(0, r), i = s.substring(r);
1630
+ return `${o} {{ filters | where }} ${i}`;
1638
1631
  }
1639
1632
  }
1640
1633
  function il({
@@ -1643,10 +1636,10 @@ function il({
1643
1636
  setUserInputforAI: a,
1644
1637
  setTriggerAIRun: t
1645
1638
  }) {
1646
- return /* @__PURE__ */ e.jsxs(Ts, { openDelay: 0, children: [
1647
- /* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
1639
+ return /* @__PURE__ */ e.jsxs(Fs, { openDelay: 0, children: [
1640
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
1648
1641
  /* @__PURE__ */ e.jsx(
1649
- Fs,
1642
+ Ls,
1650
1643
  {
1651
1644
  align: "start",
1652
1645
  className: "w-full min-w-fit max-w-[700px]",
@@ -1661,7 +1654,7 @@ function il({
1661
1654
  size: "sm",
1662
1655
  variant: "outline",
1663
1656
  children: [
1664
- /* @__PURE__ */ e.jsx(Tn, { className: "mr-2 h-4 w-4" }),
1657
+ /* @__PURE__ */ e.jsx(Fn, { className: "mr-2 h-4 w-4" }),
1665
1658
  "Debug with AI"
1666
1659
  ]
1667
1660
  }
@@ -1726,21 +1719,21 @@ function cl({
1726
1719
  triggerAIRun: l,
1727
1720
  setTriggerAIRun: r
1728
1721
  }) {
1729
- const i = ns(null), o = ns(null), { authToken: d } = Se(), [x, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns), A = u((k) => k.card.sql), I = u((k) => k.selectedTableName), z = `
1722
+ const o = ns(null), i = ns(null), { authToken: d } = Se(), [x, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns), V = u((k) => k.card.sql), I = u((k) => k.selectedTableName), z = `
1730
1723
  ${a}
1731
1724
 
1732
1725
  Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
1733
1726
  Table Name: ${I}
1734
1727
  Table Columns: ${y == null ? void 0 : y.map((k) => `${k.column_name} | ${k.data_type}`).join(", ")}
1735
- User SQL: ${A}
1736
- ${g && `Base Queries: ${JSON.stringify(g)} `}`, T = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1737
- Visual Query Syntax: ${ol}`, { data: L, isLoading: V, isFetching: m, isError: v, refetch: j } = be({
1728
+ User SQL: ${V}
1729
+ ${g && `Base Queries: ${JSON.stringify(g)} `}`, F = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1730
+ Visual Query Syntax: ${ol}`, { data: T, isLoading: A, isFetching: m, isError: v, refetch: j } = be({
1738
1731
  queryKey: ["ai-query"],
1739
1732
  queryFn: () => ze(
1740
1733
  "https://semaphor.cloud/api/v1/ai",
1741
1734
  (d == null ? void 0 : d.accessToken) || "",
1742
1735
  {
1743
- user_content: `userContent: ${z} ${x ? T : ""}`
1736
+ user_content: `userContent: ${z} ${x ? F : ""}`
1744
1737
  }
1745
1738
  ),
1746
1739
  enabled: !1
@@ -1767,22 +1760,22 @@ function cl({
1767
1760
  return f("bar"), !1;
1768
1761
  return !0;
1769
1762
  }
1770
- Z(() => {
1771
- L && N((k) => [...k, { role: "ai", content: L.response }]);
1772
- }, [L]), Z(() => {
1763
+ X(() => {
1764
+ T && N((k) => [...k, { role: "ai", content: T.response }]);
1765
+ }, [T]), X(() => {
1773
1766
  const k = setTimeout(() => {
1774
- var P;
1775
- o.current && (o.current.scroll({
1776
- top: o.current.scrollHeight,
1767
+ var $;
1768
+ i.current && (i.current.scroll({
1769
+ top: i.current.scrollHeight,
1777
1770
  behavior: "smooth"
1778
- }), (P = i.current) == null || P.focus());
1771
+ }), ($ = o.current) == null || $.focus());
1779
1772
  }, 100);
1780
1773
  return () => clearTimeout(k);
1781
1774
  }, [p]);
1782
1775
  function S() {
1783
1776
  a && (N((k) => [...k, { role: "user", content: a }]), D(a) && c(!0), t(""), j());
1784
1777
  }
1785
- Z(() => {
1778
+ X(() => {
1786
1779
  l && (S(), r(!1));
1787
1780
  }, [l, r]);
1788
1781
  const _ = {
@@ -1793,7 +1786,7 @@ function cl({
1793
1786
  fontSize: 15,
1794
1787
  // padding: '5px',
1795
1788
  width: "100%"
1796
- }, $ = {
1789
+ }, P = {
1797
1790
  // background: '#f6f8fa',
1798
1791
  // color: '#000',
1799
1792
  fontFamily: "monospace",
@@ -1812,10 +1805,10 @@ function cl({
1812
1805
  listStyleType: "disc"
1813
1806
  }, ee = {
1814
1807
  // Override how paragraphs are rendered
1815
- p: ({ node: k, ...P }) => /* @__PURE__ */ e.jsx("p", { style: _, ...P }),
1816
- code: ({ node: k, ...P }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...P }),
1817
- pre: ({ node: k, ...P }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: $, children: [
1818
- /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: P.children }),
1808
+ p: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsx("p", { style: _, ...$ }),
1809
+ code: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...$ }),
1810
+ pre: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
1811
+ /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: $.children }),
1819
1812
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1820
1813
  /* @__PURE__ */ e.jsx(O, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(pt, {}) }),
1821
1814
  /* @__PURE__ */ e.jsx(
@@ -1832,17 +1825,17 @@ function cl({
1832
1825
  )
1833
1826
  ] })
1834
1827
  ] }),
1835
- li: ({ node: k, ...P }) => /* @__PURE__ */ e.jsx("li", { style: K, ...P })
1828
+ li: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsx("li", { style: K, ...$ })
1836
1829
  // You can add more overrides for other elements like h1, h2, etc.
1837
1830
  };
1838
1831
  function G(k) {
1839
- const P = k.currentTarget.closest("pre");
1840
- if (!P) return;
1841
- const U = P.textContent || P.innerText;
1832
+ const $ = k.currentTarget.closest("pre");
1833
+ if (!$) return;
1834
+ const U = $.textContent || $.innerText;
1842
1835
  return navigator.clipboard.writeText(U).then(() => console.log("Text copied to clipboard")).catch((E) => console.error("Error in copying text: ", E)), U;
1843
1836
  }
1844
1837
  function se() {
1845
- return p == null ? void 0 : p.map((k, P) => k.role === "user" ? /* @__PURE__ */ e.jsxs(
1838
+ return p == null ? void 0 : p.map((k, $) => k.role === "user" ? /* @__PURE__ */ e.jsxs(
1846
1839
  "div",
1847
1840
  {
1848
1841
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
@@ -1851,16 +1844,16 @@ function cl({
1851
1844
  /* @__PURE__ */ e.jsx("div", { children: k.content })
1852
1845
  ]
1853
1846
  },
1854
- P
1847
+ $
1855
1848
  ) : k.role === "ai" ? /* @__PURE__ */ e.jsx(
1856
1849
  xt,
1857
1850
  {
1858
1851
  className: "w-full overflow-auto py-1",
1859
1852
  components: ee,
1860
- children: L == null ? void 0 : L.response.replace(/DuckDB/gi, "Semaphor")
1853
+ children: T == null ? void 0 : T.response.replace(/DuckDB/gi, "Semaphor")
1861
1854
  },
1862
- P
1863
- ) : /* @__PURE__ */ e.jsx("div", {}, P));
1855
+ $
1856
+ ) : /* @__PURE__ */ e.jsx("div", {}, $));
1864
1857
  }
1865
1858
  return /* @__PURE__ */ e.jsxs(Cs, { open: s, onOpenChange: n, children: [
1866
1859
  /* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsx(
@@ -1884,7 +1877,7 @@ function cl({
1884
1877
  /* @__PURE__ */ e.jsx(
1885
1878
  "div",
1886
1879
  {
1887
- ref: o,
1880
+ ref: i,
1888
1881
  className: "h-[625px] w-full overflow-auto border-t border-t-muted",
1889
1882
  children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: se() })
1890
1883
  }
@@ -1897,19 +1890,19 @@ function cl({
1897
1890
  pa,
1898
1891
  {
1899
1892
  autoFocus: !0,
1900
- ref: i,
1893
+ ref: o,
1901
1894
  onKeyDown: (k) => {
1902
1895
  k.key === "Enter" && !k.shiftKey && (k.preventDefault(), t(""), S());
1903
1896
  },
1904
1897
  placeholder: "Type your question here...",
1905
1898
  onFocus: (k) => {
1906
- const P = k.target, U = P.value.length;
1907
- P.setSelectionRange(U, U);
1899
+ const $ = k.target, U = $.value.length;
1900
+ $.setSelectionRange(U, U);
1908
1901
  },
1909
1902
  className: Y(
1910
1903
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1911
1904
  ),
1912
- disabled: V || m,
1905
+ disabled: A || m,
1913
1906
  value: a,
1914
1907
  onChange: (k) => t(k.target.value)
1915
1908
  }
@@ -1922,7 +1915,7 @@ function cl({
1922
1915
  size: "sm",
1923
1916
  variant: "ghost",
1924
1917
  onClick: S,
1925
- children: !V && !m ? /* @__PURE__ */ e.jsx(mt, {}) : /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1918
+ children: !A && !m ? /* @__PURE__ */ e.jsx(mt, {}) : /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1926
1919
  }
1927
1920
  )
1928
1921
  ] })
@@ -1939,7 +1932,7 @@ var qa = {
1939
1932
  className: void 0,
1940
1933
  style: void 0,
1941
1934
  attr: void 0
1942
- }, Xs = Ne.createContext && /* @__PURE__ */ Ne.createContext(qa), dl = ["attr", "size", "title"];
1935
+ }, Zs = Ne.createContext && /* @__PURE__ */ Ne.createContext(qa), dl = ["attr", "size", "title"];
1943
1936
  function ul(s, n) {
1944
1937
  if (s == null) return {};
1945
1938
  var a = hl(s, n), t, l;
@@ -1970,7 +1963,7 @@ function ls() {
1970
1963
  return s;
1971
1964
  }, ls.apply(this, arguments);
1972
1965
  }
1973
- function Zs(s, n) {
1966
+ function Xs(s, n) {
1974
1967
  var a = Object.keys(s);
1975
1968
  if (Object.getOwnPropertySymbols) {
1976
1969
  var t = Object.getOwnPropertySymbols(s);
@@ -1983,9 +1976,9 @@ function Zs(s, n) {
1983
1976
  function rs(s) {
1984
1977
  for (var n = 1; n < arguments.length; n++) {
1985
1978
  var a = arguments[n] != null ? arguments[n] : {};
1986
- n % 2 ? Zs(Object(a), !0).forEach(function(t) {
1979
+ n % 2 ? Xs(Object(a), !0).forEach(function(t) {
1987
1980
  ml(s, t, a[t]);
1988
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Zs(Object(a)).forEach(function(t) {
1981
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Xs(Object(a)).forEach(function(t) {
1989
1982
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
1990
1983
  });
1991
1984
  }
@@ -2024,31 +2017,31 @@ function fl(s) {
2024
2017
  attr: t,
2025
2018
  size: l,
2026
2019
  title: r
2027
- } = s, i = ul(s, dl), o = l || a.size || "1em", d;
2020
+ } = s, o = ul(s, dl), i = l || a.size || "1em", d;
2028
2021
  return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ Ne.createElement("svg", ls({
2029
2022
  stroke: "currentColor",
2030
2023
  fill: "currentColor",
2031
2024
  strokeWidth: "0"
2032
- }, a.attr, t, i, {
2025
+ }, a.attr, t, o, {
2033
2026
  className: d,
2034
2027
  style: rs(rs({
2035
2028
  color: s.color || a.color
2036
2029
  }, a.style), s.style),
2037
- height: o,
2038
- width: o,
2030
+ height: i,
2031
+ width: i,
2039
2032
  xmlns: "http://www.w3.org/2000/svg"
2040
2033
  }), r && /* @__PURE__ */ Ne.createElement("title", null, r), s.children);
2041
2034
  };
2042
- return Xs !== void 0 ? /* @__PURE__ */ Ne.createElement(Xs.Consumer, null, (a) => n(a)) : n(qa);
2035
+ return Zs !== void 0 ? /* @__PURE__ */ Ne.createElement(Zs.Consumer, null, (a) => n(a)) : n(qa);
2043
2036
  }
2044
2037
  function gl(s) {
2045
2038
  return ge({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
2046
2039
  }
2047
2040
  function jl({ sql: s }) {
2048
- return /* @__PURE__ */ e.jsxs(Ts, { children: [
2049
- /* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(gt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2041
+ return /* @__PURE__ */ e.jsxs(Fs, { children: [
2042
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(gt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2050
2043
  /* @__PURE__ */ e.jsx(
2051
- Fs,
2044
+ Ls,
2052
2045
  {
2053
2046
  align: "end",
2054
2047
  className: "w-full min-w-fit max-w-[700px] p-3 pt-2",
@@ -2061,19 +2054,19 @@ function jl({ sql: s }) {
2061
2054
  ] });
2062
2055
  }
2063
2056
  function _a(s) {
2064
- const { theme: n } = jt(), a = M((p) => p.theme), t = u((p) => p.frame), l = u((p) => p.card), r = u((p) => p.activeTabCardId), i = bt(), { refetch: o } = De(l), { updateCardTab: d, setRunSql: x } = ne(), c = ns(), b = ns({}), g = t.cards.find((p) => p.id === r), h = Oa(() => {
2057
+ const { theme: n } = jt(), a = M((p) => p.theme), t = u((p) => p.frame), l = u((p) => p.card), r = u((p) => p.activeTabCardId), o = bt(), { refetch: i } = De(l), { updateCardTab: d, setRunSql: x } = ne(), c = ns(), b = ns({}), g = t.cards.find((p) => p.id === r), h = Oa(() => {
2065
2058
  let p = "";
2066
2059
  return s === "python" && (p = (g == null ? void 0 : g.python) || fa), s === "sql" && (p = (g == null ? void 0 : g.sql) || ""), p;
2067
2060
  }, [s, g]);
2068
- Z(() => {
2061
+ X(() => {
2069
2062
  if (r && l.id && l.id !== r) {
2070
- if (c.current && i) {
2063
+ if (c.current && o) {
2071
2064
  const p = c.current.getModel();
2072
2065
  p && (b.current[l.id] = p);
2073
2066
  let N = b.current[r];
2074
2067
  if (!N) {
2075
2068
  const y = h();
2076
- N = i.editor.createModel(y, s), b.current[r] = N;
2069
+ N = o.editor.createModel(y, s), b.current[r] = N;
2077
2070
  }
2078
2071
  c.current.setModel(N);
2079
2072
  }
@@ -2083,14 +2076,14 @@ function _a(s) {
2083
2076
  r,
2084
2077
  l,
2085
2078
  d,
2086
- i,
2079
+ o,
2087
2080
  x,
2088
2081
  s,
2089
2082
  h
2090
- ]), Z(() => {
2091
- if (!i) return;
2083
+ ]), X(() => {
2084
+ if (!o) return;
2092
2085
  const p = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", N = a === "system" ? p : a;
2093
- i.editor.defineTheme("default", {
2086
+ o.editor.defineTheme("default", {
2094
2087
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2095
2088
  base: N === "light" ? "vs" : "vs-dark",
2096
2089
  inherit: !0,
@@ -2102,29 +2095,29 @@ function _a(s) {
2102
2095
  // ? '#ffffff'
2103
2096
  // : getCssVariableValue('--semaphor-background'),
2104
2097
  }
2105
- }), i.editor.setTheme("default");
2106
- }, [n, a, i]), Z(() => {
2098
+ }), o.editor.setTheme("default");
2099
+ }, [n, a, o]), X(() => {
2107
2100
  const p = c.current;
2108
- p && i && l && p.addCommand(
2109
- i.KeyMod.Shift | i.KeyCode.Enter,
2101
+ p && o && l && p.addCommand(
2102
+ o.KeyMod.Shift | o.KeyCode.Enter,
2110
2103
  function() {
2111
- return o(), !1;
2104
+ return i(), !1;
2112
2105
  }
2113
2106
  );
2114
- }, [i, o, l]);
2107
+ }, [o, i, l]);
2115
2108
  function f(p, N) {
2116
2109
  if (c.current = p, !b.current[l.id]) {
2117
- const y = p.getModel(), A = h();
2118
- b.current[l.id] = y || (N == null ? void 0 : N.editor.createModel(A, s)) || p.getModel();
2110
+ const y = p.getModel(), V = h();
2111
+ b.current[l.id] = y || (N == null ? void 0 : N.editor.createModel(V, s)) || p.getModel();
2119
2112
  }
2120
2113
  p.setModel(b.current[l.id]);
2121
2114
  }
2122
2115
  return { handleEditorDidMount: f };
2123
2116
  }
2124
2117
  function bl() {
2125
- const s = u((i) => i.card.sql), n = u((i) => i.sqlGen), { setCardSql: a, setSqlGen: t } = ne(), { handleEditorDidMount: l } = _a("sql");
2126
- function r(i) {
2127
- i !== void 0 && (a(i.trim()), vt(n) || t({}));
2118
+ const s = u((o) => o.card.sql), n = u((o) => o.sqlGen), { setCardSql: a, setSqlGen: t } = ne(), { handleEditorDidMount: l } = _a("sql");
2119
+ function r(o) {
2120
+ a(o), vt(n) || t({});
2128
2121
  }
2129
2122
  return /* @__PURE__ */ e.jsx(
2130
2123
  os,
@@ -2151,15 +2144,16 @@ function bl() {
2151
2144
  );
2152
2145
  }
2153
2146
  function yl() {
2154
- const s = u((t) => t.card.python), { setCardPython: n } = ne(), { handleEditorDidMount: a } = _a("python");
2147
+ const s = u((l) => l.card.python), { setCardPython: n } = ne(), { handleEditorDidMount: a } = _a("python");
2148
+ function t(l) {
2149
+ n(l);
2150
+ }
2155
2151
  return /* @__PURE__ */ e.jsx(
2156
2152
  os,
2157
2153
  {
2158
2154
  className: "pt-3",
2159
2155
  theme: "default",
2160
- onChange: (t) => {
2161
- n(t && t.trim() || "");
2162
- },
2156
+ onChange: t,
2163
2157
  value: s || fa,
2164
2158
  options: {
2165
2159
  minimap: {
@@ -2182,7 +2176,7 @@ function vl() {
2182
2176
  const s = M((r) => r.dashboard.filters), n = M((r) => r.filterValues), a = M((r) => r.selectedSheetId), t = s == null ? void 0 : s.filter(
2183
2177
  (r) => r.sheetId === a || !r.sheetId
2184
2178
  ), l = n == null ? void 0 : n.filter(
2185
- (r) => (t == null ? void 0 : t.some((i) => i.id === r.filterId)) || r.filterId.endsWith(a)
2179
+ (r) => (t == null ? void 0 : t.some((o) => o.id === r.filterId)) || r.filterId.endsWith(a)
2186
2180
  );
2187
2181
  return /* @__PURE__ */ e.jsx(
2188
2182
  os,
@@ -2213,38 +2207,38 @@ function Cl() {
2213
2207
  const [s, n] = q({
2214
2208
  queryKey: [],
2215
2209
  queryData: null
2216
- }), a = Ct(), [t, l] = q(!1), [r, i] = q(!1), [o, d] = q(!1), [x, c] = q(""), [b, g] = q(!1), h = u((w) => w.frame), f = u((w) => w.card), p = u((w) => w.isShowingVisual), N = u(
2210
+ }), a = Ct(), [t, l] = q(!1), [r, o] = q(!1), [i, d] = q(!1), [x, c] = q(""), [b, g] = q(!1), h = u((w) => w.frame), f = u((w) => w.card), p = u((w) => w.isShowingVisual), N = u(
2217
2211
  (w) => w.selectedConnectionId
2218
2212
  ), y = u(
2219
2213
  (w) => w.selectedDatabaseName
2220
- ), A = u(
2214
+ ), V = u(
2221
2215
  (w) => w.selectedDatamodelId
2222
2216
  ), I = u(
2223
2217
  (w) => w.selectedSchemaName
2224
- ), z = u((w) => w.selectedTableName), T = u((w) => {
2218
+ ), z = u((w) => w.selectedTableName), F = u((w) => {
2225
2219
  var le;
2226
2220
  return (le = w == null ? void 0 : w.card) == null ? void 0 : le.sql;
2227
- }), L = u((w) => w.applyFilters), {
2228
- setCardCustomCfg: V,
2221
+ }), T = u((w) => w.applyFilters), {
2222
+ setCardCustomCfg: A,
2229
2223
  setQueryResultColumns: m,
2230
2224
  setCardSql: v,
2231
2225
  setQueryError: j,
2232
2226
  setPythonStdOut: D,
2233
2227
  setCardPreferences: S,
2234
2228
  setCardType: _
2235
- } = ne(), $ = u((w) => w.onSave), K = u((w) => w.onClose), ee = u((w) => w.actions.setSqlGen), G = u((w) => w.runSql), se = u((w) => w.actions.setRunSql), k = u((w) => w.actions.setCardCfg), P = u(
2229
+ } = ne(), P = u((w) => w.onSave), K = u((w) => w.onClose), ee = u((w) => w.actions.setSqlGen), G = u((w) => w.runSql), se = u((w) => w.actions.setRunSql), k = u((w) => w.actions.setCardCfg), $ = u(
2236
2230
  (w) => w.actions.setIsSqlRunning
2237
2231
  ), {
2238
2232
  data: U,
2239
2233
  isLoading: E,
2240
- isFetching: F,
2234
+ isFetching: L,
2241
2235
  isSuccess: re,
2242
2236
  isError: B,
2243
2237
  error: ae,
2244
2238
  queryKey: te,
2245
2239
  refetch: je
2246
2240
  } = De(f);
2247
- Z(() => {
2241
+ X(() => {
2248
2242
  if (U && (U.rowLimitExceeded && Ge.error("Row limit (10,000) exceeded. Refine your query.", {
2249
2243
  position: "top-center",
2250
2244
  richColors: !0
@@ -2252,28 +2246,28 @@ function Cl() {
2252
2246
  const { dimensionKeys: w } = js(U.records);
2253
2247
  m(w);
2254
2248
  }
2255
- }, [U, m, D]), Z(() => {
2256
- (E || F) && P(!0), (B || re) && P(!1), B ? (j(ae.message), m([]), D("")) : j("");
2249
+ }, [U, m, D]), X(() => {
2250
+ (E || L) && $(!0), (B || re) && $(!1), B ? (j(ae.message), m([]), D("")) : j("");
2257
2251
  }, [
2258
2252
  E,
2259
- F,
2253
+ L,
2260
2254
  U,
2261
2255
  D,
2262
2256
  B,
2263
2257
  re,
2264
- P,
2258
+ $,
2265
2259
  m,
2266
2260
  j,
2267
2261
  ae
2268
- ]), Z(() => {
2262
+ ]), X(() => {
2269
2263
  G && (a.getQueryData(te) || je(), se(!1));
2270
2264
  }, [G, je, se, te, a]);
2271
- function Te() {
2265
+ function Fe() {
2272
2266
  const w = a.getQueryData(te);
2273
2267
  s.queryData || n({
2274
2268
  queryKey: te,
2275
2269
  queryData: w
2276
- }), a.setQueryData(te, null), v(""), ee({}), k(void 0), V(""), S({}), _("bar");
2270
+ }), a.setQueryData(te, null), v(""), ee({}), k(void 0), A(""), S({}), _("bar");
2277
2271
  }
2278
2272
  function we(w, le) {
2279
2273
  if (w.length === 0)
@@ -2295,13 +2289,13 @@ function Cl() {
2295
2289
  }
2296
2290
  return w[0].id;
2297
2291
  }
2298
- function Le() {
2299
- let w = T;
2300
- T && !T.includes("{{") && (w = rl(T), v(w));
2292
+ function Te() {
2293
+ let w = F;
2294
+ F && !F.includes("{{") && (w = rl(F), v(w));
2301
2295
  const le = {
2302
2296
  ...f,
2303
2297
  lastSelectedSchema: I,
2304
- lastSelectedDatamodelId: A,
2298
+ lastSelectedDatamodelId: V,
2305
2299
  lastSelectedDatabase: y,
2306
2300
  lastSelectedTable: z,
2307
2301
  connectionId: N,
@@ -2315,9 +2309,9 @@ function Cl() {
2315
2309
  cards: ke,
2316
2310
  activeCardId: we(ke, h.activeCardId)
2317
2311
  };
2318
- $ == null || $(oe);
2312
+ P == null || P(oe);
2319
2313
  }
2320
- function Fe() {
2314
+ function Le() {
2321
2315
  const { queryKey: w, queryData: le } = s;
2322
2316
  w && le && a.setQueryData(w, le), K == null || K();
2323
2317
  }
@@ -2334,7 +2328,7 @@ function Cl() {
2334
2328
  r && /* @__PURE__ */ e.jsx(
2335
2329
  Be,
2336
2330
  {
2337
- onClick: () => i(!1),
2331
+ onClick: () => o(!1),
2338
2332
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
2339
2333
  }
2340
2334
  )
@@ -2346,18 +2340,18 @@ function Cl() {
2346
2340
  !r && /* @__PURE__ */ e.jsx(
2347
2341
  oa,
2348
2342
  {
2349
- onClick: () => i(!0),
2343
+ onClick: () => o(!0),
2350
2344
  className: Y(
2351
2345
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
2352
2346
  {
2353
- "font-bold text-red-800": L
2347
+ "font-bold text-red-800": T
2354
2348
  }
2355
2349
  )
2356
2350
  }
2357
2351
  )
2358
2352
  ] });
2359
2353
  }
2360
- function Ae() {
2354
+ function Ve() {
2361
2355
  return /* @__PURE__ */ e.jsxs(
2362
2356
  ss,
2363
2357
  {
@@ -2421,7 +2415,7 @@ function Cl() {
2421
2415
  className: "flex grow flex-col justify-end",
2422
2416
  children: [
2423
2417
  /* @__PURE__ */ e.jsxs("div", { className: "relative flex grow justify-between overflow-y-scroll", children: [
2424
- Ae(),
2418
+ Ve(),
2425
2419
  Ee()
2426
2420
  ] }),
2427
2421
  /* @__PURE__ */ e.jsxs(
@@ -2435,7 +2429,7 @@ function Cl() {
2435
2429
  O,
2436
2430
  {
2437
2431
  title: "Shift + Enter",
2438
- disabled: E || F,
2432
+ disabled: E || L,
2439
2433
  onClick: () => {
2440
2434
  je();
2441
2435
  },
@@ -2443,7 +2437,7 @@ function Cl() {
2443
2437
  size: "sm",
2444
2438
  variant: "outline",
2445
2439
  children: [
2446
- E || F ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Hn, { className: "mr-2 h-4 w-4" }),
2440
+ E || L ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Hn, { className: "mr-2 h-4 w-4" }),
2447
2441
  "Run"
2448
2442
  ]
2449
2443
  }
@@ -2460,7 +2454,7 @@ function Cl() {
2460
2454
  /* @__PURE__ */ e.jsxs(
2461
2455
  O,
2462
2456
  {
2463
- onClick: Te,
2457
+ onClick: Fe,
2464
2458
  className: "",
2465
2459
  size: "sm",
2466
2460
  variant: "outline",
@@ -2484,7 +2478,7 @@ function Cl() {
2484
2478
  /* @__PURE__ */ e.jsx(
2485
2479
  cl,
2486
2480
  {
2487
- open: o,
2481
+ open: i,
2488
2482
  setOpen: d,
2489
2483
  userInput: x,
2490
2484
  triggerAIRun: b,
@@ -2498,7 +2492,7 @@ function Cl() {
2498
2492
  /* @__PURE__ */ e.jsxs(
2499
2493
  O,
2500
2494
  {
2501
- onClick: Fe,
2495
+ onClick: Le,
2502
2496
  className: "w-full",
2503
2497
  size: "sm",
2504
2498
  variant: "outline",
@@ -2511,7 +2505,7 @@ function Cl() {
2511
2505
  /* @__PURE__ */ e.jsxs(
2512
2506
  O,
2513
2507
  {
2514
- onClick: Le,
2508
+ onClick: Te,
2515
2509
  size: "sm",
2516
2510
  variant: "outline",
2517
2511
  children: [
@@ -2530,10 +2524,10 @@ function Cl() {
2530
2524
  );
2531
2525
  }
2532
2526
  function Nl({ data: s }) {
2533
- var i;
2534
- const [n, a] = Ne.useState([]), l = Object.keys(s[0]).map((o) => ({
2527
+ var o;
2528
+ const [n, a] = Ne.useState([]), l = Object.keys(s[0]).map((i) => ({
2535
2529
  // header: key,
2536
- accessorKey: o,
2530
+ accessorKey: i,
2537
2531
  header: ({ column: d }) => {
2538
2532
  const x = d.getIsSorted();
2539
2533
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
@@ -2542,7 +2536,7 @@ function Nl({ data: s }) {
2542
2536
  className: "flex cursor-pointer items-center",
2543
2537
  onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2544
2538
  children: [
2545
- o,
2539
+ i,
2546
2540
  x === "asc" ? /* @__PURE__ */ e.jsx(St, { className: "ml-2 h-5 w-5" }) : x === "desc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : null
2547
2541
  ]
2548
2542
  }
@@ -2554,14 +2548,14 @@ function Nl({ data: s }) {
2554
2548
  getCoreRowModel: Mt(),
2555
2549
  getPaginationRowModel: It(),
2556
2550
  onSortingChange: a,
2557
- getSortedRowModel: Tt(),
2551
+ getSortedRowModel: Ft(),
2558
2552
  manualPagination: !0,
2559
2553
  state: {
2560
2554
  sorting: n
2561
2555
  }
2562
2556
  });
2563
2557
  return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
2564
- /* @__PURE__ */ e.jsx(zt, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(fs, { children: o.headers.map((d) => /* @__PURE__ */ e.jsx(
2558
+ /* @__PURE__ */ e.jsx(zt, { children: r.getHeaderGroups().map((i) => /* @__PURE__ */ e.jsx(fs, { children: i.headers.map((d) => /* @__PURE__ */ e.jsx(
2565
2559
  Ot,
2566
2560
  {
2567
2561
  className: "sticky top-0 h-11 bg-muted font-semibold",
@@ -2571,38 +2565,38 @@ function Nl({ data: s }) {
2571
2565
  )
2572
2566
  },
2573
2567
  d.id
2574
- )) }, o.id)) }),
2575
- /* @__PURE__ */ e.jsx(Dt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2568
+ )) }, i.id)) }),
2569
+ /* @__PURE__ */ e.jsx(Dt, { children: (o = r.getRowModel().rows) != null && o.length ? r.getRowModel().rows.map((i) => /* @__PURE__ */ e.jsx(
2576
2570
  fs,
2577
2571
  {
2578
2572
  className: "whitespace-nowrap py-2",
2579
- "data-state": o.getIsSelected() && "selected",
2580
- children: o.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Qs, { className: "py-3", children: Ks(d.column.columnDef.cell, d.getContext()) }, d.id))
2573
+ "data-state": i.getIsSelected() && "selected",
2574
+ children: i.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Qs, { className: "py-3", children: Ks(d.column.columnDef.cell, d.getContext()) }, d.id))
2581
2575
  },
2582
- o.id
2576
+ i.id
2583
2577
  )) : /* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Qs, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2584
2578
  ] }) });
2585
2579
  }
2586
2580
  function Sl({ card: s }) {
2587
- var y, A, I, z, T, L, V, m, v, j, D;
2581
+ var y, V, I, z, F, T, A, m, v, j, D;
2588
2582
  const [n, a] = q(!1), [t, l] = q(
2589
2583
  []
2590
- ), { authToken: r } = Se(), i = Lt(r == null ? void 0 : r.accessToken), o = M((S) => S.themeStyle), d = {
2591
- colors: ((A = (y = o == null ? void 0 : o.chart) == null ? void 0 : y.dataset) == null ? void 0 : A.backgroundColor) || []
2584
+ ), { authToken: r } = Se(), o = Tt(r == null ? void 0 : r.accessToken), i = M((S) => S.themeStyle), d = {
2585
+ colors: ((V = (y = i == null ? void 0 : i.chart) == null ? void 0 : y.dataset) == null ? void 0 : V.backgroundColor) || []
2592
2586
  };
2593
2587
  (I = s.customCardPreferences) != null && I.inputData;
2594
- const { getCard: x } = ga(((z = s.customCardPreferences) == null ? void 0 : z.url) || ""), c = ((T = s.customCardPreferences) == null ? void 0 : T.visualType) || "single", b = u((S) => S.frame);
2588
+ const { getCard: x } = ga(((z = s.customCardPreferences) == null ? void 0 : z.url) || ""), c = ((F = s.customCardPreferences) == null ? void 0 : F.visualType) || "single", b = u((S) => S.frame);
2595
2589
  ne();
2596
2590
  const { data: g } = De(s), h = Oa((S, _) => {
2597
- l(($) => ({
2598
- ...$,
2591
+ l((P) => ({
2592
+ ...P,
2599
2593
  [S]: _
2600
2594
  }));
2601
2595
  }, []);
2602
- if (!((L = s.customCardPreferences) != null && L.componentName))
2596
+ if (!((T = s.customCardPreferences) != null && T.componentName))
2603
2597
  return null;
2604
2598
  const f = x(
2605
- (V = s.customCardPreferences) == null ? void 0 : V.componentName
2599
+ (A = s.customCardPreferences) == null ? void 0 : A.componentName
2606
2600
  );
2607
2601
  function p(S) {
2608
2602
  a(S);
@@ -2611,8 +2605,8 @@ function Sl({ card: s }) {
2611
2605
  ((m = s.customCardPreferences) == null ? void 0 : m.dataInputCardIds) || {}
2612
2606
  ).map((S) => {
2613
2607
  var K, ee, G;
2614
- const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, $ = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find((se) => se.id === _);
2615
- return $ || null;
2608
+ const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find((se) => se.id === _);
2609
+ return P || null;
2616
2610
  });
2617
2611
  return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
2618
2612
  Cn,
@@ -2622,7 +2616,7 @@ function Sl({ card: s }) {
2622
2616
  f && c === "single" && /* @__PURE__ */ e.jsx(
2623
2617
  f,
2624
2618
  {
2625
- params: i,
2619
+ params: o,
2626
2620
  theme: d,
2627
2621
  settings: (v = s.customCardPreferences) == null ? void 0 : v.settings,
2628
2622
  onDataChange: h,
@@ -2634,19 +2628,19 @@ function Sl({ card: s }) {
2634
2628
  ((j = s.customCardPreferences) == null ? void 0 : j.dataInputCardIds) || {}
2635
2629
  ).map((S) => {
2636
2630
  var K, ee, G;
2637
- const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, $ = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find(
2631
+ const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find(
2638
2632
  (se) => se.id === _
2639
2633
  );
2640
- if ($)
2634
+ if (P)
2641
2635
  return /* @__PURE__ */ e.jsx(
2642
- Ft,
2636
+ Lt,
2643
2637
  {
2644
2638
  onLoadingStatus: p,
2645
2639
  onDataChange: h,
2646
2640
  dataInputIndex: S,
2647
- card: $
2641
+ card: P
2648
2642
  },
2649
- $.id + S
2643
+ P.id + S
2650
2644
  );
2651
2645
  }),
2652
2646
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
@@ -2678,7 +2672,7 @@ function Ha({
2678
2672
  var N;
2679
2673
  const a = u((y) => y.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = u((y) => y.frame), r = M((y) => y.dashboard.filters);
2680
2674
  u((y) => y.actions.setRunSql);
2681
- const { updateFilter: i } = is(), o = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: d, isLoading: x, isFetching: c } = De(a), { setCard: b } = ne(), { data: g } = Es(a);
2675
+ const { updateFilter: o } = is(), i = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: d, isLoading: x, isFetching: c } = De(a), { setCard: b } = ne(), { data: g } = Es(a);
2682
2676
  if (!a.id) return null;
2683
2677
  let h;
2684
2678
  d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (h = ja({
@@ -2711,7 +2705,7 @@ function Ha({
2711
2705
  );
2712
2706
  if (a.type === "table" && (d != null && d.records) && (d == null ? void 0 : d.records.length) > 0)
2713
2707
  return /* @__PURE__ */ e.jsxs(fe, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
2714
- /* @__PURE__ */ e.jsx(Pt, { card: a, data: d == null ? void 0 : d.records }),
2708
+ /* @__PURE__ */ e.jsx($t, { card: a, data: d == null ? void 0 : d.records }),
2715
2709
  /* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
2716
2710
  ] });
2717
2711
  }
@@ -2722,19 +2716,19 @@ function Ha({
2722
2716
  className: Y("relative flex h-full flex-col rounded-none", s),
2723
2717
  ...n,
2724
2718
  children: [
2725
- t && /* @__PURE__ */ e.jsxs(At, { className: "flex flex-row items-start justify-between py-4", children: [
2719
+ t && /* @__PURE__ */ e.jsxs(Vt, { className: "flex flex-row items-start justify-between py-4", children: [
2726
2720
  /* @__PURE__ */ e.jsxs("div", { children: [
2727
2721
  /* @__PURE__ */ e.jsx(
2728
- Xe,
2722
+ Ze,
2729
2723
  {
2730
2724
  text: a.title,
2731
2725
  onSave: (y) => b({ ...a, title: y }),
2732
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(Vt, { className: "text-base", children: a.title || "Edit title..." }) })
2726
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(At, { className: "text-base", children: a.title || "Edit title..." }) })
2733
2727
  },
2734
2728
  a.title
2735
2729
  ),
2736
2730
  /* @__PURE__ */ e.jsx(
2737
- Xe,
2731
+ Ze,
2738
2732
  {
2739
2733
  text: a.description || "",
2740
2734
  onSave: (y) => b({ ...a, description: y }),
@@ -2743,17 +2737,17 @@ function Ha({
2743
2737
  a.description
2744
2738
  )
2745
2739
  ] }),
2746
- o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2740
+ i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2747
2741
  /* @__PURE__ */ e.jsx(
2748
- Xe,
2742
+ Ze,
2749
2743
  {
2750
2744
  className: "my-1",
2751
- text: o.title || o.column,
2752
- onSave: (y) => i({ ...o, title: y }),
2753
- children: /* @__PURE__ */ e.jsx(H, { children: o.title })
2745
+ text: i.title || i.column,
2746
+ onSave: (y) => o({ ...i, title: y }),
2747
+ children: /* @__PURE__ */ e.jsx(H, { children: i.title })
2754
2748
  }
2755
2749
  ),
2756
- /* @__PURE__ */ e.jsx(ba, { filter: o })
2750
+ /* @__PURE__ */ e.jsx(ba, { filter: i })
2757
2751
  ] })
2758
2752
  ] }),
2759
2753
  /* @__PURE__ */ e.jsx(Rt, { className: "flex grow flex-col", children: p() })
@@ -2814,12 +2808,12 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2814
2808
  onCodeChange: l
2815
2809
  }) => /* @__PURE__ */ e.jsxs(va, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2816
2810
  /* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2817
- /* @__PURE__ */ e.jsxs(Ze, { value: "custom-config", children: [
2811
+ /* @__PURE__ */ e.jsxs(Xe, { value: "custom-config", children: [
2818
2812
  a && /* @__PURE__ */ e.jsx(Na, { className: "mr-1 h-5 w-5 text-green-600" }),
2819
2813
  a ? "Custom Config" : "Default Config"
2820
2814
  ] }),
2821
- /* @__PURE__ */ e.jsx(Ze, { value: "output", children: "Output" }),
2822
- /* @__PURE__ */ e.jsx(Ze, { value: "custom-code", children: "Custom Code" })
2815
+ /* @__PURE__ */ e.jsx(Xe, { value: "output", children: "Output" }),
2816
+ /* @__PURE__ */ e.jsx(Xe, { value: "custom-code", children: "Custom Code" })
2823
2817
  ] }),
2824
2818
  /* @__PURE__ */ e.jsx(
2825
2819
  es,
@@ -2879,15 +2873,15 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2879
2873
  /* @__PURE__ */ e.jsx(O, { onClick: l, variant: "outline", children: "Close" })
2880
2874
  ] });
2881
2875
  function Ol() {
2882
- const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [i, o] = q(""), [d, x] = q(""), c = u((z) => z.card), b = u((z) => z.card.customCfg), { data: g } = De(c), { data: h } = Es(c), { setCardCustomCfg: f, setCustomVisualCode: p } = ne(), N = (z) => {
2883
- var T, L;
2876
+ const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [o, i] = q(""), [d, x] = q(""), c = u((z) => z.card), b = u((z) => z.card.customCfg), { data: g } = De(c), { data: h } = Es(c), { setCardCustomCfg: f, setCustomVisualCode: p } = ne(), N = (z) => {
2877
+ var F, T;
2884
2878
  return JSON.stringify(
2885
2879
  {
2886
2880
  ...z,
2887
2881
  data: {
2888
2882
  ...z.data,
2889
- datasets: (L = (T = z.data) == null ? void 0 : T.datasets) == null ? void 0 : L.map((V) => ({
2890
- ...V,
2883
+ datasets: (T = (F = z.data) == null ? void 0 : F.datasets) == null ? void 0 : T.map((A) => ({
2884
+ ...A,
2891
2885
  data: []
2892
2886
  }))
2893
2887
  }
@@ -2896,8 +2890,8 @@ function Ol() {
2896
2890
  2
2897
2891
  );
2898
2892
  }, y = () => {
2899
- var T, L;
2900
- if (!((T = g == null ? void 0 : g.records) != null && T.length)) return;
2893
+ var F, T;
2894
+ if (!((F = g == null ? void 0 : g.records) != null && F.length)) return;
2901
2895
  const z = ja({
2902
2896
  data: g.records,
2903
2897
  cardType: c.type,
@@ -2905,12 +2899,12 @@ function Ol() {
2905
2899
  preferences: c.preferences,
2906
2900
  topoJson: h
2907
2901
  });
2908
- z && (t(N(z)), o(((L = c.preferences) == null ? void 0 : L.customVisualCode) || ""), r(
2902
+ z && (t(N(z)), i(((T = c.preferences) == null ? void 0 : T.customVisualCode) || ""), r(
2909
2903
  b ? JSON.stringify(b, null, 2) : ""
2910
2904
  ));
2911
- }, A = () => {
2905
+ }, V = () => {
2912
2906
  try {
2913
- if (i && p(i), l) {
2907
+ if (o && p(o), l) {
2914
2908
  const z = JSON.parse(l);
2915
2909
  f(z), x("");
2916
2910
  }
@@ -2932,7 +2926,7 @@ function Ol() {
2932
2926
  size: "sm",
2933
2927
  variant: "outline",
2934
2928
  className: b ? "border-foreground/50 dark:border-foreground/70" : "",
2935
- children: /* @__PURE__ */ e.jsx($t, { className: "h-4 w-4" })
2929
+ children: /* @__PURE__ */ e.jsx(Pt, { className: "h-4 w-4" })
2936
2930
  }
2937
2931
  ) }),
2938
2932
  /* @__PURE__ */ e.jsxs(ws, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
@@ -2943,10 +2937,10 @@ function Ol() {
2943
2937
  kl,
2944
2938
  {
2945
2939
  defaultConfig: a,
2946
- customCode: i,
2940
+ customCode: o,
2947
2941
  customConfig: I(),
2948
2942
  onConfigChange: (z) => r(z ?? ""),
2949
- onCodeChange: (z) => o(z ?? "")
2943
+ onCodeChange: (z) => i(z ?? "")
2950
2944
  }
2951
2945
  )
2952
2946
  ] }),
@@ -2958,17 +2952,17 @@ function Ol() {
2958
2952
  onReset: () => {
2959
2953
  r(""), f(null);
2960
2954
  },
2961
- onApply: A,
2955
+ onApply: V,
2962
2956
  onClose: () => n(!1)
2963
2957
  }
2964
2958
  )
2965
2959
  ] })
2966
2960
  ] });
2967
2961
  }
2968
- function Pa(s) {
2962
+ function $a(s) {
2969
2963
  return ge({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
2970
2964
  }
2971
- function $a(s) {
2965
+ function Pa(s) {
2972
2966
  return ge({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z" }, child: [] }] })(s);
2973
2967
  }
2974
2968
  function Ba(s) {
@@ -2991,9 +2985,9 @@ function Ja(s) {
2991
2985
  }
2992
2986
  function Wa(s) {
2993
2987
  const [n, a] = q(null);
2994
- return Z(() => {
2988
+ return X(() => {
2995
2989
  s && (async () => {
2996
- const r = (await import("./lucide-react-g0ln-XxW.js"))[s];
2990
+ const r = (await import("./lucide-react-CoTyczdi.js"))[s];
2997
2991
  a(r);
2998
2992
  })();
2999
2993
  }, [s]), n;
@@ -3010,18 +3004,18 @@ function Dl({
3010
3004
  onChartTypeChange: s
3011
3005
  }) {
3012
3006
  const [n, a] = q([]), { data: t } = Ya();
3013
- return Z(() => {
3007
+ return X(() => {
3014
3008
  (async () => {
3015
3009
  var r;
3016
3010
  if (t) {
3017
- const o = (await Promise.all(
3011
+ const i = (await Promise.all(
3018
3012
  (r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (d) => (await Ut(d.value)).visuals.map((b) => ({
3019
3013
  name: b.name,
3020
3014
  icon: b.icon,
3021
3015
  url: d.value
3022
3016
  })))
3023
3017
  )).flat();
3024
- a(o);
3018
+ a(i);
3025
3019
  }
3026
3020
  })();
3027
3021
  }, [t]), n.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -3047,9 +3041,9 @@ const Ml = ({
3047
3041
  };
3048
3042
  function Il() {
3049
3043
  var c, b;
3050
- const [s, n] = q(!1), a = u((g) => g.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = u((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: d } = ne();
3044
+ const [s, n] = q(!1), a = u((g) => g.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: o } = u((g) => g.actions), { setCardCustomCfg: i, setCustomCardPreferences: d } = ne();
3051
3045
  function x(g, h) {
3052
- o(null), r({}), l(g), h && d({
3046
+ i(null), r({}), l(g), h && d({
3053
3047
  type: "component",
3054
3048
  visualType: "single",
3055
3049
  url: h.url,
@@ -3059,7 +3053,7 @@ function Il() {
3059
3053
  }
3060
3054
  return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
3061
3055
  /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3062
- Tl,
3056
+ Fl,
3063
3057
  {
3064
3058
  className: "h-4 w-4",
3065
3059
  chartType: t,
@@ -3131,7 +3125,7 @@ function Il() {
3131
3125
  {
3132
3126
  onClick: () => x("doughnut"),
3133
3127
  variant: "ghost",
3134
- children: /* @__PURE__ */ e.jsx($a, { className: "size-5", strokeWidth: 1 })
3128
+ children: /* @__PURE__ */ e.jsx(Pa, { className: "size-5", strokeWidth: 1 })
3135
3129
  }
3136
3130
  ),
3137
3131
  /* @__PURE__ */ e.jsx(
@@ -3140,7 +3134,7 @@ function Il() {
3140
3134
  onClick: () => x("radar"),
3141
3135
  variant: "ghost",
3142
3136
  children: /* @__PURE__ */ e.jsx(
3143
- Pa,
3137
+ $a,
3144
3138
  {
3145
3139
  className: "size-5 font-extralight",
3146
3140
  strokeWidth: 0.5
@@ -3201,7 +3195,7 @@ function Il() {
3201
3195
  {
3202
3196
  onClick: () => x("map"),
3203
3197
  variant: "ghost",
3204
- children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
3198
+ children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4" })
3205
3199
  }
3206
3200
  ),
3207
3201
  /* @__PURE__ */ e.jsx(
@@ -3209,7 +3203,7 @@ function Il() {
3209
3203
  {
3210
3204
  onClick: () => x("custom"),
3211
3205
  variant: "ghost",
3212
- children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4" })
3206
+ children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
3213
3207
  }
3214
3208
  )
3215
3209
  ] }),
@@ -3217,7 +3211,7 @@ function Il() {
3217
3211
  ] })
3218
3212
  ] });
3219
3213
  }
3220
- function Tl({
3214
+ function Fl({
3221
3215
  chartType: s,
3222
3216
  className: n,
3223
3217
  customIcon: a,
@@ -3232,13 +3226,13 @@ function Tl({
3232
3226
  case "pie":
3233
3227
  return /* @__PURE__ */ e.jsx(Ma, { className: n });
3234
3228
  case "radar":
3235
- return /* @__PURE__ */ e.jsx(Pa, { className: n });
3229
+ return /* @__PURE__ */ e.jsx($a, { className: n });
3236
3230
  case "scatter":
3237
3231
  return /* @__PURE__ */ e.jsx(Ia, { className: n });
3238
3232
  case "bubble":
3239
3233
  return /* @__PURE__ */ e.jsx(Ua, { className: n });
3240
3234
  case "doughnut":
3241
- return /* @__PURE__ */ e.jsx($a, { className: n });
3235
+ return /* @__PURE__ */ e.jsx(Pa, { className: n });
3242
3236
  case "stackedBar":
3243
3237
  return /* @__PURE__ */ e.jsx(Ka, { className: "size-4 text-foreground/70" });
3244
3238
  case "stackedLine":
@@ -3254,18 +3248,18 @@ function Tl({
3254
3248
  case "text":
3255
3249
  return /* @__PURE__ */ e.jsx(_s, { className: n });
3256
3250
  case "map":
3257
- return /* @__PURE__ */ e.jsx(La, { className: n });
3251
+ return /* @__PURE__ */ e.jsx(Ta, { className: n });
3258
3252
  case "custom":
3259
- return a && l ? /* @__PURE__ */ e.jsx(l, { className: n }) : t ? t == null ? void 0 : t.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(Fa, { className: n });
3253
+ return a && l ? /* @__PURE__ */ e.jsx(l, { className: n }) : t ? t == null ? void 0 : t.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(La, { className: n });
3260
3254
  default:
3261
3255
  return /* @__PURE__ */ e.jsx(Is, { className: n });
3262
3256
  }
3263
3257
  }
3264
- function Ll() {
3258
+ function Tl() {
3265
3259
  var n;
3266
3260
  const s = u((a) => a.card);
3267
3261
  return (n = s.customCardPreferences) == null || n.showCardHeader, ne(), /* @__PURE__ */ e.jsxs(na, { children: [
3268
- /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3262
+ /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3269
3263
  /* @__PURE__ */ e.jsx(ra, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
3270
3264
  Gt,
3271
3265
  {
@@ -3284,7 +3278,7 @@ function Ll() {
3284
3278
  function sa() {
3285
3279
  const s = u((m) => m.frame), n = u((m) => m.card), a = u((m) => m.isShowingVisual), t = u((m) => m.isSqlRunning), l = u((m) => m.queryError), r = u((m) => m.pythonStdOut);
3286
3280
  u((m) => m.actions.setRunSql);
3287
- const { setFrame: i, setCard: o, updateCardInFrame: d, setActiveTabCardId: x } = ne(), { data: c, isLoading: b, isFetching: g } = De(n);
3281
+ const { setFrame: o, setCard: i, updateCardInFrame: d, setActiveTabCardId: x } = ne(), { data: c, isLoading: b, isFetching: g } = De(n);
3288
3282
  if (!n) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3289
3283
  function h() {
3290
3284
  const m = {
@@ -3312,7 +3306,7 @@ function sa() {
3312
3306
  cards: [...s.cards, m],
3313
3307
  activeCardId: m.id
3314
3308
  };
3315
- i(v), x(m.id);
3309
+ o(v), x(m.id);
3316
3310
  }
3317
3311
  function p() {
3318
3312
  const m = {
@@ -3330,12 +3324,12 @@ function sa() {
3330
3324
  // update the active card to the first card in the frame
3331
3325
  activeCardId: j.id
3332
3326
  };
3333
- i(D), o(j);
3327
+ o(D), i(j);
3334
3328
  }
3335
3329
  function y(m) {
3336
3330
  x(m);
3337
3331
  }
3338
- const A = (m, v) => {
3332
+ const V = (m, v) => {
3339
3333
  console.log("handleDragStart", v), m.dataTransfer.setData("tabIndex", v.toString());
3340
3334
  }, I = (m) => {
3341
3335
  m.preventDefault();
@@ -3343,15 +3337,15 @@ function sa() {
3343
3337
  const j = m.dataTransfer.getData("tabIndex");
3344
3338
  if (j === v.toString()) return;
3345
3339
  const D = Array.from(s.cards), [S] = D.splice(parseInt(j), 1);
3346
- D.splice(v, 0, S), i({ ...s, cards: D });
3340
+ D.splice(v, 0, S), o({ ...s, cards: D });
3347
3341
  };
3348
- function T(m, v) {
3342
+ function F(m, v) {
3349
3343
  return m.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || m.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3350
3344
  "div",
3351
3345
  {
3352
3346
  onClick: () => {
3353
3347
  const j = v.displayTab === void 0 ? !1 : !v.displayTab;
3354
- o({ ...v, displayTab: j }), d({
3348
+ i({ ...v, displayTab: j }), d({
3355
3349
  ...v,
3356
3350
  displayTab: j
3357
3351
  });
@@ -3360,7 +3354,7 @@ function sa() {
3360
3354
  }
3361
3355
  );
3362
3356
  }
3363
- function L() {
3357
+ function T() {
3364
3358
  return /* @__PURE__ */ e.jsxs(
3365
3359
  va,
3366
3360
  {
@@ -3368,26 +3362,26 @@ function sa() {
3368
3362
  value: s.activeCardId,
3369
3363
  className: "flex grow flex-col",
3370
3364
  children: [
3371
- s.cards.map((m) => /* @__PURE__ */ e.jsx(es, { className: "mt-0 grow", value: m.id, children: V() }, m.id)),
3365
+ s.cards.map((m) => /* @__PURE__ */ e.jsx(es, { className: "mt-0 grow", value: m.id, children: A() }, m.id)),
3372
3366
  /* @__PURE__ */ e.jsx(Ca, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3373
3367
  s.cards.map((m, v) => /* @__PURE__ */ e.jsx(
3374
- Xe,
3368
+ Ze,
3375
3369
  {
3376
3370
  text: m.tabTitle || m.title,
3377
3371
  onSave: (j) => {
3378
- o({ ...n, tabTitle: j }), d({ ...n, tabTitle: j });
3372
+ i({ ...n, tabTitle: j }), d({ ...n, tabTitle: j });
3379
3373
  },
3380
3374
  children: /* @__PURE__ */ e.jsxs(
3381
- Ze,
3375
+ Xe,
3382
3376
  {
3383
3377
  draggable: !0,
3384
- onDragStart: (j) => A(j, v),
3378
+ onDragStart: (j) => V(j, v),
3385
3379
  onDragOver: I,
3386
3380
  onDrop: (j) => z(j, v),
3387
3381
  className: "",
3388
3382
  value: m.id,
3389
3383
  children: [
3390
- T(s, m),
3384
+ F(s, m),
3391
3385
  m.tabTitle || m.title,
3392
3386
  s.activeCardId === m.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3393
3387
  Sa,
@@ -3425,7 +3419,7 @@ function sa() {
3425
3419
  }
3426
3420
  );
3427
3421
  }
3428
- function V() {
3422
+ function A() {
3429
3423
  return n.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Qt, { card: n, data: c == null ? void 0 : c.records }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(fe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3430
3424
  Jt,
3431
3425
  {
@@ -3436,16 +3430,16 @@ function sa() {
3436
3430
  ) }) }) }) : /* @__PURE__ */ e.jsx(cs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ha, { className: "grow border-none shadow-none" }) });
3437
3431
  }
3438
3432
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
3439
- (b || g) && /* @__PURE__ */ e.jsx(Ve, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3433
+ (b || g) && /* @__PURE__ */ e.jsx(Ae, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3440
3434
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3441
3435
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3442
3436
  /* @__PURE__ */ e.jsx(Il, {}),
3443
3437
  !["table", "custom"].includes(n.type) && /* @__PURE__ */ e.jsx(Ol, {}),
3444
- /* @__PURE__ */ e.jsx(Ll, {})
3438
+ /* @__PURE__ */ e.jsx(Tl, {})
3445
3439
  ] }),
3446
3440
  /* @__PURE__ */ e.jsx(El, {})
3447
3441
  ] }),
3448
- a ? L() : /* @__PURE__ */ e.jsxs(
3442
+ a ? T() : /* @__PURE__ */ e.jsxs(
3449
3443
  ss,
3450
3444
  {
3451
3445
  className: "px-6",
@@ -3460,7 +3454,7 @@ function sa() {
3460
3454
  defaultSize: 30,
3461
3455
  minSize: 10,
3462
3456
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3463
- children: r && /* @__PURE__ */ e.jsx(Fl, {})
3457
+ children: r && /* @__PURE__ */ e.jsx(Ll, {})
3464
3458
  }
3465
3459
  ),
3466
3460
  /* @__PURE__ */ e.jsx(as, {})
@@ -3484,7 +3478,7 @@ function sa() {
3484
3478
  )
3485
3479
  ] });
3486
3480
  }
3487
- function Fl() {
3481
+ function Ll() {
3488
3482
  const s = u((a) => a.pythonStdOut);
3489
3483
  if (!s) return null;
3490
3484
  const n = s.replace(/\n/g, "<br>");
@@ -3513,7 +3507,7 @@ function El() {
3513
3507
  )
3514
3508
  ] });
3515
3509
  }
3516
- function Al({
3510
+ function Vl({
3517
3511
  options: s,
3518
3512
  value: n,
3519
3513
  onValueChange: a
@@ -3549,11 +3543,11 @@ function de({
3549
3543
  ),
3550
3544
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3551
3545
  /* @__PURE__ */ e.jsx(pe, { children: s }),
3552
- n.map((r) => /* @__PURE__ */ e.jsx(X, { value: r.value, children: r.label }, r.value))
3546
+ n.map((r) => /* @__PURE__ */ e.jsx(Z, { value: r.value, children: r.label }, r.value))
3553
3547
  ] }) })
3554
3548
  ] });
3555
3549
  }
3556
- function $e({
3550
+ function Pe({
3557
3551
  children: s,
3558
3552
  summary: n,
3559
3553
  open: a,
@@ -3567,106 +3561,106 @@ function $e({
3567
3561
  children: [
3568
3562
  /* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
3569
3563
  /* @__PURE__ */ e.jsx(H, { children: n }),
3570
- /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4" })
3564
+ /* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4" })
3571
3565
  ] }),
3572
3566
  /* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
3573
3567
  ]
3574
3568
  }
3575
3569
  );
3576
3570
  }
3577
- function Vl() {
3571
+ function Al() {
3578
3572
  var p, N;
3579
3573
  const s = u(
3580
3574
  (y) => y.card.customCardPreferences
3581
- ), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((y) => y.card), l = u((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ne(), { components: o, manifest: d } = ga(
3575
+ ), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((y) => y.card), l = u((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: o } = ne(), { components: i, manifest: d } = ga(
3582
3576
  (s == null ? void 0 : s.url) || ""
3583
3577
  ), x = (p = d == null ? void 0 : d.visuals) == null ? void 0 : p.find(
3584
3578
  (y) => y.name === (s == null ? void 0 : s.componentName)
3585
3579
  );
3586
- function c(y, A) {
3580
+ function c(y, V) {
3587
3581
  if (!s) return;
3588
3582
  const z = {
3589
3583
  ...(s == null ? void 0 : s.dataInputCardIds) || {},
3590
3584
  [y]: {
3591
- cardId: A,
3585
+ cardId: V,
3592
3586
  hookRef: null
3593
3587
  }
3594
3588
  };
3595
- i({
3589
+ o({
3596
3590
  ...s,
3597
3591
  dataInputCardIds: z
3598
3592
  });
3599
3593
  }
3600
3594
  function b(y) {
3601
3595
  var I, z;
3602
- const A = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((T) => {
3603
- var L;
3604
- return ((L = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : L.visualType) !== "multiple";
3605
- }).map((T) => ({
3606
- value: T.id,
3607
- label: T.tabTitle || T.title
3596
+ const V = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((F) => {
3597
+ var T;
3598
+ return ((T = F == null ? void 0 : F.customCardPreferences) == null ? void 0 : T.visualType) !== "multiple";
3599
+ }).map((F) => ({
3600
+ value: F.id,
3601
+ label: F.tabTitle || F.title
3608
3602
  }));
3609
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (z = y == null ? void 0 : y.dataInputs) == null ? void 0 : z.map((T, L) => {
3610
- var V, m;
3603
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (z = y == null ? void 0 : y.dataInputs) == null ? void 0 : z.map((F, T) => {
3604
+ var A, m;
3611
3605
  return /* @__PURE__ */ e.jsxs(
3612
3606
  "div",
3613
3607
  {
3614
3608
  className: "grid grid-cols-10 gap-2",
3615
3609
  children: [
3616
- /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: T }),
3610
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: F }),
3617
3611
  /* @__PURE__ */ e.jsx(
3618
3612
  de,
3619
3613
  {
3620
3614
  className: "col-span-6 h-8 w-full justify-between",
3621
3615
  label: "",
3622
- options: A || [],
3623
- value: ((m = (V = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : V[L]) == null ? void 0 : m.cardId) || "",
3624
- onValueChange: (v) => c(L, v)
3616
+ options: V || [],
3617
+ value: ((m = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[T]) == null ? void 0 : m.cardId) || "",
3618
+ onValueChange: (v) => c(T, v)
3625
3619
  }
3626
3620
  )
3627
3621
  ]
3628
3622
  },
3629
- L + Math.random()
3623
+ T + Math.random()
3630
3624
  );
3631
3625
  }) });
3632
3626
  }
3633
- function g(y, A, I = []) {
3634
- var z, T;
3627
+ function g(y, V, I = []) {
3628
+ var z, F;
3635
3629
  return s ? y === "input" ? /* @__PURE__ */ e.jsx(
3636
3630
  ie,
3637
3631
  {
3638
- className: `h-8 w-full ${Pe}`,
3639
- value: ((z = s == null ? void 0 : s.settings) == null ? void 0 : z[A]) || "",
3640
- onChange: (L) => {
3641
- i({
3632
+ className: `h-8 w-full ${$e}`,
3633
+ value: ((z = s == null ? void 0 : s.settings) == null ? void 0 : z[V]) || "",
3634
+ onChange: (T) => {
3635
+ o({
3642
3636
  ...s,
3643
3637
  settings: {
3644
3638
  ...s == null ? void 0 : s.settings,
3645
- [A]: L.target.value
3639
+ [V]: T.target.value
3646
3640
  }
3647
3641
  });
3648
3642
  }
3649
3643
  },
3650
- A
3644
+ V
3651
3645
  ) : y === "select" ? /* @__PURE__ */ e.jsx(
3652
3646
  de,
3653
3647
  {
3654
3648
  className: "h-8 w-full",
3655
3649
  label: "",
3656
3650
  options: I,
3657
- value: ((T = s == null ? void 0 : s.settings) == null ? void 0 : T[A]) || "",
3658
- onValueChange: (L) => {
3659
- i({
3651
+ value: ((F = s == null ? void 0 : s.settings) == null ? void 0 : F[V]) || "",
3652
+ onValueChange: (T) => {
3653
+ o({
3660
3654
  ...s,
3661
- settings: { ...s == null ? void 0 : s.settings, [A]: L }
3655
+ settings: { ...s == null ? void 0 : s.settings, [V]: T }
3662
3656
  });
3663
3657
  }
3664
3658
  }
3665
3659
  ) : null : null;
3666
3660
  }
3667
3661
  function h(y) {
3668
- const A = Object.entries((y == null ? void 0 : y.settings) || {});
3669
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: A.map(([I, z]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3662
+ const V = Object.entries((y == null ? void 0 : y.settings) || {});
3663
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: V.map(([I, z]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3670
3664
  /* @__PURE__ */ e.jsx(H, { children: z.title }),
3671
3665
  g(
3672
3666
  z.ui,
@@ -3676,7 +3670,7 @@ function Vl() {
3676
3670
  ] }, I)) });
3677
3671
  }
3678
3672
  function f(y) {
3679
- s && i({
3673
+ s && o({
3680
3674
  ...s,
3681
3675
  visualType: y,
3682
3676
  componentName: ""
@@ -3687,7 +3681,7 @@ function Vl() {
3687
3681
  {
3688
3682
  className: "p-6",
3689
3683
  children: [
3690
- /* @__PURE__ */ e.jsx($e, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
3684
+ /* @__PURE__ */ e.jsx(Pe, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
3691
3685
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
3692
3686
  de,
3693
3687
  {
@@ -3695,7 +3689,7 @@ function Vl() {
3695
3689
  label: "",
3696
3690
  options: a,
3697
3691
  value: (s == null ? void 0 : s.url) || "",
3698
- onValueChange: (y) => i({
3692
+ onValueChange: (y) => o({
3699
3693
  ...s || {
3700
3694
  url: "",
3701
3695
  componentName: ""
@@ -3705,7 +3699,7 @@ function Vl() {
3705
3699
  }
3706
3700
  ) }) }),
3707
3701
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
3708
- Al,
3702
+ Vl,
3709
3703
  {
3710
3704
  options: [
3711
3705
  { value: "single", label: "Single Visual" },
@@ -3717,12 +3711,12 @@ function Vl() {
3717
3711
  ),
3718
3712
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3719
3713
  /* @__PURE__ */ e.jsx(H, { children: "Component" }),
3720
- /* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: o && /* @__PURE__ */ e.jsx(
3714
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: i && /* @__PURE__ */ e.jsx(
3721
3715
  de,
3722
3716
  {
3723
3717
  className: "h-8 w-full",
3724
3718
  label: "",
3725
- options: (o == null ? void 0 : o.filter(
3719
+ options: (i == null ? void 0 : i.filter(
3726
3720
  (y) => y.type === r
3727
3721
  ).map((y) => ({
3728
3722
  value: y.name,
@@ -3730,7 +3724,7 @@ function Vl() {
3730
3724
  }))) || [],
3731
3725
  value: s.componentName,
3732
3726
  onValueChange: (y) => {
3733
- console.log("changing value", y), i({
3727
+ console.log("changing value", y), o({
3734
3728
  ...s,
3735
3729
  componentName: y
3736
3730
  });
@@ -3740,7 +3734,7 @@ function Vl() {
3740
3734
  ] }) })
3741
3735
  ] }) }) }),
3742
3736
  /* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
3743
- ((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs($e, { summary: "Component Settings", children: [
3737
+ ((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs(Pe, { summary: "Component Settings", children: [
3744
3738
  x && x.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3745
3739
  /* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
3746
3740
  /* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(x) })
@@ -3756,7 +3750,7 @@ function Ie() {
3756
3750
  u(
3757
3751
  (c) => c.card.cfg
3758
3752
  );
3759
- const a = u((c) => c.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: r } = u((c) => c.actions), i = u(
3753
+ const a = u((c) => c.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: r } = u((c) => c.actions), o = u(
3760
3754
  (c) => c.queryResultColumns
3761
3755
  );
3762
3756
  u(
@@ -3764,10 +3758,10 @@ function Ie() {
3764
3758
  var b;
3765
3759
  return (b = c.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
3766
3760
  }
3767
- ), Z(() => {
3768
- i && n(new Array(i.length).fill(!1));
3769
- }, [i]);
3770
- function o(c, b) {
3761
+ ), X(() => {
3762
+ o && n(new Array(o.length).fill(!1));
3763
+ }, [o]);
3764
+ function i(c, b) {
3771
3765
  var g, h;
3772
3766
  b ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? r({
3773
3767
  ...a,
@@ -3823,7 +3817,7 @@ function Ie() {
3823
3817
  }
3824
3818
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3825
3819
  /* @__PURE__ */ e.jsx(H, { children: "On Click" }),
3826
- i == null ? void 0 : i.map((c, b) => {
3820
+ o == null ? void 0 : o.map((c, b) => {
3827
3821
  var g, h;
3828
3822
  return /* @__PURE__ */ e.jsx(
3829
3823
  "div",
@@ -3832,12 +3826,12 @@ function Ie() {
3832
3826
  children: /* @__PURE__ */ e.jsxs("div", { className: "grow", children: [
3833
3827
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 py-2", children: [
3834
3828
  /* @__PURE__ */ e.jsx(
3835
- As,
3829
+ Vs,
3836
3830
  {
3837
3831
  checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
3838
3832
  (f) => f.columnIndex === b
3839
3833
  )),
3840
- onCheckedChange: (f) => o(b, f)
3834
+ onCheckedChange: (f) => i(b, f)
3841
3835
  }
3842
3836
  ),
3843
3837
  /* @__PURE__ */ e.jsx(
@@ -3871,18 +3865,18 @@ function Ie() {
3871
3865
  ] });
3872
3866
  }
3873
3867
  function xs() {
3874
- var i, o, d;
3868
+ var o, i, d;
3875
3869
  const s = u((x) => x.card.preferences), n = u(
3876
3870
  (x) => x.card.cfg
3877
3871
  ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = u((x) => x.actions);
3878
- (i = n == null ? void 0 : n.options) != null && i.indexAxis;
3872
+ (o = n == null ? void 0 : n.options) != null && o.indexAxis;
3879
3873
  function r(x) {
3880
3874
  l(x);
3881
3875
  }
3882
3876
  return /* @__PURE__ */ e.jsxs(
3883
3877
  ms,
3884
3878
  {
3885
- value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((d = n == null ? void 0 : n.options) == null ? void 0 : d.indexAxis) || "x",
3879
+ value: ((i = s == null ? void 0 : s.chartOptions) == null ? void 0 : i.indexAxis) || ((d = n == null ? void 0 : n.options) == null ? void 0 : d.indexAxis) || "x",
3886
3880
  onValueChange: r,
3887
3881
  className: "flex gap-3",
3888
3882
  defaultValue: "x",
@@ -3905,40 +3899,40 @@ function aa(s, n) {
3905
3899
  const a = wa(s, n);
3906
3900
  return ((r = (l = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : l[a]) == null ? void 0 : r.type) || "linear";
3907
3901
  }
3908
- function Xa() {
3909
- var ee, G, se, k, P, U;
3902
+ function Za() {
3903
+ var ee, G, se, k, $, U;
3910
3904
  const [s, n] = q(!1), a = u((E) => {
3911
- var F;
3912
- return (F = E.card) == null ? void 0 : F.preferences;
3905
+ var L;
3906
+ return (L = E.card) == null ? void 0 : L.preferences;
3913
3907
  }), t = u((E) => {
3914
- var F;
3915
- return (F = E.card) == null ? void 0 : F.cfg;
3916
- }), l = wa(a, t), [r, i] = q(
3908
+ var L;
3909
+ return (L = E.card) == null ? void 0 : L.cfg;
3910
+ }), l = wa(a, t), [r, o] = q(
3917
3911
  aa(a)
3918
- ), [o, d] = q(
3912
+ ), [i, d] = q(
3919
3913
  ((se = (G = (ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : G[l]) == null ? void 0 : se.min) || ""
3920
3914
  ), [x, c] = q(
3921
- ((U = (P = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : P[l]) == null ? void 0 : U.max) || ""
3922
- ), [b, g] = q(o || x ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y, A] = q(""), [I, z] = q(""), [T, L] = q(""), V = u(
3915
+ ((U = ($ = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : $[l]) == null ? void 0 : U.max) || ""
3916
+ ), [b, g] = q(i || x ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y, V] = q(""), [I, z] = q(""), [F, T] = q(""), A = u(
3923
3917
  (E) => E.actions.setCardPreferences
3924
3918
  ), { updateCardInFrame: m } = ne(), v = u((E) => E.card), j = u((E) => {
3925
- var F;
3926
- return (F = E.card) == null ? void 0 : F.type;
3919
+ var L;
3920
+ return (L = E.card) == null ? void 0 : L.type;
3927
3921
  }), D = ["pie", "doughnut", "polarArea"].includes(j);
3928
- Z(() => {
3929
- var E, F, re, B, ae, te, je, Te, we, Le, Fe, Ee, Ae, w;
3930
- i(aa(a)), d(
3931
- ((re = (F = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : F[l]) == null ? void 0 : re.min) === 0 ? 0 : ""
3922
+ X(() => {
3923
+ var E, L, re, B, ae, te, je, Fe, we, Te, Le, Ee, Ve, w;
3924
+ o(aa(a)), d(
3925
+ ((re = (L = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : L[l]) == null ? void 0 : re.min) === 0 ? 0 : ""
3932
3926
  ), c(((te = (ae = (B = a == null ? void 0 : a.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : ae[l]) == null ? void 0 : te.max) || ""), f(
3933
- ((Le = (we = (Te = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : Te[l]) == null ? void 0 : we.ticks) == null ? void 0 : Le.stepSize) || ""
3934
- ), N(((Fe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Fe.decimalPlaces) || 0), A(((Ee = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ee.suffix) || ""), z(((Ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ae.currency) || ""), L(((w = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : w.locale) || "");
3927
+ ((Te = (we = (Fe = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : Fe[l]) == null ? void 0 : we.ticks) == null ? void 0 : Te.stepSize) || ""
3928
+ ), N(((Le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Le.decimalPlaces) || 0), V(((Ee = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ee.suffix) || ""), z(((Ve = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ve.currency) || ""), T(((w = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : w.locale) || "");
3935
3929
  }, [s, a, l]);
3936
- function S(E, F) {
3937
- return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(E);
3930
+ function S(E, L) {
3931
+ return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(E);
3938
3932
  }
3939
3933
  function _() {
3940
3934
  const E = [
3941
- ...new Set(ts.map((F) => F.currency))
3935
+ ...new Set(ts.map((L) => L.currency))
3942
3936
  ];
3943
3937
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3944
3938
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
@@ -3961,18 +3955,18 @@ function Xa() {
3961
3955
  ue,
3962
3956
  {
3963
3957
  value: I || "none",
3964
- onValueChange: (F) => z(F === "none" ? "" : F),
3958
+ onValueChange: (L) => z(L === "none" ? "" : L),
3965
3959
  children: [
3966
3960
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
3967
3961
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3968
3962
  /* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
3969
- /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
3970
- E.map((F) => /* @__PURE__ */ e.jsx(X, { value: F, children: F }, F))
3963
+ /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }),
3964
+ E.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L, children: L }, L))
3971
3965
  ] }) })
3972
3966
  ]
3973
3967
  }
3974
3968
  ),
3975
- /* @__PURE__ */ e.jsxs(ue, { value: T, onValueChange: (F) => L(F), children: [
3969
+ /* @__PURE__ */ e.jsxs(ue, { value: F, onValueChange: (L) => T(L), children: [
3976
3970
  /* @__PURE__ */ e.jsx(
3977
3971
  he,
3978
3972
  {
@@ -3982,7 +3976,7 @@ function Xa() {
3982
3976
  ),
3983
3977
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3984
3978
  /* @__PURE__ */ e.jsx(pe, { children: "Locale" }),
3985
- ts.map((F) => /* @__PURE__ */ e.jsx(X, { value: F.locale, children: F.locale }, F.locale))
3979
+ ts.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L.locale, children: L.locale }, L.locale))
3986
3980
  ] }) })
3987
3981
  ] })
3988
3982
  ] }),
@@ -3992,7 +3986,7 @@ function Xa() {
3992
3986
  ie,
3993
3987
  {
3994
3988
  value: p,
3995
- onChange: (F) => N(Number(F.target.value)),
3989
+ onChange: (L) => N(Number(L.target.value)),
3996
3990
  id: "format",
3997
3991
  className: `col-span-6 h-8 w-full tracking-wide ${We}`
3998
3992
  }
@@ -4000,7 +3994,7 @@ function Xa() {
4000
3994
  ] })
4001
3995
  ] });
4002
3996
  }
4003
- function $() {
3997
+ function P() {
4004
3998
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4005
3999
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
4006
4000
  /* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
@@ -4008,8 +4002,8 @@ function Xa() {
4008
4002
  ie,
4009
4003
  {
4010
4004
  id: "min",
4011
- value: o,
4012
- onChange: (E) => d((F) => S(F, E.target.value)),
4005
+ value: i,
4006
+ onChange: (E) => d((L) => S(L, E.target.value)),
4013
4007
  className: `col-span-1 h-8 w-full ${We}`
4014
4008
  }
4015
4009
  ),
@@ -4017,7 +4011,7 @@ function Xa() {
4017
4011
  ie,
4018
4012
  {
4019
4013
  value: x,
4020
- onChange: (E) => c((F) => S(F, E.target.value)),
4014
+ onChange: (E) => c((L) => S(L, E.target.value)),
4021
4015
  id: "max",
4022
4016
  className: `col-span-1 h-8 w-full ${We}`
4023
4017
  }
@@ -4029,7 +4023,7 @@ function Xa() {
4029
4023
  ie,
4030
4024
  {
4031
4025
  value: h,
4032
- onChange: (E) => f((F) => S(F, E.target.value)),
4026
+ onChange: (E) => f((L) => S(L, E.target.value)),
4033
4027
  id: "step-size",
4034
4028
  className: `col-span-1 h-8 w-full ${We}`
4035
4029
  }
@@ -4041,13 +4035,13 @@ function Xa() {
4041
4035
  var B;
4042
4036
  let E = {};
4043
4037
  b === "custom" && (E = {
4044
- min: o,
4038
+ min: i,
4045
4039
  max: x,
4046
4040
  ticks: {
4047
4041
  stepSize: h
4048
4042
  }
4049
4043
  });
4050
- const F = {
4044
+ const L = {
4051
4045
  ...a || {},
4052
4046
  chartOptions: {
4053
4047
  ...a == null ? void 0 : a.chartOptions,
@@ -4064,18 +4058,18 @@ function Xa() {
4064
4058
  decimalPlaces: p,
4065
4059
  suffix: y,
4066
4060
  currency: I,
4067
- locale: T
4061
+ locale: F
4068
4062
  }
4069
4063
  };
4070
- console.log(F), V(F);
4064
+ console.log(L), A(L);
4071
4065
  const re = {
4072
4066
  ...v,
4073
- preferences: F
4067
+ preferences: L
4074
4068
  };
4075
4069
  m(re);
4076
4070
  }
4077
4071
  return /* @__PURE__ */ e.jsxs(ds, { onOpenChange: (E) => n(E), children: [
4078
- /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(Zt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4072
+ /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(Xt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4079
4073
  /* @__PURE__ */ e.jsx(hs, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
4080
4074
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4081
4075
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
@@ -4089,13 +4083,13 @@ function Xa() {
4089
4083
  {
4090
4084
  disabled: D,
4091
4085
  value: r,
4092
- onValueChange: (E) => i(E),
4086
+ onValueChange: (E) => o(E),
4093
4087
  children: [
4094
4088
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4095
4089
  /* @__PURE__ */ e.jsx(xe, { id: "type", children: /* @__PURE__ */ e.jsxs(ve, { children: [
4096
4090
  /* @__PURE__ */ e.jsx(pe, { children: "Option" }),
4097
- /* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
4098
- /* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
4091
+ /* @__PURE__ */ e.jsx(Z, { value: "linear", children: "Linear" }),
4092
+ /* @__PURE__ */ e.jsx(Z, { value: "logarithmic", children: "Logarithmic" })
4099
4093
  ] }) })
4100
4094
  ]
4101
4095
  }
@@ -4125,7 +4119,7 @@ function Xa() {
4125
4119
  }
4126
4120
  )
4127
4121
  ] }),
4128
- b === "custom" && r == "linear" && $(),
4122
+ b === "custom" && r == "linear" && P(),
4129
4123
  _(),
4130
4124
  /* @__PURE__ */ e.jsx(en, {}),
4131
4125
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
@@ -4142,7 +4136,7 @@ function Xa() {
4142
4136
  ] });
4143
4137
  }
4144
4138
  function ql({ idx: s }) {
4145
- var o;
4139
+ var i;
4146
4140
  const n = u((d) => {
4147
4141
  var x;
4148
4142
  return (x = d.card) == null ? void 0 : x.preferences;
@@ -4153,8 +4147,8 @@ function ql({ idx: s }) {
4153
4147
  }
4154
4148
  ), t = u(
4155
4149
  (d) => d.actions.setCardPreferences
4156
- ), l = (o = n == null ? void 0 : n.chartOptions) == null ? void 0 : o.indexAxis, r = a == null ? void 0 : a.find((d) => d.idx === s);
4157
- function i(d, x) {
4150
+ ), l = (i = n == null ? void 0 : n.chartOptions) == null ? void 0 : i.indexAxis, r = a == null ? void 0 : a.find((d) => d.idx === s);
4151
+ function o(d, x) {
4158
4152
  (d === "end" || d === "start") && sn(an());
4159
4153
  const c = {
4160
4154
  display: d !== "none",
@@ -4191,7 +4185,7 @@ function ql({ idx: s }) {
4191
4185
  /* @__PURE__ */ e.jsx(
4192
4186
  O,
4193
4187
  {
4194
- onClick: () => i("none", s),
4188
+ onClick: () => o("none", s),
4195
4189
  size: "sm",
4196
4190
  variant: "secondary",
4197
4191
  className: "h-7 p-1 text-xs font-normal",
@@ -4201,12 +4195,12 @@ function ql({ idx: s }) {
4201
4195
  /* @__PURE__ */ e.jsx(
4202
4196
  O,
4203
4197
  {
4204
- onClick: () => i("start", s),
4198
+ onClick: () => o("start", s),
4205
4199
  size: "sm",
4206
4200
  variant: "secondary",
4207
4201
  className: "h-7 p-1 text-xs font-normal",
4208
4202
  children: /* @__PURE__ */ e.jsx(
4209
- An,
4203
+ Vn,
4210
4204
  {
4211
4205
  className: Y("h-4 w-4", {
4212
4206
  "rotate-90": l === "y"
@@ -4218,7 +4212,7 @@ function ql({ idx: s }) {
4218
4212
  /* @__PURE__ */ e.jsx(
4219
4213
  O,
4220
4214
  {
4221
- onClick: () => i("center", s),
4215
+ onClick: () => o("center", s),
4222
4216
  size: "sm",
4223
4217
  variant: "secondary",
4224
4218
  className: "h-7 p-1 text-xs font-normal",
@@ -4235,12 +4229,12 @@ function ql({ idx: s }) {
4235
4229
  /* @__PURE__ */ e.jsx(
4236
4230
  O,
4237
4231
  {
4238
- onClick: () => i("end", s),
4232
+ onClick: () => o("end", s),
4239
4233
  size: "sm",
4240
4234
  variant: "secondary",
4241
4235
  className: "h-7 p-1 text-xs font-normal",
4242
4236
  children: /* @__PURE__ */ e.jsx(
4243
- Vn,
4237
+ An,
4244
4238
  {
4245
4239
  className: Y("h-4 w-4", {
4246
4240
  "rotate-90": l === "y"
@@ -4252,7 +4246,7 @@ function ql({ idx: s }) {
4252
4246
  ] }) })
4253
4247
  ] });
4254
4248
  }
4255
- function Za() {
4249
+ function Xa() {
4256
4250
  const s = u((x) => x.card), n = u(
4257
4251
  (x) => {
4258
4252
  var c, b, g;
@@ -4260,15 +4254,15 @@ function Za() {
4260
4254
  }
4261
4255
  ), { data: a } = De(s), t = n === "y" ? "Y axis" : "X axis", l = n === "y" ? "X axis" : "Y axis", {
4262
4256
  keys: r,
4263
- metricKeys: i,
4264
- dimensionKeys: o
4257
+ metricKeys: o,
4258
+ dimensionKeys: i
4265
4259
  } = js((a == null ? void 0 : a.records) || []);
4266
- let d = i;
4260
+ let d = o;
4267
4261
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4268
4262
  const x = tn({
4269
4263
  dataArray: (a == null ? void 0 : a.records) || [],
4270
- groupKey: o[0],
4271
- pivotKey: o[1],
4264
+ groupKey: i[0],
4265
+ pivotKey: i[1],
4272
4266
  valueKey: d[0]
4273
4267
  }), { metricKeys: c } = js(x);
4274
4268
  d = c;
@@ -4276,28 +4270,28 @@ function Za() {
4276
4270
  return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4277
4271
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4278
4272
  /* @__PURE__ */ e.jsx(H, { children: t }),
4279
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: o[0] }) }) })
4273
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: i[0] }) }) })
4280
4274
  ] }),
4281
4275
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4282
4276
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
4283
4277
  /* @__PURE__ */ e.jsx(H, { children: l }),
4284
- /* @__PURE__ */ e.jsx(Xa, {})
4278
+ /* @__PURE__ */ e.jsx(Za, {})
4285
4279
  ] }),
4286
4280
  /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((x, c) => /* @__PURE__ */ e.jsx(Rl, { col: x, idx: c }, x)) })
4287
4281
  ] })
4288
4282
  ] });
4289
4283
  }
4290
4284
  function Rl({ col: s, idx: n }) {
4291
- const a = u((o) => {
4285
+ const a = u((i) => {
4292
4286
  var d;
4293
- return (d = o.card) == null ? void 0 : d.preferences;
4287
+ return (d = i.card) == null ? void 0 : d.preferences;
4294
4288
  }), t = u(
4295
- (o) => {
4289
+ (i) => {
4296
4290
  var d;
4297
- return (d = o.card.preferences) == null ? void 0 : d.datasetOptions;
4291
+ return (d = i.card.preferences) == null ? void 0 : d.datasetOptions;
4298
4292
  }
4299
- ), l = t == null ? void 0 : t.find((o) => o.idx === n), { setCardPreferences: r } = u((o) => o.actions);
4300
- function i(o) {
4293
+ ), l = t == null ? void 0 : t.find((i) => i.idx === n), { setCardPreferences: r } = u((i) => i.actions);
4294
+ function o(i) {
4301
4295
  if (!l)
4302
4296
  r({
4303
4297
  ...a,
@@ -4305,14 +4299,14 @@ function Rl({ col: s, idx: n }) {
4305
4299
  ...t || [],
4306
4300
  {
4307
4301
  idx: n,
4308
- type: o === "area" ? "line" : o,
4309
- fill: o === "area" ? "origin" : ""
4302
+ type: i === "area" ? "line" : i,
4303
+ fill: i === "area" ? "origin" : ""
4310
4304
  }
4311
4305
  ]
4312
4306
  });
4313
4307
  else {
4314
4308
  const d = { ...l };
4315
- d.type = o === "area" ? "line" : o, d.fill = o === "area" ? "origin" : "";
4309
+ d.type = i === "area" ? "line" : i, d.fill = i === "area" ? "origin" : "";
4316
4310
  const x = t == null ? void 0 : t.map(
4317
4311
  (c) => c.idx === n ? d : c
4318
4312
  );
@@ -4328,21 +4322,21 @@ function Rl({ col: s, idx: n }) {
4328
4322
  /* @__PURE__ */ e.jsx(
4329
4323
  qs,
4330
4324
  {
4331
- onClick: () => i("bar"),
4325
+ onClick: () => o("bar"),
4332
4326
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4333
4327
  }
4334
4328
  ),
4335
4329
  /* @__PURE__ */ e.jsx(
4336
4330
  Rs,
4337
4331
  {
4338
- onClick: () => i("line"),
4332
+ onClick: () => o("line"),
4339
4333
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4340
4334
  }
4341
4335
  ),
4342
4336
  /* @__PURE__ */ e.jsx(
4343
4337
  wn,
4344
4338
  {
4345
- onClick: () => i("area"),
4339
+ onClick: () => o("area"),
4346
4340
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4347
4341
  }
4348
4342
  ),
@@ -4351,28 +4345,28 @@ function Rl({ col: s, idx: n }) {
4351
4345
  ] });
4352
4346
  }
4353
4347
  function et() {
4354
- const s = u((g) => g.selectedConnectionId), n = u((g) => g.selectedDatamodelId), a = u((g) => g.selectedDatabaseName), t = u((g) => g.selectedSchemaName), l = u((g) => g.selectedTableName), r = M((g) => g.dashboard.filters) || [], i = M((g) => g.actions.addFilter), o = M((g) => g.actions.removeFilter), { removeFilterValues: d } = is(), { modelItems: x, tableName: c } = qe();
4348
+ const s = u((g) => g.selectedConnectionId), n = u((g) => g.selectedDatamodelId), a = u((g) => g.selectedDatabaseName), t = u((g) => g.selectedSchemaName), l = u((g) => g.selectedTableName), r = M((g) => g.dashboard.filters) || [], o = M((g) => g.actions.addFilter), i = M((g) => g.actions.removeFilter), { removeFilterValues: d } = is(), { modelItems: x, tableName: c } = qe();
4355
4349
  function b(g, h = "dashboard") {
4356
- var L;
4350
+ var T;
4357
4351
  const f = ce(g.column_name), p = ce(a || ""), N = ce(t || ""), y = ce(c);
4358
- let A = xa(
4352
+ let V = xa(
4359
4353
  N,
4360
4354
  y
4361
- ), I = `${A}.${f}`;
4362
- const z = (L = x == null ? void 0 : x.find(
4363
- (V) => V.id === n
4364
- )) == null ? void 0 : L.name;
4365
- n && n !== "none" && (I = `${gs}.${z}.${f}`, A = `${gs}.${z}`);
4366
- const T = r == null ? void 0 : r.find(
4367
- (V) => V.column === I && V.table === y && (V.database === p || V.database === a)
4355
+ ), I = `${V}.${f}`;
4356
+ const z = (T = x == null ? void 0 : x.find(
4357
+ (A) => A.id === n
4358
+ )) == null ? void 0 : T.name;
4359
+ n && n !== "none" && (I = `${gs}.${z}.${f}`, V = `${gs}.${z}`);
4360
+ const F = r == null ? void 0 : r.find(
4361
+ (A) => A.column === I && A.table === y && (A.database === p || A.database === a)
4368
4362
  );
4369
- if (T)
4370
- d(T.id), o(T.id);
4363
+ if (F)
4364
+ d(F.id), i(F.id);
4371
4365
  else {
4372
- const V = Ue();
4373
- return c === "api" && s ? (i({
4366
+ const A = Ue();
4367
+ return c === "api" && s ? (o({
4374
4368
  location: h,
4375
- id: V,
4369
+ id: A,
4376
4370
  //uuidv4(),
4377
4371
  column: I,
4378
4372
  title: g.column_name,
@@ -4384,12 +4378,12 @@ function et() {
4384
4378
  operation: "in",
4385
4379
  sql: Ws(
4386
4380
  g.data_type,
4387
- A,
4381
+ V,
4388
4382
  f
4389
4383
  )
4390
4384
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4391
- }), V) : (i({
4392
- id: V,
4385
+ }), A) : (o({
4386
+ id: A,
4393
4387
  //uuidv4(),
4394
4388
  location: h,
4395
4389
  column: I,
@@ -4402,35 +4396,35 @@ function et() {
4402
4396
  operation: "in",
4403
4397
  sql: Ws(
4404
4398
  g.data_type,
4405
- A,
4399
+ V,
4406
4400
  f
4407
4401
  )
4408
4402
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4409
- }), V);
4403
+ }), A);
4410
4404
  }
4411
4405
  }
4412
4406
  return { assignFilter: b };
4413
4407
  }
4414
4408
  function Re() {
4415
4409
  const s = M(
4416
- (o) => o.dashboard.filters
4417
- ), n = u((o) => o.frame), { setFrame: a } = ne(), { columns: t } = qe(), { assignFilter: l } = et();
4418
- function r(o) {
4419
- const d = l(o, "frame");
4410
+ (i) => i.dashboard.filters
4411
+ ), n = u((i) => i.frame), { setFrame: a } = ne(), { columns: t } = qe(), { assignFilter: l } = et();
4412
+ function r(i) {
4413
+ const d = l(i, "frame");
4420
4414
  a({ ...n, filterId: d });
4421
4415
  }
4422
- const i = s == null ? void 0 : s.find((o) => o.id === n.filterId);
4416
+ const o = s == null ? void 0 : s.find((i) => i.id === n.filterId);
4423
4417
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4424
4418
  /* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
4425
4419
  /* @__PURE__ */ e.jsx(_l, { onSelect: r, columns: t }),
4426
- i && /* @__PURE__ */ e.jsx(ka, { filter: i })
4420
+ o && /* @__PURE__ */ e.jsx(ka, { filter: o })
4427
4421
  ] });
4428
4422
  }
4429
4423
  function _l({
4430
4424
  columns: s,
4431
4425
  onSelect: n
4432
4426
  }) {
4433
- var i;
4427
+ var o;
4434
4428
  const [a, t] = Ys.useState(!1), [l, r] = Ys.useState("");
4435
4429
  return /* @__PURE__ */ e.jsxs(ds, { open: a, onOpenChange: t, children: [
4436
4430
  /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
@@ -4442,7 +4436,7 @@ function _l({
4442
4436
  "aria-expanded": a,
4443
4437
  className: "w-full justify-between font-normal",
4444
4438
  children: [
4445
- l ? (i = s.find((o) => o.column_name === l)) == null ? void 0 : i.column_name : "Select Column...",
4439
+ l ? (o = s.find((i) => i.column_name === l)) == null ? void 0 : o.column_name : "Select Column...",
4446
4440
  /* @__PURE__ */ e.jsx(nn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4447
4441
  ]
4448
4442
  }
@@ -4451,28 +4445,28 @@ function _l({
4451
4445
  /* @__PURE__ */ e.jsx(rn, { placeholder: "Search column", className: "h-9" }),
4452
4446
  /* @__PURE__ */ e.jsxs(on, { children: [
4453
4447
  /* @__PURE__ */ e.jsx(cn, { children: "No framework found." }),
4454
- /* @__PURE__ */ e.jsx(dn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
4448
+ /* @__PURE__ */ e.jsx(dn, { children: s.map((i) => /* @__PURE__ */ e.jsxs(
4455
4449
  un,
4456
4450
  {
4457
- value: o.column_name,
4451
+ value: i.column_name,
4458
4452
  onSelect: (d) => {
4459
4453
  const x = d === l ? "" : d;
4460
- r(x), t(!1), x && n(o);
4454
+ r(x), t(!1), x && n(i);
4461
4455
  },
4462
4456
  children: [
4463
- o.column_name,
4457
+ i.column_name,
4464
4458
  /* @__PURE__ */ e.jsx(
4465
4459
  Na,
4466
4460
  {
4467
4461
  className: Y(
4468
4462
  "ml-auto h-4 w-4",
4469
- l === o.column_name ? "opacity-100" : "opacity-0"
4463
+ l === i.column_name ? "opacity-100" : "opacity-0"
4470
4464
  )
4471
4465
  }
4472
4466
  )
4473
4467
  ]
4474
4468
  },
4475
- o.column_name
4469
+ i.column_name
4476
4470
  )) })
4477
4471
  ] })
4478
4472
  ] }) })
@@ -4483,7 +4477,7 @@ function Hl({
4483
4477
  }) {
4484
4478
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
4485
4479
  /* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
4486
- /* @__PURE__ */ e.jsx(J, { children: `${Vs(s)} Chart` }),
4480
+ /* @__PURE__ */ e.jsx(J, { children: `${As(s)} Chart` }),
4487
4481
  /* @__PURE__ */ e.jsxs(W, { className: "space-y-4 font-mono text-xs", children: [
4488
4482
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
4489
4483
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -4511,7 +4505,7 @@ function Hl({
4511
4505
  /* @__PURE__ */ e.jsx(J, { children: "Settings" }),
4512
4506
  /* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
4513
4507
  /* @__PURE__ */ e.jsx(xs, {}),
4514
- /* @__PURE__ */ e.jsx(Za, {})
4508
+ /* @__PURE__ */ e.jsx(Xa, {})
4515
4509
  ] })
4516
4510
  ] }),
4517
4511
  /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
@@ -4524,17 +4518,17 @@ function Hl({
4524
4518
  ] }) });
4525
4519
  }
4526
4520
  function Hs() {
4527
- var l, r, i;
4521
+ var l, r, o;
4528
4522
  const s = u(
4529
- (o) => o.card.cfg
4530
- ), n = u((o) => o.actions.setCardCfg), a = u((o) => o.card.type);
4531
- function t(o) {
4523
+ (i) => i.card.cfg
4524
+ ), n = u((i) => i.actions.setCardCfg), a = u((i) => i.card.type);
4525
+ function t(i) {
4532
4526
  var c;
4533
4527
  const d = {
4534
4528
  datalabels: {
4535
- display: o !== "none",
4536
- align: o,
4537
- anchor: o,
4529
+ display: i !== "none",
4530
+ align: i,
4531
+ anchor: i,
4538
4532
  clamp: !0
4539
4533
  }
4540
4534
  }, x = {
@@ -4547,34 +4541,34 @@ function Hs() {
4547
4541
  }
4548
4542
  }
4549
4543
  };
4550
- n(x), console.log(o);
4544
+ n(x), console.log(i);
4551
4545
  }
4552
4546
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4553
4547
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
4554
4548
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
4555
- !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Xa, {})
4549
+ !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Za, {})
4556
4550
  ] }),
4557
4551
  /* @__PURE__ */ e.jsxs(
4558
4552
  ue,
4559
4553
  {
4560
- value: (i = (r = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : i.anchor,
4554
+ value: (o = (r = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : o.anchor,
4561
4555
  onValueChange: t,
4562
4556
  defaultValue: "none",
4563
4557
  children: [
4564
4558
  /* @__PURE__ */ e.jsx(he, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, { placeholder: "Select position" }) }),
4565
4559
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4566
4560
  /* @__PURE__ */ e.jsx(pe, { children: "Data Labels" }),
4567
- /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
4568
- a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
4569
- /* @__PURE__ */ e.jsx(X, { value: "center", children: "Center" }),
4570
- a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "end", children: "End" })
4561
+ /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }),
4562
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(Z, { value: "start", children: "Start" }),
4563
+ /* @__PURE__ */ e.jsx(Z, { value: "center", children: "Center" }),
4564
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(Z, { value: "end", children: "End" })
4571
4565
  ] }) })
4572
4566
  ]
4573
4567
  }
4574
4568
  )
4575
4569
  ] });
4576
4570
  }
4577
- function Pl({
4571
+ function $l({
4578
4572
  cardType: s
4579
4573
  }) {
4580
4574
  function n(a) {
@@ -4605,7 +4599,7 @@ function Pl({
4605
4599
  }
4606
4600
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
4607
4601
  /* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
4608
- /* @__PURE__ */ e.jsx(J, { children: `${Vs(s)} Chart` }),
4602
+ /* @__PURE__ */ e.jsx(J, { children: `${As(s)} Chart` }),
4609
4603
  /* @__PURE__ */ e.jsx(W, { className: "space-y-4 font-mono text-xs", children: n(s) })
4610
4604
  ] }),
4611
4605
  /* @__PURE__ */ e.jsxs(Q, { value: "item-2", children: [
@@ -4621,7 +4615,7 @@ function Pl({
4621
4615
  ] })
4622
4616
  ] }) });
4623
4617
  }
4624
- const $l = {
4618
+ const Pl = {
4625
4619
  datasets: [
4626
4620
  {
4627
4621
  type: "line",
@@ -4685,7 +4679,7 @@ function Gl(s) {
4685
4679
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
4686
4680
  " and change the `type` property in the dataset."
4687
4681
  ] }),
4688
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify($l, null, 2) })
4682
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Pl, null, 2) })
4689
4683
  ] })
4690
4684
  ] }),
4691
4685
  /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
@@ -4793,13 +4787,13 @@ function Kl() {
4793
4787
  var f, p;
4794
4788
  return (p = (f = h.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : p.colorRanges;
4795
4789
  }
4796
- ) || [], i = u(
4790
+ ) || [], o = u(
4797
4791
  (h) => h.actions.setColorRanges
4798
- ), o = [...new Set(ts.map((h) => h.currency))];
4792
+ ), i = [...new Set(ts.map((h) => h.currency))];
4799
4793
  return /* @__PURE__ */ e.jsxs("div", { children: [
4800
4794
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
4801
4795
  /* @__PURE__ */ e.jsx(
4802
- As,
4796
+ Vs,
4803
4797
  {
4804
4798
  checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
4805
4799
  onCheckedChange: (h) => {
@@ -4837,8 +4831,8 @@ function Kl() {
4837
4831
  /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4838
4832
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4839
4833
  /* @__PURE__ */ e.jsx(pe, { children: "Format" }),
4840
- /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
4841
- ts.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
4834
+ /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
4835
+ ts.map((h) => /* @__PURE__ */ e.jsx(Z, { value: h.locale, children: h.locale }, h.locale))
4842
4836
  ] }) })
4843
4837
  ]
4844
4838
  }
@@ -4863,8 +4857,8 @@ function Kl() {
4863
4857
  /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4864
4858
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4865
4859
  /* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
4866
- /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
4867
- o.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
4860
+ /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
4861
+ i.map((h) => /* @__PURE__ */ e.jsx(Z, { value: h, children: h }, h))
4868
4862
  ] }) })
4869
4863
  ]
4870
4864
  }
@@ -4889,7 +4883,7 @@ function Kl() {
4889
4883
  },
4890
4884
  children: [
4891
4885
  /* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4892
- /* @__PURE__ */ e.jsx(xe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h)) })
4886
+ /* @__PURE__ */ e.jsx(xe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(Z, { value: h, children: h }, h)) })
4893
4887
  ]
4894
4888
  }
4895
4889
  )
@@ -4921,7 +4915,7 @@ function Kl() {
4921
4915
  hn,
4922
4916
  {
4923
4917
  colorRanges: r,
4924
- setColorRanges: i
4918
+ setColorRanges: o
4925
4919
  }
4926
4920
  )
4927
4921
  ] })
@@ -5058,14 +5052,14 @@ const Jl = [
5058
5052
  label: s,
5059
5053
  value: s
5060
5054
  }));
5061
- function Xl() {
5062
- var d, x, c, b, g, h, f, p, N, y, A, I, z, T, L, V, m, v;
5055
+ function Zl() {
5056
+ var d, x, c, b, g, h, f, p, N, y, V, I, z, F, T, A, m, v;
5063
5057
  const s = u((j) => j.card), n = (x = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, t] = q(
5064
5058
  ((b = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
5065
- ), { setCardPreferences: l } = ne(), { data: r } = Es(s), i = Object.keys((r == null ? void 0 : r.objects) || {}).map((j) => ({
5059
+ ), { setCardPreferences: l } = ne(), { data: r } = Es(s), o = Object.keys((r == null ? void 0 : r.objects) || {}).map((j) => ({
5066
5060
  label: j,
5067
5061
  value: j
5068
- })) || [], o = [
5062
+ })) || [], i = [
5069
5063
  {
5070
5064
  label: "US States 10m",
5071
5065
  value: "https://unpkg.com/us-atlas/states-10m.json"
@@ -5080,14 +5074,14 @@ function Xl() {
5080
5074
  }
5081
5075
  ];
5082
5076
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
5083
- /* @__PURE__ */ e.jsx($e, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
5077
+ /* @__PURE__ */ e.jsx(Pe, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
5084
5078
  /* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
5085
- /* @__PURE__ */ e.jsx($e, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5079
+ /* @__PURE__ */ e.jsx(Pe, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5086
5080
  /* @__PURE__ */ e.jsx(
5087
5081
  de,
5088
5082
  {
5089
5083
  className: "h-9",
5090
- options: o,
5084
+ options: i,
5091
5085
  onValueChange: (j) => {
5092
5086
  console.log("value", j), l({
5093
5087
  ...s.preferences,
@@ -5118,7 +5112,7 @@ function Xl() {
5118
5112
  });
5119
5113
  },
5120
5114
  value: a,
5121
- className: `h-9 w-full ${Pe}`,
5115
+ className: `h-9 w-full ${$e}`,
5122
5116
  placeholder: "Custom URL"
5123
5117
  }
5124
5118
  ),
@@ -5129,7 +5123,7 @@ function Xl() {
5129
5123
  de,
5130
5124
  {
5131
5125
  className: "h-9",
5132
- options: i,
5126
+ options: o,
5133
5127
  value: ((h = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
5134
5128
  label: "Map Object",
5135
5129
  onValueChange: (j) => {
@@ -5192,14 +5186,14 @@ function Xl() {
5192
5186
  ] })
5193
5187
  ] }) }),
5194
5188
  /* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
5195
- /* @__PURE__ */ e.jsx($e, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5189
+ /* @__PURE__ */ e.jsx(Pe, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5196
5190
  /* @__PURE__ */ e.jsx(
5197
5191
  ie,
5198
5192
  {
5199
- className: `h-9 w-full ${Pe}`,
5193
+ className: `h-9 w-full ${$e}`,
5200
5194
  type: "number",
5201
5195
  step: 0.1,
5202
- value: ((I = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
5196
+ value: ((I = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
5203
5197
  onChange: (j) => {
5204
5198
  var D;
5205
5199
  l({
@@ -5216,19 +5210,19 @@ function Xl() {
5216
5210
  /* @__PURE__ */ e.jsx(
5217
5211
  ie,
5218
5212
  {
5219
- className: `h-9 w-full ${Pe}`,
5213
+ className: `h-9 w-full ${$e}`,
5220
5214
  type: "number",
5221
5215
  step: 10,
5222
- value: ((L = (T = (z = s.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : L[0]) || 0,
5216
+ value: ((T = (F = (z = s.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : F.projectionOffset) == null ? void 0 : T[0]) || 0,
5223
5217
  onChange: (j) => {
5224
- var D, S, _, $;
5218
+ var D, S, _, P;
5225
5219
  l({
5226
5220
  ...s.preferences,
5227
5221
  mapVisualOptions: {
5228
5222
  ...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
5229
5223
  projectionOffset: [
5230
5224
  Number(j.target.value),
5231
- (($ = (_ = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : $[1]) || 0
5225
+ ((P = (_ = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : P[1]) || 0
5232
5226
  ]
5233
5227
  }
5234
5228
  });
@@ -5239,18 +5233,18 @@ function Xl() {
5239
5233
  /* @__PURE__ */ e.jsx(
5240
5234
  ie,
5241
5235
  {
5242
- className: `h-9 w-full ${Pe}`,
5236
+ className: `h-9 w-full ${$e}`,
5243
5237
  type: "number",
5244
5238
  step: 10,
5245
- value: ((v = (m = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : m.projectionOffset) == null ? void 0 : v[1]) || 0,
5239
+ value: ((v = (m = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : m.projectionOffset) == null ? void 0 : v[1]) || 0,
5246
5240
  onChange: (j) => {
5247
- var D, S, _, $;
5241
+ var D, S, _, P;
5248
5242
  l({
5249
5243
  ...s.preferences,
5250
5244
  mapVisualOptions: {
5251
5245
  ...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
5252
5246
  projectionOffset: [
5253
- (($ = (_ = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : $[0]) || 0,
5247
+ ((P = (_ = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : P[0]) || 0,
5254
5248
  Number(j.target.value)
5255
5249
  ]
5256
5250
  }
@@ -5263,7 +5257,7 @@ function Xl() {
5263
5257
  /* @__PURE__ */ e.jsx(Ie, {})
5264
5258
  ] });
5265
5259
  }
5266
- function Zl() {
5260
+ function Xl() {
5267
5261
  var t;
5268
5262
  const s = u((l) => l.card.preferences), { setCardPreferences: n } = u((l) => l.actions);
5269
5263
  function a(l) {
@@ -5303,7 +5297,7 @@ function Ye({
5303
5297
  let t = "pie-chart";
5304
5298
  return s === "radar" && (t = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
5305
5299
  /* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
5306
- /* @__PURE__ */ e.jsx(J, { children: `${Vs(s)} ${a}` }),
5300
+ /* @__PURE__ */ e.jsx(J, { children: `${As(s)} ${a}` }),
5307
5301
  /* @__PURE__ */ e.jsx(W, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5308
5302
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
5309
5303
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -5331,7 +5325,7 @@ function Ye({
5331
5325
  /* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
5332
5326
  s === "range" && /* @__PURE__ */ e.jsx(xs, {}),
5333
5327
  s !== "text" && /* @__PURE__ */ e.jsx(Hs, {}),
5334
- s === "text" && /* @__PURE__ */ e.jsx(Zl, {})
5328
+ s === "text" && /* @__PURE__ */ e.jsx(Xl, {})
5335
5329
  ] })
5336
5330
  ] }),
5337
5331
  !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
@@ -5411,7 +5405,7 @@ function er() {
5411
5405
  /* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
5412
5406
  /* @__PURE__ */ e.jsx(xs, {}),
5413
5407
  a(),
5414
- /* @__PURE__ */ e.jsx(Za, {})
5408
+ /* @__PURE__ */ e.jsx(Xa, {})
5415
5409
  ] })
5416
5410
  ] }),
5417
5411
  /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
@@ -5444,7 +5438,7 @@ function sr({}) {
5444
5438
  ] })
5445
5439
  ] }) }),
5446
5440
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5447
- /* @__PURE__ */ e.jsx(As, { onCheckedChange: a, id: "allow-download" }),
5441
+ /* @__PURE__ */ e.jsx(Vs, { onCheckedChange: a, id: "allow-download" }),
5448
5442
  /* @__PURE__ */ e.jsx(
5449
5443
  "label",
5450
5444
  {
@@ -5528,7 +5522,7 @@ function lr() {
5528
5522
  return /* @__PURE__ */ e.jsx(Ye, { cardType: a });
5529
5523
  case "bubble":
5530
5524
  case "scatter":
5531
- return /* @__PURE__ */ e.jsx(Pl, { cardType: a });
5525
+ return /* @__PURE__ */ e.jsx($l, { cardType: a });
5532
5526
  case "table":
5533
5527
  return /* @__PURE__ */ e.jsx(sr, { cardType: a });
5534
5528
  case "text":
@@ -5541,9 +5535,9 @@ function lr() {
5541
5535
  }
5542
5536
  );
5543
5537
  case "map":
5544
- return /* @__PURE__ */ e.jsx(Xl, {});
5538
+ return /* @__PURE__ */ e.jsx(Zl, {});
5545
5539
  case "custom":
5546
- return /* @__PURE__ */ e.jsx(Vl, {});
5540
+ return /* @__PURE__ */ e.jsx(Al, {});
5547
5541
  default:
5548
5542
  return /* @__PURE__ */ e.jsx(Ul, {});
5549
5543
  }
@@ -5597,11 +5591,11 @@ function rr() {
5597
5591
  );
5598
5592
  }
5599
5593
  function ir({ authToken: s, onSave: n, onClose: a }) {
5600
- M((i) => i.themeStyle);
5601
- const t = u((i) => i.actions.setOnSave), l = u((i) => i.actions.setOnClose), r = M((i) => i.actions.setAuthToken);
5602
- return Z(() => {
5594
+ M((o) => o.themeStyle);
5595
+ const t = u((o) => o.actions.setOnSave), l = u((o) => o.actions.setOnClose), r = M((o) => o.actions.setAuthToken);
5596
+ return X(() => {
5603
5597
  n && t(n), a && l(a);
5604
- }, [n, t, a, l]), Z(() => {
5598
+ }, [n, t, a, l]), X(() => {
5605
5599
  s && s.accessToken && r(s);
5606
5600
  }, [s, r]), /* @__PURE__ */ e.jsx(cs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(
5607
5601
  mn,
@@ -5613,17 +5607,17 @@ function ir({ authToken: s, onSave: n, onClose: a }) {
5613
5607
  className: "rounded-none",
5614
5608
  role: "editor-panel",
5615
5609
  children: [
5616
- /* @__PURE__ */ e.jsx(xn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Va, {}) }),
5610
+ /* @__PURE__ */ e.jsx(xn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
5617
5611
  /* @__PURE__ */ e.jsx(pn, { children: /* @__PURE__ */ e.jsx(rr, {}) })
5618
5612
  ]
5619
5613
  }
5620
5614
  ) });
5621
5615
  }
5622
5616
  function or() {
5623
- M((i) => i.selectedCardId);
5624
- const s = M((i) => i.selectedSheetId), { setIsVisualEditing: n } = M((i) => i.actions), a = M((i) => i.isVisualEditing), t = M((i) => i.actions.updateFrame);
5625
- function l(i) {
5626
- s && (t(s, i), n(!1));
5617
+ M((o) => o.selectedCardId);
5618
+ const s = M((o) => o.selectedSheetId), { setIsVisualEditing: n } = M((o) => o.actions), a = M((o) => o.isVisualEditing), t = M((o) => o.actions.updateFrame);
5619
+ function l(o) {
5620
+ s && (t(s, o), n(!1));
5627
5621
  }
5628
5622
  function r() {
5629
5623
  n(!1);
@@ -5642,8 +5636,8 @@ function or() {
5642
5636
  function cr() {
5643
5637
  const s = u((r) => r.selectedDatabaseName), n = u((r) => r.selectedTableName), a = M((r) => r.dashboard.filters) || [], { columns: t } = qe(), { assignFilter: l } = et();
5644
5638
  return /* @__PURE__ */ e.jsx(fe, { className: "flex-1 basis-0 flex-col px-3", children: t == null ? void 0 : t.map((r) => {
5645
- const i = a == null ? void 0 : a.find(
5646
- (o) => o.column === ce(r.column_name) && o.table === n && o.database === s
5639
+ const o = a == null ? void 0 : a.find(
5640
+ (i) => i.column === ce(r.column_name) && i.table === n && i.database === s
5647
5641
  );
5648
5642
  return /* @__PURE__ */ e.jsx(
5649
5643
  "div",
@@ -5652,11 +5646,11 @@ function cr() {
5652
5646
  className: Y(
5653
5647
  "group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
5654
5648
  {
5655
- "bg-muted": i
5649
+ "bg-muted": o
5656
5650
  }
5657
5651
  ),
5658
5652
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
5659
- /* @__PURE__ */ e.jsx(Aa, { column: r }),
5653
+ /* @__PURE__ */ e.jsx(Va, { column: r }),
5660
5654
  /* @__PURE__ */ e.jsx("span", { children: r.column_name })
5661
5655
  ] })
5662
5656
  },
@@ -5683,7 +5677,7 @@ function dr() {
5683
5677
  )
5684
5678
  ] }),
5685
5679
  /* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
5686
- Va,
5680
+ Aa,
5687
5681
  {
5688
5682
  ColumnsComponent: () => (
5689
5683
  // schemaName, tableName, columns
@@ -5807,16 +5801,16 @@ export {
5807
5801
  Nn as B,
5808
5802
  wn as C,
5809
5803
  gr as D,
5810
- Ta as E,
5804
+ Fa as E,
5811
5805
  Wn as F,
5812
5806
  In as G,
5813
- Tn as H,
5807
+ Fn as H,
5814
5808
  En as K,
5815
- An as L,
5816
- La as M,
5809
+ Vn as L,
5810
+ Ta as M,
5817
5811
  _n as N,
5818
5812
  Hn as P,
5819
- $n as S,
5813
+ Pn as S,
5820
5814
  Kn as T,
5821
5815
  Jn as U,
5822
5816
  Sn as a,
@@ -5830,14 +5824,14 @@ export {
5830
5824
  On as i,
5831
5825
  Dn as j,
5832
5826
  Mn as k,
5833
- Ln as l,
5834
- Fn as m,
5835
- Vn as n,
5827
+ Tn as l,
5828
+ Ln as m,
5829
+ An as n,
5836
5830
  qn as o,
5837
- Ve as p,
5831
+ Ae as p,
5838
5832
  Rn as q,
5839
- Pn as r,
5840
- Fa as s,
5833
+ $n as r,
5834
+ La as s,
5841
5835
  Bn as t,
5842
5836
  Un as u,
5843
5837
  Gn as v,