react-semaphor 0.0.345 → 0.0.346

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.
@@ -516,7 +516,7 @@ function Ea(s) {
516
516
  var r;
517
517
  return {
518
518
  ...l,
519
- cards: (r = l.cards) == null ? void 0 : r.map((i) => Wn(i))
519
+ cards: (r = l.cards) == null ? void 0 : r.map((o) => Wn(o))
520
520
  };
521
521
  })
522
522
  };
@@ -571,13 +571,13 @@ async function Xn(s, n, a, t) {
571
571
  async function ys(s, n) {
572
572
  if (!n)
573
573
  return null;
574
- const { id: a, template: t, filterValues: l, isDefault: r, shared: i } = s;
574
+ const { id: a, template: t, filterValues: l, isDefault: r, shared: o } = s;
575
575
  return await vs("https://semaphor.cloud/api/v1/lens", n, {
576
576
  lensId: a,
577
577
  template: t,
578
578
  filterValues: l,
579
579
  isDefault: r,
580
- shared: i,
580
+ shared: o,
581
581
  operation: "update"
582
582
  });
583
583
  }
@@ -588,7 +588,7 @@ async function Zn(s, n) {
588
588
  }) : null;
589
589
  }
590
590
  function el() {
591
- const [s, n] = q(""), [a, t] = q(!1), l = M((p) => p.lenses), { setLenses: r, setSelectedLensId: i } = is(), [o, d] = q(!1), [x, c] = q(!1), b = M((p) => p.dashboard), g = M((p) => p.filterValues), { authToken: h } = Se();
591
+ const [s, n] = q(""), [a, t] = q(!1), l = M((p) => p.lenses), { setLenses: r, setSelectedLensId: o } = is(), [i, d] = q(!1), [x, c] = q(!1), b = M((p) => p.dashboard), g = M((p) => p.filterValues), { authToken: h } = Se();
592
592
  async function f() {
593
593
  d(!0);
594
594
  const p = Ea(
@@ -599,7 +599,7 @@ function el() {
599
599
  g,
600
600
  h == null ? void 0 : h.accessToken
601
601
  );
602
- N && (r([...l || [], N]), i(N.id), c(!1)), d(!1);
602
+ N && (r([...l || [], N]), o(N.id), c(!1)), d(!1);
603
603
  }
604
604
  return /* @__PURE__ */ e.jsxs(Cs, { open: x, onOpenChange: c, children: [
605
605
  /* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
@@ -641,20 +641,20 @@ function el() {
641
641
  variant: "outline",
642
642
  type: "submit",
643
643
  onClick: f,
644
- disabled: o,
645
- children: o ? "Creating..." : "Add"
644
+ disabled: i,
645
+ children: i ? "Creating..." : "Add"
646
646
  }
647
647
  ) })
648
648
  ] })
649
649
  ] });
650
650
  }
651
651
  function sl() {
652
- const [s, n] = q(!1), a = M((c) => c.lenses), t = M((c) => c.selectedLensId), { setLenses: l, setSelectedLensId: r } = is(), { authToken: i } = Se();
653
- async function o(c) {
652
+ const [s, n] = q(!1), a = M((c) => c.lenses), t = M((c) => c.selectedLensId), { setLenses: l, setSelectedLensId: r } = is(), { authToken: o } = Se();
653
+ async function i(c) {
654
654
  r(c);
655
655
  }
656
656
  async function d(c) {
657
- if (await Zn(c, i == null ? void 0 : i.accessToken)) {
657
+ if (await Zn(c, o == null ? void 0 : o.accessToken)) {
658
658
  const g = a == null ? void 0 : a.filter((h) => h.id !== c);
659
659
  l(g || []), r("original");
660
660
  }
@@ -672,14 +672,14 @@ function sl() {
672
672
  ...c,
673
673
  isDefault: !c.isDefault
674
674
  };
675
- await ys(g, i == null ? void 0 : i.accessToken);
675
+ await ys(g, o == null ? void 0 : o.accessToken);
676
676
  const h = a == null ? void 0 : a.find((f) => f.isDefault);
677
677
  if (h && h.id !== c.id) {
678
678
  const f = {
679
679
  ...h,
680
680
  isDefault: !1
681
681
  };
682
- await ys(f, i == null ? void 0 : i.accessToken);
682
+ await ys(f, o == null ? void 0 : o.accessToken);
683
683
  }
684
684
  }
685
685
  return /* @__PURE__ */ e.jsxs(na, { open: s, onOpenChange: n, children: [
@@ -691,7 +691,7 @@ function sl() {
691
691
  tt,
692
692
  {
693
693
  value: t,
694
- onValueChange: o,
694
+ onValueChange: i,
695
695
  children: [
696
696
  /* @__PURE__ */ e.jsx(Gs, { value: "original", children: "Original" }),
697
697
  a == null ? void 0 : a.map((c) => /* @__PURE__ */ e.jsxs(
@@ -742,13 +742,13 @@ function sl() {
742
742
  function al({
743
743
  iconClassName: s
744
744
  }) {
745
- const [n, a] = q(!1), { authToken: t } = Se(), l = M((o) => o.theme), r = M((o) => o.filterValues);
746
- async function i() {
745
+ const [n, a] = q(!1), { authToken: t } = Se(), l = M((i) => i.theme), r = M((i) => i.filterValues);
746
+ async function o() {
747
747
  {
748
748
  a(!0);
749
- const o = new URLSearchParams();
750
- o.set("token", (t == null ? void 0 : t.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(r));
751
- const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, c = await (await fetch(d, {
749
+ const i = new URLSearchParams();
750
+ i.set("token", (t == null ? void 0 : t.accessToken) || ""), i.set("theme", l || "light"), i.set("filterValues", JSON.stringify(r));
751
+ const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(i.toString())}`, c = await (await fetch(d, {
752
752
  method: "GET",
753
753
  headers: {
754
754
  Authorization: `Bearer ${t == null ? void 0 : t.accessToken}`
@@ -763,7 +763,7 @@ function al({
763
763
  variant: "link",
764
764
  className: "group h-7 p-2",
765
765
  size: "sm",
766
- onClick: i,
766
+ onClick: o,
767
767
  children: n ? /* @__PURE__ */ e.jsx(Ve, { className: Y("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
768
768
  nt,
769
769
  {
@@ -775,16 +775,15 @@ function al({
775
775
  );
776
776
  }
777
777
  function tl() {
778
- q(!1);
779
778
  const { authToken: s } = Se();
780
779
  M((j) => j.theme);
781
780
  const n = M((j) => j.lenses), a = M((j) => j.selectedLensId), t = n == null ? void 0 : n.find((j) => j.id === a), l = M((j) => j.dashboard);
782
781
  M((j) => j.selectedSheetId);
783
782
  const r = M(
784
783
  (j) => j.isDashboardEditing
785
- ), i = u(
784
+ ), o = u(
786
785
  (j) => j.selectedConnectionId
787
- ), [o, d] = q(!1), x = M((j) => j.filterValues), c = M((j) => j.isVisualEditing), b = M((j) => j.showFilters);
786
+ ), [i, d] = q(!1), x = M((j) => j.filterValues), c = M((j) => j.isVisualEditing), b = M((j) => j.showFilters);
788
787
  M(
789
788
  (j) => j.showDashboardJSON
790
789
  );
@@ -798,7 +797,7 @@ function tl() {
798
797
  ), L = bs(() => z || T, [z, T]), V = () => {
799
798
  if (!r || !I) return;
800
799
  const j = {
801
- connectionId: i,
800
+ connectionId: o,
802
801
  id: Ue(),
803
802
  title: "Title",
804
803
  description: "Description",
@@ -886,7 +885,7 @@ function tl() {
886
885
  {
887
886
  className: "h-7 p-2",
888
887
  variant: "ghost",
889
- disabled: o,
888
+ disabled: i,
890
889
  onClick: v,
891
890
  size: "sm",
892
891
  children: /* @__PURE__ */ e.jsx($n, { className: "h-4 w-4", strokeWidth: 1.5 })
@@ -916,8 +915,8 @@ function He({
916
915
  isLoading: t,
917
916
  isError: l,
918
917
  connectionTooltip: r,
919
- onChange: i,
920
- showNone: o = !1,
918
+ onChange: o,
919
+ showNone: i = !1,
921
920
  className: d,
922
921
  showIcon: x = !0,
923
922
  disabled: c = !1
@@ -940,7 +939,7 @@ function He({
940
939
  /* @__PURE__ */ e.jsx(ca, { children: g() }),
941
940
  /* @__PURE__ */ e.jsx(Ms, { className: "text-xs", align: "start", children: r })
942
941
  ] }) : g() }),
943
- /* @__PURE__ */ e.jsxs(ue, { disabled: c, value: b, onValueChange: i, children: [
942
+ /* @__PURE__ */ e.jsxs(ue, { disabled: c, value: b, onValueChange: o, children: [
944
943
  /* @__PURE__ */ e.jsx(
945
944
  he,
946
945
  {
@@ -959,7 +958,7 @@ function He({
959
958
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
960
959
  t ? /* @__PURE__ */ e.jsx(pe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(pe, { children: s }),
961
960
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
962
- o && /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
961
+ i && /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
963
962
  n && n.map((h, f) => /* @__PURE__ */ e.jsx(X, { value: h.id, children: h.name }, f))
964
963
  ] }),
965
964
  (t || l) && /* @__PURE__ */ e.jsx(X, { value: b, children: b })
@@ -972,10 +971,10 @@ function nl({ column: s }) {
972
971
  (h) => h.selectedSchemaName
973
972
  ), r = u(
974
973
  (h) => h.selectedDatamodelId
975
- ), i = u((h) => h.sqlGen), { modelItems: o } = qe(), d = u((h) => h.actions.setSqlGen), x = u((h) => h.actions.setCardSql), c = u((h) => h.actions.setRunSql);
974
+ ), o = u((h) => h.sqlGen), { modelItems: i } = qe(), d = u((h) => h.actions.setSqlGen), x = u((h) => h.actions.setCardSql), c = u((h) => h.actions.setRunSql);
976
975
  function b(h, f) {
977
976
  var A;
978
- const p = da(h, i, f), N = (A = o == null ? void 0 : o.find(
977
+ const p = da(h, o, f), N = (A = i == null ? void 0 : i.find(
979
978
  (I) => I.id === r
980
979
  )) == null ? void 0 : A.name;
981
980
  d(p);
@@ -1063,9 +1062,9 @@ function ll({
1063
1062
  }) {
1064
1063
  const l = u((m) => m.sqlGen), r = u(
1065
1064
  (m) => m.selectedConnectionId
1066
- ), i = u(
1067
- (m) => m.selectedDatabaseName
1068
1065
  ), o = u(
1066
+ (m) => m.selectedDatabaseName
1067
+ ), i = u(
1069
1068
  (m) => m.selectedSchemaName
1070
1069
  ), d = u((m) => m.selectedTableName), x = u(
1071
1070
  (m) => m.selectedDatamodelId
@@ -1093,8 +1092,8 @@ function ll({
1093
1092
  const v = {
1094
1093
  connectinonId: r,
1095
1094
  connectionType: N,
1096
- databaseName: i,
1097
- schemaName: o,
1095
+ databaseName: o,
1096
+ schemaName: i,
1098
1097
  tableName: d
1099
1098
  }, D = [...c || [], v].filter(
1100
1099
  (S, _, $) => $.findIndex(
@@ -1233,9 +1232,9 @@ function qe(s, n) {
1233
1232
  (C) => C.selectedConnectionId
1234
1233
  ), r = u(
1235
1234
  (C) => C.selectedDatamodelId
1236
- ), i = u(
1237
- (C) => C.selectedDatabaseName
1238
1235
  ), o = u(
1236
+ (C) => C.selectedDatabaseName
1237
+ ), i = u(
1239
1238
  (C) => C.selectedSchemaName
1240
1239
  ), d = u((C) => C.selectedTableName), x = u(
1241
1240
  (C) => C.actions.setCurrentColumns
@@ -1251,10 +1250,10 @@ function qe(s, n) {
1251
1250
  (C) => C.actions.setSelectedTableName
1252
1251
  ), p = u((C) => C.actions.setCardSql);
1253
1252
  function N(C) {
1254
- return l && i && o && i !== "NA" ? !0 : l && C === "API" ? !1 : !!(l && C === "S3");
1253
+ return l && o && i && o !== "NA" ? !0 : l && C === "API" ? !1 : !!(l && C === "S3");
1255
1254
  }
1256
1255
  function y(C) {
1257
- return !!(l && i && i !== "NA" && o && d || l && (C === "S3" || C === "API") || r && r);
1256
+ return !!(l && o && o !== "NA" && i && d || l && (C === "S3" || C === "API") || r && r);
1258
1257
  }
1259
1258
  function A(C) {
1260
1259
  return l && C ? !(C === "API" || C === "S3") : !1;
@@ -1312,16 +1311,16 @@ function qe(s, n) {
1312
1311
  isError: P,
1313
1312
  refetch: U
1314
1313
  } = be({
1315
- queryKey: ["schemas", l, i],
1314
+ queryKey: ["schemas", l, o],
1316
1315
  queryFn: () => ze(
1317
1316
  "https://semaphor.cloud/api/v1/schemas",
1318
1317
  (t == null ? void 0 : t.accessToken) || "",
1319
1318
  {
1320
1319
  connection_id: l,
1321
- database_name: i
1320
+ database_name: o
1322
1321
  }
1323
1322
  ),
1324
- enabled: !!l && !!i && !D && i !== "NA"
1323
+ enabled: !!l && !!o && !D && o !== "NA"
1325
1324
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1326
1325
  }), {
1327
1326
  data: E,
@@ -1333,16 +1332,16 @@ function qe(s, n) {
1333
1332
  queryKey: [
1334
1333
  "tables",
1335
1334
  l,
1336
- i,
1337
- o
1335
+ o,
1336
+ i
1338
1337
  ],
1339
1338
  queryFn: () => ze(
1340
1339
  "https://semaphor.cloud/api/v1/tables",
1341
1340
  (t == null ? void 0 : t.accessToken) || "",
1342
1341
  {
1343
1342
  connection_id: l,
1344
- database_name: i,
1345
- schema_name: o
1343
+ database_name: o,
1344
+ schema_name: i
1346
1345
  }
1347
1346
  ),
1348
1347
  enabled: N(j)
@@ -1355,9 +1354,9 @@ function qe(s, n) {
1355
1354
  queryKey: [
1356
1355
  "columns",
1357
1356
  l,
1358
- i,
1359
- r,
1360
1357
  o,
1358
+ r,
1359
+ i,
1361
1360
  d
1362
1361
  ],
1363
1362
  queryFn: () => ze(
@@ -1367,8 +1366,8 @@ function qe(s, n) {
1367
1366
  connection_id: l,
1368
1367
  datamodel_id: r || "",
1369
1368
  // don't pass undefined. Pass empty string
1370
- database_name: i,
1371
- schema_name: o,
1369
+ database_name: o,
1370
+ schema_name: i,
1372
1371
  table_name: d
1373
1372
  }
1374
1373
  ),
@@ -1392,7 +1391,7 @@ function qe(s, n) {
1392
1391
  g,
1393
1392
  v
1394
1393
  ]);
1395
- const Le = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() : d || "", Fe = D ? "" : o || "";
1394
+ const Le = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() : d || "", Fe = D ? "" : i || "";
1396
1395
  function Ee(C) {
1397
1396
  h(C), f("");
1398
1397
  }
@@ -1469,10 +1468,10 @@ function Va({
1469
1468
  (B) => B.selectedDatabaseName
1470
1469
  ), l = u(
1471
1470
  (B) => B.selectedSchemaName
1472
- ), r = u((B) => B.selectedTableName), i = u(
1471
+ ), r = u((B) => B.selectedTableName), o = u(
1473
1472
  (B) => B.actions.setSelectedTableName
1474
1473
  ), {
1475
- connectionItems: o,
1474
+ connectionItems: i,
1476
1475
  modelItems: d,
1477
1476
  schemaItems: x,
1478
1477
  databaseItems: c,
@@ -1574,7 +1573,7 @@ function Va({
1574
1573
  return B() ? /* @__PURE__ */ e.jsx(
1575
1574
  He,
1576
1575
  {
1577
- onChange: i,
1576
+ onChange: o,
1578
1577
  isError: m,
1579
1578
  items: b,
1580
1579
  isLoading: V,
@@ -1588,13 +1587,13 @@ function Va({
1588
1587
  /* @__PURE__ */ e.jsx(
1589
1588
  He,
1590
1589
  {
1591
- items: o,
1590
+ items: i,
1592
1591
  title: "Connection",
1593
1592
  value: n || "",
1594
1593
  onChange: D,
1595
1594
  isLoading: h,
1596
1595
  isError: p,
1597
- connectionTooltip: ((re = o == null ? void 0 : o.find(
1596
+ connectionTooltip: ((re = i == null ? void 0 : i.find(
1598
1597
  (B) => B.id === n
1599
1598
  )) == null ? void 0 : re.type) || ""
1600
1599
  }
@@ -1625,16 +1624,16 @@ function rl(s) {
1625
1624
  const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1626
1625
  let r = s.length;
1627
1626
  if (l !== -1 && (r = l), t !== -1 && t < r && (r = t), n !== -1) {
1628
- const i = s.substring(0, n), o = s.substring(n);
1629
- return `${i} {{ filters | where }} AND ${o.substring(
1627
+ const o = s.substring(0, n), i = s.substring(n);
1628
+ return `${o} {{ filters | where }} AND ${i.substring(
1630
1629
  6
1631
1630
  )}`;
1632
1631
  } else if (a !== -1) {
1633
- const i = s.substring(0, a), o = s.substring(a);
1634
- return `${i} {{ filters | where }} ${o}`;
1632
+ const o = s.substring(0, a), i = s.substring(a);
1633
+ return `${o} {{ filters | where }} ${i}`;
1635
1634
  } else {
1636
- const i = s.substring(0, r), o = s.substring(r);
1637
- return `${i} {{ filters | where }} ${o}`;
1635
+ const o = s.substring(0, r), i = s.substring(r);
1636
+ return `${o} {{ filters | where }} ${i}`;
1638
1637
  }
1639
1638
  }
1640
1639
  function il({
@@ -1726,7 +1725,7 @@ function cl({
1726
1725
  triggerAIRun: l,
1727
1726
  setTriggerAIRun: r
1728
1727
  }) {
1729
- const i = ns(null), o = ns(null), { authToken: d } = Se(), [x, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns), A = u((k) => k.card.sql), I = u((k) => k.selectedTableName), z = `
1728
+ const o = ns(null), i = ns(null), { authToken: d } = Se(), [x, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns), A = u((k) => k.card.sql), I = u((k) => k.selectedTableName), z = `
1730
1729
  ${a}
1731
1730
 
1732
1731
  Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
@@ -1772,10 +1771,10 @@ function cl({
1772
1771
  }, [L]), Z(() => {
1773
1772
  const k = setTimeout(() => {
1774
1773
  var P;
1775
- o.current && (o.current.scroll({
1776
- top: o.current.scrollHeight,
1774
+ i.current && (i.current.scroll({
1775
+ top: i.current.scrollHeight,
1777
1776
  behavior: "smooth"
1778
- }), (P = i.current) == null || P.focus());
1777
+ }), (P = o.current) == null || P.focus());
1779
1778
  }, 100);
1780
1779
  return () => clearTimeout(k);
1781
1780
  }, [p]);
@@ -1884,7 +1883,7 @@ function cl({
1884
1883
  /* @__PURE__ */ e.jsx(
1885
1884
  "div",
1886
1885
  {
1887
- ref: o,
1886
+ ref: i,
1888
1887
  className: "h-[625px] w-full overflow-auto border-t border-t-muted",
1889
1888
  children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: se() })
1890
1889
  }
@@ -1897,7 +1896,7 @@ function cl({
1897
1896
  pa,
1898
1897
  {
1899
1898
  autoFocus: !0,
1900
- ref: i,
1899
+ ref: o,
1901
1900
  onKeyDown: (k) => {
1902
1901
  k.key === "Enter" && !k.shiftKey && (k.preventDefault(), t(""), S());
1903
1902
  },
@@ -2024,18 +2023,18 @@ function fl(s) {
2024
2023
  attr: t,
2025
2024
  size: l,
2026
2025
  title: r
2027
- } = s, i = ul(s, dl), o = l || a.size || "1em", d;
2026
+ } = s, o = ul(s, dl), i = l || a.size || "1em", d;
2028
2027
  return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ Ne.createElement("svg", ls({
2029
2028
  stroke: "currentColor",
2030
2029
  fill: "currentColor",
2031
2030
  strokeWidth: "0"
2032
- }, a.attr, t, i, {
2031
+ }, a.attr, t, o, {
2033
2032
  className: d,
2034
2033
  style: rs(rs({
2035
2034
  color: s.color || a.color
2036
2035
  }, a.style), s.style),
2037
- height: o,
2038
- width: o,
2036
+ height: i,
2037
+ width: i,
2039
2038
  xmlns: "http://www.w3.org/2000/svg"
2040
2039
  }), r && /* @__PURE__ */ Ne.createElement("title", null, r), s.children);
2041
2040
  };
@@ -2061,19 +2060,19 @@ function jl({ sql: s }) {
2061
2060
  ] });
2062
2061
  }
2063
2062
  function _a(s) {
2064
- const { theme: n } = jt(), a = M((p) => p.theme), t = u((p) => p.frame), l = u((p) => p.card), r = u((p) => p.activeTabCardId), i = bt(), { refetch: o } = De(l), { updateCardTab: d, setRunSql: x } = ne(), c = ns(), b = ns({}), g = t.cards.find((p) => p.id === r), h = Oa(() => {
2063
+ const { theme: n } = jt(), a = M((p) => p.theme), t = u((p) => p.frame), l = u((p) => p.card), r = u((p) => p.activeTabCardId), o = bt(), { refetch: i } = De(l), { updateCardTab: d, setRunSql: x } = ne(), c = ns(), b = ns({}), g = t.cards.find((p) => p.id === r), h = Oa(() => {
2065
2064
  let p = "";
2066
2065
  return s === "python" && (p = (g == null ? void 0 : g.python) || fa), s === "sql" && (p = (g == null ? void 0 : g.sql) || ""), p;
2067
2066
  }, [s, g]);
2068
2067
  Z(() => {
2069
2068
  if (r && l.id && l.id !== r) {
2070
- if (c.current && i) {
2069
+ if (c.current && o) {
2071
2070
  const p = c.current.getModel();
2072
2071
  p && (b.current[l.id] = p);
2073
2072
  let N = b.current[r];
2074
2073
  if (!N) {
2075
2074
  const y = h();
2076
- N = i.editor.createModel(y, s), b.current[r] = N;
2075
+ N = o.editor.createModel(y, s), b.current[r] = N;
2077
2076
  }
2078
2077
  c.current.setModel(N);
2079
2078
  }
@@ -2083,14 +2082,14 @@ function _a(s) {
2083
2082
  r,
2084
2083
  l,
2085
2084
  d,
2086
- i,
2085
+ o,
2087
2086
  x,
2088
2087
  s,
2089
2088
  h
2090
2089
  ]), Z(() => {
2091
- if (!i) return;
2090
+ if (!o) return;
2092
2091
  const p = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", N = a === "system" ? p : a;
2093
- i.editor.defineTheme("default", {
2092
+ o.editor.defineTheme("default", {
2094
2093
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2095
2094
  base: N === "light" ? "vs" : "vs-dark",
2096
2095
  inherit: !0,
@@ -2102,16 +2101,16 @@ function _a(s) {
2102
2101
  // ? '#ffffff'
2103
2102
  // : getCssVariableValue('--semaphor-background'),
2104
2103
  }
2105
- }), i.editor.setTheme("default");
2106
- }, [n, a, i]), Z(() => {
2104
+ }), o.editor.setTheme("default");
2105
+ }, [n, a, o]), Z(() => {
2107
2106
  const p = c.current;
2108
- p && i && l && p.addCommand(
2109
- i.KeyMod.Shift | i.KeyCode.Enter,
2107
+ p && o && l && p.addCommand(
2108
+ o.KeyMod.Shift | o.KeyCode.Enter,
2110
2109
  function() {
2111
- return o(), !1;
2110
+ return i(), !1;
2112
2111
  }
2113
2112
  );
2114
- }, [i, o, l]);
2113
+ }, [o, i, l]);
2115
2114
  function f(p, N) {
2116
2115
  if (c.current = p, !b.current[l.id]) {
2117
2116
  const y = p.getModel(), A = h();
@@ -2122,9 +2121,9 @@ function _a(s) {
2122
2121
  return { handleEditorDidMount: f };
2123
2122
  }
2124
2123
  function bl() {
2125
- const s = u((i) => i.card.sql), n = u((i) => i.sqlGen), { setCardSql: a, setSqlGen: t } = ne(), { handleEditorDidMount: l } = _a("sql");
2126
- function r(i) {
2127
- i !== void 0 && (a(i.trim()), vt(n) || t({}));
2124
+ const s = u((o) => o.card.sql), n = u((o) => o.sqlGen), { setCardSql: a, setSqlGen: t } = ne(), { handleEditorDidMount: l } = _a("sql");
2125
+ function r(o) {
2126
+ a(o), vt(n) || t({});
2128
2127
  }
2129
2128
  return /* @__PURE__ */ e.jsx(
2130
2129
  os,
@@ -2151,15 +2150,16 @@ function bl() {
2151
2150
  );
2152
2151
  }
2153
2152
  function yl() {
2154
- const s = u((t) => t.card.python), { setCardPython: n } = ne(), { handleEditorDidMount: a } = _a("python");
2153
+ const s = u((l) => l.card.python), { setCardPython: n } = ne(), { handleEditorDidMount: a } = _a("python");
2154
+ function t(l) {
2155
+ n(l);
2156
+ }
2155
2157
  return /* @__PURE__ */ e.jsx(
2156
2158
  os,
2157
2159
  {
2158
2160
  className: "pt-3",
2159
2161
  theme: "default",
2160
- onChange: (t) => {
2161
- n(t && t.trim() || "");
2162
- },
2162
+ onChange: t,
2163
2163
  value: s || fa,
2164
2164
  options: {
2165
2165
  minimap: {
@@ -2182,7 +2182,7 @@ function vl() {
2182
2182
  const s = M((r) => r.dashboard.filters), n = M((r) => r.filterValues), a = M((r) => r.selectedSheetId), t = s == null ? void 0 : s.filter(
2183
2183
  (r) => r.sheetId === a || !r.sheetId
2184
2184
  ), l = n == null ? void 0 : n.filter(
2185
- (r) => (t == null ? void 0 : t.some((i) => i.id === r.filterId)) || r.filterId.endsWith(a)
2185
+ (r) => (t == null ? void 0 : t.some((o) => o.id === r.filterId)) || r.filterId.endsWith(a)
2186
2186
  );
2187
2187
  return /* @__PURE__ */ e.jsx(
2188
2188
  os,
@@ -2213,7 +2213,7 @@ function Cl() {
2213
2213
  const [s, n] = q({
2214
2214
  queryKey: [],
2215
2215
  queryData: null
2216
- }), a = Ct(), [t, l] = q(!1), [r, i] = q(!1), [o, d] = q(!1), [x, c] = q(""), [b, g] = q(!1), h = u((w) => w.frame), f = u((w) => w.card), p = u((w) => w.isShowingVisual), N = u(
2216
+ }), a = Ct(), [t, l] = q(!1), [r, o] = q(!1), [i, d] = q(!1), [x, c] = q(""), [b, g] = q(!1), h = u((w) => w.frame), f = u((w) => w.card), p = u((w) => w.isShowingVisual), N = u(
2217
2217
  (w) => w.selectedConnectionId
2218
2218
  ), y = u(
2219
2219
  (w) => w.selectedDatabaseName
@@ -2334,7 +2334,7 @@ function Cl() {
2334
2334
  r && /* @__PURE__ */ e.jsx(
2335
2335
  Be,
2336
2336
  {
2337
- onClick: () => i(!1),
2337
+ onClick: () => o(!1),
2338
2338
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
2339
2339
  }
2340
2340
  )
@@ -2346,7 +2346,7 @@ function Cl() {
2346
2346
  !r && /* @__PURE__ */ e.jsx(
2347
2347
  oa,
2348
2348
  {
2349
- onClick: () => i(!0),
2349
+ onClick: () => o(!0),
2350
2350
  className: Y(
2351
2351
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
2352
2352
  {
@@ -2484,7 +2484,7 @@ function Cl() {
2484
2484
  /* @__PURE__ */ e.jsx(
2485
2485
  cl,
2486
2486
  {
2487
- open: o,
2487
+ open: i,
2488
2488
  setOpen: d,
2489
2489
  userInput: x,
2490
2490
  triggerAIRun: b,
@@ -2530,10 +2530,10 @@ function Cl() {
2530
2530
  );
2531
2531
  }
2532
2532
  function Nl({ data: s }) {
2533
- var i;
2534
- const [n, a] = Ne.useState([]), l = Object.keys(s[0]).map((o) => ({
2533
+ var o;
2534
+ const [n, a] = Ne.useState([]), l = Object.keys(s[0]).map((i) => ({
2535
2535
  // header: key,
2536
- accessorKey: o,
2536
+ accessorKey: i,
2537
2537
  header: ({ column: d }) => {
2538
2538
  const x = d.getIsSorted();
2539
2539
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
@@ -2542,7 +2542,7 @@ function Nl({ data: s }) {
2542
2542
  className: "flex cursor-pointer items-center",
2543
2543
  onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2544
2544
  children: [
2545
- o,
2545
+ i,
2546
2546
  x === "asc" ? /* @__PURE__ */ e.jsx(St, { className: "ml-2 h-5 w-5" }) : x === "desc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : null
2547
2547
  ]
2548
2548
  }
@@ -2561,7 +2561,7 @@ function Nl({ data: s }) {
2561
2561
  }
2562
2562
  });
2563
2563
  return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
2564
- /* @__PURE__ */ e.jsx(zt, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(fs, { children: o.headers.map((d) => /* @__PURE__ */ e.jsx(
2564
+ /* @__PURE__ */ e.jsx(zt, { children: r.getHeaderGroups().map((i) => /* @__PURE__ */ e.jsx(fs, { children: i.headers.map((d) => /* @__PURE__ */ e.jsx(
2565
2565
  Ot,
2566
2566
  {
2567
2567
  className: "sticky top-0 h-11 bg-muted font-semibold",
@@ -2571,15 +2571,15 @@ function Nl({ data: s }) {
2571
2571
  )
2572
2572
  },
2573
2573
  d.id
2574
- )) }, o.id)) }),
2575
- /* @__PURE__ */ e.jsx(Dt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2574
+ )) }, i.id)) }),
2575
+ /* @__PURE__ */ e.jsx(Dt, { children: (o = r.getRowModel().rows) != null && o.length ? r.getRowModel().rows.map((i) => /* @__PURE__ */ e.jsx(
2576
2576
  fs,
2577
2577
  {
2578
2578
  className: "whitespace-nowrap py-2",
2579
- "data-state": o.getIsSelected() && "selected",
2580
- children: o.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Qs, { className: "py-3", children: Ks(d.column.columnDef.cell, d.getContext()) }, d.id))
2579
+ "data-state": i.getIsSelected() && "selected",
2580
+ children: i.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Qs, { className: "py-3", children: Ks(d.column.columnDef.cell, d.getContext()) }, d.id))
2581
2581
  },
2582
- o.id
2582
+ i.id
2583
2583
  )) : /* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Qs, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2584
2584
  ] }) });
2585
2585
  }
@@ -2587,8 +2587,8 @@ function Sl({ card: s }) {
2587
2587
  var y, A, I, z, T, L, V, m, v, j, D;
2588
2588
  const [n, a] = q(!1), [t, l] = q(
2589
2589
  []
2590
- ), { authToken: r } = Se(), i = Lt(r == null ? void 0 : r.accessToken), o = M((S) => S.themeStyle), d = {
2591
- colors: ((A = (y = o == null ? void 0 : o.chart) == null ? void 0 : y.dataset) == null ? void 0 : A.backgroundColor) || []
2590
+ ), { authToken: r } = Se(), o = Lt(r == null ? void 0 : r.accessToken), i = M((S) => S.themeStyle), d = {
2591
+ colors: ((A = (y = i == null ? void 0 : i.chart) == null ? void 0 : y.dataset) == null ? void 0 : A.backgroundColor) || []
2592
2592
  };
2593
2593
  (I = s.customCardPreferences) != null && I.inputData;
2594
2594
  const { getCard: x } = ga(((z = s.customCardPreferences) == null ? void 0 : z.url) || ""), c = ((T = s.customCardPreferences) == null ? void 0 : T.visualType) || "single", b = u((S) => S.frame);
@@ -2622,7 +2622,7 @@ function Sl({ card: s }) {
2622
2622
  f && c === "single" && /* @__PURE__ */ e.jsx(
2623
2623
  f,
2624
2624
  {
2625
- params: i,
2625
+ params: o,
2626
2626
  theme: d,
2627
2627
  settings: (v = s.customCardPreferences) == null ? void 0 : v.settings,
2628
2628
  onDataChange: h,
@@ -2678,7 +2678,7 @@ function Ha({
2678
2678
  var N;
2679
2679
  const a = u((y) => y.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = u((y) => y.frame), r = M((y) => y.dashboard.filters);
2680
2680
  u((y) => y.actions.setRunSql);
2681
- const { updateFilter: i } = is(), o = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: d, isLoading: x, isFetching: c } = De(a), { setCard: b } = ne(), { data: g } = Es(a);
2681
+ const { updateFilter: o } = is(), i = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: d, isLoading: x, isFetching: c } = De(a), { setCard: b } = ne(), { data: g } = Es(a);
2682
2682
  if (!a.id) return null;
2683
2683
  let h;
2684
2684
  d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (h = ja({
@@ -2743,17 +2743,17 @@ function Ha({
2743
2743
  a.description
2744
2744
  )
2745
2745
  ] }),
2746
- o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2746
+ i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2747
2747
  /* @__PURE__ */ e.jsx(
2748
2748
  Xe,
2749
2749
  {
2750
2750
  className: "my-1",
2751
- text: o.title || o.column,
2752
- onSave: (y) => i({ ...o, title: y }),
2753
- children: /* @__PURE__ */ e.jsx(H, { children: o.title })
2751
+ text: i.title || i.column,
2752
+ onSave: (y) => o({ ...i, title: y }),
2753
+ children: /* @__PURE__ */ e.jsx(H, { children: i.title })
2754
2754
  }
2755
2755
  ),
2756
- /* @__PURE__ */ e.jsx(ba, { filter: o })
2756
+ /* @__PURE__ */ e.jsx(ba, { filter: i })
2757
2757
  ] })
2758
2758
  ] }),
2759
2759
  /* @__PURE__ */ e.jsx(Rt, { className: "flex grow flex-col", children: p() })
@@ -2879,7 +2879,7 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2879
2879
  /* @__PURE__ */ e.jsx(O, { onClick: l, variant: "outline", children: "Close" })
2880
2880
  ] });
2881
2881
  function Ol() {
2882
- const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [i, o] = q(""), [d, x] = q(""), c = u((z) => z.card), b = u((z) => z.card.customCfg), { data: g } = De(c), { data: h } = Es(c), { setCardCustomCfg: f, setCustomVisualCode: p } = ne(), N = (z) => {
2882
+ const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [o, i] = q(""), [d, x] = q(""), c = u((z) => z.card), b = u((z) => z.card.customCfg), { data: g } = De(c), { data: h } = Es(c), { setCardCustomCfg: f, setCustomVisualCode: p } = ne(), N = (z) => {
2883
2883
  var T, L;
2884
2884
  return JSON.stringify(
2885
2885
  {
@@ -2905,12 +2905,12 @@ function Ol() {
2905
2905
  preferences: c.preferences,
2906
2906
  topoJson: h
2907
2907
  });
2908
- z && (t(N(z)), o(((L = c.preferences) == null ? void 0 : L.customVisualCode) || ""), r(
2908
+ z && (t(N(z)), i(((L = c.preferences) == null ? void 0 : L.customVisualCode) || ""), r(
2909
2909
  b ? JSON.stringify(b, null, 2) : ""
2910
2910
  ));
2911
2911
  }, A = () => {
2912
2912
  try {
2913
- if (i && p(i), l) {
2913
+ if (o && p(o), l) {
2914
2914
  const z = JSON.parse(l);
2915
2915
  f(z), x("");
2916
2916
  }
@@ -2943,10 +2943,10 @@ function Ol() {
2943
2943
  kl,
2944
2944
  {
2945
2945
  defaultConfig: a,
2946
- customCode: i,
2946
+ customCode: o,
2947
2947
  customConfig: I(),
2948
2948
  onConfigChange: (z) => r(z ?? ""),
2949
- onCodeChange: (z) => o(z ?? "")
2949
+ onCodeChange: (z) => i(z ?? "")
2950
2950
  }
2951
2951
  )
2952
2952
  ] }),
@@ -2993,7 +2993,7 @@ function Wa(s) {
2993
2993
  const [n, a] = q(null);
2994
2994
  return Z(() => {
2995
2995
  s && (async () => {
2996
- const r = (await import("./lucide-react-g0ln-XxW.js"))[s];
2996
+ const r = (await import("./lucide-react-Be4cg6f4.js"))[s];
2997
2997
  a(r);
2998
2998
  })();
2999
2999
  }, [s]), n;
@@ -3014,14 +3014,14 @@ function Dl({
3014
3014
  (async () => {
3015
3015
  var r;
3016
3016
  if (t) {
3017
- const o = (await Promise.all(
3017
+ const i = (await Promise.all(
3018
3018
  (r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (d) => (await Ut(d.value)).visuals.map((b) => ({
3019
3019
  name: b.name,
3020
3020
  icon: b.icon,
3021
3021
  url: d.value
3022
3022
  })))
3023
3023
  )).flat();
3024
- a(o);
3024
+ a(i);
3025
3025
  }
3026
3026
  })();
3027
3027
  }, [t]), n.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -3047,9 +3047,9 @@ const Ml = ({
3047
3047
  };
3048
3048
  function Il() {
3049
3049
  var c, b;
3050
- const [s, n] = q(!1), a = u((g) => g.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = u((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: d } = ne();
3050
+ const [s, n] = q(!1), a = u((g) => g.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: o } = u((g) => g.actions), { setCardCustomCfg: i, setCustomCardPreferences: d } = ne();
3051
3051
  function x(g, h) {
3052
- o(null), r({}), l(g), h && d({
3052
+ i(null), r({}), l(g), h && d({
3053
3053
  type: "component",
3054
3054
  visualType: "single",
3055
3055
  url: h.url,
@@ -3284,7 +3284,7 @@ function Ll() {
3284
3284
  function sa() {
3285
3285
  const s = u((m) => m.frame), n = u((m) => m.card), a = u((m) => m.isShowingVisual), t = u((m) => m.isSqlRunning), l = u((m) => m.queryError), r = u((m) => m.pythonStdOut);
3286
3286
  u((m) => m.actions.setRunSql);
3287
- const { setFrame: i, setCard: o, updateCardInFrame: d, setActiveTabCardId: x } = ne(), { data: c, isLoading: b, isFetching: g } = De(n);
3287
+ const { setFrame: o, setCard: i, updateCardInFrame: d, setActiveTabCardId: x } = ne(), { data: c, isLoading: b, isFetching: g } = De(n);
3288
3288
  if (!n) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3289
3289
  function h() {
3290
3290
  const m = {
@@ -3312,7 +3312,7 @@ function sa() {
3312
3312
  cards: [...s.cards, m],
3313
3313
  activeCardId: m.id
3314
3314
  };
3315
- i(v), x(m.id);
3315
+ o(v), x(m.id);
3316
3316
  }
3317
3317
  function p() {
3318
3318
  const m = {
@@ -3330,7 +3330,7 @@ function sa() {
3330
3330
  // update the active card to the first card in the frame
3331
3331
  activeCardId: j.id
3332
3332
  };
3333
- i(D), o(j);
3333
+ o(D), i(j);
3334
3334
  }
3335
3335
  function y(m) {
3336
3336
  x(m);
@@ -3343,7 +3343,7 @@ function sa() {
3343
3343
  const j = m.dataTransfer.getData("tabIndex");
3344
3344
  if (j === v.toString()) return;
3345
3345
  const D = Array.from(s.cards), [S] = D.splice(parseInt(j), 1);
3346
- D.splice(v, 0, S), i({ ...s, cards: D });
3346
+ D.splice(v, 0, S), o({ ...s, cards: D });
3347
3347
  };
3348
3348
  function T(m, v) {
3349
3349
  return m.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || m.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
@@ -3351,7 +3351,7 @@ function sa() {
3351
3351
  {
3352
3352
  onClick: () => {
3353
3353
  const j = v.displayTab === void 0 ? !1 : !v.displayTab;
3354
- o({ ...v, displayTab: j }), d({
3354
+ i({ ...v, displayTab: j }), d({
3355
3355
  ...v,
3356
3356
  displayTab: j
3357
3357
  });
@@ -3375,7 +3375,7 @@ function sa() {
3375
3375
  {
3376
3376
  text: m.tabTitle || m.title,
3377
3377
  onSave: (j) => {
3378
- o({ ...n, tabTitle: j }), d({ ...n, tabTitle: j });
3378
+ i({ ...n, tabTitle: j }), d({ ...n, tabTitle: j });
3379
3379
  },
3380
3380
  children: /* @__PURE__ */ e.jsxs(
3381
3381
  Ze,
@@ -3578,7 +3578,7 @@ function Vl() {
3578
3578
  var p, N;
3579
3579
  const s = u(
3580
3580
  (y) => y.card.customCardPreferences
3581
- ), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((y) => y.card), l = u((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ne(), { components: o, manifest: d } = ga(
3581
+ ), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((y) => y.card), l = u((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: o } = ne(), { components: i, manifest: d } = ga(
3582
3582
  (s == null ? void 0 : s.url) || ""
3583
3583
  ), x = (p = d == null ? void 0 : d.visuals) == null ? void 0 : p.find(
3584
3584
  (y) => y.name === (s == null ? void 0 : s.componentName)
@@ -3592,7 +3592,7 @@ function Vl() {
3592
3592
  hookRef: null
3593
3593
  }
3594
3594
  };
3595
- i({
3595
+ o({
3596
3596
  ...s,
3597
3597
  dataInputCardIds: z
3598
3598
  });
@@ -3638,7 +3638,7 @@ function Vl() {
3638
3638
  className: `h-8 w-full ${Pe}`,
3639
3639
  value: ((z = s == null ? void 0 : s.settings) == null ? void 0 : z[A]) || "",
3640
3640
  onChange: (L) => {
3641
- i({
3641
+ o({
3642
3642
  ...s,
3643
3643
  settings: {
3644
3644
  ...s == null ? void 0 : s.settings,
@@ -3656,7 +3656,7 @@ function Vl() {
3656
3656
  options: I,
3657
3657
  value: ((T = s == null ? void 0 : s.settings) == null ? void 0 : T[A]) || "",
3658
3658
  onValueChange: (L) => {
3659
- i({
3659
+ o({
3660
3660
  ...s,
3661
3661
  settings: { ...s == null ? void 0 : s.settings, [A]: L }
3662
3662
  });
@@ -3676,7 +3676,7 @@ function Vl() {
3676
3676
  ] }, I)) });
3677
3677
  }
3678
3678
  function f(y) {
3679
- s && i({
3679
+ s && o({
3680
3680
  ...s,
3681
3681
  visualType: y,
3682
3682
  componentName: ""
@@ -3695,7 +3695,7 @@ function Vl() {
3695
3695
  label: "",
3696
3696
  options: a,
3697
3697
  value: (s == null ? void 0 : s.url) || "",
3698
- onValueChange: (y) => i({
3698
+ onValueChange: (y) => o({
3699
3699
  ...s || {
3700
3700
  url: "",
3701
3701
  componentName: ""
@@ -3717,12 +3717,12 @@ function Vl() {
3717
3717
  ),
3718
3718
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3719
3719
  /* @__PURE__ */ e.jsx(H, { children: "Component" }),
3720
- /* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: o && /* @__PURE__ */ e.jsx(
3720
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: i && /* @__PURE__ */ e.jsx(
3721
3721
  de,
3722
3722
  {
3723
3723
  className: "h-8 w-full",
3724
3724
  label: "",
3725
- options: (o == null ? void 0 : o.filter(
3725
+ options: (i == null ? void 0 : i.filter(
3726
3726
  (y) => y.type === r
3727
3727
  ).map((y) => ({
3728
3728
  value: y.name,
@@ -3730,7 +3730,7 @@ function Vl() {
3730
3730
  }))) || [],
3731
3731
  value: s.componentName,
3732
3732
  onValueChange: (y) => {
3733
- console.log("changing value", y), i({
3733
+ console.log("changing value", y), o({
3734
3734
  ...s,
3735
3735
  componentName: y
3736
3736
  });
@@ -3756,7 +3756,7 @@ function Ie() {
3756
3756
  u(
3757
3757
  (c) => c.card.cfg
3758
3758
  );
3759
- const a = u((c) => c.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: r } = u((c) => c.actions), i = u(
3759
+ const a = u((c) => c.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: r } = u((c) => c.actions), o = u(
3760
3760
  (c) => c.queryResultColumns
3761
3761
  );
3762
3762
  u(
@@ -3765,9 +3765,9 @@ function Ie() {
3765
3765
  return (b = c.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
3766
3766
  }
3767
3767
  ), Z(() => {
3768
- i && n(new Array(i.length).fill(!1));
3769
- }, [i]);
3770
- function o(c, b) {
3768
+ o && n(new Array(o.length).fill(!1));
3769
+ }, [o]);
3770
+ function i(c, b) {
3771
3771
  var g, h;
3772
3772
  b ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? r({
3773
3773
  ...a,
@@ -3823,7 +3823,7 @@ function Ie() {
3823
3823
  }
3824
3824
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3825
3825
  /* @__PURE__ */ e.jsx(H, { children: "On Click" }),
3826
- i == null ? void 0 : i.map((c, b) => {
3826
+ o == null ? void 0 : o.map((c, b) => {
3827
3827
  var g, h;
3828
3828
  return /* @__PURE__ */ e.jsx(
3829
3829
  "div",
@@ -3837,7 +3837,7 @@ function Ie() {
3837
3837
  checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
3838
3838
  (f) => f.columnIndex === b
3839
3839
  )),
3840
- onCheckedChange: (f) => o(b, f)
3840
+ onCheckedChange: (f) => i(b, f)
3841
3841
  }
3842
3842
  ),
3843
3843
  /* @__PURE__ */ e.jsx(
@@ -3871,18 +3871,18 @@ function Ie() {
3871
3871
  ] });
3872
3872
  }
3873
3873
  function xs() {
3874
- var i, o, d;
3874
+ var o, i, d;
3875
3875
  const s = u((x) => x.card.preferences), n = u(
3876
3876
  (x) => x.card.cfg
3877
3877
  ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = u((x) => x.actions);
3878
- (i = n == null ? void 0 : n.options) != null && i.indexAxis;
3878
+ (o = n == null ? void 0 : n.options) != null && o.indexAxis;
3879
3879
  function r(x) {
3880
3880
  l(x);
3881
3881
  }
3882
3882
  return /* @__PURE__ */ e.jsxs(
3883
3883
  ms,
3884
3884
  {
3885
- value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((d = n == null ? void 0 : n.options) == null ? void 0 : d.indexAxis) || "x",
3885
+ value: ((i = s == null ? void 0 : s.chartOptions) == null ? void 0 : i.indexAxis) || ((d = n == null ? void 0 : n.options) == null ? void 0 : d.indexAxis) || "x",
3886
3886
  onValueChange: r,
3887
3887
  className: "flex gap-3",
3888
3888
  defaultValue: "x",
@@ -3913,13 +3913,13 @@ function Xa() {
3913
3913
  }), t = u((E) => {
3914
3914
  var F;
3915
3915
  return (F = E.card) == null ? void 0 : F.cfg;
3916
- }), l = wa(a, t), [r, i] = q(
3916
+ }), l = wa(a, t), [r, o] = q(
3917
3917
  aa(a)
3918
- ), [o, d] = q(
3918
+ ), [i, d] = q(
3919
3919
  ((se = (G = (ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : G[l]) == null ? void 0 : se.min) || ""
3920
3920
  ), [x, c] = q(
3921
3921
  ((U = (P = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : P[l]) == null ? void 0 : U.max) || ""
3922
- ), [b, g] = q(o || x ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y, A] = q(""), [I, z] = q(""), [T, L] = q(""), V = u(
3922
+ ), [b, g] = q(i || x ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y, A] = q(""), [I, z] = q(""), [T, L] = q(""), V = u(
3923
3923
  (E) => E.actions.setCardPreferences
3924
3924
  ), { updateCardInFrame: m } = ne(), v = u((E) => E.card), j = u((E) => {
3925
3925
  var F;
@@ -3927,7 +3927,7 @@ function Xa() {
3927
3927
  }), D = ["pie", "doughnut", "polarArea"].includes(j);
3928
3928
  Z(() => {
3929
3929
  var E, F, re, B, ae, te, je, Te, we, Le, Fe, Ee, Ae, w;
3930
- i(aa(a)), d(
3930
+ o(aa(a)), d(
3931
3931
  ((re = (F = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : F[l]) == null ? void 0 : re.min) === 0 ? 0 : ""
3932
3932
  ), c(((te = (ae = (B = a == null ? void 0 : a.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : ae[l]) == null ? void 0 : te.max) || ""), f(
3933
3933
  ((Le = (we = (Te = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : Te[l]) == null ? void 0 : we.ticks) == null ? void 0 : Le.stepSize) || ""
@@ -4008,7 +4008,7 @@ function Xa() {
4008
4008
  ie,
4009
4009
  {
4010
4010
  id: "min",
4011
- value: o,
4011
+ value: i,
4012
4012
  onChange: (E) => d((F) => S(F, E.target.value)),
4013
4013
  className: `col-span-1 h-8 w-full ${We}`
4014
4014
  }
@@ -4041,7 +4041,7 @@ function Xa() {
4041
4041
  var B;
4042
4042
  let E = {};
4043
4043
  b === "custom" && (E = {
4044
- min: o,
4044
+ min: i,
4045
4045
  max: x,
4046
4046
  ticks: {
4047
4047
  stepSize: h
@@ -4089,7 +4089,7 @@ function Xa() {
4089
4089
  {
4090
4090
  disabled: D,
4091
4091
  value: r,
4092
- onValueChange: (E) => i(E),
4092
+ onValueChange: (E) => o(E),
4093
4093
  children: [
4094
4094
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4095
4095
  /* @__PURE__ */ e.jsx(xe, { id: "type", children: /* @__PURE__ */ e.jsxs(ve, { children: [
@@ -4142,7 +4142,7 @@ function Xa() {
4142
4142
  ] });
4143
4143
  }
4144
4144
  function ql({ idx: s }) {
4145
- var o;
4145
+ var i;
4146
4146
  const n = u((d) => {
4147
4147
  var x;
4148
4148
  return (x = d.card) == null ? void 0 : x.preferences;
@@ -4153,8 +4153,8 @@ function ql({ idx: s }) {
4153
4153
  }
4154
4154
  ), t = u(
4155
4155
  (d) => d.actions.setCardPreferences
4156
- ), l = (o = n == null ? void 0 : n.chartOptions) == null ? void 0 : o.indexAxis, r = a == null ? void 0 : a.find((d) => d.idx === s);
4157
- function i(d, x) {
4156
+ ), l = (i = n == null ? void 0 : n.chartOptions) == null ? void 0 : i.indexAxis, r = a == null ? void 0 : a.find((d) => d.idx === s);
4157
+ function o(d, x) {
4158
4158
  (d === "end" || d === "start") && sn(an());
4159
4159
  const c = {
4160
4160
  display: d !== "none",
@@ -4191,7 +4191,7 @@ function ql({ idx: s }) {
4191
4191
  /* @__PURE__ */ e.jsx(
4192
4192
  O,
4193
4193
  {
4194
- onClick: () => i("none", s),
4194
+ onClick: () => o("none", s),
4195
4195
  size: "sm",
4196
4196
  variant: "secondary",
4197
4197
  className: "h-7 p-1 text-xs font-normal",
@@ -4201,7 +4201,7 @@ function ql({ idx: s }) {
4201
4201
  /* @__PURE__ */ e.jsx(
4202
4202
  O,
4203
4203
  {
4204
- onClick: () => i("start", s),
4204
+ onClick: () => o("start", s),
4205
4205
  size: "sm",
4206
4206
  variant: "secondary",
4207
4207
  className: "h-7 p-1 text-xs font-normal",
@@ -4218,7 +4218,7 @@ function ql({ idx: s }) {
4218
4218
  /* @__PURE__ */ e.jsx(
4219
4219
  O,
4220
4220
  {
4221
- onClick: () => i("center", s),
4221
+ onClick: () => o("center", s),
4222
4222
  size: "sm",
4223
4223
  variant: "secondary",
4224
4224
  className: "h-7 p-1 text-xs font-normal",
@@ -4235,7 +4235,7 @@ function ql({ idx: s }) {
4235
4235
  /* @__PURE__ */ e.jsx(
4236
4236
  O,
4237
4237
  {
4238
- onClick: () => i("end", s),
4238
+ onClick: () => o("end", s),
4239
4239
  size: "sm",
4240
4240
  variant: "secondary",
4241
4241
  className: "h-7 p-1 text-xs font-normal",
@@ -4260,15 +4260,15 @@ function Za() {
4260
4260
  }
4261
4261
  ), { data: a } = De(s), t = n === "y" ? "Y axis" : "X axis", l = n === "y" ? "X axis" : "Y axis", {
4262
4262
  keys: r,
4263
- metricKeys: i,
4264
- dimensionKeys: o
4263
+ metricKeys: o,
4264
+ dimensionKeys: i
4265
4265
  } = js((a == null ? void 0 : a.records) || []);
4266
- let d = i;
4266
+ let d = o;
4267
4267
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4268
4268
  const x = tn({
4269
4269
  dataArray: (a == null ? void 0 : a.records) || [],
4270
- groupKey: o[0],
4271
- pivotKey: o[1],
4270
+ groupKey: i[0],
4271
+ pivotKey: i[1],
4272
4272
  valueKey: d[0]
4273
4273
  }), { metricKeys: c } = js(x);
4274
4274
  d = c;
@@ -4276,7 +4276,7 @@ function Za() {
4276
4276
  return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4277
4277
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4278
4278
  /* @__PURE__ */ e.jsx(H, { children: t }),
4279
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: o[0] }) }) })
4279
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: i[0] }) }) })
4280
4280
  ] }),
4281
4281
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4282
4282
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
@@ -4288,16 +4288,16 @@ function Za() {
4288
4288
  ] });
4289
4289
  }
4290
4290
  function Rl({ col: s, idx: n }) {
4291
- const a = u((o) => {
4291
+ const a = u((i) => {
4292
4292
  var d;
4293
- return (d = o.card) == null ? void 0 : d.preferences;
4293
+ return (d = i.card) == null ? void 0 : d.preferences;
4294
4294
  }), t = u(
4295
- (o) => {
4295
+ (i) => {
4296
4296
  var d;
4297
- return (d = o.card.preferences) == null ? void 0 : d.datasetOptions;
4297
+ return (d = i.card.preferences) == null ? void 0 : d.datasetOptions;
4298
4298
  }
4299
- ), l = t == null ? void 0 : t.find((o) => o.idx === n), { setCardPreferences: r } = u((o) => o.actions);
4300
- function i(o) {
4299
+ ), l = t == null ? void 0 : t.find((i) => i.idx === n), { setCardPreferences: r } = u((i) => i.actions);
4300
+ function o(i) {
4301
4301
  if (!l)
4302
4302
  r({
4303
4303
  ...a,
@@ -4305,14 +4305,14 @@ function Rl({ col: s, idx: n }) {
4305
4305
  ...t || [],
4306
4306
  {
4307
4307
  idx: n,
4308
- type: o === "area" ? "line" : o,
4309
- fill: o === "area" ? "origin" : ""
4308
+ type: i === "area" ? "line" : i,
4309
+ fill: i === "area" ? "origin" : ""
4310
4310
  }
4311
4311
  ]
4312
4312
  });
4313
4313
  else {
4314
4314
  const d = { ...l };
4315
- d.type = o === "area" ? "line" : o, d.fill = o === "area" ? "origin" : "";
4315
+ d.type = i === "area" ? "line" : i, d.fill = i === "area" ? "origin" : "";
4316
4316
  const x = t == null ? void 0 : t.map(
4317
4317
  (c) => c.idx === n ? d : c
4318
4318
  );
@@ -4328,21 +4328,21 @@ function Rl({ col: s, idx: n }) {
4328
4328
  /* @__PURE__ */ e.jsx(
4329
4329
  qs,
4330
4330
  {
4331
- onClick: () => i("bar"),
4331
+ onClick: () => o("bar"),
4332
4332
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4333
4333
  }
4334
4334
  ),
4335
4335
  /* @__PURE__ */ e.jsx(
4336
4336
  Rs,
4337
4337
  {
4338
- onClick: () => i("line"),
4338
+ onClick: () => o("line"),
4339
4339
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4340
4340
  }
4341
4341
  ),
4342
4342
  /* @__PURE__ */ e.jsx(
4343
4343
  wn,
4344
4344
  {
4345
- onClick: () => i("area"),
4345
+ onClick: () => o("area"),
4346
4346
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4347
4347
  }
4348
4348
  ),
@@ -4351,7 +4351,7 @@ function Rl({ col: s, idx: n }) {
4351
4351
  ] });
4352
4352
  }
4353
4353
  function et() {
4354
- const s = u((g) => g.selectedConnectionId), n = u((g) => g.selectedDatamodelId), a = u((g) => g.selectedDatabaseName), t = u((g) => g.selectedSchemaName), l = u((g) => g.selectedTableName), r = M((g) => g.dashboard.filters) || [], i = M((g) => g.actions.addFilter), o = M((g) => g.actions.removeFilter), { removeFilterValues: d } = is(), { modelItems: x, tableName: c } = qe();
4354
+ const s = u((g) => g.selectedConnectionId), n = u((g) => g.selectedDatamodelId), a = u((g) => g.selectedDatabaseName), t = u((g) => g.selectedSchemaName), l = u((g) => g.selectedTableName), r = M((g) => g.dashboard.filters) || [], o = M((g) => g.actions.addFilter), i = M((g) => g.actions.removeFilter), { removeFilterValues: d } = is(), { modelItems: x, tableName: c } = qe();
4355
4355
  function b(g, h = "dashboard") {
4356
4356
  var L;
4357
4357
  const f = ce(g.column_name), p = ce(a || ""), N = ce(t || ""), y = ce(c);
@@ -4367,10 +4367,10 @@ function et() {
4367
4367
  (V) => V.column === I && V.table === y && (V.database === p || V.database === a)
4368
4368
  );
4369
4369
  if (T)
4370
- d(T.id), o(T.id);
4370
+ d(T.id), i(T.id);
4371
4371
  else {
4372
4372
  const V = Ue();
4373
- return c === "api" && s ? (i({
4373
+ return c === "api" && s ? (o({
4374
4374
  location: h,
4375
4375
  id: V,
4376
4376
  //uuidv4(),
@@ -4388,7 +4388,7 @@ function et() {
4388
4388
  f
4389
4389
  )
4390
4390
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4391
- }), V) : (i({
4391
+ }), V) : (o({
4392
4392
  id: V,
4393
4393
  //uuidv4(),
4394
4394
  location: h,
@@ -4413,24 +4413,24 @@ function et() {
4413
4413
  }
4414
4414
  function Re() {
4415
4415
  const s = M(
4416
- (o) => o.dashboard.filters
4417
- ), n = u((o) => o.frame), { setFrame: a } = ne(), { columns: t } = qe(), { assignFilter: l } = et();
4418
- function r(o) {
4419
- const d = l(o, "frame");
4416
+ (i) => i.dashboard.filters
4417
+ ), n = u((i) => i.frame), { setFrame: a } = ne(), { columns: t } = qe(), { assignFilter: l } = et();
4418
+ function r(i) {
4419
+ const d = l(i, "frame");
4420
4420
  a({ ...n, filterId: d });
4421
4421
  }
4422
- const i = s == null ? void 0 : s.find((o) => o.id === n.filterId);
4422
+ const o = s == null ? void 0 : s.find((i) => i.id === n.filterId);
4423
4423
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4424
4424
  /* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
4425
4425
  /* @__PURE__ */ e.jsx(_l, { onSelect: r, columns: t }),
4426
- i && /* @__PURE__ */ e.jsx(ka, { filter: i })
4426
+ o && /* @__PURE__ */ e.jsx(ka, { filter: o })
4427
4427
  ] });
4428
4428
  }
4429
4429
  function _l({
4430
4430
  columns: s,
4431
4431
  onSelect: n
4432
4432
  }) {
4433
- var i;
4433
+ var o;
4434
4434
  const [a, t] = Ys.useState(!1), [l, r] = Ys.useState("");
4435
4435
  return /* @__PURE__ */ e.jsxs(ds, { open: a, onOpenChange: t, children: [
4436
4436
  /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
@@ -4442,7 +4442,7 @@ function _l({
4442
4442
  "aria-expanded": a,
4443
4443
  className: "w-full justify-between font-normal",
4444
4444
  children: [
4445
- l ? (i = s.find((o) => o.column_name === l)) == null ? void 0 : i.column_name : "Select Column...",
4445
+ l ? (o = s.find((i) => i.column_name === l)) == null ? void 0 : o.column_name : "Select Column...",
4446
4446
  /* @__PURE__ */ e.jsx(nn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4447
4447
  ]
4448
4448
  }
@@ -4451,28 +4451,28 @@ function _l({
4451
4451
  /* @__PURE__ */ e.jsx(rn, { placeholder: "Search column", className: "h-9" }),
4452
4452
  /* @__PURE__ */ e.jsxs(on, { children: [
4453
4453
  /* @__PURE__ */ e.jsx(cn, { children: "No framework found." }),
4454
- /* @__PURE__ */ e.jsx(dn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
4454
+ /* @__PURE__ */ e.jsx(dn, { children: s.map((i) => /* @__PURE__ */ e.jsxs(
4455
4455
  un,
4456
4456
  {
4457
- value: o.column_name,
4457
+ value: i.column_name,
4458
4458
  onSelect: (d) => {
4459
4459
  const x = d === l ? "" : d;
4460
- r(x), t(!1), x && n(o);
4460
+ r(x), t(!1), x && n(i);
4461
4461
  },
4462
4462
  children: [
4463
- o.column_name,
4463
+ i.column_name,
4464
4464
  /* @__PURE__ */ e.jsx(
4465
4465
  Na,
4466
4466
  {
4467
4467
  className: Y(
4468
4468
  "ml-auto h-4 w-4",
4469
- l === o.column_name ? "opacity-100" : "opacity-0"
4469
+ l === i.column_name ? "opacity-100" : "opacity-0"
4470
4470
  )
4471
4471
  }
4472
4472
  )
4473
4473
  ]
4474
4474
  },
4475
- o.column_name
4475
+ i.column_name
4476
4476
  )) })
4477
4477
  ] })
4478
4478
  ] }) })
@@ -4524,17 +4524,17 @@ function Hl({
4524
4524
  ] }) });
4525
4525
  }
4526
4526
  function Hs() {
4527
- var l, r, i;
4527
+ var l, r, o;
4528
4528
  const s = u(
4529
- (o) => o.card.cfg
4530
- ), n = u((o) => o.actions.setCardCfg), a = u((o) => o.card.type);
4531
- function t(o) {
4529
+ (i) => i.card.cfg
4530
+ ), n = u((i) => i.actions.setCardCfg), a = u((i) => i.card.type);
4531
+ function t(i) {
4532
4532
  var c;
4533
4533
  const d = {
4534
4534
  datalabels: {
4535
- display: o !== "none",
4536
- align: o,
4537
- anchor: o,
4535
+ display: i !== "none",
4536
+ align: i,
4537
+ anchor: i,
4538
4538
  clamp: !0
4539
4539
  }
4540
4540
  }, x = {
@@ -4547,7 +4547,7 @@ function Hs() {
4547
4547
  }
4548
4548
  }
4549
4549
  };
4550
- n(x), console.log(o);
4550
+ n(x), console.log(i);
4551
4551
  }
4552
4552
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4553
4553
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
@@ -4557,7 +4557,7 @@ function Hs() {
4557
4557
  /* @__PURE__ */ e.jsxs(
4558
4558
  ue,
4559
4559
  {
4560
- value: (i = (r = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : i.anchor,
4560
+ value: (o = (r = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : o.anchor,
4561
4561
  onValueChange: t,
4562
4562
  defaultValue: "none",
4563
4563
  children: [
@@ -4793,9 +4793,9 @@ function Kl() {
4793
4793
  var f, p;
4794
4794
  return (p = (f = h.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : p.colorRanges;
4795
4795
  }
4796
- ) || [], i = u(
4796
+ ) || [], o = u(
4797
4797
  (h) => h.actions.setColorRanges
4798
- ), o = [...new Set(ts.map((h) => h.currency))];
4798
+ ), i = [...new Set(ts.map((h) => h.currency))];
4799
4799
  return /* @__PURE__ */ e.jsxs("div", { children: [
4800
4800
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
4801
4801
  /* @__PURE__ */ e.jsx(
@@ -4864,7 +4864,7 @@ function Kl() {
4864
4864
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4865
4865
  /* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
4866
4866
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
4867
- o.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
4867
+ i.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
4868
4868
  ] }) })
4869
4869
  ]
4870
4870
  }
@@ -4921,7 +4921,7 @@ function Kl() {
4921
4921
  hn,
4922
4922
  {
4923
4923
  colorRanges: r,
4924
- setColorRanges: i
4924
+ setColorRanges: o
4925
4925
  }
4926
4926
  )
4927
4927
  ] })
@@ -5062,10 +5062,10 @@ function Xl() {
5062
5062
  var d, x, c, b, g, h, f, p, N, y, A, I, z, T, L, V, m, v;
5063
5063
  const s = u((j) => j.card), n = (x = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, t] = q(
5064
5064
  ((b = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
5065
- ), { setCardPreferences: l } = ne(), { data: r } = Es(s), i = Object.keys((r == null ? void 0 : r.objects) || {}).map((j) => ({
5065
+ ), { setCardPreferences: l } = ne(), { data: r } = Es(s), o = Object.keys((r == null ? void 0 : r.objects) || {}).map((j) => ({
5066
5066
  label: j,
5067
5067
  value: j
5068
- })) || [], o = [
5068
+ })) || [], i = [
5069
5069
  {
5070
5070
  label: "US States 10m",
5071
5071
  value: "https://unpkg.com/us-atlas/states-10m.json"
@@ -5087,7 +5087,7 @@ function Xl() {
5087
5087
  de,
5088
5088
  {
5089
5089
  className: "h-9",
5090
- options: o,
5090
+ options: i,
5091
5091
  onValueChange: (j) => {
5092
5092
  console.log("value", j), l({
5093
5093
  ...s.preferences,
@@ -5129,7 +5129,7 @@ function Xl() {
5129
5129
  de,
5130
5130
  {
5131
5131
  className: "h-9",
5132
- options: i,
5132
+ options: o,
5133
5133
  value: ((h = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
5134
5134
  label: "Map Object",
5135
5135
  onValueChange: (j) => {
@@ -5597,8 +5597,8 @@ function rr() {
5597
5597
  );
5598
5598
  }
5599
5599
  function ir({ authToken: s, onSave: n, onClose: a }) {
5600
- M((i) => i.themeStyle);
5601
- const t = u((i) => i.actions.setOnSave), l = u((i) => i.actions.setOnClose), r = M((i) => i.actions.setAuthToken);
5600
+ M((o) => o.themeStyle);
5601
+ const t = u((o) => o.actions.setOnSave), l = u((o) => o.actions.setOnClose), r = M((o) => o.actions.setAuthToken);
5602
5602
  return Z(() => {
5603
5603
  n && t(n), a && l(a);
5604
5604
  }, [n, t, a, l]), Z(() => {
@@ -5620,10 +5620,10 @@ function ir({ authToken: s, onSave: n, onClose: a }) {
5620
5620
  ) });
5621
5621
  }
5622
5622
  function or() {
5623
- M((i) => i.selectedCardId);
5624
- const s = M((i) => i.selectedSheetId), { setIsVisualEditing: n } = M((i) => i.actions), a = M((i) => i.isVisualEditing), t = M((i) => i.actions.updateFrame);
5625
- function l(i) {
5626
- s && (t(s, i), n(!1));
5623
+ M((o) => o.selectedCardId);
5624
+ const s = M((o) => o.selectedSheetId), { setIsVisualEditing: n } = M((o) => o.actions), a = M((o) => o.isVisualEditing), t = M((o) => o.actions.updateFrame);
5625
+ function l(o) {
5626
+ s && (t(s, o), n(!1));
5627
5627
  }
5628
5628
  function r() {
5629
5629
  n(!1);
@@ -5642,8 +5642,8 @@ function or() {
5642
5642
  function cr() {
5643
5643
  const s = u((r) => r.selectedDatabaseName), n = u((r) => r.selectedTableName), a = M((r) => r.dashboard.filters) || [], { columns: t } = qe(), { assignFilter: l } = et();
5644
5644
  return /* @__PURE__ */ e.jsx(fe, { className: "flex-1 basis-0 flex-col px-3", children: t == null ? void 0 : t.map((r) => {
5645
- const i = a == null ? void 0 : a.find(
5646
- (o) => o.column === ce(r.column_name) && o.table === n && o.database === s
5645
+ const o = a == null ? void 0 : a.find(
5646
+ (i) => i.column === ce(r.column_name) && i.table === n && i.database === s
5647
5647
  );
5648
5648
  return /* @__PURE__ */ e.jsx(
5649
5649
  "div",
@@ -5652,7 +5652,7 @@ function cr() {
5652
5652
  className: Y(
5653
5653
  "group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
5654
5654
  {
5655
- "bg-muted": i
5655
+ "bg-muted": o
5656
5656
  }
5657
5657
  ),
5658
5658
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [