react-semaphor 0.0.181 → 0.0.182

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,4 +1,4 @@
1
- import { P as T, b as k, j as e, Q as ds, R as hs, U as w, V as Us, W as ms, X as us, Y as xs, Z as ps, _ as B, $ as ae, a0 as Js, J as Gs, O as Ee, a1 as Ia, a2 as qa, a3 as Va, a4 as Ra, a5 as _a, a6 as Ha, a7 as Fs, a8 as Re, a9 as Ze, aa as Qe, T as fs, e as Ps, g as gs, ab as Oe, ac as Me, f as W, ad as Te, ae as Ae, af as _e, ag as Le, ah as X, ai as js, G as i, aj as $e, ak as Ke, al as Ba, am as Ue, w as Qs, v as Ws, t as he, an as $a, r as Ka, N as Ys, s as Ua, ao as Ja, B as Ga, ap as Xs, aq as Pa, L as He, S as bs, z as Qa, n as Os, ar as Ms, A as rs, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Wa, aA as Ya, aB as na, aC as Xa, aD as Za, aE as et, aF as st, aG as at, aH as is, aI as tt, aJ as Pe, aK as os, aL as Fe, aM as cs, aN as Ts, aO as nt, aP as lt, aQ as rt, aR as it, aS as ot, aT as ls, aU as ct, aV as As, aW as dt, aX as Es, aY as ht, aZ as mt, a_ as ut, a$ as la, l as xt, C as pt, E as Ls, d as ft, h as gt, i as jt, o as bt, b0 as yt, m as vt, b1 as Nt, b2 as Ct, b3 as St, b4 as Ds, b5 as kt, b6 as Is, b7 as qs, K as wt, b8 as ys, b9 as zt, ba as ra, bb as We, bc as ia, bd as Ft, be as Ot, bf as Mt, bg as Tt, bh as At, bi as Et, bj as Se, bk as q, bl as V, bm as vs, bn as R, bo as Vs, bp as Lt, bq as Dt, br as It, bs as qt, bt as Rs, bu as Vt, bv as Rt, bw as _t, bx as Ht, by as Bt, bz as $t } from "./index-gOVFSJhq.js";
1
+ import { P as T, b as k, j as e, Q as ds, R as hs, U as w, V as Us, W as ms, X as us, Y as xs, Z as ps, _ as B, $ as ae, a0 as Js, J as Ps, O as Ee, a1 as Ia, a2 as qa, a3 as Va, a4 as Ra, a5 as _a, a6 as Ha, a7 as Fs, a8 as Re, a9 as $e, aa as We, T as fs, e as Gs, g as gs, ab as Oe, ac as Me, f as W, ad as Te, ae as Ae, af as _e, ag as Le, ah as X, ai as js, G as r, aj as Ke, ak as Ue, al as Ba, am as Je, w as Qs, v as Ws, t as he, an as $a, r as Ka, N as Ys, s as Ua, ao as Ja, B as Pa, ap as Xs, aq as Ga, L as He, S as bs, z as Qa, n as Os, ar as Ms, A as rs, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Wa, aA as Ya, aB as na, aC as Xa, aD as Za, aE as et, aF as st, aG as at, aH as is, aI as tt, aJ as Qe, aK as os, aL as Fe, aM as cs, aN as Ts, aO as nt, aP as lt, aQ as rt, aR as it, aS as ot, aT as ls, aU as ct, aV as As, aW as dt, aX as Es, aY as ht, aZ as mt, a_ as ut, a$ as la, l as xt, C as pt, E as Ls, d as ft, h as gt, i as jt, o as bt, b0 as yt, m as vt, b1 as Nt, b2 as Ct, b3 as St, b4 as Ds, b5 as kt, b6 as Is, b7 as qs, K as wt, b8 as ys, b9 as zt, ba as ra, bb as Ye, bc as ia, bd as Ft, be as Ot, bf as Mt, bg as Tt, bh as At, bi as Et, bj as Se, bk as q, bl as V, bm as vs, bn as R, bo as Vs, bp as Lt, bq as Dt, br as It, bs as qt, bt as Rs, bu as Vt, bv as Rt, bw as _t, bx as Ht, by as Bt, bz as $t } from "./index-4vPj_gV0.js";
2
2
  import me, { useState as M, useEffect as K, useMemo as Kt, useRef as Be } from "react";
3
3
  /**
4
4
  * @license lucide-react v0.379.0 - ISC
@@ -43,7 +43,7 @@ const Ns = T("BarChart4", [
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
45
  */
46
- const Gt = T("CircleX", [
46
+ const Pt = T("CircleX", [
47
47
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
48
48
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
49
49
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -54,7 +54,7 @@ const Gt = T("CircleX", [
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
56
  */
57
- const Pt = T("Database", [
57
+ const Gt = T("Database", [
58
58
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
59
59
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
60
60
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -377,9 +377,9 @@ const pn = T("User", [
377
377
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
378
378
  ]);
379
379
  function fn() {
380
- const [s, n] = M(""), [a, t] = M(!1), [o, r] = M(!1), l = k((d) => d.dashboard);
380
+ const [s, n] = M(""), [a, t] = M(!1), [i, o] = M(!1), l = k((d) => d.dashboard);
381
381
  function c() {
382
- const d = Gs(l), f = Ee(l.id), m = JSON.parse(localStorage.getItem(f) || "[]");
382
+ const d = Ps(l), f = Ee(l.id), m = JSON.parse(localStorage.getItem(f) || "[]");
383
383
  if (m.some(
384
384
  (C) => C.name === s
385
385
  )) {
@@ -389,9 +389,9 @@ function fn() {
389
389
  m.push({
390
390
  name: s,
391
391
  template: d
392
- }), localStorage.setItem(f, JSON.stringify(m)), r(!1);
392
+ }), localStorage.setItem(f, JSON.stringify(m)), o(!1);
393
393
  }
394
- return /* @__PURE__ */ e.jsxs(ds, { open: o, onOpenChange: r, children: [
394
+ return /* @__PURE__ */ e.jsxs(ds, { open: i, onOpenChange: o, children: [
395
395
  /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
396
396
  w,
397
397
  {
@@ -438,19 +438,19 @@ function fn() {
438
438
  ] });
439
439
  }
440
440
  function gn() {
441
- const [s, n] = M(!1), [a, t] = M(""), o = k((h) => h.dashboard), r = k((h) => h.bookmarkKey), [l, c] = M([]), d = k((h) => h.actions.setDashboard), f = k(
441
+ const [s, n] = M(!1), [a, t] = M(""), i = k((h) => h.dashboard), o = k((h) => h.bookmarkKey), [l, c] = M([]), d = k((h) => h.actions.setDashboard), f = k(
442
442
  (h) => h.actions.setFilterValues
443
443
  ), m = k(
444
444
  (h) => h.actions.setBookmarkKey
445
445
  );
446
446
  K(() => {
447
- const h = Ee(o.id), x = JSON.parse(localStorage.getItem(h) || "[]");
447
+ const h = Ee(i.id), x = JSON.parse(localStorage.getItem(h) || "[]");
448
448
  c(x);
449
449
  const g = x.find(
450
450
  (j) => j.default
451
451
  );
452
- g && g.name === r && t(g.name);
453
- }, [s, o, r]);
452
+ g && g.name === o && t(g.name);
453
+ }, [s, i, o]);
454
454
  function u(h) {
455
455
  if (h === a)
456
456
  return;
@@ -458,7 +458,7 @@ function gn() {
458
458
  g && (d(g), f(x.filterValues || []), m(h === "Original" ? "" : h)), t(h);
459
459
  }
460
460
  function C(h) {
461
- const x = Ee(o.id), j = JSON.parse(localStorage.getItem(x) || "[]").filter(
461
+ const x = Ee(i.id), j = JSON.parse(localStorage.getItem(x) || "[]").filter(
462
462
  (b) => b.name !== h
463
463
  );
464
464
  localStorage.setItem(x, JSON.stringify(j)), c(j);
@@ -480,7 +480,7 @@ function gn() {
480
480
  {
481
481
  className: "xbg-red-100 flex justify-between",
482
482
  value: h.name,
483
- defaultChecked: h.name === r,
483
+ defaultChecked: h.name === o,
484
484
  children: [
485
485
  /* @__PURE__ */ e.jsx("p", { children: h.name }),
486
486
  /* @__PURE__ */ e.jsx(
@@ -504,33 +504,33 @@ function gn() {
504
504
  ] });
505
505
  }
506
506
  function jn() {
507
- const [s, n] = M(!1), a = k((r) => r.dashboard), t = k((r) => r.bookmarkKey);
507
+ const [s, n] = M(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
508
508
  K(() => {
509
509
  if (!t) {
510
510
  n(!1);
511
511
  return;
512
512
  }
513
- const r = Ee(a.id), c = JSON.parse(
514
- localStorage.getItem(r) || "[]"
513
+ const o = Ee(a.id), c = JSON.parse(
514
+ localStorage.getItem(o) || "[]"
515
515
  ).find(
516
516
  (d) => d.name === t
517
517
  );
518
518
  n(c ? c.default : !1);
519
519
  }, [t, a.id]);
520
- function o(r) {
521
- if (n(r), !t)
520
+ function i(o) {
521
+ if (n(o), !t)
522
522
  return;
523
523
  const l = Ee(a.id), d = JSON.parse(
524
524
  localStorage.getItem(l) || "[]"
525
- ).map((f) => (f.name === t ? f.default = r : f.default = !1, f));
525
+ ).map((f) => (f.name === t ? f.default = o : f.default = !1, f));
526
526
  console.log(d), localStorage.setItem(l, JSON.stringify(d));
527
527
  }
528
528
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
529
529
  /* @__PURE__ */ e.jsx(
530
- Ze,
530
+ $e,
531
531
  {
532
532
  checked: s,
533
- onCheckedChange: o,
533
+ onCheckedChange: i,
534
534
  id: "terms"
535
535
  }
536
536
  ),
@@ -549,7 +549,7 @@ function bn() {
549
549
  k((b) => b.selectedSheetId);
550
550
  const a = k(
551
551
  (b) => b.isDashboardEditing
552
- ), t = k((b) => b.filterValues), o = k((b) => b.isVisualEditing), r = k((b) => b.showFilters);
552
+ ), t = k((b) => b.filterValues), i = k((b) => b.isVisualEditing), o = k((b) => b.showFilters);
553
553
  k(
554
554
  (b) => b.showDashboardJSON
555
555
  );
@@ -561,7 +561,7 @@ function bn() {
561
561
  if (!a || !h)
562
562
  return;
563
563
  const b = {
564
- id: Qe(),
564
+ id: We(),
565
565
  title: "Title",
566
566
  description: "Description",
567
567
  preferences: {
@@ -576,7 +576,7 @@ function bn() {
576
576
  sql: "select COUNT(*) from YOUR_TABLE",
577
577
  data: []
578
578
  }, L = {
579
- id: Qe(),
579
+ id: We(),
580
580
  cards: [b],
581
581
  activeCardId: b.id
582
582
  };
@@ -587,7 +587,7 @@ function bn() {
587
587
  function j() {
588
588
  if (!s || s === "")
589
589
  return;
590
- const b = Gs(n), L = Ee(n.id), A = JSON.parse(localStorage.getItem(L) || "[]"), O = A.findIndex(
590
+ const b = Ps(n), L = Ee(n.id), A = JSON.parse(localStorage.getItem(L) || "[]"), O = A.findIndex(
591
591
  (y) => y.name === s
592
592
  );
593
593
  O !== -1 ? A[O] = {
@@ -601,13 +601,13 @@ function bn() {
601
601
  filterValues: t
602
602
  }), localStorage.setItem(L, JSON.stringify(A)), l == null || l(b);
603
603
  }
604
- return o ? null : /* @__PURE__ */ e.jsxs(
604
+ return i ? null : /* @__PURE__ */ e.jsxs(
605
605
  "div",
606
606
  {
607
607
  className: "flex items-center justify-between gap-2 border-b bg-muted/50 px-2 py-2",
608
608
  role: "dashboard-controls",
609
609
  children: [
610
- !o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
610
+ !i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
611
611
  /* @__PURE__ */ e.jsx(B, { children: s }),
612
612
  !!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
613
613
  /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
@@ -615,9 +615,9 @@ function bn() {
615
615
  ] })
616
616
  ] }),
617
617
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
618
- a && !o && /* @__PURE__ */ e.jsx(fn, {}),
619
- !o && /* @__PURE__ */ e.jsx(gn, {}),
620
- a && !o && /* @__PURE__ */ e.jsxs(
618
+ a && !i && /* @__PURE__ */ e.jsx(fn, {}),
619
+ !i && /* @__PURE__ */ e.jsx(gn, {}),
620
+ a && !i && /* @__PURE__ */ e.jsxs(
621
621
  w,
622
622
  {
623
623
  variant: "outline",
@@ -641,7 +641,7 @@ function bn() {
641
641
  children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
642
642
  }
643
643
  ),
644
- a && !o && /* @__PURE__ */ e.jsx(
644
+ a && !i && /* @__PURE__ */ e.jsx(
645
645
  w,
646
646
  {
647
647
  variant: "outline",
@@ -654,7 +654,7 @@ function bn() {
654
654
  children: /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4", strokeWidth: 1.5 })
655
655
  }
656
656
  ),
657
- a && !o && /* @__PURE__ */ e.jsx(
657
+ a && !i && /* @__PURE__ */ e.jsx(
658
658
  w,
659
659
  {
660
660
  className: "h-7 p-2",
@@ -664,7 +664,7 @@ function bn() {
664
664
  children: /* @__PURE__ */ e.jsx(on, { className: "h-4 w-4", strokeWidth: 1.5 })
665
665
  }
666
666
  ),
667
- !r && !o && a && /* @__PURE__ */ e.jsx(
667
+ !o && !i && a && /* @__PURE__ */ e.jsx(
668
668
  w,
669
669
  {
670
670
  className: "h-7 p-2",
@@ -674,8 +674,8 @@ function bn() {
674
674
  children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
675
675
  }
676
676
  ),
677
- !o && a && !1,
678
- !o && !1
677
+ !i && a && !1,
678
+ !i && !1
679
679
  ] })
680
680
  ]
681
681
  }
@@ -686,28 +686,28 @@ function Ge({
686
686
  items: n,
687
687
  value: a,
688
688
  isLoading: t,
689
- isError: o,
690
- connectionTooltip: r,
689
+ isError: i,
690
+ connectionTooltip: o,
691
691
  onChange: l,
692
692
  className: c,
693
693
  showIcon: d = !0,
694
694
  disabled: f = !1
695
695
  }) {
696
- const m = t ? "Loading..." : o ? "Error" : a;
696
+ const m = t ? "Loading..." : i ? "Error" : a;
697
697
  function u() {
698
698
  if (s === "Connection")
699
699
  return /* @__PURE__ */ e.jsx(rn, { className: "size-4 rotate-90" });
700
700
  if (s === "Database")
701
- return /* @__PURE__ */ e.jsx(Pt, { className: "size-4" });
701
+ return /* @__PURE__ */ e.jsx(Gt, { className: "size-4" });
702
702
  if (s === "Schema")
703
703
  return /* @__PURE__ */ e.jsx(nn, { className: "size-4" });
704
704
  if (s === "Table")
705
705
  return /* @__PURE__ */ e.jsx(js, { className: "size-4" });
706
706
  }
707
707
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
708
- d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(fs, { children: [
709
- /* @__PURE__ */ e.jsx(Ps, { children: u() }),
710
- /* @__PURE__ */ e.jsx(gs, { className: "text-xs", align: "start", children: r })
708
+ d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(fs, { children: [
709
+ /* @__PURE__ */ e.jsx(Gs, { children: u() }),
710
+ /* @__PURE__ */ e.jsx(gs, { className: "text-xs", align: "start", children: o })
711
711
  ] }) : u() }),
712
712
  /* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange: l, children: [
713
713
  /* @__PURE__ */ e.jsx(
@@ -720,7 +720,7 @@ function Ge({
720
720
  children: /* @__PURE__ */ e.jsx(
721
721
  Te,
722
722
  {
723
- placeholder: t ? "Loading..." : o ? "Error" : `Select ${s}`
723
+ placeholder: t ? "Loading..." : i ? "Error" : `Select ${s}`
724
724
  }
725
725
  )
726
726
  }
@@ -728,29 +728,29 @@ function Ge({
728
728
  /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
729
729
  t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
730
730
  /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((C, h) => /* @__PURE__ */ e.jsx(X, { value: C.id, children: C.name }, h)) }),
731
- (t || o) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
731
+ (t || i) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
732
732
  ] }) })
733
733
  ] })
734
734
  ] });
735
735
  }
736
736
  function yn({ column: s }) {
737
- const [n, a] = M(!1), t = i((m) => m.selectedTableName), o = i(
737
+ const [n, a] = M(!1), t = r((m) => m.selectedTableName), i = r(
738
738
  (m) => m.selectedSchemaName
739
- ), r = i((m) => m.sqlGen), l = i((m) => m.actions.setSqlGen), c = i((m) => m.actions.setCardSql), d = i((m) => m.actions.setRunSql);
739
+ ), o = r((m) => m.sqlGen), l = r((m) => m.actions.setSqlGen), c = r((m) => m.actions.setCardSql), d = r((m) => m.actions.setRunSql);
740
740
  function f(m, u) {
741
- const C = Qs(m, r, u);
741
+ const C = Qs(m, o, u);
742
742
  l(C);
743
743
  const h = Ws(
744
744
  C,
745
- he(o || ""),
745
+ he(i || ""),
746
746
  he(t)
747
747
  );
748
748
  h && (c(h), d(!0)), a(!1);
749
749
  }
750
- return /* @__PURE__ */ e.jsxs($e, { open: n, onOpenChange: a, children: [
751
- /* @__PURE__ */ e.jsx(Ke, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ba, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
750
+ return /* @__PURE__ */ e.jsxs(Ke, { open: n, onOpenChange: a, children: [
751
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ba, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
752
752
  /* @__PURE__ */ e.jsx(
753
- Ue,
753
+ Je,
754
754
  {
755
755
  align: "center",
756
756
  className: "w-18 rounded-md p-0 shadow-none",
@@ -808,7 +808,7 @@ function ma({ column: s }) {
808
808
  ) : Ys.includes(s.data_type.toLowerCase()) ? (
809
809
  //
810
810
  /* @__PURE__ */ e.jsx(Xt, { className: "size-3" })
811
- ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ja, { className: "size-3" }) : Ga.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(un, { className: "size-3" }) : /* @__PURE__ */ e.jsx(cn, { className: "size-3" }) }),
811
+ ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ja, { className: "size-3" }) : Pa.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(un, { className: "size-3" }) : /* @__PURE__ */ e.jsx(cn, { className: "size-3" }) }),
812
812
  /* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
813
813
  ] });
814
814
  }
@@ -818,32 +818,32 @@ function vn({
818
818
  columns: a,
819
819
  status: t
820
820
  }) {
821
- const o = i((y) => y.sqlGen), r = i(
821
+ const i = r((y) => y.sqlGen), o = r(
822
822
  (y) => y.selectedConnectionId
823
- ), l = i(
823
+ ), l = r(
824
824
  (y) => y.selectedDatabaseName
825
- ), c = i(
825
+ ), c = r(
826
826
  (y) => y.selectedSchemaName
827
- ), d = i((y) => y.selectedTableName), f = k(
827
+ ), d = r((y) => y.selectedTableName), f = k(
828
828
  (y) => y.dashboard.aiScopeTables
829
- ), { setAIScopeTables: m } = k((y) => y.actions), u = i((y) => y.actions.setRunSql), C = i((y) => y.actions.setSqlGen), h = i(
829
+ ), { setAIScopeTables: m } = k((y) => y.actions), u = r((y) => y.actions.setRunSql), C = r((y) => y.actions.setSqlGen), h = r(
830
830
  (y) => y.actions.setIsShowingVisual
831
- ), x = i((y) => y.actions.setCardSql), { connectionType: g } = ua();
831
+ ), x = r((y) => y.actions.setCardSql), { connectionType: g } = ua();
832
832
  function j(y) {
833
- const z = Qs(y, o);
833
+ const z = Qs(y, i);
834
834
  C(z);
835
835
  const E = Ws(z, he(s), he(n));
836
836
  E && (x(E), u(!0));
837
837
  }
838
838
  function b() {
839
839
  return (f == null ? void 0 : f.find(
840
- (y) => y.connectinonId === r && y.tableName === d
840
+ (y) => y.connectinonId === o && y.tableName === d
841
841
  )) !== void 0;
842
842
  }
843
843
  function L(y) {
844
- if (y === !0 && d && r) {
844
+ if (y === !0 && d && o) {
845
845
  const z = {
846
- connectinonId: r,
846
+ connectinonId: o,
847
847
  connectionType: g,
848
848
  databaseName: l,
849
849
  schemaName: c,
@@ -860,7 +860,7 @@ function vn({
860
860
  });
861
861
  } else {
862
862
  const z = (f || []).filter(
863
- (E) => E.connectinonId !== r && E.tableName !== d
863
+ (E) => E.connectinonId !== o && E.tableName !== d
864
864
  );
865
865
  m(z), Ms(`Removed '${d}' from AI Scope`, {
866
866
  position: "top-right",
@@ -888,7 +888,7 @@ function vn({
888
888
  variant: "outline",
889
889
  className: "h-9 px-2",
890
890
  children: /* @__PURE__ */ e.jsx(
891
- Pa,
891
+ Ga,
892
892
  {
893
893
  className: W("size-4", {
894
894
  "text-primary": b(),
@@ -939,7 +939,7 @@ function vn({
939
939
  className: W(
940
940
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
941
941
  {
942
- "bg-muted": Qa(y, o)
942
+ "bg-muted": Qa(y, i)
943
943
  }
944
944
  ),
945
945
  children: [
@@ -967,33 +967,33 @@ function vn({
967
967
  ] });
968
968
  }
969
969
  function ua(s, n) {
970
- var ss, ve, Je, qe;
970
+ var ss, ve, Pe, qe;
971
971
  let a = Kt(() => [], []);
972
- const t = es().authToken || s, o = i(
972
+ const t = es().authToken || s, i = r(
973
973
  (S) => S.selectedConnectionId
974
- ), r = i(
974
+ ), o = r(
975
975
  (S) => S.selectedDatabaseName
976
- ), l = i(
976
+ ), l = r(
977
977
  (S) => S.selectedSchemaName
978
- ), c = i((S) => S.selectedTableName), d = i(
978
+ ), c = r((S) => S.selectedTableName), d = r(
979
979
  (S) => S.actions.setCurrentColumns
980
- ), f = i(
980
+ ), f = r(
981
981
  (S) => S.actions.setSelectedConnectionId
982
- ), m = i(
982
+ ), m = r(
983
983
  (S) => S.actions.setSelectedDatabaseName
984
- ), u = i(
984
+ ), u = r(
985
985
  (S) => S.actions.setSelectedSchemaName
986
- ), C = i(
986
+ ), C = r(
987
987
  (S) => S.actions.setSelectedTableName
988
- ), h = i((S) => S.actions.setCardSql);
988
+ ), h = r((S) => S.actions.setCardSql);
989
989
  function x(S) {
990
- return o && r && l && r !== "NA" ? !0 : o && S === "API" ? !1 : !!(o && S === "S3");
990
+ return i && o && l && o !== "NA" ? !0 : i && S === "API" ? !1 : !!(i && S === "S3");
991
991
  }
992
992
  function g(S) {
993
- return !!(o && r && r !== "NA" && l && c || o && (S === "S3" || S === "API"));
993
+ return !!(i && o && o !== "NA" && l && c || i && (S === "S3" || S === "API"));
994
994
  }
995
995
  function j(S) {
996
- return o && S ? !(S === "API" || S === "S3") : !1;
996
+ return i && S ? !(S === "API" || S === "S3") : !1;
997
997
  }
998
998
  const {
999
999
  data: b,
@@ -1008,7 +1008,7 @@ function ua(s, n) {
1008
1008
  enabled: !!(t != null && t.accessToken)
1009
1009
  // Only fetch if authToken is present
1010
1010
  }), O = b == null ? void 0 : b.connections.find(
1011
- (S) => S.id === o
1011
+ (S) => S.id === i
1012
1012
  ), y = O == null ? void 0 : O.type, z = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1013
1013
  data: E,
1014
1014
  isLoading: _,
@@ -1016,12 +1016,12 @@ function ua(s, n) {
1016
1016
  isError: $,
1017
1017
  refetch: U
1018
1018
  } = Ce({
1019
- queryKey: ["databases", o],
1019
+ queryKey: ["databases", i],
1020
1020
  queryFn: () => ze(
1021
1021
  "https://semaphor.cloud/api/v1/databases",
1022
1022
  (t == null ? void 0 : t.accessToken) || "",
1023
1023
  {
1024
- connection_id: o
1024
+ connection_id: i
1025
1025
  }
1026
1026
  ),
1027
1027
  enabled: j(y)
@@ -1029,20 +1029,20 @@ function ua(s, n) {
1029
1029
  }), {
1030
1030
  data: D,
1031
1031
  isLoading: te,
1032
- isFetching: P,
1032
+ isFetching: G,
1033
1033
  isError: ee,
1034
1034
  refetch: Z
1035
1035
  } = Ce({
1036
- queryKey: ["schemas", o, r],
1036
+ queryKey: ["schemas", i, o],
1037
1037
  queryFn: () => ze(
1038
1038
  "https://semaphor.cloud/api/v1/schemas",
1039
1039
  (t == null ? void 0 : t.accessToken) || "",
1040
1040
  {
1041
- connection_id: o,
1042
- database_name: r
1041
+ connection_id: i,
1042
+ database_name: o
1043
1043
  }
1044
1044
  ),
1045
- enabled: !!o && !!r && !z && r !== "NA"
1045
+ enabled: !!i && !!o && !z && o !== "NA"
1046
1046
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1047
1047
  }), {
1048
1048
  data: J,
@@ -1053,16 +1053,16 @@ function ua(s, n) {
1053
1053
  } = Ce({
1054
1054
  queryKey: [
1055
1055
  "tables",
1056
+ i,
1056
1057
  o,
1057
- r,
1058
1058
  l
1059
1059
  ],
1060
1060
  queryFn: () => ze(
1061
1061
  "https://semaphor.cloud/api/v1/tables",
1062
1062
  (t == null ? void 0 : t.accessToken) || "",
1063
1063
  {
1064
- connection_id: o,
1065
- database_name: r,
1064
+ connection_id: i,
1065
+ database_name: o,
1066
1066
  schema_name: l
1067
1067
  }
1068
1068
  ),
@@ -1075,8 +1075,8 @@ function ua(s, n) {
1075
1075
  } = Ce({
1076
1076
  queryKey: [
1077
1077
  "columns",
1078
+ i,
1078
1079
  o,
1079
- r,
1080
1080
  l,
1081
1081
  c
1082
1082
  ],
@@ -1084,8 +1084,8 @@ function ua(s, n) {
1084
1084
  "https://semaphor.cloud/api/v1/columns",
1085
1085
  (t == null ? void 0 : t.accessToken) || "",
1086
1086
  {
1087
- connection_id: o,
1088
- database_name: r,
1087
+ connection_id: i,
1088
+ database_name: o,
1089
1089
  schema_name: l,
1090
1090
  table_name: c
1091
1091
  }
@@ -1114,13 +1114,13 @@ function ua(s, n) {
1114
1114
  function xe(S) {
1115
1115
  u(S), C("");
1116
1116
  }
1117
- function G(S) {
1117
+ function P(S) {
1118
1118
  m(S), u(""), C("");
1119
1119
  }
1120
1120
  function ne(S) {
1121
1121
  f(S);
1122
1122
  }
1123
- E && ((ve = E == null ? void 0 : E.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((S) => ({
1123
+ E && ((ve = E == null ? void 0 : E.databases) == null ? void 0 : ve.length) > 0, D && ((Pe = D == null ? void 0 : D.schemas) == null ? void 0 : Pe.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((S) => ({
1124
1124
  ...S,
1125
1125
  data_type: S.data_type.toLowerCase()
1126
1126
  }))), $ && (a = []), (ge || A) && (a = []);
@@ -1148,7 +1148,7 @@ function ua(s, n) {
1148
1148
  isDatabasesLoadingOrFetching: _ || Y,
1149
1149
  isDatabaseError: $,
1150
1150
  schemaItems: re,
1151
- isSchemaLoadingOrFetching: te || P,
1151
+ isSchemaLoadingOrFetching: te || G,
1152
1152
  isSchemaError: ee,
1153
1153
  tableItems: Ie,
1154
1154
  isTableLoadingOrFetching: I || v,
@@ -1161,7 +1161,7 @@ function ua(s, n) {
1161
1161
  tableName: je,
1162
1162
  schemaName: be,
1163
1163
  handleConnectionChange: ne,
1164
- handleDatabaseChange: G,
1164
+ handleDatabaseChange: P,
1165
1165
  handleSchemaChange: xe
1166
1166
  };
1167
1167
  }
@@ -1169,13 +1169,13 @@ function xa({
1169
1169
  ColumnsComponent: s
1170
1170
  }) {
1171
1171
  var J;
1172
- const n = i(
1172
+ const n = r(
1173
1173
  (I) => I.selectedConnectionId
1174
- ), a = i(
1174
+ ), a = r(
1175
1175
  (I) => I.selectedDatabaseName
1176
- ), t = i(
1176
+ ), t = r(
1177
1177
  (I) => I.selectedSchemaName
1178
- ), o = i((I) => I.selectedTableName), r = i(
1178
+ ), i = r((I) => I.selectedTableName), o = r(
1179
1179
  (I) => I.actions.setSelectedTableName
1180
1180
  ), {
1181
1181
  connectionItems: l,
@@ -1215,7 +1215,7 @@ function xa({
1215
1215
  function te() {
1216
1216
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1217
1217
  }
1218
- function P() {
1218
+ function G() {
1219
1219
  return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
1220
1220
  Ge,
1221
1221
  {
@@ -1245,11 +1245,11 @@ function xa({
1245
1245
  return y === "API" ? null : /* @__PURE__ */ e.jsx(
1246
1246
  Ge,
1247
1247
  {
1248
- onChange: r,
1248
+ onChange: o,
1249
1249
  isError: O,
1250
1250
  items: f,
1251
1251
  isLoading: A,
1252
- value: o || "",
1252
+ value: i || "",
1253
1253
  title: "Table"
1254
1254
  }
1255
1255
  );
@@ -1270,7 +1270,7 @@ function xa({
1270
1270
  )) == null ? void 0 : J.type) || ""
1271
1271
  }
1272
1272
  ),
1273
- P(),
1273
+ G(),
1274
1274
  ee(),
1275
1275
  Z()
1276
1276
  ] }),
@@ -1291,9 +1291,9 @@ function xa({
1291
1291
  ] });
1292
1292
  }
1293
1293
  function Nn(s) {
1294
- const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), o = s.toUpperCase().indexOf("ORDER BY");
1295
- let r = s.length;
1296
- if (o !== -1 && (r = o), t !== -1 && t < r && (r = t), n !== -1) {
1294
+ const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
1295
+ let o = s.length;
1296
+ if (i !== -1 && (o = i), t !== -1 && t < o && (o = t), n !== -1) {
1297
1297
  const l = s.substring(0, n), c = s.substring(n);
1298
1298
  return `${l} {{ filters | where }} AND ${c.substring(
1299
1299
  6
@@ -1302,7 +1302,7 @@ function Nn(s) {
1302
1302
  const l = s.substring(0, a), c = s.substring(a);
1303
1303
  return `${l} {{ filters | where }} ${c}`;
1304
1304
  } else {
1305
- const l = s.substring(0, r), c = s.substring(r);
1305
+ const l = s.substring(0, o), c = s.substring(o);
1306
1306
  return `${l} {{ filters | where }} ${c}`;
1307
1307
  }
1308
1308
  }
@@ -1313,7 +1313,7 @@ function Cn({
1313
1313
  setTriggerAIRun: t
1314
1314
  }) {
1315
1315
  return /* @__PURE__ */ e.jsxs(Zs, { openDelay: 0, children: [
1316
- /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Gt, { className: "h-4 w-4 text-red-500" }) }) }),
1316
+ /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Pt, { className: "h-4 w-4 text-red-500" }) }) }),
1317
1317
  /* @__PURE__ */ e.jsx(sa, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
1318
1318
  /* @__PURE__ */ e.jsxs(
1319
1319
  w,
@@ -1339,12 +1339,12 @@ function Sn({
1339
1339
  checked: a
1340
1340
  }) {
1341
1341
  return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
1342
- /* @__PURE__ */ e.jsx(Ze, { checked: a, onCheckedChange: n }),
1342
+ /* @__PURE__ */ e.jsx($e, { checked: a, onCheckedChange: n }),
1343
1343
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1344
1344
  ] });
1345
1345
  }
1346
1346
  function kn() {
1347
- const { authToken: s } = es(), n = Be(null), a = i((c) => c.applyFilters), [t, o] = M(""), r = i((c) => c.filterValues), l = i((c) => c.card.sql);
1347
+ const { authToken: s } = es(), n = Be(null), a = r((c) => c.applyFilters), [t, i] = M(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
1348
1348
  return /* @__PURE__ */ e.jsxs(
1349
1349
  Zs,
1350
1350
  {
@@ -1358,10 +1358,10 @@ function kn() {
1358
1358
  (s == null ? void 0 : s.accessToken) || "",
1359
1359
  {
1360
1360
  sql: l,
1361
- active_filters: r
1361
+ active_filters: o
1362
1362
  }
1363
1363
  );
1364
- console.log(d), d.sql ? (console.log(d.records), o(d.sql)) : o("Error");
1364
+ console.log(d), d.sql ? (console.log(d.records), i(d.sql)) : i("Error");
1365
1365
  },
1366
1366
  children: [
1367
1367
  /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
@@ -1437,10 +1437,10 @@ function zn({
1437
1437
  setOpen: n,
1438
1438
  userInput: a,
1439
1439
  setUserInput: t,
1440
- triggerAIRun: o,
1441
- setTriggerAIRun: r
1440
+ triggerAIRun: i,
1441
+ setTriggerAIRun: o
1442
1442
  }) {
1443
- const l = Be(null), c = Be(null), { authToken: d } = es(), [f, m] = M(!1), u = i((v) => v.actions.setCardSql), C = k((v) => v.dashboard.baseQueries), h = i((v) => v.actions.setRunSql), x = i((v) => v.actions.setCardType), [g, j] = M([]), b = i((v) => v.currentColumns), L = i((v) => v.card.sql), A = i((v) => v.selectedTableName), O = `
1443
+ const l = Be(null), c = Be(null), { authToken: d } = es(), [f, m] = M(!1), u = r((v) => v.actions.setCardSql), C = k((v) => v.dashboard.baseQueries), h = r((v) => v.actions.setRunSql), x = r((v) => v.actions.setCardType), [g, j] = M([]), b = r((v) => v.currentColumns), L = r((v) => v.card.sql), A = r((v) => v.selectedTableName), O = `
1444
1444
  ${a}
1445
1445
 
1446
1446
  Database Query Dialect: ${A === "api" || A === "s3" ? "DuckDb" : ""}
@@ -1497,8 +1497,8 @@ function zn({
1497
1497
  a && (j((v) => [...v, { role: "user", content: a }]), U(a) && m(!0), t(""), $());
1498
1498
  }
1499
1499
  K(() => {
1500
- o && (D(), r(!1));
1501
- }, [o, r]);
1500
+ i && (D(), o(!1));
1501
+ }, [i, o]);
1502
1502
  const te = {
1503
1503
  //seleect a darker color
1504
1504
  // color: '#000',
@@ -1507,7 +1507,7 @@ function zn({
1507
1507
  fontSize: 15,
1508
1508
  // padding: '5px',
1509
1509
  width: "100%"
1510
- }, P = {
1510
+ }, G = {
1511
1511
  // background: '#f6f8fa',
1512
1512
  // color: '#000',
1513
1513
  fontFamily: "monospace",
@@ -1528,7 +1528,7 @@ function zn({
1528
1528
  // Override how paragraphs are rendered
1529
1529
  p: ({ node: v, ...N }) => /* @__PURE__ */ e.jsx("p", { style: te, ...N }),
1530
1530
  code: ({ node: v, ...N }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...N }),
1531
- pre: ({ node: v, ...N }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
1531
+ pre: ({ node: v, ...N }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: G, children: [
1532
1532
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: N.children }),
1533
1533
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1534
1534
  /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
@@ -1658,43 +1658,43 @@ var pa = {
1658
1658
  function On(s, n) {
1659
1659
  if (s == null)
1660
1660
  return {};
1661
- var a = Mn(s, n), t, o;
1661
+ var a = Mn(s, n), t, i;
1662
1662
  if (Object.getOwnPropertySymbols) {
1663
- var r = Object.getOwnPropertySymbols(s);
1664
- for (o = 0; o < r.length; o++)
1665
- t = r[o], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
1663
+ var o = Object.getOwnPropertySymbols(s);
1664
+ for (i = 0; i < o.length; i++)
1665
+ t = o[i], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
1666
1666
  }
1667
1667
  return a;
1668
1668
  }
1669
1669
  function Mn(s, n) {
1670
1670
  if (s == null)
1671
1671
  return {};
1672
- var a = {}, t = Object.keys(s), o, r;
1673
- for (r = 0; r < t.length; r++)
1674
- o = t[r], !(n.indexOf(o) >= 0) && (a[o] = s[o]);
1672
+ var a = {}, t = Object.keys(s), i, o;
1673
+ for (o = 0; o < t.length; o++)
1674
+ i = t[o], !(n.indexOf(i) >= 0) && (a[i] = s[i]);
1675
1675
  return a;
1676
1676
  }
1677
- function Ye() {
1678
- return Ye = Object.assign ? Object.assign.bind() : function(s) {
1677
+ function Xe() {
1678
+ return Xe = Object.assign ? Object.assign.bind() : function(s) {
1679
1679
  for (var n = 1; n < arguments.length; n++) {
1680
1680
  var a = arguments[n];
1681
1681
  for (var t in a)
1682
1682
  Object.prototype.hasOwnProperty.call(a, t) && (s[t] = a[t]);
1683
1683
  }
1684
1684
  return s;
1685
- }, Ye.apply(this, arguments);
1685
+ }, Xe.apply(this, arguments);
1686
1686
  }
1687
1687
  function Hs(s, n) {
1688
1688
  var a = Object.keys(s);
1689
1689
  if (Object.getOwnPropertySymbols) {
1690
1690
  var t = Object.getOwnPropertySymbols(s);
1691
- n && (t = t.filter(function(o) {
1692
- return Object.getOwnPropertyDescriptor(s, o).enumerable;
1691
+ n && (t = t.filter(function(i) {
1692
+ return Object.getOwnPropertyDescriptor(s, i).enumerable;
1693
1693
  })), a.push.apply(a, t);
1694
1694
  }
1695
1695
  return a;
1696
1696
  }
1697
- function Xe(s) {
1697
+ function Ze(s) {
1698
1698
  for (var n = 1; n < arguments.length; n++) {
1699
1699
  var a = arguments[n] != null ? arguments[n] : {};
1700
1700
  n % 2 ? Hs(Object(a), !0).forEach(function(t) {
@@ -1725,35 +1725,35 @@ function En(s, n) {
1725
1725
  return (n === "string" ? String : Number)(s);
1726
1726
  }
1727
1727
  function fa(s) {
1728
- return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, Xe({
1728
+ return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, Ze({
1729
1729
  key: a
1730
1730
  }, n.attr), fa(n.child)));
1731
1731
  }
1732
1732
  function fe(s) {
1733
- return (n) => /* @__PURE__ */ me.createElement(Ln, Ye({
1734
- attr: Xe({}, s.attr)
1733
+ return (n) => /* @__PURE__ */ me.createElement(Ln, Xe({
1734
+ attr: Ze({}, s.attr)
1735
1735
  }, n), fa(s.child));
1736
1736
  }
1737
1737
  function Ln(s) {
1738
1738
  var n = (a) => {
1739
1739
  var {
1740
1740
  attr: t,
1741
- size: o,
1742
- title: r
1743
- } = s, l = On(s, Fn), c = o || a.size || "1em", d;
1744
- return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Ye({
1741
+ size: i,
1742
+ title: o
1743
+ } = s, l = On(s, Fn), c = i || a.size || "1em", d;
1744
+ return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
1745
1745
  stroke: "currentColor",
1746
1746
  fill: "currentColor",
1747
1747
  strokeWidth: "0"
1748
1748
  }, a.attr, t, l, {
1749
1749
  className: d,
1750
- style: Xe(Xe({
1750
+ style: Ze(Ze({
1751
1751
  color: s.color || a.color
1752
1752
  }, a.style), s.style),
1753
1753
  height: c,
1754
1754
  width: c,
1755
1755
  xmlns: "http://www.w3.org/2000/svg"
1756
- }), r && /* @__PURE__ */ me.createElement("title", null, r), s.children);
1756
+ }), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
1757
1757
  };
1758
1758
  return _s !== void 0 ? /* @__PURE__ */ me.createElement(_s.Consumer, null, (a) => n(a)) : n(pa);
1759
1759
  }
@@ -1761,33 +1761,33 @@ function Dn(s) {
1761
1761
  return fe({ 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);
1762
1762
  }
1763
1763
  function In() {
1764
- const { theme: s } = st(), n = Be(), a = Be(), [t, o] = M(!1), [r, l] = M(!1), [c, d] = M(!1), [f, m] = M(""), [u, C] = M(!1), { authToken: h } = es();
1764
+ const { theme: s } = st(), n = Be(), a = Be(), [t, i] = M(!1), [o, l] = M(!1), [c, d] = M(!1), [f, m] = M(""), [u, C] = M(!1), { authToken: h } = es();
1765
1765
  k((p) => p.selectedSheetId);
1766
- const x = k((p) => p.dashboard.baseQueries), g = i((p) => p.card), j = k((p) => p.theme), b = i((p) => p.isShowingVisual), L = i(
1766
+ const x = k((p) => p.dashboard.baseQueries), g = r((p) => p.card), j = k((p) => p.theme), b = r((p) => p.isShowingVisual), L = r(
1767
1767
  (p) => p.selectedConnectionId
1768
- ), A = i(
1768
+ ), A = r(
1769
1769
  (p) => p.selectedDatabaseName
1770
- ), O = i(
1770
+ ), O = r(
1771
1771
  (p) => p.selectedSchemaName
1772
1772
  );
1773
1773
  k(
1774
1774
  (p) => p.actions.updateFrameCard
1775
1775
  );
1776
- const y = i((p) => p.selectedTableName), z = i((p) => p.card.sql), E = i((p) => p.card.python), _ = at(z, x), Y = i((p) => p.selectedConnectionId), $ = i((p) => p.frame), U = i((p) => p.filterValues), D = i((p) => p.applyFilters), {
1776
+ const y = r((p) => p.selectedTableName), z = r((p) => p.card.sql), E = r((p) => p.card.python), _ = at(z, x), Y = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), U = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
1777
1777
  setCardCustomCfg: te,
1778
- setQueryResultColumns: P,
1778
+ setQueryResultColumns: G,
1779
1779
  setFilterValues: ee,
1780
1780
  setCardSql: Z,
1781
1781
  setCardPython: J,
1782
1782
  setQueryError: I,
1783
1783
  setPythonStdOut: v,
1784
1784
  setCardPreferences: N
1785
- } = i((p) => p.actions), F = i((p) => p.onSave), H = i(
1785
+ } = r((p) => p.actions), F = r((p) => p.onSave), H = r(
1786
1786
  (p) => p.actions.setApplyFilters
1787
- ), ue = i((p) => p.onClose), se = i((p) => p.actions.setCardData), ge = i((p) => p.actions.setSqlGen), je = i((p) => p.runSql), be = i((p) => p.actions.setRunSql), xe = i(
1787
+ ), ue = r((p) => p.onClose), se = r((p) => p.actions.setCardData), ge = r((p) => p.actions.setSqlGen), je = r((p) => p.runSql), be = r((p) => p.actions.setRunSql), xe = r(
1788
1788
  (p) => p.actions.setIsSqlRunning
1789
1789
  ), {
1790
- data: G,
1790
+ data: P,
1791
1791
  isLoading: ne,
1792
1792
  isFetching: le,
1793
1793
  isSuccess: ye,
@@ -1811,28 +1811,28 @@ function In() {
1811
1811
  retry: !1
1812
1812
  });
1813
1813
  K(() => {
1814
- if (G && (se(G.records), v((G == null ? void 0 : G.output) || ""), G.records.length > 0)) {
1815
- const { dimensionKeys: p } = is(G.records);
1816
- P(p);
1814
+ if (P && (se(P.records), v((P == null ? void 0 : P.output) || ""), P.records.length > 0)) {
1815
+ const { dimensionKeys: p } = is(P.records);
1816
+ G(p);
1817
1817
  }
1818
- }, [G, se, P, v]), K(() => {
1818
+ }, [P, se, G, v]), K(() => {
1819
1819
  je && (ve(), be(!1));
1820
1820
  }, [je, ve, be]), K(() => {
1821
- (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), P([]), v("")) : I("");
1821
+ (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), G([]), v("")) : I("");
1822
1822
  }, [
1823
1823
  ne,
1824
1824
  le,
1825
- G,
1825
+ P,
1826
1826
  v,
1827
1827
  re,
1828
1828
  ye,
1829
1829
  xe,
1830
1830
  se,
1831
- P,
1831
+ G,
1832
1832
  I,
1833
1833
  Ie
1834
1834
  ]);
1835
- function Je() {
1835
+ function Pe() {
1836
1836
  Z(""), se([]), ge({}), te(""), N({});
1837
1837
  }
1838
1838
  const qe = (p) => {
@@ -1905,7 +1905,7 @@ function In() {
1905
1905
  }
1906
1906
  function Ma() {
1907
1907
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1908
- r && /* @__PURE__ */ e.jsx(
1908
+ o && /* @__PURE__ */ e.jsx(
1909
1909
  "div",
1910
1910
  {
1911
1911
  className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
@@ -1921,7 +1921,7 @@ function In() {
1921
1921
  }
1922
1922
  ),
1923
1923
  /* @__PURE__ */ e.jsx(kn, {}),
1924
- U && r && /* @__PURE__ */ e.jsx(
1924
+ U && o && /* @__PURE__ */ e.jsx(
1925
1925
  Re,
1926
1926
  {
1927
1927
  onClick: () => l(!1),
@@ -1930,7 +1930,7 @@ function In() {
1930
1930
  )
1931
1931
  ] }),
1932
1932
  /* @__PURE__ */ e.jsx(
1933
- Pe,
1933
+ Qe,
1934
1934
  {
1935
1935
  theme: "default",
1936
1936
  onChange: (p) => {
@@ -1963,7 +1963,7 @@ function In() {
1963
1963
  ] })
1964
1964
  }
1965
1965
  ),
1966
- U && !r && /* @__PURE__ */ e.jsx(
1966
+ U && !o && /* @__PURE__ */ e.jsx(
1967
1967
  oa,
1968
1968
  {
1969
1969
  onClick: () => l(!0),
@@ -1999,7 +1999,7 @@ function In() {
1999
1999
  role: "sql-container",
2000
2000
  className: "relative flex w-[99%]",
2001
2001
  children: /* @__PURE__ */ e.jsx(
2002
- Pe,
2002
+ Qe,
2003
2003
  {
2004
2004
  theme: "default",
2005
2005
  className: "pt-3",
@@ -2047,7 +2047,7 @@ function In() {
2047
2047
  role: "python-container",
2048
2048
  className: "relative flex w-[99%] pt-0",
2049
2049
  children: /* @__PURE__ */ e.jsx(
2050
- Pe,
2050
+ Qe,
2051
2051
  {
2052
2052
  className: "pt-3",
2053
2053
  theme: "default",
@@ -2138,7 +2138,7 @@ function In() {
2138
2138
  /* @__PURE__ */ e.jsxs(
2139
2139
  w,
2140
2140
  {
2141
- onClick: Je,
2141
+ onClick: Pe,
2142
2142
  className: "",
2143
2143
  size: "sm",
2144
2144
  variant: "outline",
@@ -2152,7 +2152,7 @@ function In() {
2152
2152
  Xs,
2153
2153
  {
2154
2154
  pressed: t,
2155
- onPressedChange: (p) => o(p),
2155
+ onPressedChange: (p) => i(p),
2156
2156
  className: "",
2157
2157
  size: "sm",
2158
2158
  variant: "outline",
@@ -2208,7 +2208,7 @@ function In() {
2208
2208
  }
2209
2209
  function qn({ data: s }) {
2210
2210
  var l;
2211
- const [n, a] = me.useState([]), o = Object.keys(s[0]).map((c) => ({
2211
+ const [n, a] = me.useState([]), i = Object.keys(s[0]).map((c) => ({
2212
2212
  // header: key,
2213
2213
  accessorKey: c,
2214
2214
  header: ({ column: d }) => {
@@ -2225,9 +2225,9 @@ function qn({ data: s }) {
2225
2225
  }
2226
2226
  ) });
2227
2227
  }
2228
- })), r = rt({
2228
+ })), o = rt({
2229
2229
  data: s,
2230
- columns: o,
2230
+ columns: i,
2231
2231
  getCoreRowModel: ht(),
2232
2232
  getPaginationRowModel: mt(),
2233
2233
  onSortingChange: a,
@@ -2238,11 +2238,11 @@ function qn({ data: s }) {
2238
2238
  }
2239
2239
  });
2240
2240
  return /* @__PURE__ */ e.jsxs(it, { children: [
2241
- /* @__PURE__ */ e.jsx(ot, { children: r.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((d) => /* @__PURE__ */ e.jsx(ct, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : As(
2241
+ /* @__PURE__ */ e.jsx(ot, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((d) => /* @__PURE__ */ e.jsx(ct, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : As(
2242
2242
  d.column.columnDef.header,
2243
2243
  d.getContext()
2244
2244
  ) }, d.id)) }, c.id)) }),
2245
- /* @__PURE__ */ e.jsx(dt, { children: (l = r.getRowModel().rows) != null && l.length ? r.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2245
+ /* @__PURE__ */ e.jsx(dt, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2246
2246
  ls,
2247
2247
  {
2248
2248
  className: "whitespace-nowrap py-2",
@@ -2250,7 +2250,7 @@ function qn({ data: s }) {
2250
2250
  children: c.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Es, { children: As(d.column.columnDef.cell, d.getContext()) }, d.id))
2251
2251
  },
2252
2252
  c.id
2253
- )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Es, { colSpan: o.length, className: "h-24 text-center", children: "No results." }) }) })
2253
+ )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Es, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2254
2254
  ] });
2255
2255
  }
2256
2256
  function ga({
@@ -2259,7 +2259,7 @@ function ga({
2259
2259
  ...n
2260
2260
  }) {
2261
2261
  me.useState(0);
2262
- const a = k((l) => l.themeStyle), t = i((l) => l.card), o = i((l) => l.actions.setCard);
2262
+ const a = k((l) => l.themeStyle), t = r((l) => l.card), i = r((l) => l.actions.setCard);
2263
2263
  if (K(() => {
2264
2264
  }, [
2265
2265
  t.data,
@@ -2270,8 +2270,8 @@ function ga({
2270
2270
  t.preferences
2271
2271
  ]), !t.id)
2272
2272
  return null;
2273
- let r;
2274
- return t.data && t.data.length > 0 && (r = la({
2273
+ let o;
2274
+ return t.data && t.data.length > 0 && (o = la({
2275
2275
  data: t.data,
2276
2276
  cardType: t.type,
2277
2277
  cfg: t.cfg,
@@ -2289,7 +2289,7 @@ function ga({
2289
2289
  Ls,
2290
2290
  {
2291
2291
  text: t.title,
2292
- onSave: (l) => o({ ...t, title: l }),
2292
+ onSave: (l) => i({ ...t, title: l }),
2293
2293
  children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ft, { className: "text-base", children: t.title }) })
2294
2294
  },
2295
2295
  t.title
@@ -2298,7 +2298,7 @@ function ga({
2298
2298
  Ls,
2299
2299
  {
2300
2300
  text: t.description || "",
2301
- onSave: (l) => o({ ...t, description: l }),
2301
+ onSave: (l) => i({ ...t, description: l }),
2302
2302
  children: /* @__PURE__ */ e.jsxs(gt, { children: [
2303
2303
  " ",
2304
2304
  t.description
@@ -2308,13 +2308,13 @@ function ga({
2308
2308
  )
2309
2309
  ] }),
2310
2310
  /* @__PURE__ */ e.jsxs(jt, { className: "flex grow flex-col pb-3", children: [
2311
- t.type !== "table" && r && // <ChartJsVisual key={visualKey} cfg={cfg} />
2311
+ t.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
2312
2312
  /* @__PURE__ */ e.jsx(
2313
2313
  bt,
2314
2314
  {
2315
- cfg: r
2315
+ cfg: o
2316
2316
  },
2317
- JSON.stringify(r) + JSON.stringify(t.preferences)
2317
+ JSON.stringify(o) + JSON.stringify(t.preferences)
2318
2318
  ),
2319
2319
  t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2320
2320
  /* @__PURE__ */ e.jsx(yt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(vt, { card: t, data: t == null ? void 0 : t.data }) })
@@ -2324,9 +2324,9 @@ function ga({
2324
2324
  );
2325
2325
  }
2326
2326
  function Vn() {
2327
- const [s, n] = M(!1), [a, t] = M(""), [o, r] = M(""), [l, c] = M(""), d = i((j) => j.card), f = i(
2327
+ const [s, n] = M(!1), [a, t] = M(""), [i, o] = M(""), [l, c] = M(""), d = r((j) => j.card), f = r(
2328
2328
  (j) => j.card.customCfg
2329
- ), m = i(
2329
+ ), m = r(
2330
2330
  (j) => j.actions.setCardCustomCfg
2331
2331
  );
2332
2332
  function u(j) {
@@ -2352,19 +2352,19 @@ function Vn() {
2352
2352
  cfg: d.cfg,
2353
2353
  preferences: d.preferences
2354
2354
  });
2355
- j && (t(JSON.stringify(j, null, 1)), f && r(JSON.stringify(f, null, 1)));
2355
+ j && (t(JSON.stringify(j, null, 1)), f && o(JSON.stringify(f, null, 1)));
2356
2356
  }
2357
2357
  function h() {
2358
- if (o)
2358
+ if (i)
2359
2359
  try {
2360
- const j = JSON.parse(o);
2361
- return j ? (m(j), c(""), r(""), j) : void 0;
2360
+ const j = JSON.parse(i);
2361
+ return j ? (m(j), c(""), o(""), j) : void 0;
2362
2362
  } catch (j) {
2363
2363
  console.log(j), c("Invalid JSON");
2364
2364
  }
2365
2365
  }
2366
2366
  function x() {
2367
- r(""), m(null);
2367
+ o(""), m(null);
2368
2368
  }
2369
2369
  function g() {
2370
2370
  let j;
@@ -2394,7 +2394,7 @@ function Vn() {
2394
2394
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2395
2395
  /* @__PURE__ */ e.jsx(xs, { children: "Customize Card" }),
2396
2396
  /* @__PURE__ */ e.jsxs(fs, { children: [
2397
- /* @__PURE__ */ e.jsx(Ps, { children: /* @__PURE__ */ e.jsx(
2397
+ /* @__PURE__ */ e.jsx(Gs, { children: /* @__PURE__ */ e.jsx(
2398
2398
  Zt,
2399
2399
  {
2400
2400
  onClick: () => {
@@ -2450,7 +2450,7 @@ function Vn() {
2450
2450
  className: "mt-0 grow rounded-b border border-t-0",
2451
2451
  value: "custom-config",
2452
2452
  children: /* @__PURE__ */ e.jsx(
2453
- Pe,
2453
+ Qe,
2454
2454
  {
2455
2455
  className: "h-full w-full overflow-hidden",
2456
2456
  theme: "default",
@@ -2468,7 +2468,7 @@ function Vn() {
2468
2468
  },
2469
2469
  defaultLanguage: "json",
2470
2470
  value: g(),
2471
- onChange: (j) => r(j)
2471
+ onChange: (j) => o(j)
2472
2472
  }
2473
2473
  )
2474
2474
  }
@@ -2516,17 +2516,17 @@ function Sa(s) {
2516
2516
  return fe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
2517
2517
  }
2518
2518
  function Rn() {
2519
- const [s, n] = M(!1), a = i((c) => c.card.type), { setCardType: t, setCardPreferences: o } = i(
2519
+ const [s, n] = M(!1), a = r((c) => c.card.type), { setCardType: t, setCardPreferences: i } = r(
2520
2520
  (c) => c.actions
2521
- ), r = i(
2521
+ ), o = r(
2522
2522
  (c) => c.actions.setCardCustomCfg
2523
2523
  );
2524
2524
  function l(c) {
2525
- t(c), r(null), o({}), n(!1);
2525
+ t(c), o(null), i({}), n(!1);
2526
2526
  }
2527
- return /* @__PURE__ */ e.jsxs($e, { open: s, onOpenChange: n, children: [
2528
- /* @__PURE__ */ e.jsx(Ke, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(_n, { className: "h-4 w-4", chartType: a }) }) }),
2529
- /* @__PURE__ */ e.jsx(Ue, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2527
+ return /* @__PURE__ */ e.jsxs(Ke, { open: s, onOpenChange: n, children: [
2528
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(_n, { className: "h-4 w-4", chartType: a }) }) }),
2529
+ /* @__PURE__ */ e.jsx(Je, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2530
2530
  /* @__PURE__ */ e.jsx(
2531
2531
  w,
2532
2532
  {
@@ -2662,14 +2662,14 @@ function _n({ chartType: s, className: n }) {
2662
2662
  }
2663
2663
  }
2664
2664
  function Hn() {
2665
- const s = i(
2665
+ const s = r(
2666
2666
  (a) => a.card.refreshInterval
2667
- ), n = i(
2667
+ ), n = r(
2668
2668
  (a) => a.actions.setCardRefreshInterval
2669
2669
  );
2670
- return /* @__PURE__ */ e.jsxs($e, { children: [
2671
- /* @__PURE__ */ e.jsx(Ke, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ut, { className: "w-4 h-4" }) }) }),
2672
- /* @__PURE__ */ e.jsx(Ue, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2670
+ return /* @__PURE__ */ e.jsxs(Ke, { children: [
2671
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ut, { className: "w-4 h-4" }) }) }),
2672
+ /* @__PURE__ */ e.jsx(Je, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2673
2673
  /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2674
2674
  /* @__PURE__ */ e.jsx(
2675
2675
  ae,
@@ -2685,9 +2685,9 @@ function Hn() {
2685
2685
  ] });
2686
2686
  }
2687
2687
  function Bs() {
2688
- i((l) => l.frame);
2689
- const s = i((l) => l.card), n = i((l) => l.card.data), a = i((l) => l.isShowingVisual), t = i((l) => l.isSqlRunning), o = i((l) => l.queryError), r = i((l) => l.pythonStdOut);
2690
- return i((l) => l.onSave), i((l) => l.onClose), i((l) => l.actions.setCardSql), i((l) => l.actions.setCardType), i((l) => l.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2688
+ r((l) => l.frame);
2689
+ const s = r((l) => l.card), n = r((l) => l.card.data), a = r((l) => l.isShowingVisual), t = r((l) => l.isSqlRunning), i = r((l) => l.queryError), o = r((l) => l.pythonStdOut);
2690
+ return r((l) => l.onSave), r((l) => l.onClose), r((l) => l.actions.setCardSql), r((l) => l.actions.setCardType), r((l) => l.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2691
2691
  t && /* @__PURE__ */ e.jsx(He, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2692
2692
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2693
2693
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
@@ -2698,14 +2698,14 @@ function Bs() {
2698
2698
  /* @__PURE__ */ e.jsx($n, {})
2699
2699
  ] }),
2700
2700
  a ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(wt, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ga, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2701
- r && /* @__PURE__ */ e.jsx(Bn, {}),
2701
+ o && /* @__PURE__ */ e.jsx(Bn, {}),
2702
2702
  s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(qn, { data: n || [] }),
2703
- o && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: o })
2703
+ i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
2704
2704
  ] })
2705
2705
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2706
2706
  }
2707
2707
  function Bn() {
2708
- const s = i((a) => a.pythonStdOut);
2708
+ const s = r((a) => a.pythonStdOut);
2709
2709
  if (!s)
2710
2710
  return null;
2711
2711
  const n = s.replace(/\n/g, "<br>");
@@ -2722,7 +2722,7 @@ function Bn() {
2722
2722
  ] });
2723
2723
  }
2724
2724
  function $n() {
2725
- const s = i((a) => a.isShowingVisual), n = i(
2725
+ const s = r((a) => a.isShowingVisual), n = r(
2726
2726
  (a) => a.actions.setIsShowingVisual
2727
2727
  );
2728
2728
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
@@ -2740,13 +2740,13 @@ function $n() {
2740
2740
  }
2741
2741
  function De() {
2742
2742
  const [s, n] = M([]);
2743
- i(
2743
+ r(
2744
2744
  (m) => m.card.cfg
2745
2745
  );
2746
- const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: o, setCardPreferences: r } = i((m) => m.actions), l = i(
2746
+ const a = r((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = r((m) => m.actions), l = r(
2747
2747
  (m) => m.queryResultColumns
2748
2748
  );
2749
- i(
2749
+ r(
2750
2750
  (m) => {
2751
2751
  var u;
2752
2752
  return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
@@ -2756,7 +2756,7 @@ function De() {
2756
2756
  }, [l]);
2757
2757
  function c(m, u) {
2758
2758
  var C, h;
2759
- u ? a != null && a.onClickFilter && ((C = a == null ? void 0 : a.onClickFilter) == null ? void 0 : C.length) > 0 ? r({
2759
+ u ? a != null && a.onClickFilter && ((C = a == null ? void 0 : a.onClickFilter) == null ? void 0 : C.length) > 0 ? o({
2760
2760
  ...a,
2761
2761
  onClickFilter: [
2762
2762
  ...a.onClickFilter,
@@ -2765,7 +2765,7 @@ function De() {
2765
2765
  expression: ""
2766
2766
  }
2767
2767
  ]
2768
- }) : r({
2768
+ }) : o({
2769
2769
  ...a,
2770
2770
  onClickFilter: [
2771
2771
  {
@@ -2773,7 +2773,7 @@ function De() {
2773
2773
  expression: ""
2774
2774
  }
2775
2775
  ]
2776
- }) : (r({
2776
+ }) : (o({
2777
2777
  ...a,
2778
2778
  onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
2779
2779
  (x) => x.columnIndex !== m
@@ -2789,7 +2789,7 @@ function De() {
2789
2789
  ...x,
2790
2790
  expression: u.target.value
2791
2791
  } : x);
2792
- r({
2792
+ o({
2793
2793
  ...a,
2794
2794
  onClickFilter: C
2795
2795
  });
@@ -2817,7 +2817,7 @@ function De() {
2817
2817
  children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
2818
2818
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
2819
2819
  /* @__PURE__ */ e.jsx(
2820
- Ze,
2820
+ $e,
2821
2821
  {
2822
2822
  checked: !!((C = a == null ? void 0 : a.onClickFilter) != null && C.find(
2823
2823
  (x) => x.columnIndex === u
@@ -2855,14 +2855,14 @@ function De() {
2855
2855
  }) });
2856
2856
  }
2857
2857
  function Ss() {
2858
- var r, l;
2859
- const s = i((c) => c.card.preferences), n = i(
2858
+ var o, l;
2859
+ const s = r((c) => c.card.preferences), n = r(
2860
2860
  (c) => c.card.cfg
2861
- ), { setCardCfg: a, setCardPreferences: t } = i(
2861
+ ), { setCardCfg: a, setCardPreferences: t } = r(
2862
2862
  (c) => c.actions
2863
2863
  );
2864
- (r = n == null ? void 0 : n.options) != null && r.indexAxis;
2865
- function o(c) {
2864
+ (o = n == null ? void 0 : n.options) != null && o.indexAxis;
2865
+ function i(c) {
2866
2866
  var m, u, C, h, x, g;
2867
2867
  let d = {};
2868
2868
  (m = s == null ? void 0 : s.chartOptions) != null && m.scales && (d = {
@@ -2886,16 +2886,16 @@ function Ss() {
2886
2886
  ra,
2887
2887
  {
2888
2888
  value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || "x",
2889
- onValueChange: o,
2889
+ onValueChange: i,
2890
2890
  className: "flex gap-3",
2891
2891
  defaultValue: "x",
2892
2892
  children: [
2893
2893
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2894
- /* @__PURE__ */ e.jsx(We, { value: "x", id: "r1" }),
2894
+ /* @__PURE__ */ e.jsx(Ye, { value: "x", id: "r1" }),
2895
2895
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
2896
2896
  ] }),
2897
2897
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2898
- /* @__PURE__ */ e.jsx(We, { value: "y", id: "r2" }),
2898
+ /* @__PURE__ */ e.jsx(Ye, { value: "y", id: "r2" }),
2899
2899
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
2900
2900
  ] })
2901
2901
  ]
@@ -2904,38 +2904,38 @@ function Ss() {
2904
2904
  }
2905
2905
  const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2906
2906
  function $s(s, n) {
2907
- var t, o, r;
2907
+ var t, i, o;
2908
2908
  const a = ia(s, n);
2909
- return ((r = (o = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : o[a]) == null ? void 0 : r.type) || "linear";
2909
+ return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
2910
2910
  }
2911
2911
  function ka() {
2912
- var P, ee, Z, J, I, v;
2913
- const [s, n] = M(!1), a = i((N) => {
2912
+ var G, ee, Z, J, I, v;
2913
+ const [s, n] = M(!1), a = r((N) => {
2914
2914
  var F;
2915
2915
  return (F = N.card) == null ? void 0 : F.preferences;
2916
- }), t = i((N) => {
2916
+ }), t = r((N) => {
2917
2917
  var F;
2918
2918
  return (F = N.card) == null ? void 0 : F.cfg;
2919
- }), o = ia(a, t), [r, l] = M(
2919
+ }), i = ia(a, t), [o, l] = M(
2920
2920
  $s(a)
2921
2921
  ), [c, d] = M(
2922
- ((Z = (ee = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : ee[o]) == null ? void 0 : Z.min) || ""
2922
+ ((Z = (ee = (G = a == null ? void 0 : a.chartOptions) == null ? void 0 : G.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
2923
2923
  ), [f, m] = M(
2924
- ((v = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[o]) == null ? void 0 : v.max) || ""
2925
- ), [u, C] = M(c || f ? "custom" : "auto"), [h, x] = M(""), [g, j] = M(0), [b, L] = M(""), [A, O] = M(""), [y, z] = M(""), E = i(
2924
+ ((v = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[i]) == null ? void 0 : v.max) || ""
2925
+ ), [u, C] = M(c || f ? "custom" : "auto"), [h, x] = M(""), [g, j] = M(0), [b, L] = M(""), [A, O] = M(""), [y, z] = M(""), E = r(
2926
2926
  (N) => N.actions.setCardPreferences
2927
- ), _ = i((N) => {
2927
+ ), _ = r((N) => {
2928
2928
  var F;
2929
2929
  return (F = N.card) == null ? void 0 : F.type;
2930
2930
  }), Y = ["pie", "doughnut", "polarArea"].includes(_);
2931
2931
  K(() => {
2932
- var N, F, H, ue, se, ge, je, be, xe, G, ne, le, ye, re;
2932
+ var N, F, H, ue, se, ge, je, be, xe, P, ne, le, ye, re;
2933
2933
  l($s(a)), d(
2934
- ((H = (F = (N = a == null ? void 0 : a.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : F[o]) == null ? void 0 : H.min) === 0 ? 0 : ""
2935
- ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[o]) == null ? void 0 : ge.max) || ""), x(
2936
- ((G = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[o]) == null ? void 0 : xe.ticks) == null ? void 0 : G.stepSize) || ""
2934
+ ((H = (F = (N = a == null ? void 0 : a.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : F[i]) == null ? void 0 : H.min) === 0 ? 0 : ""
2935
+ ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[i]) == null ? void 0 : ge.max) || ""), x(
2936
+ ((P = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : P.stepSize) || ""
2937
2937
  ), j(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), z(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
2938
- }, [s, a, o]);
2938
+ }, [s, a, i]);
2939
2939
  function $(N, F) {
2940
2940
  return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(N);
2941
2941
  }
@@ -3045,10 +3045,10 @@ function ka() {
3045
3045
  ...a == null ? void 0 : a.chartOptions,
3046
3046
  scales: {
3047
3047
  ...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
3048
- [o]: {
3048
+ [i]: {
3049
3049
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3050
- type: r,
3051
- ...r === "linear" ? N : {}
3050
+ type: o,
3051
+ ...o === "linear" ? N : {}
3052
3052
  }
3053
3053
  }
3054
3054
  },
@@ -3061,9 +3061,9 @@ function ka() {
3061
3061
  };
3062
3062
  E(F);
3063
3063
  }
3064
- return /* @__PURE__ */ e.jsxs($e, { onOpenChange: (N) => n(N), children: [
3065
- /* @__PURE__ */ e.jsx(Ke, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ft, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3066
- /* @__PURE__ */ e.jsx(Ue, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3064
+ return /* @__PURE__ */ e.jsxs(Ke, { onOpenChange: (N) => n(N), children: [
3065
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ft, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3066
+ /* @__PURE__ */ e.jsx(Je, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3067
3067
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3068
3068
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
3069
3069
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
@@ -3075,7 +3075,7 @@ function ka() {
3075
3075
  Oe,
3076
3076
  {
3077
3077
  disabled: Y,
3078
- value: r,
3078
+ value: o,
3079
3079
  onValueChange: (N) => l(N),
3080
3080
  children: [
3081
3081
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
@@ -3088,7 +3088,7 @@ function ka() {
3088
3088
  }
3089
3089
  )
3090
3090
  ] }),
3091
- r == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3091
+ o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3092
3092
  /* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
3093
3093
  /* @__PURE__ */ e.jsxs(
3094
3094
  ra,
@@ -3101,18 +3101,18 @@ function ka() {
3101
3101
  defaultValue: "x",
3102
3102
  children: [
3103
3103
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3104
- /* @__PURE__ */ e.jsx(We, { value: "auto", id: "r1" }),
3104
+ /* @__PURE__ */ e.jsx(Ye, { value: "auto", id: "r1" }),
3105
3105
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
3106
3106
  ] }),
3107
3107
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3108
- /* @__PURE__ */ e.jsx(We, { value: "custom", id: "r2" }),
3108
+ /* @__PURE__ */ e.jsx(Ye, { value: "custom", id: "r2" }),
3109
3109
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
3110
3110
  ] })
3111
3111
  ]
3112
3112
  }
3113
3113
  )
3114
3114
  ] }),
3115
- u === "custom" && r == "linear" && D(),
3115
+ u === "custom" && o == "linear" && D(),
3116
3116
  U(),
3117
3117
  /* @__PURE__ */ e.jsx(Ot, {}),
3118
3118
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
@@ -3130,17 +3130,17 @@ function ka() {
3130
3130
  }
3131
3131
  function Kn({ idx: s }) {
3132
3132
  var c;
3133
- const n = i((d) => {
3133
+ const n = r((d) => {
3134
3134
  var f;
3135
3135
  return (f = d.card) == null ? void 0 : f.preferences;
3136
- }), a = i(
3136
+ }), a = r(
3137
3137
  (d) => {
3138
3138
  var f;
3139
3139
  return (f = d.card.preferences) == null ? void 0 : f.datasetOptions;
3140
3140
  }
3141
- ), t = i(
3141
+ ), t = r(
3142
3142
  (d) => d.actions.setCardPreferences
3143
- ), o = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, r = a == null ? void 0 : a.find((d) => d.idx === s);
3143
+ ), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((d) => d.idx === s);
3144
3144
  function l(d, f) {
3145
3145
  (d === "end" || d === "start") && Tt(At());
3146
3146
  const m = {
@@ -3149,7 +3149,7 @@ function Kn({ idx: s }) {
3149
3149
  anchor: d,
3150
3150
  clamp: !0
3151
3151
  };
3152
- if (!r)
3152
+ if (!o)
3153
3153
  t({
3154
3154
  ...n,
3155
3155
  datasetOptions: [
@@ -3161,7 +3161,7 @@ function Kn({ idx: s }) {
3161
3161
  ]
3162
3162
  });
3163
3163
  else {
3164
- const u = { ...r };
3164
+ const u = { ...o };
3165
3165
  u.datalabels = m;
3166
3166
  const C = a == null ? void 0 : a.map(
3167
3167
  (h) => h.idx === f ? u : h
@@ -3172,9 +3172,9 @@ function Kn({ idx: s }) {
3172
3172
  });
3173
3173
  }
3174
3174
  }
3175
- return /* @__PURE__ */ e.jsxs($e, { children: [
3176
- /* @__PURE__ */ e.jsx(Ke, { children: /* @__PURE__ */ e.jsx(mn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3177
- /* @__PURE__ */ e.jsx(Ue, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3175
+ return /* @__PURE__ */ e.jsxs(Ke, { children: [
3176
+ /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(mn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3177
+ /* @__PURE__ */ e.jsx(Je, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3178
3178
  /* @__PURE__ */ e.jsx(
3179
3179
  w,
3180
3180
  {
@@ -3196,7 +3196,7 @@ function Kn({ idx: s }) {
3196
3196
  en,
3197
3197
  {
3198
3198
  className: W("h-4 w-4", {
3199
- "rotate-90": o === "y"
3199
+ "rotate-90": i === "y"
3200
3200
  })
3201
3201
  }
3202
3202
  )
@@ -3213,7 +3213,7 @@ function Kn({ idx: s }) {
3213
3213
  an,
3214
3214
  {
3215
3215
  className: W("h-4 w-4", {
3216
- "rotate-90": o === "y"
3216
+ "rotate-90": i === "y"
3217
3217
  })
3218
3218
  }
3219
3219
  )
@@ -3230,7 +3230,7 @@ function Kn({ idx: s }) {
3230
3230
  sn,
3231
3231
  {
3232
3232
  className: W("h-4 w-4", {
3233
- "rotate-90": o === "y"
3233
+ "rotate-90": i === "y"
3234
3234
  })
3235
3235
  }
3236
3236
  )
@@ -3240,17 +3240,17 @@ function Kn({ idx: s }) {
3240
3240
  ] });
3241
3241
  }
3242
3242
  function wa() {
3243
- const s = i((d) => d.card), n = i(
3243
+ const s = r((d) => d.card), n = r(
3244
3244
  (d) => {
3245
3245
  var f, m, u;
3246
3246
  return (u = (m = (f = d == null ? void 0 : d.card) == null ? void 0 : f.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3247
3247
  }
3248
3248
  ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3249
- keys: o,
3250
- metricKeys: r,
3249
+ keys: i,
3250
+ metricKeys: o,
3251
3251
  dimensionKeys: l
3252
3252
  } = is(s.data || []);
3253
- let c = r;
3253
+ let c = o;
3254
3254
  if (s.type === "stackedBar") {
3255
3255
  const d = Et({
3256
3256
  dataArray: s.data || [],
@@ -3260,7 +3260,7 @@ function wa() {
3260
3260
  }), { metricKeys: f } = is(d);
3261
3261
  c = f;
3262
3262
  }
3263
- return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3263
+ return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3264
3264
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3265
3265
  /* @__PURE__ */ e.jsx(B, { children: a }),
3266
3266
  /* @__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: l[0] }) }) })
@@ -3275,18 +3275,18 @@ function wa() {
3275
3275
  ] });
3276
3276
  }
3277
3277
  function Un({ col: s, idx: n }) {
3278
- const a = i((c) => {
3278
+ const a = r((c) => {
3279
3279
  var d;
3280
3280
  return (d = c.card) == null ? void 0 : d.preferences;
3281
- }), t = i(
3281
+ }), t = r(
3282
3282
  (c) => {
3283
3283
  var d;
3284
3284
  return (d = c.card.preferences) == null ? void 0 : d.datasetOptions;
3285
3285
  }
3286
- ), o = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: r } = i((c) => c.actions);
3286
+ ), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
3287
3287
  function l(c) {
3288
- if (!o)
3289
- r({
3288
+ if (!i)
3289
+ o({
3290
3290
  ...a,
3291
3291
  datasetOptions: [
3292
3292
  ...t || [],
@@ -3298,12 +3298,12 @@ function Un({ col: s, idx: n }) {
3298
3298
  ]
3299
3299
  });
3300
3300
  else {
3301
- const d = { ...o };
3301
+ const d = { ...i };
3302
3302
  d.type = c === "area" ? "line" : c, d.fill = c === "area" ? "origin" : "";
3303
3303
  const f = t == null ? void 0 : t.map(
3304
3304
  (m) => m.idx === n ? d : m
3305
3305
  );
3306
- r({
3306
+ o({
3307
3307
  ...a,
3308
3308
  datasetOptions: f
3309
3309
  });
@@ -3387,10 +3387,10 @@ function Jn({
3387
3387
  ] }) });
3388
3388
  }
3389
3389
  function ks() {
3390
- var o, r, l;
3391
- const s = i(
3390
+ var i, o, l;
3391
+ const s = r(
3392
3392
  (c) => c.card.cfg
3393
- ), n = i((c) => c.actions.setCardCfg), a = i((c) => c.card.type);
3393
+ ), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
3394
3394
  function t(c) {
3395
3395
  var m;
3396
3396
  const d = {
@@ -3420,7 +3420,7 @@ function ks() {
3420
3420
  /* @__PURE__ */ e.jsxs(
3421
3421
  Oe,
3422
3422
  {
3423
- value: (l = (r = (o = s == null ? void 0 : s.options) == null ? void 0 : o.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : l.anchor,
3423
+ value: (l = (o = (i = s == null ? void 0 : s.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : l.anchor,
3424
3424
  onValueChange: t,
3425
3425
  defaultValue: "none",
3426
3426
  children: [
@@ -3437,13 +3437,13 @@ function ks() {
3437
3437
  )
3438
3438
  ] });
3439
3439
  }
3440
- function Gn({
3440
+ function Pn({
3441
3441
  cardType: s
3442
3442
  }) {
3443
3443
  function n(a) {
3444
- const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", o = "SELECT label, [group], x-axis, y-axis FROM table";
3444
+ const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", i = "SELECT label, [group], x-axis, y-axis FROM table";
3445
3445
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3446
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : o }),
3446
+ /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : i }),
3447
3447
  /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
3448
3448
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3449
3449
  /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
@@ -3457,7 +3457,7 @@ function Gn({
3457
3457
  "a",
3458
3458
  {
3459
3459
  target: "_blank",
3460
- onClick: (r) => r.stopPropagation(),
3460
+ onClick: (o) => o.stopPropagation(),
3461
3461
  className: "text-blue-700",
3462
3462
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3463
3463
  children: "example"
@@ -3482,7 +3482,7 @@ function Gn({
3482
3482
  ] })
3483
3483
  ] }) });
3484
3484
  }
3485
- const Pn = {
3485
+ const Gn = {
3486
3486
  datasets: [
3487
3487
  {
3488
3488
  type: "line",
@@ -3506,7 +3506,7 @@ const Pn = {
3506
3506
  ]
3507
3507
  };
3508
3508
  function Wn() {
3509
- const s = i((n) => n.card.type);
3509
+ const s = r((n) => n.card.type);
3510
3510
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6 space-y-6", children: [
3511
3511
  /* @__PURE__ */ e.jsx(
3512
3512
  Se,
@@ -3543,7 +3543,7 @@ function Yn(s) {
3543
3543
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
3544
3544
  " and change the `type` property in the dataset."
3545
3545
  ] }),
3546
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Pn, null, 2) })
3546
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gn, null, 2) })
3547
3547
  ] })
3548
3548
  ] }),
3549
3549
  /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
@@ -3621,43 +3621,43 @@ function Yn(s) {
3621
3621
  }
3622
3622
  function Xn() {
3623
3623
  var d, f, m, u, C;
3624
- const s = i((h) => h.card.preferences), n = i(
3624
+ const s = r((h) => h.card.preferences), n = r(
3625
3625
  (h) => h.actions.setCardPreferences
3626
- ), a = i(
3626
+ ), a = r(
3627
3627
  (h) => h.actions.setNumberFormat
3628
3628
  );
3629
- i(
3629
+ r(
3630
3630
  (h) => {
3631
3631
  var x, g;
3632
3632
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.decimalPlaces;
3633
3633
  }
3634
3634
  );
3635
- const t = i(
3635
+ const t = r(
3636
3636
  (h) => {
3637
3637
  var x, g;
3638
3638
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.locale;
3639
3639
  }
3640
- ), o = i(
3640
+ ), i = r(
3641
3641
  (h) => {
3642
3642
  var x, g;
3643
3643
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.currency;
3644
3644
  }
3645
3645
  );
3646
- i(
3646
+ r(
3647
3647
  (h) => h.actions.setFilterOnClickField
3648
3648
  );
3649
- const r = i(
3649
+ const o = r(
3650
3650
  (h) => {
3651
3651
  var x, g;
3652
3652
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.colorRanges;
3653
3653
  }
3654
- ) || [], l = i(
3654
+ ) || [], l = r(
3655
3655
  (h) => h.actions.setColorRanges
3656
3656
  ), c = [...new Set(Vs.map((h) => h.currency))];
3657
3657
  return /* @__PURE__ */ e.jsxs("div", { children: [
3658
3658
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
3659
3659
  /* @__PURE__ */ e.jsx(
3660
- Ze,
3660
+ $e,
3661
3661
  {
3662
3662
  checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
3663
3663
  onCheckedChange: (h) => {
@@ -3706,7 +3706,7 @@ function Xn() {
3706
3706
  /* @__PURE__ */ e.jsxs(
3707
3707
  Oe,
3708
3708
  {
3709
- value: o || "none",
3709
+ value: i || "none",
3710
3710
  onValueChange: (h) => {
3711
3711
  var x, g, j;
3712
3712
  return a(
@@ -3777,7 +3777,7 @@ function Xn() {
3777
3777
  /* @__PURE__ */ e.jsx(
3778
3778
  Lt,
3779
3779
  {
3780
- colorRanges: r,
3780
+ colorRanges: o,
3781
3781
  setColorRanges: l
3782
3782
  }
3783
3783
  )
@@ -3895,10 +3895,34 @@ function el() {
3895
3895
  ] }) });
3896
3896
  }
3897
3897
  function sl({}) {
3898
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3899
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3900
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3901
- ] }) }) });
3898
+ const s = r((t) => {
3899
+ var i;
3900
+ return (i = t.card) == null ? void 0 : i.preferences;
3901
+ }), n = r(
3902
+ (t) => t.actions.setCardPreferences
3903
+ ), a = (t) => {
3904
+ n({
3905
+ ...s,
3906
+ allowDownload: t
3907
+ });
3908
+ };
3909
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3910
+ /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3911
+ /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3912
+ /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3913
+ ] }) }),
3914
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3915
+ /* @__PURE__ */ e.jsx($e, { onCheckedChange: a, id: "allow-download" }),
3916
+ /* @__PURE__ */ e.jsx(
3917
+ "label",
3918
+ {
3919
+ htmlFor: "allow-download",
3920
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
3921
+ children: "Allow Download"
3922
+ }
3923
+ )
3924
+ ] })
3925
+ ] });
3902
3926
  }
3903
3927
  const al = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3904
3928
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
@@ -3918,7 +3942,7 @@ const al = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3918
3942
  ] })
3919
3943
  ] });
3920
3944
  function tl() {
3921
- const s = i((a) => a.card.type);
3945
+ const s = r((a) => a.card.type);
3922
3946
  function n(a) {
3923
3947
  switch (a) {
3924
3948
  case "stackedBar":
@@ -3943,7 +3967,7 @@ function tl() {
3943
3967
  return /* @__PURE__ */ e.jsx(Ks, { cardType: a });
3944
3968
  case "bubble":
3945
3969
  case "scatter":
3946
- return /* @__PURE__ */ e.jsx(Gn, { cardType: a });
3970
+ return /* @__PURE__ */ e.jsx(Pn, { cardType: a });
3947
3971
  case "table":
3948
3972
  return /* @__PURE__ */ e.jsx(sl, { cardType: a });
3949
3973
  default:
@@ -3953,7 +3977,7 @@ function tl() {
3953
3977
  return /* @__PURE__ */ e.jsx(bs, { className: "h-full w-full text-sm", children: n(s) });
3954
3978
  }
3955
3979
  function nl() {
3956
- const s = i((n) => n.isShowingVisual);
3980
+ const s = r((n) => n.isShowingVisual);
3957
3981
  return /* @__PURE__ */ e.jsxs(
3958
3982
  os,
3959
3983
  {
@@ -3999,12 +4023,12 @@ function nl() {
3999
4023
  );
4000
4024
  }
4001
4025
  function ll({ authToken: s, onSave: n, onClose: a }) {
4002
- const t = i((l) => l.actions.setOnSave), o = i((l) => l.actions.setOnClose), r = k((l) => l.actions.setAuthToken);
4026
+ const t = r((l) => l.actions.setOnSave), i = r((l) => l.actions.setOnClose), o = k((l) => l.actions.setAuthToken);
4003
4027
  return K(() => {
4004
- n && t(n), a && o(a);
4005
- }, [n, t, a, o]), K(() => {
4006
- s && s.accessToken && r(s);
4007
- }, [s, r]), /* @__PURE__ */ e.jsxs(Dt, { className: "rounded-none", role: "editor-panel", children: [
4028
+ n && t(n), a && i(a);
4029
+ }, [n, t, a, i]), K(() => {
4030
+ s && s.accessToken && o(s);
4031
+ }, [s, o]), /* @__PURE__ */ e.jsxs(Dt, { className: "rounded-none", role: "editor-panel", children: [
4008
4032
  /* @__PURE__ */ e.jsx(It, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(xa, {}) }),
4009
4033
  /* @__PURE__ */ e.jsx(qt, { children: /* @__PURE__ */ e.jsx(nl, {}) })
4010
4034
  ] });
@@ -4012,10 +4036,10 @@ function ll({ authToken: s, onSave: n, onClose: a }) {
4012
4036
  function rl() {
4013
4037
  k((l) => l.selectedCardId);
4014
4038
  const s = k((l) => l.selectedSheetId), { setIsVisualEditing: n } = k((l) => l.actions), a = k((l) => l.isVisualEditing), t = k((l) => l.actions.updateFrame);
4015
- function o(l) {
4039
+ function i(l) {
4016
4040
  s && (t(s, l), n(!1));
4017
4041
  }
4018
- function r() {
4042
+ function o() {
4019
4043
  n(!1);
4020
4044
  }
4021
4045
  return /* @__PURE__ */ e.jsx(
@@ -4026,7 +4050,7 @@ function rl() {
4026
4050
  block: a,
4027
4051
  hidden: !a
4028
4052
  }),
4029
- children: /* @__PURE__ */ e.jsx(ll, { onSave: o, onClose: r })
4053
+ children: /* @__PURE__ */ e.jsx(ll, { onSave: i, onClose: o })
4030
4054
  }
4031
4055
  );
4032
4056
  }
@@ -4034,11 +4058,11 @@ function il({
4034
4058
  columns: s,
4035
4059
  tableName: n
4036
4060
  }) {
4037
- const a = i((u) => u.selectedConnectionId), t = i((u) => u.selectedDatabaseName), o = i((u) => u.selectedSchemaName), r = i((u) => u.selectedTableName), l = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter), d = k((u) => u.actions.removeFilter), f = k(
4061
+ const a = r((u) => u.selectedConnectionId), t = r((u) => u.selectedDatabaseName), i = r((u) => u.selectedSchemaName), o = r((u) => u.selectedTableName), l = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter), d = k((u) => u.actions.removeFilter), f = k(
4038
4062
  (u) => u.actions.removeFilterValue
4039
4063
  );
4040
4064
  function m(u) {
4041
- const C = he(u.column_name), h = he(t || ""), x = he(o || ""), g = he(n), j = rs(
4065
+ const C = he(u.column_name), h = he(t || ""), x = he(i || ""), g = he(n), j = rs(
4042
4066
  x,
4043
4067
  g
4044
4068
  ), b = `${j}.${C}`;
@@ -4056,7 +4080,7 @@ function il({
4056
4080
  else {
4057
4081
  if (n === "api" && a) {
4058
4082
  c({
4059
- id: Qe(),
4083
+ id: We(),
4060
4084
  column: b,
4061
4085
  title: u.column_name,
4062
4086
  dataType: u.data_type,
@@ -4075,11 +4099,11 @@ function il({
4075
4099
  return;
4076
4100
  }
4077
4101
  c({
4078
- id: Qe(),
4102
+ id: We(),
4079
4103
  column: `${j}.${C}`,
4080
4104
  title: u.column_name,
4081
4105
  dataType: u.data_type,
4082
- table: r || "",
4106
+ table: o || "",
4083
4107
  database: t || "",
4084
4108
  connectionId: a || "",
4085
4109
  operation: "in",
@@ -4094,7 +4118,7 @@ function il({
4094
4118
  }
4095
4119
  return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: s == null ? void 0 : s.map((u) => {
4096
4120
  const C = l == null ? void 0 : l.find(
4097
- (h) => h.column === he(u.column_name) && h.table === r && h.database === t
4121
+ (h) => h.column === he(u.column_name) && h.table === o && h.database === t
4098
4122
  );
4099
4123
  return /* @__PURE__ */ e.jsx(
4100
4124
  "div",