react-semaphor 0.0.296 → 0.0.297

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 { c as q, p as hs, u as z, n as Fs, o as Oe, q as e, r as Ts, s as Is, t as F, j as Ds, v as Ms, w as Ls, x as Es, y as As, L as _, z as re, A as oa, E as ca, H as da, J as ua, K as rt, M as it, N as ot, O as Ys, Q as W, R as Qe, V as d, W as ct, F as ha, Y as We, Z as Ye, _ as Vs, $ as ma, a0 as qs, a1 as fe, a2 as ge, a3 as je, a4 as be, a5 as ke, a6 as ye, a7 as Q, T as Rs, a8 as _s, a9 as Hs, aa as $s, ab as xa, ac as pa, ad as xe, ae as dt, af as ut, ag as fa, ah as ht, C as mt, ai as xt, aj as ga, B as pt, ak as Ps, al as ft, am as Xs, an as ja, ao as Ns, ap as me, aq as we, ar as de, as as ms, at as ba, au as gt, av as jt, aw as ya, ax as bt, ay as yt, az as vt, aA as Ct, aB as Nt, aC as qe, aD as Ss, aE as St, a as wt, aF as Ke, aG as ws, aH as Ve, aI as ks, aJ as kt, aK as zt, aL as Ot, aM as Ft, aN as Tt, aO as It, aP as Cs, aQ as Dt, aR as Zs, aS as Mt, aT as ea, aU as Lt, aV as Et, aW as At, aX as va, aY as ce, aZ as Bs, a_ as Ca, a$ as Vt, b0 as qt, b1 as rs, b2 as Rt, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, b8 as Ut, l as Gt, b9 as xs, ba as Na, bb as Sa, bc as wa, bd as is, be as ka, bf as os, bg as sa, bh as Kt, bi as Jt, bj as ps, bk as fs, bl as gs, bm as Qt, bn as Wt, X as za, bo as Yt, bp as Xt, bq as Zt, br as js, bs as Ie, f as en, bt as Ge, bu as Oa, bv as sn, bw as an, bx as cs, by as tn, bz as nn, bA as ln, bB as aa, bC as rn, bD as on, bE as cn, bF as dn, bG as un, bH as hn, bI as mn, bJ as xn, bK as De, bL as U, bM as G, bN as Us, bO as K, bP as pn, bQ as Fa, bR as fn, bS as gn, bT as jn, bU as bn, bV as yn, bW as vn, bX as Cn, bY as Nn, bZ as Sn } from "./index-PtVvQMP6.js";
1
+ import { c as q, p as hs, u as z, n as Fs, o as Oe, q as e, r as Is, s as Ts, t as F, j as Ds, v as Ms, w as Ls, x as Es, y as As, L as H, z as re, A as oa, E as ca, H as da, J as ua, K as rt, M as it, N as ot, O as Ys, Q as W, R as Je, V as u, W as ct, F as ha, Y as We, Z as Ye, _ as Vs, $ as ma, a0 as qs, a1 as fe, a2 as ge, a3 as je, a4 as be, a5 as ke, a6 as ye, a7 as Q, T as Rs, a8 as _s, a9 as Hs, aa as $s, ab as xa, ac as pa, ad as xe, ae as dt, af as ut, ag as fa, ah as ht, C as mt, ai as xt, aj as ga, B as pt, ak as Ps, al as ft, am as Xs, an as ja, ao as Ns, ap as me, aq as we, ar as de, as as ms, at as ba, au as gt, av as jt, aw as ya, ax as bt, ay as yt, az as vt, aA as Ct, aB as Nt, aC as qe, aD as Ss, aE as St, a as wt, aF as Ke, aG as ws, aH as Ve, aI as ks, aJ as kt, aK as zt, aL as Ot, aM as Ft, aN as It, aO as Tt, aP as Cs, aQ as Dt, aR as Zs, aS as Mt, aT as ea, aU as Lt, aV as Et, aW as At, aX as va, aY as ce, aZ as Bs, a_ as Ca, a$ as Vt, b0 as qt, b1 as rs, b2 as Rt, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, b8 as Ut, l as Gt, b9 as xs, ba as Na, bb as Sa, bc as wa, bd as is, be as ka, bf as os, bg as sa, bh as Kt, bi as Qt, bj as ps, bk as fs, bl as gs, bm as Jt, bn as Wt, X as za, bo as Yt, bp as Xt, bq as Zt, br as js, bs as Te, f as en, bt as Ge, bu as Oa, bv as sn, bw as an, bx as cs, by as tn, bz as nn, bA as ln, bB as aa, bC as rn, bD as on, bE as cn, bF as dn, bG as un, bH as hn, bI as mn, bJ as xn, bK as De, bL as U, bM as G, bN as Us, bO as K, bP as pn, bQ as Fa, bR as fn, bS as gn, bT as jn, bU as bn, bV as yn, bW as vn, bX as Cn, bY as Nn, bZ as Sn } from "./index-D9JU1xVZ.js";
2
2
  import * as ta from "react";
3
3
  import ze, { useState as R, useMemo as zs, useEffect as Z, useRef as Xe, Suspense as wn } from "react";
4
4
  import "react-dom";
@@ -63,7 +63,7 @@ const Ks = q("ChartLine", [
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
65
  */
66
- const Ta = q("ChartNoAxesGantt", [
66
+ const Ia = q("ChartNoAxesGantt", [
67
67
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
68
68
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
69
69
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -74,7 +74,7 @@ const Ta = q("ChartNoAxesGantt", [
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
76
  */
77
- const Ia = q("ChartPie", [
77
+ const Ta = q("ChartPie", [
78
78
  [
79
79
  "path",
80
80
  {
@@ -127,7 +127,7 @@ const Fn = q("CopyPlus", [
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
129
  */
130
- const Tn = q("Database", [
130
+ const In = q("Database", [
131
131
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
132
132
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
133
133
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -149,7 +149,7 @@ const Ma = q("EllipsisVertical", [
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
151
  */
152
- const In = q("Eraser", [
152
+ const Tn = q("Eraser", [
153
153
  [
154
154
  "path",
155
155
  {
@@ -458,7 +458,7 @@ const Kn = q("Sigma", [
458
458
  * This source code is licensed under the ISC license.
459
459
  * See the LICENSE file in the root directory of this source tree.
460
460
  */
461
- const Jn = q("SwatchBook", [
461
+ const Qn = q("SwatchBook", [
462
462
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
463
463
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
464
464
  ["path", { d: "M 7 17h.01", key: "1euzgo" }],
@@ -476,7 +476,7 @@ const Jn = q("SwatchBook", [
476
476
  * This source code is licensed under the ISC license.
477
477
  * See the LICENSE file in the root directory of this source tree.
478
478
  */
479
- const Qn = q("Tag", [
479
+ const Jn = q("Tag", [
480
480
  [
481
481
  "path",
482
482
  {
@@ -502,7 +502,7 @@ const Wn = q("ToggleLeft", [
502
502
  * This source code is licensed under the ISC license.
503
503
  * See the LICENSE file in the root directory of this source tree.
504
504
  */
505
- const Js = q("Type", [
505
+ const Qs = q("Type", [
506
506
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
507
507
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
508
508
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -526,10 +526,10 @@ function qa(s) {
526
526
  return {
527
527
  ...a,
528
528
  frames: (n = a.frames) == null ? void 0 : n.map((l) => {
529
- var o;
529
+ var i;
530
530
  return {
531
531
  ...l,
532
- cards: (o = l.cards) == null ? void 0 : o.map((r) => Xn(r))
532
+ cards: (i = l.cards) == null ? void 0 : i.map((r) => Xn(r))
533
533
  };
534
534
  })
535
535
  };
@@ -545,8 +545,8 @@ function Xn(s) {
545
545
  data: {
546
546
  ...(t = s.cfg) == null ? void 0 : t.data,
547
547
  labels: [],
548
- datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((o) => ({
549
- ...o,
548
+ datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((i) => ({
549
+ ...i,
550
550
  data: []
551
551
  }))
552
552
  }
@@ -584,12 +584,12 @@ async function el(s, t, a, n) {
584
584
  async function Os(s, t) {
585
585
  if (!t)
586
586
  return null;
587
- const { id: a, template: n, filterValues: l, isDefault: o, shared: r } = s;
587
+ const { id: a, template: n, filterValues: l, isDefault: i, shared: r } = s;
588
588
  return await hs("https://semaphor.cloud/api/v1/lens", t, {
589
589
  lensId: a,
590
590
  template: n,
591
591
  filterValues: l,
592
- isDefault: o,
592
+ isDefault: i,
593
593
  shared: r,
594
594
  operation: "update"
595
595
  });
@@ -601,9 +601,9 @@ async function sl(s, t) {
601
601
  }) : null;
602
602
  }
603
603
  function al() {
604
- const [s, t] = R(""), [a, n] = R(!1), l = z((j) => j.lenses), { setLenses: o, setSelectedLensId: r } = Fs(), [u, i] = R(!1), [x, c] = R(!1), y = z((j) => j.dashboard), f = z((j) => j.filterValues), { authToken: m } = Oe();
604
+ const [s, t] = R(""), [a, n] = R(!1), l = z((j) => j.lenses), { setLenses: i, setSelectedLensId: r } = Fs(), [c, o] = R(!1), [x, d] = R(!1), y = z((j) => j.dashboard), f = z((j) => j.filterValues), { authToken: m } = Oe();
605
605
  async function g() {
606
- i(!0);
606
+ o(!0);
607
607
  const j = qa(
608
608
  y
609
609
  ), D = await el(
@@ -612,10 +612,10 @@ function al() {
612
612
  f,
613
613
  m == null ? void 0 : m.accessToken
614
614
  );
615
- D && (o([...l || [], D]), r(D.id), c(!1)), i(!1);
615
+ D && (i([...l || [], D]), r(D.id), d(!1)), o(!1);
616
616
  }
617
- return /* @__PURE__ */ e.jsxs(Ts, { open: x, onOpenChange: c, children: [
618
- /* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
617
+ return /* @__PURE__ */ e.jsxs(Is, { open: x, onOpenChange: d, children: [
618
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
619
619
  F,
620
620
  {
621
621
  variant: "secondary",
@@ -633,7 +633,7 @@ function al() {
633
633
  /* @__PURE__ */ e.jsx(As, { children: "Lenses are private by default and are only visible to you." })
634
634
  ] }),
635
635
  /* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
636
- /* @__PURE__ */ e.jsx(_, { className: "text-right", children: "Name" }),
636
+ /* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
637
637
  /* @__PURE__ */ e.jsx(
638
638
  re,
639
639
  {
@@ -654,40 +654,40 @@ function al() {
654
654
  variant: "outline",
655
655
  type: "submit",
656
656
  onClick: g,
657
- disabled: u,
658
- children: u ? "Creating..." : "Add"
657
+ disabled: c,
658
+ children: c ? "Creating..." : "Add"
659
659
  }
660
660
  ) })
661
661
  ] })
662
662
  ] });
663
663
  }
664
664
  function tl() {
665
- const [s, t] = R(!1), a = z((c) => c.lenses), n = z((c) => c.selectedLensId), { setLenses: l, setSelectedLensId: o } = Fs(), { authToken: r } = Oe();
666
- async function u(c) {
667
- o(c);
665
+ const [s, t] = R(!1), a = z((d) => d.lenses), n = z((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: i } = Fs(), { authToken: r } = Oe();
666
+ async function c(d) {
667
+ i(d);
668
668
  }
669
- async function i(c) {
670
- if (await sl(c, r == null ? void 0 : r.accessToken)) {
671
- const f = a == null ? void 0 : a.filter((m) => m.id !== c);
672
- l(f || []), o("original");
669
+ async function o(d) {
670
+ if (await sl(d, r == null ? void 0 : r.accessToken)) {
671
+ const f = a == null ? void 0 : a.filter((m) => m.id !== d);
672
+ l(f || []), i("original");
673
673
  }
674
674
  }
675
- async function x(c) {
676
- const y = a == null ? void 0 : a.map((g) => g.id === c.id ? {
675
+ async function x(d) {
676
+ const y = a == null ? void 0 : a.map((g) => g.id === d.id ? {
677
677
  ...g,
678
- isDefault: !c.isDefault
678
+ isDefault: !d.isDefault
679
679
  } : {
680
680
  ...g,
681
681
  isDefault: !1
682
682
  });
683
683
  l(y || []);
684
684
  const f = {
685
- ...c,
686
- isDefault: !c.isDefault
685
+ ...d,
686
+ isDefault: !d.isDefault
687
687
  };
688
688
  await Os(f, r == null ? void 0 : r.accessToken);
689
689
  const m = a == null ? void 0 : a.find((g) => g.isDefault);
690
- if (m && m.id !== c.id) {
690
+ if (m && m.id !== d.id) {
691
691
  const g = {
692
692
  ...m,
693
693
  isDefault: !1
@@ -704,38 +704,38 @@ function tl() {
704
704
  ot,
705
705
  {
706
706
  value: n,
707
- onValueChange: u,
707
+ onValueChange: c,
708
708
  children: [
709
709
  /* @__PURE__ */ e.jsx(Ys, { value: "original", children: "Original" }),
710
- a == null ? void 0 : a.map((c) => /* @__PURE__ */ e.jsxs(
710
+ a == null ? void 0 : a.map((d) => /* @__PURE__ */ e.jsxs(
711
711
  Ys,
712
712
  {
713
713
  className: "group flex justify-between gap-2",
714
- value: c.id,
714
+ value: d.id,
715
715
  children: [
716
- /* @__PURE__ */ e.jsx("p", { children: c.name }),
716
+ /* @__PURE__ */ e.jsx("p", { children: d.name }),
717
717
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
718
718
  /* @__PURE__ */ e.jsx(
719
719
  Vn,
720
720
  {
721
721
  onClick: (y) => {
722
- y.preventDefault(), x(c);
722
+ y.preventDefault(), x(d);
723
723
  },
724
724
  className: W(
725
725
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
726
726
  {
727
- invisible: !c.isDefault,
728
- "text-green-500": c.isDefault
727
+ invisible: !d.isDefault,
728
+ "text-green-500": d.isDefault
729
729
  }
730
730
  ),
731
731
  strokeWidth: 1.5
732
732
  }
733
733
  ),
734
734
  /* @__PURE__ */ e.jsx(
735
- Qe,
735
+ Je,
736
736
  {
737
737
  onClick: (y) => {
738
- y.preventDefault(), i(c.id);
738
+ y.preventDefault(), o(d.id);
739
739
  },
740
740
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
741
741
  strokeWidth: 1.5
@@ -744,7 +744,7 @@ function tl() {
744
744
  ] })
745
745
  ]
746
746
  },
747
- c.id
747
+ d.id
748
748
  ))
749
749
  ]
750
750
  }
@@ -755,11 +755,11 @@ function tl() {
755
755
  function nl() {
756
756
  const { authToken: s } = Oe(), t = z((p) => p.lenses), a = z((p) => p.selectedLensId), n = t == null ? void 0 : t.find((p) => p.id === a), l = z((p) => p.dashboard);
757
757
  z((p) => p.selectedSheetId);
758
- const o = z(
758
+ const i = z(
759
759
  (p) => p.isDashboardEditing
760
- ), r = d(
760
+ ), r = u(
761
761
  (p) => p.selectedConnectionId
762
- ), [u, i] = R(!1), x = z((p) => p.filterValues), c = z((p) => p.isVisualEditing), y = z((p) => p.showFilters);
762
+ ), [c, o] = R(!1), x = z((p) => p.filterValues), d = z((p) => p.isVisualEditing), y = z((p) => p.showFilters);
763
763
  z(
764
764
  (p) => p.showDashboardJSON
765
765
  );
@@ -767,11 +767,11 @@ function nl() {
767
767
  (p) => p.actions.setShowFilters
768
768
  ), { addFrame: g, setSelectedFrameId: j } = z(
769
769
  (p) => p.actions
770
- ), { getSelectedSheet: D, setIsDashboardEditing: C, setShowDashboardJSON: L } = z((p) => p.actions), T = D(), { tenantId: O, endUserId: N } = zs(
770
+ ), { getSelectedSheet: D, setIsDashboardEditing: C, setShowDashboardJSON: L } = z((p) => p.actions), I = D(), { tenantId: O, endUserId: N } = zs(
771
771
  () => ct(s == null ? void 0 : s.accessToken),
772
772
  [s == null ? void 0 : s.accessToken]
773
- ), I = zs(() => O || N, [O, N]), A = () => {
774
- if (!o || !T)
773
+ ), T = zs(() => O || N, [O, N]), A = () => {
774
+ if (!i || !I)
775
775
  return;
776
776
  const p = {
777
777
  connectionId: r,
@@ -794,12 +794,12 @@ function nl() {
794
794
  cards: [p],
795
795
  activeCardId: p.id
796
796
  };
797
- g(T.id, k), j(k.id);
797
+ g(I.id, k), j(k.id);
798
798
  }, h = () => {
799
799
  C(!0);
800
800
  };
801
801
  async function v() {
802
- if (i(!0), !a || !n)
802
+ if (o(!0), !a || !n)
803
803
  return;
804
804
  const p = qa(
805
805
  l
@@ -808,25 +808,25 @@ function nl() {
808
808
  template: k,
809
809
  filterValues: x
810
810
  };
811
- await Os(V, s == null ? void 0 : s.accessToken), Ye.success("Lens saved"), f == null || f(p), i(!1);
811
+ await Os(V, s == null ? void 0 : s.accessToken), Ye.success("Lens saved"), f == null || f(p), o(!1);
812
812
  }
813
- return c ? null : /* @__PURE__ */ e.jsxs(
813
+ return d ? null : /* @__PURE__ */ e.jsxs(
814
814
  "div",
815
815
  {
816
816
  className: "flex items-center justify-between gap-2 border-b bg-muted/50 py-2 pl-3 pr-2",
817
817
  role: "dashboard-controls",
818
818
  children: [
819
- !c && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(_, { children: n == null ? void 0 : n.name }) }),
819
+ !d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: n == null ? void 0 : n.name }) }),
820
820
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
821
- o && !c && I && /* @__PURE__ */ e.jsx(al, {}),
822
- !c && I && /* @__PURE__ */ e.jsx(tl, {}),
823
- o && !c && /* @__PURE__ */ e.jsxs(
821
+ i && !d && T && /* @__PURE__ */ e.jsx(al, {}),
822
+ !d && T && /* @__PURE__ */ e.jsx(tl, {}),
823
+ i && !d && /* @__PURE__ */ e.jsxs(
824
824
  F,
825
825
  {
826
826
  variant: "secondary",
827
827
  className: "h-7 p-2",
828
828
  size: "sm",
829
- disabled: !o,
829
+ disabled: !i,
830
830
  onClick: A,
831
831
  children: [
832
832
  /* @__PURE__ */ e.jsx(Ds, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
@@ -834,7 +834,7 @@ function nl() {
834
834
  ]
835
835
  }
836
836
  ),
837
- !o && /* @__PURE__ */ e.jsx(
837
+ !i && /* @__PURE__ */ e.jsx(
838
838
  F,
839
839
  {
840
840
  variant: "ghost",
@@ -844,7 +844,7 @@ function nl() {
844
844
  children: /* @__PURE__ */ e.jsx(Aa, { className: "h-4 w-4", strokeWidth: 1.5 })
845
845
  }
846
846
  ),
847
- o && !c && /* @__PURE__ */ e.jsx(
847
+ i && !d && /* @__PURE__ */ e.jsx(
848
848
  F,
849
849
  {
850
850
  variant: "ghost",
@@ -854,21 +854,21 @@ function nl() {
854
854
  C(!1), L(!1);
855
855
  },
856
856
  size: "sm",
857
- children: /* @__PURE__ */ e.jsx(Qe, { className: "h-4 w-4", strokeWidth: 1.5 })
857
+ children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
858
858
  }
859
859
  ),
860
- o && !c && I && /* @__PURE__ */ e.jsx(
860
+ i && !d && T && /* @__PURE__ */ e.jsx(
861
861
  F,
862
862
  {
863
863
  className: "h-7 p-2",
864
864
  variant: "ghost",
865
- disabled: u,
865
+ disabled: c,
866
866
  onClick: v,
867
867
  size: "sm",
868
868
  children: /* @__PURE__ */ e.jsx(Un, { className: "h-4 w-4", strokeWidth: 1.5 })
869
869
  }
870
870
  ),
871
- !y && !c && o && /* @__PURE__ */ e.jsx(
871
+ !y && !d && i && /* @__PURE__ */ e.jsx(
872
872
  F,
873
873
  {
874
874
  className: "h-7 p-2",
@@ -878,8 +878,8 @@ function nl() {
878
878
  children: /* @__PURE__ */ e.jsx(ha, { className: "h-4 w-4", strokeWidth: 1.5 })
879
879
  }
880
880
  ),
881
- !c && o && !1,
882
- !c && !1
881
+ !d && i && !1,
882
+ !d && !1
883
883
  ] })
884
884
  ]
885
885
  }
@@ -891,19 +891,19 @@ function Ue({
891
891
  value: a,
892
892
  isLoading: n,
893
893
  isError: l,
894
- connectionTooltip: o,
894
+ connectionTooltip: i,
895
895
  onChange: r,
896
- showNone: u = !1,
897
- className: i,
896
+ showNone: c = !1,
897
+ className: o,
898
898
  showIcon: x = !0,
899
- disabled: c = !1
899
+ disabled: d = !1
900
900
  }) {
901
901
  const y = n ? "Loading..." : l ? "Error" : a;
902
902
  function f() {
903
903
  if (s === "Connection")
904
904
  return /* @__PURE__ */ e.jsx(Bn, { className: "size-4 rotate-90" });
905
905
  if (s === "Database")
906
- return /* @__PURE__ */ e.jsx(Tn, { className: "size-4" });
906
+ return /* @__PURE__ */ e.jsx(In, { className: "size-4" });
907
907
  if (s === "Schema")
908
908
  return /* @__PURE__ */ e.jsx($n, { className: "size-4" });
909
909
  if (s === "Table")
@@ -912,17 +912,17 @@ function Ue({
912
912
  return /* @__PURE__ */ e.jsx(kn, { className: "size-4" });
913
913
  }
914
914
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
915
- x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(Vs, { children: [
915
+ x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: i ? /* @__PURE__ */ e.jsxs(Vs, { children: [
916
916
  /* @__PURE__ */ e.jsx(ma, { children: f() }),
917
- /* @__PURE__ */ e.jsx(qs, { className: "text-xs", align: "start", children: o })
917
+ /* @__PURE__ */ e.jsx(qs, { className: "text-xs", align: "start", children: i })
918
918
  ] }) : f() }),
919
- /* @__PURE__ */ e.jsxs(fe, { disabled: c, value: y, onValueChange: r, children: [
919
+ /* @__PURE__ */ e.jsxs(fe, { disabled: d, value: y, onValueChange: r, children: [
920
920
  /* @__PURE__ */ e.jsx(
921
921
  ge,
922
922
  {
923
923
  className: W(
924
924
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
925
- i
925
+ o
926
926
  ),
927
927
  children: /* @__PURE__ */ e.jsx(
928
928
  je,
@@ -935,7 +935,7 @@ function Ue({
935
935
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
936
936
  n ? /* @__PURE__ */ e.jsx(ye, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(ye, { children: s }),
937
937
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
938
- u && /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
938
+ c && /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
939
939
  t && t.map((m, g) => /* @__PURE__ */ e.jsx(Q, { value: m.id, children: m.name }, g))
940
940
  ] }),
941
941
  (n || l) && /* @__PURE__ */ e.jsx(Q, { value: y, children: y })
@@ -944,24 +944,24 @@ function Ue({
944
944
  ] });
945
945
  }
946
946
  function ll({ column: s }) {
947
- const [t, a] = R(!1), n = d((m) => m.selectedTableName), l = d(
947
+ const [t, a] = R(!1), n = u((m) => m.selectedTableName), l = u(
948
948
  (m) => m.selectedSchemaName
949
- ), o = d(
949
+ ), i = u(
950
950
  (m) => m.selectedDatamodelId
951
- ), r = d((m) => m.sqlGen), { modelItems: u } = Re(), i = d((m) => m.actions.setSqlGen), x = d((m) => m.actions.setCardSql), c = d((m) => m.actions.setRunSql);
951
+ ), r = u((m) => m.sqlGen), { modelItems: c } = Re(), o = u((m) => m.actions.setSqlGen), x = u((m) => m.actions.setCardSql), d = u((m) => m.actions.setRunSql);
952
952
  function y(m, g) {
953
953
  var L;
954
- const j = xa(m, r, g), D = (L = u == null ? void 0 : u.find(
955
- (T) => T.id === o
954
+ const j = xa(m, r, g), D = (L = c == null ? void 0 : c.find(
955
+ (I) => I.id === i
956
956
  )) == null ? void 0 : L.name;
957
- i(j);
957
+ o(j);
958
958
  const C = pa(
959
959
  j,
960
960
  xe(l || ""),
961
961
  xe(n),
962
962
  D
963
963
  );
964
- C && (x(C), c(!0)), a(!1);
964
+ C && (x(C), d(!0)), a(!1);
965
965
  }
966
966
  function f() {
967
967
  return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
@@ -1023,7 +1023,7 @@ function Ra({ column: s }) {
1023
1023
  return /* @__PURE__ */ e.jsxs(Vs, { children: [
1024
1024
  /* @__PURE__ */ e.jsx(dt, { asChild: !0, children: ut.includes(s.data_type.toLowerCase()) ? (
1025
1025
  // <span className=" font-thin">T</span>
1026
- /* @__PURE__ */ e.jsx(Js, { className: "size-3" })
1026
+ /* @__PURE__ */ e.jsx(Qs, { className: "size-3" })
1027
1027
  ) : fa.includes(s.data_type.toLowerCase()) ? (
1028
1028
  //
1029
1029
  /* @__PURE__ */ e.jsx(An, { className: "size-3" })
@@ -1037,19 +1037,19 @@ function rl({
1037
1037
  columns: a,
1038
1038
  status: n
1039
1039
  }) {
1040
- const l = d((h) => h.sqlGen), o = d(
1040
+ const l = u((h) => h.sqlGen), i = u(
1041
1041
  (h) => h.selectedConnectionId
1042
- ), r = d(
1042
+ ), r = u(
1043
1043
  (h) => h.selectedDatabaseName
1044
- ), u = d(
1044
+ ), c = u(
1045
1045
  (h) => h.selectedSchemaName
1046
- ), i = d((h) => h.selectedTableName), x = d(
1046
+ ), o = u((h) => h.selectedTableName), x = u(
1047
1047
  (h) => h.selectedDatamodelId
1048
- ), c = z(
1048
+ ), d = z(
1049
1049
  (h) => h.dashboard.aiScopeTables
1050
- ), { setAIScopeTables: y } = z((h) => h.actions), f = d((h) => h.actions.setRunSql), m = d((h) => h.actions.setSqlGen), g = d(
1050
+ ), { setAIScopeTables: y } = z((h) => h.actions), f = u((h) => h.actions.setRunSql), m = u((h) => h.actions.setSqlGen), g = u(
1051
1051
  (h) => h.actions.setIsShowingVisual
1052
- ), j = d((h) => h.actions.setCardSql), { connectionType: D, modelItems: C } = Re();
1052
+ ), j = u((h) => h.actions.setCardSql), { connectionType: D, modelItems: C } = Re();
1053
1053
  function L(h) {
1054
1054
  var V;
1055
1055
  const v = xa(h, l);
@@ -1059,34 +1059,34 @@ function rl({
1059
1059
  )) == null ? void 0 : V.name, k = pa(v, xe(s), xe(t), p);
1060
1060
  k && (j(k), f(!0));
1061
1061
  }
1062
- function T() {
1063
- return (c == null ? void 0 : c.find(
1064
- (h) => h.connectinonId === o && h.tableName === i
1062
+ function I() {
1063
+ return (d == null ? void 0 : d.find(
1064
+ (h) => h.connectinonId === i && h.tableName === o
1065
1065
  )) !== void 0;
1066
1066
  }
1067
1067
  function O(h) {
1068
- if (h === !0 && i && o) {
1068
+ if (h === !0 && o && i) {
1069
1069
  const v = {
1070
- connectinonId: o,
1070
+ connectinonId: i,
1071
1071
  connectionType: D,
1072
1072
  databaseName: r,
1073
- schemaName: u,
1074
- tableName: i
1075
- }, k = [...c || [], v].filter(
1073
+ schemaName: c,
1074
+ tableName: o
1075
+ }, k = [...d || [], v].filter(
1076
1076
  (V, $, B) => B.findIndex(
1077
1077
  (Y) => Y.connectinonId === V.connectinonId && Y.tableName === V.tableName
1078
1078
  ) === $
1079
1079
  );
1080
- y(k), Ye.success(`Added '${i}' to AI Scope`, {
1080
+ y(k), Ye.success(`Added '${o}' to AI Scope`, {
1081
1081
  position: "top-right",
1082
1082
  duration: 2500,
1083
1083
  richColors: !0
1084
1084
  });
1085
1085
  } else {
1086
- const v = (c || []).filter(
1087
- (p) => p.connectinonId !== o && p.tableName !== i
1086
+ const v = (d || []).filter(
1087
+ (p) => p.connectinonId !== i && p.tableName !== o
1088
1088
  );
1089
- y(v), Ye(`Removed '${i}' from AI Scope`, {
1089
+ y(v), Ye(`Removed '${o}' from AI Scope`, {
1090
1090
  position: "top-right",
1091
1091
  duration: 2e3,
1092
1092
  richColors: !0
@@ -1103,7 +1103,7 @@ function rl({
1103
1103
  let p = h;
1104
1104
  return (($) => /[A-Z]/.test($))(t) && (p = p.split(".").map((B) => `"${B}"`).join(".")), p;
1105
1105
  }
1106
- function I() {
1106
+ function T() {
1107
1107
  const h = N();
1108
1108
  g(!1);
1109
1109
  const v = D === "MSSQL" ? `SELECT top 10 * FROM ${h}` : `SELECT * FROM ${h} LIMIT 10`;
@@ -1118,8 +1118,8 @@ function rl({
1118
1118
  /* @__PURE__ */ e.jsx(
1119
1119
  ga,
1120
1120
  {
1121
- title: `${T() ? "Remove from" : "Add to"} AI Scope`,
1122
- pressed: T(),
1121
+ title: `${I() ? "Remove from" : "Add to"} AI Scope`,
1122
+ pressed: I(),
1123
1123
  onPressedChange: O,
1124
1124
  variant: "outline",
1125
1125
  className: "h-9 px-2",
@@ -1127,8 +1127,8 @@ function rl({
1127
1127
  pt,
1128
1128
  {
1129
1129
  className: W("size-4", {
1130
- "text-primary": T(),
1131
- "text-muted-foreground": !T()
1130
+ "text-primary": I(),
1131
+ "text-muted-foreground": !I()
1132
1132
  })
1133
1133
  }
1134
1134
  )
@@ -1138,12 +1138,12 @@ function rl({
1138
1138
  F,
1139
1139
  {
1140
1140
  disabled: n !== "Success",
1141
- onClick: I,
1141
+ onClick: T,
1142
1142
  size: "sm",
1143
1143
  variant: "secondary",
1144
1144
  className: "flex",
1145
1145
  children: [
1146
- n !== "Success" ? /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Jn, { className: "mr-2 size-4" }),
1146
+ n !== "Success" ? /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Qn, { className: "mr-2 size-4" }),
1147
1147
  "Top 10"
1148
1148
  ]
1149
1149
  }
@@ -1205,38 +1205,38 @@ function rl({
1205
1205
  function Re(s, t) {
1206
1206
  var Pe, ss, as, ts, Be;
1207
1207
  let a = zs(() => [], []);
1208
- const n = Oe().authToken || s, l = d(
1208
+ const n = Oe().authToken || s, l = u(
1209
1209
  (S) => S.selectedConnectionId
1210
- ), o = d(
1210
+ ), i = u(
1211
1211
  (S) => S.selectedDatamodelId
1212
- ), r = d(
1212
+ ), r = u(
1213
1213
  (S) => S.selectedDatabaseName
1214
- ), u = d(
1214
+ ), c = u(
1215
1215
  (S) => S.selectedSchemaName
1216
- ), i = d((S) => S.selectedTableName), x = d(
1216
+ ), o = u((S) => S.selectedTableName), x = u(
1217
1217
  (S) => S.actions.setCurrentColumns
1218
- ), c = d(
1218
+ ), d = u(
1219
1219
  (S) => S.actions.setSelectedConnectionId
1220
- ), y = d(
1220
+ ), y = u(
1221
1221
  (S) => S.actions.setSelectedDatamodelId
1222
- ), f = d(
1222
+ ), f = u(
1223
1223
  (S) => S.actions.setSelectedDatabaseName
1224
- ), m = d(
1224
+ ), m = u(
1225
1225
  (S) => S.actions.setSelectedSchemaName
1226
- ), g = d(
1226
+ ), g = u(
1227
1227
  (S) => S.actions.setSelectedTableName
1228
- ), j = d((S) => S.actions.setCardSql);
1228
+ ), j = u((S) => S.actions.setCardSql);
1229
1229
  function D(S) {
1230
- return l && r && u && r !== "NA" ? !0 : l && S === "API" ? !1 : !!(l && S === "S3");
1230
+ return l && r && c && r !== "NA" ? !0 : l && S === "API" ? !1 : !!(l && S === "S3");
1231
1231
  }
1232
1232
  function C(S) {
1233
- return !!(l && r && r !== "NA" && u && i || l && (S === "S3" || S === "API") || o && o);
1233
+ return !!(l && r && r !== "NA" && c && o || l && (S === "S3" || S === "API") || i && i);
1234
1234
  }
1235
1235
  function L(S) {
1236
1236
  return l && S ? !(S === "API" || S === "S3") : !1;
1237
1237
  }
1238
1238
  const {
1239
- data: T,
1239
+ data: I,
1240
1240
  isLoading: O,
1241
1241
  isError: N
1242
1242
  } = me({
@@ -1248,7 +1248,7 @@ function Re(s, t) {
1248
1248
  enabled: !!(n != null && n.accessToken)
1249
1249
  // Only fetch if authToken is present
1250
1250
  }), {
1251
- data: I,
1251
+ data: T,
1252
1252
  isLoading: A,
1253
1253
  isError: h
1254
1254
  } = me({
@@ -1262,7 +1262,7 @@ function Re(s, t) {
1262
1262
  ),
1263
1263
  enabled: !!(n != null && n.accessToken) && !!l
1264
1264
  // Only fetch if authToken is present
1265
- }), v = T == null ? void 0 : T.connections.find(
1265
+ }), v = I == null ? void 0 : I.connections.find(
1266
1266
  (S) => S.id === l
1267
1267
  ), p = v == null ? void 0 : v.type, k = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
1268
1268
  data: V,
@@ -1285,7 +1285,7 @@ function Re(s, t) {
1285
1285
  data: J,
1286
1286
  isLoading: ne,
1287
1287
  isFetching: w,
1288
- isError: H,
1288
+ isError: _,
1289
1289
  refetch: ee
1290
1290
  } = me({
1291
1291
  queryKey: ["schemas", l, r],
@@ -1310,7 +1310,7 @@ function Re(s, t) {
1310
1310
  "tables",
1311
1311
  l,
1312
1312
  r,
1313
- u
1313
+ c
1314
1314
  ],
1315
1315
  queryFn: () => we(
1316
1316
  "https://semaphor.cloud/api/v1/tables",
@@ -1318,7 +1318,7 @@ function Re(s, t) {
1318
1318
  {
1319
1319
  connection_id: l,
1320
1320
  database_name: r,
1321
- schema_name: u
1321
+ schema_name: c
1322
1322
  }
1323
1323
  ),
1324
1324
  enabled: D(p)
@@ -1332,20 +1332,20 @@ function Re(s, t) {
1332
1332
  "columns",
1333
1333
  l,
1334
1334
  r,
1335
- o,
1336
- u,
1337
- i
1335
+ i,
1336
+ c,
1337
+ o
1338
1338
  ],
1339
1339
  queryFn: () => we(
1340
1340
  "https://semaphor.cloud/api/v1/columns",
1341
1341
  (n == null ? void 0 : n.accessToken) || "",
1342
1342
  {
1343
1343
  connection_id: l,
1344
- datamodel_id: o || "",
1344
+ datamodel_id: i || "",
1345
1345
  // don't pass undefined. Pass empty string
1346
1346
  database_name: r,
1347
- schema_name: u,
1348
- table_name: i
1347
+ schema_name: c,
1348
+ table_name: o
1349
1349
  }
1350
1350
  ),
1351
1351
  enabled: C(p)
@@ -1368,7 +1368,7 @@ function Re(s, t) {
1368
1368
  f,
1369
1369
  v
1370
1370
  ]);
1371
- const Fe = (v == null ? void 0 : v.type) === "API" ? (Pe = v == null ? void 0 : v.type) == null ? void 0 : Pe.toLowerCase() : i || "", Se = k ? "" : u || "";
1371
+ const Fe = (v == null ? void 0 : v.type) === "API" ? (Pe = v == null ? void 0 : v.type) == null ? void 0 : Pe.toLowerCase() : o || "", Se = k ? "" : c || "";
1372
1372
  function ae(S) {
1373
1373
  m(S), g("");
1374
1374
  }
@@ -1376,7 +1376,7 @@ function Re(s, t) {
1376
1376
  f(S === "none" ? "" : S), m(""), g(""), S !== "none" && S !== "" && y("");
1377
1377
  }
1378
1378
  function he(S) {
1379
- c(S);
1379
+ d(S);
1380
1380
  }
1381
1381
  function es(S) {
1382
1382
  y(S === "none" ? "" : S), S !== "none" && S !== "" && f("");
@@ -1385,13 +1385,13 @@ function Re(s, t) {
1385
1385
  ...S,
1386
1386
  data_type: S.data_type.toLowerCase()
1387
1387
  }))), Y && (a = []), (Ne || N) && (a = []);
1388
- const Ee = T == null ? void 0 : T.connections.map(
1388
+ const Ee = I == null ? void 0 : I.connections.map(
1389
1389
  (S) => ({
1390
1390
  id: S.id,
1391
1391
  name: S.name,
1392
1392
  type: S.type
1393
1393
  })
1394
- ), He = (Be = I == null ? void 0 : I.datamodels) == null ? void 0 : Be.map((S) => ({
1394
+ ), He = (Be = T == null ? void 0 : T.datamodels) == null ? void 0 : Be.map((S) => ({
1395
1395
  id: S.id,
1396
1396
  name: S.name
1397
1397
  })), $e = V == null ? void 0 : V.databases.map((S) => ({
@@ -1416,7 +1416,7 @@ function Re(s, t) {
1416
1416
  isDatabaseError: Y,
1417
1417
  schemaItems: Ae,
1418
1418
  isSchemaLoadingOrFetching: ne || w,
1419
- isSchemaError: H,
1419
+ isSchemaError: _,
1420
1420
  tableItems: ys,
1421
1421
  isTableLoadingOrFetching: M || se,
1422
1422
  isTableError: P,
@@ -1437,21 +1437,21 @@ function _a({
1437
1437
  ColumnsComponent: s
1438
1438
  }) {
1439
1439
  var se;
1440
- const t = d(
1440
+ const t = u(
1441
1441
  (P) => P.selectedConnectionId
1442
- ), a = d(
1442
+ ), a = u(
1443
1443
  (P) => P.selectedDatamodelId
1444
- ), n = d(
1444
+ ), n = u(
1445
1445
  (P) => P.selectedDatabaseName
1446
- ), l = d(
1446
+ ), l = u(
1447
1447
  (P) => P.selectedSchemaName
1448
- ), o = d((P) => P.selectedTableName), r = d(
1448
+ ), i = u((P) => P.selectedTableName), r = u(
1449
1449
  (P) => P.actions.setSelectedTableName
1450
1450
  ), {
1451
- connectionItems: u,
1452
- modelItems: i,
1451
+ connectionItems: c,
1452
+ modelItems: o,
1453
1453
  schemaItems: x,
1454
- databaseItems: c,
1454
+ databaseItems: d,
1455
1455
  tableItems: y,
1456
1456
  columns: f,
1457
1457
  isConnectionsLoading: m,
@@ -1460,10 +1460,10 @@ function _a({
1460
1460
  isModelsError: D,
1461
1461
  isDatabasesLoadingOrFetching: C,
1462
1462
  isDatabaseError: L,
1463
- isSchemaLoadingOrFetching: T,
1463
+ isSchemaLoadingOrFetching: I,
1464
1464
  isSchemaError: O,
1465
1465
  isColumnsError: N,
1466
- isColumnsLoadingOrFetching: I,
1466
+ isColumnsLoadingOrFetching: T,
1467
1467
  isTableLoadingOrFetching: A,
1468
1468
  isTableError: h,
1469
1469
  connectionType: v,
@@ -1482,7 +1482,7 @@ function _a({
1482
1482
  schemaName: le,
1483
1483
  tableName: Y,
1484
1484
  columns: f,
1485
- status: I ? "Loading..." : N ? "Error" : "Success"
1485
+ status: T ? "Loading..." : N ? "Error" : "Success"
1486
1486
  }
1487
1487
  );
1488
1488
  }
@@ -1500,17 +1500,17 @@ function _a({
1500
1500
  onChange: V,
1501
1501
  isError: L,
1502
1502
  isLoading: C,
1503
- items: c,
1503
+ items: d,
1504
1504
  value: n || "",
1505
1505
  title: "Database"
1506
1506
  }
1507
1507
  );
1508
1508
  }
1509
- function H() {
1509
+ function _() {
1510
1510
  if (t && !p && (!n || n === "none") && (!a || a === "none"))
1511
1511
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1512
1512
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(de, {}) }),
1513
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(_, { children: "OR" }) }),
1513
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(H, { children: "OR" }) }),
1514
1514
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(de, {}) })
1515
1515
  ] });
1516
1516
  }
@@ -1525,7 +1525,7 @@ function _a({
1525
1525
  onChange: B,
1526
1526
  isError: D,
1527
1527
  isLoading: g,
1528
- items: i,
1528
+ items: o,
1529
1529
  value: a || "",
1530
1530
  title: "Model"
1531
1531
  }
@@ -1537,7 +1537,7 @@ function _a({
1537
1537
  {
1538
1538
  onChange: $,
1539
1539
  isError: O,
1540
- isLoading: T,
1540
+ isLoading: I,
1541
1541
  items: x,
1542
1542
  value: l || "",
1543
1543
  title: "Schema"
@@ -1556,7 +1556,7 @@ function _a({
1556
1556
  isError: h,
1557
1557
  items: y,
1558
1558
  isLoading: A,
1559
- value: o || "",
1559
+ value: i || "",
1560
1560
  title: "Table"
1561
1561
  }
1562
1562
  ) : null;
@@ -1566,19 +1566,19 @@ function _a({
1566
1566
  /* @__PURE__ */ e.jsx(
1567
1567
  Ue,
1568
1568
  {
1569
- items: u,
1569
+ items: c,
1570
1570
  title: "Connection",
1571
1571
  value: t || "",
1572
1572
  onChange: k,
1573
1573
  isLoading: m,
1574
1574
  isError: j,
1575
- connectionTooltip: ((se = u == null ? void 0 : u.find(
1575
+ connectionTooltip: ((se = c == null ? void 0 : c.find(
1576
1576
  (P) => P.id === t
1577
1577
  )) == null ? void 0 : se.type) || ""
1578
1578
  }
1579
1579
  ),
1580
1580
  ee(),
1581
- H(),
1581
+ _(),
1582
1582
  w(),
1583
1583
  E(),
1584
1584
  M()
@@ -1599,7 +1599,23 @@ function _a({
1599
1599
  ) })
1600
1600
  ] });
1601
1601
  }
1602
- function il({
1602
+ function il(s) {
1603
+ const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1604
+ let i = s.length;
1605
+ if (l !== -1 && (i = l), n !== -1 && n < i && (i = n), t !== -1) {
1606
+ const r = s.substring(0, t), c = s.substring(t);
1607
+ return `${r} {{ filters | where }} AND ${c.substring(
1608
+ 6
1609
+ )}`;
1610
+ } else if (a !== -1) {
1611
+ const r = s.substring(0, a), c = s.substring(a);
1612
+ return `${r} {{ filters | where }} ${c}`;
1613
+ } else {
1614
+ const r = s.substring(0, i), c = s.substring(i);
1615
+ return `${r} {{ filters | where }} ${c}`;
1616
+ }
1617
+ }
1618
+ function ol({
1603
1619
  error: s,
1604
1620
  setShowAIDialog: t,
1605
1621
  setUserInputforAI: a,
@@ -1626,7 +1642,7 @@ function il({
1626
1642
  ] }) }) })
1627
1643
  ] });
1628
1644
  }
1629
- function ol({
1645
+ function cl({
1630
1646
  text: s,
1631
1647
  onCheckedChange: t,
1632
1648
  checked: a
@@ -1636,9 +1652,9 @@ function ol({
1636
1652
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1637
1653
  ] });
1638
1654
  }
1639
- function cl() {
1640
- const { authToken: s } = Oe(), t = d(
1641
- (o) => o.selectedConnectionId
1655
+ function dl() {
1656
+ const { authToken: s } = Oe(), t = u(
1657
+ (i) => i.selectedConnectionId
1642
1658
  ), { data: a } = me({
1643
1659
  queryKey: ["connections"],
1644
1660
  queryFn: () => we(
@@ -1648,18 +1664,18 @@ function cl() {
1648
1664
  enabled: !!(s != null && s.accessToken)
1649
1665
  // Only fetch if authToken is present
1650
1666
  }), n = a == null ? void 0 : a.connections.find(
1651
- (o) => o.id === t
1667
+ (i) => i.id === t
1652
1668
  );
1653
1669
  return n == null ? void 0 : n.type;
1654
1670
  }
1655
- function dl() {
1656
- const { authToken: s } = Oe(), t = Xe(null), a = d((i) => i.applyFilters), [n, l] = R(""), o = d((i) => i.filterValues), r = d((i) => i.card.sql), u = cl();
1671
+ function ul() {
1672
+ const { authToken: s } = Oe(), t = Xe(null), a = u((o) => o.applyFilters), [n, l] = R(""), i = u((o) => o.filterValues), r = u((o) => o.card.sql), c = dl();
1657
1673
  return /* @__PURE__ */ e.jsxs(
1658
1674
  _s,
1659
1675
  {
1660
1676
  openDelay: 0,
1661
- onOpenChange: async (i) => {
1662
- if (!i)
1677
+ onOpenChange: async (o) => {
1678
+ if (!o)
1663
1679
  return;
1664
1680
  console.log("onOpenChange");
1665
1681
  const x = await hs(
@@ -1667,8 +1683,8 @@ function dl() {
1667
1683
  (s == null ? void 0 : s.accessToken) || "",
1668
1684
  {
1669
1685
  sql: r,
1670
- active_filters: o,
1671
- connection_type: u
1686
+ active_filters: i,
1687
+ connection_type: c
1672
1688
  }
1673
1689
  );
1674
1690
  console.log(x), x.sql ? (console.log(x.records), l(x.sql)) : l("Error");
@@ -1695,7 +1711,7 @@ function dl() {
1695
1711
  }
1696
1712
  );
1697
1713
  }
1698
- const ul = `
1714
+ const hl = `
1699
1715
 
1700
1716
  Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
1701
1717
 
@@ -1742,27 +1758,27 @@ SELECT label, measure FROM table
1742
1758
  - Label - Category
1743
1759
  - Measure - Number
1744
1760
  `;
1745
- function hl({
1761
+ function ml({
1746
1762
  open: s,
1747
1763
  setOpen: t,
1748
1764
  userInput: a,
1749
1765
  setUserInput: n,
1750
1766
  triggerAIRun: l,
1751
- setTriggerAIRun: o
1767
+ setTriggerAIRun: i
1752
1768
  }) {
1753
- const r = Xe(null), u = Xe(null), { authToken: i } = Oe(), [x, c] = R(!1), y = d((w) => w.actions.setCardSql), f = z((w) => w.dashboard.baseQueries), m = d((w) => w.actions.setRunSql), g = d((w) => w.actions.setCardType), [j, D] = R([]), C = d((w) => w.currentColumns), L = d((w) => w.card.sql), T = d((w) => w.selectedTableName), O = `
1769
+ const r = Xe(null), c = Xe(null), { authToken: o } = Oe(), [x, d] = R(!1), y = u((w) => w.actions.setCardSql), f = z((w) => w.dashboard.baseQueries), m = u((w) => w.actions.setRunSql), g = u((w) => w.actions.setCardType), [j, D] = R([]), C = u((w) => w.currentColumns), L = u((w) => w.card.sql), I = u((w) => w.selectedTableName), O = `
1754
1770
  ${a}
1755
1771
 
1756
- Database Query Dialect: ${T === "api" || T === "s3" ? "DuckDb" : ""}
1757
- Table Name: ${T}
1772
+ Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
1773
+ Table Name: ${I}
1758
1774
  Table Columns: ${C == null ? void 0 : C.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
1759
1775
  User SQL: ${L}
1760
1776
  ${f && `Base Queries: ${JSON.stringify(f)} `}`, N = ` 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.
1761
- Visual Query Syntax: ${ul}`, { data: I, isLoading: A, isFetching: h, isError: v, refetch: p } = me({
1777
+ Visual Query Syntax: ${hl}`, { data: T, isLoading: A, isFetching: h, isError: v, refetch: p } = me({
1762
1778
  queryKey: ["ai-query"],
1763
1779
  queryFn: () => we(
1764
1780
  "https://semaphor.cloud/api/v1/ai",
1765
- (i == null ? void 0 : i.accessToken) || "",
1781
+ (o == null ? void 0 : o.accessToken) || "",
1766
1782
  {
1767
1783
  user_content: `userContent: ${O} ${x ? N : ""}`
1768
1784
  }
@@ -1792,23 +1808,23 @@ function hl({
1792
1808
  return !0;
1793
1809
  }
1794
1810
  Z(() => {
1795
- I && D((w) => [...w, { role: "ai", content: I.response }]);
1796
- }, [I]), Z(() => {
1811
+ T && D((w) => [...w, { role: "ai", content: T.response }]);
1812
+ }, [T]), Z(() => {
1797
1813
  const w = setTimeout(() => {
1798
- var H;
1799
- u.current && (u.current.scroll({
1800
- top: u.current.scrollHeight,
1814
+ var _;
1815
+ c.current && (c.current.scroll({
1816
+ top: c.current.scrollHeight,
1801
1817
  behavior: "smooth"
1802
- }), (H = r.current) == null || H.focus());
1818
+ }), (_ = r.current) == null || _.focus());
1803
1819
  }, 100);
1804
1820
  return () => clearTimeout(w);
1805
1821
  }, [j]);
1806
1822
  function V() {
1807
- a && (D((w) => [...w, { role: "user", content: a }]), k(a) && c(!0), n(""), p());
1823
+ a && (D((w) => [...w, { role: "user", content: a }]), k(a) && d(!0), n(""), p());
1808
1824
  }
1809
1825
  Z(() => {
1810
- l && (V(), o(!1));
1811
- }, [l, o]);
1826
+ l && (V(), i(!1));
1827
+ }, [l, i]);
1812
1828
  const $ = {
1813
1829
  //seleect a darker color
1814
1830
  // color: '#000',
@@ -1836,10 +1852,10 @@ function hl({
1836
1852
  listStyleType: "disc"
1837
1853
  }, le = {
1838
1854
  // Override how paragraphs are rendered
1839
- p: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("p", { style: $, ...H }),
1840
- code: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...H }),
1841
- pre: ({ node: w, ...H }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: B, children: [
1842
- /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: H.children }),
1855
+ p: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsx("p", { style: $, ..._ }),
1856
+ code: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ..._ }),
1857
+ pre: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: B, children: [
1858
+ /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: _.children }),
1843
1859
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1844
1860
  /* @__PURE__ */ e.jsx(F, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ba, {}) }),
1845
1861
  /* @__PURE__ */ e.jsx(
@@ -1856,18 +1872,18 @@ function hl({
1856
1872
  )
1857
1873
  ] })
1858
1874
  ] }),
1859
- li: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("li", { style: Y, ...H })
1875
+ li: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsx("li", { style: Y, ..._ })
1860
1876
  // You can add more overrides for other elements like h1, h2, etc.
1861
1877
  };
1862
1878
  function J(w) {
1863
- const H = w.currentTarget.closest("pre");
1864
- if (!H)
1879
+ const _ = w.currentTarget.closest("pre");
1880
+ if (!_)
1865
1881
  return;
1866
- const ee = H.textContent || H.innerText;
1882
+ const ee = _.textContent || _.innerText;
1867
1883
  return navigator.clipboard.writeText(ee).then(() => console.log("Text copied to clipboard")).catch((E) => console.error("Error in copying text: ", E)), ee;
1868
1884
  }
1869
1885
  function ne() {
1870
- return j == null ? void 0 : j.map((w, H) => w.role === "user" ? /* @__PURE__ */ e.jsxs(
1886
+ return j == null ? void 0 : j.map((w, _) => w.role === "user" ? /* @__PURE__ */ e.jsxs(
1871
1887
  "div",
1872
1888
  {
1873
1889
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
@@ -1876,19 +1892,19 @@ function hl({
1876
1892
  /* @__PURE__ */ e.jsx("div", { children: w.content })
1877
1893
  ]
1878
1894
  },
1879
- H
1895
+ _
1880
1896
  ) : w.role === "ai" ? /* @__PURE__ */ e.jsx(
1881
1897
  yt,
1882
1898
  {
1883
1899
  className: "w-full overflow-auto py-1",
1884
1900
  components: le,
1885
- children: I == null ? void 0 : I.response.replace(/DuckDB/gi, "Semaphor")
1901
+ children: T == null ? void 0 : T.response.replace(/DuckDB/gi, "Semaphor")
1886
1902
  },
1887
- H
1888
- ) : /* @__PURE__ */ e.jsx("div", {}, H));
1903
+ _
1904
+ ) : /* @__PURE__ */ e.jsx("div", {}, _));
1889
1905
  }
1890
- return /* @__PURE__ */ e.jsxs(Ts, { open: s, onOpenChange: t, children: [
1891
- /* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1906
+ return /* @__PURE__ */ e.jsxs(Is, { open: s, onOpenChange: t, children: [
1907
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1892
1908
  F,
1893
1909
  {
1894
1910
  size: "sm",
@@ -1909,7 +1925,7 @@ function hl({
1909
1925
  /* @__PURE__ */ e.jsx(
1910
1926
  "div",
1911
1927
  {
1912
- ref: u,
1928
+ ref: c,
1913
1929
  className: "h-[625px] w-full overflow-auto border-t border-t-muted",
1914
1930
  children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: ne() })
1915
1931
  }
@@ -1928,8 +1944,8 @@ function hl({
1928
1944
  },
1929
1945
  placeholder: "Type your question here...",
1930
1946
  onFocus: (w) => {
1931
- const H = w.target, ee = H.value.length;
1932
- H.setSelectionRange(ee, ee);
1947
+ const _ = w.target, ee = _.value.length;
1948
+ _.setSelectionRange(ee, ee);
1933
1949
  },
1934
1950
  className: W(
1935
1951
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -1964,24 +1980,24 @@ var Ha = {
1964
1980
  className: void 0,
1965
1981
  style: void 0,
1966
1982
  attr: void 0
1967
- }, na = ze.createContext && /* @__PURE__ */ ze.createContext(Ha), ml = ["attr", "size", "title"];
1968
- function xl(s, t) {
1983
+ }, na = ze.createContext && /* @__PURE__ */ ze.createContext(Ha), xl = ["attr", "size", "title"];
1984
+ function pl(s, t) {
1969
1985
  if (s == null)
1970
1986
  return {};
1971
- var a = pl(s, t), n, l;
1987
+ var a = fl(s, t), n, l;
1972
1988
  if (Object.getOwnPropertySymbols) {
1973
- var o = Object.getOwnPropertySymbols(s);
1974
- for (l = 0; l < o.length; l++)
1975
- n = o[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
1989
+ var i = Object.getOwnPropertySymbols(s);
1990
+ for (l = 0; l < i.length; l++)
1991
+ n = i[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
1976
1992
  }
1977
1993
  return a;
1978
1994
  }
1979
- function pl(s, t) {
1995
+ function fl(s, t) {
1980
1996
  if (s == null)
1981
1997
  return {};
1982
- var a = {}, n = Object.keys(s), l, o;
1983
- for (o = 0; o < n.length; o++)
1984
- l = n[o], !(t.indexOf(l) >= 0) && (a[l] = s[l]);
1998
+ var a = {}, n = Object.keys(s), l, i;
1999
+ for (i = 0; i < n.length; i++)
2000
+ l = n[i], !(t.indexOf(l) >= 0) && (a[l] = s[l]);
1985
2001
  return a;
1986
2002
  }
1987
2003
  function ds() {
@@ -2008,21 +2024,21 @@ function us(s) {
2008
2024
  for (var t = 1; t < arguments.length; t++) {
2009
2025
  var a = arguments[t] != null ? arguments[t] : {};
2010
2026
  t % 2 ? la(Object(a), !0).forEach(function(n) {
2011
- fl(s, n, a[n]);
2027
+ gl(s, n, a[n]);
2012
2028
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : la(Object(a)).forEach(function(n) {
2013
2029
  Object.defineProperty(s, n, Object.getOwnPropertyDescriptor(a, n));
2014
2030
  });
2015
2031
  }
2016
2032
  return s;
2017
2033
  }
2018
- function fl(s, t, a) {
2019
- return t = gl(t), t in s ? Object.defineProperty(s, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[t] = a, s;
2034
+ function gl(s, t, a) {
2035
+ return t = jl(t), t in s ? Object.defineProperty(s, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[t] = a, s;
2020
2036
  }
2021
- function gl(s) {
2022
- var t = jl(s, "string");
2037
+ function jl(s) {
2038
+ var t = bl(s, "string");
2023
2039
  return typeof t == "symbol" ? t : String(t);
2024
2040
  }
2025
- function jl(s, t) {
2041
+ function bl(s, t) {
2026
2042
  if (typeof s != "object" || s === null)
2027
2043
  return s;
2028
2044
  var a = s[Symbol.toPrimitive];
@@ -2040,75 +2056,75 @@ function $a(s) {
2040
2056
  }, t.attr), $a(t.child)));
2041
2057
  }
2042
2058
  function ve(s) {
2043
- return (t) => /* @__PURE__ */ ze.createElement(bl, ds({
2059
+ return (t) => /* @__PURE__ */ ze.createElement(yl, ds({
2044
2060
  attr: us({}, s.attr)
2045
2061
  }, t), $a(s.child));
2046
2062
  }
2047
- function bl(s) {
2063
+ function yl(s) {
2048
2064
  var t = (a) => {
2049
2065
  var {
2050
2066
  attr: n,
2051
2067
  size: l,
2052
- title: o
2053
- } = s, r = xl(s, ml), u = l || a.size || "1em", i;
2054
- return a.className && (i = a.className), s.className && (i = (i ? i + " " : "") + s.className), /* @__PURE__ */ ze.createElement("svg", ds({
2068
+ title: i
2069
+ } = s, r = pl(s, xl), c = l || a.size || "1em", o;
2070
+ return a.className && (o = a.className), s.className && (o = (o ? o + " " : "") + s.className), /* @__PURE__ */ ze.createElement("svg", ds({
2055
2071
  stroke: "currentColor",
2056
2072
  fill: "currentColor",
2057
2073
  strokeWidth: "0"
2058
2074
  }, a.attr, n, r, {
2059
- className: i,
2075
+ className: o,
2060
2076
  style: us(us({
2061
2077
  color: s.color || a.color
2062
2078
  }, a.style), s.style),
2063
- height: u,
2064
- width: u,
2079
+ height: c,
2080
+ width: c,
2065
2081
  xmlns: "http://www.w3.org/2000/svg"
2066
- }), o && /* @__PURE__ */ ze.createElement("title", null, o), s.children);
2082
+ }), i && /* @__PURE__ */ ze.createElement("title", null, i), s.children);
2067
2083
  };
2068
2084
  return na !== void 0 ? /* @__PURE__ */ ze.createElement(na.Consumer, null, (a) => t(a)) : t(Ha);
2069
2085
  }
2070
- function yl(s) {
2086
+ function vl(s) {
2071
2087
  return ve({ 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);
2072
2088
  }
2073
- function vl() {
2089
+ function Cl() {
2074
2090
  const [s, t] = R({
2075
2091
  queryKey: [],
2076
2092
  queryData: null
2077
- }), { theme: a } = Ct(), n = Nt(), l = Xe(), o = Xe(), [r, u] = R(!1), [i, x] = R(!1), [c, y] = R(!1), [f, m] = R(""), [g, j] = R(!1), D = z((b) => b.selectedSheetId);
2093
+ }), { theme: a } = Ct(), n = Nt(), l = Xe(), i = Xe(), [r, c] = R(!1), [o, x] = R(!1), [d, y] = R(!1), [f, m] = R(""), [g, j] = R(!1), D = z((b) => b.selectedSheetId);
2078
2094
  z((b) => b.dashboard.baseQueries);
2079
- const C = d((b) => b.card), L = z((b) => b.theme), T = d((b) => b.isShowingVisual);
2095
+ const C = u((b) => b.card), L = z((b) => b.theme), I = u((b) => b.isShowingVisual);
2080
2096
  z((b) => b.onAcceptChanges);
2081
- const O = d(
2097
+ const O = u(
2082
2098
  (b) => b.selectedConnectionId
2083
- ), N = d(
2099
+ ), N = u(
2084
2100
  (b) => b.selectedDatabaseName
2085
- ), I = d(
2101
+ ), T = u(
2086
2102
  (b) => b.selectedDatamodelId
2087
- ), A = d(
2103
+ ), A = u(
2088
2104
  (b) => b.selectedSchemaName
2089
2105
  );
2090
2106
  z(
2091
2107
  (b) => b.actions.updateFrameCard
2092
2108
  );
2093
- const h = d((b) => b.selectedTableName), v = d((b) => b.card.sql), p = d((b) => b.card.python), k = d((b) => b.frame), V = z((b) => b.dashboard.filters), $ = z((b) => b.filterValues), B = V == null ? void 0 : V.filter(
2109
+ const h = u((b) => b.selectedTableName), v = u((b) => b.card.sql), p = u((b) => b.card.python), k = u((b) => b.frame), V = z((b) => b.dashboard.filters), $ = z((b) => b.filterValues), B = V == null ? void 0 : V.filter(
2094
2110
  (b) => b.sheetId === D || !b.sheetId
2095
2111
  ), Y = $ == null ? void 0 : $.filter(
2096
2112
  (b) => (B == null ? void 0 : B.some((te) => te.id === b.filterId)) || b.filterId.endsWith(D)
2097
- ), le = d((b) => b.applyFilters), {
2113
+ ), le = u((b) => b.applyFilters), {
2098
2114
  setCardCustomCfg: J,
2099
2115
  setQueryResultColumns: ne,
2100
2116
  setFilterValues: w,
2101
- setCardSql: H,
2117
+ setCardSql: _,
2102
2118
  setCard: ee,
2103
2119
  setCardPython: E,
2104
2120
  setQueryError: M,
2105
2121
  setPythonStdOut: se,
2106
2122
  setCardPreferences: P
2107
- } = d((b) => b.actions), X = d((b) => b.onSave), ie = d(
2123
+ } = u((b) => b.actions), X = u((b) => b.onSave), ie = u(
2108
2124
  (b) => b.actions.setApplyFilters
2109
- ), Ce = d((b) => b.onClose), Le = d((b) => b.actions.setSqlGen), Ne = d((b) => b.runSql), Fe = d((b) => b.actions.setRunSql);
2110
- d((b) => b.actions.setCardCfg);
2111
- const Se = d(
2125
+ ), Ce = u((b) => b.onClose), Le = u((b) => b.actions.setSqlGen), Ne = u((b) => b.runSql), Fe = u((b) => b.actions.setRunSql);
2126
+ u((b) => b.actions.setCardCfg);
2127
+ const Se = u(
2112
2128
  (b) => b.actions.setIsSqlRunning
2113
2129
  ), {
2114
2130
  data: ae,
@@ -2154,18 +2170,18 @@ function vl() {
2154
2170
  s.queryData || t({
2155
2171
  queryKey: $e,
2156
2172
  queryData: b
2157
- }), n.setQueryData($e, null), H(""), Le({}), J(""), P({});
2173
+ }), n.setQueryData($e, null), _(""), Le({}), J(""), P({});
2158
2174
  }
2159
2175
  const Pe = (b) => {
2160
- o.current = b;
2176
+ i.current = b;
2161
2177
  };
2162
2178
  function ss(b, te) {
2163
2179
  if (b.length === 0)
2164
2180
  return "";
2165
2181
  if (te) {
2166
- const Te = b.find((oe) => oe.id === te);
2167
- if (Te) {
2168
- const oe = Te.tabTitle;
2182
+ const Ie = b.find((oe) => oe.id === te);
2183
+ if (Ie) {
2184
+ const oe = Ie.tabTitle;
2169
2185
  if (oe == "All__Header")
2170
2186
  return b[0].id;
2171
2187
  if (oe && oe.endsWith("__Header")) {
@@ -2180,22 +2196,24 @@ function vl() {
2180
2196
  return b[0].id;
2181
2197
  }
2182
2198
  function as() {
2183
- const b = v, te = {
2199
+ let b = v;
2200
+ v && !v.includes("{{") && (b = il(v), _(b));
2201
+ const te = {
2184
2202
  ...C,
2185
2203
  lastSelectedSchema: A,
2186
- lastSelectedDatamodelId: I,
2204
+ lastSelectedDatamodelId: T,
2187
2205
  lastSelectedDatabase: N,
2188
2206
  lastSelectedTable: h,
2189
2207
  connectionId: O,
2190
- type: T ? C.type : "table",
2208
+ type: I ? C.type : "table",
2191
2209
  sql: b,
2192
- customCfg: T ? C.customCfg : null
2193
- }, Te = k.cards.map(
2210
+ customCfg: I ? C.customCfg : null
2211
+ }, Ie = k.cards.map(
2194
2212
  (vs) => vs.id === C.id ? te : vs
2195
2213
  ), oe = {
2196
2214
  ...k,
2197
- cards: Te,
2198
- activeCardId: ss(Te, k.activeCardId)
2215
+ cards: Ie,
2216
+ activeCardId: ss(Ie, k.activeCardId)
2199
2217
  };
2200
2218
  X == null || X(oe);
2201
2219
  }
@@ -2204,9 +2222,9 @@ function vl() {
2204
2222
  b && te && n.setQueryData(b, te), Ce == null || Ce();
2205
2223
  }
2206
2224
  Z(() => {
2207
- const b = l.current, te = o.current;
2225
+ const b = l.current, te = i.current;
2208
2226
  if (b) {
2209
- const Te = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", oe = L === "system" ? Te : L;
2227
+ const Ie = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", oe = L === "system" ? Ie : L;
2210
2228
  b.editor.defineTheme("default", {
2211
2229
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2212
2230
  base: oe === "light" ? "vs" : "vs-dark",
@@ -2231,7 +2249,7 @@ function vl() {
2231
2249
  }
2232
2250
  function S() {
2233
2251
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2234
- i && /* @__PURE__ */ e.jsx(
2252
+ o && /* @__PURE__ */ e.jsx(
2235
2253
  "div",
2236
2254
  {
2237
2255
  className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
@@ -2239,16 +2257,16 @@ function vl() {
2239
2257
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
2240
2258
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
2241
2259
  /* @__PURE__ */ e.jsx(
2242
- ol,
2260
+ cl,
2243
2261
  {
2244
2262
  checked: le,
2245
2263
  onCheckedChange: () => ie(!le),
2246
2264
  text: "Apply Filters"
2247
2265
  }
2248
2266
  ),
2249
- /* @__PURE__ */ e.jsx(dl, {}),
2250
- Y && i && /* @__PURE__ */ e.jsx(
2251
- Qe,
2267
+ /* @__PURE__ */ e.jsx(ul, {}),
2268
+ Y && o && /* @__PURE__ */ e.jsx(
2269
+ Je,
2252
2270
  {
2253
2271
  onClick: () => x(!1),
2254
2272
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
@@ -2289,7 +2307,7 @@ function vl() {
2289
2307
  ] })
2290
2308
  }
2291
2309
  ),
2292
- Y && !i && /* @__PURE__ */ e.jsx(
2310
+ Y && !o && /* @__PURE__ */ e.jsx(
2293
2311
  ha,
2294
2312
  {
2295
2313
  onClick: () => x(!0),
@@ -2330,7 +2348,7 @@ function vl() {
2330
2348
  theme: "default",
2331
2349
  className: "pt-3",
2332
2350
  onChange: (b) => {
2333
- H(b);
2351
+ _(b);
2334
2352
  },
2335
2353
  value: v,
2336
2354
  options: {
@@ -2452,7 +2470,7 @@ function vl() {
2452
2470
  }
2453
2471
  ),
2454
2472
  Ee && /* @__PURE__ */ e.jsx(
2455
- il,
2473
+ ol,
2456
2474
  {
2457
2475
  error: He.message,
2458
2476
  setShowAIDialog: y,
@@ -2468,7 +2486,7 @@ function vl() {
2468
2486
  size: "sm",
2469
2487
  variant: "outline",
2470
2488
  children: [
2471
- /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-4" }),
2489
+ /* @__PURE__ */ e.jsx(Tn, { className: "mr-2 size-4" }),
2472
2490
  "Clear"
2473
2491
  ]
2474
2492
  }
@@ -2477,17 +2495,17 @@ function vl() {
2477
2495
  ga,
2478
2496
  {
2479
2497
  pressed: r,
2480
- onPressedChange: (b) => u(b),
2498
+ onPressedChange: (b) => c(b),
2481
2499
  className: "",
2482
2500
  size: "sm",
2483
2501
  variant: "outline",
2484
- children: /* @__PURE__ */ e.jsx(yl, { className: "size-4 text-foreground/70" })
2502
+ children: /* @__PURE__ */ e.jsx(vl, { className: "size-4 text-foreground/70" })
2485
2503
  }
2486
2504
  ),
2487
2505
  /* @__PURE__ */ e.jsx(
2488
- hl,
2506
+ ml,
2489
2507
  {
2490
- open: c,
2508
+ open: d,
2491
2509
  setOpen: y,
2492
2510
  userInput: f,
2493
2511
  triggerAIRun: g,
@@ -2517,7 +2535,7 @@ function vl() {
2517
2535
  size: "sm",
2518
2536
  variant: "outline",
2519
2537
  children: [
2520
- /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 size-4" }),
2538
+ /* @__PURE__ */ e.jsx(Je, { className: "mr-2 size-4" }),
2521
2539
  "Close"
2522
2540
  ]
2523
2541
  }
@@ -2531,26 +2549,26 @@ function vl() {
2531
2549
  )
2532
2550
  );
2533
2551
  }
2534
- function Cl({ data: s }) {
2552
+ function Nl({ data: s }) {
2535
2553
  var r;
2536
- const [t, a] = ze.useState([]), l = Object.keys(s[0]).map((u) => ({
2554
+ const [t, a] = ze.useState([]), l = Object.keys(s[0]).map((c) => ({
2537
2555
  // header: key,
2538
- accessorKey: u,
2539
- header: ({ column: i }) => {
2540
- const x = i.getIsSorted();
2556
+ accessorKey: c,
2557
+ header: ({ column: o }) => {
2558
+ const x = o.getIsSorted();
2541
2559
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2542
2560
  "div",
2543
2561
  {
2544
2562
  className: "flex cursor-pointer items-center",
2545
- onClick: () => i.toggleSorting(i.getIsSorted() === "asc"),
2563
+ onClick: () => o.toggleSorting(o.getIsSorted() === "asc"),
2546
2564
  children: [
2547
- u,
2565
+ c,
2548
2566
  x === "asc" ? /* @__PURE__ */ e.jsx(zt, { className: "ml-2 h-5 w-5" }) : x === "desc" ? /* @__PURE__ */ e.jsx(Ot, { className: "ml-2 h-5 w-5" }) : null
2549
2567
  ]
2550
2568
  }
2551
2569
  ) });
2552
2570
  }
2553
- })), o = Ft({
2571
+ })), i = Ft({
2554
2572
  data: s,
2555
2573
  columns: l,
2556
2574
  getCoreRowModel: Lt(),
@@ -2562,63 +2580,63 @@ function Cl({ data: s }) {
2562
2580
  sorting: t
2563
2581
  }
2564
2582
  });
2565
- return /* @__PURE__ */ e.jsxs(Tt, { children: [
2566
- /* @__PURE__ */ e.jsx(It, { children: o.getHeaderGroups().map((u) => /* @__PURE__ */ e.jsx(Cs, { children: u.headers.map((i) => /* @__PURE__ */ e.jsx(Dt, { className: "sticky top-0 bg-muted", children: i.isPlaceholder ? null : Zs(
2567
- i.column.columnDef.header,
2568
- i.getContext()
2569
- ) }, i.id)) }, u.id)) }),
2570
- /* @__PURE__ */ e.jsx(Mt, { children: (r = o.getRowModel().rows) != null && r.length ? o.getRowModel().rows.map((u) => /* @__PURE__ */ e.jsx(
2583
+ return /* @__PURE__ */ e.jsxs(It, { children: [
2584
+ /* @__PURE__ */ e.jsx(Tt, { children: i.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(Cs, { children: c.headers.map((o) => /* @__PURE__ */ e.jsx(Dt, { className: "sticky top-0 bg-muted", children: o.isPlaceholder ? null : Zs(
2585
+ o.column.columnDef.header,
2586
+ o.getContext()
2587
+ ) }, o.id)) }, c.id)) }),
2588
+ /* @__PURE__ */ e.jsx(Mt, { children: (r = i.getRowModel().rows) != null && r.length ? i.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2571
2589
  Cs,
2572
2590
  {
2573
2591
  className: "whitespace-nowrap py-2",
2574
- "data-state": u.getIsSelected() && "selected",
2575
- children: u.getVisibleCells().map((i) => /* @__PURE__ */ e.jsx(ea, { children: Zs(i.column.columnDef.cell, i.getContext()) }, i.id))
2592
+ "data-state": c.getIsSelected() && "selected",
2593
+ children: c.getVisibleCells().map((o) => /* @__PURE__ */ e.jsx(ea, { children: Zs(o.column.columnDef.cell, o.getContext()) }, o.id))
2576
2594
  },
2577
- u.id
2595
+ c.id
2578
2596
  )) : /* @__PURE__ */ e.jsx(Cs, { children: /* @__PURE__ */ e.jsx(ea, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2579
2597
  ] });
2580
2598
  }
2581
- function Nl({ card: s }) {
2582
- var c, y, f, m, g, j, D, C, L, T;
2599
+ function Sl({ card: s }) {
2600
+ var d, y, f, m, g, j, D, C, L, I;
2583
2601
  const t = z((O) => O.themeStyle), a = {
2584
- colors: ((y = (c = t == null ? void 0 : t.chart) == null ? void 0 : c.dataset) == null ? void 0 : y.backgroundColor) || []
2602
+ colors: ((y = (d = t == null ? void 0 : t.chart) == null ? void 0 : d.dataset) == null ? void 0 : y.backgroundColor) || []
2585
2603
  };
2586
2604
  (f = s.customCardPreferences) != null && f.inputData;
2587
- const { getCard: n } = va(((m = s.customCardPreferences) == null ? void 0 : m.url) || ""), l = ((g = s.customCardPreferences) == null ? void 0 : g.visualType) || "single", o = d((O) => O.frame);
2605
+ const { getCard: n } = va(((m = s.customCardPreferences) == null ? void 0 : m.url) || ""), l = ((g = s.customCardPreferences) == null ? void 0 : g.visualType) || "single", i = u((O) => O.frame);
2588
2606
  ce();
2589
2607
  const { data: r } = qe(s);
2590
2608
  if (!((j = s.customCardPreferences) != null && j.componentName))
2591
2609
  return null;
2592
- const u = n(
2610
+ const c = n(
2593
2611
  (D = s.customCardPreferences) == null ? void 0 : D.componentName
2594
- ), i = (O) => {
2612
+ ), o = (O) => {
2595
2613
  console.log("data", O), s.customCardPreferences;
2596
2614
  }, x = Object.keys(
2597
2615
  ((C = s.customCardPreferences) == null ? void 0 : C.dataInputCardIds) || {}
2598
2616
  ).map((O) => {
2599
2617
  var A, h, v;
2600
- const N = (h = (A = s.customCardPreferences) == null ? void 0 : A.dataInputCardIds) == null ? void 0 : h[O].cardId, I = (v = o == null ? void 0 : o.cards) == null ? void 0 : v.find((p) => p.id === N);
2601
- return I || null;
2618
+ const N = (h = (A = s.customCardPreferences) == null ? void 0 : A.dataInputCardIds) == null ? void 0 : h[O].cardId, T = (v = i == null ? void 0 : i.cards) == null ? void 0 : v.find((p) => p.id === N);
2619
+ return T || null;
2602
2620
  });
2603
2621
  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(
2604
2622
  wn,
2605
2623
  {
2606
2624
  fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
2607
2625
  children: [
2608
- u && l === "single" && /* @__PURE__ */ e.jsx(
2609
- u,
2626
+ c && l === "single" && /* @__PURE__ */ e.jsx(
2627
+ c,
2610
2628
  {
2611
2629
  theme: a,
2612
2630
  settings: (L = s.customCardPreferences) == null ? void 0 : L.settings,
2613
- onDataChange: i,
2631
+ onDataChange: o,
2614
2632
  data: (r == null ? void 0 : r.records) || []
2615
2633
  }
2616
2634
  ),
2617
- u && l === "multiple" && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
2618
- u,
2635
+ c && l === "multiple" && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
2636
+ c,
2619
2637
  {
2620
2638
  theme: a,
2621
- onDataChange: i,
2639
+ onDataChange: o,
2622
2640
  settings: x.map(
2623
2641
  (O) => {
2624
2642
  var N;
@@ -2630,7 +2648,7 @@ function Nl({ card: s }) {
2630
2648
  ) })
2631
2649
  ]
2632
2650
  },
2633
- (T = s.customCardPreferences) == null ? void 0 : T.componentName
2651
+ (I = s.customCardPreferences) == null ? void 0 : I.componentName
2634
2652
  ) });
2635
2653
  }
2636
2654
  function Pa({
@@ -2640,22 +2658,22 @@ function Pa({
2640
2658
  ...t
2641
2659
  }) {
2642
2660
  var m, g;
2643
- const a = d((j) => j.card), n = ((m = a.customCardPreferences) == null ? void 0 : m.showCardHeader) ?? !0, l = d((j) => j.frame), o = z((j) => j.dashboard.filters);
2644
- d((j) => j.actions.setRunSql);
2645
- const { updateFilter: r } = Fs(), u = o == null ? void 0 : o.find((j) => j.id === l.filterId), { data: i } = qe(a), { setCard: x } = ce(), { data: c } = Bs(a);
2661
+ const a = u((j) => j.card), n = ((m = a.customCardPreferences) == null ? void 0 : m.showCardHeader) ?? !0, l = u((j) => j.frame), i = z((j) => j.dashboard.filters);
2662
+ u((j) => j.actions.setRunSql);
2663
+ const { updateFilter: r } = Fs(), c = i == null ? void 0 : i.find((j) => j.id === l.filterId), { data: o } = qe(a), { setCard: x } = ce(), { data: d } = Bs(a);
2646
2664
  if (!a.id)
2647
2665
  return null;
2648
2666
  let y;
2649
- i != null && i.records && (i == null ? void 0 : i.records.length) > 0 && (y = Ca({
2650
- data: i == null ? void 0 : i.records,
2667
+ o != null && o.records && (o == null ? void 0 : o.records.length) > 0 && (y = Ca({
2668
+ data: o == null ? void 0 : o.records,
2651
2669
  cardType: a.type,
2652
2670
  cfg: a.cfg,
2653
2671
  customCfg: a.customCfg,
2654
2672
  preferences: a.preferences,
2655
- topoJson: c
2673
+ topoJson: d
2656
2674
  }));
2657
2675
  function f(j) {
2658
- return /* @__PURE__ */ e.jsx(Nl, { card: j });
2676
+ return /* @__PURE__ */ e.jsx(Sl, { card: j });
2659
2677
  }
2660
2678
  return /* @__PURE__ */ e.jsxs(
2661
2679
  Vt,
@@ -2685,17 +2703,17 @@ function Pa({
2685
2703
  a.description
2686
2704
  )
2687
2705
  ] }),
2688
- u && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2706
+ c && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2689
2707
  /* @__PURE__ */ e.jsx(
2690
2708
  rs,
2691
2709
  {
2692
2710
  className: "my-1",
2693
- text: u.title || u.column,
2694
- onSave: (j) => r({ ...u, title: j }),
2695
- children: /* @__PURE__ */ e.jsx(_, { children: u.title })
2711
+ text: c.title || c.column,
2712
+ onSave: (j) => r({ ...c, title: j }),
2713
+ children: /* @__PURE__ */ e.jsx(H, { children: c.title })
2696
2714
  }
2697
2715
  ),
2698
- Ht(u)
2716
+ Ht(c)
2699
2717
  ] })
2700
2718
  ] }),
2701
2719
  /* @__PURE__ */ e.jsxs($t, { className: "flex grow flex-col", children: [
@@ -2708,20 +2726,20 @@ function Pa({
2708
2726
  },
2709
2727
  JSON.stringify(y) + JSON.stringify(a.preferences) + ((g = a == null ? void 0 : a.preferences) == null ? void 0 : g.customVisualCode)
2710
2728
  ),
2711
- a.type === "table" && (i == null ? void 0 : i.records) && (i == null ? void 0 : i.records.length) > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2712
- /* @__PURE__ */ e.jsx(Bt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Ut, { card: a, data: i == null ? void 0 : i.records }) })
2729
+ a.type === "table" && (o == null ? void 0 : o.records) && (o == null ? void 0 : o.records.length) > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2730
+ /* @__PURE__ */ e.jsx(Bt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Ut, { card: a, data: o == null ? void 0 : o.records }) })
2713
2731
  ] })
2714
2732
  ]
2715
2733
  }
2716
2734
  );
2717
2735
  }
2718
- function Sl() {
2719
- const [s, t] = R(!1), [a, n] = R(""), [l, o] = R(""), [r, u] = R(""), [i, x] = R(""), c = d((N) => N.card), y = d(
2736
+ function wl() {
2737
+ const [s, t] = R(!1), [a, n] = R(""), [l, i] = R(""), [r, c] = R(""), [o, x] = R(""), d = u((N) => N.card), y = u(
2720
2738
  (N) => N.card.customCfg
2721
- ), { data: f } = qe(c), { data: m } = Bs(c), { setCardCustomCfg: g, setCustomVisualCode: j } = ce();
2739
+ ), { data: f } = qe(d), { data: m } = Bs(d), { setCardCustomCfg: g, setCustomVisualCode: j } = ce();
2722
2740
  function D(N) {
2723
2741
  var h, v;
2724
- const I = {
2742
+ const T = {
2725
2743
  ...N,
2726
2744
  data: {
2727
2745
  ...N == null ? void 0 : N.data,
@@ -2731,43 +2749,43 @@ function Sl() {
2731
2749
  }))
2732
2750
  }
2733
2751
  };
2734
- return JSON.stringify(I, null, 1);
2752
+ return JSON.stringify(T, null, 1);
2735
2753
  }
2736
2754
  function C() {
2737
- var I, A;
2755
+ var T, A;
2738
2756
  if (!(f != null && f.records) || (f == null ? void 0 : f.records.length) === 0)
2739
2757
  return;
2740
2758
  const N = Ca({
2741
2759
  data: f == null ? void 0 : f.records,
2742
- cardType: c.type,
2743
- cfg: c.cfg,
2744
- preferences: c.preferences,
2760
+ cardType: d.type,
2761
+ cfg: d.cfg,
2762
+ preferences: d.preferences,
2745
2763
  topoJson: m
2746
2764
  });
2747
- N && (n(JSON.stringify(N, null, 1)), (I = c == null ? void 0 : c.preferences) != null && I.customVisualCode && u((A = c == null ? void 0 : c.preferences) == null ? void 0 : A.customVisualCode), y && o(JSON.stringify(y, null, 1)));
2765
+ N && (n(JSON.stringify(N, null, 1)), (T = d == null ? void 0 : d.preferences) != null && T.customVisualCode && c((A = d == null ? void 0 : d.preferences) == null ? void 0 : A.customVisualCode), y && i(JSON.stringify(y, null, 1)));
2748
2766
  }
2749
2767
  function L() {
2750
2768
  if (r && j(r), !!l)
2751
2769
  try {
2752
2770
  const N = JSON.parse(l);
2753
- return N ? (g(N), x(""), o(""), N) : void 0;
2771
+ return N ? (g(N), x(""), i(""), N) : void 0;
2754
2772
  } catch (N) {
2755
2773
  console.log(N), x("Invalid JSON");
2756
2774
  }
2757
2775
  }
2758
- function T() {
2759
- o(""), g(null);
2776
+ function I() {
2777
+ i(""), g(null);
2760
2778
  }
2761
2779
  function O() {
2762
2780
  let N;
2763
2781
  if (y) {
2764
- const I = sa.cloneDeep(c.cfg), A = sa.merge(I, y);
2782
+ const T = sa.cloneDeep(d.cfg), A = sa.merge(T, y);
2765
2783
  return N = D(A), N;
2766
2784
  }
2767
2785
  return a ? (N = D(JSON.parse(a)), N) : "";
2768
2786
  }
2769
- return /* @__PURE__ */ e.jsxs(Ts, { open: s, onOpenChange: t, children: [
2770
- /* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2787
+ return /* @__PURE__ */ e.jsxs(Is, { open: s, onOpenChange: t, children: [
2788
+ /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2771
2789
  F,
2772
2790
  {
2773
2791
  onClick: C,
@@ -2790,7 +2808,7 @@ function Sl() {
2790
2808
  La,
2791
2809
  {
2792
2810
  onClick: () => {
2793
- navigator.clipboard.writeText(c.id);
2811
+ navigator.clipboard.writeText(d.id);
2794
2812
  },
2795
2813
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
2796
2814
  }
@@ -2861,7 +2879,7 @@ function Sl() {
2861
2879
  },
2862
2880
  defaultLanguage: "json",
2863
2881
  value: O(),
2864
- onChange: (N) => o(N)
2882
+ onChange: (N) => i(N)
2865
2883
  }
2866
2884
  )
2867
2885
  }
@@ -2890,7 +2908,7 @@ function Sl() {
2890
2908
  },
2891
2909
  defaultLanguage: "javascript",
2892
2910
  value: r,
2893
- onChange: (N) => u(N || "")
2911
+ onChange: (N) => c(N || "")
2894
2912
  }
2895
2913
  )
2896
2914
  }
@@ -2898,12 +2916,12 @@ function Sl() {
2898
2916
  ] })
2899
2917
  ] }),
2900
2918
  /* @__PURE__ */ e.jsxs(oa, { className: "flex items-center", children: [
2901
- /* @__PURE__ */ e.jsx(_, { className: "mr-2 text-red-500", children: i }),
2919
+ /* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: o }),
2902
2920
  /* @__PURE__ */ e.jsx(
2903
2921
  F,
2904
2922
  {
2905
2923
  disabled: !y,
2906
- onClick: T,
2924
+ onClick: I,
2907
2925
  variant: "outline",
2908
2926
  children: "Reset"
2909
2927
  }
@@ -2928,10 +2946,10 @@ function Ga(s) {
2928
2946
  function Ka(s) {
2929
2947
  return ve({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
2930
2948
  }
2931
- function Ja(s) {
2949
+ function Qa(s) {
2932
2950
  return ve({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
2933
2951
  }
2934
- function Qa(s) {
2952
+ function Ja(s) {
2935
2953
  return ve({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
2936
2954
  }
2937
2955
  function Wa(s) {
@@ -2944,8 +2962,8 @@ function Xa(s) {
2944
2962
  const [t, a] = R(null);
2945
2963
  return Z(() => {
2946
2964
  s && (async () => {
2947
- const o = (await import("./lucide-react-3timzT6o.js"))[s];
2948
- a(o);
2965
+ const i = (await import("./lucide-react-i2jWfYYq.js"))[s];
2966
+ a(i);
2949
2967
  })();
2950
2968
  }, [s]), t;
2951
2969
  }
@@ -2957,38 +2975,38 @@ function Za() {
2957
2975
  });
2958
2976
  return { data: t, isLoading: a, isFetching: n, isError: l };
2959
2977
  }
2960
- function wl({
2978
+ function kl({
2961
2979
  onChartTypeChange: s
2962
2980
  }) {
2963
2981
  const [t, a] = R([]), { data: n } = Za();
2964
2982
  return Z(() => {
2965
2983
  (async () => {
2966
- var o;
2984
+ var i;
2967
2985
  if (n) {
2968
- const u = (await Promise.all(
2969
- (o = n == null ? void 0 : n.plugins) == null ? void 0 : o.map(async (i) => (await Jt(i.value)).visuals.map((y) => ({
2986
+ const c = (await Promise.all(
2987
+ (i = n == null ? void 0 : n.plugins) == null ? void 0 : i.map(async (o) => (await Qt(o.value)).visuals.map((y) => ({
2970
2988
  name: y.name,
2971
2989
  icon: y.icon,
2972
- url: i.value
2990
+ url: o.value
2973
2991
  })))
2974
2992
  )).flat();
2975
- a(u);
2993
+ a(c);
2976
2994
  }
2977
2995
  })();
2978
2996
  }, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2979
2997
  /* @__PURE__ */ e.jsx(de, { className: "my-2" }),
2980
- /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, o) => /* @__PURE__ */ e.jsx(
2981
- kl,
2998
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, i) => /* @__PURE__ */ e.jsx(
2999
+ zl,
2982
3000
  {
2983
3001
  text: l.name,
2984
3002
  onClick: () => s("custom", l),
2985
3003
  icon: l.icon
2986
3004
  },
2987
- l.url + l.name + o
3005
+ l.url + l.name + i
2988
3006
  )) })
2989
3007
  ] });
2990
3008
  }
2991
- const kl = ({
3009
+ const zl = ({
2992
3010
  text: s,
2993
3011
  icon: t,
2994
3012
  onClick: a
@@ -2996,11 +3014,11 @@ const kl = ({
2996
3014
  const n = Xa(t || ""), l = s.charAt(0).toUpperCase();
2997
3015
  return /* @__PURE__ */ e.jsx(F, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
2998
3016
  };
2999
- function zl() {
3000
- var c, y;
3001
- const [s, t] = R(!1), a = d((f) => f.card), n = a.type, { setCardType: l, setCardPreferences: o, setChartOrientation: r } = d((f) => f.actions), { setCardCustomCfg: u, setCustomCardPreferences: i } = ce();
3017
+ function Ol() {
3018
+ var d, y;
3019
+ const [s, t] = R(!1), a = u((f) => f.card), n = a.type, { setCardType: l, setCardPreferences: i, setChartOrientation: r } = u((f) => f.actions), { setCardCustomCfg: c, setCustomCardPreferences: o } = ce();
3002
3020
  function x(f, m) {
3003
- u(null), o({}), l(f), m && i({
3021
+ c(null), i({}), l(f), m && o({
3004
3022
  type: "component",
3005
3023
  visualType: "single",
3006
3024
  url: m.url,
@@ -3010,11 +3028,11 @@ function zl() {
3010
3028
  }
3011
3029
  return /* @__PURE__ */ e.jsxs(ps, { open: s, onOpenChange: t, children: [
3012
3030
  /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3013
- Ol,
3031
+ Fl,
3014
3032
  {
3015
3033
  className: "h-4 w-4",
3016
3034
  chartType: n,
3017
- customIcon: (c = a.customCardPreferences) == null ? void 0 : c.icon,
3035
+ customIcon: (d = a.customCardPreferences) == null ? void 0 : d.icon,
3018
3036
  componentName: (y = a.customCardPreferences) == null ? void 0 : y.componentName
3019
3037
  }
3020
3038
  ) }) }),
@@ -3042,7 +3060,7 @@ function zl() {
3042
3060
  {
3043
3061
  onClick: () => x("stackedBar"),
3044
3062
  variant: "ghost",
3045
- children: /* @__PURE__ */ e.jsx(Qa, { className: "size-5", strokeWidth: 0 })
3063
+ children: /* @__PURE__ */ e.jsx(Ja, { className: "size-5", strokeWidth: 0 })
3046
3064
  }
3047
3065
  ),
3048
3066
  /* @__PURE__ */ e.jsx(
@@ -3050,7 +3068,7 @@ function zl() {
3050
3068
  {
3051
3069
  onClick: () => x("stackedLine"),
3052
3070
  variant: "ghost",
3053
- children: /* @__PURE__ */ e.jsx(Ja, { className: "size-5", strokeWidth: 0 })
3071
+ children: /* @__PURE__ */ e.jsx(Qa, { className: "size-5", strokeWidth: 0 })
3054
3072
  }
3055
3073
  ),
3056
3074
  /* @__PURE__ */ e.jsx(
@@ -3074,7 +3092,7 @@ function zl() {
3074
3092
  {
3075
3093
  onClick: () => x("pie"),
3076
3094
  variant: "ghost",
3077
- children: /* @__PURE__ */ e.jsx(Ia, { className: "size-5" })
3095
+ children: /* @__PURE__ */ e.jsx(Ta, { className: "size-5" })
3078
3096
  }
3079
3097
  ),
3080
3098
  /* @__PURE__ */ e.jsx(
@@ -3120,7 +3138,7 @@ function zl() {
3120
3138
  {
3121
3139
  onClick: () => x("range"),
3122
3140
  variant: "ghost",
3123
- children: /* @__PURE__ */ e.jsx(Ta, { className: "size-5" })
3141
+ children: /* @__PURE__ */ e.jsx(Ia, { className: "size-5" })
3124
3142
  }
3125
3143
  ),
3126
3144
  /* @__PURE__ */ e.jsx(
@@ -3144,7 +3162,7 @@ function zl() {
3144
3162
  {
3145
3163
  onClick: () => x("text"),
3146
3164
  variant: "ghost",
3147
- children: /* @__PURE__ */ e.jsx(Js, { className: "size-4" })
3165
+ children: /* @__PURE__ */ e.jsx(Qs, { className: "size-4" })
3148
3166
  }
3149
3167
  ),
3150
3168
  /* @__PURE__ */ e.jsx(
@@ -3164,11 +3182,11 @@ function zl() {
3164
3182
  }
3165
3183
  )
3166
3184
  ] }),
3167
- /* @__PURE__ */ e.jsx(wl, { onChartTypeChange: x })
3185
+ /* @__PURE__ */ e.jsx(kl, { onChartTypeChange: x })
3168
3186
  ] })
3169
3187
  ] });
3170
3188
  }
3171
- function Ol({
3189
+ function Fl({
3172
3190
  chartType: s,
3173
3191
  className: t,
3174
3192
  customIcon: a,
@@ -3181,7 +3199,7 @@ function Ol({
3181
3199
  case "line":
3182
3200
  return /* @__PURE__ */ e.jsx(Ks, { className: t });
3183
3201
  case "pie":
3184
- return /* @__PURE__ */ e.jsx(Ia, { className: t });
3202
+ return /* @__PURE__ */ e.jsx(Ta, { className: t });
3185
3203
  case "radar":
3186
3204
  return /* @__PURE__ */ e.jsx(Ba, { className: t });
3187
3205
  case "scatter":
@@ -3191,19 +3209,19 @@ function Ol({
3191
3209
  case "doughnut":
3192
3210
  return /* @__PURE__ */ e.jsx(Ua, { className: t });
3193
3211
  case "stackedBar":
3194
- return /* @__PURE__ */ e.jsx(Qa, { className: "size-4 text-foreground/70" });
3195
- case "stackedLine":
3196
3212
  return /* @__PURE__ */ e.jsx(Ja, { className: "size-4 text-foreground/70" });
3213
+ case "stackedLine":
3214
+ return /* @__PURE__ */ e.jsx(Qa, { className: "size-4 text-foreground/70" });
3197
3215
  case "polarArea":
3198
3216
  return /* @__PURE__ */ e.jsx(Ga, { className: t });
3199
3217
  case "pyramid":
3200
3218
  return /* @__PURE__ */ e.jsx(Ya, { className: t });
3201
3219
  case "range":
3202
- return /* @__PURE__ */ e.jsx(Ta, { className: t });
3220
+ return /* @__PURE__ */ e.jsx(Ia, { className: t });
3203
3221
  case "kpi":
3204
3222
  return /* @__PURE__ */ e.jsx(Wa, { className: t });
3205
3223
  case "text":
3206
- return /* @__PURE__ */ e.jsx(Js, { className: t });
3224
+ return /* @__PURE__ */ e.jsx(Qs, { className: t });
3207
3225
  case "map":
3208
3226
  return /* @__PURE__ */ e.jsx(Ea, { className: t });
3209
3227
  case "custom":
@@ -3212,19 +3230,19 @@ function Ol({
3212
3230
  return /* @__PURE__ */ e.jsx(Rs, { className: t });
3213
3231
  }
3214
3232
  }
3215
- function Fl() {
3233
+ function Il() {
3216
3234
  var l;
3217
- const s = d((o) => o.card), t = ((l = s.customCardPreferences) == null ? void 0 : l.showCardHeader) ?? !0, { setCustomCardPreferences: a } = ce(), n = (o) => {
3235
+ const s = u((i) => i.card), t = ((l = s.customCardPreferences) == null ? void 0 : l.showCardHeader) ?? !0, { setCustomCardPreferences: a } = ce(), n = (i) => {
3218
3236
  s.customCardPreferences && a({
3219
3237
  ...s.customCardPreferences,
3220
- showCardHeader: o === !0
3238
+ showCardHeader: i === !0
3221
3239
  });
3222
3240
  };
3223
3241
  return /* @__PURE__ */ e.jsxs(ca, { children: [
3224
3242
  /* @__PURE__ */ e.jsx(da, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ma, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3225
3243
  /* @__PURE__ */ e.jsxs(ua, { align: "start", className: "w-40 text-muted-foreground", children: [
3226
3244
  /* @__PURE__ */ e.jsx(
3227
- Qt,
3245
+ Jt,
3228
3246
  {
3229
3247
  checked: t,
3230
3248
  onCheckedChange: n,
@@ -3248,9 +3266,9 @@ function Fl() {
3248
3266
  ] });
3249
3267
  }
3250
3268
  function ra() {
3251
- const s = d((h) => h.frame), t = d((h) => h.card), a = d((h) => h.isShowingVisual), n = d((h) => h.isSqlRunning), l = d((h) => h.queryError), o = d((h) => h.pythonStdOut), r = d((h) => h.actions.setRunSql);
3252
- d((h) => h.onSave), d((h) => h.onClose), d((h) => h.actions.setCardSql), d((h) => h.actions.setCardType), d((h) => h.actions.setSqlGen);
3253
- const { setFrame: u, setCard: i, updateCardInFrame: x } = ce(), { data: c, isLoading: y, isFetching: f } = qe(t);
3269
+ const s = u((h) => h.frame), t = u((h) => h.card), a = u((h) => h.isShowingVisual), n = u((h) => h.isSqlRunning), l = u((h) => h.queryError), i = u((h) => h.pythonStdOut), r = u((h) => h.actions.setRunSql);
3270
+ u((h) => h.onSave), u((h) => h.onClose), u((h) => h.actions.setCardSql), u((h) => h.actions.setCardType), u((h) => h.actions.setSqlGen);
3271
+ const { setFrame: c, setCard: o, updateCardInFrame: x } = ce(), { data: d, isLoading: y, isFetching: f } = qe(t);
3254
3272
  if (!t)
3255
3273
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3256
3274
  function m() {
@@ -3279,7 +3297,7 @@ function ra() {
3279
3297
  cards: [...s.cards, h],
3280
3298
  activeCardId: h.id
3281
3299
  };
3282
- u(v), i(h);
3300
+ c(v), o(h);
3283
3301
  }
3284
3302
  function j() {
3285
3303
  const h = {
@@ -3297,7 +3315,7 @@ function ra() {
3297
3315
  // update the active card to the first card in the frame
3298
3316
  activeCardId: p.id
3299
3317
  };
3300
- u(k), i(p);
3318
+ c(k), o(p);
3301
3319
  }
3302
3320
  function C(h) {
3303
3321
  const v = {
@@ -3305,20 +3323,20 @@ function ra() {
3305
3323
  cards: s.cards.map((k) => k.id === t.id ? t : k),
3306
3324
  activeCardId: h
3307
3325
  };
3308
- u(v);
3326
+ c(v);
3309
3327
  const p = v.cards.find((k) => k.id === h);
3310
- p.sql && r(!0), i(p);
3328
+ p.sql && r(!0), o(p);
3311
3329
  }
3312
3330
  const L = (h, v) => {
3313
3331
  console.log("handleDragStart", v), h.dataTransfer.setData("tabIndex", v.toString());
3314
- }, T = (h) => {
3332
+ }, I = (h) => {
3315
3333
  h.preventDefault();
3316
3334
  }, O = (h, v) => {
3317
3335
  const p = h.dataTransfer.getData("tabIndex");
3318
3336
  if (p === v.toString())
3319
3337
  return;
3320
3338
  const k = Array.from(s.cards), [V] = k.splice(parseInt(p), 1);
3321
- k.splice(v, 0, V), u({ ...s, cards: k });
3339
+ k.splice(v, 0, V), c({ ...s, cards: k });
3322
3340
  };
3323
3341
  function N(h, v) {
3324
3342
  return h.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || h.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
@@ -3326,7 +3344,7 @@ function ra() {
3326
3344
  {
3327
3345
  onClick: () => {
3328
3346
  const p = v.displayTab === void 0 ? !1 : !v.displayTab;
3329
- i({ ...v, displayTab: p }), x({
3347
+ o({ ...v, displayTab: p }), x({
3330
3348
  ...v,
3331
3349
  displayTab: p
3332
3350
  });
@@ -3335,7 +3353,7 @@ function ra() {
3335
3353
  }
3336
3354
  );
3337
3355
  }
3338
- function I() {
3356
+ function T() {
3339
3357
  return /* @__PURE__ */ e.jsxs(
3340
3358
  Sa,
3341
3359
  {
@@ -3350,14 +3368,14 @@ function ra() {
3350
3368
  {
3351
3369
  text: h.tabTitle || h.title,
3352
3370
  onSave: (p) => {
3353
- i({ ...t, tabTitle: p }), x({ ...t, tabTitle: p });
3371
+ o({ ...t, tabTitle: p }), x({ ...t, tabTitle: p });
3354
3372
  },
3355
3373
  children: /* @__PURE__ */ e.jsxs(
3356
3374
  is,
3357
3375
  {
3358
3376
  draggable: !0,
3359
3377
  onDragStart: (p) => L(p, v),
3360
- onDragOver: T,
3378
+ onDragOver: I,
3361
3379
  onDrop: (p) => O(p, v),
3362
3380
  className: "",
3363
3381
  value: h.id,
@@ -3401,12 +3419,12 @@ function ra() {
3401
3419
  );
3402
3420
  }
3403
3421
  function A() {
3404
- return t.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(Yt, { card: t, data: c == null ? void 0 : c.records }) }) }) : t.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(
3422
+ return t.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(Yt, { card: t, data: d == null ? void 0 : d.records }) }) }) : t.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(
3405
3423
  Xt,
3406
3424
  {
3407
3425
  isLoading: n,
3408
3426
  card: t,
3409
- data: c == null ? void 0 : c.records
3427
+ data: d == null ? void 0 : d.records
3410
3428
  }
3411
3429
  ) }) }) : /* @__PURE__ */ e.jsx(xs, { FallbackComponent: Na, children: /* @__PURE__ */ e.jsx(Pa, { className: "grow border-none shadow-none" }) });
3412
3430
  }
@@ -3414,21 +3432,21 @@ function ra() {
3414
3432
  (y || f) && /* @__PURE__ */ e.jsx(Ze, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3415
3433
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3416
3434
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3417
- /* @__PURE__ */ e.jsx(zl, {}),
3418
- !["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(Sl, {}),
3419
- /* @__PURE__ */ e.jsx(Fl, {})
3435
+ /* @__PURE__ */ e.jsx(Ol, {}),
3436
+ !["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(wl, {}),
3437
+ /* @__PURE__ */ e.jsx(Il, {})
3420
3438
  ] }),
3421
- /* @__PURE__ */ e.jsx(Il, {})
3439
+ /* @__PURE__ */ e.jsx(Dl, {})
3422
3440
  ] }),
3423
- a ? I() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
3424
- o && /* @__PURE__ */ e.jsx(Tl, {}),
3425
- (c == null ? void 0 : c.records) && (c == null ? void 0 : c.records.length) > 0 && /* @__PURE__ */ e.jsx(Cl, { data: (c == null ? void 0 : c.records) || [] }),
3441
+ a ? T() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
3442
+ i && /* @__PURE__ */ e.jsx(Tl, {}),
3443
+ (d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && /* @__PURE__ */ e.jsx(Nl, { data: (d == null ? void 0 : d.records) || [] }),
3426
3444
  l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
3427
3445
  ] })
3428
3446
  ] });
3429
3447
  }
3430
3448
  function Tl() {
3431
- const s = d((a) => a.pythonStdOut);
3449
+ const s = u((a) => a.pythonStdOut);
3432
3450
  if (!s)
3433
3451
  return null;
3434
3452
  const t = s.replace(/\n/g, "<br>");
@@ -3444,12 +3462,12 @@ function Tl() {
3444
3462
  /* @__PURE__ */ e.jsx(de, { className: "mb-2" })
3445
3463
  ] });
3446
3464
  }
3447
- function Il() {
3448
- const s = d((a) => a.isShowingVisual), t = d(
3465
+ function Dl() {
3466
+ const s = u((a) => a.isShowingVisual), t = u(
3449
3467
  (a) => a.actions.setIsShowingVisual
3450
3468
  );
3451
3469
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3452
- /* @__PURE__ */ e.jsx(_, { htmlFor: "visualize", children: "Chart" }),
3470
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
3453
3471
  /* @__PURE__ */ e.jsx(
3454
3472
  Zt,
3455
3473
  {
@@ -3461,7 +3479,7 @@ function Il() {
3461
3479
  )
3462
3480
  ] });
3463
3481
  }
3464
- function Dl({
3482
+ function Ml({
3465
3483
  options: s,
3466
3484
  value: t,
3467
3485
  onValueChange: a
@@ -3474,7 +3492,7 @@ function Dl({
3474
3492
  className: "flex gap-4",
3475
3493
  defaultValue: s[0].value,
3476
3494
  children: s.map((n) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3477
- /* @__PURE__ */ e.jsx(Ie, { value: n.value, id: n.value }),
3495
+ /* @__PURE__ */ e.jsx(Te, { value: n.value, id: n.value }),
3478
3496
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: n.value, children: n.label })
3479
3497
  ] }, n.value))
3480
3498
  }
@@ -3497,11 +3515,11 @@ function pe({
3497
3515
  ),
3498
3516
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
3499
3517
  /* @__PURE__ */ e.jsx(ye, { children: s }),
3500
- t.map((o) => /* @__PURE__ */ e.jsx(Q, { value: o.value, children: o.label }, o.value))
3518
+ t.map((i) => /* @__PURE__ */ e.jsx(Q, { value: i.value, children: i.label }, i.value))
3501
3519
  ] }) })
3502
3520
  ] });
3503
3521
  }
3504
- function Je({
3522
+ function Qe({
3505
3523
  children: s,
3506
3524
  summary: t,
3507
3525
  open: a,
@@ -3514,7 +3532,7 @@ function Je({
3514
3532
  className: W("space-y-4 [&_summary>svg]:open:-rotate-180", n),
3515
3533
  children: [
3516
3534
  /* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
3517
- /* @__PURE__ */ e.jsx(_, { children: t }),
3535
+ /* @__PURE__ */ e.jsx(H, { children: t }),
3518
3536
  /* @__PURE__ */ e.jsx(en, { className: "h-4 w-4" })
3519
3537
  ] }),
3520
3538
  /* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
@@ -3522,16 +3540,16 @@ function Je({
3522
3540
  }
3523
3541
  );
3524
3542
  }
3525
- function Ml() {
3543
+ function Ll() {
3526
3544
  var j, D;
3527
- const s = d(
3545
+ const s = u(
3528
3546
  (C) => C.card.customCardPreferences
3529
- ), { data: t } = Za(), a = (t == null ? void 0 : t.plugins) || [], n = d((C) => C.card), l = d((C) => C.frame), o = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = ce(), { components: u, manifest: i } = va(
3547
+ ), { data: t } = Za(), a = (t == null ? void 0 : t.plugins) || [], n = u((C) => C.card), l = u((C) => C.frame), i = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = ce(), { components: c, manifest: o } = va(
3530
3548
  (s == null ? void 0 : s.url) || ""
3531
- ), x = (j = i == null ? void 0 : i.visuals) == null ? void 0 : j.find(
3549
+ ), x = (j = o == null ? void 0 : o.visuals) == null ? void 0 : j.find(
3532
3550
  (C) => C.name === (s == null ? void 0 : s.componentName)
3533
3551
  );
3534
- function c(C, L) {
3552
+ function d(C, L) {
3535
3553
  if (!s)
3536
3554
  return;
3537
3555
  const O = {
@@ -3547,15 +3565,15 @@ function Ml() {
3547
3565
  });
3548
3566
  }
3549
3567
  function y(C) {
3550
- var T, O;
3551
- const L = (T = l == null ? void 0 : l.cards) == null ? void 0 : T.filter((N) => {
3552
- var I;
3553
- return ((I = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : I.visualType) !== "multiple";
3568
+ var I, O;
3569
+ const L = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((N) => {
3570
+ var T;
3571
+ return ((T = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : T.visualType) !== "multiple";
3554
3572
  }).map((N) => ({
3555
3573
  value: N.id,
3556
3574
  label: N.tabTitle || N.title
3557
3575
  }));
3558
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (O = C == null ? void 0 : C.dataInputs) == null ? void 0 : O.map((N, I) => {
3576
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (O = C == null ? void 0 : C.dataInputs) == null ? void 0 : O.map((N, T) => {
3559
3577
  var A, h;
3560
3578
  return /* @__PURE__ */ e.jsxs(
3561
3579
  "div",
@@ -3569,29 +3587,29 @@ function Ml() {
3569
3587
  className: "col-span-6 h-8 w-full justify-between",
3570
3588
  label: "",
3571
3589
  options: L || [],
3572
- value: ((h = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[I]) == null ? void 0 : h.cardId) || "",
3573
- onValueChange: (v) => c(I, v)
3590
+ value: ((h = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[T]) == null ? void 0 : h.cardId) || "",
3591
+ onValueChange: (v) => d(T, v)
3574
3592
  }
3575
3593
  )
3576
3594
  ]
3577
3595
  },
3578
- I + Math.random()
3596
+ T + Math.random()
3579
3597
  );
3580
3598
  }) });
3581
3599
  }
3582
- function f(C, L, T = []) {
3600
+ function f(C, L, I = []) {
3583
3601
  var O, N;
3584
3602
  return s ? C === "input" ? /* @__PURE__ */ e.jsx(
3585
3603
  re,
3586
3604
  {
3587
3605
  className: `h-8 w-full ${Ge}`,
3588
3606
  value: ((O = s == null ? void 0 : s.settings) == null ? void 0 : O[L]) || "",
3589
- onChange: (I) => {
3607
+ onChange: (T) => {
3590
3608
  r({
3591
3609
  ...s,
3592
3610
  settings: {
3593
3611
  ...s == null ? void 0 : s.settings,
3594
- [L]: I.target.value
3612
+ [L]: T.target.value
3595
3613
  }
3596
3614
  });
3597
3615
  }
@@ -3602,12 +3620,12 @@ function Ml() {
3602
3620
  {
3603
3621
  className: "h-8 w-full",
3604
3622
  label: "",
3605
- options: T,
3623
+ options: I,
3606
3624
  value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[L]) || "",
3607
- onValueChange: (I) => {
3625
+ onValueChange: (T) => {
3608
3626
  r({
3609
3627
  ...s,
3610
- settings: { ...s == null ? void 0 : s.settings, [L]: I }
3628
+ settings: { ...s == null ? void 0 : s.settings, [L]: T }
3611
3629
  });
3612
3630
  }
3613
3631
  }
@@ -3615,14 +3633,14 @@ function Ml() {
3615
3633
  }
3616
3634
  function m(C) {
3617
3635
  const L = Object.entries((C == null ? void 0 : C.settings) || {});
3618
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: L.map(([T, O]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3619
- /* @__PURE__ */ e.jsx(_, { children: O.title }),
3636
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: L.map(([I, O]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3637
+ /* @__PURE__ */ e.jsx(H, { children: O.title }),
3620
3638
  f(
3621
3639
  O.ui,
3622
- T,
3640
+ I,
3623
3641
  O.options
3624
3642
  )
3625
- ] }, T)) });
3643
+ ] }, I)) });
3626
3644
  }
3627
3645
  function g(C) {
3628
3646
  s && r({
@@ -3636,7 +3654,7 @@ function Ml() {
3636
3654
  {
3637
3655
  className: "p-6",
3638
3656
  children: [
3639
- /* @__PURE__ */ e.jsx(Je, { 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: [
3657
+ /* @__PURE__ */ e.jsx(Qe, { 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: [
3640
3658
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
3641
3659
  pe,
3642
3660
  {
@@ -3654,25 +3672,25 @@ function Ml() {
3654
3672
  }
3655
3673
  ) }) }),
3656
3674
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
3657
- Dl,
3675
+ Ml,
3658
3676
  {
3659
3677
  options: [
3660
3678
  { value: "single", label: "Single Visual" },
3661
3679
  { value: "multiple", label: "Multi-Visual" }
3662
3680
  ],
3663
- value: o,
3681
+ value: i,
3664
3682
  onValueChange: g
3665
3683
  }
3666
3684
  ),
3667
3685
  ((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: [
3668
- /* @__PURE__ */ e.jsx(_, { children: "Component" }),
3669
- /* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: u && /* @__PURE__ */ e.jsx(
3686
+ /* @__PURE__ */ e.jsx(H, { children: "Component" }),
3687
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: c && /* @__PURE__ */ e.jsx(
3670
3688
  pe,
3671
3689
  {
3672
3690
  className: "h-8 w-full",
3673
3691
  label: "",
3674
- options: (u == null ? void 0 : u.filter(
3675
- (C) => C.type === o
3692
+ options: (c == null ? void 0 : c.filter(
3693
+ (C) => C.type === i
3676
3694
  ).map((C) => ({
3677
3695
  value: C.name,
3678
3696
  label: C.name
@@ -3689,9 +3707,9 @@ function Ml() {
3689
3707
  ] }) })
3690
3708
  ] }) }) }),
3691
3709
  /* @__PURE__ */ e.jsx(de, { className: "my-4" }),
3692
- ((D = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : D.componentName) && /* @__PURE__ */ e.jsxs(Je, { summary: "Component Settings", children: [
3710
+ ((D = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : D.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
3693
3711
  x && x.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3694
- /* @__PURE__ */ e.jsx(_, { children: "Input Mapping" }),
3712
+ /* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
3695
3713
  /* @__PURE__ */ e.jsx("div", { className: "px-2", children: y(x) })
3696
3714
  ] }),
3697
3715
  x && x.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: m(x) }) })
@@ -3702,68 +3720,68 @@ function Ml() {
3702
3720
  }
3703
3721
  function Me() {
3704
3722
  const [s, t] = R([]);
3705
- d(
3706
- (c) => c.card.cfg
3723
+ u(
3724
+ (d) => d.card.cfg
3707
3725
  );
3708
- const a = d((c) => c.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: o } = d((c) => c.actions), r = d(
3709
- (c) => c.queryResultColumns
3726
+ const a = u((d) => d.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: i } = u((d) => d.actions), r = u(
3727
+ (d) => d.queryResultColumns
3710
3728
  );
3711
- d(
3712
- (c) => {
3729
+ u(
3730
+ (d) => {
3713
3731
  var y;
3714
- return (y = c.card.preferences) == null ? void 0 : y.filterOnClickColumnIndex;
3732
+ return (y = d.card.preferences) == null ? void 0 : y.filterOnClickColumnIndex;
3715
3733
  }
3716
3734
  ), Z(() => {
3717
3735
  r && t(new Array(r.length).fill(!1));
3718
3736
  }, [r]);
3719
- function u(c, y) {
3737
+ function c(d, y) {
3720
3738
  var f, m;
3721
- y ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ? o({
3739
+ y ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ? i({
3722
3740
  ...a,
3723
3741
  onClickFilter: [
3724
3742
  ...a.onClickFilter,
3725
3743
  {
3726
- columnIndex: c,
3744
+ columnIndex: d,
3727
3745
  expression: ""
3728
3746
  }
3729
3747
  ]
3730
- }) : o({
3748
+ }) : i({
3731
3749
  ...a,
3732
3750
  onClickFilter: [
3733
3751
  {
3734
- columnIndex: c,
3752
+ columnIndex: d,
3735
3753
  expression: ""
3736
3754
  }
3737
3755
  ]
3738
- }) : (o({
3756
+ }) : (i({
3739
3757
  ...a,
3740
3758
  onClickFilter: (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.filter(
3741
- (g) => g.columnIndex !== c
3759
+ (g) => g.columnIndex !== d
3742
3760
  )
3743
3761
  }), t((g) => {
3744
3762
  const j = [...g];
3745
- return j[c] = !1, j;
3763
+ return j[d] = !1, j;
3746
3764
  }));
3747
3765
  }
3748
- function i(c, y) {
3766
+ function o(d, y) {
3749
3767
  var m;
3750
- const f = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.map((g) => g.columnIndex === c ? {
3768
+ const f = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.map((g) => g.columnIndex === d ? {
3751
3769
  ...g,
3752
3770
  expression: y.target.value
3753
3771
  } : g);
3754
- o({
3772
+ i({
3755
3773
  ...a,
3756
3774
  onClickFilter: f
3757
3775
  });
3758
3776
  }
3759
- function x(c) {
3777
+ function x(d) {
3760
3778
  var y, f, m, g;
3761
- if (s != null && s[c] || (f = (y = a == null ? void 0 : a.onClickFilter) == null ? void 0 : y.find((j) => j.columnIndex === c)) != null && f.expression)
3779
+ if (s != null && s[d] || (f = (y = a == null ? void 0 : a.onClickFilter) == null ? void 0 : y.find((j) => j.columnIndex === d)) != null && f.expression)
3762
3780
  return /* @__PURE__ */ e.jsx(
3763
3781
  re,
3764
3782
  {
3765
- value: (g = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find((j) => j.columnIndex === c)) == null ? void 0 : g.expression,
3766
- onChange: (j) => i(c, j),
3783
+ value: (g = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find((j) => j.columnIndex === d)) == null ? void 0 : g.expression,
3784
+ onChange: (j) => o(d, j),
3767
3785
  type: "text",
3768
3786
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3769
3787
  placeholder: "Expression"
@@ -3771,8 +3789,8 @@ function Me() {
3771
3789
  );
3772
3790
  }
3773
3791
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3774
- /* @__PURE__ */ e.jsx(_, { children: "On Click" }),
3775
- r == null ? void 0 : r.map((c, y) => {
3792
+ /* @__PURE__ */ e.jsx(H, { children: "On Click" }),
3793
+ r == null ? void 0 : r.map((d, y) => {
3776
3794
  var f, m;
3777
3795
  return /* @__PURE__ */ e.jsx(
3778
3796
  "div",
@@ -3786,14 +3804,14 @@ function Me() {
3786
3804
  checked: !!((f = a == null ? void 0 : a.onClickFilter) != null && f.find(
3787
3805
  (g) => g.columnIndex === y
3788
3806
  )),
3789
- onCheckedChange: (g) => u(y, g)
3807
+ onCheckedChange: (g) => c(y, g)
3790
3808
  }
3791
3809
  ),
3792
3810
  /* @__PURE__ */ e.jsx(
3793
3811
  "label",
3794
3812
  {
3795
3813
  className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
3796
- children: c
3814
+ children: d
3797
3815
  }
3798
3816
  ),
3799
3817
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find(
@@ -3814,34 +3832,34 @@ function Me() {
3814
3832
  x(y)
3815
3833
  ] })
3816
3834
  },
3817
- c
3835
+ d
3818
3836
  );
3819
3837
  })
3820
3838
  ] });
3821
3839
  }
3822
3840
  function bs() {
3823
- var r, u, i;
3824
- const s = d((x) => x.card.preferences), t = d(
3841
+ var r, c, o;
3842
+ const s = u((x) => x.card.preferences), t = u(
3825
3843
  (x) => x.card.cfg
3826
- ), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = d((x) => x.actions);
3844
+ ), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = u((x) => x.actions);
3827
3845
  (r = t == null ? void 0 : t.options) != null && r.indexAxis;
3828
- function o(x) {
3846
+ function i(x) {
3829
3847
  l(x);
3830
3848
  }
3831
3849
  return /* @__PURE__ */ e.jsxs(
3832
3850
  js,
3833
3851
  {
3834
- value: ((u = s == null ? void 0 : s.chartOptions) == null ? void 0 : u.indexAxis) || ((i = t == null ? void 0 : t.options) == null ? void 0 : i.indexAxis) || "x",
3835
- onValueChange: o,
3852
+ value: ((c = s == null ? void 0 : s.chartOptions) == null ? void 0 : c.indexAxis) || ((o = t == null ? void 0 : t.options) == null ? void 0 : o.indexAxis) || "x",
3853
+ onValueChange: i,
3836
3854
  className: "flex gap-3",
3837
3855
  defaultValue: "x",
3838
3856
  children: [
3839
3857
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3840
- /* @__PURE__ */ e.jsx(Ie, { value: "x", id: "r1" }),
3858
+ /* @__PURE__ */ e.jsx(Te, { value: "x", id: "r1" }),
3841
3859
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
3842
3860
  ] }),
3843
3861
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3844
- /* @__PURE__ */ e.jsx(Ie, { value: "y", id: "r2" }),
3862
+ /* @__PURE__ */ e.jsx(Te, { value: "y", id: "r2" }),
3845
3863
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
3846
3864
  ] })
3847
3865
  ]
@@ -3850,37 +3868,37 @@ function bs() {
3850
3868
  }
3851
3869
  const ns = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
3852
3870
  function ia(s, t) {
3853
- var n, l, o;
3871
+ var n, l, i;
3854
3872
  const a = Oa(s, t);
3855
- return ((o = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : o.type) || "linear";
3873
+ return ((i = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : i.type) || "linear";
3856
3874
  }
3857
3875
  function et() {
3858
- var le, J, ne, w, H, ee;
3859
- const [s, t] = R(!1), a = d((E) => {
3876
+ var le, J, ne, w, _, ee;
3877
+ const [s, t] = R(!1), a = u((E) => {
3860
3878
  var M;
3861
3879
  return (M = E.card) == null ? void 0 : M.preferences;
3862
- }), n = d((E) => {
3880
+ }), n = u((E) => {
3863
3881
  var M;
3864
3882
  return (M = E.card) == null ? void 0 : M.cfg;
3865
- }), l = Oa(a, n), [o, r] = R(
3883
+ }), l = Oa(a, n), [i, r] = R(
3866
3884
  ia(a)
3867
- ), [u, i] = R(
3885
+ ), [c, o] = R(
3868
3886
  ((ne = (J = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : J[l]) == null ? void 0 : ne.min) || ""
3869
- ), [x, c] = R(
3870
- ((ee = (H = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : H[l]) == null ? void 0 : ee.max) || ""
3871
- ), [y, f] = R(u || x ? "custom" : "auto"), [m, g] = R(""), [j, D] = R(0), [C, L] = R(""), [T, O] = R(""), [N, I] = R(""), A = d(
3887
+ ), [x, d] = R(
3888
+ ((ee = (_ = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
3889
+ ), [y, f] = R(c || x ? "custom" : "auto"), [m, g] = R(""), [j, D] = R(0), [C, L] = R(""), [I, O] = R(""), [N, T] = R(""), A = u(
3872
3890
  (E) => E.actions.setCardPreferences
3873
- ), { updateCardInFrame: h } = ce(), v = d((E) => E.card), p = d((E) => {
3891
+ ), { updateCardInFrame: h } = ce(), v = u((E) => E.card), p = u((E) => {
3874
3892
  var M;
3875
3893
  return (M = E.card) == null ? void 0 : M.type;
3876
3894
  }), k = ["pie", "doughnut", "polarArea"].includes(p);
3877
3895
  Z(() => {
3878
3896
  var E, M, se, P, X, ie, Ce, Le, Ne, Fe, Se, ae, ue, he;
3879
- r(ia(a)), i(
3897
+ r(ia(a)), o(
3880
3898
  ((se = (M = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : M[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
3881
- ), c(((ie = (X = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : X[l]) == null ? void 0 : ie.max) || ""), g(
3899
+ ), d(((ie = (X = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : X[l]) == null ? void 0 : ie.max) || ""), g(
3882
3900
  ((Fe = (Ne = (Le = (Ce = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ce.scales) == null ? void 0 : Le[l]) == null ? void 0 : Ne.ticks) == null ? void 0 : Fe.stepSize) || ""
3883
- ), D(((Se = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Se.decimalPlaces) || 0), L(((ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ae.suffix) || ""), O(((ue = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ue.currency) || ""), I(((he = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : he.locale) || "");
3901
+ ), D(((Se = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Se.decimalPlaces) || 0), L(((ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ae.suffix) || ""), O(((ue = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ue.currency) || ""), T(((he = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : he.locale) || "");
3884
3902
  }, [s, a, l]);
3885
3903
  function V(E, M) {
3886
3904
  return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(E);
@@ -3892,7 +3910,7 @@ function et() {
3892
3910
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3893
3911
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
3894
3912
  /* @__PURE__ */ e.jsx(
3895
- _,
3913
+ H,
3896
3914
  {
3897
3915
  className: "col-span-2 hover:cursor-pointer hover:underline",
3898
3916
  htmlFor: "currency",
@@ -3909,7 +3927,7 @@ function et() {
3909
3927
  /* @__PURE__ */ e.jsxs(
3910
3928
  fe,
3911
3929
  {
3912
- value: T || "none",
3930
+ value: I || "none",
3913
3931
  onValueChange: (M) => O(M === "none" ? "" : M),
3914
3932
  children: [
3915
3933
  /* @__PURE__ */ e.jsx(ge, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
@@ -3921,7 +3939,7 @@ function et() {
3921
3939
  ]
3922
3940
  }
3923
3941
  ),
3924
- /* @__PURE__ */ e.jsxs(fe, { value: N, onValueChange: (M) => I(M), children: [
3942
+ /* @__PURE__ */ e.jsxs(fe, { value: N, onValueChange: (M) => T(M), children: [
3925
3943
  /* @__PURE__ */ e.jsx(
3926
3944
  ge,
3927
3945
  {
@@ -3936,7 +3954,7 @@ function et() {
3936
3954
  ] })
3937
3955
  ] }),
3938
3956
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
3939
- /* @__PURE__ */ e.jsx(_, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
3957
+ /* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
3940
3958
  /* @__PURE__ */ e.jsx(
3941
3959
  re,
3942
3960
  {
@@ -3952,13 +3970,13 @@ function et() {
3952
3970
  function B() {
3953
3971
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3954
3972
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3955
- /* @__PURE__ */ e.jsx(_, { htmlFor: "range", children: "Range" }),
3973
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
3956
3974
  /* @__PURE__ */ e.jsx(
3957
3975
  re,
3958
3976
  {
3959
3977
  id: "min",
3960
- value: u,
3961
- onChange: (E) => i((M) => V(M, E.target.value)),
3978
+ value: c,
3979
+ onChange: (E) => o((M) => V(M, E.target.value)),
3962
3980
  className: `col-span-1 h-8 w-full ${ns}`
3963
3981
  }
3964
3982
  ),
@@ -3966,14 +3984,14 @@ function et() {
3966
3984
  re,
3967
3985
  {
3968
3986
  value: x,
3969
- onChange: (E) => c((M) => V(M, E.target.value)),
3987
+ onChange: (E) => d((M) => V(M, E.target.value)),
3970
3988
  id: "max",
3971
3989
  className: `col-span-1 h-8 w-full ${ns}`
3972
3990
  }
3973
3991
  )
3974
3992
  ] }),
3975
3993
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3976
- /* @__PURE__ */ e.jsx(_, { htmlFor: "step-size", children: "Step Size" }),
3994
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "step-size", children: "Step Size" }),
3977
3995
  /* @__PURE__ */ e.jsx(
3978
3996
  re,
3979
3997
  {
@@ -3990,7 +4008,7 @@ function et() {
3990
4008
  var P;
3991
4009
  let E = {};
3992
4010
  y === "custom" && (E = {
3993
- min: u,
4011
+ min: c,
3994
4012
  max: x,
3995
4013
  ticks: {
3996
4014
  stepSize: m
@@ -4004,15 +4022,15 @@ function et() {
4004
4022
  ...(P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales,
4005
4023
  [l]: {
4006
4024
  // ...cardPreferences?.chartOptions?.scales?.[axis],
4007
- type: o,
4008
- ...o === "linear" ? E : {}
4025
+ type: i,
4026
+ ...i === "linear" ? E : {}
4009
4027
  }
4010
4028
  }
4011
4029
  },
4012
4030
  numberAxisFormat: {
4013
4031
  decimalPlaces: j,
4014
4032
  suffix: C,
4015
- currency: T,
4033
+ currency: I,
4016
4034
  locale: N
4017
4035
  }
4018
4036
  };
@@ -4032,12 +4050,12 @@ function et() {
4032
4050
  ] }),
4033
4051
  /* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
4034
4052
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
4035
- /* @__PURE__ */ e.jsx(_, { htmlFor: "scale", children: "Type" }),
4053
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "scale", children: "Type" }),
4036
4054
  /* @__PURE__ */ e.jsxs(
4037
4055
  fe,
4038
4056
  {
4039
4057
  disabled: k,
4040
- value: o,
4058
+ value: i,
4041
4059
  onValueChange: (E) => r(E),
4042
4060
  children: [
4043
4061
  /* @__PURE__ */ e.jsx(ge, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
@@ -4050,8 +4068,8 @@ function et() {
4050
4068
  }
4051
4069
  )
4052
4070
  ] }),
4053
- o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
4054
- /* @__PURE__ */ e.jsx(_, { htmlFor: "scale-option", children: "Setup" }),
4071
+ i == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
4072
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
4055
4073
  /* @__PURE__ */ e.jsxs(
4056
4074
  js,
4057
4075
  {
@@ -4063,18 +4081,18 @@ function et() {
4063
4081
  defaultValue: "x",
4064
4082
  children: [
4065
4083
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4066
- /* @__PURE__ */ e.jsx(Ie, { value: "auto", id: "r1" }),
4084
+ /* @__PURE__ */ e.jsx(Te, { value: "auto", id: "r1" }),
4067
4085
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
4068
4086
  ] }),
4069
4087
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4070
- /* @__PURE__ */ e.jsx(Ie, { value: "custom", id: "r2" }),
4088
+ /* @__PURE__ */ e.jsx(Te, { value: "custom", id: "r2" }),
4071
4089
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
4072
4090
  ] })
4073
4091
  ]
4074
4092
  }
4075
4093
  )
4076
4094
  ] }),
4077
- y === "custom" && o == "linear" && B(),
4095
+ y === "custom" && i == "linear" && B(),
4078
4096
  $(),
4079
4097
  /* @__PURE__ */ e.jsx(an, {}),
4080
4098
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
@@ -4090,41 +4108,41 @@ function et() {
4090
4108
  ] }) })
4091
4109
  ] });
4092
4110
  }
4093
- function Ll({ idx: s }) {
4094
- var u;
4095
- const t = d((i) => {
4111
+ function El({ idx: s }) {
4112
+ var c;
4113
+ const t = u((o) => {
4096
4114
  var x;
4097
- return (x = i.card) == null ? void 0 : x.preferences;
4098
- }), a = d(
4099
- (i) => {
4115
+ return (x = o.card) == null ? void 0 : x.preferences;
4116
+ }), a = u(
4117
+ (o) => {
4100
4118
  var x;
4101
- return (x = i.card.preferences) == null ? void 0 : x.datasetOptions;
4119
+ return (x = o.card.preferences) == null ? void 0 : x.datasetOptions;
4102
4120
  }
4103
- ), n = d(
4104
- (i) => i.actions.setCardPreferences
4105
- ), l = (u = t == null ? void 0 : t.chartOptions) == null ? void 0 : u.indexAxis, o = a == null ? void 0 : a.find((i) => i.idx === s);
4106
- function r(i, x) {
4107
- (i === "end" || i === "start") && tn(nn());
4108
- const c = {
4109
- display: i !== "none",
4110
- align: i,
4111
- anchor: i,
4121
+ ), n = u(
4122
+ (o) => o.actions.setCardPreferences
4123
+ ), l = (c = t == null ? void 0 : t.chartOptions) == null ? void 0 : c.indexAxis, i = a == null ? void 0 : a.find((o) => o.idx === s);
4124
+ function r(o, x) {
4125
+ (o === "end" || o === "start") && tn(nn());
4126
+ const d = {
4127
+ display: o !== "none",
4128
+ align: o,
4129
+ anchor: o,
4112
4130
  clamp: !0
4113
4131
  };
4114
- if (!o)
4132
+ if (!i)
4115
4133
  n({
4116
4134
  ...t,
4117
4135
  datasetOptions: [
4118
4136
  ...a || [],
4119
4137
  {
4120
4138
  idx: x,
4121
- datalabels: c
4139
+ datalabels: d
4122
4140
  }
4123
4141
  ]
4124
4142
  });
4125
4143
  else {
4126
- const y = { ...o };
4127
- y.datalabels = c;
4144
+ const y = { ...i };
4145
+ y.datalabels = d;
4128
4146
  const f = a == null ? void 0 : a.map(
4129
4147
  (m) => m.idx === x ? y : m
4130
4148
  );
@@ -4135,7 +4153,7 @@ function Ll({ idx: s }) {
4135
4153
  }
4136
4154
  }
4137
4155
  return /* @__PURE__ */ e.jsxs(ps, { children: [
4138
- /* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Qn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4156
+ /* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Jn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4139
4157
  /* @__PURE__ */ e.jsx(gs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4140
4158
  /* @__PURE__ */ e.jsx(
4141
4159
  F,
@@ -4202,70 +4220,70 @@ function Ll({ idx: s }) {
4202
4220
  ] });
4203
4221
  }
4204
4222
  function st() {
4205
- const s = d((x) => x.card), t = d(
4223
+ const s = u((x) => x.card), t = u(
4206
4224
  (x) => {
4207
- var c, y, f;
4208
- return (f = (y = (c = x == null ? void 0 : x.card) == null ? void 0 : c.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : f.indexAxis;
4225
+ var d, y, f;
4226
+ return (f = (y = (d = x == null ? void 0 : x.card) == null ? void 0 : d.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : f.indexAxis;
4209
4227
  }
4210
4228
  ), { data: a } = qe(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
4211
- keys: o,
4229
+ keys: i,
4212
4230
  metricKeys: r,
4213
- dimensionKeys: u
4231
+ dimensionKeys: c
4214
4232
  } = Ss((a == null ? void 0 : a.records) || []);
4215
- let i = r;
4233
+ let o = r;
4216
4234
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4217
4235
  const x = ln({
4218
4236
  dataArray: (a == null ? void 0 : a.records) || [],
4219
- groupKey: u[0],
4220
- pivotKey: u[1],
4221
- valueKey: i[0]
4222
- }), { metricKeys: c } = Ss(x);
4223
- i = c;
4237
+ groupKey: c[0],
4238
+ pivotKey: c[1],
4239
+ valueKey: o[0]
4240
+ }), { metricKeys: d } = Ss(x);
4241
+ o = d;
4224
4242
  }
4225
- return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4243
+ return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4226
4244
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4227
- /* @__PURE__ */ e.jsx(_, { children: n }),
4228
- /* @__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: u[0] }) }) })
4245
+ /* @__PURE__ */ e.jsx(H, { children: n }),
4246
+ /* @__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: c[0] }) }) })
4229
4247
  ] }),
4230
4248
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4231
4249
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
4232
- /* @__PURE__ */ e.jsx(_, { children: l }),
4250
+ /* @__PURE__ */ e.jsx(H, { children: l }),
4233
4251
  /* @__PURE__ */ e.jsx(et, {})
4234
4252
  ] }),
4235
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: i.map((x, c) => /* @__PURE__ */ e.jsx(El, { col: x, idx: c }, x)) })
4253
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: o.map((x, d) => /* @__PURE__ */ e.jsx(Al, { col: x, idx: d }, x)) })
4236
4254
  ] })
4237
4255
  ] });
4238
4256
  }
4239
- function El({ col: s, idx: t }) {
4240
- const a = d((u) => {
4241
- var i;
4242
- return (i = u.card) == null ? void 0 : i.preferences;
4243
- }), n = d(
4244
- (u) => {
4245
- var i;
4246
- return (i = u.card.preferences) == null ? void 0 : i.datasetOptions;
4257
+ function Al({ col: s, idx: t }) {
4258
+ const a = u((c) => {
4259
+ var o;
4260
+ return (o = c.card) == null ? void 0 : o.preferences;
4261
+ }), n = u(
4262
+ (c) => {
4263
+ var o;
4264
+ return (o = c.card.preferences) == null ? void 0 : o.datasetOptions;
4247
4265
  }
4248
- ), l = n == null ? void 0 : n.find((u) => u.idx === t), { setCardPreferences: o } = d((u) => u.actions);
4249
- function r(u) {
4266
+ ), l = n == null ? void 0 : n.find((c) => c.idx === t), { setCardPreferences: i } = u((c) => c.actions);
4267
+ function r(c) {
4250
4268
  if (!l)
4251
- o({
4269
+ i({
4252
4270
  ...a,
4253
4271
  datasetOptions: [
4254
4272
  ...n || [],
4255
4273
  {
4256
4274
  idx: t,
4257
- type: u === "area" ? "line" : u,
4258
- fill: u === "area" ? "origin" : ""
4275
+ type: c === "area" ? "line" : c,
4276
+ fill: c === "area" ? "origin" : ""
4259
4277
  }
4260
4278
  ]
4261
4279
  });
4262
4280
  else {
4263
- const i = { ...l };
4264
- i.type = u === "area" ? "line" : u, i.fill = u === "area" ? "origin" : "";
4281
+ const o = { ...l };
4282
+ o.type = c === "area" ? "line" : c, o.fill = c === "area" ? "origin" : "";
4265
4283
  const x = n == null ? void 0 : n.map(
4266
- (c) => c.idx === t ? i : c
4284
+ (d) => d.idx === t ? o : d
4267
4285
  );
4268
- o({
4286
+ i({
4269
4287
  ...a,
4270
4288
  datasetOptions: x
4271
4289
  });
@@ -4302,37 +4320,37 @@ function El({ col: s, idx: t }) {
4302
4320
  className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
4303
4321
  }
4304
4322
  ),
4305
- /* @__PURE__ */ e.jsx(Ll, { idx: t })
4323
+ /* @__PURE__ */ e.jsx(El, { idx: t })
4306
4324
  ] })
4307
4325
  ] });
4308
4326
  }
4309
4327
  function at() {
4310
- const s = d((f) => f.selectedConnectionId), t = d((f) => f.selectedDatamodelId), a = d((f) => f.selectedDatabaseName), n = d((f) => f.selectedSchemaName), l = d((f) => f.selectedTableName), o = z((f) => f.dashboard.filters) || [], r = z((f) => f.actions.addFilter), u = z((f) => f.actions.removeFilter), i = z(
4328
+ const s = u((f) => f.selectedConnectionId), t = u((f) => f.selectedDatamodelId), a = u((f) => f.selectedDatabaseName), n = u((f) => f.selectedSchemaName), l = u((f) => f.selectedTableName), i = z((f) => f.dashboard.filters) || [], r = z((f) => f.actions.addFilter), c = z((f) => f.actions.removeFilter), o = z(
4311
4329
  (f) => f.actions.removeFilterValue
4312
- ), { modelItems: x, tableName: c } = Re();
4330
+ ), { modelItems: x, tableName: d } = Re();
4313
4331
  function y(f, m = "dashboard") {
4314
- var I;
4315
- const g = xe(f.column_name), j = xe(a || ""), D = xe(n || ""), C = xe(c);
4332
+ var T;
4333
+ const g = xe(f.column_name), j = xe(a || ""), D = xe(n || ""), C = xe(d);
4316
4334
  let L = ja(
4317
4335
  D,
4318
4336
  C
4319
- ), T = `${L}.${g}`;
4320
- const O = (I = x == null ? void 0 : x.find(
4337
+ ), I = `${L}.${g}`;
4338
+ const O = (T = x == null ? void 0 : x.find(
4321
4339
  (A) => A.id === t
4322
- )) == null ? void 0 : I.name;
4323
- t && t !== "none" && (T = `${Ns}.${O}.${g}`, L = `${Ns}.${O}`);
4324
- const N = o == null ? void 0 : o.find(
4325
- (A) => A.column === T && A.table === C && (A.database === j || A.database === a)
4340
+ )) == null ? void 0 : T.name;
4341
+ t && t !== "none" && (I = `${Ns}.${O}.${g}`, L = `${Ns}.${O}`);
4342
+ const N = i == null ? void 0 : i.find(
4343
+ (A) => A.column === I && A.table === C && (A.database === j || A.database === a)
4326
4344
  );
4327
4345
  if (N)
4328
- i(N.id), u(N.id);
4346
+ o(N.id), c(N.id);
4329
4347
  else {
4330
4348
  const A = We();
4331
- return c === "api" && s ? (r({
4349
+ return d === "api" && s ? (r({
4332
4350
  location: m,
4333
4351
  id: A,
4334
4352
  //uuidv4(),
4335
- column: T,
4353
+ column: I,
4336
4354
  title: f.column_name,
4337
4355
  dataType: f.data_type,
4338
4356
  table: "api",
@@ -4350,7 +4368,7 @@ function at() {
4350
4368
  id: A,
4351
4369
  //uuidv4(),
4352
4370
  location: m,
4353
- column: T,
4371
+ column: I,
4354
4372
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
4355
4373
  title: f.column_name,
4356
4374
  dataType: f.data_type,
@@ -4371,25 +4389,25 @@ function at() {
4371
4389
  }
4372
4390
  function _e() {
4373
4391
  const s = z(
4374
- (u) => u.dashboard.filters
4375
- ), t = d((u) => u.frame), { setFrame: a } = ce(), { columns: n } = Re(), { assignFilter: l } = at();
4376
- function o(u) {
4377
- const i = l(u, "frame");
4378
- a({ ...t, filterId: i });
4392
+ (c) => c.dashboard.filters
4393
+ ), t = u((c) => c.frame), { setFrame: a } = ce(), { columns: n } = Re(), { assignFilter: l } = at();
4394
+ function i(c) {
4395
+ const o = l(c, "frame");
4396
+ a({ ...t, filterId: o });
4379
4397
  }
4380
- const r = s == null ? void 0 : s.find((u) => u.id === t.filterId);
4398
+ const r = s == null ? void 0 : s.find((c) => c.id === t.filterId);
4381
4399
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4382
- /* @__PURE__ */ e.jsx(_, { children: "Card Filter" }),
4383
- /* @__PURE__ */ e.jsx(Al, { onSelect: o, columns: n }),
4400
+ /* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
4401
+ /* @__PURE__ */ e.jsx(Vl, { onSelect: i, columns: n }),
4384
4402
  r && /* @__PURE__ */ e.jsx(rn, { filter: r })
4385
4403
  ] });
4386
4404
  }
4387
- function Al({
4405
+ function Vl({
4388
4406
  columns: s,
4389
4407
  onSelect: t
4390
4408
  }) {
4391
4409
  var r;
4392
- const [a, n] = ta.useState(!1), [l, o] = ta.useState("");
4410
+ const [a, n] = ta.useState(!1), [l, i] = ta.useState("");
4393
4411
  return /* @__PURE__ */ e.jsxs(ps, { open: a, onOpenChange: n, children: [
4394
4412
  /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
4395
4413
  F,
@@ -4400,7 +4418,7 @@ function Al({
4400
4418
  "aria-expanded": a,
4401
4419
  className: "w-full justify-between font-normal",
4402
4420
  children: [
4403
- l ? (r = s.find((u) => u.column_name === l)) == null ? void 0 : r.column_name : "Select Column...",
4421
+ l ? (r = s.find((c) => c.column_name === l)) == null ? void 0 : r.column_name : "Select Column...",
4404
4422
  /* @__PURE__ */ e.jsx(on, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4405
4423
  ]
4406
4424
  }
@@ -4409,34 +4427,34 @@ function Al({
4409
4427
  /* @__PURE__ */ e.jsx(dn, { placeholder: "Search column", className: "h-9" }),
4410
4428
  /* @__PURE__ */ e.jsxs(un, { children: [
4411
4429
  /* @__PURE__ */ e.jsx(hn, { children: "No framework found." }),
4412
- /* @__PURE__ */ e.jsx(mn, { children: s.map((u) => /* @__PURE__ */ e.jsxs(
4430
+ /* @__PURE__ */ e.jsx(mn, { children: s.map((c) => /* @__PURE__ */ e.jsxs(
4413
4431
  xn,
4414
4432
  {
4415
- value: u.column_name,
4416
- onSelect: (i) => {
4417
- const x = i === l ? "" : i;
4418
- o(x), n(!1), x && t(u);
4433
+ value: c.column_name,
4434
+ onSelect: (o) => {
4435
+ const x = o === l ? "" : o;
4436
+ i(x), n(!1), x && t(c);
4419
4437
  },
4420
4438
  children: [
4421
- u.column_name,
4439
+ c.column_name,
4422
4440
  /* @__PURE__ */ e.jsx(
4423
4441
  ka,
4424
4442
  {
4425
4443
  className: W(
4426
4444
  "ml-auto h-4 w-4",
4427
- l === u.column_name ? "opacity-100" : "opacity-0"
4445
+ l === c.column_name ? "opacity-100" : "opacity-0"
4428
4446
  )
4429
4447
  }
4430
4448
  )
4431
4449
  ]
4432
4450
  },
4433
- u.column_name
4451
+ c.column_name
4434
4452
  )) })
4435
4453
  ] })
4436
4454
  ] }) })
4437
4455
  ] });
4438
4456
  }
4439
- function Vl({
4457
+ function ql({
4440
4458
  cardType: s
4441
4459
  }) {
4442
4460
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
@@ -4481,18 +4499,18 @@ function Vl({
4481
4499
  ] })
4482
4500
  ] }) });
4483
4501
  }
4484
- function Qs() {
4485
- var l, o, r;
4486
- const s = d(
4487
- (u) => u.card.cfg
4488
- ), t = d((u) => u.actions.setCardCfg), a = d((u) => u.card.type);
4489
- function n(u) {
4490
- var c;
4491
- const i = {
4502
+ function Js() {
4503
+ var l, i, r;
4504
+ const s = u(
4505
+ (c) => c.card.cfg
4506
+ ), t = u((c) => c.actions.setCardCfg), a = u((c) => c.card.type);
4507
+ function n(c) {
4508
+ var d;
4509
+ const o = {
4492
4510
  datalabels: {
4493
- display: u !== "none",
4494
- align: u,
4495
- anchor: u,
4511
+ display: c !== "none",
4512
+ align: c,
4513
+ anchor: c,
4496
4514
  clamp: !0
4497
4515
  }
4498
4516
  }, x = {
@@ -4500,12 +4518,12 @@ function Qs() {
4500
4518
  options: {
4501
4519
  ...s == null ? void 0 : s.options,
4502
4520
  plugins: {
4503
- ...(c = s == null ? void 0 : s.options) == null ? void 0 : c.plugins,
4504
- ...i
4521
+ ...(d = s == null ? void 0 : s.options) == null ? void 0 : d.plugins,
4522
+ ...o
4505
4523
  }
4506
4524
  }
4507
4525
  };
4508
- t(x), console.log(u);
4526
+ t(x), console.log(c);
4509
4527
  }
4510
4528
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4511
4529
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
@@ -4515,7 +4533,7 @@ function Qs() {
4515
4533
  /* @__PURE__ */ e.jsxs(
4516
4534
  fe,
4517
4535
  {
4518
- value: (r = (o = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : r.anchor,
4536
+ value: (r = (i = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : i.datalabels) == null ? void 0 : r.anchor,
4519
4537
  onValueChange: n,
4520
4538
  defaultValue: "none",
4521
4539
  children: [
@@ -4532,7 +4550,7 @@ function Qs() {
4532
4550
  )
4533
4551
  ] });
4534
4552
  }
4535
- function ql({
4553
+ function Rl({
4536
4554
  cardType: s
4537
4555
  }) {
4538
4556
  function t(a) {
@@ -4552,7 +4570,7 @@ function ql({
4552
4570
  "a",
4553
4571
  {
4554
4572
  target: "_blank",
4555
- onClick: (o) => o.stopPropagation(),
4573
+ onClick: (i) => i.stopPropagation(),
4556
4574
  className: "text-blue-700",
4557
4575
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
4558
4576
  children: "example"
@@ -4569,7 +4587,7 @@ function ql({
4569
4587
  ] }),
4570
4588
  /* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
4571
4589
  /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
4572
- /* @__PURE__ */ e.jsx(K, { className: "px-2", children: /* @__PURE__ */ e.jsx(Qs, {}) })
4590
+ /* @__PURE__ */ e.jsx(K, { className: "px-2", children: /* @__PURE__ */ e.jsx(Js, {}) })
4573
4591
  ] }),
4574
4592
  /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
4575
4593
  /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
@@ -4580,7 +4598,7 @@ function ql({
4580
4598
  ] })
4581
4599
  ] }) });
4582
4600
  }
4583
- const Rl = {
4601
+ const _l = {
4584
4602
  datasets: [
4585
4603
  {
4586
4604
  type: "line",
@@ -4593,7 +4611,7 @@ const Rl = {
4593
4611
  data: []
4594
4612
  }
4595
4613
  ]
4596
- }, _l = {
4614
+ }, Hl = {
4597
4615
  datasets: [
4598
4616
  {
4599
4617
  fill: "origin",
@@ -4603,8 +4621,8 @@ const Rl = {
4603
4621
  }
4604
4622
  ]
4605
4623
  };
4606
- function Hl() {
4607
- const s = d((t) => t.card.type);
4624
+ function $l() {
4625
+ const s = u((t) => t.card.type);
4608
4626
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4609
4627
  /* @__PURE__ */ e.jsx(
4610
4628
  De,
@@ -4612,18 +4630,18 @@ function Hl() {
4612
4630
  className: " ",
4613
4631
  type: "single",
4614
4632
  collapsible: !0,
4615
- children: $l(s)
4633
+ children: Pl(s)
4616
4634
  }
4617
4635
  ),
4618
4636
  /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(bs, {}) }),
4619
4637
  !["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4620
- /* @__PURE__ */ e.jsx(Qs, {}),
4638
+ /* @__PURE__ */ e.jsx(Js, {}),
4621
4639
  /* @__PURE__ */ e.jsx(Me, {}),
4622
4640
  /* @__PURE__ */ e.jsx(_e, {})
4623
4641
  ] })
4624
4642
  ] });
4625
4643
  }
4626
- function $l(s) {
4644
+ function Pl(s) {
4627
4645
  if (["line", "bar"].includes(s))
4628
4646
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4629
4647
  /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
@@ -4644,7 +4662,7 @@ function $l(s) {
4644
4662
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
4645
4663
  " and change the `type` property in the dataset."
4646
4664
  ] }),
4647
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Rl, null, 2) })
4665
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(_l, null, 2) })
4648
4666
  ] })
4649
4667
  ] }),
4650
4668
  /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
@@ -4665,7 +4683,7 @@ function $l(s) {
4665
4683
  ),
4666
4684
  "for more options."
4667
4685
  ] }),
4668
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(_l, null, 2) })
4686
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Hl, null, 2) })
4669
4687
  ] })
4670
4688
  ] })
4671
4689
  ] });
@@ -4720,47 +4738,47 @@ function $l(s) {
4720
4738
  ] })
4721
4739
  ] }) });
4722
4740
  }
4723
- function Pl() {
4724
- var i, x, c, y, f;
4725
- const s = d((m) => m.card.preferences), t = d(
4741
+ function Bl() {
4742
+ var o, x, d, y, f;
4743
+ const s = u((m) => m.card.preferences), t = u(
4726
4744
  (m) => m.actions.setCardPreferences
4727
- ), a = d(
4745
+ ), a = u(
4728
4746
  (m) => m.actions.setNumberFormat
4729
4747
  );
4730
- d(
4748
+ u(
4731
4749
  (m) => {
4732
4750
  var g, j;
4733
4751
  return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.decimalPlaces;
4734
4752
  }
4735
4753
  );
4736
- const n = d(
4754
+ const n = u(
4737
4755
  (m) => {
4738
4756
  var g, j;
4739
4757
  return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.locale;
4740
4758
  }
4741
- ), l = d(
4759
+ ), l = u(
4742
4760
  (m) => {
4743
4761
  var g, j;
4744
4762
  return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.currency;
4745
4763
  }
4746
4764
  );
4747
- d(
4765
+ u(
4748
4766
  (m) => m.actions.setFilterOnClickField
4749
4767
  );
4750
- const o = d(
4768
+ const i = u(
4751
4769
  (m) => {
4752
4770
  var g, j;
4753
4771
  return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.colorRanges;
4754
4772
  }
4755
- ) || [], r = d(
4773
+ ) || [], r = u(
4756
4774
  (m) => m.actions.setColorRanges
4757
- ), u = [...new Set(cs.map((m) => m.currency))];
4775
+ ), c = [...new Set(cs.map((m) => m.currency))];
4758
4776
  return /* @__PURE__ */ e.jsxs("div", { children: [
4759
4777
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
4760
4778
  /* @__PURE__ */ e.jsx(
4761
4779
  ms,
4762
4780
  {
4763
- checked: !!((i = s == null ? void 0 : s.formatNumber) != null && i.enabled),
4781
+ checked: !!((o = s == null ? void 0 : s.formatNumber) != null && o.enabled),
4764
4782
  onCheckedChange: (m) => {
4765
4783
  t({
4766
4784
  ...s,
@@ -4772,23 +4790,23 @@ function Pl() {
4772
4790
  }
4773
4791
  }
4774
4792
  ),
4775
- /* @__PURE__ */ e.jsx(_, { children: "Format Number" })
4793
+ /* @__PURE__ */ e.jsx(H, { children: "Format Number" })
4776
4794
  ] }),
4777
4795
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4778
4796
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
4779
4797
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4780
4798
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4781
- /* @__PURE__ */ e.jsx(_, { children: "Locale" }),
4799
+ /* @__PURE__ */ e.jsx(H, { children: "Locale" }),
4782
4800
  /* @__PURE__ */ e.jsxs(
4783
4801
  fe,
4784
4802
  {
4785
- value: n || "en-US",
4803
+ value: n || "none",
4786
4804
  onValueChange: (m) => {
4787
4805
  var g, j, D;
4788
4806
  return a(
4789
4807
  ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
4790
4808
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
4791
- m || "en-US",
4809
+ m,
4792
4810
  ((D = s == null ? void 0 : s.formatNumber) == null ? void 0 : D.suffix) || ""
4793
4811
  );
4794
4812
  },
@@ -4796,6 +4814,7 @@ function Pl() {
4796
4814
  /* @__PURE__ */ e.jsx(ge, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
4797
4815
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
4798
4816
  /* @__PURE__ */ e.jsx(ye, { children: "Format" }),
4817
+ /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
4799
4818
  cs.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m.locale, children: m.locale }, m.locale))
4800
4819
  ] }) })
4801
4820
  ]
@@ -4803,14 +4822,14 @@ function Pl() {
4803
4822
  )
4804
4823
  ] }),
4805
4824
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4806
- /* @__PURE__ */ e.jsx(_, { children: "Currency" }),
4825
+ /* @__PURE__ */ e.jsx(H, { children: "Currency" }),
4807
4826
  /* @__PURE__ */ e.jsxs(
4808
4827
  fe,
4809
4828
  {
4810
4829
  value: l || "none",
4811
4830
  onValueChange: (m) => {
4812
4831
  var g, j, D;
4813
- return a(
4832
+ console.log("currency", m), a(
4814
4833
  ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
4815
4834
  m === "none" ? "" : m,
4816
4835
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
@@ -4822,7 +4841,7 @@ function Pl() {
4822
4841
  /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(ke, { children: [
4823
4842
  /* @__PURE__ */ e.jsx(ye, { children: "Currency" }),
4824
4843
  /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
4825
- u.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m, children: m }, m))
4844
+ c.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m, children: m }, m))
4826
4845
  ] }) })
4827
4846
  ]
4828
4847
  }
@@ -4831,11 +4850,11 @@ function Pl() {
4831
4850
  ] }),
4832
4851
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
4833
4852
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4834
- /* @__PURE__ */ e.jsx(_, { children: "Decimals" }),
4853
+ /* @__PURE__ */ e.jsx(H, { children: "Decimals" }),
4835
4854
  /* @__PURE__ */ e.jsxs(
4836
4855
  fe,
4837
4856
  {
4838
- value: ((y = (c = s == null ? void 0 : s.formatNumber) == null ? void 0 : c.decimalPlaces) == null ? void 0 : y.toString()) || "0",
4857
+ value: ((y = (d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.decimalPlaces) == null ? void 0 : y.toString()) || "0",
4839
4858
  onValueChange: (m) => {
4840
4859
  var g, j, D;
4841
4860
  return a(
@@ -4853,7 +4872,7 @@ function Pl() {
4853
4872
  )
4854
4873
  ] }),
4855
4874
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4856
- /* @__PURE__ */ e.jsx(_, { children: "Suffix" }),
4875
+ /* @__PURE__ */ e.jsx(H, { children: "Suffix" }),
4857
4876
  /* @__PURE__ */ e.jsx(
4858
4877
  re,
4859
4878
  {
@@ -4878,14 +4897,14 @@ function Pl() {
4878
4897
  /* @__PURE__ */ e.jsx(
4879
4898
  pn,
4880
4899
  {
4881
- colorRanges: o,
4900
+ colorRanges: i,
4882
4901
  setColorRanges: r
4883
4902
  }
4884
4903
  )
4885
4904
  ] })
4886
4905
  ] });
4887
4906
  }
4888
- function Bl() {
4907
+ function Ul() {
4889
4908
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4890
4909
  /* @__PURE__ */ e.jsx(De, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4891
4910
  /* @__PURE__ */ e.jsx(G, { className: "", children: "KPI Query" }),
@@ -4911,12 +4930,12 @@ function Bl() {
4911
4930
  ] })
4912
4931
  ] })
4913
4932
  ] }) }),
4914
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Pl, {}) }),
4933
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Bl, {}) }),
4915
4934
  /* @__PURE__ */ e.jsx("div", {}),
4916
4935
  /* @__PURE__ */ e.jsx("div", {})
4917
4936
  ] });
4918
4937
  }
4919
- const Ul = [
4938
+ const Gl = [
4920
4939
  {
4921
4940
  label: "Mercator",
4922
4941
  value: "mercator"
@@ -4973,7 +4992,7 @@ const Ul = [
4973
4992
  label: "Natural Earth 1",
4974
4993
  value: "naturalEarth1"
4975
4994
  }
4976
- ], Gl = [
4995
+ ], Kl = [
4977
4996
  "blues",
4978
4997
  "brBG",
4979
4998
  "buGn",
@@ -5012,18 +5031,18 @@ const Ul = [
5012
5031
  "ylGnBu",
5013
5032
  "ylOrBr",
5014
5033
  "ylOrRd"
5015
- ], Kl = Gl.map((s) => ({
5034
+ ], Ql = Kl.map((s) => ({
5016
5035
  label: s,
5017
5036
  value: s
5018
5037
  }));
5019
5038
  function Jl() {
5020
- var i, x, c, y, f, m, g, j, D, C, L, T, O, N, I, A, h, v;
5021
- const s = d((p) => p.card), t = (x = (i = s == null ? void 0 : s.preferences) == null ? void 0 : i.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, n] = R(
5022
- ((y = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
5023
- ), { setCardPreferences: l } = ce(), { data: o } = Bs(s), r = Object.keys((o == null ? void 0 : o.objects) || {}).map((p) => ({
5039
+ var o, x, d, y, f, m, g, j, D, C, L, I, O, N, T, A, h, v;
5040
+ const s = u((p) => p.card), t = (x = (o = s == null ? void 0 : s.preferences) == null ? void 0 : o.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, n] = R(
5041
+ ((y = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
5042
+ ), { setCardPreferences: l } = ce(), { data: i } = Bs(s), r = Object.keys((i == null ? void 0 : i.objects) || {}).map((p) => ({
5024
5043
  label: p,
5025
5044
  value: p
5026
- })) || [], u = [
5045
+ })) || [], c = [
5027
5046
  {
5028
5047
  label: "US States 10m",
5029
5048
  value: "https://unpkg.com/us-atlas/states-10m.json"
@@ -5038,14 +5057,14 @@ function Jl() {
5038
5057
  }
5039
5058
  ];
5040
5059
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
5041
- /* @__PURE__ */ e.jsx(Je, { 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" }) }),
5060
+ /* @__PURE__ */ e.jsx(Qe, { 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" }) }),
5042
5061
  /* @__PURE__ */ e.jsx(de, { className: "my-4" }),
5043
- /* @__PURE__ */ e.jsx(Je, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5062
+ /* @__PURE__ */ e.jsx(Qe, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5044
5063
  /* @__PURE__ */ e.jsx(
5045
5064
  pe,
5046
5065
  {
5047
5066
  className: "h-9",
5048
- options: u,
5067
+ options: c,
5049
5068
  onValueChange: (p) => {
5050
5069
  console.log("value", p), l({
5051
5070
  ...s.preferences,
@@ -5080,9 +5099,9 @@ function Jl() {
5080
5099
  placeholder: "Custom URL"
5081
5100
  }
5082
5101
  ),
5083
- o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
5102
+ i && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
5084
5103
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
5085
- /* @__PURE__ */ e.jsx(_, { children: "Map Object" }),
5104
+ /* @__PURE__ */ e.jsx(H, { children: "Map Object" }),
5086
5105
  /* @__PURE__ */ e.jsx(
5087
5106
  pe,
5088
5107
  {
@@ -5104,12 +5123,12 @@ function Jl() {
5104
5123
  )
5105
5124
  ] }),
5106
5125
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
5107
- /* @__PURE__ */ e.jsx(_, { children: "Projection" }),
5126
+ /* @__PURE__ */ e.jsx(H, { children: "Projection" }),
5108
5127
  /* @__PURE__ */ e.jsx(
5109
5128
  pe,
5110
5129
  {
5111
5130
  className: "h-9",
5112
- options: Ul,
5131
+ options: Gl,
5113
5132
  value: ((j = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : j.projection) || "",
5114
5133
  label: "Projection",
5115
5134
  onValueChange: (p) => {
@@ -5126,12 +5145,12 @@ function Jl() {
5126
5145
  )
5127
5146
  ] }),
5128
5147
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
5129
- /* @__PURE__ */ e.jsx(_, { children: "Colors" }),
5148
+ /* @__PURE__ */ e.jsx(H, { children: "Colors" }),
5130
5149
  /* @__PURE__ */ e.jsx(
5131
5150
  pe,
5132
5151
  {
5133
5152
  className: "h-9",
5134
- options: Kl,
5153
+ options: Ql,
5135
5154
  value: ((C = (D = s.preferences) == null ? void 0 : D.mapVisualOptions) == null ? void 0 : C.colorScale) || "",
5136
5155
  label: "Select Color Scale",
5137
5156
  onValueChange: (p) => {
@@ -5150,14 +5169,14 @@ function Jl() {
5150
5169
  ] })
5151
5170
  ] }) }),
5152
5171
  /* @__PURE__ */ e.jsx(de, { className: "my-4" }),
5153
- /* @__PURE__ */ e.jsx(Je, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5172
+ /* @__PURE__ */ e.jsx(Qe, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5154
5173
  /* @__PURE__ */ e.jsx(
5155
5174
  re,
5156
5175
  {
5157
5176
  className: `h-9 w-full ${Ge}`,
5158
5177
  type: "number",
5159
5178
  step: 0.1,
5160
- value: ((T = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : T.projectionScale) || 1,
5179
+ value: ((I = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
5161
5180
  onChange: (p) => {
5162
5181
  var k;
5163
5182
  l({
@@ -5170,14 +5189,14 @@ function Jl() {
5170
5189
  }
5171
5190
  }
5172
5191
  ),
5173
- /* @__PURE__ */ e.jsx(_, { children: "X" }),
5192
+ /* @__PURE__ */ e.jsx(H, { children: "X" }),
5174
5193
  /* @__PURE__ */ e.jsx(
5175
5194
  re,
5176
5195
  {
5177
5196
  className: `h-9 w-full ${Ge}`,
5178
5197
  type: "number",
5179
5198
  step: 10,
5180
- value: ((I = (N = (O = s.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : I[0]) || 0,
5199
+ value: ((T = (N = (O = s.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : T[0]) || 0,
5181
5200
  onChange: (p) => {
5182
5201
  var k, V, $, B;
5183
5202
  l({
@@ -5193,7 +5212,7 @@ function Jl() {
5193
5212
  }
5194
5213
  }
5195
5214
  ),
5196
- /* @__PURE__ */ e.jsx(_, { children: "Y" }),
5215
+ /* @__PURE__ */ e.jsx(H, { children: "Y" }),
5197
5216
  /* @__PURE__ */ e.jsx(
5198
5217
  re,
5199
5218
  {
@@ -5221,9 +5240,9 @@ function Jl() {
5221
5240
  /* @__PURE__ */ e.jsx(Me, {})
5222
5241
  ] });
5223
5242
  }
5224
- function Ql() {
5243
+ function Wl() {
5225
5244
  var n;
5226
- const s = d((l) => l.card.preferences), { setCardPreferences: t } = d((l) => l.actions);
5245
+ const s = u((l) => l.card.preferences), { setCardPreferences: t } = u((l) => l.actions);
5227
5246
  function a(l) {
5228
5247
  t({
5229
5248
  ...s,
@@ -5242,11 +5261,11 @@ function Ql() {
5242
5261
  defaultValue: "x",
5243
5262
  children: [
5244
5263
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5245
- /* @__PURE__ */ e.jsx(Ie, { value: "static", id: "r1" }),
5264
+ /* @__PURE__ */ e.jsx(Te, { value: "static", id: "r1" }),
5246
5265
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
5247
5266
  ] }),
5248
5267
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5249
- /* @__PURE__ */ e.jsx(Ie, { value: "dynamic", id: "r2" }),
5268
+ /* @__PURE__ */ e.jsx(Te, { value: "dynamic", id: "r2" }),
5250
5269
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
5251
5270
  ] })
5252
5271
  ]
@@ -5287,8 +5306,8 @@ function ls({
5287
5306
  /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
5288
5307
  /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
5289
5308
  s === "range" && /* @__PURE__ */ e.jsx(bs, {}),
5290
- s !== "text" && /* @__PURE__ */ e.jsx(Qs, {}),
5291
- s === "text" && /* @__PURE__ */ e.jsx(Ql, {})
5309
+ s !== "text" && /* @__PURE__ */ e.jsx(Js, {}),
5310
+ s === "text" && /* @__PURE__ */ e.jsx(Wl, {})
5292
5311
  ] })
5293
5312
  ] }),
5294
5313
  !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
@@ -5300,16 +5319,16 @@ function ls({
5300
5319
  ] })
5301
5320
  ] }) });
5302
5321
  }
5303
- function Wl() {
5304
- const s = d(
5322
+ function Yl() {
5323
+ const s = u(
5305
5324
  (n) => {
5306
- var l, o;
5307
- return (o = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : o.sortChart;
5325
+ var l, i;
5326
+ return (i = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : i.sortChart;
5308
5327
  }
5309
5328
  ), { setSortChart: t } = ce();
5310
5329
  function a() {
5311
5330
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
5312
- /* @__PURE__ */ e.jsx(_, { children: "Sort" }),
5331
+ /* @__PURE__ */ e.jsx(H, { children: "Sort" }),
5313
5332
  /* @__PURE__ */ e.jsx(
5314
5333
  pe,
5315
5334
  {
@@ -5380,11 +5399,11 @@ function Wl() {
5380
5399
  ] })
5381
5400
  ] }) });
5382
5401
  }
5383
- function Yl({}) {
5384
- const s = d((n) => {
5402
+ function Xl({}) {
5403
+ const s = u((n) => {
5385
5404
  var l;
5386
5405
  return (l = n.card) == null ? void 0 : l.preferences;
5387
- }), t = d(
5406
+ }), t = u(
5388
5407
  (n) => n.actions.setCardPreferences
5389
5408
  ), a = (n) => {
5390
5409
  t({
@@ -5413,7 +5432,7 @@ function Yl({}) {
5413
5432
  ] })
5414
5433
  ] });
5415
5434
  }
5416
- const Xl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5435
+ const Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5417
5436
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
5418
5437
  /* @__PURE__ */ e.jsxs("div", { children: [
5419
5438
  "See ",
@@ -5429,7 +5448,7 @@ const Xl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5429
5448
  ),
5430
5449
  " in the docs."
5431
5450
  ] })
5432
- ] }), Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5451
+ ] }), er = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5433
5452
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
5434
5453
  /* @__PURE__ */ e.jsxs("div", { children: [
5435
5454
  "See ",
@@ -5445,7 +5464,7 @@ const Xl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5445
5464
  ),
5446
5465
  " in the docs."
5447
5466
  ] })
5448
- ] }), er = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5467
+ ] }), sr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5449
5468
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
5450
5469
  /* @__PURE__ */ e.jsxs("div", { children: [
5451
5470
  "See ",
@@ -5462,22 +5481,22 @@ const Xl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5462
5481
  " in the docs."
5463
5482
  ] })
5464
5483
  ] });
5465
- function sr() {
5466
- const s = d((a) => a.card.type);
5484
+ function ar() {
5485
+ const s = u((a) => a.card.type);
5467
5486
  function t(a) {
5468
5487
  switch (a) {
5469
5488
  case "stackedBar":
5470
5489
  case "stackedLine":
5471
- return /* @__PURE__ */ e.jsx(Wl, {});
5490
+ return /* @__PURE__ */ e.jsx(Yl, {});
5472
5491
  case "pyramid":
5473
- return /* @__PURE__ */ e.jsx(ls, { docContent: Xl, cardType: a });
5492
+ return /* @__PURE__ */ e.jsx(ls, { docContent: Zl, cardType: a });
5474
5493
  case "kpi":
5475
- return /* @__PURE__ */ e.jsx(Bl, {});
5494
+ return /* @__PURE__ */ e.jsx(Ul, {});
5476
5495
  case "line":
5477
5496
  case "bar":
5478
- return /* @__PURE__ */ e.jsx(Vl, { cardType: a });
5497
+ return /* @__PURE__ */ e.jsx(ql, { cardType: a });
5479
5498
  case "range":
5480
- return /* @__PURE__ */ e.jsx(ls, { docContent: Zl, cardType: a });
5499
+ return /* @__PURE__ */ e.jsx(ls, { docContent: er, cardType: a });
5481
5500
  case "pie":
5482
5501
  case "doughnut":
5483
5502
  case "polarArea":
@@ -5485,14 +5504,14 @@ function sr() {
5485
5504
  return /* @__PURE__ */ e.jsx(ls, { cardType: a });
5486
5505
  case "bubble":
5487
5506
  case "scatter":
5488
- return /* @__PURE__ */ e.jsx(ql, { cardType: a });
5507
+ return /* @__PURE__ */ e.jsx(Rl, { cardType: a });
5489
5508
  case "table":
5490
- return /* @__PURE__ */ e.jsx(Yl, { cardType: a });
5509
+ return /* @__PURE__ */ e.jsx(Xl, { cardType: a });
5491
5510
  case "text":
5492
5511
  return /* @__PURE__ */ e.jsx(
5493
5512
  ls,
5494
5513
  {
5495
- docContent: er,
5514
+ docContent: sr,
5496
5515
  cardType: a,
5497
5516
  suffix: "Visual"
5498
5517
  }
@@ -5500,15 +5519,15 @@ function sr() {
5500
5519
  case "map":
5501
5520
  return /* @__PURE__ */ e.jsx(Jl, {});
5502
5521
  case "custom":
5503
- return /* @__PURE__ */ e.jsx(Ml, {});
5522
+ return /* @__PURE__ */ e.jsx(Ll, {});
5504
5523
  default:
5505
- return /* @__PURE__ */ e.jsx(Hl, {});
5524
+ return /* @__PURE__ */ e.jsx($l, {});
5506
5525
  }
5507
5526
  }
5508
5527
  return /* @__PURE__ */ e.jsx(Ps, { className: "h-full w-full text-sm", children: t(s) });
5509
5528
  }
5510
- function ar() {
5511
- const s = d((t) => t.isShowingVisual);
5529
+ function tr() {
5530
+ const s = u((t) => t.isShowingVisual);
5512
5531
  return /* @__PURE__ */ e.jsxs(
5513
5532
  ws,
5514
5533
  {
@@ -5522,7 +5541,7 @@ function ar() {
5522
5541
  className: "flex",
5523
5542
  minSize: 20,
5524
5543
  defaultSize: 40,
5525
- children: /* @__PURE__ */ e.jsx(vl, {})
5544
+ children: /* @__PURE__ */ e.jsx(Cl, {})
5526
5545
  }
5527
5546
  ),
5528
5547
  /* @__PURE__ */ e.jsx(ks, { withHandle: !0, className: "border" }),
@@ -5541,7 +5560,7 @@ function ar() {
5541
5560
  minSize: 20,
5542
5561
  defaultSize: 25,
5543
5562
  maxSize: 30,
5544
- children: /* @__PURE__ */ e.jsx(sr, {})
5563
+ children: /* @__PURE__ */ e.jsx(ar, {})
5545
5564
  }
5546
5565
  ) }),
5547
5566
  /* @__PURE__ */ e.jsx(ks, { className: "border" }),
@@ -5553,14 +5572,14 @@ function ar() {
5553
5572
  }
5554
5573
  );
5555
5574
  }
5556
- function tr({ authToken: s, onSave: t, onClose: a }) {
5575
+ function nr({ authToken: s, onSave: t, onClose: a }) {
5557
5576
  z((r) => r.themeStyle);
5558
- const n = d((r) => r.actions.setOnSave), l = d((r) => r.actions.setOnClose), o = z((r) => r.actions.setAuthToken);
5577
+ const n = u((r) => r.actions.setOnSave), l = u((r) => r.actions.setOnClose), i = z((r) => r.actions.setAuthToken);
5559
5578
  return Z(() => {
5560
5579
  t && n(t), a && l(a);
5561
5580
  }, [t, n, a, l]), Z(() => {
5562
- s && s.accessToken && o(s);
5563
- }, [s, o]), /* @__PURE__ */ e.jsx(xs, { FallbackComponent: Fa, children: /* @__PURE__ */ e.jsxs(
5581
+ s && s.accessToken && i(s);
5582
+ }, [s, i]), /* @__PURE__ */ e.jsx(xs, { FallbackComponent: Fa, children: /* @__PURE__ */ e.jsxs(
5564
5583
  fn,
5565
5584
  {
5566
5585
  style: {
@@ -5571,18 +5590,18 @@ function tr({ authToken: s, onSave: t, onClose: a }) {
5571
5590
  role: "editor-panel",
5572
5591
  children: [
5573
5592
  /* @__PURE__ */ e.jsx(gn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(_a, {}) }),
5574
- /* @__PURE__ */ e.jsx(jn, { children: /* @__PURE__ */ e.jsx(ar, {}) })
5593
+ /* @__PURE__ */ e.jsx(jn, { children: /* @__PURE__ */ e.jsx(tr, {}) })
5575
5594
  ]
5576
5595
  }
5577
5596
  ) });
5578
5597
  }
5579
- function nr() {
5598
+ function lr() {
5580
5599
  z((r) => r.selectedCardId);
5581
5600
  const s = z((r) => r.selectedSheetId), { setIsVisualEditing: t } = z((r) => r.actions), a = z((r) => r.isVisualEditing), n = z((r) => r.actions.updateFrame);
5582
5601
  function l(r) {
5583
5602
  s && (n(s, r), t(!1));
5584
5603
  }
5585
- function o() {
5604
+ function i() {
5586
5605
  t(!1);
5587
5606
  }
5588
5607
  return /* @__PURE__ */ e.jsx(
@@ -5592,31 +5611,31 @@ function nr() {
5592
5611
  className: W("flex grow", {
5593
5612
  "max-h-0 overflow-hidden": !a
5594
5613
  }),
5595
- children: /* @__PURE__ */ e.jsx(tr, { onSave: l, onClose: o })
5614
+ children: /* @__PURE__ */ e.jsx(nr, { onSave: l, onClose: i })
5596
5615
  }
5597
5616
  );
5598
5617
  }
5599
- function lr() {
5600
- d((r) => r.selectedConnectionId), d((r) => r.selectedDatamodelId);
5601
- const s = d((r) => r.selectedDatabaseName);
5602
- d((r) => r.selectedSchemaName);
5603
- const t = d((r) => r.selectedTableName), a = z((r) => r.dashboard.filters) || [];
5618
+ function rr() {
5619
+ u((r) => r.selectedConnectionId), u((r) => r.selectedDatamodelId);
5620
+ const s = u((r) => r.selectedDatabaseName);
5621
+ u((r) => r.selectedSchemaName);
5622
+ const t = u((r) => r.selectedTableName), a = z((r) => r.dashboard.filters) || [];
5604
5623
  z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
5605
5624
  (r) => r.actions.removeFilterValue
5606
5625
  );
5607
- const { modelItems: n, columns: l } = Re(), { assignFilter: o } = at();
5626
+ const { modelItems: n, columns: l } = Re(), { assignFilter: i } = at();
5608
5627
  return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((r) => {
5609
- const u = a == null ? void 0 : a.find(
5610
- (i) => i.column === xe(r.column_name) && i.table === t && i.database === s
5628
+ const c = a == null ? void 0 : a.find(
5629
+ (o) => o.column === xe(r.column_name) && o.table === t && o.database === s
5611
5630
  );
5612
5631
  return /* @__PURE__ */ e.jsx(
5613
5632
  "div",
5614
5633
  {
5615
- onClick: () => o(r),
5634
+ onClick: () => i(r),
5616
5635
  className: W(
5617
5636
  "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",
5618
5637
  {
5619
- "bg-muted": u
5638
+ "bg-muted": c
5620
5639
  }
5621
5640
  ),
5622
5641
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -5628,21 +5647,21 @@ function lr() {
5628
5647
  );
5629
5648
  }) });
5630
5649
  }
5631
- function rr() {
5650
+ function ir() {
5632
5651
  z((t) => t.showFilters);
5633
5652
  const s = z(
5634
5653
  (t) => t.actions.setShowFilters
5635
5654
  );
5636
5655
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
5637
5656
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
5638
- /* @__PURE__ */ e.jsx(_, { className: "text-lg", children: "Filters" }),
5657
+ /* @__PURE__ */ e.jsx(H, { className: "text-lg", children: "Filters" }),
5639
5658
  /* @__PURE__ */ e.jsx(
5640
5659
  F,
5641
5660
  {
5642
5661
  onClick: () => s(!1),
5643
5662
  className: "h-7 w-7 p-0",
5644
5663
  variant: "ghost",
5645
- children: /* @__PURE__ */ e.jsx(Qe, {})
5664
+ children: /* @__PURE__ */ e.jsx(Je, {})
5646
5665
  }
5647
5666
  )
5648
5667
  ] }),
@@ -5652,7 +5671,7 @@ function rr() {
5652
5671
  ColumnsComponent: () => (
5653
5672
  // schemaName, tableName, columns
5654
5673
  /* @__PURE__ */ e.jsx(
5655
- lr,
5674
+ rr,
5656
5675
  {}
5657
5676
  )
5658
5677
  )
@@ -5660,7 +5679,7 @@ function rr() {
5660
5679
  ) })
5661
5680
  ] });
5662
5681
  }
5663
- function ir() {
5682
+ function or() {
5664
5683
  const s = z((a) => a.showFilters), t = z((a) => a.isVisualEditing);
5665
5684
  return /* @__PURE__ */ e.jsxs(
5666
5685
  "div",
@@ -5672,12 +5691,12 @@ function ir() {
5672
5691
  }),
5673
5692
  children: [
5674
5693
  /* @__PURE__ */ e.jsx(bn, {}),
5675
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(rr, {}) })
5694
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(ir, {}) })
5676
5695
  ]
5677
5696
  }
5678
5697
  );
5679
5698
  }
5680
- function or() {
5699
+ function cr() {
5681
5700
  const s = z((n) => n.dashboard), t = z((n) => n.actions.setDashboard), a = z(
5682
5701
  (n) => n.showDashboardJSON
5683
5702
  );
@@ -5721,7 +5740,7 @@ function or() {
5721
5740
  }
5722
5741
  );
5723
5742
  }
5724
- function hr({
5743
+ function mr({
5725
5744
  showControls: s = !1,
5726
5745
  showFooter: t = !0,
5727
5746
  ...a
@@ -5729,11 +5748,11 @@ function hr({
5729
5748
  return /* @__PURE__ */ e.jsx(xs, { FallbackComponent: Fa, children: /* @__PURE__ */ e.jsxs(vn, { dashboardProps: a, children: [
5730
5749
  /* @__PURE__ */ e.jsx(Cn, {}),
5731
5750
  /* @__PURE__ */ e.jsxs(Nn, { children: [
5732
- /* @__PURE__ */ e.jsx(or, {}),
5751
+ /* @__PURE__ */ e.jsx(cr, {}),
5733
5752
  /* @__PURE__ */ e.jsxs(Sn, { ...a, children: [
5734
5753
  s && /* @__PURE__ */ e.jsx(nl, {}),
5735
- /* @__PURE__ */ e.jsx(nr, {}),
5736
- /* @__PURE__ */ e.jsx(ir, {})
5754
+ /* @__PURE__ */ e.jsx(lr, {}),
5755
+ /* @__PURE__ */ e.jsx(or, {})
5737
5756
  ] })
5738
5757
  ] })
5739
5758
  ] }) });
@@ -5742,7 +5761,7 @@ export {
5742
5761
  Ue as A,
5743
5762
  kn as B,
5744
5763
  zn as C,
5745
- hr as D,
5764
+ mr as D,
5746
5765
  Ma as E,
5747
5766
  qa as F,
5748
5767
  Ln as G,
@@ -5754,17 +5773,17 @@ export {
5754
5773
  $n as N,
5755
5774
  Aa as P,
5756
5775
  Un as S,
5757
- Qn as T,
5776
+ Jn as T,
5758
5777
  Yn as U,
5759
5778
  Gs as a,
5760
5779
  Ks as b,
5761
- Ta as c,
5762
- Ia as d,
5780
+ Ia as c,
5781
+ Ta as d,
5763
5782
  Da as e,
5764
5783
  On as f,
5765
5784
  Fn as g,
5766
- Tn as h,
5767
- In as i,
5785
+ In as h,
5786
+ Tn as i,
5768
5787
  Mn as j,
5769
5788
  Dn as k,
5770
5789
  An as l,
@@ -5778,8 +5797,8 @@ export {
5778
5797
  Va as t,
5779
5798
  Gn as u,
5780
5799
  Kn as v,
5781
- Jn as w,
5800
+ Qn as w,
5782
5801
  Wn as x,
5783
- Js as y,
5802
+ Qs as y,
5784
5803
  Re as z
5785
5804
  };