react-semaphor 0.0.503 → 0.0.505

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,12 +1,12 @@
1
1
  var Ga = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var Ln = (t, a, n) => a.has(t) || Ga("Cannot " + n);
5
- var ue = (t, a, n) => (Ln(t, a, "read from private field"), n ? n.call(t) : a.get(t)), Ae = (t, a, n) => a.has(t) ? Ga("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, n), Se = (t, a, n, r) => (Ln(t, a, "write to private field"), r ? r.call(t, n) : a.set(t, n), n), ze = (t, a, n) => (Ln(t, a, "access private method"), n);
6
- import { jsxs as s, jsx as e, Fragment as ae } from "react/jsx-runtime";
7
- import { z as _r, A as Hn, B as $r, Q as us, C as ms, E as Gr, F as Jr, G as Hr, H as Ur, I as Yr, J as Kr, K as Ja, L as Ha, M as Qr, N as Wr, O as q, P as da, v as G, w as Ot, R as lt, T as pn, U as hs, V as P, W as ke, X as fn, Y as gn, Z as yn, _ as vn, $ as H, a0 as we, a1 as ps, a2 as fs, a3 as gs, a4 as se, a5 as ys, a6 as vs, a7 as bs, a8 as Zr, a9 as Ua, aa as _, ab as ua, ac as Xr, ad as le, ae as oe, af as ce, ag as de, ah as nt, ai as Ge, aj as U, ak as xs, al as Ye, am as Ke, an as It, ao as Ze, ap as gt, aq as yt, ar as Et, as as vt, at, au as Ns, av as Ut, aw as ma, ax as Cs, ay as ha, az as Un, aA as ws, x as T, aB as Ss, aC as kt, aD as jt, aE as At, aF as bn, aG as xn, aH as Nn, aI as Cn, aJ as wn, aK as Sn, aL as Yt, aM as qt, t as Pe, aN as ks, aO as Ms, aP as Ts, aQ as Ds, l as Os, k as Is, f as qe, aR as ei, e as _e, aS as ti, g as pt, h as $e, aT as Es, j as ni, aU as ai, aV as si, aW as it, aX as st, aY as As, aZ as ri, y as X, d as zs, a_ as Bt, a$ as Xe, b0 as ii, b1 as Yn, b2 as pa, b3 as fa, b4 as Kt, b5 as He, b6 as Fs, r as sn, p as Ya, b7 as Ee, b8 as li, b9 as bt, ba as oi, bb as ci, bc as di, bd as ui, be as Ls, bf as mi, bg as kn, bh as hi, bi as pi, bj as Kn, bk as be, bl as et, bm as Ce, bn as tt, bo as fi, bp as Rs, bq as Vs, br as js, bs as gi, bt as yi, bu as vi, bv as bi, bw as Rn, bx as xi, by as Ka, bz as Ni, bA as Qa, bB as Ci, bC as wi, bD as Si, bE as ki, bF as qs, bG as Mi, bH as ga, bI as Bs, bJ as Mn, bK as Ps, bL as Ct, bM as _s, bN as Ti, bO as $s, bP as Tn, bQ as Di, bR as Oi, bS as Gs, bT as Js, bU as Dn, bV as Hs, bW as Ii, bX as Qt, bY as Wt, bZ as Te, b_ as an, b$ as Ei, c0 as Ai, c1 as zi, c2 as ya, c3 as Us, c4 as Fi, c5 as rn, c6 as Ys, c7 as ln, c8 as Ks, c9 as Li, ca as Ri, cb as Vi, cc as Qs, cd as ji, ce as ot, cf as he, cg as pe, ch as fe, ci as On, cj as qi, ck as Bi, cl as Pi, cm as _i, q as $i, cn as Wa, co as Ws, cp as Gi, cq as Ji, cr as Hi, cs as Zs, ct as va, cu as zt, cv as ba, cw as Ue, cx as Ui, cy as Ft, cz as Xs, cA as Yi, cB as Ki, cC as Qi, cD as Wi, cE as Za, cF as Zi, cG as Xi, cH as el, cI as tl, cJ as nl, cK as al, cL as xa, cM as sl, cN as rl, cO as il, cP as ll, cQ as ol, cR as er, cS as Qn, cT as Vn, cU as cl, cV as Pt, cW as Je, cX as ge, cY as dl, cZ as ul, c_ as ml, c$ as Mt, d0 as Be, d1 as hl, d2 as pl, d3 as fl, d4 as Wn, d5 as Xa, d6 as Zn, d7 as Xn, d8 as on, d9 as Tt, da as _t, db as gl, dc as tr, dd as yl, de as vl, df as bl, dg as xl, dh as Nl, di as Cl } from "./index-CEr4Bl2R.js";
4
+ var Rn = (t, a, n) => a.has(t) || Ga("Cannot " + n);
5
+ var ue = (t, a, n) => (Rn(t, a, "read from private field"), n ? n.call(t) : a.get(t)), Ae = (t, a, n) => a.has(t) ? Ga("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, n), Se = (t, a, n, r) => (Rn(t, a, "write to private field"), r ? r.call(t, n) : a.set(t, n), n), ze = (t, a, n) => (Rn(t, a, "access private method"), n);
6
+ import { jsxs as s, jsx as e, Fragment as se } from "react/jsx-runtime";
7
+ import { z as _r, A as Un, B as $r, Q as us, C as ms, E as Gr, F as Jr, G as Hr, H as Ur, I as Yr, J as Kr, K as Ja, L as Ha, M as Qr, N as Wr, O as q, P as ua, v as G, w as It, R as lt, T as pn, U as hs, V as P, W as ke, X as fn, Y as gn, Z as yn, _ as bn, $ as H, a0 as we, a1 as ps, a2 as fs, a3 as gs, a4 as ae, a5 as ys, a6 as bs, a7 as vs, a8 as Zr, a9 as Ua, aa as _, ab as ma, ac as Xr, ad as le, ae as oe, af as ce, ag as de, ah as nt, ai as Ge, aj as U, ak as xs, al as Ye, am as Ke, an as Et, ao as Ze, ap as gt, aq as yt, ar as At, as as bt, at, au as Ns, av as Ut, aw as ha, ax as Cs, ay as pa, az as Yn, aA as ws, x as T, aB as Ss, aC as Mt, aD as jt, aE as vt, aF as vn, aG as xn, aH as Nn, aI as Cn, aJ as wn, aK as Sn, aL as Yt, aM as qt, t as Pe, aN as ks, aO as Ms, aP as Ts, aQ as Ds, l as Os, k as Is, f as qe, aR as ei, e as _e, aS as ti, g as pt, h as $e, aT as Es, j as ni, aU as ai, aV as si, aW as it, aX as st, aY as As, aZ as ri, y as X, d as zs, a_ as Bt, a$ as Xe, b0 as ii, b1 as Kn, b2 as fa, b3 as ga, b4 as Kt, b5 as He, b6 as Fs, r as sn, p as Ya, b7 as Ee, b8 as li, b9 as xt, ba as oi, bb as ci, bc as di, bd as ui, be as Ls, bf as mi, bg as kn, bh as hi, bi as pi, bj as Qn, bk as ve, bl as et, bm as Ce, bn as tt, bo as fi, bp as Rs, bq as Vs, br as js, bs as gi, bt as yi, bu as bi, bv as vi, bw as Vn, bx as xi, by as Ka, bz as Ni, bA as Qa, bB as Ci, bC as wi, bD as Si, bE as ki, bF as qs, bG as Mi, bH as ya, bI as Bs, bJ as Mn, bK as Ps, bL as wt, bM as _s, bN as Ti, bO as $s, bP as Tn, bQ as Di, bR as Oi, bS as Gs, bT as Js, bU as Dn, bV as Hs, bW as Ii, bX as Qt, bY as Wt, bZ as Te, b_ as an, b$ as Ei, c0 as Ai, c1 as zi, c2 as ba, c3 as Us, c4 as Fi, c5 as rn, c6 as Ys, c7 as ln, c8 as Ks, c9 as Li, ca as Ri, cb as Vi, cc as Qs, cd as ji, ce as ot, cf as he, cg as pe, ch as fe, ci as On, cj as qi, ck as Bi, cl as Pi, cm as _i, q as $i, cn as Wa, co as Ws, cp as Gi, cq as Ji, cr as Hi, cs as Zs, ct as va, cu as zt, cv as xa, cw as Ue, cx as Ui, cy as Ft, cz as Xs, cA as Yi, cB as Ki, cC as Qi, cD as Wi, cE as Za, cF as Zi, cG as Xi, cH as el, cI as tl, cJ as nl, cK as al, cL as In, cM as sl, cN as rl, cO as il, cP as ll, cQ as ol, cR as er, cS as Wn, cT as jn, cU as cl, cV as Pt, cW as Je, cX as ge, cY as dl, cZ as ul, c_ as ml, c$ as Tt, d0 as Be, d1 as hl, d2 as pl, d3 as fl, d4 as Zn, d5 as Xa, d6 as Xn, d7 as ea, d8 as on, d9 as Dt, da as _t, db as gl, dc as tr, dd as yl, de as bl, df as vl, dg as xl, dh as Nl, di as Cl } from "./index-CPLZoYFD.js";
8
8
  import * as Ie from "react";
9
- import Le, { useState as V, useMemo as rt, useRef as ft, useCallback as Ne, useEffect as ve, Suspense as wl } from "react";
9
+ import Le, { useState as V, useMemo as rt, useRef as ft, useCallback as Ne, useEffect as be, Suspense as wl } from "react";
10
10
  import "react-dom";
11
11
  function es(t, a) {
12
12
  return t.filter((n) => !a.includes(n));
@@ -15,25 +15,25 @@ function Sl(t, a, n) {
15
15
  const r = t.slice(0);
16
16
  return r[a] = n, r;
17
17
  }
18
- var dt, De, wt, St, Oe, We, Gt, Jt, Ht, xe, ea, ta, na, aa, sa, ds, kl = (ds = class extends _r {
18
+ var dt, De, St, kt, Oe, We, Gt, Jt, Ht, xe, ta, na, aa, sa, ra, ds, kl = (ds = class extends _r {
19
19
  constructor(a, n, r) {
20
20
  super();
21
21
  Ae(this, xe);
22
22
  Ae(this, dt);
23
23
  Ae(this, De);
24
- Ae(this, wt);
25
24
  Ae(this, St);
25
+ Ae(this, kt);
26
26
  Ae(this, Oe);
27
27
  Ae(this, We);
28
28
  Ae(this, Gt);
29
29
  Ae(this, Jt);
30
30
  Ae(this, Ht, []);
31
- Se(this, dt, a), Se(this, St, r), Se(this, wt, []), Se(this, Oe, []), Se(this, De, []), this.setQueries(n);
31
+ Se(this, dt, a), Se(this, kt, r), Se(this, St, []), Se(this, Oe, []), Se(this, De, []), this.setQueries(n);
32
32
  }
33
33
  onSubscribe() {
34
34
  this.listeners.size === 1 && ue(this, Oe).forEach((a) => {
35
35
  a.subscribe((n) => {
36
- ze(this, xe, aa).call(this, a, n);
36
+ ze(this, xe, sa).call(this, a, n);
37
37
  });
38
38
  });
39
39
  }
@@ -46,7 +46,7 @@ var dt, De, wt, St, Oe, We, Gt, Jt, Ht, xe, ea, ta, na, aa, sa, ds, kl = (ds = c
46
46
  });
47
47
  }
48
48
  setQueries(a, n, r) {
49
- if (Se(this, wt, a), Se(this, St, n), process.env.NODE_ENV !== "production") {
49
+ if (Se(this, St, a), Se(this, kt, n), process.env.NODE_ENV !== "production") {
50
50
  const i = a.map(
51
51
  (l) => ue(this, dt).defaultQueryOptions(l).queryHash
52
52
  );
@@ -54,8 +54,8 @@ var dt, De, wt, St, Oe, We, Gt, Jt, Ht, xe, ea, ta, na, aa, sa, ds, kl = (ds = c
54
54
  "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior."
55
55
  );
56
56
  }
57
- Hn.batch(() => {
58
- const i = ue(this, Oe), l = ze(this, xe, na).call(this, ue(this, wt));
57
+ Un.batch(() => {
58
+ const i = ue(this, Oe), l = ze(this, xe, aa).call(this, ue(this, St));
59
59
  Se(this, Ht, l), l.forEach(
60
60
  (h) => h.observer.setOptions(h.defaultedQueryOptions, r)
61
61
  );
@@ -68,9 +68,9 @@ var dt, De, wt, St, Oe, We, Gt, Jt, Ht, xe, ea, ta, na, aa, sa, ds, kl = (ds = c
68
68
  h.destroy();
69
69
  }), es(o, i).forEach((h) => {
70
70
  h.subscribe((d) => {
71
- ze(this, xe, aa).call(this, h, d);
71
+ ze(this, xe, sa).call(this, h, d);
72
72
  });
73
- }), ze(this, xe, sa).call(this)));
73
+ }), ze(this, xe, ra).call(this)));
74
74
  });
75
75
  }
76
76
  getCurrentResult() {
@@ -83,16 +83,16 @@ var dt, De, wt, St, Oe, We, Gt, Jt, Ht, xe, ea, ta, na, aa, sa, ds, kl = (ds = c
83
83
  return ue(this, Oe);
84
84
  }
85
85
  getOptimisticResult(a, n) {
86
- const r = ze(this, xe, na).call(this, a), i = r.map(
86
+ const r = ze(this, xe, aa).call(this, a), i = r.map(
87
87
  (l) => l.observer.getOptimisticResult(l.defaultedQueryOptions)
88
88
  );
89
89
  return [
90
90
  i,
91
- (l) => ze(this, xe, ta).call(this, l ?? i, n),
92
- () => ze(this, xe, ea).call(this, i, r)
91
+ (l) => ze(this, xe, na).call(this, l ?? i, n),
92
+ () => ze(this, xe, ta).call(this, i, r)
93
93
  ];
94
94
  }
95
- }, dt = new WeakMap(), De = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Oe = new WeakMap(), We = new WeakMap(), Gt = new WeakMap(), Jt = new WeakMap(), Ht = new WeakMap(), xe = new WeakSet(), ea = function(a, n) {
95
+ }, dt = new WeakMap(), De = new WeakMap(), St = new WeakMap(), kt = new WeakMap(), Oe = new WeakMap(), We = new WeakMap(), Gt = new WeakMap(), Jt = new WeakMap(), Ht = new WeakMap(), xe = new WeakSet(), ta = function(a, n) {
96
96
  return n.map((r, i) => {
97
97
  const l = a[i];
98
98
  return r.defaultedQueryOptions.notifyOnChangeProps ? l : r.observer.trackResult(l, (o) => {
@@ -101,12 +101,12 @@ var dt, De, wt, St, Oe, We, Gt, Jt, Ht, xe, ea, ta, na, aa, sa, ds, kl = (ds = c
101
101
  });
102
102
  });
103
103
  });
104
- }, ta = function(a, n) {
104
+ }, na = function(a, n) {
105
105
  return n ? ((!ue(this, We) || ue(this, De) !== ue(this, Jt) || n !== ue(this, Gt)) && (Se(this, Gt, n), Se(this, Jt, ue(this, De)), Se(this, We, $r(
106
106
  ue(this, We),
107
107
  n(a)
108
108
  ))), ue(this, We)) : a;
109
- }, na = function(a) {
109
+ }, aa = function(a) {
110
110
  const n = new Map(
111
111
  ue(this, Oe).map((i) => [i.options.queryHash, i])
112
112
  ), r = [];
@@ -120,14 +120,14 @@ var dt, De, wt, St, Oe, We, Gt, Jt, Ht, xe, ea, ta, na, aa, sa, ds, kl = (ds = c
120
120
  observer: new us(ue(this, dt), l)
121
121
  });
122
122
  }), r;
123
- }, aa = function(a, n) {
123
+ }, sa = function(a, n) {
124
124
  const r = ue(this, Oe).indexOf(a);
125
- r !== -1 && (Se(this, De, Sl(ue(this, De), r, n)), ze(this, xe, sa).call(this));
126
- }, sa = function() {
125
+ r !== -1 && (Se(this, De, Sl(ue(this, De), r, n)), ze(this, xe, ra).call(this));
126
+ }, ra = function() {
127
127
  var a;
128
128
  if (this.hasListeners()) {
129
- const n = ue(this, We), r = ze(this, xe, ea).call(this, ue(this, De), ue(this, Ht)), i = ze(this, xe, ta).call(this, r, (a = ue(this, St)) == null ? void 0 : a.combine);
130
- n !== i && Hn.batch(() => {
129
+ const n = ue(this, We), r = ze(this, xe, ta).call(this, ue(this, De), ue(this, Ht)), i = ze(this, xe, na).call(this, r, (a = ue(this, kt)) == null ? void 0 : a.combine);
130
+ n !== i && Un.batch(() => {
131
131
  this.listeners.forEach((l) => {
132
132
  l(ue(this, De));
133
133
  });
@@ -162,7 +162,7 @@ function Ml({
162
162
  ), m = !i && a.subscribed !== !1;
163
163
  Ie.useSyncExternalStore(
164
164
  Ie.useCallback(
165
- (p) => m ? u.subscribe(Hn.batchCalls(p)) : Kr,
165
+ (p) => m ? u.subscribe(Un.batchCalls(p)) : Kr,
166
166
  [u, m]
167
167
  ),
168
168
  () => u.getCurrentResult(),
@@ -271,7 +271,7 @@ const El = q("ArrowDownZA", [
271
271
  * This source code is licensed under the ISC license.
272
272
  * See the LICENSE file in the root directory of this source tree.
273
273
  */
274
- const In = q("ArrowDown", [
274
+ const En = q("ArrowDown", [
275
275
  ["path", { d: "M12 5v14", key: "s699le" }],
276
276
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
277
277
  ]);
@@ -339,7 +339,7 @@ const Rl = q("ArrowUpAZ", [
339
339
  * This source code is licensed under the ISC license.
340
340
  * See the LICENSE file in the root directory of this source tree.
341
341
  */
342
- const En = q("ArrowUp", [
342
+ const An = q("ArrowUp", [
343
343
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
344
344
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
345
345
  ]);
@@ -473,7 +473,7 @@ const _l = q("ChartArea", [
473
473
  * This source code is licensed under the ISC license.
474
474
  * See the LICENSE file in the root directory of this source tree.
475
475
  */
476
- const An = q("ChartColumnIncreasing", [
476
+ const zn = q("ChartColumnIncreasing", [
477
477
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
478
478
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
479
479
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
@@ -510,7 +510,7 @@ const Ca = q("ChartColumn", [
510
510
  * This source code is licensed under the ISC license.
511
511
  * See the LICENSE file in the root directory of this source tree.
512
512
  */
513
- const zn = q("ChartLine", [
513
+ const Fn = q("ChartLine", [
514
514
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
515
515
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
516
516
  ]);
@@ -1078,7 +1078,7 @@ const rr = q("RefreshCw", [
1078
1078
  * This source code is licensed under the ISC license.
1079
1079
  * See the LICENSE file in the root directory of this source tree.
1080
1080
  */
1081
- const vo = q("Rows3", [
1081
+ const bo = q("Rows3", [
1082
1082
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
1083
1083
  ["path", { d: "M21 9H3", key: "1338ky" }],
1084
1084
  ["path", { d: "M21 15H3", key: "9uk58r" }]
@@ -1089,7 +1089,7 @@ const vo = q("Rows3", [
1089
1089
  * This source code is licensed under the ISC license.
1090
1090
  * See the LICENSE file in the root directory of this source tree.
1091
1091
  */
1092
- const bo = q("Save", [
1092
+ const vo = q("Save", [
1093
1093
  [
1094
1094
  "path",
1095
1095
  {
@@ -1159,7 +1159,7 @@ const No = q("Square", [
1159
1159
  * This source code is licensed under the ISC license.
1160
1160
  * See the LICENSE file in the root directory of this source tree.
1161
1161
  */
1162
- const Fn = q("Table2", [
1162
+ const Ln = q("Table2", [
1163
1163
  [
1164
1164
  "path",
1165
1165
  {
@@ -1286,18 +1286,18 @@ async function ko(t, a, n, r) {
1286
1286
  if (!r)
1287
1287
  return null;
1288
1288
  const i = JSON.stringify(a);
1289
- return await da("https://semaphor.cloud/api/v1/lens", r, {
1289
+ return await ua("https://semaphor.cloud/api/v1/lens", r, {
1290
1290
  name: t,
1291
1291
  template: i,
1292
1292
  filterValues: n,
1293
1293
  operation: "create"
1294
1294
  });
1295
1295
  }
1296
- async function ra(t, a) {
1296
+ async function ia(t, a) {
1297
1297
  if (!a)
1298
1298
  return null;
1299
1299
  const { id: n, template: r, filterValues: i, isDefault: l, shared: o } = t;
1300
- return await da("https://semaphor.cloud/api/v1/lens", a, {
1300
+ return await ua("https://semaphor.cloud/api/v1/lens", a, {
1301
1301
  lensId: n,
1302
1302
  template: r,
1303
1303
  filterValues: i,
@@ -1307,13 +1307,13 @@ async function ra(t, a) {
1307
1307
  });
1308
1308
  }
1309
1309
  async function Mo(t, a) {
1310
- return a ? await da("https://semaphor.cloud/api/v1/lens", a, {
1310
+ return a ? await ua("https://semaphor.cloud/api/v1/lens", a, {
1311
1311
  operation: "delete",
1312
1312
  lensId: t
1313
1313
  }) : null;
1314
1314
  }
1315
1315
  function To() {
1316
- const [t, a] = V(""), [n, r] = V(!1), i = G((p) => p.lenses), { setLenses: l, setSelectedLensId: o } = Ot(), [u, c] = V(!1), [h, d] = V(!1), m = G((p) => p.dashboard), C = G((p) => p.filterValues), { authToken: g } = lt();
1316
+ const [t, a] = V(""), [n, r] = V(!1), i = G((p) => p.lenses), { setLenses: l, setSelectedLensId: o } = It(), [u, c] = V(!1), [h, d] = V(!1), m = G((p) => p.dashboard), C = G((p) => p.filterValues), { authToken: g } = lt();
1317
1317
  async function y() {
1318
1318
  c(!0);
1319
1319
  const p = dr(
@@ -1342,7 +1342,7 @@ function To() {
1342
1342
  /* @__PURE__ */ s(fn, { className: "sm:max-w-[425px]", children: [
1343
1343
  /* @__PURE__ */ s(gn, { children: [
1344
1344
  /* @__PURE__ */ e(yn, { children: "Create Lens" }),
1345
- /* @__PURE__ */ e(vn, { children: "Lenses are private by default and are only visible to you." })
1345
+ /* @__PURE__ */ e(bn, { children: "Lenses are private by default and are only visible to you." })
1346
1346
  ] }),
1347
1347
  /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-8 items-center gap-4", children: [
1348
1348
  /* @__PURE__ */ e(H, { className: "text-right", children: "Name" }),
@@ -1374,7 +1374,7 @@ function To() {
1374
1374
  ] });
1375
1375
  }
1376
1376
  function Do() {
1377
- const [t, a] = V(!1), n = G((d) => d.lenses), r = G((d) => d.selectedLensId), { setLenses: i, setSelectedLensId: l } = Ot(), { authToken: o } = lt();
1377
+ const [t, a] = V(!1), n = G((d) => d.lenses), r = G((d) => d.selectedLensId), { setLenses: i, setSelectedLensId: l } = It(), { authToken: o } = lt();
1378
1378
  async function u(d) {
1379
1379
  l(d);
1380
1380
  }
@@ -1397,21 +1397,21 @@ function Do() {
1397
1397
  ...d,
1398
1398
  isDefault: !d.isDefault
1399
1399
  };
1400
- await ra(C, o == null ? void 0 : o.accessToken);
1400
+ await ia(C, o == null ? void 0 : o.accessToken);
1401
1401
  const g = n == null ? void 0 : n.find((y) => y.isDefault);
1402
1402
  if (g && g.id !== d.id) {
1403
1403
  const y = {
1404
1404
  ...g,
1405
1405
  isDefault: !1
1406
1406
  };
1407
- await ra(y, o == null ? void 0 : o.accessToken);
1407
+ await ia(y, o == null ? void 0 : o.accessToken);
1408
1408
  }
1409
1409
  }
1410
1410
  return /* @__PURE__ */ s(fs, { open: t, onOpenChange: a, children: [
1411
- /* @__PURE__ */ e(gs, { asChild: !0, children: /* @__PURE__ */ e(se, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(no, { className: "h-4 w-4" }) }) }),
1411
+ /* @__PURE__ */ e(gs, { asChild: !0, children: /* @__PURE__ */ e(ae, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(no, { className: "h-4 w-4" }) }) }),
1412
1412
  /* @__PURE__ */ s(ys, { align: "end", className: "w-60", children: [
1413
- /* @__PURE__ */ e(vs, { className: "px-3", children: "Lenses" }),
1414
- /* @__PURE__ */ e(bs, {}),
1413
+ /* @__PURE__ */ e(bs, { className: "px-3", children: "Lenses" }),
1414
+ /* @__PURE__ */ e(vs, {}),
1415
1415
  /* @__PURE__ */ s(
1416
1416
  Zr,
1417
1417
  {
@@ -1444,7 +1444,7 @@ function Do() {
1444
1444
  }
1445
1445
  ),
1446
1446
  /* @__PURE__ */ e(
1447
- ua,
1447
+ ma,
1448
1448
  {
1449
1449
  onClick: (m) => {
1450
1450
  m.preventDefault(), c(d.id);
@@ -1506,7 +1506,7 @@ function Io({
1506
1506
  await Oo();
1507
1507
  }
1508
1508
  return /* @__PURE__ */ e(
1509
- se,
1509
+ ae,
1510
1510
  {
1511
1511
  tooltip: "Download PDF",
1512
1512
  className: "h-7 p-2",
@@ -1569,14 +1569,14 @@ function Eo({
1569
1569
  } = Ao(), [u, c] = V(""), [h, d] = V(as[0].value), [m, C] = V("06:00"), [g, y] = V("");
1570
1570
  return /* @__PURE__ */ e(xs, { delayDuration: 0, children: /* @__PURE__ */ s(Ye, { children: [
1571
1571
  /* @__PURE__ */ e(Ke, { asChild: !0, children: /* @__PURE__ */ e(
1572
- se,
1572
+ ae,
1573
1573
  {
1574
1574
  tooltip: "Schedule Dashboard",
1575
1575
  className: _("h-7 p-2", t),
1576
1576
  children: /* @__PURE__ */ e(Jl, { className: "size-4" })
1577
1577
  }
1578
1578
  ) }),
1579
- /* @__PURE__ */ e(It, { align: "end", className: "w-80", children: /* @__PURE__ */ s("div", { className: "grid gap-4", children: [
1579
+ /* @__PURE__ */ e(Et, { align: "end", className: "w-80", children: /* @__PURE__ */ s("div", { className: "grid gap-4", children: [
1580
1580
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
1581
1581
  /* @__PURE__ */ e("h4", { className: "font-medium leading-none", children: "Schedule Subscription" }),
1582
1582
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Subscribe to receive dashboard via email" })
@@ -1652,8 +1652,8 @@ function Eo({
1652
1652
  i === "loading" && /* @__PURE__ */ e(Re, { className: "mr-2 size-4 animate-spin" }),
1653
1653
  i === "success" && /* @__PURE__ */ e(gt, { className: "mr-2 size-4" }),
1654
1654
  i === "error" && /* @__PURE__ */ s(yt, { children: [
1655
- /* @__PURE__ */ e(Et, { children: /* @__PURE__ */ e(ar, { className: "mr-2 size-4 text-destructive" }) }),
1656
- /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ e("p", { children: l }) })
1655
+ /* @__PURE__ */ e(At, { children: /* @__PURE__ */ e(ar, { className: "mr-2 size-4 text-destructive" }) }),
1656
+ /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ e("p", { children: l }) })
1657
1657
  ] }),
1658
1658
  "Schedule"
1659
1659
  ]
@@ -1690,7 +1690,7 @@ function Eo({
1690
1690
  ),
1691
1691
  /* @__PURE__ */ e(ss, { tooltip: `${p.endUserEmail}`, children: /* @__PURE__ */ e(mo, { className: "size-3.5" }) }),
1692
1692
  o === p.id ? /* @__PURE__ */ e(Re, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ e(
1693
- ma,
1693
+ ha,
1694
1694
  {
1695
1695
  onClick: () => r(p.id),
1696
1696
  className: "size-3.5 cursor-pointer"
@@ -1710,14 +1710,14 @@ const ss = ({
1710
1710
  children: t,
1711
1711
  tooltip: a
1712
1712
  }) => /* @__PURE__ */ e(xs, { delayDuration: 0, children: /* @__PURE__ */ s(yt, { children: [
1713
- /* @__PURE__ */ e(Et, { asChild: !0, children: t }),
1714
- /* @__PURE__ */ e(vt, { children: a })
1713
+ /* @__PURE__ */ e(At, { asChild: !0, children: t }),
1714
+ /* @__PURE__ */ e(bt, { children: a })
1715
1715
  ] }) });
1716
1716
  function Ao() {
1717
1717
  const [t, a] = V("idle"), [n, r] = V(""), [i, l] = V(null), o = G((E) => E.authToken), u = G((E) => E.dashboard.id), c = G((E) => E.dashboard.title), { endUserId: h } = Cs((o == null ? void 0 : o.accessToken) || ""), d = "https://semaphor.cloud/api/v1/subscriptions/get", m = {
1718
1718
  dashboardId: u,
1719
1719
  endUserId: h
1720
- }, { data: C, isLoading: g, isError: y, isFetching: p, refetch: N } = ha({
1720
+ }, { data: C, isLoading: g, isError: y, isFetching: p, refetch: N } = pa({
1721
1721
  queryKey: ["subscriptions", u, h],
1722
1722
  queryFn: () => ws(d, (o == null ? void 0 : o.accessToken) || "", m),
1723
1723
  enabled: !!(o != null && o.accessToken) && !!u && !!h
@@ -1725,12 +1725,12 @@ function Ao() {
1725
1725
  async function f({
1726
1726
  email: E,
1727
1727
  subject: D,
1728
- frequency: v,
1728
+ frequency: b,
1729
1729
  time: x
1730
1730
  }) {
1731
- const { authToken: b, ...S } = ur(), O = Intl.DateTimeFormat().resolvedOptions().timeZone, I = {
1731
+ const { authToken: v, ...S } = ur(), O = Intl.DateTimeFormat().resolvedOptions().timeZone, I = {
1732
1732
  email: E,
1733
- frequency: v,
1733
+ frequency: b,
1734
1734
  time: x,
1735
1735
  timezone: O,
1736
1736
  endUserId: h,
@@ -1742,9 +1742,9 @@ function Ao() {
1742
1742
  a("loading");
1743
1743
  const w = "https://semaphor.cloud/api/v1/subscriptions/create";
1744
1744
  try {
1745
- const L = await Un(
1745
+ const L = await Yn(
1746
1746
  w,
1747
- (b == null ? void 0 : b.accessToken) || "",
1747
+ (v == null ? void 0 : v.accessToken) || "",
1748
1748
  {
1749
1749
  ...I
1750
1750
  }
@@ -1760,11 +1760,11 @@ function Ao() {
1760
1760
  const D = "https://semaphor.cloud/api/v1/subscriptions/delete";
1761
1761
  l(E);
1762
1762
  try {
1763
- await Un(D, (o == null ? void 0 : o.accessToken) || "", { id: E }), N(), setTimeout(() => {
1763
+ await Yn(D, (o == null ? void 0 : o.accessToken) || "", { id: E }), N(), setTimeout(() => {
1764
1764
  l(null);
1765
1765
  }, 2e3);
1766
- } catch (v) {
1767
- console.error(v), l(null), a("error"), r(v.message);
1766
+ } catch (b) {
1767
+ console.error(b), l(null), a("error"), r(b.message);
1768
1768
  }
1769
1769
  }
1770
1770
  return {
@@ -1797,14 +1797,14 @@ function zo() {
1797
1797
  (I) => I.actions.setShowFilters
1798
1798
  ), { addFrame: y, setSelectedFrameId: p } = G(
1799
1799
  (I) => I.actions
1800
- ), { getSelectedSheet: N, setIsDashboardEditing: f, setShowDashboardJSON: M } = G((I) => I.actions), E = N(), { tenantId: D, endUserId: v } = rt(
1800
+ ), { getSelectedSheet: N, setIsDashboardEditing: f, setShowDashboardJSON: M } = G((I) => I.actions), E = N(), { tenantId: D, endUserId: b } = rt(
1801
1801
  () => Cs(t == null ? void 0 : t.accessToken),
1802
1802
  [t == null ? void 0 : t.accessToken]
1803
- ), x = rt(() => D || v, [D, v]), b = () => {
1803
+ ), x = rt(() => D || b, [D, b]), v = () => {
1804
1804
  if (!l || !E) return;
1805
1805
  const I = {
1806
1806
  connectionId: o,
1807
- id: kt(),
1807
+ id: Mt(),
1808
1808
  title: "Title",
1809
1809
  // description: 'Description',
1810
1810
  preferences: {
@@ -1819,7 +1819,7 @@ function zo() {
1819
1819
  sql: "",
1820
1820
  data: []
1821
1821
  }, w = {
1822
- id: kt(),
1822
+ id: Mt(),
1823
1823
  cards: [I],
1824
1824
  activeCardId: I.id
1825
1825
  };
@@ -1836,7 +1836,7 @@ function zo() {
1836
1836
  template: w,
1837
1837
  filterValues: h
1838
1838
  };
1839
- await ra(L, t == null ? void 0 : t.accessToken), jt.success("Lens saved"), C == null || C(I), c(!1);
1839
+ await ia(L, t == null ? void 0 : t.accessToken), jt.success("Lens saved"), C == null || C(I), c(!1);
1840
1840
  }
1841
1841
  return d ? null : /* @__PURE__ */ s(
1842
1842
  "div",
@@ -1858,7 +1858,7 @@ function zo() {
1858
1858
  className: "h-7 p-2",
1859
1859
  size: "sm",
1860
1860
  disabled: !l,
1861
- onClick: b,
1861
+ onClick: v,
1862
1862
  children: [
1863
1863
  /* @__PURE__ */ e(ke, { className: "mr-2 h-4 w-4" }),
1864
1864
  "Frame"
@@ -1876,13 +1876,13 @@ function zo() {
1876
1876
  }
1877
1877
  ),
1878
1878
  l && !d && /* @__PURE__ */ e(
1879
- se,
1879
+ ae,
1880
1880
  {
1881
1881
  className: "h-7 p-2",
1882
1882
  onClick: () => {
1883
1883
  f(!1), M(!1);
1884
1884
  },
1885
- children: /* @__PURE__ */ e(ua, { className: "h-4 w-4" })
1885
+ children: /* @__PURE__ */ e(ma, { className: "h-4 w-4" })
1886
1886
  }
1887
1887
  ),
1888
1888
  l && !d && x && /* @__PURE__ */ e(
@@ -1893,7 +1893,7 @@ function zo() {
1893
1893
  disabled: u,
1894
1894
  onClick: O,
1895
1895
  size: "sm",
1896
- children: /* @__PURE__ */ e(bo, { className: "h-4 w-4" })
1896
+ children: /* @__PURE__ */ e(vo, { className: "h-4 w-4" })
1897
1897
  }
1898
1898
  ),
1899
1899
  !m && !d && l && /* @__PURE__ */ e(
@@ -1950,19 +1950,19 @@ function Fo({
1950
1950
  c && /* @__PURE__ */ e("div", { className: "mr-2", children: c }),
1951
1951
  /* @__PURE__ */ e("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: N() })
1952
1952
  ] }),
1953
- /* @__PURE__ */ e(At, { className: "size-4 opacity-50" })
1953
+ /* @__PURE__ */ e(vt, { className: "size-4 opacity-50" })
1954
1954
  ]
1955
1955
  }
1956
1956
  ) }),
1957
1957
  /* @__PURE__ */ e(
1958
- It,
1958
+ Et,
1959
1959
  {
1960
1960
  className: "w-full p-0",
1961
1961
  style: { minWidth: g },
1962
- children: /* @__PURE__ */ s(bn, { children: [
1962
+ children: /* @__PURE__ */ s(vn, { children: [
1963
1963
  /* @__PURE__ */ s("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
1964
1964
  /* @__PURE__ */ e(xn, { className: "h-9", placeholder: "Search..." }),
1965
- /* @__PURE__ */ e(se, { className: "h-7", onClick: o, children: /* @__PURE__ */ e(
1965
+ /* @__PURE__ */ e(ae, { className: "h-7", onClick: o, children: /* @__PURE__ */ e(
1966
1966
  rr,
1967
1967
  {
1968
1968
  className: _(
@@ -2028,7 +2028,7 @@ function Rt({
2028
2028
  if (t === "Schema")
2029
2029
  return /* @__PURE__ */ e(go, { className: "size-4" });
2030
2030
  if (t === "Table")
2031
- return /* @__PURE__ */ e(Fn, { className: "size-4" });
2031
+ return /* @__PURE__ */ e(Ln, { className: "size-4" });
2032
2032
  if (t === "Model")
2033
2033
  return /* @__PURE__ */ e(ql, { className: "size-4" });
2034
2034
  }
@@ -2063,7 +2063,7 @@ function Rt({
2063
2063
  }
2064
2064
  )
2065
2065
  ] }),
2066
- /* @__PURE__ */ s(ae, { children: [
2066
+ /* @__PURE__ */ s(se, { children: [
2067
2067
  u && /* @__PURE__ */ e(U, { value: "none", children: "None" }, "none"),
2068
2068
  a && a.map((p, N) => /* @__PURE__ */ e(U, { value: p.id, children: p.name }, N))
2069
2069
  ] }),
@@ -2101,7 +2101,7 @@ function Lo({ column: t }) {
2101
2101
  function g(p, N) {
2102
2102
  var D;
2103
2103
  const f = Os(p, u, N), M = (D = c == null ? void 0 : c.find(
2104
- (v) => v.id === o
2104
+ (b) => b.id === o
2105
2105
  )) == null ? void 0 : D.name;
2106
2106
  d(f);
2107
2107
  const E = Is(
@@ -2173,10 +2173,10 @@ function Lo({ column: t }) {
2173
2173
  function za({ column: t }) {
2174
2174
  return /* @__PURE__ */ s(yt, { children: [
2175
2175
  /* @__PURE__ */ e(ei, { className: "shrink-0", asChild: !0, children: _e(t.data_type) ? /* @__PURE__ */ e(ti, { className: "size-3 text-muted-foreground" }) : pt(t.data_type) ? /* @__PURE__ */ e(Da, { className: "size-3 text-muted-foreground" }) : $e(t.data_type) ? /* @__PURE__ */ e(Es, { className: "size-3 text-muted-foreground" }) : ni(t.data_type) ? /* @__PURE__ */ e(or, { className: "size-3 text-muted-foreground" }) : t.data_type.startsWith("json") ? /* @__PURE__ */ e(Bl, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ e(ai, { className: "size-3 text-muted-foreground" }) }),
2176
- /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ e("p", { className: "text-xs", children: t.data_type }) })
2176
+ /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ e("p", { className: "text-xs", children: t.data_type }) })
2177
2177
  ] });
2178
2178
  }
2179
- function jn({
2179
+ function qn({
2180
2180
  column: t,
2181
2181
  className: a
2182
2182
  }) {
@@ -2260,39 +2260,39 @@ function Vo({
2260
2260
  ),
2261
2261
  children: [
2262
2262
  n === a.column_name && /* @__PURE__ */ e(As, { children: /* @__PURE__ */ e(
2263
- jn,
2263
+ qn,
2264
2264
  {
2265
2265
  column: a,
2266
2266
  className: "rounded-md border-2 border-dashed border-muted-foreground bg-muted shadow-md"
2267
2267
  }
2268
2268
  ) }),
2269
- n === a.column_name && /* @__PURE__ */ e("div", { className: "absolute inset-0", children: n === a.column_name && /* @__PURE__ */ e(jn, { column: a }) }),
2270
- /* @__PURE__ */ e(Ro, { id: a.column_name, type: "column", children: /* @__PURE__ */ e(jn, { column: a }) })
2269
+ n === a.column_name && /* @__PURE__ */ e("div", { className: "absolute inset-0", children: n === a.column_name && /* @__PURE__ */ e(qn, { column: a }) }),
2270
+ /* @__PURE__ */ e(Ro, { id: a.column_name, type: "column", children: /* @__PURE__ */ e(qn, { column: a }) })
2271
2271
  ]
2272
2272
  }
2273
2273
  )
2274
2274
  );
2275
2275
  }
2276
- const qn = {
2276
+ const Bn = {
2277
2277
  id: "__placeholder__",
2278
2278
  role: "groupby",
2279
2279
  type: "string"
2280
- }, Bn = {
2280
+ }, Pn = {
2281
2281
  id: "__placeholder__",
2282
2282
  role: "groupby",
2283
2283
  type: "string"
2284
- }, Pn = {
2284
+ }, _n = {
2285
2285
  id: "__placeholder__",
2286
2286
  role: "metric",
2287
2287
  type: "number"
2288
- }, _n = {
2288
+ }, $n = {
2289
2289
  name: "Filter",
2290
2290
  id: "__placeholder__",
2291
2291
  role: "filter",
2292
2292
  type: "string"
2293
2293
  }, mr = {
2294
2294
  id: "__placeholder__"
2295
- }, ut = "droppable-group-by", mt = "droppable-metrics", ht = "droppable-pivot-by", cn = "sortable-group-by", ia = "sortable-metrics", dn = "sortable-pivot-by", la = "droppable-filters", oa = "sortable-filters", Fa = "sortable-order-by";
2295
+ }, ut = "droppable-group-by", mt = "droppable-metrics", ht = "droppable-pivot-by", cn = "sortable-group-by", la = "sortable-metrics", dn = "sortable-pivot-by", oa = "droppable-filters", ca = "sortable-filters", Fa = "sortable-order-by";
2296
2296
  function jo() {
2297
2297
  const t = st((z) => z.insertIndex), a = T(
2298
2298
  (z) => {
@@ -2357,12 +2357,12 @@ function jo() {
2357
2357
  );
2358
2358
  o(te);
2359
2359
  const Y = a.filter(
2360
- (J) => J.id !== qn.id
2360
+ (J) => J.id !== Bn.id
2361
2361
  );
2362
- Y.splice(te, 0, qn), c(Y);
2362
+ Y.splice(te, 0, Bn), c(Y);
2363
2363
  } else if (A.id === ut) {
2364
2364
  o(a.length);
2365
- const te = [...a, qn];
2365
+ const te = [...a, Bn];
2366
2366
  c(te), h(n), d(r);
2367
2367
  }
2368
2368
  }
@@ -2375,12 +2375,12 @@ function jo() {
2375
2375
  );
2376
2376
  o(te);
2377
2377
  const Y = l.filter(
2378
- (J) => J.id !== Bn.id
2378
+ (J) => J.id !== Pn.id
2379
2379
  );
2380
- Y.splice(te, 0, Bn), m(Y);
2380
+ Y.splice(te, 0, Pn), m(Y);
2381
2381
  } else if (A.id === ht) {
2382
2382
  o(l.length);
2383
- const te = [...l, Bn];
2383
+ const te = [...l, Pn];
2384
2384
  m(te), c(a), h(n), d(r);
2385
2385
  }
2386
2386
  }
@@ -2392,12 +2392,12 @@ function jo() {
2392
2392
  const te = n.findIndex((J) => J.id === B);
2393
2393
  o(te);
2394
2394
  const Y = n.filter(
2395
- (J) => J.id !== Pn.id
2395
+ (J) => J.id !== _n.id
2396
2396
  );
2397
- Y.splice(te, 0, Pn), h(Y);
2397
+ Y.splice(te, 0, _n), h(Y);
2398
2398
  } else if (A.id === mt) {
2399
2399
  o(n.length);
2400
- const te = [...n, Pn];
2400
+ const te = [...n, _n];
2401
2401
  h(te), d(r), c(a), m(l);
2402
2402
  }
2403
2403
  }
@@ -2408,25 +2408,25 @@ function jo() {
2408
2408
  const te = r.findIndex((J) => J.id === B);
2409
2409
  o(te);
2410
2410
  const Y = r.filter(
2411
- (J) => J.id !== _n.id
2411
+ (J) => J.id !== $n.id
2412
2412
  );
2413
- Y.splice(te, 0, _n), d(Y);
2414
- } else if (A.id === la) {
2413
+ Y.splice(te, 0, $n), d(Y);
2414
+ } else if (A.id === oa) {
2415
2415
  o(r.length);
2416
- const te = [...r, _n];
2416
+ const te = [...r, $n];
2417
2417
  d(te), h(n), c(a), m(l);
2418
2418
  }
2419
2419
  }
2420
2420
  } else
2421
2421
  c(a), h(n), d(r), m(l);
2422
2422
  };
2423
- function v(z) {
2423
+ function b(z) {
2424
2424
  u(z.active.id), o(null), c(a), h(n), d(r), m(l);
2425
2425
  }
2426
2426
  function x(z) {
2427
2427
  return !r.some((k) => k.name === z.column_name);
2428
2428
  }
2429
- function b(z, k = "SUM") {
2429
+ function v(z, k = "SUM") {
2430
2430
  const { column_name: A, data_type: R } = z, B = [...n], $ = t !== null ? t : n.length, j = {
2431
2431
  ...z,
2432
2432
  id: je(A),
@@ -2458,7 +2458,7 @@ function jo() {
2458
2458
  name: z.column_name,
2459
2459
  type: z.data_type,
2460
2460
  role: "groupby",
2461
- label: Dt(z.column_name, "month"),
2461
+ label: Ot(z.column_name, "month"),
2462
2462
  granularity: "month"
2463
2463
  }, A.splice(R, 0, B), N(A);
2464
2464
  }
@@ -2481,7 +2481,7 @@ function jo() {
2481
2481
  name: z.column_name,
2482
2482
  type: z.data_type,
2483
2483
  role: "groupby",
2484
- label: Dt(z.column_name, "month"),
2484
+ label: Ot(z.column_name, "month"),
2485
2485
  granularity: "month"
2486
2486
  }, A.splice(R, 0, B), C(A);
2487
2487
  }
@@ -2492,7 +2492,7 @@ function jo() {
2492
2492
  // Unique ID
2493
2493
  name: z.column_name,
2494
2494
  type: z.data_type,
2495
- sql: Yn(
2495
+ sql: Kn(
2496
2496
  z.data_type,
2497
2497
  M,
2498
2498
  qe(z.column_name)
@@ -2510,7 +2510,7 @@ function jo() {
2510
2510
  );
2511
2511
  if (!J) return;
2512
2512
  const K = pt(J.data_type), Z = _e(J.data_type), ne = $e(J.data_type);
2513
- (Z || ne) && (A.id === ut || ((B = A.data.current) == null ? void 0 : B.type) === cn) && O(J), (Z || ne) && (A.id === ht || (($ = A.data.current) == null ? void 0 : $.type) === dn) ? S(J) : (K || Z) && (A.id === mt || ((j = A.data.current) == null ? void 0 : j.type) === ia) ? (K && b(J), Z && b(J, "COUNT")) : x(J) && (A.id === la || ((re = A.data.current) == null ? void 0 : re.type) === oa) && I(J);
2513
+ (Z || ne) && (A.id === ut || ((B = A.data.current) == null ? void 0 : B.type) === cn) && O(J), (Z || ne) && (A.id === ht || (($ = A.data.current) == null ? void 0 : $.type) === dn) ? S(J) : (K || Z) && (A.id === mt || ((j = A.data.current) == null ? void 0 : j.type) === la) ? (K && v(J), Z && v(J, "COUNT")) : x(J) && (A.id === oa || ((re = A.data.current) == null ? void 0 : re.type) === ca) && I(J);
2514
2514
  }
2515
2515
  if (A && ((ee = A.data.current) == null ? void 0 : ee.type) === cn && a.some((J) => J.id === k.id)) {
2516
2516
  const J = a.findIndex(
@@ -2528,14 +2528,14 @@ function jo() {
2528
2528
  Z.splice(K, 0, ne), N(Z);
2529
2529
  }
2530
2530
  }
2531
- if (A && ((te = A.data.current) == null ? void 0 : te.type) === ia && n.some((J) => J.id === k.id)) {
2531
+ if (A && ((te = A.data.current) == null ? void 0 : te.type) === la && n.some((J) => J.id === k.id)) {
2532
2532
  const J = n.findIndex((Z) => Z.id === k.id), K = n.findIndex((Z) => Z.id === A.id);
2533
2533
  if (J !== -1 && K !== -1 && J !== K) {
2534
2534
  const Z = [...n], [ne] = Z.splice(J, 1);
2535
2535
  Z.splice(K, 0, ne), g(Z);
2536
2536
  }
2537
2537
  }
2538
- if (A && ((Y = A.data.current) == null ? void 0 : Y.type) === oa && r.some((J) => J.id === k.id)) {
2538
+ if (A && ((Y = A.data.current) == null ? void 0 : Y.type) === ca && r.some((J) => J.id === k.id)) {
2539
2539
  const J = r.findIndex((Z) => Z.id === k.id), K = r.findIndex((Z) => Z.id === A.id);
2540
2540
  if (J !== -1 && K !== -1 && J !== K) {
2541
2541
  const Z = [...r], [ne] = Z.splice(J, 1);
@@ -2564,16 +2564,16 @@ function jo() {
2564
2564
  return {
2565
2565
  handleDragOver: D,
2566
2566
  handleDragEnd: w,
2567
- handleDragStart: v,
2567
+ handleDragStart: b,
2568
2568
  handleDragCancel: F,
2569
2569
  sensors: E
2570
2570
  };
2571
2571
  }
2572
2572
  function je(t) {
2573
- return `${t}-${kt()}`;
2573
+ return `${t}-${Mt()}`;
2574
2574
  }
2575
2575
  function $t(t, a) {
2576
- const n = pa(t.replace(/_/g, " "));
2576
+ const n = fa(t.replace(/_/g, " "));
2577
2577
  switch (a) {
2578
2578
  case "SUM":
2579
2579
  return `Sum of ${n}`;
@@ -2594,8 +2594,8 @@ function $t(t, a) {
2594
2594
  function Vt(t) {
2595
2595
  return `${Fa}-${t}`;
2596
2596
  }
2597
- function Dt(t, a) {
2598
- const n = pa(t.replace(/_/g, " "));
2597
+ function Ot(t, a) {
2598
+ const n = fa(t.replace(/_/g, " "));
2599
2599
  switch (a) {
2600
2600
  case "day":
2601
2601
  return `Date of ${n}`;
@@ -2637,14 +2637,14 @@ function qo({
2637
2637
  (k) => k.selectedDatamodelId
2638
2638
  ), C = G(
2639
2639
  (k) => k.dashboard.aiScopeTables
2640
- ), { addToAIScope: g, removeFromAIScope: y } = Ot(), {
2640
+ ), { addToAIScope: g, removeFromAIScope: y } = It(), {
2641
2641
  addColumnToMetricColumns: p,
2642
2642
  addColumnToGroupBy: N,
2643
2643
  setCardSql: f,
2644
2644
  setRunSql: M,
2645
2645
  setSqlGen: E,
2646
2646
  setIsShowingVisual: D
2647
- } = X(), { connectionType: v, modelItems: x, selectedDatamodelName: b } = Pe();
2647
+ } = X(), { connectionType: b, modelItems: x, selectedDatamodelName: v } = Pe();
2648
2648
  function S(k) {
2649
2649
  var A;
2650
2650
  if (l) {
@@ -2657,7 +2657,7 @@ function qo({
2657
2657
  qe(t),
2658
2658
  qe(a),
2659
2659
  B || "",
2660
- v,
2660
+ b,
2661
2661
  c || ""
2662
2662
  );
2663
2663
  $ && (f($), M(!0));
@@ -2692,7 +2692,7 @@ function qo({
2692
2692
  id: je(k.column_name),
2693
2693
  name: k.column_name,
2694
2694
  type: k.data_type,
2695
- label: Dt(k.column_name, "month"),
2695
+ label: Ot(k.column_name, "month"),
2696
2696
  granularity: "month"
2697
2697
  };
2698
2698
  N(R);
@@ -2712,13 +2712,13 @@ function qo({
2712
2712
  }
2713
2713
  }
2714
2714
  function O(k) {
2715
- k === !0 && (d || b) && o ? (g({
2715
+ k === !0 && (d || v) && o ? (g({
2716
2716
  connectionId: o,
2717
- connectionType: v === "S3" || v === "API" ? "DuckDb" : v || "",
2717
+ connectionType: b === "S3" || b === "API" ? "DuckDb" : b || "",
2718
2718
  databaseName: c || "",
2719
2719
  schemaName: h || "",
2720
2720
  tableName: d || "",
2721
- datamodelName: sn(b),
2721
+ datamodelName: sn(v),
2722
2722
  datamodelId: m || ""
2723
2723
  }), jt.success("Added to Assistant Scope", {
2724
2724
  position: "top-right",
@@ -2726,9 +2726,9 @@ function qo({
2726
2726
  richColors: !0
2727
2727
  })) : (y({
2728
2728
  connectionId: o || "",
2729
- connectionType: v || "",
2729
+ connectionType: b || "",
2730
2730
  tableName: d || "",
2731
- datamodelName: sn(b),
2731
+ datamodelName: sn(v),
2732
2732
  datamodelId: m || "",
2733
2733
  databaseName: c || "",
2734
2734
  schemaName: h || ""
@@ -2742,27 +2742,27 @@ function qo({
2742
2742
  const k = Ya({
2743
2743
  schemaName: t,
2744
2744
  tableName: a,
2745
- modelName: b,
2746
- connectionType: v,
2745
+ modelName: v,
2746
+ connectionType: b,
2747
2747
  databaseName: c || ""
2748
2748
  });
2749
2749
  D(!1);
2750
- const A = v === "MSSQL" ? `SELECT top 10 * FROM ${k}` : `SELECT * FROM ${k} LIMIT 10`;
2750
+ const A = b === "MSSQL" ? `SELECT top 10 * FROM ${k}` : `SELECT * FROM ${k} LIMIT 10`;
2751
2751
  f(A), M(!0);
2752
2752
  }
2753
2753
  function w() {
2754
2754
  const k = Ya({
2755
2755
  schemaName: t,
2756
2756
  tableName: a,
2757
- modelName: b,
2758
- connectionType: v,
2757
+ modelName: v,
2758
+ connectionType: b,
2759
2759
  databaseName: c || ""
2760
2760
  });
2761
2761
  f(`SELECT COUNT(*) as count FROM ${k}`), M(!0);
2762
2762
  }
2763
2763
  function L() {
2764
2764
  return (C == null ? void 0 : C.find(
2765
- (k) => k.connectionId === o && (k.tableName === d || k.datamodelName === b)
2765
+ (k) => k.connectionId === o && (k.tableName === d || k.datamodelName === v)
2766
2766
  )) !== void 0;
2767
2767
  }
2768
2768
  function F(k) {
@@ -2789,7 +2789,7 @@ function qo({
2789
2789
  ) : /* @__PURE__ */ e(Vo, { onClick: S, column: k });
2790
2790
  }
2791
2791
  function z() {
2792
- return /* @__PURE__ */ s(ae, { children: [
2792
+ return /* @__PURE__ */ s(se, { children: [
2793
2793
  /* @__PURE__ */ s(
2794
2794
  Fs,
2795
2795
  {
@@ -2848,7 +2848,7 @@ function qo({
2848
2848
  // <div className="flex h-full w-full items-center justify-center">
2849
2849
  // <Loader2 className="h-6 w-6 animate-spin text-muted-foreground/70" />
2850
2850
  // </div>
2851
- /* @__PURE__ */ e("div", { className: "flex grow flex-col justify-start gap-2 px-6", children: Array.from({ length: 3 }).map((k, A) => /* @__PURE__ */ e(fa, { className: "h-7 w-full" }, A)) })
2851
+ /* @__PURE__ */ e("div", { className: "flex grow flex-col justify-start gap-2 px-6", children: Array.from({ length: 3 }).map((k, A) => /* @__PURE__ */ e(ga, { className: "h-7 w-full" }, A)) })
2852
2852
  ) : /* @__PURE__ */ s("div", { className: "flex grow flex-col space-y-4 px-4", children: [
2853
2853
  l && /* @__PURE__ */ e("div", { className: "mx-2 flex items-center justify-center gap-2", children: z() }),
2854
2854
  /* @__PURE__ */ s(
@@ -2895,9 +2895,9 @@ function hr({
2895
2895
  columns: M,
2896
2896
  isConnectionsLoading: E,
2897
2897
  isModelsLoading: D,
2898
- isConnectionsError: v,
2898
+ isConnectionsError: b,
2899
2899
  isModelsError: x,
2900
- isDatabasesLoadingOrFetching: b,
2900
+ isDatabasesLoadingOrFetching: v,
2901
2901
  isDatabaseError: S,
2902
2902
  isSchemaLoadingOrFetching: O,
2903
2903
  isSchemaError: I,
@@ -2950,7 +2950,7 @@ function hr({
2950
2950
  showNone: !0,
2951
2951
  onChange: te,
2952
2952
  isError: S,
2953
- isLoading: b,
2953
+ isLoading: v,
2954
2954
  items: N,
2955
2955
  value: o || "",
2956
2956
  title: "Database",
@@ -3038,7 +3038,7 @@ function hr({
3038
3038
  value: r || "",
3039
3039
  onChange: W,
3040
3040
  isLoading: E,
3041
- isError: v,
3041
+ isError: b,
3042
3042
  type: "combobox",
3043
3043
  connectionTooltip: (($a = g == null ? void 0 : g.find(
3044
3044
  (me) => me.id === r
@@ -3052,7 +3052,7 @@ function hr({
3052
3052
  Pr()
3053
3053
  ] }),
3054
3054
  Q(),
3055
- /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-2 px-6 py-4", children: a === "main" && /* @__PURE__ */ s(ae, { children: [
3055
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-2 px-6 py-4", children: a === "main" && /* @__PURE__ */ s(se, { children: [
3056
3056
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
3057
3057
  /* @__PURE__ */ e(
3058
3058
  li,
@@ -3091,7 +3091,7 @@ function pr({ sql: t, error: a, onClick: n }) {
3091
3091
  }, 100);
3092
3092
  }
3093
3093
  return /* @__PURE__ */ e("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ s("div", { className: "flex grow flex-col space-y-2", children: [
3094
- /* @__PURE__ */ s(bt, { className: "max-h-[250px] min-h-0 overflow-scroll text-xs leading-relaxed text-foreground/80", children: [
3094
+ /* @__PURE__ */ s(xt, { className: "max-h-[250px] min-h-0 overflow-scroll text-xs leading-relaxed text-foreground/80", children: [
3095
3095
  a && a,
3096
3096
  t && /* @__PURE__ */ e("div", { className: "flex flex-col space-y-1.5", children: /* @__PURE__ */ e("div", { className: "rounded-md", children: /* @__PURE__ */ e(oi, { code: t, language: "sql" }) }) })
3097
3097
  ] }),
@@ -3198,7 +3198,7 @@ function yr(t) {
3198
3198
  key: n
3199
3199
  }, a.attr), yr(a.child)));
3200
3200
  }
3201
- function xt(t) {
3201
+ function Nt(t) {
3202
3202
  return (a) => /* @__PURE__ */ Le.createElement(Ho, un({
3203
3203
  attr: mn({}, t.attr)
3204
3204
  }, a), yr(t.child));
@@ -3227,14 +3227,14 @@ function Ho(t) {
3227
3227
  return rs !== void 0 ? /* @__PURE__ */ Le.createElement(rs.Consumer, null, (n) => a(n)) : a(gr);
3228
3228
  }
3229
3229
  function Uo(t) {
3230
- return xt({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(t);
3230
+ return Nt({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(t);
3231
3231
  }
3232
- function vr(t) {
3232
+ function br(t) {
3233
3233
  const { theme: a } = di(), n = G((p) => p.theme), r = T((p) => p.frame), i = T((p) => p.card), l = T((p) => p.activeTabCardId), o = ui(), { refetch: u } = Ee(i), { updateCardTab: c, setRunSql: h } = X(), d = ft(), m = ft({}), C = r.cards.find((p) => p.id === l), g = Ne(() => {
3234
3234
  let p = "";
3235
3235
  return t === "python" && (p = (C == null ? void 0 : C.python) || Ls), t === "sql" && (p = (C == null ? void 0 : C.sql) || ""), p;
3236
3236
  }, [t, C]);
3237
- ve(() => {
3237
+ be(() => {
3238
3238
  if (l && i.id && i.id !== l) {
3239
3239
  if (d.current && o) {
3240
3240
  const p = d.current.getModel();
@@ -3256,7 +3256,7 @@ function vr(t) {
3256
3256
  h,
3257
3257
  t,
3258
3258
  g
3259
- ]), ve(() => {
3259
+ ]), be(() => {
3260
3260
  if (!o) return;
3261
3261
  const p = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", N = n === "system" ? p : n;
3262
3262
  o.editor.defineTheme("default", {
@@ -3272,7 +3272,7 @@ function vr(t) {
3272
3272
  // : getCssVariableValue('--semaphor-background'),
3273
3273
  }
3274
3274
  }), o.editor.setTheme("default");
3275
- }, [a, n, o]), ve(() => {
3275
+ }, [a, n, o]), be(() => {
3276
3276
  const p = d.current;
3277
3277
  p && o && i && p.addCommand(
3278
3278
  o.KeyMod.Shift | o.KeyCode.Enter,
@@ -3291,7 +3291,7 @@ function vr(t) {
3291
3291
  return { handleEditorDidMount: y };
3292
3292
  }
3293
3293
  function Yo() {
3294
- const t = T((o) => o.card.sql), a = T((o) => o.sqlGen), { setCardSql: n, setSqlGen: r } = X(), { handleEditorDidMount: i } = vr("sql");
3294
+ const t = T((o) => o.card.sql), a = T((o) => o.sqlGen), { setCardSql: n, setSqlGen: r } = X(), { handleEditorDidMount: i } = br("sql");
3295
3295
  function l(o) {
3296
3296
  n(o), hi(a) || r({});
3297
3297
  }
@@ -3323,7 +3323,7 @@ function Yo() {
3323
3323
  ] });
3324
3324
  }
3325
3325
  function Ko() {
3326
- const t = T((i) => i.card.python), { setCardPython: a } = X(), { handleEditorDidMount: n } = vr("python");
3326
+ const t = T((i) => i.card.python), { setCardPython: a } = X(), { handleEditorDidMount: n } = br("python");
3327
3327
  function r(i) {
3328
3328
  a(i);
3329
3329
  }
@@ -3412,10 +3412,10 @@ function Wo() {
3412
3412
  setShowAIDialog: E
3413
3413
  } = X();
3414
3414
  T((j) => j.onSave), T((j) => j.onClose), T((j) => j.actions.setSqlGen);
3415
- const D = T((j) => j.runSql), v = T((j) => j.actions.setRunSql), x = T(
3415
+ const D = T((j) => j.runSql), b = T((j) => j.actions.setRunSql), x = T(
3416
3416
  (j) => j.actions.setIsSqlRunning
3417
3417
  ), {
3418
- data: b,
3418
+ data: v,
3419
3419
  isLoading: S,
3420
3420
  isFetching: O,
3421
3421
  isSuccess: I,
@@ -3425,20 +3425,20 @@ function Wo() {
3425
3425
  refetch: z,
3426
3426
  errorMessage: k
3427
3427
  } = Ee(l);
3428
- ve(() => {
3429
- if (b && (b.rowLimitExceeded && jt.error("Row limit (10,000) exceeded. Refine your query.", {
3428
+ be(() => {
3429
+ if (v && (v.rowLimitExceeded && jt.error("Row limit (10,000) exceeded. Refine your query.", {
3430
3430
  position: "top-center",
3431
3431
  richColors: !0
3432
- }), y((b == null ? void 0 : b.output) || ""), b.records.length > 0)) {
3433
- const { dimensionKeys: j } = Kn(b.records);
3432
+ }), y((v == null ? void 0 : v.output) || ""), v.records.length > 0)) {
3433
+ const { dimensionKeys: j } = Qn(v.records);
3434
3434
  m(j);
3435
3435
  }
3436
- }, [b, m, y]), ve(() => {
3436
+ }, [v, m, y]), be(() => {
3437
3437
  (S || O) && x(!0), (w || I) && x(!1), w && (m([]), y(""));
3438
3438
  }, [
3439
3439
  S,
3440
3440
  O,
3441
- b,
3441
+ v,
3442
3442
  y,
3443
3443
  w,
3444
3444
  I,
@@ -3446,9 +3446,9 @@ function Wo() {
3446
3446
  m,
3447
3447
  // setQueryError,
3448
3448
  L
3449
- ]), ve(() => {
3450
- D && (t.getQueryData(F) || z(), v(!1));
3451
- }, [D, z, v, F, t]);
3449
+ ]), be(() => {
3450
+ D && (t.getQueryData(F) || z(), b(!1));
3451
+ }, [D, z, b, F, t]);
3452
3452
  async function A() {
3453
3453
  const j = `Can you help me debug this query in the current table scope?
3454
3454
 
@@ -3466,7 +3466,7 @@ ${c}` : ""}
3466
3466
  M(j);
3467
3467
  }
3468
3468
  function R() {
3469
- return /* @__PURE__ */ s(ae, { children: [
3469
+ return /* @__PURE__ */ s(se, { children: [
3470
3470
  r && /* @__PURE__ */ e(
3471
3471
  "div",
3472
3472
  {
@@ -3486,7 +3486,7 @@ ${c}` : ""}
3486
3486
  variant: "ghost",
3487
3487
  onClick: () => i(!r),
3488
3488
  className: "absolute bottom-0 right-6 size-7 p-1",
3489
- children: r ? /* @__PURE__ */ e(be, { className: "size-3.5 text-muted-foreground" }) : /* @__PURE__ */ e(Ta, { className: "size-3.5 text-muted-foreground" })
3489
+ children: r ? /* @__PURE__ */ e(ve, { className: "size-3.5 text-muted-foreground" }) : /* @__PURE__ */ e(Ta, { className: "size-3.5 text-muted-foreground" })
3490
3490
  }
3491
3491
  )
3492
3492
  ] });
@@ -3519,7 +3519,7 @@ ${c}` : ""}
3519
3519
  ]
3520
3520
  }
3521
3521
  ),
3522
- a && /* @__PURE__ */ s(ae, { children: [
3522
+ a && /* @__PURE__ */ s(se, { children: [
3523
3523
  /* @__PURE__ */ e(tt, { withHandle: !0, className: "border" }),
3524
3524
  /* @__PURE__ */ s(
3525
3525
  Ce,
@@ -3573,7 +3573,7 @@ ${c}` : ""}
3573
3573
  /* @__PURE__ */ e(
3574
3574
  fr,
3575
3575
  {
3576
- sql: b == null ? void 0 : b.sql,
3576
+ sql: v == null ? void 0 : v.sql,
3577
3577
  error: k,
3578
3578
  onClick: A
3579
3579
  }
@@ -3646,7 +3646,7 @@ function Zo({ data: t }) {
3646
3646
  }
3647
3647
  ) });
3648
3648
  }
3649
- })), l = vi({
3649
+ })), l = bi({
3650
3650
  data: t,
3651
3651
  columns: i,
3652
3652
  getCoreRowModel: Si(),
@@ -3660,7 +3660,7 @@ function Zo({ data: t }) {
3660
3660
  });
3661
3661
  return /* @__PURE__ */ s(Kt, { className: "grow overflow-auto font-mono text-xs text-foreground/95", children: [
3662
3662
  /* @__PURE__ */ s("table", { className: "w-full", children: [
3663
- /* @__PURE__ */ e(bi, { className: "sticky top-0 z-50 h-0 bg-muted", children: l.getHeaderGroups().map((u) => /* @__PURE__ */ e(Rn, { className: "", children: u.headers.map((c) => /* @__PURE__ */ e(
3663
+ /* @__PURE__ */ e(vi, { className: "sticky top-0 z-50 h-0 bg-muted", children: l.getHeaderGroups().map((u) => /* @__PURE__ */ e(Vn, { className: "", children: u.headers.map((c) => /* @__PURE__ */ e(
3664
3664
  xi,
3665
3665
  {
3666
3666
  className: "h-11 font-semibold text-foreground",
@@ -3672,33 +3672,33 @@ function Zo({ data: t }) {
3672
3672
  c.id
3673
3673
  )) }, u.id)) }),
3674
3674
  /* @__PURE__ */ e(Ni, { children: (o = l.getRowModel().rows) != null && o.length ? l.getRowModel().rows.map((u) => /* @__PURE__ */ e(
3675
- Rn,
3675
+ Vn,
3676
3676
  {
3677
3677
  className: "h-11 whitespace-nowrap py-2",
3678
3678
  "data-state": u.getIsSelected() && "selected",
3679
3679
  children: u.getVisibleCells().map((c) => /* @__PURE__ */ e(Qa, { className: "py-2", children: Ka(c.column.columnDef.cell, c.getContext()) }, c.id))
3680
3680
  },
3681
3681
  u.id
3682
- )) : /* @__PURE__ */ e(Rn, { children: /* @__PURE__ */ e(Qa, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
3682
+ )) : /* @__PURE__ */ e(Vn, { children: /* @__PURE__ */ e(Qa, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
3683
3683
  ] }),
3684
3684
  /* @__PURE__ */ e(He, { orientation: "horizontal" })
3685
3685
  ] });
3686
3686
  }
3687
3687
  function Xo({ card: t }) {
3688
- var M, E, D, v, x, b, S, O, I, w, L;
3688
+ var M, E, D, b, x, v, S, O, I, w, L;
3689
3689
  const [a, n] = V(!1), [r, i] = V(
3690
3690
  []
3691
3691
  ), { authToken: l } = lt(), o = ki(l == null ? void 0 : l.accessToken), u = G((F) => F.themeStyle), c = {
3692
3692
  colors: ((E = (M = u == null ? void 0 : u.chart) == null ? void 0 : M.dataset) == null ? void 0 : E.backgroundColor) || []
3693
3693
  };
3694
3694
  (D = t.customCardPreferences) != null && D.inputData;
3695
- const { getCard: h } = qs(((v = t.customCardPreferences) == null ? void 0 : v.url) || ""), d = ((x = t.customCardPreferences) == null ? void 0 : x.visualType) || "single", m = T((F) => F.frame), { setCustomCardPreferences: C } = X(), { data: g } = Ee(t), y = Ne((F, z) => {
3695
+ const { getCard: h } = qs(((b = t.customCardPreferences) == null ? void 0 : b.url) || ""), d = ((x = t.customCardPreferences) == null ? void 0 : x.visualType) || "single", m = T((F) => F.frame), { setCustomCardPreferences: C } = X(), { data: g } = Ee(t), y = Ne((F, z) => {
3696
3696
  i((k) => ({
3697
3697
  ...k,
3698
3698
  [F]: z
3699
3699
  }));
3700
3700
  }, []);
3701
- if (!((b = t.customCardPreferences) != null && b.componentName))
3701
+ if (!((v = t.customCardPreferences) != null && v.componentName))
3702
3702
  return null;
3703
3703
  const p = h(
3704
3704
  (S = t.customCardPreferences) == null ? void 0 : S.componentName
@@ -3716,7 +3716,7 @@ function Xo({ card: t }) {
3716
3716
  return /* @__PURE__ */ e("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ s(
3717
3717
  wl,
3718
3718
  {
3719
- fallback: /* @__PURE__ */ e(ae, {}),
3719
+ fallback: /* @__PURE__ */ e(se, {}),
3720
3720
  children: [
3721
3721
  p && d === "single" && /* @__PURE__ */ e(
3722
3722
  p,
@@ -3728,7 +3728,7 @@ function Xo({ card: t }) {
3728
3728
  data: (g == null ? void 0 : g.records) || []
3729
3729
  }
3730
3730
  ),
3731
- p && d === "multiple" && /* @__PURE__ */ s(ae, { children: [
3731
+ p && d === "multiple" && /* @__PURE__ */ s(se, { children: [
3732
3732
  Object.keys(
3733
3733
  ((w = t.customCardPreferences) == null ? void 0 : w.dataInputCardIds) || {}
3734
3734
  ).map((F) => {
@@ -3768,7 +3768,7 @@ function Xo({ card: t }) {
3768
3768
  (L = t.customCardPreferences) == null ? void 0 : L.componentName
3769
3769
  ) });
3770
3770
  }
3771
- function br({
3771
+ function vr({
3772
3772
  // card,
3773
3773
  // showCard,
3774
3774
  className: t,
@@ -3777,7 +3777,7 @@ function br({
3777
3777
  var N;
3778
3778
  const n = T((f) => f.card), r = ((N = n.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, i = T((f) => f.frame), l = G((f) => f.dashboard.filters);
3779
3779
  T((f) => f.actions.setRunSql);
3780
- const { updateFilter: o } = Ot(), u = l == null ? void 0 : l.find((f) => f.id === i.filterId), { data: c, isLoading: h, isFetching: d } = Ee(n), { setCard: m } = X(), { data: C } = ga(n), g = rt(() => !n.id || !(c != null && c.records) ? null : Bs({
3780
+ const { updateFilter: o } = It(), u = l == null ? void 0 : l.find((f) => f.id === i.filterId), { data: c, isLoading: h, isFetching: d } = Ee(n), { setCard: m } = X(), { data: C } = ya(n), g = rt(() => !n.id || !(c != null && c.records) ? null : Bs({
3781
3781
  card: n,
3782
3782
  data: c == null ? void 0 : c.records,
3783
3783
  cardType: n.type,
@@ -3808,7 +3808,7 @@ function br({
3808
3808
  if (n.type === "custom")
3809
3809
  return y(n);
3810
3810
  if (!["table", "custom"].includes(n.type) && g)
3811
- return /* @__PURE__ */ e(ae, { children: h || d ? /* @__PURE__ */ e(ae, {}) : /* @__PURE__ */ e(
3811
+ return /* @__PURE__ */ e(se, { children: h || d ? /* @__PURE__ */ e(se, {}) : /* @__PURE__ */ e(
3812
3812
  Oi,
3813
3813
  {
3814
3814
  cfg: g
@@ -3827,7 +3827,7 @@ function br({
3827
3827
  r && /* @__PURE__ */ s(Ps, { className: "flex flex-row items-start justify-between py-4", children: [
3828
3828
  /* @__PURE__ */ s("div", { children: [
3829
3829
  /* @__PURE__ */ e(
3830
- Ct,
3830
+ wt,
3831
3831
  {
3832
3832
  enabled: !0,
3833
3833
  text: n.title,
@@ -3837,7 +3837,7 @@ function br({
3837
3837
  n.title
3838
3838
  ),
3839
3839
  /* @__PURE__ */ e(
3840
- Ct,
3840
+ wt,
3841
3841
  {
3842
3842
  enabled: !0,
3843
3843
  text: n.description || "",
@@ -3849,7 +3849,7 @@ function br({
3849
3849
  ] }),
3850
3850
  u && /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
3851
3851
  /* @__PURE__ */ e(
3852
- Ct,
3852
+ wt,
3853
3853
  {
3854
3854
  enabled: !0,
3855
3855
  className: "my-1",
@@ -3866,7 +3866,7 @@ function br({
3866
3866
  }
3867
3867
  );
3868
3868
  }
3869
- const $n = ({
3869
+ const Gn = ({
3870
3870
  language: t,
3871
3871
  value: a,
3872
3872
  onChange: n,
@@ -3894,7 +3894,7 @@ const $n = ({
3894
3894
  }
3895
3895
  ), ec = () => /* @__PURE__ */ s(gn, { children: [
3896
3896
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(yn, { children: "Customize Card" }) }),
3897
- /* @__PURE__ */ s(vn, { children: [
3897
+ /* @__PURE__ */ s(bn, { children: [
3898
3898
  "See the configuration options and documentation",
3899
3899
  /* @__PURE__ */ e(
3900
3900
  "a",
@@ -3925,7 +3925,7 @@ const $n = ({
3925
3925
  value: "final-config",
3926
3926
  className: "mt-0 grow rounded-b border border-t-0",
3927
3927
  children: /* @__PURE__ */ e(
3928
- $n,
3928
+ Gn,
3929
3929
  {
3930
3930
  language: "json",
3931
3931
  value: n,
@@ -3940,7 +3940,7 @@ const $n = ({
3940
3940
  value: "custom-config",
3941
3941
  className: "mt-0 grow rounded-b border border-t-0",
3942
3942
  children: /* @__PURE__ */ e(
3943
- $n,
3943
+ Gn,
3944
3944
  {
3945
3945
  readonly: !0,
3946
3946
  language: "json",
@@ -3957,7 +3957,7 @@ const $n = ({
3957
3957
  value: "custom-code",
3958
3958
  className: "mt-0 grow rounded-b border border-t-0",
3959
3959
  children: /* @__PURE__ */ e(
3960
- $n,
3960
+ Gn,
3961
3961
  {
3962
3962
  language: "javascript",
3963
3963
  value: t,
@@ -3979,14 +3979,14 @@ const $n = ({
3979
3979
  /* @__PURE__ */ e(P, { onClick: i, variant: "outline", children: "Close" })
3980
3980
  ] });
3981
3981
  function ac() {
3982
- const [t, a] = V(!1), [n, r] = V(""), [i, l] = V(""), [o, u] = V(""), [c, h] = V(""), d = T((v) => v.card), m = T((v) => v.card.customCfg), C = m ? JSON.stringify(m, null, 2) : "", { data: g } = Ee(d), { data: y } = ga(d), { setCardCustomCfg: p, setCustomVisualCode: N } = X(), f = (v) => {
3983
- var x, b;
3982
+ const [t, a] = V(!1), [n, r] = V(""), [i, l] = V(""), [o, u] = V(""), [c, h] = V(""), d = T((b) => b.card), m = T((b) => b.card.customCfg), C = m ? JSON.stringify(m, null, 2) : "", { data: g } = Ee(d), { data: y } = ya(d), { setCardCustomCfg: p, setCustomVisualCode: N } = X(), f = (b) => {
3983
+ var x, v;
3984
3984
  return JSON.stringify(
3985
3985
  {
3986
- ...v,
3986
+ ...b,
3987
3987
  data: {
3988
- ...v.data,
3989
- datasets: (b = (x = v.data) == null ? void 0 : x.datasets) == null ? void 0 : b.map((S) => ({
3988
+ ...b.data,
3989
+ datasets: (v = (x = b.data) == null ? void 0 : x.datasets) == null ? void 0 : v.map((S) => ({
3990
3990
  ...S,
3991
3991
  data: []
3992
3992
  }))
@@ -3996,9 +3996,9 @@ function ac() {
3996
3996
  2
3997
3997
  );
3998
3998
  }, M = () => {
3999
- var x, b;
3999
+ var x, v;
4000
4000
  if (!((x = g == null ? void 0 : g.records) != null && x.length)) return;
4001
- const v = Bs({
4001
+ const b = Bs({
4002
4002
  card: d,
4003
4003
  data: g.records,
4004
4004
  cardType: d.type,
@@ -4007,19 +4007,19 @@ function ac() {
4007
4007
  preferences: d.preferences,
4008
4008
  topoJson: y
4009
4009
  });
4010
- if (v) {
4011
- r(f(v)), u(((b = d.preferences) == null ? void 0 : b.customVisualCode) || "");
4012
- const S = Ii(v, m);
4010
+ if (b) {
4011
+ r(f(b)), u(((v = d.preferences) == null ? void 0 : v.customVisualCode) || "");
4012
+ const S = Ii(b, m);
4013
4013
  l(f(S));
4014
4014
  }
4015
4015
  }, E = () => {
4016
4016
  try {
4017
4017
  if (o && N(o), i) {
4018
- const v = JSON.parse(
4018
+ const b = JSON.parse(
4019
4019
  i
4020
4020
  ), x = Ei(
4021
4021
  JSON.parse(n),
4022
- v
4022
+ b
4023
4023
  );
4024
4024
  p(x), h("");
4025
4025
  }
@@ -4029,7 +4029,7 @@ function ac() {
4029
4029
  }, D = Object.keys(m || {}).length === 0;
4030
4030
  return /* @__PURE__ */ s(pn, { open: t, onOpenChange: a, children: [
4031
4031
  /* @__PURE__ */ e(hs, { asChild: !0, children: /* @__PURE__ */ e(
4032
- se,
4032
+ ae,
4033
4033
  {
4034
4034
  tooltip: "Customize Visual",
4035
4035
  onClick: M,
@@ -4040,15 +4040,15 @@ function ac() {
4040
4040
  /* @__PURE__ */ s(fn, { className: "flex h-[600px] grow flex-col overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
4041
4041
  /* @__PURE__ */ e(ec, {}),
4042
4042
  /* @__PURE__ */ s("div", { className: "flex grow gap-2", children: [
4043
- /* @__PURE__ */ e(Dn, { FallbackComponent: Hs, children: /* @__PURE__ */ e(br, { className: "w-1/2 rounded shadow-none" }) }),
4043
+ /* @__PURE__ */ e(Dn, { FallbackComponent: Hs, children: /* @__PURE__ */ e(vr, { className: "w-1/2 rounded shadow-none" }) }),
4044
4044
  /* @__PURE__ */ e(
4045
4045
  tc,
4046
4046
  {
4047
4047
  customCode: o,
4048
4048
  cardCustomCfgString: C,
4049
4049
  mergedConfig: i,
4050
- onConfigChange: (v) => l(v ?? ""),
4051
- onCodeChange: (v) => u(v ?? "")
4050
+ onConfigChange: (b) => l(b ?? ""),
4051
+ onCodeChange: (b) => u(b ?? "")
4052
4052
  }
4053
4053
  )
4054
4054
  ] }),
@@ -4072,7 +4072,7 @@ function xr(t) {
4072
4072
  return a;
4073
4073
  }
4074
4074
  function Nr() {
4075
- const { authToken: t } = lt(), { data: a, isLoading: n, isFetching: r, isError: i } = ha({
4075
+ const { authToken: t } = lt(), { data: a, isLoading: n, isFetching: r, isError: i } = pa({
4076
4076
  queryKey: ["plugins", t == null ? void 0 : t.accessToken],
4077
4077
  queryFn: () => Ai(t == null ? void 0 : t.accessToken)
4078
4078
  // staleTime: Infinity,
@@ -4097,7 +4097,7 @@ function sc({
4097
4097
  icon: d.icon
4098
4098
  }), t == null || t();
4099
4099
  }
4100
- return ve(() => {
4100
+ return be(() => {
4101
4101
  (async () => {
4102
4102
  var d;
4103
4103
  if (u) {
@@ -4111,7 +4111,7 @@ function sc({
4111
4111
  n(C);
4112
4112
  }
4113
4113
  })();
4114
- }, [u]), a.length === 0 ? null : /* @__PURE__ */ s(ae, { children: [
4114
+ }, [u]), a.length === 0 ? null : /* @__PURE__ */ s(se, { children: [
4115
4115
  /* @__PURE__ */ e(at, { className: "my-2" }),
4116
4116
  /* @__PURE__ */ e("div", { className: "grid grid-cols-4 place-items-center", children: a.map((h, d) => /* @__PURE__ */ e(
4117
4117
  rc,
@@ -4130,25 +4130,25 @@ const rc = ({
4130
4130
  onClick: n
4131
4131
  }) => {
4132
4132
  const r = xr(), i = t.charAt(0).toUpperCase();
4133
- return /* @__PURE__ */ e(se, { onClick: n, tooltip: t, children: r ? /* @__PURE__ */ e(r, { className: "h-4 w-4" }) : i });
4133
+ return /* @__PURE__ */ e(ae, { onClick: n, tooltip: t, children: r ? /* @__PURE__ */ e(r, { className: "h-4 w-4" }) : i });
4134
4134
  };
4135
4135
  function La(t) {
4136
- return xt({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(t);
4136
+ return Nt({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(t);
4137
4137
  }
4138
4138
  function ic(t) {
4139
- return xt({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z" }, child: [] }] })(t);
4139
+ return Nt({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z" }, child: [] }] })(t);
4140
4140
  }
4141
4141
  function Ra(t) {
4142
- return xt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(t);
4142
+ return Nt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(t);
4143
4143
  }
4144
4144
  function Va(t) {
4145
- return xt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M4.387 3h15.226a1 1 0 0 1 .948 1.316l-5.105 15.316a2 2 0 0 1 -1.898 1.368h-3.116a2 2 0 0 1 -1.898 -1.368l-5.104 -15.316a1 1 0 0 1 .947 -1.316" }, child: [] }, { tag: "path", attr: { d: "M5 9h14" }, child: [] }, { tag: "path", attr: { d: "M7 15h10" }, child: [] }] })(t);
4145
+ return Nt({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M4.387 3h15.226a1 1 0 0 1 .948 1.316l-5.105 15.316a2 2 0 0 1 -1.898 1.368h-3.116a2 2 0 0 1 -1.898 -1.368l-5.104 -15.316a1 1 0 0 1 .947 -1.316" }, child: [] }, { tag: "path", attr: { d: "M5 9h14" }, child: [] }, { tag: "path", attr: { d: "M7 15h10" }, child: [] }] })(t);
4146
4146
  }
4147
4147
  function ja(t) {
4148
- return xt({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(t);
4148
+ return Nt({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(t);
4149
4149
  }
4150
4150
  function qa(t) {
4151
- return xt({ attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(t);
4151
+ return Nt({ attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(t);
4152
4152
  }
4153
4153
  function Cr({
4154
4154
  onChartTypeChange: t,
@@ -4163,37 +4163,37 @@ function Cr({
4163
4163
  const h = 1e3;
4164
4164
  return /* @__PURE__ */ s("div", { className: "grid grid-cols-5 place-items-center", children: [
4165
4165
  /* @__PURE__ */ e(
4166
- se,
4166
+ ae,
4167
4167
  {
4168
4168
  openDelay: h,
4169
4169
  tooltip: "Table",
4170
4170
  onClick: () => c("table"),
4171
4171
  className: "h-10 p-4",
4172
- children: /* @__PURE__ */ e(Fn, { className: _("size-5", a) })
4172
+ children: /* @__PURE__ */ e(Ln, { className: _("size-5", a) })
4173
4173
  }
4174
4174
  ),
4175
4175
  /* @__PURE__ */ e(
4176
- se,
4176
+ ae,
4177
4177
  {
4178
4178
  openDelay: h,
4179
4179
  tooltip: "Bar Chart",
4180
4180
  onClick: () => c("bar"),
4181
4181
  className: "h-10 p-4",
4182
- children: /* @__PURE__ */ e(An, { className: _("size-5", a) })
4182
+ children: /* @__PURE__ */ e(zn, { className: _("size-5", a) })
4183
4183
  }
4184
4184
  ),
4185
4185
  /* @__PURE__ */ e(
4186
- se,
4186
+ ae,
4187
4187
  {
4188
4188
  openDelay: h,
4189
4189
  tooltip: "Line Chart",
4190
4190
  onClick: () => c("line"),
4191
4191
  className: "h-10 p-4",
4192
- children: /* @__PURE__ */ e(zn, { className: _("size-5", a) })
4192
+ children: /* @__PURE__ */ e(Fn, { className: _("size-5", a) })
4193
4193
  }
4194
4194
  ),
4195
4195
  /* @__PURE__ */ e(
4196
- se,
4196
+ ae,
4197
4197
  {
4198
4198
  openDelay: h,
4199
4199
  tooltip: "Stacked Bar Chart",
@@ -4203,7 +4203,7 @@ function Cr({
4203
4203
  }
4204
4204
  ),
4205
4205
  /* @__PURE__ */ e(
4206
- se,
4206
+ ae,
4207
4207
  {
4208
4208
  openDelay: h,
4209
4209
  tooltip: "Stacked Line Chart",
@@ -4219,7 +4219,7 @@ function Cr({
4219
4219
  }
4220
4220
  ),
4221
4221
  /* @__PURE__ */ e(
4222
- se,
4222
+ ae,
4223
4223
  {
4224
4224
  openDelay: h,
4225
4225
  tooltip: "Scatter Chart",
@@ -4229,7 +4229,7 @@ function Cr({
4229
4229
  }
4230
4230
  ),
4231
4231
  /* @__PURE__ */ e(
4232
- se,
4232
+ ae,
4233
4233
  {
4234
4234
  openDelay: h,
4235
4235
  tooltip: "Bubble Chart",
@@ -4239,7 +4239,7 @@ function Cr({
4239
4239
  }
4240
4240
  ),
4241
4241
  /* @__PURE__ */ e(
4242
- se,
4242
+ ae,
4243
4243
  {
4244
4244
  openDelay: h,
4245
4245
  tooltip: "Pie Chart",
@@ -4249,7 +4249,7 @@ function Cr({
4249
4249
  }
4250
4250
  ),
4251
4251
  /* @__PURE__ */ e(
4252
- se,
4252
+ ae,
4253
4253
  {
4254
4254
  openDelay: h,
4255
4255
  tooltip: "Doughnut Chart",
@@ -4259,7 +4259,7 @@ function Cr({
4259
4259
  }
4260
4260
  ),
4261
4261
  /* @__PURE__ */ e(
4262
- se,
4262
+ ae,
4263
4263
  {
4264
4264
  openDelay: h,
4265
4265
  tooltip: "Funnel Chart",
@@ -4269,7 +4269,7 @@ function Cr({
4269
4269
  }
4270
4270
  ),
4271
4271
  /* @__PURE__ */ e(
4272
- se,
4272
+ ae,
4273
4273
  {
4274
4274
  openDelay: h,
4275
4275
  tooltip: "Radar Chart",
@@ -4279,7 +4279,7 @@ function Cr({
4279
4279
  }
4280
4280
  ),
4281
4281
  /* @__PURE__ */ e(
4282
- se,
4282
+ ae,
4283
4283
  {
4284
4284
  openDelay: h,
4285
4285
  tooltip: "Polar Area Chart",
@@ -4289,7 +4289,7 @@ function Cr({
4289
4289
  }
4290
4290
  ),
4291
4291
  /* @__PURE__ */ e(
4292
- se,
4292
+ ae,
4293
4293
  {
4294
4294
  openDelay: h,
4295
4295
  tooltip: "Tornado Chart",
@@ -4299,7 +4299,7 @@ function Cr({
4299
4299
  }
4300
4300
  ),
4301
4301
  /* @__PURE__ */ e(
4302
- se,
4302
+ ae,
4303
4303
  {
4304
4304
  tooltip: "Range Chart",
4305
4305
  onClick: () => c("range"),
@@ -4308,7 +4308,7 @@ function Cr({
4308
4308
  }
4309
4309
  ),
4310
4310
  /* @__PURE__ */ e(
4311
- se,
4311
+ ae,
4312
4312
  {
4313
4313
  openDelay: h,
4314
4314
  tooltip: "KPI",
@@ -4318,7 +4318,7 @@ function Cr({
4318
4318
  }
4319
4319
  ),
4320
4320
  /* @__PURE__ */ e(
4321
- se,
4321
+ ae,
4322
4322
  {
4323
4323
  openDelay: h,
4324
4324
  tooltip: "Text",
@@ -4328,7 +4328,7 @@ function Cr({
4328
4328
  }
4329
4329
  ),
4330
4330
  /* @__PURE__ */ e(
4331
- se,
4331
+ ae,
4332
4332
  {
4333
4333
  tooltip: "Map",
4334
4334
  onClick: () => c("map"),
@@ -4337,7 +4337,7 @@ function Cr({
4337
4337
  }
4338
4338
  ),
4339
4339
  /* @__PURE__ */ e(
4340
- se,
4340
+ ae,
4341
4341
  {
4342
4342
  openDelay: h,
4343
4343
  tooltip: "Custom",
@@ -4357,9 +4357,9 @@ function lc({
4357
4357
  const i = xr();
4358
4358
  switch (t) {
4359
4359
  case "bar":
4360
- return /* @__PURE__ */ e(An, { className: a });
4361
- case "line":
4362
4360
  return /* @__PURE__ */ e(zn, { className: a });
4361
+ case "line":
4362
+ return /* @__PURE__ */ e(Fn, { className: a });
4363
4363
  case "pie":
4364
4364
  return /* @__PURE__ */ e(Sa, { className: a });
4365
4365
  case "radar":
@@ -4392,7 +4392,7 @@ function lc({
4392
4392
  case "custom":
4393
4393
  return n && i ? /* @__PURE__ */ e(i, { className: a }) : r ? r == null ? void 0 : r.charAt(0).toUpperCase() : /* @__PURE__ */ e(Ea, { className: a });
4394
4394
  default:
4395
- return /* @__PURE__ */ e(Fn, { className: a });
4395
+ return /* @__PURE__ */ e(Ln, { className: a });
4396
4396
  }
4397
4397
  }
4398
4398
  function wr({
@@ -4418,7 +4418,7 @@ function wr({
4418
4418
  }
4419
4419
  ) }),
4420
4420
  /* @__PURE__ */ s(
4421
- ya,
4421
+ ba,
4422
4422
  {
4423
4423
  onOpenAutoFocus: (u) => u.preventDefault(),
4424
4424
  className: "w-72 p-1",
@@ -4455,12 +4455,12 @@ function oc() {
4455
4455
  ((B = (R = (A = n == null ? void 0 : n.chartOptions) == null ? void 0 : A.scales) == null ? void 0 : R[i]) == null ? void 0 : B.min) || ""
4456
4456
  ), [h, d] = V(
4457
4457
  ((re = (j = ($ = n == null ? void 0 : n.chartOptions) == null ? void 0 : $.scales) == null ? void 0 : j[i]) == null ? void 0 : re.max) || ""
4458
- ), [m, C] = V(u || h ? "custom" : "auto"), [g, y] = V(""), [p, N] = V(0), [f, M] = V(""), [E, D] = V(""), [v, x] = V(""), b = T(
4458
+ ), [m, C] = V(u || h ? "custom" : "auto"), [g, y] = V(""), [p, N] = V(0), [f, M] = V(""), [E, D] = V(""), [b, x] = V(""), v = T(
4459
4459
  (ee) => ee.actions.setCardPreferences
4460
4460
  ), { updateCardInFrame: S } = X(), O = T((ee) => ee.card), I = ["pie", "doughnut", "polarArea", "funnel"].includes(
4461
4461
  r
4462
4462
  );
4463
- ve(() => {
4463
+ be(() => {
4464
4464
  var ee, W, te, Y, J, K, Z, ne, ye, Ve, Q, ie, Me, Qe;
4465
4465
  o(ls(n, r)), c(
4466
4466
  ((te = (W = (ee = n == null ? void 0 : n.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : W[i]) == null ? void 0 : te.min) === 0 ? 0 : ""
@@ -4475,7 +4475,7 @@ function oc() {
4475
4475
  const ee = [
4476
4476
  ...new Set(rn.map((W) => W.currency))
4477
4477
  ];
4478
- return /* @__PURE__ */ s(ae, { children: [
4478
+ return /* @__PURE__ */ s(se, { children: [
4479
4479
  /* @__PURE__ */ s("div", { className: "grid grid-cols-6 items-center gap-2", children: [
4480
4480
  /* @__PURE__ */ e(
4481
4481
  H,
@@ -4507,7 +4507,7 @@ function oc() {
4507
4507
  ]
4508
4508
  }
4509
4509
  ),
4510
- /* @__PURE__ */ s(le, { value: v, onValueChange: (W) => x(W), children: [
4510
+ /* @__PURE__ */ s(le, { value: b, onValueChange: (W) => x(W), children: [
4511
4511
  /* @__PURE__ */ e(
4512
4512
  oe,
4513
4513
  {
@@ -4536,7 +4536,7 @@ function oc() {
4536
4536
  ] });
4537
4537
  }
4538
4538
  function F() {
4539
- return /* @__PURE__ */ s(ae, { children: [
4539
+ return /* @__PURE__ */ s(se, { children: [
4540
4540
  /* @__PURE__ */ e("div", { className: "mt-4 space-y-2", children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Set the scale for number axis" }) }),
4541
4541
  /* @__PURE__ */ s("div", { className: "mt-2 grid grid-cols-3 items-center gap-2", children: [
4542
4542
  /* @__PURE__ */ e(H, { htmlFor: "scale", children: "Type" }),
@@ -4586,7 +4586,7 @@ function oc() {
4586
4586
  ] });
4587
4587
  }
4588
4588
  function z() {
4589
- return /* @__PURE__ */ s(ae, { children: [
4589
+ return /* @__PURE__ */ s(se, { children: [
4590
4590
  /* @__PURE__ */ s("div", { className: "grid grid-cols-3 items-center gap-2", children: [
4591
4591
  /* @__PURE__ */ e(H, { htmlFor: "range", children: "Range" }),
4592
4592
  /* @__PURE__ */ e(
@@ -4649,10 +4649,10 @@ function oc() {
4649
4649
  decimalPlaces: p,
4650
4650
  suffix: f,
4651
4651
  currency: E,
4652
- locale: v
4652
+ locale: b
4653
4653
  }
4654
4654
  };
4655
- console.log(W), b(W);
4655
+ console.log(W), v(W);
4656
4656
  const te = {
4657
4657
  ...O,
4658
4658
  preferences: W
@@ -4660,8 +4660,8 @@ function oc() {
4660
4660
  S(te);
4661
4661
  }
4662
4662
  return /* @__PURE__ */ s(Ye, { onOpenChange: (ee) => a(ee), children: [
4663
- /* @__PURE__ */ e(Ke, { asChild: !0, children: /* @__PURE__ */ e(se, { tooltip: "Format Number", children: /* @__PURE__ */ e(Ql, { className: "size-4" }) }) }),
4664
- /* @__PURE__ */ e(ya, { align: "end", className: "max-w-65", children: /* @__PURE__ */ s("div", { className: "grid gap-4", children: [
4663
+ /* @__PURE__ */ e(Ke, { asChild: !0, children: /* @__PURE__ */ e(ae, { tooltip: "Format Number", children: /* @__PURE__ */ e(Ql, { className: "size-4" }) }) }),
4664
+ /* @__PURE__ */ e(ba, { align: "end", className: "max-w-65", children: /* @__PURE__ */ s("div", { className: "grid gap-4", children: [
4665
4665
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
4666
4666
  /* @__PURE__ */ e("h4", { className: "font-medium leading-none", children: "Format Options" }),
4667
4667
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Set the format for number axis" })
@@ -4720,8 +4720,8 @@ function cc() {
4720
4720
  });
4721
4721
  };
4722
4722
  return /* @__PURE__ */ s(Ye, { children: [
4723
- /* @__PURE__ */ e(Ke, { asChild: !0, children: /* @__PURE__ */ e(se, { tooltip: "Legend Settings", children: /* @__PURE__ */ e(io, { className: "size-4" }) }) }),
4724
- /* @__PURE__ */ e(ya, { align: "end", className: "w-72", children: /* @__PURE__ */ s("div", { className: "grid gap-4", children: [
4723
+ /* @__PURE__ */ e(Ke, { asChild: !0, children: /* @__PURE__ */ e(ae, { tooltip: "Legend Settings", children: /* @__PURE__ */ e(io, { className: "size-4" }) }) }),
4724
+ /* @__PURE__ */ e(ba, { align: "end", className: "w-72", children: /* @__PURE__ */ s("div", { className: "grid gap-4", children: [
4725
4725
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
4726
4726
  /* @__PURE__ */ e("h4", { className: "font-medium leading-none", children: "Legend Options" }),
4727
4727
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Set the legend options for the chart." })
@@ -4738,20 +4738,20 @@ function cc() {
4738
4738
  }
4739
4739
  ) })
4740
4740
  ] }),
4741
- n && /* @__PURE__ */ s(ae, { children: [
4741
+ n && /* @__PURE__ */ s(se, { children: [
4742
4742
  /* @__PURE__ */ s("div", { className: "grid grid-cols-3 items-center gap-4", children: [
4743
4743
  /* @__PURE__ */ e(H, { htmlFor: "position", children: "Position" }),
4744
4744
  /* @__PURE__ */ s("div", { className: "col-span-2 flex h-8 items-center", children: [
4745
4745
  /* @__PURE__ */ e(
4746
- se,
4746
+ ae,
4747
4747
  {
4748
4748
  tooltip: "Top",
4749
4749
  onClick: () => l("top"),
4750
- children: /* @__PURE__ */ e(En, { className: "size-4" })
4750
+ children: /* @__PURE__ */ e(An, { className: "size-4" })
4751
4751
  }
4752
4752
  ),
4753
4753
  /* @__PURE__ */ e(
4754
- se,
4754
+ ae,
4755
4755
  {
4756
4756
  tooltip: "Left",
4757
4757
  onClick: () => l("left"),
@@ -4759,15 +4759,15 @@ function cc() {
4759
4759
  }
4760
4760
  ),
4761
4761
  /* @__PURE__ */ e(
4762
- se,
4762
+ ae,
4763
4763
  {
4764
4764
  tooltip: "Bottom",
4765
4765
  onClick: () => l("bottom"),
4766
- children: /* @__PURE__ */ e(In, { className: "size-4" })
4766
+ children: /* @__PURE__ */ e(En, { className: "size-4" })
4767
4767
  }
4768
4768
  ),
4769
4769
  /* @__PURE__ */ e(
4770
- se,
4770
+ ae,
4771
4771
  {
4772
4772
  tooltip: "Right",
4773
4773
  onClick: () => l("right"),
@@ -4780,7 +4780,7 @@ function cc() {
4780
4780
  /* @__PURE__ */ e(H, { htmlFor: "align", children: "Align" }),
4781
4781
  /* @__PURE__ */ s("div", { className: "col-span-2 flex h-8 items-center", children: [
4782
4782
  /* @__PURE__ */ e(
4783
- se,
4783
+ ae,
4784
4784
  {
4785
4785
  tooltip: "Start",
4786
4786
  onClick: () => o("start"),
@@ -4788,7 +4788,7 @@ function cc() {
4788
4788
  }
4789
4789
  ),
4790
4790
  /* @__PURE__ */ e(
4791
- se,
4791
+ ae,
4792
4792
  {
4793
4793
  tooltip: "Center",
4794
4794
  onClick: () => o("center"),
@@ -4796,7 +4796,7 @@ function cc() {
4796
4796
  }
4797
4797
  ),
4798
4798
  /* @__PURE__ */ e(
4799
- se,
4799
+ ae,
4800
4800
  {
4801
4801
  tooltip: "End",
4802
4802
  onClick: () => o("end"),
@@ -4819,7 +4819,7 @@ function dc() {
4819
4819
  ), a = T((l) => l.card.type), { setChartOrientation: n } = T((l) => l.actions);
4820
4820
  function r() {
4821
4821
  return /* @__PURE__ */ e(
4822
- se,
4822
+ ae,
4823
4823
  {
4824
4824
  onClick: () => {
4825
4825
  n(t === "x" || t === void 0 ? "y" : "x");
@@ -4831,7 +4831,7 @@ function dc() {
4831
4831
  }
4832
4832
  function i() {
4833
4833
  return /* @__PURE__ */ e(
4834
- se,
4834
+ ae,
4835
4835
  {
4836
4836
  onClick: () => {
4837
4837
  n(t === "y" || t === void 0 ? "x" : "y");
@@ -4841,7 +4841,7 @@ function dc() {
4841
4841
  }
4842
4842
  );
4843
4843
  }
4844
- return /* @__PURE__ */ e(ae, { children: a === "funnel" ? i() : r() });
4844
+ return /* @__PURE__ */ e(se, { children: a === "funnel" ? i() : r() });
4845
4845
  }
4846
4846
  function Sr() {
4847
4847
  const t = T((o) => o.card), a = T((o) => o.isShowingVisual), n = T(
@@ -4864,7 +4864,7 @@ function Sr() {
4864
4864
  "horizontalBar",
4865
4865
  "funnel"
4866
4866
  ].includes(t.type) && /* @__PURE__ */ e(dc, {}),
4867
- !["kpi", "text", "custom", "table"].includes(t.type) && /* @__PURE__ */ s(ae, { children: [
4867
+ !["kpi", "text", "custom", "table"].includes(t.type) && /* @__PURE__ */ s(se, { children: [
4868
4868
  /* @__PURE__ */ e(oc, {}),
4869
4869
  /* @__PURE__ */ e(cc, {})
4870
4870
  ] }),
@@ -4879,10 +4879,10 @@ function Sr() {
4879
4879
  "kpi",
4880
4880
  "text",
4881
4881
  "map"
4882
- ].includes(t.type) && /* @__PURE__ */ s(se, { tooltip: "Grid Style", onClick: l, children: [
4882
+ ].includes(t.type) && /* @__PURE__ */ s(ae, { tooltip: "Grid Style", onClick: l, children: [
4883
4883
  (r === "xy" || !r) && /* @__PURE__ */ e(ao, { className: "size-4" }),
4884
4884
  r === "x" && /* @__PURE__ */ e(Ul, { className: "size-4" }),
4885
- r === "y" && /* @__PURE__ */ e(vo, { className: "size-4" }),
4885
+ r === "y" && /* @__PURE__ */ e(bo, { className: "size-4" }),
4886
4886
  r === "none" && /* @__PURE__ */ e(No, { className: "size-4" })
4887
4887
  ] })
4888
4888
  ] }) : null;
@@ -4918,7 +4918,7 @@ function uc() {
4918
4918
  function m() {
4919
4919
  const y = {
4920
4920
  ...a,
4921
- id: kt(),
4921
+ id: Mt(),
4922
4922
  title: `${a.title} Copy`,
4923
4923
  tabTitle: `${a.tabTitle || a.title} Copy`
4924
4924
  };
@@ -4931,7 +4931,7 @@ function uc() {
4931
4931
  lastSelectedSchema: y.lastSelectedSchema,
4932
4932
  lastSelectedTable: y.lastSelectedTable,
4933
4933
  lastSelectedDatamodelId: y.lastSelectedDatamodelId,
4934
- id: kt(),
4934
+ id: Mt(),
4935
4935
  title: "Title",
4936
4936
  description: "",
4937
4937
  preferences: {
@@ -4976,7 +4976,7 @@ function uc() {
4976
4976
  children: [
4977
4977
  g(t, y),
4978
4978
  /* @__PURE__ */ e(
4979
- Ct,
4979
+ wt,
4980
4980
  {
4981
4981
  enabled: t.activeCardId === y.id,
4982
4982
  text: y.tabTitle || y.title,
@@ -4988,7 +4988,7 @@ function uc() {
4988
4988
  y.id
4989
4989
  ),
4990
4990
  t.activeCardId === y.id && t.cards.length > 1 && /* @__PURE__ */ e(
4991
- be,
4991
+ ve,
4992
4992
  {
4993
4993
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
4994
4994
  onClick: () => h(y.id)
@@ -5043,14 +5043,14 @@ function kr() {
5043
5043
  f.sql && c(!0), o(f);
5044
5044
  }
5045
5045
  function y() {
5046
- return a.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Ri, { card: a, data: h == null ? void 0 : h.records, isPending: d }) }) }) : a.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(bt, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
5046
+ return a.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Ri, { card: a, data: h == null ? void 0 : h.records, isPending: d }) }) }) : a.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(xt, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
5047
5047
  Vi,
5048
5048
  {
5049
5049
  isLoading: n,
5050
5050
  card: a,
5051
5051
  data: h == null ? void 0 : h.records
5052
5052
  }
5053
- ) }) }) }) : /* @__PURE__ */ e(Dn, { FallbackComponent: Hs, children: /* @__PURE__ */ e(br, { className: "grow border-none shadow-none" }) });
5053
+ ) }) }) }) : /* @__PURE__ */ e(Dn, { FallbackComponent: Hs, children: /* @__PURE__ */ e(vr, { className: "grow border-none shadow-none" }) });
5054
5054
  }
5055
5055
  return /* @__PURE__ */ s(
5056
5056
  Qt,
@@ -5074,8 +5074,8 @@ function en({
5074
5074
  T((E) => E.actions.setRunSql);
5075
5075
  const { setFrame: o, setCard: u, setActiveTabCardId: c, runAssistant: h, setIsDevMode: d } = X(), { data: m, isLoading: C, isFetching: g, error: y } = Ee(a);
5076
5076
  function p() {
5077
- const E = JSON.stringify(m == null ? void 0 : m.records, null, 2), D = new Blob([E], { type: "application/json" }), v = URL.createObjectURL(D), x = document.createElement("a");
5078
- x.href = v, x.download = `${a.title}.json`, x.click();
5077
+ const E = JSON.stringify(m == null ? void 0 : m.records, null, 2), D = new Blob([E], { type: "application/json" }), b = URL.createObjectURL(D), x = document.createElement("a");
5078
+ x.href = b, x.download = `${a.title}.json`, x.click();
5079
5079
  }
5080
5080
  function N() {
5081
5081
  const D = [
@@ -5084,8 +5084,8 @@ function en({
5084
5084
  ).join(","),
5085
5085
  ...((m == null ? void 0 : m.records) || []).map((S) => Object.values(S).join(","))
5086
5086
  ].join(`
5087
- `), v = new Blob([D], { type: "text/csv" }), x = URL.createObjectURL(v), b = document.createElement("a");
5088
- b.href = x, b.download = `${a.title}.csv`, b.click();
5087
+ `), b = new Blob([D], { type: "text/csv" }), x = URL.createObjectURL(b), v = document.createElement("a");
5088
+ v.href = x, v.download = `${a.title}.csv`, v.click();
5089
5089
  }
5090
5090
  function f() {
5091
5091
  const E = `Can you get the documentation for ${a.type} chart?`;
@@ -5104,7 +5104,7 @@ function en({
5104
5104
  children: [
5105
5105
  r && /* @__PURE__ */ s("div", { className: "flex grow items-center", children: [
5106
5106
  /* @__PURE__ */ e(wr, {}),
5107
- i && /* @__PURE__ */ e(se, { tooltip: "Visual Docs", onClick: f, children: /* @__PURE__ */ e(jl, { className: "size-4" }) }),
5107
+ i && /* @__PURE__ */ e(ae, { tooltip: "Visual Docs", onClick: f, children: /* @__PURE__ */ e(jl, { className: "size-4" }) }),
5108
5108
  !["table", "custom"].includes(a.type) && i && /* @__PURE__ */ e(ac, {})
5109
5109
  ] }),
5110
5110
  !r && /* @__PURE__ */ s("div", { className: "flex grow items-center gap-1", children: [
@@ -5150,7 +5150,7 @@ function en({
5150
5150
  className: "px-6",
5151
5151
  direction: "horizontal",
5152
5152
  children: [
5153
- l && /* @__PURE__ */ s(ae, { children: [
5153
+ l && /* @__PURE__ */ s(se, { children: [
5154
5154
  /* @__PURE__ */ e(
5155
5155
  Ce,
5156
5156
  {
@@ -5182,7 +5182,7 @@ function en({
5182
5182
  )
5183
5183
  ]
5184
5184
  }
5185
- ) : /* @__PURE__ */ e(ae, { children: "No Active Card" });
5185
+ ) : /* @__PURE__ */ e(se, { children: "No Active Card" });
5186
5186
  }
5187
5187
  function mc() {
5188
5188
  const t = T((n) => n.pythonStdOut);
@@ -5190,7 +5190,7 @@ function mc() {
5190
5190
  const a = t.replace(/\n/g, "<br>");
5191
5191
  return /* @__PURE__ */ s("div", { className: "relative flex w-full flex-col border-r", children: [
5192
5192
  /* @__PURE__ */ e("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center border-b bg-muted px-3 font-mono text-xs font-semibold text-foreground/70", children: "Python Output" }),
5193
- /* @__PURE__ */ s(bt, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
5193
+ /* @__PURE__ */ s(xt, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
5194
5194
  /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: a } }),
5195
5195
  /* @__PURE__ */ e(He, { orientation: "horizontal" })
5196
5196
  ] })
@@ -5238,28 +5238,28 @@ function pc() {
5238
5238
  }
5239
5239
  function m(f) {
5240
5240
  var E, D;
5241
- const M = (E = i == null ? void 0 : i.cards) == null ? void 0 : E.filter((v) => {
5241
+ const M = (E = i == null ? void 0 : i.cards) == null ? void 0 : E.filter((b) => {
5242
5242
  var x;
5243
- return ((x = v == null ? void 0 : v.customCardPreferences) == null ? void 0 : x.visualType) !== "multiple";
5244
- }).map((v) => ({
5245
- value: v.id,
5246
- label: v.tabTitle || v.title
5243
+ return ((x = b == null ? void 0 : b.customCardPreferences) == null ? void 0 : x.visualType) !== "multiple";
5244
+ }).map((b) => ({
5245
+ value: b.id,
5246
+ label: b.tabTitle || b.title
5247
5247
  }));
5248
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: (D = f == null ? void 0 : f.dataInputs) == null ? void 0 : D.map((v, x) => {
5249
- var b, S;
5248
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: (D = f == null ? void 0 : f.dataInputs) == null ? void 0 : D.map((b, x) => {
5249
+ var v, S;
5250
5250
  return /* @__PURE__ */ s(
5251
5251
  "div",
5252
5252
  {
5253
5253
  className: "grid grid-cols-10 gap-2",
5254
5254
  children: [
5255
- /* @__PURE__ */ e("div", { className: "col-span-4 flex items-center", children: v }),
5255
+ /* @__PURE__ */ e("div", { className: "col-span-4 flex items-center", children: b }),
5256
5256
  /* @__PURE__ */ e(
5257
5257
  Fe,
5258
5258
  {
5259
5259
  className: "col-span-6 h-8 w-full justify-between",
5260
5260
  label: "",
5261
5261
  options: M || [],
5262
- value: ((S = (b = t == null ? void 0 : t.dataInputCardIds) == null ? void 0 : b[x]) == null ? void 0 : S.cardId) || "",
5262
+ value: ((S = (v = t == null ? void 0 : t.dataInputCardIds) == null ? void 0 : v[x]) == null ? void 0 : S.cardId) || "",
5263
5263
  onValueChange: (O) => d(x, O)
5264
5264
  }
5265
5265
  )
@@ -5270,18 +5270,18 @@ function pc() {
5270
5270
  }) });
5271
5271
  }
5272
5272
  function C(f, M, E = [], D = "") {
5273
- var v, x;
5273
+ var b, x;
5274
5274
  return t ? f === "input" ? /* @__PURE__ */ e(
5275
5275
  we,
5276
5276
  {
5277
5277
  className: `h-8 w-full ${Ze}`,
5278
- value: ((v = t == null ? void 0 : t.settings) == null ? void 0 : v[M]) || D,
5279
- onChange: (b) => {
5278
+ value: ((b = t == null ? void 0 : t.settings) == null ? void 0 : b[M]) || D,
5279
+ onChange: (v) => {
5280
5280
  o({
5281
5281
  ...t,
5282
5282
  settings: {
5283
5283
  ...t == null ? void 0 : t.settings,
5284
- [M]: b.target.value
5284
+ [M]: v.target.value
5285
5285
  }
5286
5286
  });
5287
5287
  }
@@ -5294,10 +5294,10 @@ function pc() {
5294
5294
  label: "",
5295
5295
  options: E,
5296
5296
  value: ((x = t == null ? void 0 : t.settings) == null ? void 0 : x[M]) || D,
5297
- onValueChange: (b) => {
5297
+ onValueChange: (v) => {
5298
5298
  o({
5299
5299
  ...t,
5300
- settings: { ...t == null ? void 0 : t.settings, [M]: b }
5300
+ settings: { ...t == null ? void 0 : t.settings, [M]: v }
5301
5301
  });
5302
5302
  }
5303
5303
  }
@@ -5362,7 +5362,7 @@ function pc() {
5362
5362
  }
5363
5363
  )
5364
5364
  ] }) }),
5365
- ((t == null ? void 0 : t.type) === "component" || (t == null ? void 0 : t.type) === void 0) && t && /* @__PURE__ */ e(ae, { children: u && /* @__PURE__ */ e(
5365
+ ((t == null ? void 0 : t.type) === "component" || (t == null ? void 0 : t.type) === void 0) && t && /* @__PURE__ */ e(se, { children: u && /* @__PURE__ */ e(
5366
5366
  Fe,
5367
5367
  {
5368
5368
  icon: /* @__PURE__ */ e(Yl, { className: "h-3.5 w-3.5" }),
@@ -5397,7 +5397,7 @@ function pc() {
5397
5397
  }
5398
5398
  );
5399
5399
  }
5400
- function Nt() {
5400
+ function Ct() {
5401
5401
  const [t, a] = V([]), n = T((h) => h.card.preferences), { setFilterOnClickColumnIndex: r, setCardPreferences: i } = T(
5402
5402
  (h) => h.actions
5403
5403
  ), l = T(
@@ -5408,7 +5408,7 @@ function Nt() {
5408
5408
  var d;
5409
5409
  return (d = h.card.preferences) == null ? void 0 : d.filterOnClickColumnIndex;
5410
5410
  }
5411
- ), ve(() => {
5411
+ ), be(() => {
5412
5412
  l && a(new Array(l.length).fill(!1));
5413
5413
  }, [l]);
5414
5414
  function o(h, d) {
@@ -5560,13 +5560,13 @@ function fc({ idx: t }) {
5560
5560
  }
5561
5561
  return /* @__PURE__ */ s(Ye, { children: [
5562
5562
  /* @__PURE__ */ e(Ke, { children: /* @__PURE__ */ e(lr, { className: "size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground" }) }),
5563
- /* @__PURE__ */ e(It, { className: "w-fit px-2 py-1", children: /* @__PURE__ */ s("div", { className: "flex gap-1", children: [
5563
+ /* @__PURE__ */ e(Et, { className: "w-fit px-2 py-1", children: /* @__PURE__ */ s("div", { className: "flex gap-1", children: [
5564
5564
  /* @__PURE__ */ e(
5565
5565
  "button",
5566
5566
  {
5567
5567
  onClick: () => o("none", t),
5568
5568
  className: "h-7 p-1 text-xs font-normal",
5569
- children: /* @__PURE__ */ e(be, { className: "size-3.5" })
5569
+ children: /* @__PURE__ */ e(ve, { className: "size-3.5" })
5570
5570
  }
5571
5571
  ),
5572
5572
  /* @__PURE__ */ e(
@@ -5618,7 +5618,7 @@ function fc({ idx: t }) {
5618
5618
  ] });
5619
5619
  }
5620
5620
  function Mr() {
5621
- const t = T((l) => l.card), { data: a } = Ee(t), { keys: n } = Kn((a == null ? void 0 : a.records) || []), r = n.slice(1).filter((l) => !Pi.includes(l));
5621
+ const t = T((l) => l.card), { data: a } = Ee(t), { keys: n } = Qn((a == null ? void 0 : a.records) || []), r = n.slice(1).filter((l) => !Pi.includes(l));
5622
5622
  let i = r;
5623
5623
  if (["stackedBar", "stackedLine"].includes(t.type)) {
5624
5624
  const l = _i({
@@ -5626,7 +5626,7 @@ function Mr() {
5626
5626
  groupKey: n[0],
5627
5627
  pivotKey: n[1],
5628
5628
  valueKey: n[2]
5629
- }), { keys: o } = Kn(l);
5629
+ }), { keys: o } = Qn(l);
5630
5630
  i = o.slice(1);
5631
5631
  }
5632
5632
  return {
@@ -5642,7 +5642,7 @@ function hn({
5642
5642
  delayDuration: n
5643
5643
  }) {
5644
5644
  return /* @__PURE__ */ e(Yt, { children: /* @__PURE__ */ s(yt, { delayDuration: n, children: [
5645
- /* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(
5645
+ /* @__PURE__ */ e(At, { asChild: !0, children: /* @__PURE__ */ e(
5646
5646
  "span",
5647
5647
  {
5648
5648
  className: _(
@@ -5652,7 +5652,7 @@ function hn({
5652
5652
  children: t
5653
5653
  }
5654
5654
  ) }),
5655
- /* @__PURE__ */ e(vt, { children: t })
5655
+ /* @__PURE__ */ e(bt, { children: t })
5656
5656
  ] }) });
5657
5657
  }
5658
5658
  function Tr() {
@@ -5745,7 +5745,7 @@ function Or({
5745
5745
  i || /* @__PURE__ */ e(hn, { className: "max-w-[100px]", title: t, children: Dr(t) }),
5746
5746
  /* @__PURE__ */ s("div", { className: "flex gap-2", children: [
5747
5747
  /* @__PURE__ */ e(
5748
- An,
5748
+ zn,
5749
5749
  {
5750
5750
  onClick: () => h("bar"),
5751
5751
  className: _(
@@ -5755,7 +5755,7 @@ function Or({
5755
5755
  }
5756
5756
  ),
5757
5757
  /* @__PURE__ */ e(
5758
- zn,
5758
+ Fn,
5759
5759
  {
5760
5760
  onClick: () => h("line"),
5761
5761
  className: _(
@@ -5781,9 +5781,9 @@ function Or({
5781
5781
  );
5782
5782
  }
5783
5783
  function Ir() {
5784
- const t = T((g) => g.selectedConnectionId), a = T((g) => g.selectedDatamodelId), n = T((g) => g.selectedDatabaseName), r = T((g) => g.selectedSchemaName), i = T((g) => g.selectedTableName), l = G((g) => g.dashboard.filters) || [], o = G((g) => g.actions.addFilter), u = G((g) => g.actions.removeFilter), { removeFilterValues: c } = Ot(), { modelItems: h, tableName: d, connectionType: m } = Pe();
5784
+ const t = T((g) => g.selectedConnectionId), a = T((g) => g.selectedDatamodelId), n = T((g) => g.selectedDatabaseName), r = T((g) => g.selectedSchemaName), i = T((g) => g.selectedTableName), l = G((g) => g.dashboard.filters) || [], o = G((g) => g.actions.addFilter), u = G((g) => g.actions.removeFilter), { removeFilterValues: c } = It(), { modelItems: h, tableName: d, connectionType: m } = Pe();
5785
5785
  function C(g, y = "dashboard") {
5786
- var b;
5786
+ var v;
5787
5787
  const p = qe(g.column_name), N = qe(n || ""), f = qe(r || ""), M = qe(d);
5788
5788
  let E = $i({
5789
5789
  schemaName: f,
@@ -5791,17 +5791,17 @@ function Ir() {
5791
5791
  connectionType: m,
5792
5792
  databaseName: N
5793
5793
  }), D = `${E}.${p}`;
5794
- const v = (b = h == null ? void 0 : h.find(
5794
+ const b = (v = h == null ? void 0 : h.find(
5795
5795
  (S) => S.id === a
5796
- )) == null ? void 0 : b.name;
5797
- a && a !== "none" && (D = `${Wa}.${v}.${p}`, E = `${Wa}.${v}`);
5796
+ )) == null ? void 0 : v.name;
5797
+ a && a !== "none" && (D = `${Wa}.${b}.${p}`, E = `${Wa}.${b}`);
5798
5798
  const x = l == null ? void 0 : l.find(
5799
5799
  (S) => S.column === D && S.table === M && (S.database === N || S.database === n)
5800
5800
  );
5801
5801
  if (x)
5802
5802
  c(x.id), u(x.id);
5803
5803
  else {
5804
- const S = kt();
5804
+ const S = Mt();
5805
5805
  return d === "api" && t ? (o({
5806
5806
  location: y,
5807
5807
  id: S,
@@ -5814,7 +5814,7 @@ function Ir() {
5814
5814
  // database: 'NA',
5815
5815
  connectionId: t,
5816
5816
  operation: "in",
5817
- sql: Yn(
5817
+ sql: Kn(
5818
5818
  g.data_type,
5819
5819
  E,
5820
5820
  p
@@ -5832,7 +5832,7 @@ function Ir() {
5832
5832
  database: n || "",
5833
5833
  connectionId: t || "",
5834
5834
  operation: "in",
5835
- sql: Yn(
5835
+ sql: Kn(
5836
5836
  g.data_type,
5837
5837
  E,
5838
5838
  p
@@ -5879,7 +5879,7 @@ function gc({
5879
5879
  ]
5880
5880
  }
5881
5881
  ) }),
5882
- /* @__PURE__ */ e(It, { className: "w-[200px] p-0", children: /* @__PURE__ */ s(bn, { children: [
5882
+ /* @__PURE__ */ e(Et, { className: "w-[200px] p-0", children: /* @__PURE__ */ s(vn, { children: [
5883
5883
  /* @__PURE__ */ e(xn, { placeholder: "Search column", className: "h-9" }),
5884
5884
  /* @__PURE__ */ s(Nn, { children: [
5885
5885
  /* @__PURE__ */ e(Cn, { children: "No framework found." }),
@@ -5946,7 +5946,7 @@ function yc({
5946
5946
  /* @__PURE__ */ s(he, { value: "item-3", children: [
5947
5947
  /* @__PURE__ */ e(pe, { children: "Filters" }),
5948
5948
  /* @__PURE__ */ s(fe, { className: "space-y-4 px-2", children: [
5949
- /* @__PURE__ */ e(Nt, {}),
5949
+ /* @__PURE__ */ e(Ct, {}),
5950
5950
  /* @__PURE__ */ e(Lt, {})
5951
5951
  ] })
5952
5952
  ] })
@@ -5998,11 +5998,11 @@ function Ba() {
5998
5998
  )
5999
5999
  ] });
6000
6000
  }
6001
- function vc({
6001
+ function bc({
6002
6002
  cardType: t
6003
6003
  }) {
6004
6004
  function a(n) {
6005
- return /* @__PURE__ */ s(ae, { children: [
6005
+ return /* @__PURE__ */ s(se, { children: [
6006
6006
  /* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: n === "bubble" ? "SELECT label, [group], x-axis, y-axis, radius FROM table" : "SELECT label, [group], x-axis, y-axis FROM table" }),
6007
6007
  /* @__PURE__ */ s("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
6008
6008
  /* @__PURE__ */ e("li", { children: "label - category" }),
@@ -6039,13 +6039,13 @@ function vc({
6039
6039
  /* @__PURE__ */ s(he, { value: "item-3", children: [
6040
6040
  /* @__PURE__ */ e(pe, { children: "Filters" }),
6041
6041
  /* @__PURE__ */ s(fe, { className: "space-y-4 px-2", children: [
6042
- /* @__PURE__ */ e(Nt, {}),
6042
+ /* @__PURE__ */ e(Ct, {}),
6043
6043
  /* @__PURE__ */ e(Lt, {})
6044
6044
  ] })
6045
6045
  ] })
6046
6046
  ] }) });
6047
6047
  }
6048
- const bc = {
6048
+ const vc = {
6049
6049
  datasets: [
6050
6050
  {
6051
6051
  type: "line",
@@ -6082,14 +6082,14 @@ function Nc() {
6082
6082
  ),
6083
6083
  !["kpi"].includes(t) && /* @__PURE__ */ s("div", { className: "space-y-4", children: [
6084
6084
  /* @__PURE__ */ e(Ba, {}),
6085
- /* @__PURE__ */ e(Nt, {}),
6085
+ /* @__PURE__ */ e(Ct, {}),
6086
6086
  /* @__PURE__ */ e(Lt, {})
6087
6087
  ] })
6088
6088
  ] });
6089
6089
  }
6090
6090
  function Cc(t) {
6091
6091
  if (["line", "bar"].includes(t))
6092
- return /* @__PURE__ */ s(ae, { children: [
6092
+ return /* @__PURE__ */ s(se, { children: [
6093
6093
  /* @__PURE__ */ s(he, { value: "item-1", children: [
6094
6094
  /* @__PURE__ */ e(pe, { className: "font-normal", children: /* @__PURE__ */ e("p", { children: "Chart Query" }) }),
6095
6095
  /* @__PURE__ */ s(fe, { className: " ", children: [
@@ -6108,7 +6108,7 @@ function Cc(t) {
6108
6108
  /* @__PURE__ */ e("b", { children: "Customize" }),
6109
6109
  " and change the `type` property in the dataset."
6110
6110
  ] }),
6111
- /* @__PURE__ */ e("pre", { children: JSON.stringify(bc, null, 2) })
6111
+ /* @__PURE__ */ e("pre", { children: JSON.stringify(vc, null, 2) })
6112
6112
  ] })
6113
6113
  ] }),
6114
6114
  /* @__PURE__ */ s(he, { value: "item-3", children: [
@@ -6134,7 +6134,7 @@ function Cc(t) {
6134
6134
  ] })
6135
6135
  ] });
6136
6136
  if (t === "bubble")
6137
- return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ s(he, { value: "item-1", children: [
6137
+ return /* @__PURE__ */ e(se, { children: /* @__PURE__ */ s(he, { value: "item-1", children: [
6138
6138
  /* @__PURE__ */ e(pe, { className: "font-normal", children: /* @__PURE__ */ s("p", { children: [
6139
6139
  "How to create a ",
6140
6140
  /* @__PURE__ */ e("span", { children: t }),
@@ -6152,7 +6152,7 @@ function Cc(t) {
6152
6152
  ] })
6153
6153
  ] }) });
6154
6154
  if (t === "scatter")
6155
- return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ s(he, { value: "item-1", children: [
6155
+ return /* @__PURE__ */ e(se, { children: /* @__PURE__ */ s(he, { value: "item-1", children: [
6156
6156
  /* @__PURE__ */ e(pe, { className: "font-normal", children: /* @__PURE__ */ s("p", { children: [
6157
6157
  "How to create a ",
6158
6158
  /* @__PURE__ */ e("span", { children: t }),
@@ -6169,7 +6169,7 @@ function Cc(t) {
6169
6169
  ] })
6170
6170
  ] }) });
6171
6171
  if (["pie", "doughnut", "polarArea", "funnel"].includes(t))
6172
- return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ s(he, { value: "item-1", children: [
6172
+ return /* @__PURE__ */ e(se, { children: /* @__PURE__ */ s(he, { value: "item-1", children: [
6173
6173
  /* @__PURE__ */ e(pe, { className: "font-normal", children: /* @__PURE__ */ s("p", { children: [
6174
6174
  /* @__PURE__ */ e("span", { children: t === "polarArea" ? "Polar" : t.charAt(0).toUpperCase() + t.slice(1) }),
6175
6175
  " ",
@@ -6381,7 +6381,7 @@ function Sc() {
6381
6381
  /* @__PURE__ */ e("div", {})
6382
6382
  ] });
6383
6383
  }
6384
- function Gn({
6384
+ function Jn({
6385
6385
  children: t,
6386
6386
  summary: a,
6387
6387
  open: n,
@@ -6503,17 +6503,17 @@ const kc = [
6503
6503
  value: t
6504
6504
  }));
6505
6505
  function Dc() {
6506
- var c, h, d, m, C, g, y, p, N, f, M, E, D, v, x, b, S, O;
6506
+ var c, h, d, m, C, g, y, p, N, f, M, E, D, b, x, v, S, O;
6507
6507
  const t = T((I) => I.card), a = (h = (c = t == null ? void 0 : t.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : h.topoJsonUrl, [n, r] = V(
6508
6508
  ((m = (d = t == null ? void 0 : t.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : m.customTopoJsonUrl) || ""
6509
- ), { setCardPreferences: i } = X(), { data: l } = ga(t), o = Object.keys((l == null ? void 0 : l.objects) || {}).map((I) => ({
6509
+ ), { setCardPreferences: i } = X(), { data: l } = ya(t), o = Object.keys((l == null ? void 0 : l.objects) || {}).map((I) => ({
6510
6510
  label: I,
6511
6511
  value: I
6512
6512
  })) || [];
6513
6513
  return /* @__PURE__ */ s("div", { className: "p-6", children: [
6514
- /* @__PURE__ */ e(Gn, { summary: "Map Chart", children: /* @__PURE__ */ e("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
6514
+ /* @__PURE__ */ e(Jn, { summary: "Map Chart", children: /* @__PURE__ */ e("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
6515
6515
  /* @__PURE__ */ e(at, { className: "my-4" }),
6516
- /* @__PURE__ */ e(Gn, { open: !0, summary: "Settings", children: /* @__PURE__ */ s("div", { className: "space-y-3 px-2", children: [
6516
+ /* @__PURE__ */ e(Jn, { open: !0, summary: "Settings", children: /* @__PURE__ */ s("div", { className: "space-y-3 px-2", children: [
6517
6517
  /* @__PURE__ */ e(
6518
6518
  Fe,
6519
6519
  {
@@ -6566,7 +6566,7 @@ function Dc() {
6566
6566
  placeholder: "Custom URL"
6567
6567
  }
6568
6568
  ),
6569
- l && /* @__PURE__ */ s(ae, { children: [
6569
+ l && /* @__PURE__ */ s(se, { children: [
6570
6570
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
6571
6571
  /* @__PURE__ */ e(H, { children: "Map Object" }),
6572
6572
  /* @__PURE__ */ e(
@@ -6636,7 +6636,7 @@ function Dc() {
6636
6636
  ] })
6637
6637
  ] }) }),
6638
6638
  /* @__PURE__ */ e(at, { className: "my-4" }),
6639
- /* @__PURE__ */ e(Gn, { className: "", summary: "Scale Options", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
6639
+ /* @__PURE__ */ e(Jn, { className: "", summary: "Scale Options", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
6640
6640
  /* @__PURE__ */ e(
6641
6641
  we,
6642
6642
  {
@@ -6663,7 +6663,7 @@ function Dc() {
6663
6663
  className: `h-9 w-full ${Ze}`,
6664
6664
  type: "number",
6665
6665
  step: 10,
6666
- value: ((x = (v = (D = t.preferences) == null ? void 0 : D.mapVisualOptions) == null ? void 0 : v.projectionOffset) == null ? void 0 : x[0]) || 0,
6666
+ value: ((x = (b = (D = t.preferences) == null ? void 0 : D.mapVisualOptions) == null ? void 0 : b.projectionOffset) == null ? void 0 : x[0]) || 0,
6667
6667
  onChange: (I) => {
6668
6668
  var w, L, F, z;
6669
6669
  i({
@@ -6686,7 +6686,7 @@ function Dc() {
6686
6686
  className: `h-9 w-full ${Ze}`,
6687
6687
  type: "number",
6688
6688
  step: 10,
6689
- value: ((O = (S = (b = t.preferences) == null ? void 0 : b.mapVisualOptions) == null ? void 0 : S.projectionOffset) == null ? void 0 : O[1]) || 0,
6689
+ value: ((O = (S = (v = t.preferences) == null ? void 0 : v.mapVisualOptions) == null ? void 0 : S.projectionOffset) == null ? void 0 : O[1]) || 0,
6690
6690
  onChange: (I) => {
6691
6691
  var w, L, F, z;
6692
6692
  i({
@@ -6704,7 +6704,7 @@ function Dc() {
6704
6704
  )
6705
6705
  ] }) }),
6706
6706
  /* @__PURE__ */ e(at, { className: "my-4" }),
6707
- /* @__PURE__ */ e(Nt, {})
6707
+ /* @__PURE__ */ e(Ct, {})
6708
6708
  ] });
6709
6709
  }
6710
6710
  function Oc() {
@@ -6780,7 +6780,7 @@ function tn({
6780
6780
  !["range", "text"].includes(t) && /* @__PURE__ */ s(he, { value: "item-3", children: [
6781
6781
  /* @__PURE__ */ e(pe, { children: "Filters" }),
6782
6782
  /* @__PURE__ */ s(fe, { className: "space-y-4 px-2", children: [
6783
- /* @__PURE__ */ e(Nt, {}),
6783
+ /* @__PURE__ */ e(Ct, {}),
6784
6784
  /* @__PURE__ */ e(Lt, {})
6785
6785
  ] })
6786
6786
  ] })
@@ -6859,7 +6859,7 @@ function Ic() {
6859
6859
  /* @__PURE__ */ s(he, { value: "item-3", children: [
6860
6860
  /* @__PURE__ */ e(pe, { children: "Filters" }),
6861
6861
  /* @__PURE__ */ s(fe, { className: "space-y-4 px-2", children: [
6862
- /* @__PURE__ */ e(Nt, {}),
6862
+ /* @__PURE__ */ e(Ct, {}),
6863
6863
  /* @__PURE__ */ e(Lt, {})
6864
6864
  ] })
6865
6865
  ] })
@@ -6879,7 +6879,7 @@ function Ec({
6879
6879
  /* @__PURE__ */ e(ot, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ s(he, { value: "item-3", children: [
6880
6880
  /* @__PURE__ */ e(pe, { children: "Filters" }),
6881
6881
  /* @__PURE__ */ s(fe, { className: "space-y-4 px-2", children: [
6882
- /* @__PURE__ */ e(Nt, {}),
6882
+ /* @__PURE__ */ e(Ct, {}),
6883
6883
  /* @__PURE__ */ e(Lt, {})
6884
6884
  ] })
6885
6885
  ] }) }),
@@ -6975,7 +6975,7 @@ function Lc() {
6975
6975
  return /* @__PURE__ */ e(tn, { cardType: n });
6976
6976
  case "bubble":
6977
6977
  case "scatter":
6978
- return /* @__PURE__ */ e(vc, { cardType: n });
6978
+ return /* @__PURE__ */ e(bc, { cardType: n });
6979
6979
  case "table":
6980
6980
  return /* @__PURE__ */ e(Ec, { cardType: n });
6981
6981
  case "text":
@@ -6995,7 +6995,7 @@ function Lc() {
6995
6995
  return /* @__PURE__ */ e(Nc, {});
6996
6996
  }
6997
6997
  }
6998
- return /* @__PURE__ */ s(bt, { className: "h-full w-full text-sm", children: [
6998
+ return /* @__PURE__ */ s(xt, { className: "h-full w-full text-sm", children: [
6999
6999
  a(t),
7000
7000
  /* @__PURE__ */ e(He, { orientation: "horizontal" })
7001
7001
  ] });
@@ -7052,12 +7052,12 @@ const Rc = [
7052
7052
  {
7053
7053
  label: "Min",
7054
7054
  value: "MIN",
7055
- logo: /* @__PURE__ */ e(In, { className: "size-3.5" })
7055
+ logo: /* @__PURE__ */ e(En, { className: "size-3.5" })
7056
7056
  },
7057
7057
  {
7058
7058
  label: "Max",
7059
7059
  value: "MAX",
7060
- logo: /* @__PURE__ */ e(En, { className: "size-3.5" })
7060
+ logo: /* @__PURE__ */ e(An, { className: "size-3.5" })
7061
7061
  }
7062
7062
  ];
7063
7063
  function Vc({ column: t }) {
@@ -7114,7 +7114,7 @@ function qc({ column: t }) {
7114
7114
  const i = {
7115
7115
  ...t,
7116
7116
  granularity: r,
7117
- label: Dt(t.name, r)
7117
+ label: Ot(t.name, r)
7118
7118
  };
7119
7119
  a(t.id, i);
7120
7120
  }
@@ -7186,7 +7186,7 @@ function Pc({ column: t }) {
7186
7186
  ), u = o ? n.indexOf(o) : -1;
7187
7187
  return /* @__PURE__ */ s("div", { className: "space-y-3", children: [
7188
7188
  o && /* @__PURE__ */ e(Or, { idx: u, col: o, children: /* @__PURE__ */ e(
7189
- Ct,
7189
+ wt,
7190
7190
  {
7191
7191
  enabled: !0,
7192
7192
  className: "w-[130px]",
@@ -7204,7 +7204,7 @@ function Pc({ column: t }) {
7204
7204
  l && /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2", children: [
7205
7205
  /* @__PURE__ */ e(H, { children: "Pivot Header" }),
7206
7206
  /* @__PURE__ */ e(
7207
- Ct,
7207
+ wt,
7208
7208
  {
7209
7209
  enabled: !0,
7210
7210
  text: t.aliasTemplate || "",
@@ -7244,7 +7244,7 @@ function _c({
7244
7244
  transition: g
7245
7245
  } : void 0, N = _e(t.type);
7246
7246
  function f(x) {
7247
- const b = pt(x.data_type), S = _e(x.data_type), O = $e(x.data_type), I = b ? "number" : S ? "string" : O ? "date" : "string";
7247
+ const v = pt(x.data_type), S = _e(x.data_type), O = $e(x.data_type), I = v ? "number" : S ? "string" : O ? "date" : "string";
7248
7248
  if (r === ut) {
7249
7249
  if (S) {
7250
7250
  const w = {
@@ -7263,7 +7263,7 @@ function _c({
7263
7263
  name: x.column_name,
7264
7264
  type: I,
7265
7265
  role: "groupby",
7266
- label: Dt(x.column_name, "month"),
7266
+ label: Ot(x.column_name, "month"),
7267
7267
  granularity: "month"
7268
7268
  };
7269
7269
  o(t.id, w);
@@ -7286,7 +7286,7 @@ function _c({
7286
7286
  // use the previous column's id.
7287
7287
  name: x.column_name,
7288
7288
  type: I,
7289
- label: Dt(x.column_name, "month"),
7289
+ label: Ot(x.column_name, "month"),
7290
7290
  granularity: "month",
7291
7291
  role: "groupby"
7292
7292
  };
@@ -7301,7 +7301,7 @@ function _c({
7301
7301
  type: I,
7302
7302
  role: "metric",
7303
7303
  label: $t(x.column_name, "SUM"),
7304
- aggregate: b ? "SUM" : "COUNT"
7304
+ aggregate: v ? "SUM" : "COUNT"
7305
7305
  };
7306
7306
  u(t.id, w);
7307
7307
  }
@@ -7342,7 +7342,7 @@ function _c({
7342
7342
  }
7343
7343
  );
7344
7344
  }
7345
- function v() {
7345
+ function b() {
7346
7346
  return /* @__PURE__ */ e("div", { "data-setting-actions": "", className: "flex h-full items-center gap-2", children: /* @__PURE__ */ e(
7347
7347
  "button",
7348
7348
  {
@@ -7369,7 +7369,7 @@ function _c({
7369
7369
  return /* @__PURE__ */ e("div", { ...d, ...h, ref: m, style: p, children: /* @__PURE__ */ s("div", { className: "group flex items-center justify-between gap-2", children: [
7370
7370
  /* @__PURE__ */ s("div", { className: "grow", children: [
7371
7371
  /* @__PURE__ */ s("div", { className: "flex h-8 grow items-center justify-between rounded-md bg-muted", children: [
7372
- v(),
7372
+ b(),
7373
7373
  E(),
7374
7374
  D()
7375
7375
  ] }),
@@ -7384,12 +7384,12 @@ function _c({
7384
7384
  hidden: i
7385
7385
  }
7386
7386
  ),
7387
- children: /* @__PURE__ */ e("button", { onClick: () => n(t.id), children: /* @__PURE__ */ e(be, { className: "size-3 cursor-pointer text-muted-foreground" }) })
7387
+ children: /* @__PURE__ */ e("button", { onClick: () => n(t.id), children: /* @__PURE__ */ e(ve, { className: "size-3 cursor-pointer text-muted-foreground" }) })
7388
7388
  }
7389
7389
  )
7390
7390
  ] }) });
7391
7391
  }
7392
- function Jn({
7392
+ function Hn({
7393
7393
  id: t,
7394
7394
  label: a,
7395
7395
  columns: n,
@@ -7398,7 +7398,7 @@ function Jn({
7398
7398
  onRemoveColumn: l
7399
7399
  }) {
7400
7400
  var p, N;
7401
- const { setNodeRef: o, isOver: u, over: c } = ba({
7401
+ const { setNodeRef: o, isOver: u, over: c } = xa({
7402
7402
  id: t
7403
7403
  }), h = st((f) => f.activeId), d = T((f) => {
7404
7404
  var M;
@@ -7469,7 +7469,7 @@ function Gc() {
7469
7469
  return (M = f.card.queryConfig) == null ? void 0 : M.metricColumns;
7470
7470
  }) || [], { addOrderByColumn: r, removeOrderByColumn: i, updateOrderByColumn: l } = X(), o = [...a, ...n];
7471
7471
  if (o.length === 0)
7472
- return /* @__PURE__ */ e(ae, {});
7472
+ return /* @__PURE__ */ e(se, {});
7473
7473
  const u = /* @__PURE__ */ e(Rl, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), c = /* @__PURE__ */ e(El, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), h = /* @__PURE__ */ e(Ll, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), d = /* @__PURE__ */ e(Il, { className: "size-3.5 text-muted-foreground hover:text-foreground" }), m = o == null ? void 0 : o.filter((f) => !t.some((M) => M.columnId === f.id)).map((f) => ({
7474
7474
  id: f.id,
7475
7475
  value: f.label || f.name
@@ -7556,7 +7556,7 @@ function Gc() {
7556
7556
  {
7557
7557
  onClick: () => N(f.columnId),
7558
7558
  className: "rounded-sm p-0",
7559
- children: /* @__PURE__ */ e(be, { className: "size-3 text-muted-foreground opacity-0 transition-opacity duration-200 hover:text-foreground group-hover:opacity-100" })
7559
+ children: /* @__PURE__ */ e(ve, { className: "size-3 text-muted-foreground opacity-0 transition-opacity duration-200 hover:text-foreground group-hover:opacity-100" })
7560
7560
  }
7561
7561
  ) })
7562
7562
  ] })
@@ -7614,7 +7614,7 @@ function Jc() {
7614
7614
  /* @__PURE__ */ s(Kt, { className: "flex min-h-0 grow basis-0 flex-col gap-4 overflow-y-auto", children: [
7615
7615
  /* @__PURE__ */ s("div", { className: "flex flex-col gap-4 p-4", children: [
7616
7616
  /* @__PURE__ */ e(
7617
- Jn,
7617
+ Hn,
7618
7618
  {
7619
7619
  onRemoveColumn: d,
7620
7620
  sortableType: cn,
@@ -7625,7 +7625,7 @@ function Jc() {
7625
7625
  }
7626
7626
  ),
7627
7627
  /* @__PURE__ */ e(
7628
- Jn,
7628
+ Hn,
7629
7629
  {
7630
7630
  onRemoveColumn: C,
7631
7631
  sortableType: dn,
@@ -7636,10 +7636,10 @@ function Jc() {
7636
7636
  }
7637
7637
  ),
7638
7638
  /* @__PURE__ */ e(
7639
- Jn,
7639
+ Hn,
7640
7640
  {
7641
7641
  onRemoveColumn: m,
7642
- sortableType: ia,
7642
+ sortableType: la,
7643
7643
  id: mt,
7644
7644
  label: y,
7645
7645
  columns: r,
@@ -7690,7 +7690,7 @@ function Pa({
7690
7690
  {
7691
7691
  "data-setting-actions": "",
7692
7692
  className: "invisible flex h-full items-center gap-2 group-hover:visible",
7693
- children: /* @__PURE__ */ e("button", { onClick: () => d(a), children: /* @__PURE__ */ e(be, { className: "size-3.5 cursor-pointer items-center justify-center rounded-r-sm text-muted-foreground" }) })
7693
+ children: /* @__PURE__ */ e("button", { onClick: () => d(a), children: /* @__PURE__ */ e(ve, { className: "size-3.5 cursor-pointer items-center justify-center rounded-r-sm text-muted-foreground" }) })
7694
7694
  }
7695
7695
  )
7696
7696
  ] }),
@@ -7727,13 +7727,13 @@ function Hc({
7727
7727
  }) {
7728
7728
  const n = G((E) => E.themeStyle), r = T(
7729
7729
  (E) => {
7730
- var D, v;
7731
- return (v = (D = E.card) == null ? void 0 : D.queryConfig) == null ? void 0 : v.filters;
7730
+ var D, b;
7731
+ return (b = (D = E.card) == null ? void 0 : D.queryConfig) == null ? void 0 : b.filters;
7732
7732
  }
7733
7733
  ), i = T(
7734
7734
  (E) => {
7735
- var D, v;
7736
- return (v = (D = E.card.queryConfig) == null ? void 0 : D.filterColumns) == null ? void 0 : v.find(
7735
+ var D, b;
7736
+ return (b = (D = E.card.queryConfig) == null ? void 0 : D.filterColumns) == null ? void 0 : b.find(
7737
7737
  (x) => x.name === t.name
7738
7738
  );
7739
7739
  }
@@ -7758,23 +7758,23 @@ function Hc({
7758
7758
  dataType: t.type
7759
7759
  }, { data: C, isLoading: g, isFetching: y, isError: p } = Xs(m), N = rt(() => {
7760
7760
  var D;
7761
- return m.column ? (D = C == null ? void 0 : C.records) == null ? void 0 : D.map((v) => {
7761
+ return m.column ? (D = C == null ? void 0 : C.records) == null ? void 0 : D.map((b) => {
7762
7762
  let x = m.column.split(".").slice(-1)[0].replace(/"/g, "");
7763
- return v[x] === void 0 && (x = x.toLowerCase()), {
7764
- id: v[x],
7763
+ return b[x] === void 0 && (x = x.toLowerCase()), {
7764
+ id: b[x],
7765
7765
  //idx,
7766
- value: v[x]
7766
+ value: b[x]
7767
7767
  // this is needed if
7768
7768
  };
7769
7769
  }) : [];
7770
7770
  }, [C, m.column]);
7771
7771
  function f(E) {
7772
- const D = E.map((v) => v.id);
7772
+ const D = E.map((b) => b.id);
7773
7773
  d(t.name, D);
7774
7774
  }
7775
7775
  function M() {
7776
7776
  return g || y ? /* @__PURE__ */ e(
7777
- fa,
7777
+ ga,
7778
7778
  {
7779
7779
  style: {
7780
7780
  borderRadius: n == null ? void 0 : n.controlInputRadius
@@ -7848,18 +7848,18 @@ function Yc({
7848
7848
  dataType: t.type
7849
7849
  }, { isLoading: c, isFetching: h, isError: d, data: m } = Xs(u), C = m == null ? void 0 : m.records, { dateRange: g, setDateRange: y, initialDateRange: p } = Yi(C), { updateEditorFilterValue: N } = X();
7850
7850
  function f(D) {
7851
- var x, b;
7852
- const v = {
7851
+ var x, v;
7852
+ const b = {
7853
7853
  gte: (x = D == null ? void 0 : D.from) == null ? void 0 : x.toISOString(),
7854
- lte: (b = D == null ? void 0 : D.to) == null ? void 0 : b.toISOString()
7854
+ lte: (v = D == null ? void 0 : D.to) == null ? void 0 : v.toISOString()
7855
7855
  };
7856
- N(t.name, v);
7856
+ N(t.name, b);
7857
7857
  }
7858
7858
  function M() {
7859
7859
  N(t.name, null, !0), y(p);
7860
7860
  }
7861
7861
  function E() {
7862
- return c || h ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(fa, { className: "h-8 w-72 bg-foreground/10" }) }) : d ? /* @__PURE__ */ e("div", { className: "h-8 w-72 bg-muted px-2", children: "Error" }) : C ? /* @__PURE__ */ e(
7862
+ return c || h ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(ga, { className: "h-8 w-72 bg-foreground/10" }) }) : d ? /* @__PURE__ */ e("div", { className: "h-8 w-72 bg-muted px-2", children: "Error" }) : C ? /* @__PURE__ */ e(
7863
7863
  Ki,
7864
7864
  {
7865
7865
  title: u.title,
@@ -7892,7 +7892,7 @@ function Kc({
7892
7892
  sortableType: i
7893
7893
  }) {
7894
7894
  var y, p;
7895
- const { setNodeRef: l, isOver: o, over: u } = ba({
7895
+ const { setNodeRef: l, isOver: o, over: u } = xa({
7896
7896
  id: t
7897
7897
  }), c = st((N) => N.activeId), h = {
7898
7898
  // borderColor: isOver ? 'green' : undefined,
@@ -7967,8 +7967,8 @@ function Wc() {
7967
7967
  Kc,
7968
7968
  {
7969
7969
  onRemoveColumn: r,
7970
- sortableType: oa,
7971
- id: la,
7970
+ sortableType: ca,
7971
+ id: oa,
7972
7972
  label: "Filters",
7973
7973
  columns: t,
7974
7974
  previewColumns: a
@@ -8003,12 +8003,12 @@ function Zc() {
8003
8003
  }
8004
8004
  function Xc() {
8005
8005
  const t = ft(null), a = ft(null), n = T((u) => u.isShowingVisual), r = T((u) => u.showAIDialog), i = T((u) => u.isDevMode);
8006
- ve(() => {
8006
+ be(() => {
8007
8007
  var u, c, h, d;
8008
8008
  r ? ((u = t.current) == null || u.resize(0), (c = a.current) == null || c.resize(0)) : ((h = t.current) == null || h.resize(25), (d = a.current) == null || d.resize(25));
8009
8009
  }, [r]);
8010
8010
  function l() {
8011
- return /* @__PURE__ */ s(ae, { children: [
8011
+ return /* @__PURE__ */ s(se, { children: [
8012
8012
  /* @__PURE__ */ e(
8013
8013
  Ce,
8014
8014
  {
@@ -8028,7 +8028,7 @@ function Xc() {
8028
8028
  minSize: 0,
8029
8029
  defaultSize: 60,
8030
8030
  children: n && !r ? /* @__PURE__ */ s(et, { direction: "horizontal", children: [
8031
- /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
8031
+ /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(
8032
8032
  Ce,
8033
8033
  {
8034
8034
  ref: t,
@@ -8046,13 +8046,13 @@ function Xc() {
8046
8046
  ] });
8047
8047
  }
8048
8048
  function o() {
8049
- return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
8049
+ return /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(
8050
8050
  "div",
8051
8051
  {
8052
8052
  className: "grow",
8053
8053
  "data-biz-mode-container": "",
8054
8054
  children: n ? /* @__PURE__ */ s(et, { direction: "horizontal", children: [
8055
- /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
8055
+ /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(
8056
8056
  Ce,
8057
8057
  {
8058
8058
  ref: a,
@@ -8108,11 +8108,11 @@ function ed(t, a) {
8108
8108
  (Q) => Q.selectedDatabaseName
8109
8109
  ), E = T((Q) => Q.selectedTableName), D = T(
8110
8110
  (Q) => Q.selectedConnectionId
8111
- ), v = T(
8111
+ ), b = T(
8112
8112
  (Q) => Q.selectedSchemaName
8113
8113
  ), x = G(
8114
8114
  (Q) => Q.dashboard.aiScopeTables
8115
- ), { setTriggerAIRun: b, setCurrentAssitantScope: S, setCardConfig: O } = X(), { selectedDatamodelName: I, connectionType: w, selectedDatamodelId: L } = Pe(), {
8115
+ ), { setTriggerAIRun: v, setCurrentAssitantScope: S, setCardConfig: O } = X(), { selectedDatamodelName: I, connectionType: w, selectedDatamodelId: L } = Pe(), {
8116
8116
  messages: F,
8117
8117
  setMessages: z,
8118
8118
  reload: k,
@@ -8145,17 +8145,17 @@ function ed(t, a) {
8145
8145
  Y(ie.usage), r(""), ie.finishReason === "stop" && r("");
8146
8146
  }
8147
8147
  });
8148
- ve(() => {
8148
+ be(() => {
8149
8149
  f && N && (re({
8150
8150
  target: { value: N }
8151
8151
  }), setTimeout(() => {
8152
- ee(), b(!1);
8152
+ ee(), v(!1);
8153
8153
  }, 100));
8154
8154
  }, [
8155
8155
  f,
8156
8156
  ee,
8157
8157
  N,
8158
- b,
8158
+ v,
8159
8159
  re
8160
8160
  ]);
8161
8161
  async function te({
@@ -8221,7 +8221,7 @@ function ed(t, a) {
8221
8221
  function Z() {
8222
8222
  const Q = {
8223
8223
  databaseName: M || "",
8224
- schemaName: v || "",
8224
+ schemaName: b || "",
8225
8225
  tableName: E || "",
8226
8226
  datamodelId: L || "",
8227
8227
  datamodelName: sn(I),
@@ -8233,7 +8233,7 @@ function ed(t, a) {
8233
8233
  function ne() {
8234
8234
  const Q = {
8235
8235
  databaseName: M || "",
8236
- schemaName: v || "",
8236
+ schemaName: b || "",
8237
8237
  tableName: E || "",
8238
8238
  datamodelName: sn(I),
8239
8239
  connectionId: D || "",
@@ -8293,9 +8293,9 @@ function os() {
8293
8293
  selectedEntities: []
8294
8294
  }), C = G((K) => K.dashboard.aiContext), g = T((K) => K.card.dataSource), y = T((K) => K.actions.setCardSql), p = T((K) => K.actions.setRunSql), N = T((K) => K.showAIDialog), f = G(
8295
8295
  (K) => K.handleOpenAssistantProfile
8296
- ), { setShowAIDialog: M, setCardPython: E } = X(), { setDataSource: D } = X(), { assistantProfile: v } = tl(), {
8296
+ ), { setShowAIDialog: M, setCardPython: E } = X(), { setDataSource: D } = X(), { assistantProfile: b } = tl(), {
8297
8297
  messages: x,
8298
- setMessages: b,
8298
+ setMessages: v,
8299
8299
  reload: S,
8300
8300
  append: O,
8301
8301
  input: I,
@@ -8312,7 +8312,7 @@ function os() {
8312
8312
  scrollContainerRef: t,
8313
8313
  inputRef: a,
8314
8314
  messages: x
8315
- }), ve(() => {
8315
+ }), be(() => {
8316
8316
  var K;
8317
8317
  N && ((K = a.current) == null || K.focus());
8318
8318
  }, [N]);
@@ -8346,10 +8346,10 @@ function os() {
8346
8346
  return /* @__PURE__ */ s(fs, { children: [
8347
8347
  /* @__PURE__ */ e(gs, { asChild: !0, children: /* @__PURE__ */ e(P, { className: "h-7 p-2", size: "sm", variant: "ghost", children: /* @__PURE__ */ e(Ts, { className: "size-3.5" }) }) }),
8348
8348
  /* @__PURE__ */ s(ys, { align: "end", children: [
8349
- /* @__PURE__ */ e(vs, { children: "Options" }),
8350
- /* @__PURE__ */ e(bs, {}),
8349
+ /* @__PURE__ */ e(bs, { children: "Options" }),
8350
+ /* @__PURE__ */ e(vs, {}),
8351
8351
  /* @__PURE__ */ e(
8352
- Vn,
8352
+ jn,
8353
8353
  {
8354
8354
  checked: n,
8355
8355
  onCheckedChange: r,
@@ -8357,7 +8357,7 @@ function os() {
8357
8357
  }
8358
8358
  ),
8359
8359
  /* @__PURE__ */ e(
8360
- Vn,
8360
+ jn,
8361
8361
  {
8362
8362
  checked: i,
8363
8363
  onCheckedChange: l,
@@ -8365,7 +8365,7 @@ function os() {
8365
8365
  }
8366
8366
  ),
8367
8367
  /* @__PURE__ */ e(
8368
- Vn,
8368
+ jn,
8369
8369
  {
8370
8370
  checked: o,
8371
8371
  onCheckedChange: u,
@@ -8399,29 +8399,27 @@ function os() {
8399
8399
  size: "sm",
8400
8400
  className: "h-7 p-2",
8401
8401
  onClick: f,
8402
- children: (v == null ? void 0 : v.name) || "Default Profile"
8402
+ children: (b == null ? void 0 : b.name) || "Default Profile"
8403
8403
  }
8404
8404
  ),
8405
8405
  /* @__PURE__ */ s("div", { "data-role": "header-actions", className: "flex items-center gap-2", children: [
8406
8406
  te(),
8407
8407
  /* @__PURE__ */ e(
8408
- P,
8408
+ ae,
8409
8409
  {
8410
- variant: "ghost",
8411
- size: "sm",
8410
+ tooltip: "Add Context",
8412
8411
  className: "h-7 p-2",
8413
8412
  onClick: j,
8414
8413
  children: /* @__PURE__ */ e(Js, { className: "size-4" })
8415
8414
  }
8416
8415
  ),
8417
8416
  /* @__PURE__ */ e(
8418
- P,
8417
+ ae,
8419
8418
  {
8420
8419
  className: "h-7 p-2",
8421
- size: "sm",
8422
- variant: "ghost",
8420
+ tooltip: "New Chat",
8423
8421
  onClick: () => {
8424
- b([]), S();
8422
+ v([]), S();
8425
8423
  },
8426
8424
  children: /* @__PURE__ */ e(al, { className: "size-4" })
8427
8425
  }
@@ -8435,7 +8433,7 @@ function os() {
8435
8433
  onClick: () => {
8436
8434
  M(!1);
8437
8435
  },
8438
- children: /* @__PURE__ */ e(xa, { className: "size-4" })
8436
+ children: /* @__PURE__ */ e(In, { className: "size-4" })
8439
8437
  }
8440
8438
  )
8441
8439
  ] })
@@ -8469,17 +8467,17 @@ function os() {
8469
8467
  }
8470
8468
  ),
8471
8469
  /* @__PURE__ */ s("div", { className: "mb-3", children: [
8472
- J && !v && /* @__PURE__ */ e(
8470
+ J && !b && /* @__PURE__ */ e(
8473
8471
  il,
8474
8472
  {
8475
8473
  onClick: ee,
8476
8474
  placeholders: td
8477
8475
  }
8478
8476
  ),
8479
- /* @__PURE__ */ e("div", { children: J && v && /* @__PURE__ */ e(
8477
+ /* @__PURE__ */ e("div", { children: J && b && /* @__PURE__ */ e(
8480
8478
  ll,
8481
8479
  {
8482
- seedQuestions: v.seedQuestions || [],
8480
+ seedQuestions: b.seedQuestions || [],
8483
8481
  handleSeedQuestionClick: W
8484
8482
  }
8485
8483
  ) })
@@ -8519,8 +8517,8 @@ function os() {
8519
8517
  incomingSelectedEntities: (C == null ? void 0 : C.selectedEntities) || [],
8520
8518
  open: c,
8521
8519
  onOpenChange: h,
8522
- dataSource: g || Qn,
8523
- fallbackDataSource: Qn,
8520
+ dataSource: g || Wn,
8521
+ fallbackDataSource: Wn,
8524
8522
  dialogMode: "aiContext"
8525
8523
  }
8526
8524
  )
@@ -8535,7 +8533,7 @@ function nd(t) {
8535
8533
  name: n.name,
8536
8534
  dataType: n.dataType,
8537
8535
  qualifiedEntityName: a.qualifiedEntityName,
8538
- label: n.label || pa(n.name),
8536
+ label: n.label || fa(n.name),
8539
8537
  description: n.description,
8540
8538
  entityId: a.entityId,
8541
8539
  entityName: a.entityName,
@@ -8543,7 +8541,7 @@ function nd(t) {
8543
8541
  }))
8544
8542
  );
8545
8543
  }
8546
- function ca(t) {
8544
+ function da(t) {
8547
8545
  if (t.type === "table" || t.type === "view") {
8548
8546
  if (t.database && t.schema)
8549
8547
  return `${t.database}.${t.schema}.${t.name}`;
@@ -8599,7 +8597,7 @@ function Zt(t) {
8599
8597
  }))
8600
8598
  }), h = c.some((p) => p.isPending), d = c.some((p) => p.isError), m = (y = c.find((p) => p.isError)) == null ? void 0 : y.error, C = c.map((p, N) => {
8601
8599
  var E;
8602
- const f = u[N], M = ca(f);
8600
+ const f = u[N], M = da(f);
8603
8601
  return {
8604
8602
  entityId: f.id || f.name,
8605
8603
  entityType: f.type,
@@ -8691,14 +8689,14 @@ function ad({ field: t }) {
8691
8689
  }
8692
8690
  ),
8693
8691
  /* @__PURE__ */ e(Yt, { children: /* @__PURE__ */ s(yt, { children: [
8694
- /* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ e(
8692
+ /* @__PURE__ */ e(At, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ e(
8695
8693
  "span",
8696
8694
  {
8697
8695
  className: `block text-sm dark:text-muted-foreground ${u ? "whitespace-normal break-words" : "truncate"}`,
8698
8696
  children: t.name
8699
8697
  }
8700
8698
  ) }) }),
8701
- /* @__PURE__ */ e(vt, { side: "right", className: "max-w-xs", children: /* @__PURE__ */ s("div", { className: "space-y-1 overflow-x-auto", children: [
8699
+ /* @__PURE__ */ e(bt, { side: "right", className: "max-w-xs", children: /* @__PURE__ */ s("div", { className: "space-y-1 overflow-x-auto", children: [
8702
8700
  /* @__PURE__ */ e("p", { className: "font-medium", children: t.label || t.name }),
8703
8701
  t.label && t.label !== t.name && /* @__PURE__ */ s("p", { className: "text-xs text-gray-500", children: [
8704
8702
  "Name: ",
@@ -8718,7 +8716,7 @@ function ad({ field: t }) {
8718
8716
  g.stopPropagation(), c(!u);
8719
8717
  },
8720
8718
  className: "invisible flex-shrink-0 text-gray-400 hover:text-gray-600 group-hover/container:visible",
8721
- children: u ? /* @__PURE__ */ e(At, { className: "h-4 w-4" }) : /* @__PURE__ */ e(xa, { className: "h-4 w-4" })
8719
+ children: u ? /* @__PURE__ */ e(vt, { className: "h-4 w-4" }) : /* @__PURE__ */ e(In, { className: "h-4 w-4" })
8722
8720
  }
8723
8721
  )
8724
8722
  ]
@@ -8773,13 +8771,13 @@ function sd({
8773
8771
  a.length,
8774
8772
  ")"
8775
8773
  ] }),
8776
- n ? /* @__PURE__ */ e(At, { className: "h-4 w-4" }) : /* @__PURE__ */ e(xa, { className: "h-4 w-4" })
8774
+ n ? /* @__PURE__ */ e(vt, { className: "h-4 w-4" }) : /* @__PURE__ */ e(In, { className: "h-4 w-4" })
8777
8775
  ] }),
8778
8776
  /* @__PURE__ */ e(ml, { className: "mt-1 space-y-1", children: /* @__PURE__ */ e(
8779
8777
  Ue,
8780
8778
  {
8781
8779
  items: a.map((i) => i.id),
8782
- strategy: Mt,
8780
+ strategy: Tt,
8783
8781
  children: a.map((i) => /* @__PURE__ */ e(ad, { field: i }, i.id))
8784
8782
  }
8785
8783
  ) })
@@ -8795,20 +8793,20 @@ function rd() {
8795
8793
  (D) => D.name.toLowerCase().includes(t.toLowerCase()) || D.dataType.toLowerCase().includes(t.toLowerCase()) || D.qualifiedEntityName && D.qualifiedEntityName.toLowerCase().includes(t.toLowerCase())
8796
8794
  ), C = (D) => D.dataType === "number" || D.dataType === "integer" || D.dataType === "float" || D.dataType === "decimal" || D.dataType === "currency" ? "metrics" : "dimensions", y = (i === "all" ? m : m.filter(
8797
8795
  (D) => C(D) === i
8798
- )).reduce((D, v) => {
8799
- const x = v.qualifiedEntityName || "Other Fields";
8796
+ )).reduce((D, b) => {
8797
+ const x = b.qualifiedEntityName || "Other Fields";
8800
8798
  return D[x] || (D[x] = {
8801
- label: Pt(v.entityName),
8799
+ label: Pt(b.entityName),
8802
8800
  fields: []
8803
- }), D[x].fields.push(v), D;
8801
+ }), D[x].fields.push(b), D;
8804
8802
  }, {});
8805
8803
  Le.useEffect(() => {
8806
8804
  const D = Object.keys(y);
8807
8805
  r(new Set(D));
8808
8806
  }, [Object.keys(y).join(",")]);
8809
8807
  const p = (D) => {
8810
- const v = new Set(n);
8811
- v.has(D) ? v.delete(D) : v.add(D), r(v);
8808
+ const b = new Set(n);
8809
+ b.has(D) ? b.delete(D) : b.add(D), r(b);
8812
8810
  }, N = m.filter(
8813
8811
  (D) => C(D) === "dimensions"
8814
8812
  ).length, f = m.filter(
@@ -8823,7 +8821,7 @@ function rd() {
8823
8821
  /* @__PURE__ */ e(qt, { className: "mb-4 h-12 w-12 text-red-300" }),
8824
8822
  /* @__PURE__ */ e("p", { className: "mb-2 text-sm text-red-500", children: "Error loading fields" }),
8825
8823
  /* @__PURE__ */ e("p", { className: "px-4 text-center text-xs text-red-400", children: d.message || "Failed to load column data" })
8826
- ] }) : !o || !o.selectedEntities || o.selectedEntities.length === 0 ? /* @__PURE__ */ e(bt, { className: "h-[calc(100vh-200px)] w-[290px]", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
8824
+ ] }) : !o || !o.selectedEntities || o.selectedEntities.length === 0 ? /* @__PURE__ */ e(xt, { className: "h-[calc(100vh-200px)] w-[290px]", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
8827
8825
  /* @__PURE__ */ e(qt, { className: "mb-4 h-12 w-12 text-gray-300" }),
8828
8826
  /* @__PURE__ */ e("p", { className: "mb-2 text-sm text-gray-500", children: "No data source selected" }),
8829
8827
  /* @__PURE__ */ e("p", { className: "px-4 text-xs text-gray-400", children: "Select a table, view, or dataset from the data source panel to see available fields" })
@@ -8868,16 +8866,16 @@ function rd() {
8868
8866
  ] }),
8869
8867
  /* @__PURE__ */ s(Kt, { className: "py-2", children: [
8870
8868
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
8871
- Object.entries(y).map(([D, v]) => {
8872
- const x = c.find((b) => b.entityName === D) || {
8869
+ Object.entries(y).map(([D, b]) => {
8870
+ const x = c.find((v) => v.entityName === D) || {
8873
8871
  entityName: D,
8874
- label: v.label
8872
+ label: b.label
8875
8873
  };
8876
8874
  return /* @__PURE__ */ e(
8877
8875
  sd,
8878
8876
  {
8879
8877
  entityGroup: x,
8880
- fields: v.fields,
8878
+ fields: b.fields,
8881
8879
  isOpen: n.has(D),
8882
8880
  onToggle: () => p(D)
8883
8881
  },
@@ -8907,7 +8905,7 @@ function ld({
8907
8905
  availableDataSources: a
8908
8906
  }) {
8909
8907
  const [n, r] = V(t), [i, l] = V(/* @__PURE__ */ new Set()), o = () => {
8910
- const x = n.joins.length > 0 ? Math.max(...n.joins.map((S) => S.sequence)) + 1 : 1, b = {
8908
+ const x = n.joins.length > 0 ? Math.max(...n.joins.map((S) => S.sequence)) + 1 : 1, v = {
8911
8909
  id: `join-${Date.now()}`,
8912
8910
  source: {
8913
8911
  type: "table",
@@ -8933,18 +8931,18 @@ function ld({
8933
8931
  };
8934
8932
  r({
8935
8933
  ...n,
8936
- joins: [...n.joins, b]
8937
- }), l(/* @__PURE__ */ new Set([...i, b.id]));
8934
+ joins: [...n.joins, v]
8935
+ }), l(/* @__PURE__ */ new Set([...i, v.id]));
8938
8936
  }, u = (x) => {
8939
8937
  r({
8940
8938
  ...n,
8941
- joins: n.joins.filter((b) => b.id !== x)
8942
- }), l(new Set([...i].filter((b) => b !== x)));
8943
- }, c = (x, b) => {
8939
+ joins: n.joins.filter((v) => v.id !== x)
8940
+ }), l(new Set([...i].filter((v) => v !== x)));
8941
+ }, c = (x, v) => {
8944
8942
  var w, L;
8945
8943
  const S = n.joins.find((F) => F.id === x);
8946
8944
  if (!S) return;
8947
- const O = { ...S, ...b }, I = n.joins.map(
8945
+ const O = { ...S, ...v }, I = n.joins.map(
8948
8946
  (F) => F.id === x ? O : F
8949
8947
  );
8950
8948
  if ((w = O.source) != null && w.name && ((L = O.target) != null && L.name) && O.joinKeyGroups[0].keys.length === 0) {
@@ -8998,10 +8996,10 @@ function ld({
8998
8996
  removeJoin: u,
8999
8997
  updateJoin: c,
9000
8998
  moveJoinUp: (x) => {
9001
- const b = n.joins.findIndex((S) => S.id === x);
9002
- if (b > 0) {
9003
- const S = [...n.joins], O = { ...S[b] }, I = { ...S[b - 1] };
9004
- S[b] = I, S[b - 1] = O, S.forEach((L, F) => {
8999
+ const v = n.joins.findIndex((S) => S.id === x);
9000
+ if (v > 0) {
9001
+ const S = [...n.joins], O = { ...S[v] }, I = { ...S[v - 1] };
9002
+ S[v] = I, S[v - 1] = O, S.forEach((L, F) => {
9005
9003
  L.sequence = F + 1;
9006
9004
  });
9007
9005
  const w = {
@@ -9012,10 +9010,10 @@ function ld({
9012
9010
  }
9013
9011
  },
9014
9012
  moveJoinDown: (x) => {
9015
- const b = n.joins.findIndex((S) => S.id === x);
9016
- if (b < n.joins.length - 1) {
9017
- const S = [...n.joins], O = { ...S[b] }, I = { ...S[b + 1] };
9018
- S[b] = I, S[b + 1] = O, S.forEach((L, F) => {
9013
+ const v = n.joins.findIndex((S) => S.id === x);
9014
+ if (v < n.joins.length - 1) {
9015
+ const S = [...n.joins], O = { ...S[v] }, I = { ...S[v + 1] };
9016
+ S[v] = I, S[v + 1] = O, S.forEach((L, F) => {
9019
9017
  L.sequence = F + 1;
9020
9018
  });
9021
9019
  const w = {
@@ -9026,26 +9024,26 @@ function ld({
9026
9024
  }
9027
9025
  },
9028
9026
  toggleJoinExpansion: (x) => {
9029
- const b = new Set(i);
9030
- b.has(x) ? b.delete(x) : b.add(x), l(b);
9027
+ const v = new Set(i);
9028
+ v.has(x) ? v.delete(x) : v.add(x), l(v);
9031
9029
  },
9032
9030
  getAvailableSourceEntities: (x) => {
9033
9031
  if (n.joins.length === 0) return a;
9034
- const b = n.joins.findIndex(
9032
+ const v = n.joins.findIndex(
9035
9033
  (O) => O.id === x
9036
9034
  );
9037
- if (b === 0) return a;
9035
+ if (v === 0) return a;
9038
9036
  const S = /* @__PURE__ */ new Set();
9039
- return n.baseEntity.name && S.add(n.baseEntity.name), n.joins.slice(0, b).forEach((O) => {
9037
+ return n.baseEntity.name && S.add(n.baseEntity.name), n.joins.slice(0, v).forEach((O) => {
9040
9038
  S.add(O.source.name), S.add(O.target.name);
9041
9039
  }), a.filter((O) => S.has(O.name));
9042
9040
  },
9043
- getAvailableTargetEntities: (x) => a.filter((b) => b.name !== x),
9041
+ getAvailableTargetEntities: (x) => a.filter((v) => v.name !== x),
9044
9042
  addJoinKeyGroup: (x) => {
9045
- const b = n.joins.find((O) => O.id === x);
9046
- if (!b) return;
9043
+ const v = n.joins.find((O) => O.id === x);
9044
+ if (!v) return;
9047
9045
  const S = [
9048
- ...b.joinKeyGroups,
9046
+ ...v.joinKeyGroups,
9049
9047
  {
9050
9048
  id: "group-" + Date.now() + "-" + Math.random().toString(36).substr(2, 9),
9051
9049
  operator: "AND",
@@ -9054,19 +9052,19 @@ function ld({
9054
9052
  ];
9055
9053
  c(x, { joinKeyGroups: S });
9056
9054
  },
9057
- updateGroupOperator: (x, b, S) => {
9055
+ updateGroupOperator: (x, v, S) => {
9058
9056
  const O = n.joins.find((w) => w.id === x);
9059
9057
  if (!O) return;
9060
9058
  const I = [...O.joinKeyGroups];
9061
- I[b] = { ...I[b], operator: S }, c(x, { joinKeyGroups: I });
9059
+ I[v] = { ...I[v], operator: S }, c(x, { joinKeyGroups: I });
9062
9060
  },
9063
- removeJoinKeyGroup: (x, b) => {
9061
+ removeJoinKeyGroup: (x, v) => {
9064
9062
  const S = n.joins.find((I) => I.id === x);
9065
9063
  if (!S) return;
9066
9064
  const O = [...S.joinKeyGroups];
9067
- O.splice(b, 1), c(x, { joinKeyGroups: O });
9065
+ O.splice(v, 1), c(x, { joinKeyGroups: O });
9068
9066
  },
9069
- addJoinKey: (x, b) => {
9067
+ addJoinKey: (x, v) => {
9070
9068
  const S = n.joins.find((F) => F.id === x);
9071
9069
  if (!S) return;
9072
9070
  const O = a.find(
@@ -9095,50 +9093,50 @@ function ld({
9095
9093
  },
9096
9094
  operator: "="
9097
9095
  };
9098
- w[b] = {
9099
- ...w[b],
9100
- keys: [...w[b].keys, L]
9096
+ w[v] = {
9097
+ ...w[v],
9098
+ keys: [...w[v].keys, L]
9101
9099
  }, c(x, { joinKeyGroups: w });
9102
9100
  },
9103
- updateJoinKey: (x, b, S, O, I) => {
9101
+ updateJoinKey: (x, v, S, O, I) => {
9104
9102
  const w = n.joins.find((A) => A.id === x);
9105
9103
  if (!w) return;
9106
9104
  const L = a.find(
9107
9105
  (A) => A.name === w.source.name
9108
9106
  ), F = a.find(
9109
9107
  (A) => A.name === w.target.name
9110
- ), z = [...w.joinKeyGroups], k = z[b].keys[S];
9111
- O === "sourceColumnName" && L ? z[b].keys[S] = {
9108
+ ), z = [...w.joinKeyGroups], k = z[v].keys[S];
9109
+ O === "sourceColumnName" && L ? z[v].keys[S] = {
9112
9110
  ...k,
9113
9111
  source: {
9114
9112
  ...k.source,
9115
9113
  name: I
9116
9114
  }
9117
- } : O === "targetColumnName" && F ? z[b].keys[S] = {
9115
+ } : O === "targetColumnName" && F ? z[v].keys[S] = {
9118
9116
  ...k,
9119
9117
  target: {
9120
9118
  ...k.target,
9121
9119
  name: I
9122
9120
  }
9123
- } : O === "operator" && (z[b].keys[S] = {
9121
+ } : O === "operator" && (z[v].keys[S] = {
9124
9122
  ...k,
9125
9123
  operator: I
9126
9124
  }), c(x, { joinKeyGroups: z });
9127
9125
  },
9128
- removeJoinKey: (x, b, S) => {
9126
+ removeJoinKey: (x, v, S) => {
9129
9127
  const O = n.joins.find((w) => w.id === x);
9130
9128
  if (!O) return;
9131
9129
  const I = [...O.joinKeyGroups];
9132
- I[b].keys.splice(S, 1), c(x, { joinKeyGroups: I });
9130
+ I[v].keys.splice(S, 1), c(x, { joinKeyGroups: I });
9133
9131
  },
9134
9132
  generateSQLPreview: () => {
9135
9133
  const x = [...n.joins].sort(
9136
9134
  (O, I) => O.sequence - I.sequence
9137
- ), b = n.baseEntity;
9138
- if (!b.name)
9135
+ ), v = n.baseEntity;
9136
+ if (!v.name)
9139
9137
  return "SELECT * FROM table -- Please select a base entity";
9140
9138
  let S = `SELECT *
9141
- FROM ${b.name}`;
9139
+ FROM ${v.name}`;
9142
9140
  return x.forEach((O) => {
9143
9141
  const I = a.find(
9144
9142
  (F) => F.name === O.target.name
@@ -9197,9 +9195,9 @@ function od({
9197
9195
  addJoinKeyGroup: M,
9198
9196
  updateGroupOperator: E,
9199
9197
  removeJoinKeyGroup: D,
9200
- addJoinKey: v,
9198
+ addJoinKey: b,
9201
9199
  updateJoinKey: x,
9202
- removeJoinKey: b,
9200
+ removeJoinKey: v,
9203
9201
  generateSQLPreview: S,
9204
9202
  isValidConfiguration: O
9205
9203
  } = ld({
@@ -9242,10 +9240,10 @@ function od({
9242
9240
  ]
9243
9241
  }
9244
9242
  ),
9245
- /* @__PURE__ */ e("p", { className: "text-xs text-gray-500", children: "This entity will be used as the base table in the FROM clause of the SQL query." })
9243
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "This entity will be used as the base table in the FROM clause of the SQL query." })
9246
9244
  ] }),
9247
- /* @__PURE__ */ s("div", { className: "rounded-md border bg-gray-100 p-3", children: [
9248
- /* @__PURE__ */ e("div", { className: "mb-2 text-xs font-medium text-gray-600", children: "Join SQL Preview" }),
9245
+ /* @__PURE__ */ s("div", { className: "rounded-md border p-3", children: [
9246
+ /* @__PURE__ */ e("div", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "Join SQL Preview" }),
9249
9247
  /* @__PURE__ */ e("code", { className: "block whitespace-pre-wrap break-all text-xs", children: S() })
9250
9248
  ] }),
9251
9249
  /* @__PURE__ */ s("div", { className: "space-y-4", children: [
@@ -9260,7 +9258,7 @@ function od({
9260
9258
  "Add Join"
9261
9259
  ] }) })
9262
9260
  ] }),
9263
- u.joins.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg border border-dashed py-8 text-center text-gray-500", children: /* @__PURE__ */ e("p", { children: "No joins configured. Add a join to connect multiple data sources." }) }) : /* @__PURE__ */ e("div", { className: "max-h-[300px] space-y-4 overflow-y-auto", children: u.joins.map((w) => {
9261
+ u.joins.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg border border-dashed py-8 text-center text-muted-foreground", children: /* @__PURE__ */ e("p", { children: "No joins configured. Add a join to connect multiple data sources." }) }) : /* @__PURE__ */ e("div", { className: "max-h-[300px] space-y-4 overflow-y-auto", children: u.joins.map((w) => {
9264
9262
  const L = a.find(
9265
9263
  (k) => k.name === w.source.name
9266
9264
  ), F = a.find(
@@ -9290,7 +9288,7 @@ function od({
9290
9288
  size: "sm",
9291
9289
  onClick: () => g(w.id),
9292
9290
  disabled: w.sequence === 1,
9293
- children: /* @__PURE__ */ e(En, { className: "h-4 w-4" })
9291
+ children: /* @__PURE__ */ e(An, { className: "h-4 w-4" })
9294
9292
  }
9295
9293
  ),
9296
9294
  /* @__PURE__ */ e(
@@ -9300,7 +9298,7 @@ function od({
9300
9298
  size: "sm",
9301
9299
  onClick: () => y(w.id),
9302
9300
  disabled: w.sequence === u.joins.length,
9303
- children: /* @__PURE__ */ e(In, { className: "h-4 w-4" })
9301
+ children: /* @__PURE__ */ e(En, { className: "h-4 w-4" })
9304
9302
  }
9305
9303
  ),
9306
9304
  /* @__PURE__ */ e(
@@ -9309,7 +9307,7 @@ function od({
9309
9307
  variant: "ghost",
9310
9308
  size: "sm",
9311
9309
  onClick: () => p(w.id),
9312
- children: z ? /* @__PURE__ */ e(Zs, { className: "h-4 w-4" }) : /* @__PURE__ */ e(At, { className: "h-4 w-4" })
9310
+ children: z ? /* @__PURE__ */ e(Zs, { className: "h-4 w-4" }) : /* @__PURE__ */ e(vt, { className: "h-4 w-4" })
9313
9311
  }
9314
9312
  ),
9315
9313
  /* @__PURE__ */ e(
@@ -9318,7 +9316,7 @@ function od({
9318
9316
  variant: "ghost",
9319
9317
  size: "sm",
9320
9318
  onClick: () => m(w.id),
9321
- children: /* @__PURE__ */ e(be, { className: "h-4 w-4" })
9319
+ children: /* @__PURE__ */ e(ve, { className: "h-4 w-4" })
9322
9320
  }
9323
9321
  )
9324
9322
  ] })
@@ -9498,7 +9496,7 @@ function od({
9498
9496
  w.id,
9499
9497
  A
9500
9498
  ),
9501
- children: /* @__PURE__ */ e(ma, { className: "h-4 w-4" })
9499
+ children: /* @__PURE__ */ e(ha, { className: "h-4 w-4" })
9502
9500
  }
9503
9501
  )
9504
9502
  ] })
@@ -9612,12 +9610,12 @@ function od({
9612
9610
  variant: "ghost",
9613
9611
  size: "sm",
9614
9612
  className: "self-center",
9615
- onClick: () => b(
9613
+ onClick: () => v(
9616
9614
  w.id,
9617
9615
  A,
9618
9616
  B
9619
9617
  ),
9620
- children: /* @__PURE__ */ e(be, { className: "size-3.5" })
9618
+ children: /* @__PURE__ */ e(ve, { className: "size-3.5" })
9621
9619
  }
9622
9620
  )
9623
9621
  ]
@@ -9631,7 +9629,7 @@ function od({
9631
9629
  variant: "outline",
9632
9630
  size: "sm",
9633
9631
  className: "mt-2",
9634
- onClick: () => v(w.id, A),
9632
+ onClick: () => b(w.id, A),
9635
9633
  children: [
9636
9634
  /* @__PURE__ */ e(ke, { className: "mr-1 h-3 w-3" }),
9637
9635
  " Add Condition"
@@ -9685,7 +9683,7 @@ function cs({
9685
9683
  /* @__PURE__ */ s(fn, { className: "max-w-4xl", children: [
9686
9684
  /* @__PURE__ */ s(gn, { children: [
9687
9685
  /* @__PURE__ */ e(yn, { children: "Join Configuration" }),
9688
- /* @__PURE__ */ e(vn, { children: "Configure the join between the two entities to combine the fields." })
9686
+ /* @__PURE__ */ e(bn, { children: "Configure the join between the two entities to combine the fields." })
9689
9687
  ] }),
9690
9688
  /* @__PURE__ */ e(
9691
9689
  od,
@@ -9716,7 +9714,7 @@ function cd({
9716
9714
  ), l = n.find(
9717
9715
  (o) => o.name === a
9718
9716
  );
9719
- return /* @__PURE__ */ s(ae, { children: [
9717
+ return /* @__PURE__ */ s(se, { children: [
9720
9718
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1 rounded-md border bg-muted px-2 py-1", children: [
9721
9719
  /* @__PURE__ */ e(ge, { variant: "secondary", className: "text-xs", children: l == null ? void 0 : l.type }),
9722
9720
  /* @__PURE__ */ e("span", { className: "text-xs font-medium", children: l == null ? void 0 : l.name }),
@@ -9830,25 +9828,25 @@ FROM ${y.name}`;
9830
9828
  );
9831
9829
  if (!f) return;
9832
9830
  const M = N.joinKeyGroups.filter((D) => D.keys && D.keys.length > 0).map((D) => {
9833
- const v = D.keys.filter(
9831
+ const b = D.keys.filter(
9834
9832
  (x) => {
9835
- var b, S, O, I;
9836
- return ((b = x.source) == null ? void 0 : b.name) && ((S = x.target) == null ? void 0 : S.name) && ((O = x.source) == null ? void 0 : O.entityName) && ((I = x.target) == null ? void 0 : I.entityName);
9833
+ var v, S, O, I;
9834
+ return ((v = x.source) == null ? void 0 : v.name) && ((S = x.target) == null ? void 0 : S.name) && ((O = x.source) == null ? void 0 : O.entityName) && ((I = x.target) == null ? void 0 : I.entityName);
9837
9835
  }
9838
9836
  ).map(
9839
9837
  (x) => `${x.source.entityName}.${x.source.name} ${x.operator} ${x.target.entityName}.${x.target.name}`
9840
9838
  );
9841
- return v.length > 1 ? `(${v.join(` ${D.operator} `)})` : v[0];
9839
+ return b.length > 1 ? `(${b.join(` ${D.operator} `)})` : b[0];
9842
9840
  }).filter(Boolean), E = M.length > 1 ? M.join(" OR ") : M[0] || "condition_here";
9843
9841
  p += `
9844
9842
  ${N.joinType} JOIN ${f.name}
9845
9843
  ON ${E}`;
9846
9844
  }), p;
9847
9845
  };
9848
- return o.length < 2 ? null : /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e("div", { className: "space-y-4", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
9846
+ return o.length < 2 ? null : /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e("div", { className: "space-y-4", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
9849
9847
  r.joins.length > 0 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
9850
9848
  /* @__PURE__ */ e(Yt, { children: /* @__PURE__ */ s(yt, { children: [
9851
- /* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ s(
9849
+ /* @__PURE__ */ e(At, { asChild: !0, children: /* @__PURE__ */ s(
9852
9850
  P,
9853
9851
  {
9854
9852
  variant: "outline",
@@ -9874,7 +9872,7 @@ ${N.joinType} JOIN ${f.name}
9874
9872
  }
9875
9873
  ) }),
9876
9874
  /* @__PURE__ */ e(
9877
- vt,
9875
+ bt,
9878
9876
  {
9879
9877
  side: "right",
9880
9878
  className: "max-w-md overflow-hidden p-0",
@@ -9945,8 +9943,6 @@ function ud() {
9945
9943
  /* @__PURE__ */ s(
9946
9944
  "div",
9947
9945
  {
9948
- onMouseEnter: () => r(!0),
9949
- onMouseLeave: () => r(!1),
9950
9946
  children: [
9951
9947
  /* @__PURE__ */ e(
9952
9948
  "div",
@@ -9958,10 +9954,12 @@ function ud() {
9958
9954
  /* @__PURE__ */ s(
9959
9955
  "div",
9960
9956
  {
9961
- className: "flex items-center gap-2",
9957
+ className: "flex cursor-pointer items-center gap-2",
9958
+ onClick: () => r(!n),
9962
9959
  children: [
9963
- /* @__PURE__ */ e(qt, { className: "h-5 w-5 text-cyan-600" }),
9964
- /* @__PURE__ */ e("h2", { className: "font-semibold text-gray-900", children: "Data Source" })
9960
+ n ? /* @__PURE__ */ e(vt, { className: "h-4 w-4" }) : /* @__PURE__ */ e(In, { className: "h-4 w-4" }),
9961
+ /* @__PURE__ */ e(qt, { className: "text-brand h-5 w-5" }),
9962
+ /* @__PURE__ */ e("h2", { className: "text-brand-100 font-semibold", children: "Data Source" })
9965
9963
  ]
9966
9964
  }
9967
9965
  ),
@@ -10009,7 +10007,7 @@ function ud() {
10009
10007
  });
10010
10008
  },
10011
10009
  className: "absolute right-1 top-1/2 -translate-y-1/2 rounded-full p-0.5 opacity-0 transition-opacity hover:bg-red-100 group-hover:opacity-100",
10012
- children: /* @__PURE__ */ e(be, { className: "h-2.5 w-2.5 text-red-500" })
10010
+ children: /* @__PURE__ */ e(ve, { className: "h-2.5 w-2.5 text-red-500" })
10013
10011
  }
10014
10012
  )
10015
10013
  ]
@@ -10044,9 +10042,9 @@ function ud() {
10044
10042
  ] });
10045
10043
  }
10046
10044
  const md = [
10047
- { id: "table", icon: Fn, label: "Table" },
10048
- { id: "bar", icon: An, label: "Bar Chart" },
10049
- { id: "line", icon: zn, label: "Line Chart" },
10045
+ { id: "table", icon: Ln, label: "Table" },
10046
+ { id: "bar", icon: zn, label: "Bar Chart" },
10047
+ { id: "line", icon: Fn, label: "Line Chart" },
10050
10048
  { id: "stackedBar", icon: Na, label: "Stacked Bar Chart" },
10051
10049
  {
10052
10050
  id: "stackedLine",
@@ -10106,7 +10104,7 @@ function pd({
10106
10104
  }) {
10107
10105
  const [n, r] = V(t ?? ""), [i, l] = V(!1);
10108
10106
  return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
10109
- /* @__PURE__ */ e(H, { className: "text-xs font-medium text-gray-600", children: "Display Label" }),
10107
+ /* @__PURE__ */ e(H, { className: "text-xs font-medium text-muted-foreground", children: "Display Label" }),
10110
10108
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
10111
10109
  /* @__PURE__ */ e(
10112
10110
  Be,
@@ -10126,7 +10124,7 @@ function pd({
10126
10124
  "aria-label": "Edit display label"
10127
10125
  }
10128
10126
  ),
10129
- i && n !== (t ?? "") && /* @__PURE__ */ s(ae, { children: [
10127
+ i && n !== (t ?? "") && /* @__PURE__ */ s(se, { children: [
10130
10128
  /* @__PURE__ */ e(
10131
10129
  P,
10132
10130
  {
@@ -10150,7 +10148,7 @@ function pd({
10150
10148
  onClick: () => {
10151
10149
  r(t ?? ""), l(!1);
10152
10150
  },
10153
- children: /* @__PURE__ */ e(be, { className: "h-4 w-4 text-gray-400" })
10151
+ children: /* @__PURE__ */ e(ve, { className: "h-4 w-4 text-muted-foreground" })
10154
10152
  }
10155
10153
  )
10156
10154
  ] })
@@ -10186,7 +10184,7 @@ function fd({
10186
10184
  "aria-label": "Edit alias template"
10187
10185
  }
10188
10186
  ),
10189
- i && n !== t && /* @__PURE__ */ s(ae, { children: [
10187
+ i && n !== t && /* @__PURE__ */ s(se, { children: [
10190
10188
  /* @__PURE__ */ e(
10191
10189
  P,
10192
10190
  {
@@ -10210,7 +10208,7 @@ function fd({
10210
10208
  onClick: () => {
10211
10209
  r(t), l(!1);
10212
10210
  },
10213
- children: /* @__PURE__ */ e(be, { className: "h-4 w-4 text-gray-400" })
10211
+ children: /* @__PURE__ */ e(ve, { className: "h-4 w-4 text-gray-400" })
10214
10212
  }
10215
10213
  )
10216
10214
  ] })
@@ -10231,9 +10229,9 @@ function gd({
10231
10229
  delete C[m], C[i] = o, a(C), r(null);
10232
10230
  };
10233
10231
  return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
10234
- /* @__PURE__ */ e(H, { className: "text-xs font-medium text-gray-600", children: "Pivot Value Aliases" }),
10232
+ /* @__PURE__ */ e(H, { className: "text-xs font-medium text-muted-foreground", children: "Pivot Value Aliases" }),
10235
10233
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
10236
- Object.entries(t).map(([m, C], g) => /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: n === m ? /* @__PURE__ */ s(ae, { children: [
10234
+ Object.entries(t).map(([m, C], g) => /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: n === m ? /* @__PURE__ */ s(se, { children: [
10237
10235
  /* @__PURE__ */ e(
10238
10236
  Be,
10239
10237
  {
@@ -10281,10 +10279,10 @@ function gd({
10281
10279
  className: "h-6 w-6 p-0",
10282
10280
  "aria-label": "Cancel value alias edit",
10283
10281
  onClick: () => r(null),
10284
- children: /* @__PURE__ */ e(be, { className: "h-4 w-4 text-gray-400" })
10282
+ children: /* @__PURE__ */ e(ve, { className: "h-4 w-4 text-muted-foreground" })
10285
10283
  }
10286
10284
  )
10287
- ] }) : /* @__PURE__ */ s(ae, { children: [
10285
+ ] }) : /* @__PURE__ */ s(se, { children: [
10288
10286
  /* @__PURE__ */ e(
10289
10287
  Be,
10290
10288
  {
@@ -10319,7 +10317,7 @@ function gd({
10319
10317
  className: "h-8 w-8 p-0",
10320
10318
  onClick: () => h(m),
10321
10319
  "aria-label": "Remove value alias",
10322
- children: /* @__PURE__ */ e(be, { className: "h-3 w-3" })
10320
+ children: /* @__PURE__ */ e(ve, { className: "h-3 w-3" })
10323
10321
  }
10324
10322
  )
10325
10323
  ] }) }, m + g)),
@@ -10360,18 +10358,18 @@ function yd({
10360
10358
  transform: p,
10361
10359
  transition: N,
10362
10360
  isDragging: f
10363
- } = zt({ id: t.id }), [M, E] = V(!1), [D, v] = V(
10361
+ } = zt({ id: t.id }), [M, E] = V(!1), [D, b] = V(
10364
10362
  t.dateFormat || "YYYY-MM-DD"
10365
- ), [x, b] = V(t.customFormat || ""), [S, O] = V(!!t.customFormat), [I, w] = V(
10363
+ ), [x, v] = V(t.customFormat || ""), [S, O] = V(!!t.customFormat), [I, w] = V(
10366
10364
  t.granularity || "day"
10367
10365
  ), [L, F] = V(
10368
10366
  t.aliasTemplate || ""
10369
10367
  ), [z, k] = V(
10370
10368
  t.valueAliases || {}
10371
10369
  ), A = (Y) => {
10372
- Y === "custom" ? O(!0) : (O(!1), v(Y), a === "groupBy" && h && h(Y, ""));
10370
+ Y === "custom" ? O(!0) : (O(!1), b(Y), a === "groupBy" && h && h(Y, ""));
10373
10371
  }, R = (Y) => {
10374
- b(Y), a === "groupBy" && h && h("custom", Y);
10372
+ v(Y), a === "groupBy" && h && h("custom", Y);
10375
10373
  }, B = (Y) => {
10376
10374
  w(Y), a === "groupBy" && d && d(Y);
10377
10375
  }, $ = (Y) => {
@@ -10415,7 +10413,7 @@ function yd({
10415
10413
  Y.stopPropagation(), E(!M);
10416
10414
  },
10417
10415
  children: /* @__PURE__ */ e(
10418
- At,
10416
+ vt,
10419
10417
  {
10420
10418
  className: `h-3 w-3 transition-transform ${M ? "rotate-180" : ""}`
10421
10419
  }
@@ -10439,7 +10437,7 @@ function yd({
10439
10437
  J
10440
10438
  ), l(J);
10441
10439
  },
10442
- children: i === "asc" ? /* @__PURE__ */ e(En, { className: "h-3 w-3" }) : /* @__PURE__ */ e(In, { className: "h-3 w-3" })
10440
+ children: i === "asc" ? /* @__PURE__ */ e(An, { className: "h-3 w-3" }) : /* @__PURE__ */ e(En, { className: "h-3 w-3" })
10443
10441
  }
10444
10442
  ),
10445
10443
  /* @__PURE__ */ e(
@@ -10451,7 +10449,7 @@ function yd({
10451
10449
  onClick: (Y) => {
10452
10450
  Y.stopPropagation(), n();
10453
10451
  },
10454
- children: /* @__PURE__ */ e(be, { className: "h-3 w-3" })
10452
+ children: /* @__PURE__ */ e(ve, { className: "h-3 w-3" })
10455
10453
  }
10456
10454
  )
10457
10455
  ] }),
@@ -10474,9 +10472,9 @@ function yd({
10474
10472
  /* @__PURE__ */ e(U, { value: "year", children: "Year" })
10475
10473
  ] })
10476
10474
  ] }) }),
10477
- W && a === "groupBy" && /* @__PURE__ */ s(ae, { children: [
10475
+ W && a === "groupBy" && /* @__PURE__ */ s(se, { children: [
10478
10476
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
10479
- /* @__PURE__ */ e(H, { className: "text-xs font-medium text-gray-600", children: "Granularity" }),
10477
+ /* @__PURE__ */ e(H, { className: "text-xs font-medium text-muted-foreground", children: "Granularity" }),
10480
10478
  /* @__PURE__ */ s(
10481
10479
  le,
10482
10480
  {
@@ -10496,7 +10494,7 @@ function yd({
10496
10494
  )
10497
10495
  ] }),
10498
10496
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
10499
- /* @__PURE__ */ e(H, { className: "text-xs font-medium text-gray-600", children: "Date Format" }),
10497
+ /* @__PURE__ */ e(H, { className: "text-xs font-medium text-muted-foreground", children: "Date Format" }),
10500
10498
  /* @__PURE__ */ s(
10501
10499
  le,
10502
10500
  {
@@ -10521,13 +10519,13 @@ function yd({
10521
10519
  className: "h-8 text-xs"
10522
10520
  }
10523
10521
  ),
10524
- /* @__PURE__ */ e("div", { className: "text-xs text-gray-500", children: "Examples: YYYY-MM-DD, MM/DD/YY, DD-MMM-YYYY HH:mm" })
10522
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: "Examples: YYYY-MM-DD, MM/DD/YY, DD-MMM-YYYY HH:mm" })
10525
10523
  ] })
10526
10524
  ] })
10527
10525
  ] }),
10528
- a === "metrics" && /* @__PURE__ */ s(ae, { children: [
10526
+ a === "metrics" && /* @__PURE__ */ s(se, { children: [
10529
10527
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
10530
- /* @__PURE__ */ e(H, { className: "text-xs font-medium text-gray-600", children: "Aggregation" }),
10528
+ /* @__PURE__ */ e(H, { className: "text-xs font-medium text-muted-foreground", children: "Aggregation" }),
10531
10529
  /* @__PURE__ */ s(
10532
10530
  le,
10533
10531
  {
@@ -10540,7 +10538,7 @@ function yd({
10540
10538
  /* @__PURE__ */ s(de, { children: [
10541
10539
  /* @__PURE__ */ e(U, { value: "COUNT", children: "Count" }),
10542
10540
  /* @__PURE__ */ e(U, { value: "DISTINCT", children: "Count Distinct" }),
10543
- Je(t.dataType) === "number" && /* @__PURE__ */ s(ae, { children: [
10541
+ Je(t.dataType) === "number" && /* @__PURE__ */ s(se, { children: [
10544
10542
  /* @__PURE__ */ e(U, { value: "SUM", children: "Sum" }),
10545
10543
  /* @__PURE__ */ e(U, { value: "AVG", children: "Average" }),
10546
10544
  /* @__PURE__ */ e(U, { value: "MIN", children: "Min" }),
@@ -10552,7 +10550,7 @@ function yd({
10552
10550
  }
10553
10551
  )
10554
10552
  ] }),
10555
- m && /* @__PURE__ */ s(ae, { children: [
10553
+ m && /* @__PURE__ */ s(se, { children: [
10556
10554
  /* @__PURE__ */ e(
10557
10555
  fd,
10558
10556
  {
@@ -10574,10 +10572,10 @@ function yd({
10574
10572
  }
10575
10573
  );
10576
10574
  }
10577
- function vd({ concept: t }) {
10575
+ function bd({ concept: t }) {
10578
10576
  return /* @__PURE__ */ e(Yt, { children: /* @__PURE__ */ s(yt, { delayDuration: 300, children: [
10579
- /* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(fl, { className: "size-4 text-muted-foreground hover:text-foreground" }) }),
10580
- /* @__PURE__ */ e(vt, { side: "right", align: "start", className: "p-3", children: (() => {
10577
+ /* @__PURE__ */ e(At, { asChild: !0, children: /* @__PURE__ */ e(fl, { className: "size-4 text-muted-foreground hover:text-foreground" }) }),
10578
+ /* @__PURE__ */ e(bt, { side: "right", align: "start", className: "p-3", children: (() => {
10581
10579
  switch (t) {
10582
10580
  case "groupBy":
10583
10581
  return /* @__PURE__ */ s("div", { className: "w-64 space-y-2", children: [
@@ -10677,18 +10675,18 @@ function nn({
10677
10675
  shouldShow: m,
10678
10676
  hasPivotColumns: C = !1
10679
10677
  }) {
10680
- const { isOver: g, setNodeRef: y } = ba({
10678
+ const { isOver: g, setNodeRef: y } = xa({
10681
10679
  id: t
10682
10680
  }), { updateSortByColumn: p } = X(), N = T((E) => E.card), f = a.length > 0, M = (E, D) => {
10683
10681
  var x;
10684
10682
  !((x = N.config) != null && x.sortByColumns) || N.config.sortByColumns.findIndex(
10685
- (b) => b.id === E
10683
+ (v) => v.id === E
10686
10684
  ) === -1 || p(N.id, E, { direction: D });
10687
10685
  };
10688
10686
  return t === "sortBy" && m === !1 ? null : /* @__PURE__ */ s("div", { className: "mb-4", children: [
10689
10687
  /* @__PURE__ */ s("div", { className: "mb-2 flex items-center gap-2", children: [
10690
10688
  /* @__PURE__ */ e(H, { className: "block text-sm font-medium", children: n }),
10691
- /* @__PURE__ */ e(vd, { concept: t })
10689
+ /* @__PURE__ */ e(bd, { concept: t })
10692
10690
  ] }),
10693
10691
  /* @__PURE__ */ e(
10694
10692
  "div",
@@ -10702,7 +10700,7 @@ function nn({
10702
10700
  Ue,
10703
10701
  {
10704
10702
  items: a.map((E) => E.id),
10705
- strategy: Mt,
10703
+ strategy: Tt,
10706
10704
  children: /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: a.map((E, D) => {
10707
10705
  const x = E.direction;
10708
10706
  return /* @__PURE__ */ e(
@@ -10715,18 +10713,18 @@ function nn({
10715
10713
  field: E,
10716
10714
  zone: t,
10717
10715
  onRemove: () => i(D),
10718
- onLabelChange: (b) => l(D, b),
10716
+ onLabelChange: (v) => l(D, v),
10719
10717
  sortDirection: x,
10720
- onSortDirectionChange: (b) => M(E.id, b),
10721
- onAggregationChange: o ? (b) => o(D, b) : void 0,
10722
- onAliasTemplateChange: h ? (b) => h(D, b) : void 0,
10723
- onValueAliasesChange: d ? (b) => d(D, b) : void 0,
10724
- onDateFormatChange: u ? (b, S) => u(
10718
+ onSortDirectionChange: (v) => M(E.id, v),
10719
+ onAggregationChange: o ? (v) => o(D, v) : void 0,
10720
+ onAliasTemplateChange: h ? (v) => h(D, v) : void 0,
10721
+ onValueAliasesChange: d ? (v) => d(D, v) : void 0,
10722
+ onDateFormatChange: u ? (v, S) => u(
10725
10723
  D,
10726
- b,
10724
+ v,
10727
10725
  S
10728
10726
  ) : void 0,
10729
- onGranularityChange: c ? (b) => c(D, b) : void 0,
10727
+ onGranularityChange: c ? (v) => c(D, v) : void 0,
10730
10728
  hasPivotColumns: C
10731
10729
  }
10732
10730
  ) })
@@ -10740,7 +10738,7 @@ function nn({
10740
10738
  )
10741
10739
  ] });
10742
10740
  }
10743
- function bd({
10741
+ function vd({
10744
10742
  groupByFields: t,
10745
10743
  pivotByFields: a,
10746
10744
  metricsFields: n,
@@ -10827,7 +10825,7 @@ function xd({
10827
10825
  return /* @__PURE__ */ s("div", { className: "flex w-96 flex-col border-r bg-background", children: [
10828
10826
  /* @__PURE__ */ s("div", { className: "mt-1 space-y-4 border-b px-6 py-4", children: [
10829
10827
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
10830
- /* @__PURE__ */ e(Ca, { className: "h-5 w-5 text-cyan-600" }),
10828
+ /* @__PURE__ */ e(Ca, { className: "text-brand h-5 w-5" }),
10831
10829
  /* @__PURE__ */ e("h2", { className: "font-semibold", children: "Chart Configuration" })
10832
10830
  ] }),
10833
10831
  /* @__PURE__ */ e(
@@ -10838,9 +10836,9 @@ function xd({
10838
10836
  }
10839
10837
  )
10840
10838
  ] }),
10841
- /* @__PURE__ */ s(bt, { className: "flex-1 p-6", children: [
10839
+ /* @__PURE__ */ s(xt, { className: "flex-1 p-6", children: [
10842
10840
  /* @__PURE__ */ e(
10843
- bd,
10841
+ vd,
10844
10842
  {
10845
10843
  groupByFields: n,
10846
10844
  pivotByFields: r,
@@ -10872,7 +10870,7 @@ function Nd({
10872
10870
  groups: []
10873
10871
  }
10874
10872
  );
10875
- T((v) => v.card.dataSource);
10873
+ T((b) => b.card.dataSource);
10876
10874
  const { columns: i, isLoading: l } = Zt(), u = a || i || [], c = {
10877
10875
  id: "default",
10878
10876
  name: "default",
@@ -10881,14 +10879,14 @@ function Nd({
10881
10879
  entityId: "default",
10882
10880
  entityName: "Default",
10883
10881
  entityType: "table"
10884
- }, h = (v) => {
10885
- const x = (b) => {
10886
- if (b.id === v) {
10882
+ }, h = (b) => {
10883
+ const x = (v) => {
10884
+ if (v.id === b) {
10887
10885
  const S = u[0] || c;
10888
10886
  return {
10889
- ...b,
10887
+ ...v,
10890
10888
  conditions: [
10891
- ...b.conditions,
10889
+ ...v.conditions,
10892
10890
  {
10893
10891
  id: `condition-${Date.now()}`,
10894
10892
  field: S,
@@ -10899,19 +10897,19 @@ function Nd({
10899
10897
  };
10900
10898
  }
10901
10899
  return {
10902
- ...b,
10903
- groups: b.groups.map(x)
10900
+ ...v,
10901
+ groups: v.groups.map(x)
10904
10902
  };
10905
10903
  };
10906
10904
  r(x(n));
10907
- }, d = (v) => {
10908
- const x = (b) => {
10909
- if (b.id === v) {
10905
+ }, d = (b) => {
10906
+ const x = (v) => {
10907
+ if (v.id === b) {
10910
10908
  const S = u[0] || c;
10911
10909
  return {
10912
- ...b,
10910
+ ...v,
10913
10911
  groups: [
10914
- ...b.groups,
10912
+ ...v.groups,
10915
10913
  {
10916
10914
  id: `group-${Date.now()}`,
10917
10915
  logicalOperator: "AND",
@@ -10930,92 +10928,92 @@ function Nd({
10930
10928
  };
10931
10929
  }
10932
10930
  return {
10933
- ...b,
10934
- groups: b.groups.map(x)
10931
+ ...v,
10932
+ groups: v.groups.map(x)
10935
10933
  };
10936
10934
  };
10937
10935
  r(x(n));
10938
- }, m = (v, x) => {
10939
- const b = (S) => S.id === v ? {
10936
+ }, m = (b, x) => {
10937
+ const v = (S) => S.id === b ? {
10940
10938
  ...S,
10941
10939
  conditions: S.conditions.filter((O) => O.id !== x)
10942
10940
  } : {
10943
10941
  ...S,
10944
- groups: S.groups.map(b)
10942
+ groups: S.groups.map(v)
10945
10943
  };
10946
- r(b(n));
10947
- }, C = (v, x) => {
10948
- const b = (S) => S.id === v ? {
10944
+ r(v(n));
10945
+ }, C = (b, x) => {
10946
+ const v = (S) => S.id === b ? {
10949
10947
  ...S,
10950
10948
  groups: S.groups.filter((O) => O.id !== x)
10951
10949
  } : {
10952
10950
  ...S,
10953
- groups: S.groups.map(b)
10951
+ groups: S.groups.map(v)
10954
10952
  };
10955
- r(b(n));
10956
- }, g = (v, x, b, S) => {
10957
- if (b === "field")
10953
+ r(v(n));
10954
+ }, g = (b, x, v, S) => {
10955
+ if (v === "field")
10958
10956
  throw new Error(
10959
10957
  "Use a dedicated method to update the field property with a Field object"
10960
10958
  );
10961
- const O = (I) => I.id === v ? {
10959
+ const O = (I) => I.id === b ? {
10962
10960
  ...I,
10963
10961
  conditions: I.conditions.map((w) => w.id === x ? {
10964
10962
  ...w,
10965
- [b]: S
10963
+ [v]: S
10966
10964
  } : w)
10967
10965
  } : {
10968
10966
  ...I,
10969
10967
  groups: I.groups.map(O)
10970
10968
  };
10971
10969
  r(O(n));
10972
- }, y = (v, x, b) => {
10973
- const S = (O) => O.id === v ? {
10970
+ }, y = (b, x, v) => {
10971
+ const S = (O) => O.id === b ? {
10974
10972
  ...O,
10975
- conditions: O.conditions.map((I) => I.id === x ? { ...I, ...b } : I)
10973
+ conditions: O.conditions.map((I) => I.id === x ? { ...I, ...v } : I)
10976
10974
  } : {
10977
10975
  ...O,
10978
10976
  groups: O.groups.map(S)
10979
10977
  };
10980
10978
  r(S(n));
10981
- }, p = (v, x) => {
10982
- const b = (S) => S.id === v ? {
10979
+ }, p = (b, x) => {
10980
+ const v = (S) => S.id === b ? {
10983
10981
  ...S,
10984
10982
  logicalOperator: x
10985
10983
  } : {
10986
10984
  ...S,
10987
- groups: S.groups.map(b)
10985
+ groups: S.groups.map(v)
10988
10986
  };
10989
- r(b(n));
10990
- }, N = (v, x) => {
10991
- const b = (S) => S.id === v ? {
10987
+ r(v(n));
10988
+ }, N = (b, x) => {
10989
+ const v = (S) => S.id === b ? {
10992
10990
  ...S,
10993
10991
  negate: x
10994
10992
  } : {
10995
10993
  ...S,
10996
- groups: S.groups.map(b)
10994
+ groups: S.groups.map(v)
10997
10995
  };
10998
- r(b(n));
10999
- }, f = (v, x, b) => {
11000
- const S = (O) => O.id === v ? {
10996
+ r(v(n));
10997
+ }, f = (b, x, v) => {
10998
+ const S = (O) => O.id === b ? {
11001
10999
  ...O,
11002
- conditions: Wn(O.conditions, x, b)
11000
+ conditions: Zn(O.conditions, x, v)
11003
11001
  } : {
11004
11002
  ...O,
11005
11003
  groups: O.groups.map(S)
11006
11004
  };
11007
11005
  r(S(n));
11008
- }, M = (v, x, b) => {
11009
- const S = (O) => O.id === v ? {
11006
+ }, M = (b, x, v) => {
11007
+ const S = (O) => O.id === b ? {
11010
11008
  ...O,
11011
- groups: Wn(O.groups, x, b)
11009
+ groups: Zn(O.groups, x, v)
11012
11010
  } : {
11013
11011
  ...O,
11014
11012
  groups: O.groups.map(S)
11015
11013
  };
11016
11014
  r(S(n));
11017
- }, E = (v) => {
11018
- if (!v || v.conditions.length === 0 && v.groups.length === 0)
11015
+ }, E = (b) => {
11016
+ if (!b || b.conditions.length === 0 && b.groups.length === 0)
11019
11017
  return "-- No filters defined";
11020
11018
  const x = (S) => {
11021
11019
  let O = "";
@@ -11045,15 +11043,15 @@ function Nd({
11045
11043
  default:
11046
11044
  return `${O} ${I} ${w}`;
11047
11045
  }
11048
- }, b = (S) => {
11046
+ }, v = (S) => {
11049
11047
  const O = S.conditions.map(x), I = S.groups.map(
11050
- (z) => b(z)
11048
+ (z) => v(z)
11051
11049
  ), w = [...O, ...I].filter(Boolean);
11052
11050
  if (w.length === 0) return "";
11053
11051
  const L = w.join(` ${S.logicalOperator} `), F = w.length > 1 ? `(${L})` : L;
11054
11052
  return S.negate ? `NOT ${F}` : F;
11055
11053
  };
11056
- return b(v);
11054
+ return v(b);
11057
11055
  }, D = n.conditions.length > 0 || n.groups.length > 0;
11058
11056
  return {
11059
11057
  currentFilters: n,
@@ -11143,7 +11141,7 @@ function kd({
11143
11141
  ]
11144
11142
  }
11145
11143
  ) }),
11146
- /* @__PURE__ */ e(It, { className: "z-50 w-80 p-0", align: "start", children: /* @__PURE__ */ s(bn, { children: [
11144
+ /* @__PURE__ */ e(Et, { className: "z-50 w-80 p-0", align: "start", children: /* @__PURE__ */ s(vn, { children: [
11147
11145
  /* @__PURE__ */ e(xn, { placeholder: "Search fields...", className: "h-9" }),
11148
11146
  /* @__PURE__ */ e(Cn, { children: "No fields found." }),
11149
11147
  /* @__PURE__ */ e(Nn, { className: "max-h-80", children: Object.entries(u).map(([c, h]) => /* @__PURE__ */ e(
@@ -11227,7 +11225,7 @@ function _a(t) {
11227
11225
  joinPlan: i,
11228
11226
  groupByColumns: [l],
11229
11227
  metricColumns: [o]
11230
- }, c = ((g = a.dataSource) == null ? void 0 : g.connectionId) || a.connectionId, { data: h, isPending: d, error: m } = ha({
11228
+ }, c = ((g = a.dataSource) == null ? void 0 : g.connectionId) || a.connectionId, { data: h, isPending: d, error: m } = pa({
11231
11229
  queryKey: [
11232
11230
  "filterValues",
11233
11231
  t.entityId,
@@ -11236,7 +11234,7 @@ function _a(t) {
11236
11234
  ],
11237
11235
  queryFn: async () => {
11238
11236
  try {
11239
- return await Un(
11237
+ return await Yn(
11240
11238
  "https://semaphor.cloud/api/v1/query",
11241
11239
  (n == null ? void 0 : n.accessToken) || "",
11242
11240
  {
@@ -11301,16 +11299,16 @@ function Md({
11301
11299
  onClick: (C) => {
11302
11300
  C.stopPropagation(), c(d);
11303
11301
  },
11304
- children: /* @__PURE__ */ e(be, { className: "h-3 w-3 text-muted-foreground hover:text-foreground" })
11302
+ children: /* @__PURE__ */ e(ve, { className: "h-3 w-3 text-muted-foreground hover:text-foreground" })
11305
11303
  }
11306
11304
  )
11307
11305
  ] }, d);
11308
11306
  }) : /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: r }) }),
11309
- /* @__PURE__ */ e(At, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
11307
+ /* @__PURE__ */ e(vt, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
11310
11308
  ]
11311
11309
  }
11312
11310
  ) }),
11313
- /* @__PURE__ */ e(It, { className: "z-50 w-fit overflow-auto p-0", align: "start", children: /* @__PURE__ */ s(bn, { children: [
11311
+ /* @__PURE__ */ e(Et, { className: "z-50 w-fit overflow-auto p-0", align: "start", children: /* @__PURE__ */ s(vn, { children: [
11314
11312
  /* @__PURE__ */ e(xn, { placeholder: "Search..." }),
11315
11313
  /* @__PURE__ */ s(Nn, { children: [
11316
11314
  /* @__PURE__ */ e(Cn, { children: "No results found." }),
@@ -11452,7 +11450,7 @@ function Lr({
11452
11450
  {
11453
11451
  ref: m,
11454
11452
  style: f,
11455
- className: `mb-2 flex items-center gap-2 rounded p-2 hover:bg-gray-50 ${y ? "z-50 opacity-50" : ""}`,
11453
+ className: `mb-2 flex items-center gap-2 rounded p-2 hover:bg-muted/50 ${y ? "z-50 opacity-50" : ""}`,
11456
11454
  children: [
11457
11455
  /* @__PURE__ */ e(
11458
11456
  "div",
@@ -11580,7 +11578,7 @@ function Lr({
11580
11578
  size: "sm",
11581
11579
  className: "h-7 w-7 flex-shrink-0 p-0",
11582
11580
  onClick: () => l(n, t.id),
11583
- children: /* @__PURE__ */ e(be, { className: "h-3 w-3" })
11581
+ children: /* @__PURE__ */ e(ve, { className: "h-3 w-3" })
11584
11582
  }
11585
11583
  )
11586
11584
  ]
@@ -11611,11 +11609,11 @@ function Fd({
11611
11609
  setNodeRef: M,
11612
11610
  transform: E,
11613
11611
  transition: D,
11614
- isDragging: v
11612
+ isDragging: b
11615
11613
  } = zt({ id: t.id }), x = {
11616
11614
  transform: it.Transform.toString(E),
11617
11615
  transition: D
11618
- }, b = (O) => {
11616
+ }, v = (O) => {
11619
11617
  const { active: I, over: w } = O;
11620
11618
  if (w && I.id !== w.id) {
11621
11619
  const L = t.conditions.findIndex(
@@ -11637,9 +11635,9 @@ function Fd({
11637
11635
  {
11638
11636
  ref: M,
11639
11637
  style: x,
11640
- className: `rounded-lg ${a > 0 ? "mt-2 border border-gray-200" : ""} ${v ? "z-50 opacity-50" : ""}`,
11638
+ className: `rounded-lg ${a > 0 ? "mt-2 border border-border" : ""} ${b ? "z-50 opacity-50" : ""}`,
11641
11639
  children: [
11642
- a > 0 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between rounded-t-lg bg-gray-50 p-2", children: [
11640
+ a > 0 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between rounded-t-lg bg-muted p-2", children: [
11643
11641
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
11644
11642
  /* @__PURE__ */ e(
11645
11643
  "div",
@@ -11647,7 +11645,7 @@ function Fd({
11647
11645
  ...N,
11648
11646
  ...f,
11649
11647
  className: "cursor-grab active:cursor-grabbing",
11650
- children: /* @__PURE__ */ e(Ft, { className: "h-4 w-4 text-gray-400" })
11648
+ children: /* @__PURE__ */ e(Ft, { className: "h-4 w-4 text-muted-foreground" })
11651
11649
  }
11652
11650
  ),
11653
11651
  /* @__PURE__ */ e(
@@ -11683,27 +11681,27 @@ function Fd({
11683
11681
  size: "sm",
11684
11682
  className: "h-7 w-7 p-0",
11685
11683
  onClick: () => n && l(n, t.id),
11686
- children: /* @__PURE__ */ e(ma, { className: "h-3 w-3" })
11684
+ children: /* @__PURE__ */ e(ha, { className: "h-3 w-3" })
11687
11685
  }
11688
11686
  )
11689
11687
  ] }),
11690
11688
  /* @__PURE__ */ s("div", { className: `p-3 ${a > 0 ? "" : "px-0"}`, children: [
11691
11689
  /* @__PURE__ */ e(
11692
- Tt,
11690
+ Dt,
11693
11691
  {
11694
11692
  sensors: Bt(
11695
11693
  Xe(on),
11696
- Xe(Xn, {
11697
- coordinateGetter: Zn
11694
+ Xe(ea, {
11695
+ coordinateGetter: Xn
11698
11696
  })
11699
11697
  ),
11700
11698
  collisionDetection: _t,
11701
- onDragEnd: b,
11699
+ onDragEnd: v,
11702
11700
  children: /* @__PURE__ */ e(
11703
11701
  Ue,
11704
11702
  {
11705
11703
  items: t.conditions.map((O) => O.id),
11706
- strategy: Mt,
11704
+ strategy: Tt,
11707
11705
  children: t.conditions.map((O, I) => /* @__PURE__ */ e(
11708
11706
  Lr,
11709
11707
  {
@@ -11725,12 +11723,12 @@ function Fd({
11725
11723
  }
11726
11724
  ),
11727
11725
  /* @__PURE__ */ e(
11728
- Tt,
11726
+ Dt,
11729
11727
  {
11730
11728
  sensors: Bt(
11731
11729
  Xe(on),
11732
- Xe(Xn, {
11733
- coordinateGetter: Zn
11730
+ Xe(ea, {
11731
+ coordinateGetter: Xn
11734
11732
  })
11735
11733
  ),
11736
11734
  collisionDetection: _t,
@@ -11739,7 +11737,7 @@ function Fd({
11739
11737
  Ue,
11740
11738
  {
11741
11739
  items: t.groups.map((O) => O.id),
11742
- strategy: Mt,
11740
+ strategy: Tt,
11743
11741
  children: t.groups.map(
11744
11742
  (O) => y(O, a + 1, t.id)
11745
11743
  )
@@ -11807,12 +11805,12 @@ function Ld({
11807
11805
  } = Nd({
11808
11806
  initialFilters: t,
11809
11807
  availableFields: a
11810
- }), v = Bt(
11808
+ }), b = Bt(
11811
11809
  Xe(on),
11812
- Xe(Xn, {
11813
- coordinateGetter: Zn
11810
+ Xe(ea, {
11811
+ coordinateGetter: Xn
11814
11812
  })
11815
- ), [x, b] = V(!1), S = (w, L, F) => {
11813
+ ), [x, v] = V(!1), S = (w, L, F) => {
11816
11814
  const z = (k) => k.id === w ? {
11817
11815
  ...k,
11818
11816
  conditions: k.conditions.map((A) => A.id === L ? {
@@ -11827,9 +11825,9 @@ function Ld({
11827
11825
  D(z(l));
11828
11826
  }, O = (w, L = 0, F) => L === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg", children: /* @__PURE__ */ s("div", { className: "p-3 px-0", children: [
11829
11827
  /* @__PURE__ */ e(
11830
- Tt,
11828
+ Dt,
11831
11829
  {
11832
- sensors: v,
11830
+ sensors: b,
11833
11831
  collisionDetection: _t,
11834
11832
  onDragEnd: (z) => {
11835
11833
  const { active: k, over: A } = z;
@@ -11846,7 +11844,7 @@ function Ld({
11846
11844
  Ue,
11847
11845
  {
11848
11846
  items: w.conditions.map((z) => z.id),
11849
- strategy: Mt,
11847
+ strategy: Tt,
11850
11848
  children: w.conditions.map((z, k) => /* @__PURE__ */ e(
11851
11849
  Lr,
11852
11850
  {
@@ -11868,9 +11866,9 @@ function Ld({
11868
11866
  }
11869
11867
  ),
11870
11868
  /* @__PURE__ */ e(
11871
- Tt,
11869
+ Dt,
11872
11870
  {
11873
- sensors: v,
11871
+ sensors: b,
11874
11872
  collisionDetection: _t,
11875
11873
  onDragEnd: (z) => {
11876
11874
  const { active: k, over: A } = z;
@@ -11887,7 +11885,7 @@ function Ld({
11887
11885
  Ue,
11888
11886
  {
11889
11887
  items: w.groups.map((z) => z.id),
11890
- strategy: Mt,
11888
+ strategy: Tt,
11891
11889
  children: w.groups.map(
11892
11890
  (z) => O(z, L + 1, w.id)
11893
11891
  )
@@ -11951,13 +11949,13 @@ function Ld({
11951
11949
  /* @__PURE__ */ e("div", { className: "h-5 w-5 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" }),
11952
11950
  /* @__PURE__ */ e("span", { className: "ml-2 text-sm text-gray-600", children: "Loading columns..." })
11953
11951
  ] }) : O(l),
11954
- /* @__PURE__ */ e("div", { className: "mt-4 border-t border-gray-200 pt-4", children: /* @__PURE__ */ s("div", { className: "flex items-center space-x-2", children: [
11952
+ /* @__PURE__ */ e("div", { className: "mt-4 border-t border-border pt-4", children: /* @__PURE__ */ s("div", { className: "flex items-center space-x-2", children: [
11955
11953
  /* @__PURE__ */ e(
11956
11954
  On,
11957
11955
  {
11958
11956
  id: "advanced-mode",
11959
11957
  checked: x,
11960
- onCheckedChange: (w) => b(!!w)
11958
+ onCheckedChange: (w) => v(!!w)
11961
11959
  }
11962
11960
  ),
11963
11961
  /* @__PURE__ */ e(
@@ -11969,9 +11967,9 @@ function Ld({
11969
11967
  }
11970
11968
  )
11971
11969
  ] }) }),
11972
- E && /* @__PURE__ */ s("div", { className: "mt-4 border-t border-gray-200 pt-4", children: [
11973
- /* @__PURE__ */ e("div", { className: "mb-2 text-xs font-medium text-gray-700", children: "SQL WHERE Clause Preview" }),
11974
- /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-md border bg-gray-50 p-3", children: /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap font-mono text-xs text-gray-800", children: M(l) }) })
11970
+ E && /* @__PURE__ */ s("div", { className: "mt-4 border-t border-border pt-4", children: [
11971
+ /* @__PURE__ */ e("div", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "SQL WHERE Clause Preview" }),
11972
+ /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-md border bg-muted p-3", children: /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap font-mono text-xs text-muted-foreground", children: M(l) }) })
11975
11973
  ] })
11976
11974
  ] }) }) }),
11977
11975
  /* @__PURE__ */ s("div", { className: "flex justify-end gap-2", children: [
@@ -12000,7 +11998,7 @@ function Rd({
12000
11998
  return /* @__PURE__ */ e(pn, { open: l, onOpenChange: o, children: /* @__PURE__ */ s(fn, { className: "max-h-[80vh] max-w-4xl overflow-y-auto", children: [
12001
11999
  /* @__PURE__ */ s(gn, { children: [
12002
12000
  /* @__PURE__ */ e(yn, { children: "Card Filters" }),
12003
- /* @__PURE__ */ e(vn, { children: "Add filters to the card to limit the data that is displayed." })
12001
+ /* @__PURE__ */ e(bn, { children: "Add filters to the card to limit the data that is displayed." })
12004
12002
  ] }),
12005
12003
  /* @__PURE__ */ e(
12006
12004
  Ld,
@@ -12044,10 +12042,10 @@ function Vd({
12044
12042
  (f, M) => {
12045
12043
  var E;
12046
12044
  return !u || !((E = u.baseEntity) != null && E.name) || !u.joins ? !1 : f === M || f === u.baseEntity.name || M === u.baseEntity.name ? !0 : u.joins.some((D) => {
12047
- const v = ca(D.source), x = ca(D.target);
12048
- return console.log(v, x), console.log(
12049
- v === f && x === M || v === M && x === f
12050
- ), v === f && x === M || v === M && x === f;
12045
+ const b = da(D.source), x = da(D.target);
12046
+ return console.log(b, x), console.log(
12047
+ b === f && x === M || b === M && x === f
12048
+ ), b === f && x === M || b === M && x === f;
12051
12049
  });
12052
12050
  },
12053
12051
  [u]
@@ -12059,7 +12057,7 @@ function Vd({
12059
12057
  duration: 4e3
12060
12058
  });
12061
12059
  }, []), C = (f, M) => {
12062
- const E = Vr(M, f), D = Je(f.dataType), v = D === "date", x = {
12060
+ const E = Vr(M, f), D = Je(f.dataType), b = D === "date", x = {
12063
12061
  id: E,
12064
12062
  name: f.name,
12065
12063
  dataType: f.dataType,
@@ -12070,18 +12068,18 @@ function Vd({
12070
12068
  entityType: f.entityType
12071
12069
  };
12072
12070
  if (M === "metrics") {
12073
- const b = D === "number" ? "SUM" : "COUNT", S = Rr(f.label, b);
12071
+ const v = D === "number" ? "SUM" : "COUNT", S = Rr(f.label, v);
12074
12072
  return {
12075
12073
  ...x,
12076
12074
  role: "metric",
12077
12075
  label: S,
12078
- aggregate: b
12076
+ aggregate: v
12079
12077
  };
12080
12078
  }
12081
12079
  return M === "groupBy" ? {
12082
12080
  ...x,
12083
12081
  role: "groupby",
12084
- ...v && {
12082
+ ...b && {
12085
12083
  granularity: "month"
12086
12084
  }
12087
12085
  } : M === "pivotBy" ? {
@@ -12101,8 +12099,8 @@ function Vd({
12101
12099
  l(null);
12102
12100
  return;
12103
12101
  }
12104
- const D = M.id, v = E.id, x = h(D), b = h(v) || v;
12105
- if (x === "source" && b !== "source") {
12102
+ const D = M.id, b = E.id, x = h(D), v = h(b) || b;
12103
+ if (x === "source" && v !== "source") {
12106
12104
  const S = [...a].find((F) => F.id === D);
12107
12105
  if (!S) {
12108
12106
  l(null);
@@ -12134,35 +12132,35 @@ function Vd({
12134
12132
  return;
12135
12133
  }
12136
12134
  }
12137
- const I = n(b);
12135
+ const I = n(v);
12138
12136
  if (I.some(
12139
12137
  (F) => F.name === S.name && F.qualifiedEntityName === S.qualifiedEntityName
12140
12138
  )) {
12141
12139
  l(null);
12142
12140
  return;
12143
12141
  }
12144
- const L = C(S, b);
12145
- l(null), r(b, [...I, L]);
12142
+ const L = C(S, v);
12143
+ l(null), r(v, [...I, L]);
12146
12144
  return;
12147
12145
  }
12148
- if (x && b && x !== "source" && b !== "source" && x !== b) {
12149
- const S = n(x), O = n(b), I = S.find((F) => F.id === D);
12146
+ if (x && v && x !== "source" && v !== "source" && x !== v) {
12147
+ const S = n(x), O = n(v), I = S.find((F) => F.id === D);
12150
12148
  if (!I) {
12151
12149
  l(null);
12152
12150
  return;
12153
12151
  }
12154
- const w = C(I, b);
12152
+ const w = C(I, v);
12155
12153
  l(null);
12156
12154
  const L = S.filter(
12157
12155
  (F) => F.id !== D
12158
12156
  );
12159
- r(x, L), r(b, [...O, w]);
12157
+ r(x, L), r(v, [...O, w]);
12160
12158
  return;
12161
12159
  }
12162
- if (x && b && x === b && x !== "source") {
12163
- const S = n(x), O = S.findIndex((w) => w.id === D), I = S.findIndex((w) => w.id === v);
12160
+ if (x && v && x === v && x !== "source") {
12161
+ const S = n(x), O = S.findIndex((w) => w.id === D), I = S.findIndex((w) => w.id === b);
12164
12162
  if (O !== I) {
12165
- const w = Wn(S, O, I);
12163
+ const w = Zn(S, O, I);
12166
12164
  r(x, w);
12167
12165
  }
12168
12166
  }
@@ -12203,47 +12201,47 @@ const jd = (t) => {
12203
12201
  switch (D) {
12204
12202
  case "groupBy":
12205
12203
  return (t.config.groupByColumns || []).map(
12206
- (v) => ({
12207
- id: v.id,
12208
- name: v.name,
12209
- dataType: v.dataType,
12210
- label: v.label !== void 0 ? v.label : v.name,
12211
- qualifiedEntityName: v.qualifiedEntityName,
12212
- entityId: v.entityId,
12213
- entityName: v.entityName,
12214
- entityType: v.entityType,
12215
- dateFormat: v.dateFormat,
12216
- customFormat: v.customFormat,
12217
- granularity: v.granularity
12204
+ (b) => ({
12205
+ id: b.id,
12206
+ name: b.name,
12207
+ dataType: b.dataType,
12208
+ label: b.label !== void 0 ? b.label : b.name,
12209
+ qualifiedEntityName: b.qualifiedEntityName,
12210
+ entityId: b.entityId,
12211
+ entityName: b.entityName,
12212
+ entityType: b.entityType,
12213
+ dateFormat: b.dateFormat,
12214
+ customFormat: b.customFormat,
12215
+ granularity: b.granularity
12218
12216
  })
12219
12217
  );
12220
12218
  case "metrics":
12221
12219
  return t.config.metricColumns || [];
12222
12220
  case "pivotBy":
12223
12221
  return (t.config.pivotByColumns || []).map(
12224
- (v) => ({
12225
- id: v.id,
12226
- name: v.name,
12227
- dataType: v.dataType,
12228
- label: v.label !== void 0 ? v.label : v.name,
12229
- qualifiedEntityName: v.qualifiedEntityName,
12230
- entityId: v.entityId,
12231
- entityName: v.entityName,
12232
- entityType: v.entityType
12222
+ (b) => ({
12223
+ id: b.id,
12224
+ name: b.name,
12225
+ dataType: b.dataType,
12226
+ label: b.label !== void 0 ? b.label : b.name,
12227
+ qualifiedEntityName: b.qualifiedEntityName,
12228
+ entityId: b.entityId,
12229
+ entityName: b.entityName,
12230
+ entityType: b.entityType
12233
12231
  })
12234
12232
  );
12235
12233
  case "sortBy":
12236
12234
  return (t.config.sortByColumns || []).map(
12237
- (v) => ({
12238
- id: v.id,
12239
- name: v.name,
12240
- dataType: v.dataType,
12241
- label: v.label !== void 0 ? v.label : v.name,
12242
- qualifiedEntityName: v.qualifiedEntityName,
12243
- entityId: v.entityId,
12244
- entityName: v.entityName,
12245
- entityType: v.entityType,
12246
- direction: v.direction
12235
+ (b) => ({
12236
+ id: b.id,
12237
+ name: b.name,
12238
+ dataType: b.dataType,
12239
+ label: b.label !== void 0 ? b.label : b.name,
12240
+ qualifiedEntityName: b.qualifiedEntityName,
12241
+ entityId: b.entityId,
12242
+ entityName: b.entityName,
12243
+ entityType: b.entityType,
12244
+ direction: b.direction
12247
12245
  })
12248
12246
  );
12249
12247
  case "source":
@@ -12254,30 +12252,30 @@ const jd = (t) => {
12254
12252
  },
12255
12253
  [t]
12256
12254
  ), C = Ne(
12257
- (D, v) => {
12255
+ (D, b) => {
12258
12256
  if (d)
12259
12257
  switch (D) {
12260
12258
  case "groupBy": {
12261
12259
  a(d, {
12262
- groupByColumns: v
12260
+ groupByColumns: b
12263
12261
  });
12264
12262
  break;
12265
12263
  }
12266
12264
  case "metrics": {
12267
12265
  a(d, {
12268
- metricColumns: v
12266
+ metricColumns: b
12269
12267
  });
12270
12268
  break;
12271
12269
  }
12272
12270
  case "pivotBy": {
12273
12271
  a(d, {
12274
- pivotByColumns: v
12272
+ pivotByColumns: b
12275
12273
  });
12276
12274
  break;
12277
12275
  }
12278
12276
  case "sortBy": {
12279
12277
  a(d, {
12280
- sortByColumns: v
12278
+ sortByColumns: b
12281
12279
  });
12282
12280
  break;
12283
12281
  }
@@ -12291,9 +12289,9 @@ const jd = (t) => {
12291
12289
  // createSortByColumn,
12292
12290
  ]
12293
12291
  ), g = Ne(
12294
- (D, v, x) => {
12292
+ (D, b, x) => {
12295
12293
  if (!d) return;
12296
- const S = m(D)[v];
12294
+ const S = m(D)[b];
12297
12295
  if (S)
12298
12296
  switch (D) {
12299
12297
  case "groupBy":
@@ -12319,74 +12317,74 @@ const jd = (t) => {
12319
12317
  l
12320
12318
  ]
12321
12319
  ), y = Ne(
12322
- (D, v) => {
12320
+ (D, b) => {
12323
12321
  if (!d) return;
12324
- const b = m("metrics")[D];
12325
- b && r(d, b.id, {
12326
- aggregate: v,
12322
+ const v = m("metrics")[D];
12323
+ v && r(d, v.id, {
12324
+ aggregate: b,
12327
12325
  label: Rr(
12328
- b.name,
12329
- v
12326
+ v.name,
12327
+ b
12330
12328
  )
12331
12329
  });
12332
12330
  },
12333
12331
  [d, m, r]
12334
12332
  ), p = Ne(
12335
- (D, v, x) => {
12333
+ (D, b, x) => {
12336
12334
  if (!d) return;
12337
12335
  const S = m("groupBy")[D];
12338
12336
  if (!S) return;
12339
12337
  const O = {
12340
- dateFormat: v
12338
+ dateFormat: b
12341
12339
  };
12342
- v === "custom" && x ? O.customFormat = x : O.customFormat = void 0, n(d, S.id, O);
12340
+ b === "custom" && x ? O.customFormat = x : O.customFormat = void 0, n(d, S.id, O);
12343
12341
  },
12344
12342
  [d, m, n]
12345
12343
  ), N = Ne(
12346
- (D, v) => {
12344
+ (D, b) => {
12347
12345
  if (!d) return;
12348
- const b = m("groupBy")[D];
12349
- b && n(d, b.id, {
12350
- granularity: v
12346
+ const v = m("groupBy")[D];
12347
+ v && n(d, v.id, {
12348
+ granularity: b
12351
12349
  });
12352
12350
  },
12353
12351
  [d, m, n]
12354
12352
  ), f = Ne(
12355
- (D, v) => {
12353
+ (D, b) => {
12356
12354
  if (!d) return;
12357
- const b = m("metrics")[D];
12358
- b && r(d, b.id, {
12359
- aliasTemplate: v
12355
+ const v = m("metrics")[D];
12356
+ v && r(d, v.id, {
12357
+ aliasTemplate: b
12360
12358
  });
12361
12359
  },
12362
12360
  [d, m, r]
12363
12361
  ), M = Ne(
12364
- (D, v) => {
12365
- if (console.log("handleValueAliasesChange", D, v), !d) return;
12366
- console.log("handleValueAliasesChange", D, v);
12367
- const b = m("metrics")[D];
12368
- b && (console.log("handleValueAliasesChange", v), r(d, b.id, {
12369
- valueAliases: v
12362
+ (D, b) => {
12363
+ if (console.log("handleValueAliasesChange", D, b), !d) return;
12364
+ console.log("handleValueAliasesChange", D, b);
12365
+ const v = m("metrics")[D];
12366
+ v && (console.log("handleValueAliasesChange", b), r(d, v.id, {
12367
+ valueAliases: b
12370
12368
  }));
12371
12369
  },
12372
12370
  [d, m, r]
12373
12371
  ), E = Ne(
12374
- (D, v) => {
12372
+ (D, b) => {
12375
12373
  if (!d) return;
12376
- const b = m(D)[v];
12377
- if (b)
12374
+ const v = m(D)[b];
12375
+ if (v)
12378
12376
  switch (D) {
12379
12377
  case "groupBy":
12380
- o(d, b.id);
12378
+ o(d, v.id);
12381
12379
  break;
12382
12380
  case "metrics":
12383
- u(d, b.id);
12381
+ u(d, v.id);
12384
12382
  break;
12385
12383
  case "pivotBy":
12386
- c(d, b.id);
12384
+ c(d, v.id);
12387
12385
  break;
12388
12386
  case "sortBy":
12389
- h(d, b.id);
12387
+ h(d, v.id);
12390
12388
  break;
12391
12389
  }
12392
12390
  },
@@ -12417,10 +12415,31 @@ function qd({ activeView: t, onViewChange: a }) {
12417
12415
  {
12418
12416
  value: t,
12419
12417
  onValueChange: (n) => a(n),
12420
- children: /* @__PURE__ */ s(Wt, { className: "h-9 w-fit", children: [
12421
- /* @__PURE__ */ e(Te, { value: "table", className: "text-xs", children: "Results" }),
12422
- /* @__PURE__ */ e(Te, { value: "chart", className: "text-xs", children: "Chart" }),
12423
- /* @__PURE__ */ e(Te, { value: "sql", className: "text-xs", children: "SQL" })
12418
+ children: /* @__PURE__ */ s(Wt, { className: "h-9 w-fit bg-background p-0", children: [
12419
+ /* @__PURE__ */ e(
12420
+ Te,
12421
+ {
12422
+ value: "chart",
12423
+ className: "rounded-none transition data-[state=active]:border-b-2 data-[state=active]:border-foreground data-[state=active]:bg-muted",
12424
+ children: "Chart"
12425
+ }
12426
+ ),
12427
+ /* @__PURE__ */ e(
12428
+ Te,
12429
+ {
12430
+ value: "table",
12431
+ className: "rounded-none transition data-[state=active]:border-b-2 data-[state=active]:border-foreground data-[state=active]:bg-muted",
12432
+ children: "Results"
12433
+ }
12434
+ ),
12435
+ /* @__PURE__ */ e(
12436
+ Te,
12437
+ {
12438
+ value: "sql",
12439
+ className: "rounded-none transition data-[state=active]:border-b-2 data-[state=active]:border-foreground data-[state=active]:bg-muted",
12440
+ children: "SQL"
12441
+ }
12442
+ )
12424
12443
  ] })
12425
12444
  }
12426
12445
  );
@@ -12453,7 +12472,7 @@ function Pd() {
12453
12472
  const m = d.target.value;
12454
12473
  l(m), m && !isNaN(parseInt(m)) && a(t.id, parseInt(m));
12455
12474
  },
12456
- className: "h-9 w-24",
12475
+ className: "h-7 w-24",
12457
12476
  placeholder: "Enter limit",
12458
12477
  min: 1
12459
12478
  }
@@ -12463,7 +12482,7 @@ function Pd() {
12463
12482
  value: ((h = (c = t.config) == null ? void 0 : c.rowLimit) == null ? void 0 : h.toString()) || "100",
12464
12483
  onValueChange: o,
12465
12484
  children: [
12466
- /* @__PURE__ */ e(oe, { className: "h-9 w-24", children: /* @__PURE__ */ e(ce, { placeholder: "Select limit" }) }),
12485
+ /* @__PURE__ */ e(oe, { className: "h-8 w-24 border-none px-1", children: /* @__PURE__ */ e(ce, { placeholder: "Select limit" }) }),
12467
12486
  /* @__PURE__ */ e(de, { children: Bd.map((d) => /* @__PURE__ */ e(U, { value: d.value, children: d.label }, d.value)) })
12468
12487
  ]
12469
12488
  }
@@ -12497,23 +12516,23 @@ function _d({
12497
12516
  isLoading: E,
12498
12517
  isFetching: D
12499
12518
  } = Ee(h);
12500
- function v() {
12519
+ function b() {
12501
12520
  return /* @__PURE__ */ e("div", { className: "border-b border-border bg-background p-4", children: /* @__PURE__ */ s("div", { className: "space-y-4", children: [
12502
12521
  /* @__PURE__ */ s("div", { children: [
12503
- /* @__PURE__ */ e("h3", { className: "mb-2 text-sm font-medium text-gray-700", children: "Active Card Config" }),
12504
- /* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs text-gray-800", children: JSON.stringify(g.config || {}, null, 2) })
12522
+ /* @__PURE__ */ e("h3", { className: "mb-2 text-sm font-medium", children: "Active Card Config" }),
12523
+ /* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: JSON.stringify(g.config || {}, null, 2) })
12505
12524
  ] }),
12506
12525
  /* @__PURE__ */ s("div", { children: [
12507
- /* @__PURE__ */ e("h3", { className: "mb-2 text-sm font-medium text-gray-700", children: "Card Data Source State" }),
12508
- /* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs text-gray-800", children: JSON.stringify(h.dataSource || {}, null, 2) })
12526
+ /* @__PURE__ */ e("h3", { className: "mb-2 text-sm font-medium", children: "Card Data Source State" }),
12527
+ /* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: JSON.stringify(h.dataSource || {}, null, 2) })
12509
12528
  ] }),
12510
12529
  /* @__PURE__ */ s("div", { children: [
12511
- /* @__PURE__ */ s("h3", { className: "mb-2 text-sm font-medium text-gray-700", children: [
12530
+ /* @__PURE__ */ s("h3", { className: "mb-2 text-sm font-medium", children: [
12512
12531
  "Columns (",
12513
12532
  d.length,
12514
12533
  ")"
12515
12534
  ] }),
12516
- /* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs text-gray-800", children: m ? "Loading..." : C ? "Error loading columns" : JSON.stringify(d.slice(0, 5), null, 2) })
12535
+ /* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: m ? "Loading..." : C ? "Error loading columns" : JSON.stringify(d.slice(0, 5), null, 2) })
12517
12536
  ] })
12518
12537
  ] }) });
12519
12538
  }
@@ -12550,7 +12569,7 @@ function _d({
12550
12569
  ...I,
12551
12570
  sortByColumns: w
12552
12571
  });
12553
- }, b = rt(() => {
12572
+ }, v = rt(() => {
12554
12573
  var O, I;
12555
12574
  return (I = (O = g.config) == null ? void 0 : O.sortByColumns) == null ? void 0 : I.map((w) => ({
12556
12575
  id: w.label,
@@ -12572,26 +12591,25 @@ function _d({
12572
12591
  filterCount: c
12573
12592
  }
12574
12593
  ),
12575
- n && v(),
12594
+ n && b(),
12576
12595
  /* @__PURE__ */ s("div", { className: "group/visualization flex max-w-full grow flex-col", children: [
12577
12596
  /* @__PURE__ */ s("div", { className: "z-50 flex items-center gap-2 px-6", children: [
12578
12597
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2", children: [
12579
12598
  /* @__PURE__ */ e(qd, { activeView: t, onViewChange: a }),
12599
+ u && /* @__PURE__ */ s(
12600
+ ae,
12601
+ {
12602
+ tooltip: "Card Filters",
12603
+ className: "gap-1",
12604
+ onClick: u,
12605
+ children: [
12606
+ /* @__PURE__ */ e(Ta, { className: "h-3.5 w-3.5" }),
12607
+ c > 0 && /* @__PURE__ */ e("span", { className: "ml-1 rounded-full bg-blue-100 px-1.5 py-0.5 text-xs text-blue-800", children: c })
12608
+ ]
12609
+ }
12610
+ ),
12580
12611
  /* @__PURE__ */ e(Pd, {})
12581
12612
  ] }),
12582
- u && /* @__PURE__ */ s(
12583
- P,
12584
- {
12585
- variant: "outline",
12586
- size: "sm",
12587
- className: "gap-1",
12588
- onClick: u,
12589
- children: [
12590
- /* @__PURE__ */ e(Ta, { className: "h-3.5 w-3.5" }),
12591
- c > 0 && /* @__PURE__ */ e("span", { className: "ml-1 rounded-full bg-blue-100 px-1.5 py-0.5 text-xs text-blue-800", children: c })
12592
- ]
12593
- }
12594
- ),
12595
12613
  /* @__PURE__ */ s(
12596
12614
  "div",
12597
12615
  {
@@ -12599,7 +12617,7 @@ function _d({
12599
12617
  "justify-between": p
12600
12618
  }),
12601
12619
  children: [
12602
- t === "chart" && p && /* @__PURE__ */ e(wr, { variant: "outline" }),
12620
+ t === "chart" && p && /* @__PURE__ */ e(wr, {}),
12603
12621
  /* @__PURE__ */ e("div", { className: "opacity-0 transition-opacity group-hover/visualization:opacity-100", children: t === "chart" && /* @__PURE__ */ e(Sr, {}) })
12604
12622
  ]
12605
12623
  }
@@ -12616,11 +12634,11 @@ function _d({
12616
12634
  card: h,
12617
12635
  data: N == null ? void 0 : N.records,
12618
12636
  onSortChange: x,
12619
- sortState: b
12637
+ sortState: v
12620
12638
  }
12621
12639
  ) }),
12622
12640
  t === "sql" && /* @__PURE__ */ e("div", { className: "p-6", children: /* @__PURE__ */ s("div", { className: "rounded-md border bg-background p-4", children: [
12623
- /* @__PURE__ */ e("h3", { className: "mb-3 text-sm font-medium text-gray-700", children: "Generated SQL Query" }),
12641
+ /* @__PURE__ */ e("h3", { className: "mb-3 text-sm font-medium", children: "Generated SQL Query" }),
12624
12642
  /* @__PURE__ */ e(pr, { sql: N == null ? void 0 : N.sql, error: f })
12625
12643
  ] }) })
12626
12644
  ] })
@@ -12630,14 +12648,14 @@ function _d({
12630
12648
  }
12631
12649
  function $d({ activeField: t }) {
12632
12650
  const [a, n] = V(!0);
12633
- return ve(() => {
12651
+ return be(() => {
12634
12652
  t && n(!0);
12635
12653
  }, [t]), t ? /* @__PURE__ */ s(
12636
12654
  "div",
12637
12655
  {
12638
12656
  className: `flex items-center gap-2 rounded-lg border border-blue-500 bg-background p-2 shadow-lg transition-all duration-200 ${a ? "scale-100 opacity-100" : "scale-95 opacity-0"}`,
12639
12657
  children: [
12640
- /* @__PURE__ */ e(Ft, { className: "h-3 w-3 text-gray-400" }),
12658
+ /* @__PURE__ */ e(Ft, { className: "h-3 w-3 text-muted-foreground" }),
12641
12659
  /* @__PURE__ */ e(zr, { dataType: t.dataType }),
12642
12660
  /* @__PURE__ */ e("span", { className: "text-sm dark:text-muted-foreground", children: t.name })
12643
12661
  ]
@@ -12676,7 +12694,7 @@ function Jd() {
12676
12694
  const [t, a] = V(
12677
12695
  "chart"
12678
12696
  ), [n, r] = V(!1), [i, l] = V(!1), o = T((ne) => ne.showAIDialog), { setCardType: u } = X(), c = T((ne) => ne.card.type);
12679
- ve(() => Gd(), []);
12697
+ be(() => Gd(), []);
12680
12698
  const h = () => {
12681
12699
  console.log("Accept clicked - would save/apply current configuration");
12682
12700
  }, d = () => {
@@ -12692,9 +12710,9 @@ function Jd() {
12692
12710
  (ne) => ne.actions.getAvailableFields
12693
12711
  );
12694
12712
  const { addCard: N, removeCard: f, updateCard: M, setActiveCard: E, updateFilters: D } = X(), {
12695
- columns: v = [],
12713
+ columns: b = [],
12696
12714
  isLoading: x,
12697
- error: b
12715
+ error: v
12698
12716
  } = Zt(), S = Bt(
12699
12717
  Xe(on, {
12700
12718
  activationConstraint: {
@@ -12713,7 +12731,7 @@ function Jd() {
12713
12731
  removeField: B
12714
12732
  } = jd(O), { activeField: $, handleDragStart: j, handleDragEnd: re } = Vd({
12715
12733
  activeCardId: y.activeCardId,
12716
- sourceFields: v,
12734
+ sourceFields: b,
12717
12735
  getFieldsForContainer: I,
12718
12736
  setFieldsForContainer: w
12719
12737
  }), ee = (ne, ye) => {
@@ -12726,7 +12744,7 @@ function Jd() {
12726
12744
  filters: void 0
12727
12745
  }
12728
12746
  });
12729
- }, te = v, Y = (ne) => {
12747
+ }, te = b, Y = (ne) => {
12730
12748
  if (!ne) return 0;
12731
12749
  let ye = ne.conditions.length;
12732
12750
  return ne.groups.forEach((Ve) => {
@@ -12734,7 +12752,7 @@ function Jd() {
12734
12752
  }), ye;
12735
12753
  }, J = Y(((K = O == null ? void 0 : O.config) == null ? void 0 : K.filters) || null);
12736
12754
  return /* @__PURE__ */ s(
12737
- Tt,
12755
+ Dt,
12738
12756
  {
12739
12757
  sensors: S,
12740
12758
  collisionDetection: _t,
@@ -12775,10 +12793,10 @@ function Jd() {
12775
12793
  onFiltersClick: C,
12776
12794
  filterCount: J,
12777
12795
  activeCard: O,
12778
- dataSourceState: p.dataSource || Qn,
12779
- columns: v,
12796
+ dataSourceState: p.dataSource || Wn,
12797
+ columns: b,
12780
12798
  columnsLoading: x,
12781
- columnsError: b,
12799
+ columnsError: v,
12782
12800
  getFieldsForContainer: I,
12783
12801
  cards: y.cards,
12784
12802
  activeCardId: y.activeCardId,
@@ -12805,18 +12823,18 @@ function Jd() {
12805
12823
  );
12806
12824
  }
12807
12825
  function Hd({ authToken: t, onSave: a, onClose: n }) {
12808
- const r = ft(null), i = T((M) => M.showAIDialog), l = T((M) => M.isDevMode), { setAuthToken: o } = Ot(), { setShowAIDialog: u, setOnSave: c, setOnClose: h } = X(), {
12826
+ const r = ft(null), i = T((M) => M.showAIDialog), l = T((M) => M.isDevMode), { setAuthToken: o } = It(), { setShowAIDialog: u, setOnSave: c, setOnClose: h } = X(), {
12809
12827
  handleDragOver: d,
12810
12828
  handleDragEnd: m,
12811
12829
  handleDragStart: C,
12812
12830
  handleDragCancel: g,
12813
12831
  sensors: y
12814
12832
  } = jo();
12815
- ve(() => {
12833
+ be(() => {
12816
12834
  a && c(a), n && h(n);
12817
- }, [a, c, n, h]), ve(() => {
12835
+ }, [a, c, n, h]), be(() => {
12818
12836
  t && t.accessToken && o(t);
12819
- }, [t, o]), ve(() => {
12837
+ }, [t, o]), be(() => {
12820
12838
  var M, E;
12821
12839
  i ? ((M = r.current) == null || M.resize(40), u(!0)) : (u(!1), (E = r.current) == null || E.resize(0));
12822
12840
  }, [i, u]);
@@ -12824,7 +12842,7 @@ function Hd({ authToken: t, onSave: a, onClose: n }) {
12824
12842
  M < 1 ? u(!1) : i || u(!0);
12825
12843
  }
12826
12844
  function N() {
12827
- return /* @__PURE__ */ s(ae, { children: [
12845
+ return /* @__PURE__ */ s(se, { children: [
12828
12846
  /* @__PURE__ */ e(hr, { type: "main" }),
12829
12847
  /* @__PURE__ */ s(
12830
12848
  et,
@@ -12875,7 +12893,7 @@ function Hd({ authToken: t, onSave: a, onClose: n }) {
12875
12893
  );
12876
12894
  }
12877
12895
  return /* @__PURE__ */ e(Dn, { FallbackComponent: tr, children: l ? /* @__PURE__ */ e(
12878
- Tt,
12896
+ Dt,
12879
12897
  {
12880
12898
  sensors: y,
12881
12899
  onDragStart: C,
@@ -12915,7 +12933,7 @@ function Ud() {
12915
12933
  }
12916
12934
  function Yd() {
12917
12935
  const t = T((l) => l.selectedDatabaseName), a = T((l) => l.selectedTableName), n = G((l) => l.dashboard.filters) || [], { columns: r } = Pe(), { assignFilter: i } = Ir();
12918
- return /* @__PURE__ */ e(bt, { className: "flex-1 basis-0 flex-col px-3", children: r == null ? void 0 : r.map((l) => {
12936
+ return /* @__PURE__ */ e(xt, { className: "flex-1 basis-0 flex-col px-3", children: r == null ? void 0 : r.map((l) => {
12919
12937
  const o = n == null ? void 0 : n.find(
12920
12938
  (u) => u.column === qe(l.column_name) && u.table === a && u.database === t
12921
12939
  );
@@ -12952,7 +12970,7 @@ function Kd() {
12952
12970
  onClick: () => t(!1),
12953
12971
  className: "h-7 w-7 p-0",
12954
12972
  variant: "ghost",
12955
- children: /* @__PURE__ */ e(ua, {})
12973
+ children: /* @__PURE__ */ e(ma, {})
12956
12974
  }
12957
12975
  )
12958
12976
  ] }),
@@ -13039,13 +13057,13 @@ function Zd() {
13039
13057
  className: "absolute right-2 top-2 z-10 h-8",
13040
13058
  onClick: () => r(!1),
13041
13059
  children: [
13042
- /* @__PURE__ */ e(be, { className: "mr-2 h-4 w-4" }),
13060
+ /* @__PURE__ */ e(ve, { className: "mr-2 h-4 w-4" }),
13043
13061
  "Close"
13044
13062
  ]
13045
13063
  }
13046
13064
  ),
13047
13065
  /* @__PURE__ */ e(
13048
- vl,
13066
+ bl,
13049
13067
  {
13050
13068
  onChange: (i) => {
13051
13069
  if (i)
@@ -13082,7 +13100,7 @@ function su({
13082
13100
  showFooter: a = !0,
13083
13101
  ...n
13084
13102
  }) {
13085
- return /* @__PURE__ */ e(Dn, { FallbackComponent: tr, children: /* @__PURE__ */ s(bl, { dashboardProps: n, children: [
13103
+ return /* @__PURE__ */ e(Dn, { FallbackComponent: tr, children: /* @__PURE__ */ s(vl, { dashboardProps: n, children: [
13086
13104
  /* @__PURE__ */ e(xl, {}),
13087
13105
  /* @__PURE__ */ s(Nl, { children: [
13088
13106
  /* @__PURE__ */ e(Zd, {}),