react-semaphor 0.0.186 → 0.0.188

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
- import { P as L, b as k, j as e, Q as us, R as xs, U as z, V as $s, W as ps, X as fs, Y as gs, Z as js, _ as R, $ as ae, a0 as Ks, J as Us, O as Ae, a1 as Ia, a2 as qa, a3 as Va, a4 as Ra, a5 as _a, a6 as Ha, a7 as Os, a8 as Re, a9 as $e, aa as We, T as bs, e as Ps, g as ys, ab as Fe, ac as Oe, f as W, ad as Me, ae as Te, af as _e, ag as Le, ah as X, ai as vs, G as r, aj as Ke, ak as Ue, al as Ba, am as Pe, w as Gs, v as Js, t as he, an as $a, r as Ka, N as Qs, s as Ua, ao as Pa, B as Ga, ap as Ws, aq as Ja, L as He, S as Ns, z as Qa, n as Ms, ar as Ts, A as cs, u as es, as as Ce, at as we, au as Ys, av as Xs, aw as Zs, ax as ea, ay as sa, az as Wa, aA as Ya, aB as aa, aC as Xa, aD as Za, aE as et, aF as st, aG as at, aH as ds, aI as tt, aJ as Ve, aK as hs, aL as ze, aM as ms, aN as As, aO as nt, aP as lt, aQ as rt, aR as it, aS as ot, aT as ls, aU as ct, aV as Ls, aW as dt, aX as Es, aY as ht, aZ as mt, a_ as ut, a$ as ta, l as xt, C as pt, E as Ds, d as ft, h as gt, i as jt, o as bt, b0 as yt, m as vt, H as Nt, b1 as Ct, b2 as St, b3 as kt, b4 as rs, b5 as wt, b6 as is, b7 as Is, K as zt, b8 as Cs, b9 as Ft, ba as na, bb as Ot, bc as la, bd as Ye, be as Mt, bf as Ee, bg as _, bh as H, bi as ra, bj as B, bk as qs, bl as Tt, bm as At, bn as Lt, bo as Et, bp as Dt, bq as It, br as qt, bs as Vt, bt as Vs, bu as Rt, bv as _t, bw as Ht, bx as Bt, by as $t, bz as Kt } from "./index-zzQRnCNa.js";
2
- import me, { useState as T, useEffect as K, useMemo as Ut, useRef as Be } from "react";
1
+ import { P as E, b as k, j as e, Q as xs, R as ps, U as z, V as Ps, W as fs, X as gs, Y as js, Z as bs, _ as B, $ as ae, a0 as Us, J as Gs, O as Ee, a1 as qa, a2 as Va, a3 as Ra, a4 as _a, a5 as Ha, a6 as Ba, a7 as As, a8 as _e, a9 as Ke, aa as We, T as ys, e as Js, g as vs, ab as Oe, ac as Me, f as Y, ad as Te, ae as Ae, af as He, ag as Le, ah as X, ai as Ns, G as r, aj as Pe, ak as Ue, al as $a, am as Ge, w as Qs, v as Ws, t as he, an as Ka, r as Pa, N as Ys, s as Ua, ao as Ga, B as Ja, ap as Xs, aq as Qa, L as Be, S as Cs, z as Wa, n as Es, ar as cs, A as ds, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Ya, aA as Xa, aB as na, aC as Za, aD as et, aE as st, aF as at, aG as tt, aH as hs, aI as nt, aJ as Re, aK as ms, aL as Fe, aM as us, aN as Ls, aO as lt, aP as rt, aQ as it, aR as ot, aS as ct, aT as ls, aU as dt, aV as Ds, aW as ht, aX as Is, aY as mt, aZ as ut, a_ as xt, a$ as la, l as pt, C as ft, E as qs, d as gt, h as jt, i as bt, o as yt, b0 as vt, m as Nt, H as Ct, b1 as St, b2 as kt, b3 as wt, b4 as rs, b5 as zt, b6 as is, b7 as Vs, K as Ft, b8 as Ss, b9 as Ot, ba as ra, bb as Ye, bc as ia, bd as Mt, be as Tt, bf as At, bg as Et, bh as Lt, bi as Dt, bj as Se, bk as V, bl as R, bm as ks, bn as _, bo as Rs, bp as It, bq as qt, br as Vt, bs as Rt, bt as _s, bu as _t, bv as Ht, bw as Bt, bx as $t, by as Kt, bz as Pt } from "./index-qjDx7Ig8.js";
2
+ import me, { useState as T, useEffect as K, useMemo as Ut, useRef as $e } from "react";
3
3
  /**
4
4
  * @license lucide-react v0.379.0 - ISC
5
5
  *
6
6
  * This source code is licensed under the ISC license.
7
7
  * See the LICENSE file in the root directory of this source tree.
8
8
  */
9
- const Pt = L("Activity", [
9
+ const Gt = E("Activity", [
10
10
  [
11
11
  "path",
12
12
  {
@@ -21,7 +21,7 @@ const Pt = L("Activity", [
21
21
  * This source code is licensed under the ISC license.
22
22
  * See the LICENSE file in the root directory of this source tree.
23
23
  */
24
- const Gt = L("AreaChart", [
24
+ const Jt = E("AreaChart", [
25
25
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
26
26
  ["path", { d: "M7 12v5h12V8l-5 5-4-4Z", key: "zxz28u" }]
27
27
  ]);
@@ -31,7 +31,7 @@ const Gt = L("AreaChart", [
31
31
  * This source code is licensed under the ISC license.
32
32
  * See the LICENSE file in the root directory of this source tree.
33
33
  */
34
- const Ss = L("BarChart4", [
34
+ const ws = E("BarChart4", [
35
35
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
36
36
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
37
37
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
@@ -43,7 +43,7 @@ const Ss = L("BarChart4", [
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
45
  */
46
- const Jt = L("CircleX", [
46
+ const Qt = E("CircleX", [
47
47
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
48
48
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
49
49
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -54,7 +54,7 @@ const Jt = L("CircleX", [
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
56
  */
57
- const Qt = L("Database", [
57
+ const Wt = E("Database", [
58
58
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
59
59
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
60
60
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -65,7 +65,7 @@ const Qt = L("Database", [
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
67
  */
68
- const Wt = L("Eraser", [
68
+ const Yt = E("Eraser", [
69
69
  [
70
70
  "path",
71
71
  {
@@ -82,7 +82,7 @@ const Wt = L("Eraser", [
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
84
  */
85
- const ia = L("Filter", [
85
+ const oa = E("Filter", [
86
86
  ["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
87
87
  ]);
88
88
  /**
@@ -91,7 +91,7 @@ const ia = L("Filter", [
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
93
93
  */
94
- const oa = L("GanttChart", [
94
+ const ca = E("GanttChart", [
95
95
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
96
96
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
97
97
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -102,7 +102,7 @@ const oa = L("GanttChart", [
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
104
  */
105
- const Yt = L("Glasses", [
105
+ const Xt = E("Glasses", [
106
106
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
107
107
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
108
108
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -115,7 +115,7 @@ const Yt = L("Glasses", [
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- const Xt = L("Hammer", [
118
+ const Zt = E("Hammer", [
119
119
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
120
120
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
121
121
  [
@@ -132,7 +132,7 @@ const Xt = L("Hammer", [
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
134
  */
135
- const Zt = L("Hash", [
135
+ const en = E("Hash", [
136
136
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
137
137
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
138
138
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -144,7 +144,7 @@ const Zt = L("Hash", [
144
144
  * This source code is licensed under the ISC license.
145
145
  * See the LICENSE file in the root directory of this source tree.
146
146
  */
147
- const en = L("Key", [
147
+ const sn = E("Key", [
148
148
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
149
149
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
150
150
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -155,7 +155,7 @@ const en = L("Key", [
155
155
  * This source code is licensed under the ISC license.
156
156
  * See the LICENSE file in the root directory of this source tree.
157
157
  */
158
- const ks = L("LineChart", [
158
+ const zs = E("LineChart", [
159
159
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
160
160
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
161
161
  ]);
@@ -165,7 +165,7 @@ const ks = L("LineChart", [
165
165
  * This source code is licensed under the ISC license.
166
166
  * See the LICENSE file in the root directory of this source tree.
167
167
  */
168
- const sn = L("ListEnd", [
168
+ const an = E("ListEnd", [
169
169
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
170
170
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
171
171
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -178,7 +178,7 @@ const sn = L("ListEnd", [
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
180
  */
181
- const an = L("ListStart", [
181
+ const tn = E("ListStart", [
182
182
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
183
183
  ["path", { d: "M16 18H3", key: "12xzn7" }],
184
184
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -191,7 +191,7 @@ const an = L("ListStart", [
191
191
  * This source code is licensed under the ISC license.
192
192
  * See the LICENSE file in the root directory of this source tree.
193
193
  */
194
- const tn = L("ListX", [
194
+ const nn = E("ListX", [
195
195
  ["path", { d: "M11 12H3", key: "51ecnj" }],
196
196
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
197
197
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -204,7 +204,7 @@ const tn = L("ListX", [
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
206
  */
207
- const nn = L("MessageSquareMore", [
207
+ const ln = E("MessageSquareMore", [
208
208
  ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }],
209
209
  ["path", { d: "M8 10h.01", key: "19clt8" }],
210
210
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -216,7 +216,7 @@ const nn = L("MessageSquareMore", [
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
218
  */
219
- const ln = L("Network", [
219
+ const rn = E("Network", [
220
220
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
221
221
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
222
222
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -229,7 +229,7 @@ const ln = L("Network", [
229
229
  * This source code is licensed under the ISC license.
230
230
  * See the LICENSE file in the root directory of this source tree.
231
231
  */
232
- const ca = L("Pencil", [
232
+ const da = E("Pencil", [
233
233
  ["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
234
234
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
235
235
  ]);
@@ -239,7 +239,7 @@ const ca = L("Pencil", [
239
239
  * This source code is licensed under the ISC license.
240
240
  * See the LICENSE file in the root directory of this source tree.
241
241
  */
242
- const da = L("PieChart", [
242
+ const ha = E("PieChart", [
243
243
  ["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
244
244
  ["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
245
245
  ]);
@@ -249,7 +249,7 @@ const da = L("PieChart", [
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
251
  */
252
- const rn = L("Play", [
252
+ const on = E("Play", [
253
253
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
254
254
  ]);
255
255
  /**
@@ -258,7 +258,7 @@ const rn = L("Play", [
258
258
  * This source code is licensed under the ISC license.
259
259
  * See the LICENSE file in the root directory of this source tree.
260
260
  */
261
- const on = L("Plug2", [
261
+ const cn = E("Plug2", [
262
262
  ["path", { d: "M9 2v6", key: "17ngun" }],
263
263
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
264
264
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -271,7 +271,7 @@ const on = L("Plug2", [
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 cn = L("Save", [
274
+ const dn = E("Save", [
275
275
  [
276
276
  "path",
277
277
  {
@@ -288,7 +288,7 @@ const cn = L("Save", [
288
288
  * This source code is licensed under the ISC license.
289
289
  * See the LICENSE file in the root directory of this source tree.
290
290
  */
291
- const ha = L("ScatterChart", [
291
+ const ma = E("ScatterChart", [
292
292
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
293
293
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
294
294
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -302,7 +302,7 @@ const ha = L("ScatterChart", [
302
302
  * This source code is licensed under the ISC license.
303
303
  * See the LICENSE file in the root directory of this source tree.
304
304
  */
305
- const dn = L("ShieldQuestion", [
305
+ const hn = E("ShieldQuestion", [
306
306
  [
307
307
  "path",
308
308
  {
@@ -319,7 +319,7 @@ const dn = L("ShieldQuestion", [
319
319
  * This source code is licensed under the ISC license.
320
320
  * See the LICENSE file in the root directory of this source tree.
321
321
  */
322
- const hn = L("Sigma", [
322
+ const mn = E("Sigma", [
323
323
  ["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
324
324
  ]);
325
325
  /**
@@ -328,7 +328,7 @@ const hn = L("Sigma", [
328
328
  * This source code is licensed under the ISC license.
329
329
  * See the LICENSE file in the root directory of this source tree.
330
330
  */
331
- const mn = L("SwatchBook", [
331
+ const un = E("SwatchBook", [
332
332
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
333
333
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
334
334
  ["path", { d: "M 7 17h0.01", key: "10821z" }],
@@ -346,7 +346,7 @@ const mn = L("SwatchBook", [
346
346
  * This source code is licensed under the ISC license.
347
347
  * See the LICENSE file in the root directory of this source tree.
348
348
  */
349
- const un = L("Tag", [
349
+ const xn = E("Tag", [
350
350
  [
351
351
  "path",
352
352
  {
@@ -362,7 +362,7 @@ const un = L("Tag", [
362
362
  * This source code is licensed under the ISC license.
363
363
  * See the LICENSE file in the root directory of this source tree.
364
364
  */
365
- const xn = L("ToggleLeft", [
365
+ const pn = E("ToggleLeft", [
366
366
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
367
367
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
368
368
  ]);
@@ -372,7 +372,7 @@ const xn = L("ToggleLeft", [
372
372
  * This source code is licensed under the ISC license.
373
373
  * See the LICENSE file in the root directory of this source tree.
374
374
  */
375
- const pn = L("Type", [
375
+ const fn = E("Type", [
376
376
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
377
377
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
378
378
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -383,14 +383,14 @@ const pn = L("Type", [
383
383
  * This source code is licensed under the ISC license.
384
384
  * See the LICENSE file in the root directory of this source tree.
385
385
  */
386
- const fn = L("User", [
386
+ const gn = E("User", [
387
387
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
388
388
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
389
389
  ]);
390
- function gn() {
390
+ function jn() {
391
391
  const [s, n] = T(""), [a, t] = T(!1), [i, o] = T(!1), l = k((h) => h.dashboard);
392
392
  function c() {
393
- const h = Us(l), g = Ae(l.id), m = JSON.parse(localStorage.getItem(g) || "[]");
393
+ const h = Gs(l), g = Ee(l.id), m = JSON.parse(localStorage.getItem(g) || "[]");
394
394
  if (m.some(
395
395
  (N) => N.name === s
396
396
  )) {
@@ -402,26 +402,26 @@ function gn() {
402
402
  template: h
403
403
  }), localStorage.setItem(g, JSON.stringify(m)), o(!1);
404
404
  }
405
- return /* @__PURE__ */ e.jsxs(us, { open: i, onOpenChange: o, children: [
406
- /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
405
+ return /* @__PURE__ */ e.jsxs(xs, { open: i, onOpenChange: o, children: [
406
+ /* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
407
407
  z,
408
408
  {
409
409
  variant: "outline",
410
410
  className: "h-7 p-2",
411
411
  size: "sm",
412
412
  children: [
413
- /* @__PURE__ */ e.jsx($s, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
413
+ /* @__PURE__ */ e.jsx(Ps, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
414
414
  "Add Lens"
415
415
  ]
416
416
  }
417
417
  ) }),
418
- /* @__PURE__ */ e.jsxs(ps, { className: "sm:max-w-[425px]", children: [
419
- /* @__PURE__ */ e.jsxs(fs, { children: [
420
- /* @__PURE__ */ e.jsx(gs, { children: "Add a Lens" }),
421
- /* @__PURE__ */ e.jsx(js, { children: "Lenses are private by default and are only visible to you." })
418
+ /* @__PURE__ */ e.jsxs(fs, { className: "sm:max-w-[425px]", children: [
419
+ /* @__PURE__ */ e.jsxs(gs, { children: [
420
+ /* @__PURE__ */ e.jsx(js, { children: "Add a Lens" }),
421
+ /* @__PURE__ */ e.jsx(bs, { children: "Lenses are private by default and are only visible to you." })
422
422
  ] }),
423
423
  /* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
424
- /* @__PURE__ */ e.jsx(R, { className: "text-right", children: "Name" }),
424
+ /* @__PURE__ */ e.jsx(B, { className: "text-right", children: "Name" }),
425
425
  /* @__PURE__ */ e.jsx(
426
426
  ae,
427
427
  {
@@ -435,7 +435,7 @@ function gn() {
435
435
  )
436
436
  ] }) }),
437
437
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
438
- /* @__PURE__ */ e.jsx(Ks, { children: /* @__PURE__ */ e.jsx(
438
+ /* @__PURE__ */ e.jsx(Us, { children: /* @__PURE__ */ e.jsx(
439
439
  z,
440
440
  {
441
441
  variant: "outline",
@@ -448,14 +448,14 @@ function gn() {
448
448
  ] })
449
449
  ] });
450
450
  }
451
- function jn() {
451
+ function bn() {
452
452
  const [s, n] = T(!1), [a, t] = T(""), i = k((d) => d.dashboard), o = k((d) => d.bookmarkKey), [l, c] = T([]), h = k((d) => d.actions.setDashboard), g = k(
453
453
  (d) => d.actions.setFilterValues
454
454
  ), m = k(
455
455
  (d) => d.actions.setBookmarkKey
456
456
  );
457
457
  K(() => {
458
- const d = Ae(i.id), x = JSON.parse(localStorage.getItem(d) || "[]");
458
+ const d = Ee(i.id), x = JSON.parse(localStorage.getItem(d) || "[]");
459
459
  c(x);
460
460
  const f = x.find(
461
461
  (w) => w.default
@@ -469,25 +469,25 @@ function jn() {
469
469
  f && (h(f), g(x.filterValues || []), m(d === "Original" ? "" : d)), t(d);
470
470
  }
471
471
  function N(d) {
472
- const x = Ae(i.id), w = JSON.parse(localStorage.getItem(x) || "[]").filter(
472
+ const x = Ee(i.id), w = JSON.parse(localStorage.getItem(x) || "[]").filter(
473
473
  (b) => b.name !== d
474
474
  );
475
475
  localStorage.setItem(x, JSON.stringify(w)), c(w);
476
476
  }
477
- return /* @__PURE__ */ e.jsxs(Ia, { open: s, onOpenChange: n, children: [
478
- /* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Yt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
479
- /* @__PURE__ */ e.jsxs(Va, { className: "w-56", children: [
480
- /* @__PURE__ */ e.jsx(Ra, { children: "Lenses" }),
481
- /* @__PURE__ */ e.jsx(_a, {}),
477
+ return /* @__PURE__ */ e.jsxs(qa, { open: s, onOpenChange: n, children: [
478
+ /* @__PURE__ */ e.jsx(Va, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
479
+ /* @__PURE__ */ e.jsxs(Ra, { className: "w-56", children: [
480
+ /* @__PURE__ */ e.jsx(_a, { children: "Lenses" }),
481
+ /* @__PURE__ */ e.jsx(Ha, {}),
482
482
  /* @__PURE__ */ e.jsxs(
483
- Ha,
483
+ Ba,
484
484
  {
485
485
  value: a,
486
486
  onValueChange: u,
487
487
  children: [
488
- /* @__PURE__ */ e.jsx(Os, { value: "Original", children: "Original" }),
488
+ /* @__PURE__ */ e.jsx(As, { value: "Original", children: "Original" }),
489
489
  l.filter((d) => d.name != "Original").map((d, x) => /* @__PURE__ */ e.jsxs(
490
- Os,
490
+ As,
491
491
  {
492
492
  className: "xbg-red-100 flex justify-between",
493
493
  value: d.name,
@@ -495,7 +495,7 @@ function jn() {
495
495
  children: [
496
496
  /* @__PURE__ */ e.jsx("p", { children: d.name }),
497
497
  /* @__PURE__ */ e.jsx(
498
- Re,
498
+ _e,
499
499
  {
500
500
  onClick: (f) => {
501
501
  f.preventDefault(), N(d.name);
@@ -514,14 +514,14 @@ function jn() {
514
514
  ] })
515
515
  ] });
516
516
  }
517
- function bn() {
517
+ function yn() {
518
518
  const [s, n] = T(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
519
519
  K(() => {
520
520
  if (!t) {
521
521
  n(!1);
522
522
  return;
523
523
  }
524
- const o = Ae(a.id), c = JSON.parse(
524
+ const o = Ee(a.id), c = JSON.parse(
525
525
  localStorage.getItem(o) || "[]"
526
526
  ).find(
527
527
  (h) => h.name === t
@@ -531,14 +531,14 @@ function bn() {
531
531
  function i(o) {
532
532
  if (n(o), !t)
533
533
  return;
534
- const l = Ae(a.id), h = JSON.parse(
534
+ const l = Ee(a.id), h = JSON.parse(
535
535
  localStorage.getItem(l) || "[]"
536
536
  ).map((g) => (g.name === t ? g.default = o : g.default = !1, g));
537
537
  console.log(h), localStorage.setItem(l, JSON.stringify(h));
538
538
  }
539
539
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
540
540
  /* @__PURE__ */ e.jsx(
541
- $e,
541
+ Ke,
542
542
  {
543
543
  checked: s,
544
544
  onCheckedChange: i,
@@ -555,7 +555,7 @@ function bn() {
555
555
  )
556
556
  ] });
557
557
  }
558
- function yn() {
558
+ function vn() {
559
559
  const s = k((b) => b.bookmarkKey), n = k((b) => b.dashboard);
560
560
  k((b) => b.selectedSheetId);
561
561
  const a = k(
@@ -586,19 +586,19 @@ function yn() {
586
586
  type: "bar",
587
587
  sql: "select COUNT(*) from YOUR_TABLE",
588
588
  data: []
589
- }, E = {
589
+ }, L = {
590
590
  id: We(),
591
591
  cards: [b],
592
592
  activeCardId: b.id
593
593
  };
594
- h(d.id, E), g(E.id);
594
+ h(d.id, L), g(L.id);
595
595
  }, f = () => {
596
596
  u(!0);
597
597
  };
598
598
  function w() {
599
599
  if (!s || s === "")
600
600
  return;
601
- const b = Us(n), E = Ae(n.id), C = JSON.parse(localStorage.getItem(E) || "[]"), O = C.findIndex(
601
+ const b = Gs(n), L = Ee(n.id), C = JSON.parse(localStorage.getItem(L) || "[]"), O = C.findIndex(
602
602
  (j) => j.name === s
603
603
  );
604
604
  O !== -1 ? C[O] = {
@@ -610,7 +610,7 @@ function yn() {
610
610
  name: s,
611
611
  template: b,
612
612
  filterValues: t
613
- }), localStorage.setItem(E, JSON.stringify(C)), l == null || l(b);
613
+ }), localStorage.setItem(L, JSON.stringify(C)), l == null || l(b);
614
614
  }
615
615
  return i ? null : /* @__PURE__ */ e.jsxs(
616
616
  "div",
@@ -619,15 +619,15 @@ function yn() {
619
619
  role: "dashboard-controls",
620
620
  children: [
621
621
  !i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
622
- /* @__PURE__ */ e.jsx(R, { children: s }),
622
+ /* @__PURE__ */ e.jsx(B, { children: s }),
623
623
  !!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
624
624
  /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
625
- /* @__PURE__ */ e.jsx(bn, {})
625
+ /* @__PURE__ */ e.jsx(yn, {})
626
626
  ] })
627
627
  ] }),
628
628
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
629
- a && !i && /* @__PURE__ */ e.jsx(gn, {}),
630
- !i && /* @__PURE__ */ e.jsx(jn, {}),
629
+ a && !i && /* @__PURE__ */ e.jsx(jn, {}),
630
+ !i && /* @__PURE__ */ e.jsx(bn, {}),
631
631
  a && !i && /* @__PURE__ */ e.jsxs(
632
632
  z,
633
633
  {
@@ -637,7 +637,7 @@ function yn() {
637
637
  disabled: !a,
638
638
  onClick: x,
639
639
  children: [
640
- /* @__PURE__ */ e.jsx($s, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
640
+ /* @__PURE__ */ e.jsx(Ps, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
641
641
  "Add Frame"
642
642
  ]
643
643
  }
@@ -649,7 +649,7 @@ function yn() {
649
649
  className: "h-7 p-2",
650
650
  onClick: f,
651
651
  size: "sm",
652
- children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
652
+ children: /* @__PURE__ */ e.jsx(da, { className: "h-4 w-4", strokeWidth: 1.5 })
653
653
  }
654
654
  ),
655
655
  a && !i && /* @__PURE__ */ e.jsx(
@@ -662,7 +662,7 @@ function yn() {
662
662
  u(!1), N(!1);
663
663
  },
664
664
  size: "sm",
665
- children: /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4", strokeWidth: 1.5 })
665
+ children: /* @__PURE__ */ e.jsx(_e, { className: "h-4 w-4", strokeWidth: 1.5 })
666
666
  }
667
667
  ),
668
668
  a && !i && /* @__PURE__ */ e.jsx(
@@ -672,7 +672,7 @@ function yn() {
672
672
  variant: "outline",
673
673
  onClick: w,
674
674
  size: "sm",
675
- children: /* @__PURE__ */ e.jsx(cn, { className: "h-4 w-4", strokeWidth: 1.5 })
675
+ children: /* @__PURE__ */ e.jsx(dn, { className: "h-4 w-4", strokeWidth: 1.5 })
676
676
  }
677
677
  ),
678
678
  !o && !i && a && /* @__PURE__ */ e.jsx(
@@ -682,7 +682,7 @@ function yn() {
682
682
  variant: "outline",
683
683
  onClick: () => c(!0),
684
684
  size: "sm",
685
- children: /* @__PURE__ */ e.jsx(ia, { className: "h-4 w-4", strokeWidth: 1.5 })
685
+ children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
686
686
  }
687
687
  ),
688
688
  !i && a && !1,
@@ -707,36 +707,36 @@ function Qe({
707
707
  const m = t ? "Loading..." : i ? "Error" : a;
708
708
  function u() {
709
709
  if (s === "Connection")
710
- return /* @__PURE__ */ e.jsx(on, { className: "size-4 rotate-90" });
710
+ return /* @__PURE__ */ e.jsx(cn, { className: "size-4 rotate-90" });
711
711
  if (s === "Database")
712
- return /* @__PURE__ */ e.jsx(Qt, { className: "size-4" });
712
+ return /* @__PURE__ */ e.jsx(Wt, { className: "size-4" });
713
713
  if (s === "Schema")
714
- return /* @__PURE__ */ e.jsx(ln, { className: "size-4" });
714
+ return /* @__PURE__ */ e.jsx(rn, { className: "size-4" });
715
715
  if (s === "Table")
716
- return /* @__PURE__ */ e.jsx(vs, { className: "size-4" });
716
+ return /* @__PURE__ */ e.jsx(Ns, { className: "size-4" });
717
717
  }
718
718
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
719
- h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(bs, { children: [
720
- /* @__PURE__ */ e.jsx(Ps, { children: u() }),
721
- /* @__PURE__ */ e.jsx(ys, { className: "text-xs", align: "start", children: o })
719
+ h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(ys, { children: [
720
+ /* @__PURE__ */ e.jsx(Js, { children: u() }),
721
+ /* @__PURE__ */ e.jsx(vs, { className: "text-xs", align: "start", children: o })
722
722
  ] }) : u() }),
723
- /* @__PURE__ */ e.jsxs(Fe, { disabled: g, value: m, onValueChange: l, children: [
723
+ /* @__PURE__ */ e.jsxs(Oe, { disabled: g, value: m, onValueChange: l, children: [
724
724
  /* @__PURE__ */ e.jsx(
725
- Oe,
725
+ Me,
726
726
  {
727
- className: W(
727
+ className: Y(
728
728
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
729
729
  c
730
730
  ),
731
731
  children: /* @__PURE__ */ e.jsx(
732
- Me,
732
+ Te,
733
733
  {
734
734
  placeholder: t ? "Loading..." : i ? "Error" : `Select ${s}`
735
735
  }
736
736
  )
737
737
  }
738
738
  ),
739
- /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
739
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
740
740
  t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
741
741
  /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((N, d) => /* @__PURE__ */ e.jsx(X, { value: N.id, children: N.name }, d)) }),
742
742
  (t || i) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
@@ -744,24 +744,24 @@ function Qe({
744
744
  ] })
745
745
  ] });
746
746
  }
747
- function vn({ column: s }) {
747
+ function Nn({ column: s }) {
748
748
  const [n, a] = T(!1), t = r((m) => m.selectedTableName), i = r(
749
749
  (m) => m.selectedSchemaName
750
750
  ), o = r((m) => m.sqlGen), l = r((m) => m.actions.setSqlGen), c = r((m) => m.actions.setCardSql), h = r((m) => m.actions.setRunSql);
751
751
  function g(m, u) {
752
- const N = Gs(m, o, u);
752
+ const N = Qs(m, o, u);
753
753
  l(N);
754
- const d = Js(
754
+ const d = Ws(
755
755
  N,
756
756
  he(i || ""),
757
757
  he(t)
758
758
  );
759
759
  d && (c(d), h(!0)), a(!1);
760
760
  }
761
- return /* @__PURE__ */ e.jsxs(Ke, { open: n, onOpenChange: a, children: [
762
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ba, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
761
+ return /* @__PURE__ */ e.jsxs(Pe, { open: n, onOpenChange: a, children: [
762
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx($a, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
763
763
  /* @__PURE__ */ e.jsx(
764
- Pe,
764
+ Ge,
765
765
  {
766
766
  align: "center",
767
767
  className: "w-18 rounded-md p-0 shadow-none",
@@ -811,19 +811,19 @@ function vn({ column: s }) {
811
811
  )
812
812
  ] });
813
813
  }
814
- function ma({ column: s }) {
815
- return /* @__PURE__ */ e.jsxs(bs, { children: [
816
- /* @__PURE__ */ e.jsx($a, { asChild: !0, children: Ka.includes(s.data_type.toLowerCase()) ? (
814
+ function ua({ column: s }) {
815
+ return /* @__PURE__ */ e.jsxs(ys, { children: [
816
+ /* @__PURE__ */ e.jsx(Ka, { asChild: !0, children: Pa.includes(s.data_type.toLowerCase()) ? (
817
817
  // <span className=" font-thin">T</span>
818
- /* @__PURE__ */ e.jsx(pn, { className: "size-3" })
819
- ) : Qs.includes(s.data_type.toLowerCase()) ? (
818
+ /* @__PURE__ */ e.jsx(fn, { className: "size-3" })
819
+ ) : Ys.includes(s.data_type.toLowerCase()) ? (
820
820
  //
821
- /* @__PURE__ */ e.jsx(Zt, { className: "size-3" })
822
- ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Pa, { className: "size-3" }) : Ga.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(xn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(dn, { className: "size-3" }) }),
823
- /* @__PURE__ */ e.jsx(ys, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
821
+ /* @__PURE__ */ e.jsx(en, { className: "size-3" })
822
+ ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ga, { className: "size-3" }) : Ja.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(pn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(hn, { className: "size-3" }) }),
823
+ /* @__PURE__ */ e.jsx(vs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
824
824
  ] });
825
825
  }
826
- function Nn({
826
+ function Cn({
827
827
  schemaName: s,
828
828
  tableName: n,
829
829
  columns: a,
@@ -839,11 +839,11 @@ function Nn({
839
839
  (j) => j.dashboard.aiScopeTables
840
840
  ), { setAIScopeTables: m } = k((j) => j.actions), u = r((j) => j.actions.setRunSql), N = r((j) => j.actions.setSqlGen), d = r(
841
841
  (j) => j.actions.setIsShowingVisual
842
- ), x = r((j) => j.actions.setCardSql), { connectionType: f } = ua();
842
+ ), x = r((j) => j.actions.setCardSql), { connectionType: f } = xa();
843
843
  function w(j) {
844
- const F = Gs(j, i);
844
+ const F = Qs(j, i);
845
845
  N(F);
846
- const A = Js(F, he(s), he(n));
846
+ const A = Ws(F, he(s), he(n));
847
847
  A && (x(A), u(!0));
848
848
  }
849
849
  function b() {
@@ -851,7 +851,7 @@ function Nn({
851
851
  (j) => j.connectinonId === o && j.tableName === h
852
852
  )) !== void 0;
853
853
  }
854
- function E(j) {
854
+ function L(j) {
855
855
  if (j === !0 && h && o) {
856
856
  const F = {
857
857
  connectinonId: o,
@@ -860,11 +860,11 @@ function Nn({
860
860
  schemaName: c,
861
861
  tableName: h
862
862
  }, q = [...g || [], F].filter(
863
- (Y, $, U) => U.findIndex(
864
- (D) => D.connectinonId === Y.connectinonId && D.tableName === Y.tableName
863
+ (P, $, G) => G.findIndex(
864
+ (D) => D.connectinonId === P.connectinonId && D.tableName === P.tableName
865
865
  ) === $
866
866
  );
867
- m(q), Ts.success(`Added '${h}' to AI Scope`, {
867
+ m(q), cs.success(`Added '${h}' to AI Scope`, {
868
868
  position: "top-right",
869
869
  duration: 2500,
870
870
  richColors: !0
@@ -873,7 +873,7 @@ function Nn({
873
873
  const F = (g || []).filter(
874
874
  (A) => A.connectinonId !== o && A.tableName !== h
875
875
  );
876
- m(F), Ts(`Removed '${h}' from AI Scope`, {
876
+ m(F), cs(`Removed '${h}' from AI Scope`, {
877
877
  position: "top-right",
878
878
  duration: 2e3,
879
879
  richColors: !0
@@ -881,27 +881,29 @@ function Nn({
881
881
  }
882
882
  }
883
883
  function C() {
884
- let F = cs(s, n);
885
- ((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT * FROM ${F} LIMIT 10`), u(!0);
884
+ let F = ds(s, n);
885
+ ((P) => P.charAt(0) === P.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1);
886
+ const q = f === "MSSQL" ? `SELECT top 10 * FROM ${F}` : `SELECT * FROM ${F} LIMIT 10`;
887
+ x(q), u(!0);
886
888
  }
887
889
  function O() {
888
- let F = cs(s, n);
889
- ((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT COUNT(*) FROM ${F}`), u(!0);
890
+ let F = ds(s, n);
891
+ ((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT COUNT(*) as count FROM ${F}`), u(!0);
890
892
  }
891
893
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
892
894
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
893
895
  /* @__PURE__ */ e.jsx(
894
- Ws,
896
+ Xs,
895
897
  {
896
898
  title: `${b() ? "Remove from" : "Add to"} AI Scope`,
897
899
  pressed: b(),
898
- onPressedChange: E,
900
+ onPressedChange: L,
899
901
  variant: "outline",
900
902
  className: "h-9 px-2",
901
903
  children: /* @__PURE__ */ e.jsx(
902
- Ja,
904
+ Qa,
903
905
  {
904
- className: W("size-4", {
906
+ className: Y("size-4", {
905
907
  "text-primary": b(),
906
908
  "text-muted-foreground": !b()
907
909
  })
@@ -918,7 +920,7 @@ function Nn({
918
920
  variant: "secondary",
919
921
  className: "flex",
920
922
  children: [
921
- t !== "Success" ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(mn, { className: "mr-2 size-4" }),
923
+ t !== "Success" ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(un, { className: "mr-2 size-4" }),
922
924
  "Top 10"
923
925
  ]
924
926
  }
@@ -932,14 +934,14 @@ function Nn({
932
934
  variant: "secondary",
933
935
  className: "flex",
934
936
  children: [
935
- t !== "Success" ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(hn, { className: "mr-2 size-4" }),
937
+ t !== "Success" ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(mn, { className: "mr-2 size-4" }),
936
938
  "Count"
937
939
  ]
938
940
  }
939
941
  )
940
942
  ] }),
941
943
  /* @__PURE__ */ e.jsxs(
942
- Ns,
944
+ Cs,
943
945
  {
944
946
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
945
947
  children: [
@@ -947,38 +949,38 @@ function Nn({
947
949
  "div",
948
950
  {
949
951
  onClick: () => w(j),
950
- className: W(
952
+ className: Y(
951
953
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
952
954
  {
953
- "bg-muted": Qa(j, i)
955
+ "bg-muted": Wa(j, i)
954
956
  }
955
957
  ),
956
958
  children: [
957
959
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
958
- /* @__PURE__ */ e.jsx(ma, { column: j }),
960
+ /* @__PURE__ */ e.jsx(ua, { column: j }),
959
961
  /* @__PURE__ */ e.jsx("span", { children: j.column_name })
960
962
  ] }),
961
- Qs.includes(j.data_type) && /* @__PURE__ */ e.jsx(
963
+ Ys.includes(j.data_type) && /* @__PURE__ */ e.jsx(
962
964
  "div",
963
965
  {
964
966
  onClick: (F) => F.stopPropagation(),
965
967
  className: "flex items-center justify-end",
966
- children: /* @__PURE__ */ e.jsx(vn, { column: j })
968
+ children: /* @__PURE__ */ e.jsx(Nn, { column: j })
967
969
  }
968
970
  )
969
971
  ]
970
972
  },
971
973
  j.column_name
972
974
  )),
973
- /* @__PURE__ */ e.jsx(Ms, { orientation: "vertical" }),
974
- /* @__PURE__ */ e.jsx(Ms, { orientation: "horizontal" })
975
+ /* @__PURE__ */ e.jsx(Es, { orientation: "vertical" }),
976
+ /* @__PURE__ */ e.jsx(Es, { orientation: "horizontal" })
975
977
  ]
976
978
  }
977
979
  )
978
980
  ] });
979
981
  }
980
- function ua(s, n) {
981
- var ss, ve, Je, Ie;
982
+ function xa(s, n) {
983
+ var ss, ve, Je, qe;
982
984
  let a = Ut(() => [], []);
983
985
  const t = es().authToken || s, i = r(
984
986
  (S) => S.selectedConnectionId
@@ -1008,11 +1010,11 @@ function ua(s, n) {
1008
1010
  }
1009
1011
  const {
1010
1012
  data: b,
1011
- isLoading: E,
1013
+ isLoading: L,
1012
1014
  isError: C
1013
1015
  } = Ce({
1014
1016
  queryKey: ["connections"],
1015
- queryFn: () => we(
1017
+ queryFn: () => ze(
1016
1018
  "https://semaphor.cloud/api/v1/connections",
1017
1019
  (t == null ? void 0 : t.accessToken) || ""
1018
1020
  ),
@@ -1023,12 +1025,12 @@ function ua(s, n) {
1023
1025
  ), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1024
1026
  data: A,
1025
1027
  isLoading: q,
1026
- isFetching: Y,
1028
+ isFetching: P,
1027
1029
  isError: $,
1028
- refetch: U
1030
+ refetch: G
1029
1031
  } = Ce({
1030
1032
  queryKey: ["databases", i],
1031
- queryFn: () => we(
1033
+ queryFn: () => ze(
1032
1034
  "https://semaphor.cloud/api/v1/databases",
1033
1035
  (t == null ? void 0 : t.accessToken) || "",
1034
1036
  {
@@ -1040,12 +1042,12 @@ function ua(s, n) {
1040
1042
  }), {
1041
1043
  data: D,
1042
1044
  isLoading: te,
1043
- isFetching: J,
1045
+ isFetching: Q,
1044
1046
  isError: ee,
1045
1047
  refetch: Z
1046
1048
  } = Ce({
1047
1049
  queryKey: ["schemas", i, o],
1048
- queryFn: () => we(
1050
+ queryFn: () => ze(
1049
1051
  "https://semaphor.cloud/api/v1/schemas",
1050
1052
  (t == null ? void 0 : t.accessToken) || "",
1051
1053
  {
@@ -1056,7 +1058,7 @@ function ua(s, n) {
1056
1058
  enabled: !!i && !!o && !F && o !== "NA"
1057
1059
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1058
1060
  }), {
1059
- data: P,
1061
+ data: J,
1060
1062
  isLoading: I,
1061
1063
  isFetching: y,
1062
1064
  isError: v,
@@ -1068,7 +1070,7 @@ function ua(s, n) {
1068
1070
  o,
1069
1071
  l
1070
1072
  ],
1071
- queryFn: () => we(
1073
+ queryFn: () => ze(
1072
1074
  "https://semaphor.cloud/api/v1/tables",
1073
1075
  (t == null ? void 0 : t.accessToken) || "",
1074
1076
  {
@@ -1079,7 +1081,7 @@ function ua(s, n) {
1079
1081
  ),
1080
1082
  enabled: x(j)
1081
1083
  }), {
1082
- data: V,
1084
+ data: H,
1083
1085
  isLoading: ue,
1084
1086
  isFetching: se,
1085
1087
  isError: ge
@@ -1091,7 +1093,7 @@ function ua(s, n) {
1091
1093
  l,
1092
1094
  c
1093
1095
  ],
1094
- queryFn: () => we(
1096
+ queryFn: () => ze(
1095
1097
  "https://semaphor.cloud/api/v1/columns",
1096
1098
  (t == null ? void 0 : t.accessToken) || "",
1097
1099
  {
@@ -1112,7 +1114,7 @@ function ua(s, n) {
1112
1114
  });
1113
1115
  K(() => {
1114
1116
  h(a);
1115
- }, [V, h, a]), K(() => {
1117
+ }, [H, h, a]), K(() => {
1116
1118
  }, [
1117
1119
  F,
1118
1120
  d,
@@ -1125,13 +1127,13 @@ function ua(s, n) {
1125
1127
  function xe(S) {
1126
1128
  u(S), N("");
1127
1129
  }
1128
- function G(S) {
1130
+ function U(S) {
1129
1131
  m(S), u(""), N("");
1130
1132
  }
1131
1133
  function ne(S) {
1132
1134
  g(S);
1133
1135
  }
1134
- A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, V && ((Ie = V == null ? void 0 : V.columns) == null ? void 0 : Ie.length) > 0 && (a = V.columns.map((S) => ({
1136
+ A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((S) => ({
1135
1137
  ...S,
1136
1138
  data_type: S.data_type.toLowerCase()
1137
1139
  }))), $ && (a = []), (ge || C) && (a = []);
@@ -1147,21 +1149,21 @@ function ua(s, n) {
1147
1149
  })), re = D == null ? void 0 : D.schemas.map((S) => ({
1148
1150
  id: S.schema_name,
1149
1151
  name: S.schema_name
1150
- })), De = P == null ? void 0 : P.tables.map((S) => ({
1152
+ })), Ie = J == null ? void 0 : J.tables.map((S) => ({
1151
1153
  id: S.table_name,
1152
1154
  name: S.table_name
1153
1155
  }));
1154
1156
  return {
1155
1157
  connectionItems: le,
1156
- isConnectionsLoading: E,
1158
+ isConnectionsLoading: L,
1157
1159
  isConnectionsError: C,
1158
1160
  databaseItems: ye,
1159
- isDatabasesLoadingOrFetching: q || Y,
1161
+ isDatabasesLoadingOrFetching: q || P,
1160
1162
  isDatabaseError: $,
1161
1163
  schemaItems: re,
1162
- isSchemaLoadingOrFetching: te || J,
1164
+ isSchemaLoadingOrFetching: te || Q,
1163
1165
  isSchemaError: ee,
1164
- tableItems: De,
1166
+ tableItems: Ie,
1165
1167
  isTableLoadingOrFetching: I || y,
1166
1168
  isTableError: v,
1167
1169
  columns: a,
@@ -1172,14 +1174,14 @@ function ua(s, n) {
1172
1174
  tableName: je,
1173
1175
  schemaName: be,
1174
1176
  handleConnectionChange: ne,
1175
- handleDatabaseChange: G,
1177
+ handleDatabaseChange: U,
1176
1178
  handleSchemaChange: xe
1177
1179
  };
1178
1180
  }
1179
- function xa({
1181
+ function pa({
1180
1182
  ColumnsComponent: s
1181
1183
  }) {
1182
- var P;
1184
+ var J;
1183
1185
  const n = r(
1184
1186
  (I) => I.selectedConnectionId
1185
1187
  ), a = r(
@@ -1201,32 +1203,32 @@ function xa({
1201
1203
  isSchemaLoadingOrFetching: f,
1202
1204
  isSchemaError: w,
1203
1205
  isColumnsError: b,
1204
- isColumnsLoadingOrFetching: E,
1206
+ isColumnsLoadingOrFetching: L,
1205
1207
  isTableLoadingOrFetching: C,
1206
1208
  isTableError: O,
1207
1209
  connectionType: j,
1208
1210
  isNonDbConnection: F,
1209
1211
  handleConnectionChange: A,
1210
1212
  handleDatabaseChange: q,
1211
- handleSchemaChange: Y,
1213
+ handleSchemaChange: P,
1212
1214
  tableName: $,
1213
- schemaName: U
1214
- } = ua();
1215
+ schemaName: G
1216
+ } = xa();
1215
1217
  function D() {
1216
- return s ? s(U, $, m) : /* @__PURE__ */ e.jsx(
1217
- Nn,
1218
+ return s ? s(G, $, m) : /* @__PURE__ */ e.jsx(
1219
+ Cn,
1218
1220
  {
1219
- schemaName: U,
1221
+ schemaName: G,
1220
1222
  tableName: $,
1221
1223
  columns: m,
1222
- status: E ? "Loading..." : b ? "Error" : "Success"
1224
+ status: L ? "Loading..." : b ? "Error" : "Success"
1223
1225
  }
1224
1226
  );
1225
1227
  }
1226
1228
  function te() {
1227
1229
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1228
1230
  }
1229
- function J() {
1231
+ function Q() {
1230
1232
  return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1231
1233
  Qe,
1232
1234
  {
@@ -1243,7 +1245,7 @@ function xa({
1243
1245
  return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1244
1246
  Qe,
1245
1247
  {
1246
- onChange: Y,
1248
+ onChange: P,
1247
1249
  isError: w,
1248
1250
  isLoading: f,
1249
1251
  items: c,
@@ -1276,12 +1278,12 @@ function xa({
1276
1278
  onChange: A,
1277
1279
  isLoading: u,
1278
1280
  isError: N,
1279
- connectionTooltip: ((P = l == null ? void 0 : l.find(
1281
+ connectionTooltip: ((J = l == null ? void 0 : l.find(
1280
1282
  (I) => I.id === n
1281
- )) == null ? void 0 : P.type) || ""
1283
+ )) == null ? void 0 : J.type) || ""
1282
1284
  }
1283
1285
  ),
1284
- J(),
1286
+ Q(),
1285
1287
  ee(),
1286
1288
  Z()
1287
1289
  ] }),
@@ -1294,14 +1296,14 @@ function xa({
1294
1296
  variant: "secondary",
1295
1297
  className: "w-full",
1296
1298
  children: [
1297
- /* @__PURE__ */ e.jsx(nn, { className: "mr-2 size-4" }),
1299
+ /* @__PURE__ */ e.jsx(ln, { className: "mr-2 size-4" }),
1298
1300
  "Help"
1299
1301
  ]
1300
1302
  }
1301
1303
  ) })
1302
1304
  ] });
1303
1305
  }
1304
- function Cn(s) {
1306
+ function Sn(s) {
1305
1307
  const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
1306
1308
  let o = s.length;
1307
1309
  if (i !== -1 && (o = i), t !== -1 && t < o && (o = t), n !== -1) {
@@ -1317,15 +1319,15 @@ function Cn(s) {
1317
1319
  return `${l} {{ filters | where }} ${c}`;
1318
1320
  }
1319
1321
  }
1320
- function Sn({
1322
+ function kn({
1321
1323
  error: s,
1322
1324
  setShowAIDialog: n,
1323
1325
  setUserInputforAI: a,
1324
1326
  setTriggerAIRun: t
1325
1327
  }) {
1326
- return /* @__PURE__ */ e.jsxs(Ys, { openDelay: 0, children: [
1327
- /* @__PURE__ */ e.jsx(Xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Jt, { className: "h-4 w-4 text-red-500" }) }) }),
1328
- /* @__PURE__ */ e.jsx(Zs, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
1328
+ return /* @__PURE__ */ e.jsxs(Zs, { openDelay: 0, children: [
1329
+ /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Qt, { className: "h-4 w-4 text-red-500" }) }) }),
1330
+ /* @__PURE__ */ e.jsx(sa, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
1329
1331
  /* @__PURE__ */ e.jsxs(
1330
1332
  z,
1331
1333
  {
@@ -1335,36 +1337,36 @@ function Sn({
1335
1337
  size: "sm",
1336
1338
  variant: "outline",
1337
1339
  children: [
1338
- /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4 mr-2" }),
1340
+ /* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4 mr-2" }),
1339
1341
  "Fix It"
1340
1342
  ]
1341
1343
  }
1342
1344
  ),
1343
- /* @__PURE__ */ e.jsx(Ns, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
1345
+ /* @__PURE__ */ e.jsx(Cs, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
1344
1346
  ] }) }) })
1345
1347
  ] });
1346
1348
  }
1347
- function kn({
1349
+ function wn({
1348
1350
  text: s,
1349
1351
  onCheckedChange: n,
1350
1352
  checked: a
1351
1353
  }) {
1352
1354
  return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
1353
- /* @__PURE__ */ e.jsx($e, { checked: a, onCheckedChange: n }),
1355
+ /* @__PURE__ */ e.jsx(Ke, { checked: a, onCheckedChange: n }),
1354
1356
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1355
1357
  ] });
1356
1358
  }
1357
- function wn() {
1358
- const { authToken: s } = es(), n = Be(null), a = r((c) => c.applyFilters), [t, i] = T(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
1359
+ function zn() {
1360
+ const { authToken: s } = es(), n = $e(null), a = r((c) => c.applyFilters), [t, i] = T(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
1359
1361
  return /* @__PURE__ */ e.jsxs(
1360
- Ys,
1362
+ Zs,
1361
1363
  {
1362
1364
  openDelay: 0,
1363
1365
  onOpenChange: async (c) => {
1364
1366
  if (!c)
1365
1367
  return;
1366
1368
  console.log("onOpenChange");
1367
- const h = await ea(
1369
+ const h = await aa(
1368
1370
  "https://semaphor.cloud/api/v1/filter-sql",
1369
1371
  (s == null ? void 0 : s.accessToken) || "",
1370
1372
  {
@@ -1375,20 +1377,20 @@ function wn() {
1375
1377
  console.log(h), h.sql ? (console.log(h.records), i(h.sql)) : i("Error");
1376
1378
  },
1377
1379
  children: [
1378
- /* @__PURE__ */ e.jsx(Xs, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1379
- /* @__PURE__ */ e.jsxs(Zs, { align: "end", className: "w-[600px]", children: [
1380
+ /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1381
+ /* @__PURE__ */ e.jsxs(sa, { align: "end", className: "w-[600px]", children: [
1380
1382
  /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: n, className: "font-mono text-sm", children: [
1381
1383
  t,
1382
1384
  /* @__PURE__ */ e.jsx(
1383
- sa,
1385
+ ta,
1384
1386
  {
1385
- onClick: () => Wa(n),
1387
+ onClick: () => Ya(n),
1386
1388
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
1387
1389
  }
1388
1390
  )
1389
1391
  ] }) }) }),
1390
1392
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
1391
- /* @__PURE__ */ e.jsx(Ya, { className: "h-4 w-4 opacity-70" }),
1393
+ /* @__PURE__ */ e.jsx(Xa, { className: "h-4 w-4 opacity-70" }),
1392
1394
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
1393
1395
  ] })
1394
1396
  ] })
@@ -1396,7 +1398,7 @@ function wn() {
1396
1398
  }
1397
1399
  );
1398
1400
  }
1399
- const zn = `
1401
+ const Fn = `
1400
1402
 
1401
1403
  Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
1402
1404
 
@@ -1443,7 +1445,7 @@ SELECT label, measure FROM table
1443
1445
  - Label - Category
1444
1446
  - Measure - Number
1445
1447
  `;
1446
- function Fn({
1448
+ function On({
1447
1449
  open: s,
1448
1450
  setOpen: n,
1449
1451
  userInput: a,
@@ -1451,17 +1453,17 @@ function Fn({
1451
1453
  triggerAIRun: i,
1452
1454
  setTriggerAIRun: o
1453
1455
  }) {
1454
- const l = Be(null), c = Be(null), { authToken: h } = es(), [g, m] = T(!1), u = r((y) => y.actions.setCardSql), N = k((y) => y.dashboard.baseQueries), d = r((y) => y.actions.setRunSql), x = r((y) => y.actions.setCardType), [f, w] = T([]), b = r((y) => y.currentColumns), E = r((y) => y.card.sql), C = r((y) => y.selectedTableName), O = `
1456
+ const l = $e(null), c = $e(null), { authToken: h } = es(), [g, m] = T(!1), u = r((y) => y.actions.setCardSql), N = k((y) => y.dashboard.baseQueries), d = r((y) => y.actions.setRunSql), x = r((y) => y.actions.setCardType), [f, w] = T([]), b = r((y) => y.currentColumns), L = r((y) => y.card.sql), C = r((y) => y.selectedTableName), O = `
1455
1457
  ${a}
1456
1458
 
1457
1459
  Database Query Dialect: ${C === "api" || C === "s3" ? "DuckDb" : ""}
1458
1460
  Table Name: ${C}
1459
1461
  Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
1460
- User SQL: ${E}
1462
+ User SQL: ${L}
1461
1463
  ${N && `Base Queries: ${JSON.stringify(N)} `}`, j = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1462
- Visual Query Syntax: ${zn}`, { data: F, isLoading: A, isFetching: q, isError: Y, refetch: $ } = Ce({
1464
+ Visual Query Syntax: ${Fn}`, { data: F, isLoading: A, isFetching: q, isError: P, refetch: $ } = Ce({
1463
1465
  queryKey: ["ai-query"],
1464
- queryFn: () => we(
1466
+ queryFn: () => ze(
1465
1467
  "https://semaphor.cloud/api/v1/ai",
1466
1468
  (h == null ? void 0 : h.accessToken) || "",
1467
1469
  {
@@ -1471,7 +1473,7 @@ function Fn({
1471
1473
  enabled: !1
1472
1474
  // Do not run by default.
1473
1475
  });
1474
- function U(y) {
1476
+ function G(y) {
1475
1477
  if (y.toLowerCase().includes("bar"))
1476
1478
  x("bar");
1477
1479
  else if (y.toLowerCase().includes("line"))
@@ -1505,7 +1507,7 @@ function Fn({
1505
1507
  return () => clearTimeout(y);
1506
1508
  }, [f]);
1507
1509
  function D() {
1508
- a && (w((y) => [...y, { role: "user", content: a }]), U(a) && m(!0), t(""), $());
1510
+ a && (w((y) => [...y, { role: "user", content: a }]), G(a) && m(!0), t(""), $());
1509
1511
  }
1510
1512
  K(() => {
1511
1513
  i && (D(), o(!1));
@@ -1518,7 +1520,7 @@ function Fn({
1518
1520
  fontSize: 15,
1519
1521
  // padding: '5px',
1520
1522
  width: "100%"
1521
- }, J = {
1523
+ }, Q = {
1522
1524
  // background: '#f6f8fa',
1523
1525
  // color: '#000',
1524
1526
  fontFamily: "monospace",
@@ -1539,20 +1541,20 @@ function Fn({
1539
1541
  // Override how paragraphs are rendered
1540
1542
  p: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("p", { style: te, ...v }),
1541
1543
  code: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...v }),
1542
- pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: J, children: [
1544
+ pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Q, children: [
1543
1545
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
1544
1546
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1545
- /* @__PURE__ */ e.jsx(z, { onClick: P, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(sa, {}) }),
1547
+ /* @__PURE__ */ e.jsx(z, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
1546
1548
  /* @__PURE__ */ e.jsx(
1547
1549
  z,
1548
1550
  {
1549
1551
  onClick: (M) => {
1550
- const V = P(M);
1551
- V && (n(!1), u(V), d(!0));
1552
+ const H = J(M);
1553
+ H && (n(!1), u(H), d(!0));
1552
1554
  },
1553
1555
  size: "sm",
1554
1556
  variant: "outline",
1555
- children: /* @__PURE__ */ e.jsx(et, {})
1557
+ children: /* @__PURE__ */ e.jsx(st, {})
1556
1558
  }
1557
1559
  )
1558
1560
  ] })
@@ -1560,12 +1562,12 @@ function Fn({
1560
1562
  li: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...v })
1561
1563
  // You can add more overrides for other elements like h1, h2, etc.
1562
1564
  };
1563
- function P(y) {
1565
+ function J(y) {
1564
1566
  const v = y.currentTarget.closest("pre");
1565
1567
  if (!v)
1566
1568
  return;
1567
1569
  const M = v.textContent || v.innerText;
1568
- return navigator.clipboard.writeText(M).then(() => console.log("Text copied to clipboard")).catch((V) => console.error("Error in copying text: ", V)), M;
1570
+ return navigator.clipboard.writeText(M).then(() => console.log("Text copied to clipboard")).catch((H) => console.error("Error in copying text: ", H)), M;
1569
1571
  }
1570
1572
  function I() {
1571
1573
  return f == null ? void 0 : f.map((y, v) => y.role === "user" ? /* @__PURE__ */ e.jsxs(
@@ -1573,13 +1575,13 @@ function Fn({
1573
1575
  {
1574
1576
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1575
1577
  children: [
1576
- /* @__PURE__ */ e.jsx(fn, { className: "mr-2 h-5 w-5" }),
1578
+ /* @__PURE__ */ e.jsx(gn, { className: "mr-2 h-5 w-5" }),
1577
1579
  /* @__PURE__ */ e.jsx("div", { children: y.content })
1578
1580
  ]
1579
1581
  },
1580
1582
  v
1581
1583
  ) : y.role === "ai" ? /* @__PURE__ */ e.jsx(
1582
- Za,
1584
+ et,
1583
1585
  {
1584
1586
  className: "w-full overflow-auto py-1",
1585
1587
  components: Z,
@@ -1588,8 +1590,8 @@ function Fn({
1588
1590
  v
1589
1591
  ) : /* @__PURE__ */ e.jsx("div", {}, v));
1590
1592
  }
1591
- return /* @__PURE__ */ e.jsxs(us, { open: s, onOpenChange: n, children: [
1592
- /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1593
+ return /* @__PURE__ */ e.jsxs(xs, { open: s, onOpenChange: n, children: [
1594
+ /* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1593
1595
  z,
1594
1596
  {
1595
1597
  size: "sm",
@@ -1599,13 +1601,13 @@ function Fn({
1599
1601
  }
1600
1602
  ) }),
1601
1603
  /* @__PURE__ */ e.jsxs(
1602
- ps,
1604
+ fs,
1603
1605
  {
1604
1606
  className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
1605
1607
  children: [
1606
- /* @__PURE__ */ e.jsxs(fs, { children: [
1607
- /* @__PURE__ */ e.jsx(gs, { children: "Assistant" }),
1608
- /* @__PURE__ */ e.jsx(js, { children: "What can I help you with?" })
1608
+ /* @__PURE__ */ e.jsxs(gs, { children: [
1609
+ /* @__PURE__ */ e.jsx(js, { children: "Assistant" }),
1610
+ /* @__PURE__ */ e.jsx(bs, { children: "What can I help you with?" })
1609
1611
  ] }),
1610
1612
  /* @__PURE__ */ e.jsx(
1611
1613
  "div",
@@ -1620,7 +1622,7 @@ function Fn({
1620
1622
  {
1621
1623
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
1622
1624
  /* @__PURE__ */ e.jsx(
1623
- aa,
1625
+ na,
1624
1626
  {
1625
1627
  autoFocus: !0,
1626
1628
  ref: l,
@@ -1632,7 +1634,7 @@ function Fn({
1632
1634
  const v = y.target, M = v.value.length;
1633
1635
  v.setSelectionRange(M, M);
1634
1636
  },
1635
- className: W(
1637
+ className: Y(
1636
1638
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1637
1639
  ),
1638
1640
  disabled: A || q,
@@ -1648,7 +1650,7 @@ function Fn({
1648
1650
  size: "sm",
1649
1651
  variant: "ghost",
1650
1652
  onClick: D,
1651
- children: !A && !q ? /* @__PURE__ */ e.jsx(Xa, {}) : /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1653
+ children: !A && !q ? /* @__PURE__ */ e.jsx(Za, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1652
1654
  }
1653
1655
  )
1654
1656
  ] })
@@ -1659,17 +1661,17 @@ function Fn({
1659
1661
  )
1660
1662
  ] });
1661
1663
  }
1662
- var pa = {
1664
+ var fa = {
1663
1665
  color: void 0,
1664
1666
  size: void 0,
1665
1667
  className: void 0,
1666
1668
  style: void 0,
1667
1669
  attr: void 0
1668
- }, Rs = me.createContext && /* @__PURE__ */ me.createContext(pa), On = ["attr", "size", "title"];
1669
- function Mn(s, n) {
1670
+ }, Hs = me.createContext && /* @__PURE__ */ me.createContext(fa), Mn = ["attr", "size", "title"];
1671
+ function Tn(s, n) {
1670
1672
  if (s == null)
1671
1673
  return {};
1672
- var a = Tn(s, n), t, i;
1674
+ var a = An(s, n), t, i;
1673
1675
  if (Object.getOwnPropertySymbols) {
1674
1676
  var o = Object.getOwnPropertySymbols(s);
1675
1677
  for (i = 0; i < o.length; i++)
@@ -1677,7 +1679,7 @@ function Mn(s, n) {
1677
1679
  }
1678
1680
  return a;
1679
1681
  }
1680
- function Tn(s, n) {
1682
+ function An(s, n) {
1681
1683
  if (s == null)
1682
1684
  return {};
1683
1685
  var a = {}, t = Object.keys(s), i, o;
@@ -1695,7 +1697,7 @@ function Xe() {
1695
1697
  return s;
1696
1698
  }, Xe.apply(this, arguments);
1697
1699
  }
1698
- function _s(s, n) {
1700
+ function Bs(s, n) {
1699
1701
  var a = Object.keys(s);
1700
1702
  if (Object.getOwnPropertySymbols) {
1701
1703
  var t = Object.getOwnPropertySymbols(s);
@@ -1708,22 +1710,22 @@ function _s(s, n) {
1708
1710
  function Ze(s) {
1709
1711
  for (var n = 1; n < arguments.length; n++) {
1710
1712
  var a = arguments[n] != null ? arguments[n] : {};
1711
- n % 2 ? _s(Object(a), !0).forEach(function(t) {
1712
- An(s, t, a[t]);
1713
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : _s(Object(a)).forEach(function(t) {
1713
+ n % 2 ? Bs(Object(a), !0).forEach(function(t) {
1714
+ En(s, t, a[t]);
1715
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Bs(Object(a)).forEach(function(t) {
1714
1716
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
1715
1717
  });
1716
1718
  }
1717
1719
  return s;
1718
1720
  }
1719
- function An(s, n, a) {
1721
+ function En(s, n, a) {
1720
1722
  return n = Ln(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1721
1723
  }
1722
1724
  function Ln(s) {
1723
- var n = En(s, "string");
1725
+ var n = Dn(s, "string");
1724
1726
  return typeof n == "symbol" ? n : String(n);
1725
1727
  }
1726
- function En(s, n) {
1728
+ function Dn(s, n) {
1727
1729
  if (typeof s != "object" || s === null)
1728
1730
  return s;
1729
1731
  var a = s[Symbol.toPrimitive];
@@ -1735,23 +1737,23 @@ function En(s, n) {
1735
1737
  }
1736
1738
  return (n === "string" ? String : Number)(s);
1737
1739
  }
1738
- function fa(s) {
1740
+ function ga(s) {
1739
1741
  return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, Ze({
1740
1742
  key: a
1741
- }, n.attr), fa(n.child)));
1743
+ }, n.attr), ga(n.child)));
1742
1744
  }
1743
1745
  function fe(s) {
1744
- return (n) => /* @__PURE__ */ me.createElement(Dn, Xe({
1746
+ return (n) => /* @__PURE__ */ me.createElement(In, Xe({
1745
1747
  attr: Ze({}, s.attr)
1746
- }, n), fa(s.child));
1748
+ }, n), ga(s.child));
1747
1749
  }
1748
- function Dn(s) {
1750
+ function In(s) {
1749
1751
  var n = (a) => {
1750
1752
  var {
1751
1753
  attr: t,
1752
1754
  size: i,
1753
1755
  title: o
1754
- } = s, l = Mn(s, On), c = i || a.size || "1em", h;
1756
+ } = s, l = Tn(s, Mn), c = i || a.size || "1em", h;
1755
1757
  return a.className && (h = a.className), s.className && (h = (h ? h + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
1756
1758
  stroke: "currentColor",
1757
1759
  fill: "currentColor",
@@ -1766,15 +1768,15 @@ function Dn(s) {
1766
1768
  xmlns: "http://www.w3.org/2000/svg"
1767
1769
  }), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
1768
1770
  };
1769
- return Rs !== void 0 ? /* @__PURE__ */ me.createElement(Rs.Consumer, null, (a) => n(a)) : n(pa);
1771
+ return Hs !== void 0 ? /* @__PURE__ */ me.createElement(Hs.Consumer, null, (a) => n(a)) : n(fa);
1770
1772
  }
1771
- function In(s) {
1773
+ function qn(s) {
1772
1774
  return fe({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
1773
1775
  }
1774
- function qn() {
1775
- const { theme: s } = st(), n = Be(), a = Be(), [t, i] = T(!1), [o, l] = T(!1), [c, h] = T(!1), [g, m] = T(""), [u, N] = T(!1), { authToken: d } = es();
1776
+ function Vn() {
1777
+ const { theme: s } = at(), n = $e(), a = $e(), [t, i] = T(!1), [o, l] = T(!1), [c, h] = T(!1), [g, m] = T(""), [u, N] = T(!1), { authToken: d } = es();
1776
1778
  k((p) => p.selectedSheetId);
1777
- const x = k((p) => p.dashboard.baseQueries), f = r((p) => p.card), w = k((p) => p.theme), b = r((p) => p.isShowingVisual), E = r(
1779
+ const x = k((p) => p.dashboard.baseQueries), f = r((p) => p.card), w = k((p) => p.theme), b = r((p) => p.isShowingVisual), L = r(
1778
1780
  (p) => p.selectedConnectionId
1779
1781
  ), C = r(
1780
1782
  (p) => p.selectedDatabaseName
@@ -1784,106 +1786,109 @@ function qn() {
1784
1786
  k(
1785
1787
  (p) => p.actions.updateFrameCard
1786
1788
  );
1787
- const j = r((p) => p.selectedTableName), F = r((p) => p.card.sql), A = r((p) => p.card.python), q = at(F, x), Y = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), U = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
1789
+ const j = r((p) => p.selectedTableName), F = r((p) => p.card.sql), A = r((p) => p.card.python), q = tt(F, x), P = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), G = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
1788
1790
  setCardCustomCfg: te,
1789
- setQueryResultColumns: J,
1791
+ setQueryResultColumns: Q,
1790
1792
  setFilterValues: ee,
1791
1793
  setCardSql: Z,
1792
- setCardPython: P,
1794
+ setCardPython: J,
1793
1795
  setQueryError: I,
1794
1796
  setPythonStdOut: y,
1795
1797
  setCardPreferences: v
1796
- } = r((p) => p.actions), M = r((p) => p.onSave), V = r(
1798
+ } = r((p) => p.actions), M = r((p) => p.onSave), H = r(
1797
1799
  (p) => p.actions.setApplyFilters
1798
1800
  ), ue = r((p) => p.onClose), se = r((p) => p.actions.setCardData), ge = r((p) => p.actions.setSqlGen), je = r((p) => p.runSql), be = r((p) => p.actions.setRunSql), xe = r(
1799
1801
  (p) => p.actions.setIsSqlRunning
1800
1802
  ), {
1801
- data: G,
1803
+ data: U,
1802
1804
  isLoading: ne,
1803
1805
  isFetching: le,
1804
1806
  isSuccess: ye,
1805
1807
  isError: re,
1806
- error: De,
1808
+ error: Ie,
1807
1809
  status: ss,
1808
1810
  refetch: ve
1809
1811
  } = Ce({
1810
1812
  queryKey: [q, A],
1811
- queryFn: () => ea(
1813
+ queryFn: () => aa(
1812
1814
  "https://semaphor.cloud/api/v1/query",
1813
1815
  (d == null ? void 0 : d.accessToken) || "",
1814
1816
  {
1815
- connection_id: Y,
1817
+ connection_id: P,
1816
1818
  sql: q,
1817
- python: A === As ? "" : A,
1818
- active_filters: D ? U : []
1819
+ python: A === Ls ? "" : A,
1820
+ active_filters: D ? G : []
1819
1821
  }
1820
1822
  ),
1821
1823
  enabled: !1,
1822
1824
  retry: !1
1823
1825
  });
1824
1826
  K(() => {
1825
- if (G && (se(G.records), y((G == null ? void 0 : G.output) || ""), G.records.length > 0)) {
1826
- const { dimensionKeys: p } = ds(G.records);
1827
- J(p);
1827
+ if (U && (se(U.records), U.rowLimitExceeded && cs.error("Row limit (10,000) exceeded. Refine your query.", {
1828
+ position: "top-center",
1829
+ richColors: !0
1830
+ }), y((U == null ? void 0 : U.output) || ""), U.records.length > 0)) {
1831
+ const { dimensionKeys: p } = hs(U.records);
1832
+ Q(p);
1828
1833
  }
1829
- }, [G, se, J, y]), K(() => {
1834
+ }, [U, se, Q, y]), K(() => {
1830
1835
  je && (ve(), be(!1));
1831
1836
  }, [je, ve, be]), K(() => {
1832
- (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(De.message), se([]), J([]), y("")) : I("");
1837
+ (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), Q([]), y("")) : I("");
1833
1838
  }, [
1834
1839
  ne,
1835
1840
  le,
1836
- G,
1841
+ U,
1837
1842
  y,
1838
1843
  re,
1839
1844
  ye,
1840
1845
  xe,
1841
1846
  se,
1842
- J,
1847
+ Q,
1843
1848
  I,
1844
- De
1849
+ Ie
1845
1850
  ]);
1846
1851
  function Je() {
1847
1852
  Z(""), se([]), ge({}), te(""), v({});
1848
1853
  }
1849
- const Ie = (p) => {
1854
+ const qe = (p) => {
1850
1855
  a.current = p;
1851
1856
  };
1852
1857
  function S() {
1853
1858
  let p = F;
1854
- F && !F.includes("{{") && (p = Cn(F), Z(p));
1859
+ F && !F.includes("{{") && (p = Sn(F), Z(p));
1855
1860
  const ie = {
1856
1861
  ...f,
1857
1862
  lastSelectedSchema: O,
1858
1863
  lastSelectedDatabase: C,
1859
1864
  lastSelectedTable: j,
1860
- connectionId: E,
1865
+ connectionId: L,
1861
1866
  type: b ? f.type : "table",
1862
1867
  sql: p,
1863
1868
  customCfg: b ? f.customCfg : null
1864
- }, qe = $.cards.map(
1869
+ }, Ve = $.cards.map(
1865
1870
  (Ne) => Ne.id === f.id ? ie : Ne
1866
1871
  );
1867
1872
  M == null || M({
1868
1873
  ...$,
1869
- cards: qe
1874
+ cards: Ve
1870
1875
  });
1871
1876
  }
1872
- function za() {
1877
+ function Fa() {
1873
1878
  ue == null || ue();
1874
1879
  }
1875
- function Fa(p) {
1880
+ function Oa(p) {
1876
1881
  const ie = getComputedStyle(
1877
1882
  document.documentElement
1878
1883
  ).getPropertyValue(p);
1879
- return Oa(ie);
1884
+ return Ma(ie);
1880
1885
  }
1881
- function Oa(p) {
1882
- const [ie, qe, Ne] = p.split(" "), Q = parseFloat(ie), Aa = parseFloat(qe), La = parseFloat(Ne), Ea = Aa / 100, Fs = La / 100, pe = (1 - Math.abs(2 * Fs - 1)) * Ea, Se = pe * (1 - Math.abs(Q / 60 % 2 - 1)), as = Fs - pe / 2;
1886
+ function Ma(p) {
1887
+ const [ie, Ve, Ne] = p.split(" "), W = parseFloat(ie), Ea = parseFloat(Ve), La = parseFloat(Ne), Da = Ea / 100, Ts = La / 100, pe = (1 - Math.abs(2 * Ts - 1)) * Da, ke = pe * (1 - Math.abs(W / 60 % 2 - 1)), as = Ts - pe / 2;
1883
1888
  let oe = 0, ce = 0, de = 0;
1884
- 0 <= Q && Q < 60 ? (oe = pe, ce = Se, de = 0) : 60 <= Q && Q < 120 ? (oe = Se, ce = pe, de = 0) : 120 <= Q && Q < 180 ? (oe = 0, ce = pe, de = Se) : 180 <= Q && Q < 240 ? (oe = 0, ce = Se, de = pe) : 240 <= Q && Q < 300 ? (oe = Se, ce = 0, de = pe) : 300 <= Q && Q < 360 && (oe = pe, ce = 0, de = Se), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
1885
- const ts = (Da) => {
1886
- const ns = Da.toString(16);
1889
+ 0 <= W && W < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= W && W < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= W && W < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= W && W < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= W && W < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= W && W < 360 && (oe = pe, ce = 0, de = ke), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
1890
+ const ts = (Ia) => {
1891
+ const ns = Ia.toString(16);
1887
1892
  return ns.length == 1 ? "0" + ns : ns;
1888
1893
  };
1889
1894
  return `#${ts(oe)}${ts(ce)}${ts(de)}`;
@@ -1891,7 +1896,7 @@ function qn() {
1891
1896
  K(() => {
1892
1897
  const p = n.current, ie = a.current;
1893
1898
  if (p) {
1894
- const qe = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = w === "system" ? qe : w;
1899
+ const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = w === "system" ? Ve : w;
1895
1900
  p.editor.defineTheme("default", {
1896
1901
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
1897
1902
  base: Ne === "light" ? "vs" : "vs-dark",
@@ -1899,7 +1904,7 @@ function qn() {
1899
1904
  rules: [],
1900
1905
  colors: {
1901
1906
  // 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
1902
- "editor.background": Ne === "light" ? "#ffffff" : Fa("--background")
1907
+ "editor.background": Ne === "light" ? "#ffffff" : Oa("--background")
1903
1908
  }
1904
1909
  }), p.editor.setTheme("default");
1905
1910
  }
@@ -1911,10 +1916,10 @@ function qn() {
1911
1916
  ), () => {
1912
1917
  };
1913
1918
  }, [s, w, n.current]);
1914
- function zs(p) {
1919
+ function Ms(p) {
1915
1920
  n.current = p;
1916
1921
  }
1917
- function Ma() {
1922
+ function Ta() {
1918
1923
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1919
1924
  o && /* @__PURE__ */ e.jsx(
1920
1925
  "div",
@@ -1924,16 +1929,16 @@ function qn() {
1924
1929
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
1925
1930
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
1926
1931
  /* @__PURE__ */ e.jsx(
1927
- kn,
1932
+ wn,
1928
1933
  {
1929
1934
  checked: D,
1930
- onCheckedChange: () => V(!D),
1935
+ onCheckedChange: () => H(!D),
1931
1936
  text: "Apply Filters"
1932
1937
  }
1933
1938
  ),
1934
- /* @__PURE__ */ e.jsx(wn, {}),
1935
- U && o && /* @__PURE__ */ e.jsx(
1936
- Re,
1939
+ /* @__PURE__ */ e.jsx(zn, {}),
1940
+ G && o && /* @__PURE__ */ e.jsx(
1941
+ _e,
1937
1942
  {
1938
1943
  onClick: () => l(!1),
1939
1944
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
@@ -1941,7 +1946,7 @@ function qn() {
1941
1946
  )
1942
1947
  ] }),
1943
1948
  /* @__PURE__ */ e.jsx(
1944
- Ve,
1949
+ Re,
1945
1950
  {
1946
1951
  theme: "default",
1947
1952
  onChange: (p) => {
@@ -1953,7 +1958,7 @@ function qn() {
1953
1958
  },
1954
1959
  defaultLanguage: "json",
1955
1960
  className: "mt-1 min-h-[220px]",
1956
- value: JSON.stringify(U, null, 2),
1961
+ value: JSON.stringify(G, null, 2),
1957
1962
  options: {
1958
1963
  readOnly: !0,
1959
1964
  minimap: {
@@ -1974,11 +1979,11 @@ function qn() {
1974
1979
  ] })
1975
1980
  }
1976
1981
  ),
1977
- U && !o && /* @__PURE__ */ e.jsx(
1978
- ia,
1982
+ G && !o && /* @__PURE__ */ e.jsx(
1983
+ oa,
1979
1984
  {
1980
1985
  onClick: () => l(!0),
1981
- className: W(
1986
+ className: Y(
1982
1987
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
1983
1988
  {
1984
1989
  "font-bold text-red-800": D
@@ -1988,16 +1993,16 @@ function qn() {
1988
1993
  )
1989
1994
  ] });
1990
1995
  }
1991
- function Ta() {
1996
+ function Aa() {
1992
1997
  return /* @__PURE__ */ e.jsxs(
1993
- hs,
1998
+ ms,
1994
1999
  {
1995
2000
  className: "flex grow pb-1",
1996
2001
  direction: "vertical",
1997
2002
  role: "editor-resizable-group",
1998
2003
  children: [
1999
2004
  /* @__PURE__ */ e.jsxs(
2000
- ze,
2005
+ Fe,
2001
2006
  {
2002
2007
  id: "1",
2003
2008
  order: 1,
@@ -2010,7 +2015,7 @@ function qn() {
2010
2015
  role: "sql-container",
2011
2016
  className: "relative flex w-[99%]",
2012
2017
  children: /* @__PURE__ */ e.jsx(
2013
- Ve,
2018
+ Re,
2014
2019
  {
2015
2020
  theme: "default",
2016
2021
  className: "pt-3",
@@ -2032,8 +2037,8 @@ function qn() {
2032
2037
  },
2033
2038
  defaultLanguage: "sql",
2034
2039
  defaultValue: "SELECT * FROM table",
2035
- beforeMount: zs,
2036
- onMount: Ie
2040
+ beforeMount: Ms,
2041
+ onMount: qe
2037
2042
  }
2038
2043
  )
2039
2044
  }
@@ -2043,9 +2048,9 @@ function qn() {
2043
2048
  }
2044
2049
  ),
2045
2050
  t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2046
- /* @__PURE__ */ e.jsx(ms, { withHandle: !0, className: "border" }),
2051
+ /* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border" }),
2047
2052
  /* @__PURE__ */ e.jsxs(
2048
- ze,
2053
+ Fe,
2049
2054
  {
2050
2055
  id: "2",
2051
2056
  order: 2,
@@ -2058,14 +2063,14 @@ function qn() {
2058
2063
  role: "python-container",
2059
2064
  className: "relative flex w-[99%] pt-0",
2060
2065
  children: /* @__PURE__ */ e.jsx(
2061
- Ve,
2066
+ Re,
2062
2067
  {
2063
2068
  className: "pt-3",
2064
2069
  theme: "default",
2065
2070
  onChange: (p) => {
2066
- P(p && p.trim() || "");
2071
+ J(p && p.trim() || "");
2067
2072
  },
2068
- value: A || As,
2073
+ value: A || Ls,
2069
2074
  options: {
2070
2075
  minimap: {
2071
2076
  enabled: !1
@@ -2079,8 +2084,8 @@ function qn() {
2079
2084
  renderLineHighlight: "none"
2080
2085
  },
2081
2086
  defaultLanguage: "python",
2082
- beforeMount: zs,
2083
- onMount: Ie
2087
+ beforeMount: Ms,
2088
+ onMount: qe
2084
2089
  }
2085
2090
  )
2086
2091
  }
@@ -2108,8 +2113,8 @@ function qn() {
2108
2113
  role: "sql-editor",
2109
2114
  className: "relative flex grow justify-between overflow-y-scroll",
2110
2115
  children: [
2111
- Ta(),
2112
- Ma()
2116
+ Aa(),
2117
+ Ta()
2113
2118
  ]
2114
2119
  }
2115
2120
  ),
@@ -2132,15 +2137,15 @@ function qn() {
2132
2137
  size: "sm",
2133
2138
  variant: "outline",
2134
2139
  children: [
2135
- ne || le ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(rn, { className: "mr-2 h-4 w-4" }),
2140
+ ne || le ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(on, { className: "mr-2 h-4 w-4" }),
2136
2141
  "Run"
2137
2142
  ]
2138
2143
  }
2139
2144
  ),
2140
2145
  re && /* @__PURE__ */ e.jsx(
2141
- Sn,
2146
+ kn,
2142
2147
  {
2143
- error: De.message,
2148
+ error: Ie.message,
2144
2149
  setShowAIDialog: h,
2145
2150
  setTriggerAIRun: N,
2146
2151
  setUserInputforAI: m
@@ -2154,24 +2159,24 @@ function qn() {
2154
2159
  size: "sm",
2155
2160
  variant: "outline",
2156
2161
  children: [
2157
- /* @__PURE__ */ e.jsx(Wt, { className: "mr-2 size-4" }),
2162
+ /* @__PURE__ */ e.jsx(Yt, { className: "mr-2 size-4" }),
2158
2163
  "Clear"
2159
2164
  ]
2160
2165
  }
2161
2166
  ),
2162
2167
  /* @__PURE__ */ e.jsx(
2163
- Ws,
2168
+ Xs,
2164
2169
  {
2165
2170
  pressed: t,
2166
2171
  onPressedChange: (p) => i(p),
2167
2172
  className: "",
2168
2173
  size: "sm",
2169
2174
  variant: "outline",
2170
- children: /* @__PURE__ */ e.jsx(In, { className: "size-4 text-foreground/70" })
2175
+ children: /* @__PURE__ */ e.jsx(qn, { className: "size-4 text-foreground/70" })
2171
2176
  }
2172
2177
  ),
2173
2178
  /* @__PURE__ */ e.jsx(
2174
- Fn,
2179
+ On,
2175
2180
  {
2176
2181
  open: c,
2177
2182
  setOpen: h,
@@ -2190,7 +2195,7 @@ function qn() {
2190
2195
  size: "sm",
2191
2196
  variant: "outline",
2192
2197
  children: [
2193
- /* @__PURE__ */ e.jsx(tt, { className: "mr-2 size-4 font-bold text-green-600" }),
2198
+ /* @__PURE__ */ e.jsx(nt, { className: "mr-2 size-4 font-bold text-green-600" }),
2194
2199
  "Accept"
2195
2200
  ]
2196
2201
  }
@@ -2198,12 +2203,12 @@ function qn() {
2198
2203
  /* @__PURE__ */ e.jsxs(
2199
2204
  z,
2200
2205
  {
2201
- onClick: za,
2206
+ onClick: Fa,
2202
2207
  className: "w-full",
2203
2208
  size: "sm",
2204
2209
  variant: "outline",
2205
2210
  children: [
2206
- /* @__PURE__ */ e.jsx(Re, { className: "mr-2 size-4" }),
2211
+ /* @__PURE__ */ e.jsx(_e, { className: "mr-2 size-4" }),
2207
2212
  "Close"
2208
2213
  ]
2209
2214
  }
@@ -2217,7 +2222,7 @@ function qn() {
2217
2222
  )
2218
2223
  );
2219
2224
  }
2220
- function Vn({ data: s }) {
2225
+ function Rn({ data: s }) {
2221
2226
  var l;
2222
2227
  const [n, a] = me.useState([]), i = Object.keys(s[0]).map((c) => ({
2223
2228
  // header: key,
@@ -2231,40 +2236,40 @@ function Vn({ data: s }) {
2231
2236
  onClick: () => h.toggleSorting(h.getIsSorted() === "asc"),
2232
2237
  children: [
2233
2238
  c,
2234
- g === "asc" ? /* @__PURE__ */ e.jsx(nt, { className: "ml-2 h-5 w-5" }) : g === "desc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : null
2239
+ g === "asc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : g === "desc" ? /* @__PURE__ */ e.jsx(rt, { className: "ml-2 h-5 w-5" }) : null
2235
2240
  ]
2236
2241
  }
2237
2242
  ) });
2238
2243
  }
2239
- })), o = rt({
2244
+ })), o = it({
2240
2245
  data: s,
2241
2246
  columns: i,
2242
- getCoreRowModel: ht(),
2243
- getPaginationRowModel: mt(),
2247
+ getCoreRowModel: mt(),
2248
+ getPaginationRowModel: ut(),
2244
2249
  onSortingChange: a,
2245
- getSortedRowModel: ut(),
2250
+ getSortedRowModel: xt(),
2246
2251
  manualPagination: !0,
2247
2252
  state: {
2248
2253
  sorting: n
2249
2254
  }
2250
2255
  });
2251
- return /* @__PURE__ */ e.jsxs(it, { children: [
2252
- /* @__PURE__ */ e.jsx(ot, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((h) => /* @__PURE__ */ e.jsx(ct, { className: "sticky top-0 bg-muted", children: h.isPlaceholder ? null : Ls(
2256
+ return /* @__PURE__ */ e.jsxs(ot, { children: [
2257
+ /* @__PURE__ */ e.jsx(ct, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((h) => /* @__PURE__ */ e.jsx(dt, { className: "sticky top-0 bg-muted", children: h.isPlaceholder ? null : Ds(
2253
2258
  h.column.columnDef.header,
2254
2259
  h.getContext()
2255
2260
  ) }, h.id)) }, c.id)) }),
2256
- /* @__PURE__ */ e.jsx(dt, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2261
+ /* @__PURE__ */ e.jsx(ht, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2257
2262
  ls,
2258
2263
  {
2259
2264
  className: "whitespace-nowrap py-2",
2260
2265
  "data-state": c.getIsSelected() && "selected",
2261
- children: c.getVisibleCells().map((h) => /* @__PURE__ */ e.jsx(Es, { children: Ls(h.column.columnDef.cell, h.getContext()) }, h.id))
2266
+ children: c.getVisibleCells().map((h) => /* @__PURE__ */ e.jsx(Is, { children: Ds(h.column.columnDef.cell, h.getContext()) }, h.id))
2262
2267
  },
2263
2268
  c.id
2264
- )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Es, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2269
+ )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Is, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2265
2270
  ] });
2266
2271
  }
2267
- function ga({
2272
+ function ja({
2268
2273
  // card,
2269
2274
  className: s,
2270
2275
  ...n
@@ -2283,35 +2288,35 @@ function ga({
2283
2288
  ]), !t.id)
2284
2289
  return null;
2285
2290
  let o;
2286
- return t.data && t.data.length > 0 && (o = ta({
2291
+ return t.data && t.data.length > 0 && (o = la({
2287
2292
  data: t.data,
2288
2293
  cardType: t.type,
2289
2294
  cfg: t.cfg,
2290
2295
  customCfg: t.customCfg,
2291
2296
  preferences: t.preferences
2292
2297
  })), /* @__PURE__ */ e.jsxs(
2293
- xt,
2298
+ pt,
2294
2299
  {
2295
2300
  role: "editor-visual-card",
2296
- className: W("relative flex h-full flex-col rounded-none", s),
2301
+ className: Y("relative flex h-full flex-col rounded-none", s),
2297
2302
  ...n,
2298
2303
  children: [
2299
- /* @__PURE__ */ e.jsxs(pt, { className: "py-4", children: [
2304
+ /* @__PURE__ */ e.jsxs(ft, { className: "py-4", children: [
2300
2305
  /* @__PURE__ */ e.jsx(
2301
- Ds,
2306
+ qs,
2302
2307
  {
2303
2308
  text: t.title,
2304
2309
  onSave: (c) => i({ ...t, title: c }),
2305
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ft, { className: "text-base", children: t.title }) })
2310
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(gt, { className: "text-base", children: t.title }) })
2306
2311
  },
2307
2312
  t.title
2308
2313
  ),
2309
2314
  /* @__PURE__ */ e.jsx(
2310
- Ds,
2315
+ qs,
2311
2316
  {
2312
2317
  text: t.description || "",
2313
2318
  onSave: (c) => i({ ...t, description: c }),
2314
- children: /* @__PURE__ */ e.jsxs(gt, { children: [
2319
+ children: /* @__PURE__ */ e.jsxs(jt, { children: [
2315
2320
  " ",
2316
2321
  t.description
2317
2322
  ] })
@@ -2319,26 +2324,26 @@ function ga({
2319
2324
  t.description
2320
2325
  )
2321
2326
  ] }),
2322
- /* @__PURE__ */ e.jsxs(jt, { className: "flex grow flex-col pb-3", children: [
2327
+ /* @__PURE__ */ e.jsxs(bt, { className: "flex grow flex-col pb-3", children: [
2323
2328
  t.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
2324
2329
  /* @__PURE__ */ e.jsx(
2325
- bt,
2330
+ yt,
2326
2331
  {
2327
2332
  cfg: o
2328
2333
  },
2329
2334
  JSON.stringify(o) + JSON.stringify(t.preferences) + ((l = t == null ? void 0 : t.preferences) == null ? void 0 : l.customVisualCode)
2330
2335
  ),
2331
2336
  t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2332
- /* @__PURE__ */ e.jsx(yt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(vt, { card: t, data: t == null ? void 0 : t.data }) })
2337
+ /* @__PURE__ */ e.jsx(vt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Nt, { card: t, data: t == null ? void 0 : t.data }) })
2333
2338
  ] })
2334
2339
  ]
2335
2340
  }
2336
2341
  );
2337
2342
  }
2338
- function Rn() {
2343
+ function _n() {
2339
2344
  const [s, n] = T(!1), [a, t] = T(""), [i, o] = T(""), [l, c] = T(""), [h, g] = T(""), m = r((C) => C.card), u = r(
2340
2345
  (C) => C.card.customCfg
2341
- ), { setCardCustomCfg: N, setCustomVisualCode: d } = Nt();
2346
+ ), { setCardCustomCfg: N, setCustomVisualCode: d } = Ct();
2342
2347
  function x(C) {
2343
2348
  var F, A;
2344
2349
  const O = {
@@ -2357,7 +2362,7 @@ function Rn() {
2357
2362
  var O, j;
2358
2363
  if (!m.data || m.data.length === 0)
2359
2364
  return;
2360
- const C = ta({
2365
+ const C = la({
2361
2366
  data: m.data,
2362
2367
  cardType: m.type,
2363
2368
  cfg: m.cfg,
@@ -2377,36 +2382,36 @@ function Rn() {
2377
2382
  function b() {
2378
2383
  o(""), N(null);
2379
2384
  }
2380
- function E() {
2385
+ function L() {
2381
2386
  let C;
2382
2387
  if (u) {
2383
- const O = Is.cloneDeep(m.cfg), j = Is.merge(O, u);
2388
+ const O = Vs.cloneDeep(m.cfg), j = Vs.merge(O, u);
2384
2389
  return C = x(j), C;
2385
2390
  }
2386
2391
  return a ? (C = x(JSON.parse(a)), C) : "";
2387
2392
  }
2388
- return /* @__PURE__ */ e.jsxs(us, { open: s, onOpenChange: n, children: [
2389
- /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2393
+ return /* @__PURE__ */ e.jsxs(xs, { open: s, onOpenChange: n, children: [
2394
+ /* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2390
2395
  z,
2391
2396
  {
2392
2397
  onClick: f,
2393
2398
  className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
2394
2399
  size: "sm",
2395
2400
  variant: "outline",
2396
- children: /* @__PURE__ */ e.jsx(Ct, { className: "h-4 w-4" })
2401
+ children: /* @__PURE__ */ e.jsx(St, { className: "h-4 w-4" })
2397
2402
  }
2398
2403
  ) }),
2399
2404
  /* @__PURE__ */ e.jsxs(
2400
- ps,
2405
+ fs,
2401
2406
  {
2402
2407
  className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
2403
2408
  children: [
2404
- /* @__PURE__ */ e.jsxs(fs, { className: "", children: [
2409
+ /* @__PURE__ */ e.jsxs(gs, { className: "", children: [
2405
2410
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2406
- /* @__PURE__ */ e.jsx(gs, { children: "Customize Card" }),
2407
- /* @__PURE__ */ e.jsxs(bs, { children: [
2408
- /* @__PURE__ */ e.jsx(Ps, { children: /* @__PURE__ */ e.jsx(
2409
- en,
2411
+ /* @__PURE__ */ e.jsx(js, { children: "Customize Card" }),
2412
+ /* @__PURE__ */ e.jsxs(ys, { children: [
2413
+ /* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
2414
+ sn,
2410
2415
  {
2411
2416
  onClick: () => {
2412
2417
  navigator.clipboard.writeText(m.id);
@@ -2414,10 +2419,10 @@ function Rn() {
2414
2419
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
2415
2420
  }
2416
2421
  ) }),
2417
- /* @__PURE__ */ e.jsx(ys, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2422
+ /* @__PURE__ */ e.jsx(vs, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2418
2423
  ] })
2419
2424
  ] }),
2420
- /* @__PURE__ */ e.jsxs(js, { children: [
2425
+ /* @__PURE__ */ e.jsxs(bs, { children: [
2421
2426
  "See the configuration options and documentation",
2422
2427
  /* @__PURE__ */ e.jsx(
2423
2428
  "a",
@@ -2431,11 +2436,11 @@ function Rn() {
2431
2436
  ] })
2432
2437
  ] }),
2433
2438
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2434
- /* @__PURE__ */ e.jsx(ga, { className: "w-1/2 rounded shadow-none" }),
2435
- /* @__PURE__ */ e.jsxs(St, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2436
- /* @__PURE__ */ e.jsxs(kt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2439
+ /* @__PURE__ */ e.jsx(ja, { className: "w-1/2 rounded shadow-none" }),
2440
+ /* @__PURE__ */ e.jsxs(kt, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2441
+ /* @__PURE__ */ e.jsxs(wt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2437
2442
  /* @__PURE__ */ e.jsxs(rs, { value: "custom-config", children: [
2438
- u && /* @__PURE__ */ e.jsx(wt, { className: "mr-1 h-5 w-5 text-green-600" }),
2443
+ u && /* @__PURE__ */ e.jsx(zt, { className: "mr-1 h-5 w-5 text-green-600" }),
2439
2444
  u ? "Custom Config" : "Default Config"
2440
2445
  ] }),
2441
2446
  /* @__PURE__ */ e.jsx(rs, { className: "", value: "output", children: "Output" }),
@@ -2447,7 +2452,7 @@ function Rn() {
2447
2452
  className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
2448
2453
  value: "output",
2449
2454
  children: /* @__PURE__ */ e.jsx(
2450
- aa,
2455
+ na,
2451
2456
  {
2452
2457
  disabled: !0,
2453
2458
  value: a,
@@ -2462,7 +2467,7 @@ function Rn() {
2462
2467
  className: "mt-0 grow rounded-b border border-t-0",
2463
2468
  value: "custom-config",
2464
2469
  children: /* @__PURE__ */ e.jsx(
2465
- Ve,
2470
+ Re,
2466
2471
  {
2467
2472
  className: "h-full w-full overflow-hidden",
2468
2473
  theme: "default",
@@ -2479,7 +2484,7 @@ function Rn() {
2479
2484
  renderLineHighlight: "none"
2480
2485
  },
2481
2486
  defaultLanguage: "json",
2482
- value: E(),
2487
+ value: L(),
2483
2488
  onChange: (C) => o(C)
2484
2489
  }
2485
2490
  )
@@ -2491,7 +2496,7 @@ function Rn() {
2491
2496
  className: "mt-0 grow rounded-b border border-t-0",
2492
2497
  value: "custom-code",
2493
2498
  children: /* @__PURE__ */ e.jsx(
2494
- Ve,
2499
+ Re,
2495
2500
  {
2496
2501
  className: "h-full w-full overflow-hidden",
2497
2502
  theme: "default",
@@ -2516,8 +2521,8 @@ function Rn() {
2516
2521
  )
2517
2522
  ] })
2518
2523
  ] }),
2519
- /* @__PURE__ */ e.jsxs(Ks, { className: "flex items-center", children: [
2520
- /* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children: h }),
2524
+ /* @__PURE__ */ e.jsxs(Us, { className: "flex items-center", children: [
2525
+ /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: h }),
2521
2526
  /* @__PURE__ */ e.jsx(
2522
2527
  z,
2523
2528
  {
@@ -2535,28 +2540,28 @@ function Rn() {
2535
2540
  )
2536
2541
  ] });
2537
2542
  }
2538
- function ja(s) {
2543
+ function ba(s) {
2539
2544
  return fe({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
2540
2545
  }
2541
- function ba(s) {
2546
+ function ya(s) {
2542
2547
  return fe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
2543
2548
  }
2544
- function ya(s) {
2549
+ function va(s) {
2545
2550
  return fe({ tag: "svg", 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: [] }] })(s);
2546
2551
  }
2547
- function va(s) {
2552
+ function Na(s) {
2548
2553
  return fe({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
2549
2554
  }
2550
- function Na(s) {
2555
+ function Ca(s) {
2551
2556
  return fe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
2552
2557
  }
2553
- function Ca(s) {
2558
+ function Sa(s) {
2554
2559
  return fe({ tag: "svg", 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: [] }] })(s);
2555
2560
  }
2556
- function Sa(s) {
2561
+ function ka(s) {
2557
2562
  return fe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
2558
2563
  }
2559
- function _n() {
2564
+ function Hn() {
2560
2565
  const [s, n] = T(!1), a = r((c) => c.card.type), { setCardType: t, setCardPreferences: i } = r(
2561
2566
  (c) => c.actions
2562
2567
  ), o = r(
@@ -2565,16 +2570,16 @@ function _n() {
2565
2570
  function l(c) {
2566
2571
  t(c), o(null), i({}), n(!1);
2567
2572
  }
2568
- return /* @__PURE__ */ e.jsxs(Ke, { open: s, onOpenChange: n, children: [
2569
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Hn, { className: "h-4 w-4", chartType: a }) }) }),
2570
- /* @__PURE__ */ e.jsx(Pe, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2573
+ return /* @__PURE__ */ e.jsxs(Pe, { open: s, onOpenChange: n, children: [
2574
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", chartType: a }) }) }),
2575
+ /* @__PURE__ */ e.jsx(Ge, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2571
2576
  /* @__PURE__ */ e.jsx(
2572
2577
  z,
2573
2578
  {
2574
2579
  onClick: () => l("bar"),
2575
2580
  className: "font-normal",
2576
2581
  variant: "ghost",
2577
- children: /* @__PURE__ */ e.jsx(Ss, { className: "size-5" })
2582
+ children: /* @__PURE__ */ e.jsx(ws, { className: "size-5" })
2578
2583
  }
2579
2584
  ),
2580
2585
  /* @__PURE__ */ e.jsx(
@@ -2582,7 +2587,7 @@ function _n() {
2582
2587
  {
2583
2588
  onClick: () => l("line"),
2584
2589
  variant: "ghost",
2585
- children: /* @__PURE__ */ e.jsx(ks, { className: "size-5" })
2590
+ children: /* @__PURE__ */ e.jsx(zs, { className: "size-5" })
2586
2591
  }
2587
2592
  ),
2588
2593
  /* @__PURE__ */ e.jsx(
@@ -2590,7 +2595,7 @@ function _n() {
2590
2595
  {
2591
2596
  onClick: () => l("stackedBar"),
2592
2597
  variant: "ghost",
2593
- children: /* @__PURE__ */ e.jsx(Na, { className: "size-5", strokeWidth: 0 })
2598
+ children: /* @__PURE__ */ e.jsx(Ca, { className: "size-5", strokeWidth: 0 })
2594
2599
  }
2595
2600
  ),
2596
2601
  /* @__PURE__ */ e.jsx(
@@ -2598,7 +2603,7 @@ function _n() {
2598
2603
  {
2599
2604
  onClick: () => l("scatter"),
2600
2605
  variant: "ghost",
2601
- children: /* @__PURE__ */ e.jsx(ha, { className: "size-5" })
2606
+ children: /* @__PURE__ */ e.jsx(ma, { className: "size-5" })
2602
2607
  }
2603
2608
  ),
2604
2609
  /* @__PURE__ */ e.jsx(
@@ -2606,7 +2611,7 @@ function _n() {
2606
2611
  {
2607
2612
  onClick: () => l("bubble"),
2608
2613
  variant: "ghost",
2609
- children: /* @__PURE__ */ e.jsx(va, { className: "size-4" })
2614
+ children: /* @__PURE__ */ e.jsx(Na, { className: "size-4" })
2610
2615
  }
2611
2616
  ),
2612
2617
  /* @__PURE__ */ e.jsx(
@@ -2614,7 +2619,7 @@ function _n() {
2614
2619
  {
2615
2620
  onClick: () => l("pie"),
2616
2621
  variant: "ghost",
2617
- children: /* @__PURE__ */ e.jsx(da, { className: "size-5" })
2622
+ children: /* @__PURE__ */ e.jsx(ha, { className: "size-5" })
2618
2623
  }
2619
2624
  ),
2620
2625
  /* @__PURE__ */ e.jsx(
@@ -2622,7 +2627,7 @@ function _n() {
2622
2627
  {
2623
2628
  onClick: () => l("doughnut"),
2624
2629
  variant: "ghost",
2625
- children: /* @__PURE__ */ e.jsx(ba, { className: "size-5", strokeWidth: 1 })
2630
+ children: /* @__PURE__ */ e.jsx(ya, { className: "size-5", strokeWidth: 1 })
2626
2631
  }
2627
2632
  ),
2628
2633
  /* @__PURE__ */ e.jsx(
@@ -2631,7 +2636,7 @@ function _n() {
2631
2636
  onClick: () => l("radar"),
2632
2637
  variant: "ghost",
2633
2638
  children: /* @__PURE__ */ e.jsx(
2634
- ja,
2639
+ ba,
2635
2640
  {
2636
2641
  className: "size-5 font-extralight",
2637
2642
  strokeWidth: 0.5
@@ -2644,7 +2649,7 @@ function _n() {
2644
2649
  {
2645
2650
  onClick: () => l("polarArea"),
2646
2651
  variant: "ghost",
2647
- children: /* @__PURE__ */ e.jsx(ya, { className: "size-5" })
2652
+ children: /* @__PURE__ */ e.jsx(va, { className: "size-5" })
2648
2653
  }
2649
2654
  ),
2650
2655
  /* @__PURE__ */ e.jsx(
@@ -2652,7 +2657,7 @@ function _n() {
2652
2657
  {
2653
2658
  onClick: () => l("pyramid"),
2654
2659
  variant: "ghost",
2655
- children: /* @__PURE__ */ e.jsx(Sa, { className: "size-5" })
2660
+ children: /* @__PURE__ */ e.jsx(ka, { className: "size-5" })
2656
2661
  }
2657
2662
  ),
2658
2663
  /* @__PURE__ */ e.jsx(
@@ -2660,7 +2665,7 @@ function _n() {
2660
2665
  {
2661
2666
  onClick: () => l("range"),
2662
2667
  variant: "ghost",
2663
- children: /* @__PURE__ */ e.jsx(oa, { className: "size-5" })
2668
+ children: /* @__PURE__ */ e.jsx(ca, { className: "size-5" })
2664
2669
  }
2665
2670
  ),
2666
2671
  /* @__PURE__ */ e.jsx(
@@ -2668,7 +2673,7 @@ function _n() {
2668
2673
  {
2669
2674
  onClick: () => l("table"),
2670
2675
  variant: "ghost",
2671
- children: /* @__PURE__ */ e.jsx(vs, { className: "size-5" })
2676
+ children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
2672
2677
  }
2673
2678
  ),
2674
2679
  /* @__PURE__ */ e.jsx(
@@ -2676,52 +2681,52 @@ function _n() {
2676
2681
  {
2677
2682
  onClick: () => l("kpi"),
2678
2683
  variant: "ghost",
2679
- children: /* @__PURE__ */ e.jsx(Ca, { className: "size-6" })
2684
+ children: /* @__PURE__ */ e.jsx(Sa, { className: "size-6" })
2680
2685
  }
2681
2686
  )
2682
2687
  ] }) })
2683
2688
  ] });
2684
2689
  }
2685
- function Hn({ chartType: s, className: n }) {
2690
+ function Bn({ chartType: s, className: n }) {
2686
2691
  switch (s) {
2687
2692
  case "bar":
2688
- return /* @__PURE__ */ e.jsx(Ss, { className: n });
2693
+ return /* @__PURE__ */ e.jsx(ws, { className: n });
2689
2694
  case "line":
2690
- return /* @__PURE__ */ e.jsx(ks, { className: n });
2695
+ return /* @__PURE__ */ e.jsx(zs, { className: n });
2691
2696
  case "pie":
2692
- return /* @__PURE__ */ e.jsx(da, { className: n });
2697
+ return /* @__PURE__ */ e.jsx(ha, { className: n });
2693
2698
  case "radar":
2694
- return /* @__PURE__ */ e.jsx(ja, { className: n });
2699
+ return /* @__PURE__ */ e.jsx(ba, { className: n });
2695
2700
  case "scatter":
2696
- return /* @__PURE__ */ e.jsx(ha, { className: n });
2701
+ return /* @__PURE__ */ e.jsx(ma, { className: n });
2697
2702
  case "bubble":
2698
- return /* @__PURE__ */ e.jsx(va, { className: n });
2703
+ return /* @__PURE__ */ e.jsx(Na, { className: n });
2699
2704
  case "doughnut":
2700
- return /* @__PURE__ */ e.jsx(ba, { className: n });
2705
+ return /* @__PURE__ */ e.jsx(ya, { className: n });
2701
2706
  case "stackedBar":
2702
- return /* @__PURE__ */ e.jsx(Na, { className: "size-4 text-foreground/70" });
2707
+ return /* @__PURE__ */ e.jsx(Ca, { className: "size-4 text-foreground/70" });
2703
2708
  case "polarArea":
2704
- return /* @__PURE__ */ e.jsx(ya, { className: n });
2709
+ return /* @__PURE__ */ e.jsx(va, { className: n });
2705
2710
  case "pyramid":
2706
- return /* @__PURE__ */ e.jsx(Sa, { className: n });
2711
+ return /* @__PURE__ */ e.jsx(ka, { className: n });
2707
2712
  case "range":
2708
- return /* @__PURE__ */ e.jsx(oa, { className: n });
2713
+ return /* @__PURE__ */ e.jsx(ca, { className: n });
2709
2714
  case "kpi":
2710
- return /* @__PURE__ */ e.jsx(Ca, { className: n });
2715
+ return /* @__PURE__ */ e.jsx(Sa, { className: n });
2711
2716
  default:
2712
- return /* @__PURE__ */ e.jsx(vs, { className: n });
2717
+ return /* @__PURE__ */ e.jsx(Ns, { className: n });
2713
2718
  }
2714
2719
  }
2715
- function Bn() {
2720
+ function $n() {
2716
2721
  const s = r(
2717
2722
  (a) => a.card.refreshInterval
2718
2723
  ), n = r(
2719
2724
  (a) => a.actions.setCardRefreshInterval
2720
2725
  );
2721
- return /* @__PURE__ */ e.jsxs(Ke, { children: [
2722
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Pt, { className: "w-4 h-4" }) }) }),
2723
- /* @__PURE__ */ e.jsx(Pe, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2724
- /* @__PURE__ */ e.jsx(R, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2726
+ return /* @__PURE__ */ e.jsxs(Pe, { children: [
2727
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Gt, { className: "w-4 h-4" }) }) }),
2728
+ /* @__PURE__ */ e.jsx(Ge, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2729
+ /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2725
2730
  /* @__PURE__ */ e.jsx(
2726
2731
  ae,
2727
2732
  {
@@ -2735,27 +2740,27 @@ function Bn() {
2735
2740
  ] }) }) }) })
2736
2741
  ] });
2737
2742
  }
2738
- function Hs() {
2743
+ function $s() {
2739
2744
  r((l) => l.frame);
2740
2745
  const s = r((l) => l.card), n = r((l) => l.card.data), a = r((l) => l.isShowingVisual), t = r((l) => l.isSqlRunning), i = r((l) => l.queryError), o = r((l) => l.pythonStdOut);
2741
2746
  return r((l) => l.onSave), r((l) => l.onClose), r((l) => l.actions.setCardSql), r((l) => l.actions.setCardType), r((l) => l.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2742
- t && /* @__PURE__ */ e.jsx(He, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2747
+ t && /* @__PURE__ */ e.jsx(Be, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2743
2748
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2744
2749
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2745
- /* @__PURE__ */ e.jsx(_n, {}),
2746
- s.type !== "table" && /* @__PURE__ */ e.jsx(Rn, {}),
2747
- /* @__PURE__ */ e.jsx(Bn, {})
2750
+ /* @__PURE__ */ e.jsx(Hn, {}),
2751
+ s.type !== "table" && /* @__PURE__ */ e.jsx(_n, {}),
2752
+ /* @__PURE__ */ e.jsx($n, {})
2748
2753
  ] }),
2749
- /* @__PURE__ */ e.jsx(Kn, {})
2754
+ /* @__PURE__ */ e.jsx(Pn, {})
2750
2755
  ] }),
2751
- a ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(zt, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ga, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2752
- o && /* @__PURE__ */ e.jsx($n, {}),
2753
- s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Vn, { data: n || [] }),
2756
+ a ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Ft, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ja, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2757
+ o && /* @__PURE__ */ e.jsx(Kn, {}),
2758
+ s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Rn, { data: n || [] }),
2754
2759
  i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
2755
2760
  ] })
2756
2761
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2757
2762
  }
2758
- function $n() {
2763
+ function Kn() {
2759
2764
  const s = r((a) => a.pythonStdOut);
2760
2765
  if (!s)
2761
2766
  return null;
@@ -2769,17 +2774,17 @@ function $n() {
2769
2774
  className: "bg-muted p-2 font-mono text-sm"
2770
2775
  }
2771
2776
  ),
2772
- /* @__PURE__ */ e.jsx(Cs, { className: "mb-2" })
2777
+ /* @__PURE__ */ e.jsx(Ss, { className: "mb-2" })
2773
2778
  ] });
2774
2779
  }
2775
- function Kn() {
2780
+ function Pn() {
2776
2781
  const s = r((a) => a.isShowingVisual), n = r(
2777
2782
  (a) => a.actions.setIsShowingVisual
2778
2783
  );
2779
2784
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2780
- /* @__PURE__ */ e.jsx(R, { htmlFor: "visualize", children: "Chart" }),
2785
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
2781
2786
  /* @__PURE__ */ e.jsx(
2782
- Ft,
2787
+ Ot,
2783
2788
  {
2784
2789
  checked: s,
2785
2790
  onCheckedChange: () => n(!s),
@@ -2789,48 +2794,212 @@ function Kn() {
2789
2794
  )
2790
2795
  ] });
2791
2796
  }
2792
- const ke = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2793
- function Bs(s, n) {
2797
+ function De() {
2798
+ const [s, n] = T([]);
2799
+ r(
2800
+ (m) => m.card.cfg
2801
+ );
2802
+ const a = r((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = r((m) => m.actions), l = r(
2803
+ (m) => m.queryResultColumns
2804
+ );
2805
+ r(
2806
+ (m) => {
2807
+ var u;
2808
+ return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
2809
+ }
2810
+ ), K(() => {
2811
+ l && n(new Array(l.length).fill(!1));
2812
+ }, [l]);
2813
+ function c(m, u) {
2814
+ var N, d;
2815
+ u ? a != null && a.onClickFilter && ((N = a == null ? void 0 : a.onClickFilter) == null ? void 0 : N.length) > 0 ? o({
2816
+ ...a,
2817
+ onClickFilter: [
2818
+ ...a.onClickFilter,
2819
+ {
2820
+ columnIndex: m,
2821
+ expression: ""
2822
+ }
2823
+ ]
2824
+ }) : o({
2825
+ ...a,
2826
+ onClickFilter: [
2827
+ {
2828
+ columnIndex: m,
2829
+ expression: ""
2830
+ }
2831
+ ]
2832
+ }) : (o({
2833
+ ...a,
2834
+ onClickFilter: (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.filter(
2835
+ (x) => x.columnIndex !== m
2836
+ )
2837
+ }), n((x) => {
2838
+ const f = [...x];
2839
+ return f[m] = !1, f;
2840
+ }));
2841
+ }
2842
+ function h(m, u) {
2843
+ var d;
2844
+ const N = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((x) => x.columnIndex === m ? {
2845
+ ...x,
2846
+ expression: u.target.value
2847
+ } : x);
2848
+ o({
2849
+ ...a,
2850
+ onClickFilter: N
2851
+ });
2852
+ }
2853
+ function g(m) {
2854
+ var u, N, d, x;
2855
+ if (s != null && s[m] || (N = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((f) => f.columnIndex === m)) != null && N.expression)
2856
+ return /* @__PURE__ */ e.jsx(
2857
+ ae,
2858
+ {
2859
+ value: (x = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find((f) => f.columnIndex === m)) == null ? void 0 : x.expression,
2860
+ onChange: (f) => h(m, f),
2861
+ type: "text",
2862
+ className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
2863
+ placeholder: "Expression"
2864
+ }
2865
+ );
2866
+ }
2867
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: l == null ? void 0 : l.map((m, u) => {
2868
+ var N, d;
2869
+ return /* @__PURE__ */ e.jsx(
2870
+ "div",
2871
+ {
2872
+ className: "flex items-center justify-between space-y-2 xbg-red-100 group",
2873
+ children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
2874
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
2875
+ /* @__PURE__ */ e.jsx(
2876
+ Ke,
2877
+ {
2878
+ checked: !!((N = a == null ? void 0 : a.onClickFilter) != null && N.find(
2879
+ (x) => x.columnIndex === u
2880
+ )),
2881
+ onCheckedChange: (x) => c(u, x)
2882
+ }
2883
+ ),
2884
+ /* @__PURE__ */ e.jsx(
2885
+ "label",
2886
+ {
2887
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
2888
+ children: m
2889
+ }
2890
+ ),
2891
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find(
2892
+ (x) => x.columnIndex === u
2893
+ )) && /* @__PURE__ */ e.jsx(
2894
+ da,
2895
+ {
2896
+ onClick: () => {
2897
+ n((x) => {
2898
+ const f = [...x];
2899
+ return f[u] = !x[u], f;
2900
+ });
2901
+ },
2902
+ className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
2903
+ }
2904
+ ) })
2905
+ ] }),
2906
+ g(u)
2907
+ ] })
2908
+ },
2909
+ m
2910
+ );
2911
+ }) });
2912
+ }
2913
+ function Fs() {
2914
+ var o, l, c;
2915
+ const s = r((h) => h.card.preferences), n = r(
2916
+ (h) => h.card.cfg
2917
+ ), { setCardCfg: a, setCardPreferences: t } = r(
2918
+ (h) => h.actions
2919
+ );
2920
+ (o = n == null ? void 0 : n.options) != null && o.indexAxis;
2921
+ function i(h) {
2922
+ var u, N, d, x, f, w;
2923
+ let g = {};
2924
+ (u = s == null ? void 0 : s.chartOptions) != null && u.scales && (g = {
2925
+ x: (d = (N = s == null ? void 0 : s.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : d.y,
2926
+ y: (f = (x = s == null ? void 0 : s.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : f.x
2927
+ });
2928
+ const m = {
2929
+ ...s,
2930
+ chartOptions: {
2931
+ ...s == null ? void 0 : s.chartOptions,
2932
+ scales: {
2933
+ ...(w = s == null ? void 0 : s.chartOptions) == null ? void 0 : w.scales,
2934
+ ...g
2935
+ },
2936
+ indexAxis: h
2937
+ }
2938
+ };
2939
+ t(m);
2940
+ }
2941
+ return /* @__PURE__ */ e.jsxs(
2942
+ ra,
2943
+ {
2944
+ value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
2945
+ onValueChange: i,
2946
+ className: "flex gap-3",
2947
+ defaultValue: "x",
2948
+ children: [
2949
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2950
+ /* @__PURE__ */ e.jsx(Ye, { value: "x", id: "r1" }),
2951
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
2952
+ ] }),
2953
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2954
+ /* @__PURE__ */ e.jsx(Ye, { value: "y", id: "r2" }),
2955
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
2956
+ ] })
2957
+ ]
2958
+ }
2959
+ );
2960
+ }
2961
+ const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2962
+ function Ks(s, n) {
2794
2963
  var t, i, o;
2795
- const a = na(s, n);
2964
+ const a = ia(s, n);
2796
2965
  return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
2797
2966
  }
2798
- function ka() {
2799
- var J, ee, Z, P, I, y;
2967
+ function wa() {
2968
+ var Q, ee, Z, J, I, y;
2800
2969
  const [s, n] = T(!1), a = r((v) => {
2801
2970
  var M;
2802
2971
  return (M = v.card) == null ? void 0 : M.preferences;
2803
2972
  }), t = r((v) => {
2804
2973
  var M;
2805
2974
  return (M = v.card) == null ? void 0 : M.cfg;
2806
- }), i = na(a, t), [o, l] = T(
2807
- Bs(a)
2975
+ }), i = ia(a, t), [o, l] = T(
2976
+ Ks(a)
2808
2977
  ), [c, h] = T(
2809
- ((Z = (ee = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
2978
+ ((Z = (ee = (Q = a == null ? void 0 : a.chartOptions) == null ? void 0 : Q.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
2810
2979
  ), [g, m] = T(
2811
- ((y = (I = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : I[i]) == null ? void 0 : y.max) || ""
2812
- ), [u, N] = T(c || g ? "custom" : "auto"), [d, x] = T(""), [f, w] = T(0), [b, E] = T(""), [C, O] = T(""), [j, F] = T(""), A = r(
2980
+ ((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[i]) == null ? void 0 : y.max) || ""
2981
+ ), [u, N] = T(c || g ? "custom" : "auto"), [d, x] = T(""), [f, w] = T(0), [b, L] = T(""), [C, O] = T(""), [j, F] = T(""), A = r(
2813
2982
  (v) => v.actions.setCardPreferences
2814
2983
  ), q = r((v) => {
2815
2984
  var M;
2816
2985
  return (M = v.card) == null ? void 0 : M.type;
2817
- }), Y = ["pie", "doughnut", "polarArea"].includes(q);
2986
+ }), P = ["pie", "doughnut", "polarArea"].includes(q);
2818
2987
  K(() => {
2819
- var v, M, V, ue, se, ge, je, be, xe, G, ne, le, ye, re;
2820
- l(Bs(a)), h(
2821
- ((V = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[i]) == null ? void 0 : V.min) === 0 ? 0 : ""
2988
+ var v, M, H, ue, se, ge, je, be, xe, U, ne, le, ye, re;
2989
+ l(Ks(a)), h(
2990
+ ((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[i]) == null ? void 0 : H.min) === 0 ? 0 : ""
2822
2991
  ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[i]) == null ? void 0 : ge.max) || ""), x(
2823
- ((G = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : G.stepSize) || ""
2824
- ), w(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), E(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
2992
+ ((U = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : U.stepSize) || ""
2993
+ ), w(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
2825
2994
  }, [s, a, i]);
2826
2995
  function $(v, M) {
2827
2996
  return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
2828
2997
  }
2829
- function U() {
2998
+ function G() {
2830
2999
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2831
3000
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
2832
3001
  /* @__PURE__ */ e.jsx(
2833
- R,
3002
+ B,
2834
3003
  {
2835
3004
  className: "col-span-2 hover:cursor-pointer hover:underline",
2836
3005
  htmlFor: "currency",
@@ -2851,7 +3020,7 @@ function ka() {
2851
3020
  placeholder: "USD",
2852
3021
  onChange: (v) => O(v.target.value),
2853
3022
  id: "currency",
2854
- className: `col-span-2 h-8 w-full ${ke}`
3023
+ className: `col-span-2 h-8 w-full ${we}`
2855
3024
  }
2856
3025
  ),
2857
3026
  /* @__PURE__ */ e.jsx(
@@ -2861,19 +3030,19 @@ function ka() {
2861
3030
  placeholder: "en-US",
2862
3031
  onChange: (v) => F(v.target.value),
2863
3032
  id: "locale",
2864
- className: `col-span-2 h-8 w-full ${ke}`
3033
+ className: `col-span-2 h-8 w-full ${we}`
2865
3034
  }
2866
3035
  )
2867
3036
  ] }),
2868
3037
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
2869
- /* @__PURE__ */ e.jsx(R, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
3038
+ /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
2870
3039
  /* @__PURE__ */ e.jsx(
2871
3040
  ae,
2872
3041
  {
2873
3042
  value: f,
2874
3043
  onChange: (v) => w(Number(v.target.value)),
2875
3044
  id: "format",
2876
- className: `col-span-6 h-8 w-full tracking-wide ${ke}`
3045
+ className: `col-span-6 h-8 w-full tracking-wide ${we}`
2877
3046
  }
2878
3047
  )
2879
3048
  ] })
@@ -2882,14 +3051,14 @@ function ka() {
2882
3051
  function D() {
2883
3052
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2884
3053
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
2885
- /* @__PURE__ */ e.jsx(R, { htmlFor: "range", children: "Range" }),
3054
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "range", children: "Range" }),
2886
3055
  /* @__PURE__ */ e.jsx(
2887
3056
  ae,
2888
3057
  {
2889
3058
  id: "min",
2890
3059
  value: c,
2891
3060
  onChange: (v) => h((M) => $(M, v.target.value)),
2892
- className: `col-span-1 h-8 w-full ${ke}`
3061
+ className: `col-span-1 h-8 w-full ${we}`
2893
3062
  }
2894
3063
  ),
2895
3064
  /* @__PURE__ */ e.jsx(
@@ -2898,26 +3067,26 @@ function ka() {
2898
3067
  value: g,
2899
3068
  onChange: (v) => m((M) => $(M, v.target.value)),
2900
3069
  id: "max",
2901
- className: `col-span-1 h-8 w-full ${ke}`
3070
+ className: `col-span-1 h-8 w-full ${we}`
2902
3071
  }
2903
3072
  )
2904
3073
  ] }),
2905
3074
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
2906
- /* @__PURE__ */ e.jsx(R, { htmlFor: "step-size", children: "Step Size" }),
3075
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "step-size", children: "Step Size" }),
2907
3076
  /* @__PURE__ */ e.jsx(
2908
3077
  ae,
2909
3078
  {
2910
3079
  value: d,
2911
3080
  onChange: (v) => x((M) => $(M, v.target.value)),
2912
3081
  id: "step-size",
2913
- className: `col-span-1 h-8 w-full ${ke}`
3082
+ className: `col-span-1 h-8 w-full ${we}`
2914
3083
  }
2915
3084
  )
2916
3085
  ] })
2917
3086
  ] });
2918
3087
  }
2919
3088
  function te() {
2920
- var V;
3089
+ var H;
2921
3090
  let v = {};
2922
3091
  u === "custom" && (v = {
2923
3092
  min: c,
@@ -2931,7 +3100,7 @@ function ka() {
2931
3100
  chartOptions: {
2932
3101
  ...a == null ? void 0 : a.chartOptions,
2933
3102
  scales: {
2934
- ...(V = a == null ? void 0 : a.chartOptions) == null ? void 0 : V.scales,
3103
+ ...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
2935
3104
  [i]: {
2936
3105
  // ...cardPreferences?.chartOptions?.scales?.[axis],
2937
3106
  type: o,
@@ -2948,25 +3117,25 @@ function ka() {
2948
3117
  };
2949
3118
  A(M);
2950
3119
  }
2951
- return /* @__PURE__ */ e.jsxs(Ke, { onOpenChange: (v) => n(v), children: [
2952
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ot, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
2953
- /* @__PURE__ */ e.jsx(Pe, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3120
+ return /* @__PURE__ */ e.jsxs(Pe, { onOpenChange: (v) => n(v), children: [
3121
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3122
+ /* @__PURE__ */ e.jsx(Ge, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
2954
3123
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2955
3124
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
2956
3125
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
2957
3126
  ] }),
2958
3127
  /* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
2959
3128
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
2960
- /* @__PURE__ */ e.jsx(R, { htmlFor: "scale", children: "Type" }),
3129
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "scale", children: "Type" }),
2961
3130
  /* @__PURE__ */ e.jsxs(
2962
- Fe,
3131
+ Oe,
2963
3132
  {
2964
- disabled: Y,
3133
+ disabled: P,
2965
3134
  value: o,
2966
3135
  onValueChange: (v) => l(v),
2967
3136
  children: [
2968
- /* @__PURE__ */ e.jsx(Oe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, {}) }),
2969
- /* @__PURE__ */ e.jsx(Te, { id: "type", children: /* @__PURE__ */ e.jsxs(_e, { children: [
3137
+ /* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3138
+ /* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(He, { children: [
2970
3139
  /* @__PURE__ */ e.jsx(Le, { children: "Option" }),
2971
3140
  /* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
2972
3141
  /* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
@@ -2976,11 +3145,11 @@ function ka() {
2976
3145
  )
2977
3146
  ] }),
2978
3147
  o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
2979
- /* @__PURE__ */ e.jsx(R, { htmlFor: "scale-option", children: "Setup" }),
3148
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
2980
3149
  /* @__PURE__ */ e.jsxs(
2981
- la,
3150
+ ra,
2982
3151
  {
2983
- disabled: Y,
3152
+ disabled: P,
2984
3153
  id: "scale-option",
2985
3154
  value: u,
2986
3155
  onValueChange: (v) => N(v),
@@ -3000,8 +3169,8 @@ function ka() {
3000
3169
  )
3001
3170
  ] }),
3002
3171
  u === "custom" && o == "linear" && D(),
3003
- U(),
3004
- /* @__PURE__ */ e.jsx(Mt, {}),
3172
+ G(),
3173
+ /* @__PURE__ */ e.jsx(Tt, {}),
3005
3174
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3006
3175
  z,
3007
3176
  {
@@ -3015,46 +3184,304 @@ function ka() {
3015
3184
  ] }) })
3016
3185
  ] });
3017
3186
  }
3018
- function ws() {
3019
- var i, o, l;
3020
- const s = r(
3021
- (c) => c.card.cfg
3022
- ), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
3023
- function t(c) {
3024
- var m;
3025
- const h = {
3026
- datalabels: {
3027
- display: c !== "none",
3028
- align: c,
3029
- anchor: c,
3030
- clamp: !0
3031
- }
3032
- }, g = {
3033
- ...s,
3034
- options: {
3035
- ...s == null ? void 0 : s.options,
3036
- plugins: {
3037
- ...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
3038
- ...h
3039
- }
3040
- }
3187
+ function Un({ idx: s }) {
3188
+ var c;
3189
+ const n = r((h) => {
3190
+ var g;
3191
+ return (g = h.card) == null ? void 0 : g.preferences;
3192
+ }), a = r(
3193
+ (h) => {
3194
+ var g;
3195
+ return (g = h.card.preferences) == null ? void 0 : g.datasetOptions;
3196
+ }
3197
+ ), t = r(
3198
+ (h) => h.actions.setCardPreferences
3199
+ ), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((h) => h.idx === s);
3200
+ function l(h, g) {
3201
+ (h === "end" || h === "start") && Et(Lt());
3202
+ const m = {
3203
+ display: h !== "none",
3204
+ align: h,
3205
+ anchor: h,
3206
+ clamp: !0
3041
3207
  };
3042
- n(g), console.log(c);
3043
- }
3208
+ if (!o)
3209
+ t({
3210
+ ...n,
3211
+ datasetOptions: [
3212
+ ...a || [],
3213
+ {
3214
+ idx: g,
3215
+ datalabels: m
3216
+ }
3217
+ ]
3218
+ });
3219
+ else {
3220
+ const u = { ...o };
3221
+ u.datalabels = m;
3222
+ const N = a == null ? void 0 : a.map(
3223
+ (d) => d.idx === g ? u : d
3224
+ );
3225
+ t({
3226
+ ...n,
3227
+ datasetOptions: N
3228
+ });
3229
+ }
3230
+ }
3231
+ return /* @__PURE__ */ e.jsxs(Pe, { children: [
3232
+ /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(xn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3233
+ /* @__PURE__ */ e.jsx(Ge, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3234
+ /* @__PURE__ */ e.jsx(
3235
+ z,
3236
+ {
3237
+ onClick: () => l("none", s),
3238
+ size: "sm",
3239
+ variant: "secondary",
3240
+ className: "h-7 p-1 text-xs font-normal",
3241
+ children: /* @__PURE__ */ e.jsx(At, { className: "size-4" })
3242
+ }
3243
+ ),
3244
+ /* @__PURE__ */ e.jsx(
3245
+ z,
3246
+ {
3247
+ onClick: () => l("start", s),
3248
+ size: "sm",
3249
+ variant: "secondary",
3250
+ className: "h-7 p-1 text-xs font-normal",
3251
+ children: /* @__PURE__ */ e.jsx(
3252
+ an,
3253
+ {
3254
+ className: Y("h-4 w-4", {
3255
+ "rotate-90": i === "y"
3256
+ })
3257
+ }
3258
+ )
3259
+ }
3260
+ ),
3261
+ /* @__PURE__ */ e.jsx(
3262
+ z,
3263
+ {
3264
+ onClick: () => l("center", s),
3265
+ size: "sm",
3266
+ variant: "secondary",
3267
+ className: "h-7 p-1 text-xs font-normal",
3268
+ children: /* @__PURE__ */ e.jsx(
3269
+ nn,
3270
+ {
3271
+ className: Y("h-4 w-4", {
3272
+ "rotate-90": i === "y"
3273
+ })
3274
+ }
3275
+ )
3276
+ }
3277
+ ),
3278
+ /* @__PURE__ */ e.jsx(
3279
+ z,
3280
+ {
3281
+ onClick: () => l("end", s),
3282
+ size: "sm",
3283
+ variant: "secondary",
3284
+ className: "h-7 p-1 text-xs font-normal",
3285
+ children: /* @__PURE__ */ e.jsx(
3286
+ tn,
3287
+ {
3288
+ className: Y("h-4 w-4", {
3289
+ "rotate-90": i === "y"
3290
+ })
3291
+ }
3292
+ )
3293
+ }
3294
+ )
3295
+ ] }) })
3296
+ ] });
3297
+ }
3298
+ function za() {
3299
+ const s = r((h) => h.card), n = r(
3300
+ (h) => {
3301
+ var g, m, u;
3302
+ return (u = (m = (g = h == null ? void 0 : h.card) == null ? void 0 : g.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3303
+ }
3304
+ ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3305
+ keys: i,
3306
+ metricKeys: o,
3307
+ dimensionKeys: l
3308
+ } = hs(s.data || []);
3309
+ let c = o;
3310
+ if (s.type === "stackedBar") {
3311
+ const h = Dt({
3312
+ dataArray: s.data || [],
3313
+ groupKey: l[0],
3314
+ pivotKey: l[1],
3315
+ valueKey: c[0]
3316
+ }), { metricKeys: g } = hs(h);
3317
+ c = g;
3318
+ }
3319
+ return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3320
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3321
+ /* @__PURE__ */ e.jsx(B, { children: a }),
3322
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: l[0] }) }) })
3323
+ ] }),
3324
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3325
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3326
+ /* @__PURE__ */ e.jsx(B, { children: t }),
3327
+ /* @__PURE__ */ e.jsx(wa, {})
3328
+ ] }),
3329
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((h, g) => /* @__PURE__ */ e.jsx(Gn, { col: h, idx: g }, h)) })
3330
+ ] })
3331
+ ] });
3332
+ }
3333
+ function Gn({ col: s, idx: n }) {
3334
+ const a = r((c) => {
3335
+ var h;
3336
+ return (h = c.card) == null ? void 0 : h.preferences;
3337
+ }), t = r(
3338
+ (c) => {
3339
+ var h;
3340
+ return (h = c.card.preferences) == null ? void 0 : h.datasetOptions;
3341
+ }
3342
+ ), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
3343
+ function l(c) {
3344
+ if (!i)
3345
+ o({
3346
+ ...a,
3347
+ datasetOptions: [
3348
+ ...t || [],
3349
+ {
3350
+ idx: n,
3351
+ type: c === "area" ? "line" : c,
3352
+ fill: c === "area" ? "origin" : ""
3353
+ }
3354
+ ]
3355
+ });
3356
+ else {
3357
+ const h = { ...i };
3358
+ h.type = c === "area" ? "line" : c, h.fill = c === "area" ? "origin" : "";
3359
+ const g = t == null ? void 0 : t.map(
3360
+ (m) => m.idx === n ? h : m
3361
+ );
3362
+ o({
3363
+ ...a,
3364
+ datasetOptions: g
3365
+ });
3366
+ }
3367
+ }
3368
+ return /* @__PURE__ */ e.jsxs("div", { className: "group flex items-center justify-between gap-5 rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: [
3369
+ /* @__PURE__ */ e.jsx("p", { children: s }),
3370
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3371
+ /* @__PURE__ */ e.jsx(
3372
+ ws,
3373
+ {
3374
+ onClick: () => l("bar"),
3375
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3376
+ }
3377
+ ),
3378
+ /* @__PURE__ */ e.jsx(
3379
+ zs,
3380
+ {
3381
+ onClick: () => l("line"),
3382
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3383
+ }
3384
+ ),
3385
+ /* @__PURE__ */ e.jsx(
3386
+ Jt,
3387
+ {
3388
+ onClick: () => l("area"),
3389
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3390
+ }
3391
+ ),
3392
+ /* @__PURE__ */ e.jsx(
3393
+ Ss,
3394
+ {
3395
+ orientation: "vertical",
3396
+ className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3397
+ }
3398
+ ),
3399
+ /* @__PURE__ */ e.jsx(Un, { idx: n })
3400
+ ] })
3401
+ ] });
3402
+ }
3403
+ function Jn({
3404
+ cardType: s
3405
+ }) {
3406
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3407
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3408
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3409
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3410
+ /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
3411
+ /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3412
+ /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
3413
+ /* @__PURE__ */ e.jsx("li", { children: "y-axis1 - number" }),
3414
+ /* @__PURE__ */ e.jsx("li", { children: "y-axis2 - number" })
3415
+ ] }),
3416
+ /* @__PURE__ */ e.jsxs("div", { children: [
3417
+ "See ",
3418
+ /* @__PURE__ */ e.jsx(
3419
+ "a",
3420
+ {
3421
+ target: "_blank",
3422
+ onClick: (n) => n.stopPropagation(),
3423
+ className: "text-blue-700",
3424
+ href: "https://docs.semaphor.cloud/concepts/visuals#line-chart",
3425
+ children: "example"
3426
+ }
3427
+ ),
3428
+ " in the docs."
3429
+ ] })
3430
+ ] })
3431
+ ] }),
3432
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3433
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3434
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3435
+ /* @__PURE__ */ e.jsx(Fs, {}),
3436
+ /* @__PURE__ */ e.jsx(za, {})
3437
+ ] })
3438
+ ] }),
3439
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3440
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3441
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3442
+ ] })
3443
+ ] }) });
3444
+ }
3445
+ function Os() {
3446
+ var i, o, l;
3447
+ const s = r(
3448
+ (c) => c.card.cfg
3449
+ ), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
3450
+ function t(c) {
3451
+ var m;
3452
+ const h = {
3453
+ datalabels: {
3454
+ display: c !== "none",
3455
+ align: c,
3456
+ anchor: c,
3457
+ clamp: !0
3458
+ }
3459
+ }, g = {
3460
+ ...s,
3461
+ options: {
3462
+ ...s == null ? void 0 : s.options,
3463
+ plugins: {
3464
+ ...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
3465
+ ...h
3466
+ }
3467
+ }
3468
+ };
3469
+ n(g), console.log(c);
3470
+ }
3044
3471
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3045
3472
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3046
3473
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3047
- !["pyramid", "range"].includes(a) && /* @__PURE__ */ e.jsx(ka, {})
3474
+ !["pyramid", "range"].includes(a) && /* @__PURE__ */ e.jsx(wa, {})
3048
3475
  ] }),
3049
3476
  /* @__PURE__ */ e.jsxs(
3050
- Fe,
3477
+ Oe,
3051
3478
  {
3052
3479
  value: (l = (o = (i = s == null ? void 0 : s.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : l.anchor,
3053
3480
  onValueChange: t,
3054
3481
  defaultValue: "none",
3055
3482
  children: [
3056
- /* @__PURE__ */ e.jsx(Oe, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, { placeholder: "Select position" }) }),
3057
- /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3483
+ /* @__PURE__ */ e.jsx(Me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, { placeholder: "Select position" }) }),
3484
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3058
3485
  /* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
3059
3486
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
3060
3487
  a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
@@ -3066,216 +3493,52 @@ function ws() {
3066
3493
  )
3067
3494
  ] });
3068
3495
  }
3069
- function Ge() {
3070
- const [s, n] = T([]);
3071
- r(
3072
- (m) => m.card.cfg
3073
- );
3074
- const a = r((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = r((m) => m.actions), l = r(
3075
- (m) => m.queryResultColumns
3076
- );
3077
- r(
3078
- (m) => {
3079
- var u;
3080
- return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
3081
- }
3082
- ), K(() => {
3083
- l && n(new Array(l.length).fill(!1));
3084
- }, [l]);
3085
- function c(m, u) {
3086
- var N, d;
3087
- u ? a != null && a.onClickFilter && ((N = a == null ? void 0 : a.onClickFilter) == null ? void 0 : N.length) > 0 ? o({
3088
- ...a,
3089
- onClickFilter: [
3090
- ...a.onClickFilter,
3091
- {
3092
- columnIndex: m,
3093
- expression: ""
3094
- }
3095
- ]
3096
- }) : o({
3097
- ...a,
3098
- onClickFilter: [
3099
- {
3100
- columnIndex: m,
3101
- expression: ""
3102
- }
3103
- ]
3104
- }) : (o({
3105
- ...a,
3106
- onClickFilter: (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.filter(
3107
- (x) => x.columnIndex !== m
3108
- )
3109
- }), n((x) => {
3110
- const f = [...x];
3111
- return f[m] = !1, f;
3112
- }));
3113
- }
3114
- function h(m, u) {
3115
- var d;
3116
- const N = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((x) => x.columnIndex === m ? {
3117
- ...x,
3118
- expression: u.target.value
3119
- } : x);
3120
- o({
3121
- ...a,
3122
- onClickFilter: N
3123
- });
3124
- }
3125
- function g(m) {
3126
- var u, N, d, x;
3127
- if (s != null && s[m] || (N = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((f) => f.columnIndex === m)) != null && N.expression)
3128
- return /* @__PURE__ */ e.jsx(
3129
- ae,
3130
- {
3131
- value: (x = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find((f) => f.columnIndex === m)) == null ? void 0 : x.expression,
3132
- onChange: (f) => h(m, f),
3133
- type: "text",
3134
- className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
3135
- placeholder: "Expression"
3136
- }
3137
- );
3138
- }
3139
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: l == null ? void 0 : l.map((m, u) => {
3140
- var N, d;
3141
- return /* @__PURE__ */ e.jsx(
3142
- "div",
3143
- {
3144
- className: "flex items-center justify-between space-y-2 xbg-red-100 group",
3145
- children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
3146
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
3147
- /* @__PURE__ */ e.jsx(
3148
- $e,
3149
- {
3150
- checked: !!((N = a == null ? void 0 : a.onClickFilter) != null && N.find(
3151
- (x) => x.columnIndex === u
3152
- )),
3153
- onCheckedChange: (x) => c(u, x)
3154
- }
3155
- ),
3156
- /* @__PURE__ */ e.jsx(
3157
- "label",
3158
- {
3159
- className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
3160
- children: m
3161
- }
3162
- ),
3163
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find(
3164
- (x) => x.columnIndex === u
3165
- )) && /* @__PURE__ */ e.jsx(
3166
- ca,
3167
- {
3168
- onClick: () => {
3169
- n((x) => {
3170
- const f = [...x];
3171
- return f[u] = !x[u], f;
3172
- });
3173
- },
3174
- className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
3175
- }
3176
- ) })
3177
- ] }),
3178
- g(u)
3179
- ] })
3180
- },
3181
- m
3182
- );
3183
- }) });
3184
- }
3185
- function Un({
3496
+ function Qn({
3186
3497
  cardType: s
3187
3498
  }) {
3188
3499
  function n(a) {
3189
3500
  const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", i = "SELECT label, [group], x-axis, y-axis FROM table";
3190
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3191
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : i }),
3192
- /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
3193
- /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3194
- /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
3195
- /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
3196
- /* @__PURE__ */ e.jsx("li", { children: "y-axis - category" }),
3197
- a === "bubble" && /* @__PURE__ */ e.jsx("li", { children: "radius - number" })
3198
- ] }),
3199
- /* @__PURE__ */ e.jsxs("div", { children: [
3200
- "See ",
3201
- /* @__PURE__ */ e.jsx(
3202
- "a",
3203
- {
3204
- target: "_blank",
3205
- onClick: (o) => o.stopPropagation(),
3206
- className: "text-blue-700",
3207
- href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3208
- children: "example"
3209
- }
3210
- ),
3211
- " in the docs."
3212
- ] })
3213
- ] });
3214
- }
3215
- return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
3216
- /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3217
- /* @__PURE__ */ e.jsx(H, { children: `${ra(s)} Chart` }),
3218
- /* @__PURE__ */ e.jsx(B, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3219
- ] }),
3220
- /* @__PURE__ */ e.jsxs(_, { value: "item-2", children: [
3221
- /* @__PURE__ */ e.jsx(H, { children: "Settings" }),
3222
- /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(ws, {}) })
3223
- ] }),
3224
- /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3225
- /* @__PURE__ */ e.jsx(H, { children: "Filter on click" }),
3226
- /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ge, {}) })
3227
- ] })
3228
- ] }) });
3229
- }
3230
- function wa() {
3231
- var o, l, c;
3232
- const s = r((h) => h.card.preferences), n = r(
3233
- (h) => h.card.cfg
3234
- ), { setCardCfg: a, setCardPreferences: t } = r(
3235
- (h) => h.actions
3236
- );
3237
- (o = n == null ? void 0 : n.options) != null && o.indexAxis;
3238
- function i(h) {
3239
- var u, N, d, x, f, w;
3240
- let g = {};
3241
- (u = s == null ? void 0 : s.chartOptions) != null && u.scales && (g = {
3242
- x: (d = (N = s == null ? void 0 : s.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : d.y,
3243
- y: (f = (x = s == null ? void 0 : s.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : f.x
3244
- });
3245
- const m = {
3246
- ...s,
3247
- chartOptions: {
3248
- ...s == null ? void 0 : s.chartOptions,
3249
- scales: {
3250
- ...(w = s == null ? void 0 : s.chartOptions) == null ? void 0 : w.scales,
3251
- ...g
3252
- },
3253
- indexAxis: h
3254
- }
3255
- };
3256
- t(m);
3501
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3502
+ /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : i }),
3503
+ /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
3504
+ /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3505
+ /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
3506
+ /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
3507
+ /* @__PURE__ */ e.jsx("li", { children: "y-axis - category" }),
3508
+ a === "bubble" && /* @__PURE__ */ e.jsx("li", { children: "radius - number" })
3509
+ ] }),
3510
+ /* @__PURE__ */ e.jsxs("div", { children: [
3511
+ "See ",
3512
+ /* @__PURE__ */ e.jsx(
3513
+ "a",
3514
+ {
3515
+ target: "_blank",
3516
+ onClick: (o) => o.stopPropagation(),
3517
+ className: "text-blue-700",
3518
+ href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3519
+ children: "example"
3520
+ }
3521
+ ),
3522
+ " in the docs."
3523
+ ] })
3524
+ ] });
3257
3525
  }
3258
- return /* @__PURE__ */ e.jsxs(
3259
- la,
3260
- {
3261
- value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
3262
- onValueChange: i,
3263
- className: "flex gap-3",
3264
- defaultValue: "x",
3265
- children: [
3266
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3267
- /* @__PURE__ */ e.jsx(Ye, { value: "x", id: "r1" }),
3268
- /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
3269
- ] }),
3270
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3271
- /* @__PURE__ */ e.jsx(Ye, { value: "y", id: "r2" }),
3272
- /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
3273
- ] })
3274
- ]
3275
- }
3276
- );
3526
+ return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3527
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3528
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3529
+ /* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3530
+ ] }),
3531
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3532
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3533
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
3534
+ ] }),
3535
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3536
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3537
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3538
+ ] })
3539
+ ] }) });
3277
3540
  }
3278
- const Pn = {
3541
+ const Wn = {
3279
3542
  datasets: [
3280
3543
  {
3281
3544
  type: "line",
@@ -3288,7 +3551,7 @@ const Pn = {
3288
3551
  data: []
3289
3552
  }
3290
3553
  ]
3291
- }, Gn = {
3554
+ }, Yn = {
3292
3555
  datasets: [
3293
3556
  {
3294
3557
  fill: "origin",
@@ -3298,29 +3561,29 @@ const Pn = {
3298
3561
  }
3299
3562
  ]
3300
3563
  };
3301
- function Jn() {
3564
+ function Xn() {
3302
3565
  const s = r((n) => n.card.type);
3303
3566
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
3304
3567
  /* @__PURE__ */ e.jsx(
3305
- Ee,
3568
+ Se,
3306
3569
  {
3307
3570
  className: " ",
3308
3571
  type: "single",
3309
3572
  collapsible: !0,
3310
- children: Qn(s)
3573
+ children: Zn(s)
3311
3574
  }
3312
3575
  ),
3313
- /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(wa, {}) }),
3314
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(ws, {}) }),
3315
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ge, {}) })
3576
+ /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Fs, {}) }),
3577
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Os, {}) }),
3578
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(De, {}) })
3316
3579
  ] });
3317
3580
  }
3318
- function Qn(s) {
3581
+ function Zn(s) {
3319
3582
  if (["line", "bar"].includes(s))
3320
3583
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3321
- /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3322
- /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3323
- /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3584
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3585
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3586
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3324
3587
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
3325
3588
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3326
3589
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
@@ -3328,20 +3591,20 @@ function Qn(s) {
3328
3591
  ] })
3329
3592
  ] })
3330
3593
  ] }),
3331
- /* @__PURE__ */ e.jsxs(_, { value: "item-2", children: [
3332
- /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: "Mixed Chart" }),
3333
- /* @__PURE__ */ e.jsxs(B, { className: "space-y-2 text-xs", children: [
3594
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3595
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
3596
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3334
3597
  /* @__PURE__ */ e.jsxs("p", { children: [
3335
3598
  "Click ",
3336
3599
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
3337
3600
  " and change the `type` property in the dataset."
3338
3601
  ] }),
3339
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Pn, null, 2) })
3602
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Wn, null, 2) })
3340
3603
  ] })
3341
3604
  ] }),
3342
- /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3343
- /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: "Area Chart" }),
3344
- /* @__PURE__ */ e.jsxs(B, { className: "space-y-2 text-xs", children: [
3605
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3606
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
3607
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3345
3608
  /* @__PURE__ */ e.jsxs("p", { children: [
3346
3609
  "Click ",
3347
3610
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
@@ -3357,18 +3620,18 @@ function Qn(s) {
3357
3620
  ),
3358
3621
  "for more options."
3359
3622
  ] }),
3360
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gn, null, 2) })
3623
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Yn, null, 2) })
3361
3624
  ] })
3362
3625
  ] })
3363
3626
  ] });
3364
3627
  if (s === "bubble")
3365
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3366
- /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3628
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3629
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3367
3630
  "How to create a ",
3368
3631
  /* @__PURE__ */ e.jsx("span", { children: s }),
3369
3632
  " chart query?"
3370
3633
  ] }) }),
3371
- /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3634
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3372
3635
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
3373
3636
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3374
3637
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -3380,13 +3643,13 @@ function Qn(s) {
3380
3643
  ] })
3381
3644
  ] }) });
3382
3645
  if (s === "scatter")
3383
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3384
- /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3646
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3647
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3385
3648
  "How to create a ",
3386
3649
  /* @__PURE__ */ e.jsx("span", { children: s }),
3387
3650
  " chart query?"
3388
3651
  ] }) }),
3389
- /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3652
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3390
3653
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis FROM table" }),
3391
3654
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3392
3655
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -3397,13 +3660,13 @@ function Qn(s) {
3397
3660
  ] })
3398
3661
  ] }) });
3399
3662
  if (["pie", "doughnut", "polarArea"].includes(s))
3400
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3401
- /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3663
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3664
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3402
3665
  /* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
3403
3666
  " ",
3404
3667
  "chart query"
3405
3668
  ] }) }),
3406
- /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3669
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3407
3670
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
3408
3671
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3409
3672
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -3412,7 +3675,7 @@ function Qn(s) {
3412
3675
  ] })
3413
3676
  ] }) });
3414
3677
  }
3415
- function Wn() {
3678
+ function el() {
3416
3679
  var h, g, m, u, N;
3417
3680
  const s = r((d) => d.card.preferences), n = r(
3418
3681
  (d) => d.actions.setCardPreferences
@@ -3446,11 +3709,11 @@ function Wn() {
3446
3709
  }
3447
3710
  ) || [], l = r(
3448
3711
  (d) => d.actions.setColorRanges
3449
- ), c = [...new Set(qs.map((d) => d.currency))];
3712
+ ), c = [...new Set(Rs.map((d) => d.currency))];
3450
3713
  return /* @__PURE__ */ e.jsxs("div", { children: [
3451
3714
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
3452
3715
  /* @__PURE__ */ e.jsx(
3453
- $e,
3716
+ Ke,
3454
3717
  {
3455
3718
  checked: !!((h = s == null ? void 0 : s.formatNumber) != null && h.enabled),
3456
3719
  onCheckedChange: (d) => {
@@ -3464,15 +3727,15 @@ function Wn() {
3464
3727
  }
3465
3728
  }
3466
3729
  ),
3467
- /* @__PURE__ */ e.jsx(R, { children: "Format Number" })
3730
+ /* @__PURE__ */ e.jsx(B, { children: "Format Number" })
3468
3731
  ] }),
3469
3732
  ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
3470
3733
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
3471
3734
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
3472
3735
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3473
- /* @__PURE__ */ e.jsx(R, { children: "Locale" }),
3736
+ /* @__PURE__ */ e.jsx(B, { children: "Locale" }),
3474
3737
  /* @__PURE__ */ e.jsxs(
3475
- Fe,
3738
+ Oe,
3476
3739
  {
3477
3740
  value: t || "en-US",
3478
3741
  onValueChange: (d) => {
@@ -3485,19 +3748,19 @@ function Wn() {
3485
3748
  );
3486
3749
  },
3487
3750
  children: [
3488
- /* @__PURE__ */ e.jsx(Oe, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, {}) }),
3489
- /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3751
+ /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3752
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3490
3753
  /* @__PURE__ */ e.jsx(Le, { children: "Format" }),
3491
- qs.map((d) => /* @__PURE__ */ e.jsx(X, { value: d.locale, children: d.locale }, d.locale))
3754
+ Rs.map((d) => /* @__PURE__ */ e.jsx(X, { value: d.locale, children: d.locale }, d.locale))
3492
3755
  ] }) })
3493
3756
  ]
3494
3757
  }
3495
3758
  )
3496
3759
  ] }),
3497
3760
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3498
- /* @__PURE__ */ e.jsx(R, { children: "Currency" }),
3761
+ /* @__PURE__ */ e.jsx(B, { children: "Currency" }),
3499
3762
  /* @__PURE__ */ e.jsxs(
3500
- Fe,
3763
+ Oe,
3501
3764
  {
3502
3765
  value: i || "none",
3503
3766
  onValueChange: (d) => {
@@ -3510,8 +3773,8 @@ function Wn() {
3510
3773
  );
3511
3774
  },
3512
3775
  children: [
3513
- /* @__PURE__ */ e.jsx(Oe, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, {}) }),
3514
- /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3776
+ /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3777
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3515
3778
  /* @__PURE__ */ e.jsx(Le, { children: "Currency" }),
3516
3779
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
3517
3780
  c.map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d))
@@ -3523,9 +3786,9 @@ function Wn() {
3523
3786
  ] }),
3524
3787
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3525
3788
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3526
- /* @__PURE__ */ e.jsx(R, { children: "Decimals" }),
3789
+ /* @__PURE__ */ e.jsx(B, { children: "Decimals" }),
3527
3790
  /* @__PURE__ */ e.jsxs(
3528
- Fe,
3791
+ Oe,
3529
3792
  {
3530
3793
  value: ((u = (m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : u.toString()) || "0",
3531
3794
  onValueChange: (d) => {
@@ -3538,14 +3801,14 @@ function Wn() {
3538
3801
  );
3539
3802
  },
3540
3803
  children: [
3541
- /* @__PURE__ */ e.jsx(Oe, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, {}) }),
3542
- /* @__PURE__ */ e.jsx(Te, { children: ["0", "1", "2", "3", "4"].map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d)) })
3804
+ /* @__PURE__ */ e.jsx(Me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3805
+ /* @__PURE__ */ e.jsx(Ae, { children: ["0", "1", "2", "3", "4"].map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d)) })
3543
3806
  ]
3544
3807
  }
3545
3808
  )
3546
3809
  ] }),
3547
3810
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3548
- /* @__PURE__ */ e.jsx(R, { children: "Suffix" }),
3811
+ /* @__PURE__ */ e.jsx(B, { children: "Suffix" }),
3549
3812
  /* @__PURE__ */ e.jsx(
3550
3813
  ae,
3551
3814
  {
@@ -3566,9 +3829,9 @@ function Wn() {
3566
3829
  ] })
3567
3830
  ] })
3568
3831
  ] }) }),
3569
- /* @__PURE__ */ e.jsx(Cs, { className: "my-3" }),
3832
+ /* @__PURE__ */ e.jsx(Ss, { className: "my-3" }),
3570
3833
  /* @__PURE__ */ e.jsx(
3571
- Tt,
3834
+ It,
3572
3835
  {
3573
3836
  colorRanges: o,
3574
3837
  setColorRanges: l
@@ -3577,11 +3840,11 @@ function Wn() {
3577
3840
  ] })
3578
3841
  ] });
3579
3842
  }
3580
- function Yn() {
3843
+ function sl() {
3581
3844
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3582
- /* @__PURE__ */ e.jsx(Ee, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3583
- /* @__PURE__ */ e.jsx(H, { className: "", children: "KPI Query" }),
3584
- /* @__PURE__ */ e.jsxs(B, { className: "font-mono", children: [
3845
+ /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3846
+ /* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
3847
+ /* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
3585
3848
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
3586
3849
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
3587
3850
  /* @__PURE__ */ e.jsx("li", { children: "current - number" }),
@@ -3603,7 +3866,7 @@ function Yn() {
3603
3866
  ] })
3604
3867
  ] })
3605
3868
  ] }) }),
3606
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Wn, {}) }),
3869
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(el, {}) }),
3607
3870
  /* @__PURE__ */ e.jsx("div", {}),
3608
3871
  /* @__PURE__ */ e.jsx("div", {})
3609
3872
  ] });
@@ -3612,10 +3875,10 @@ function os({
3612
3875
  cardType: s,
3613
3876
  docContent: n
3614
3877
  }) {
3615
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
3616
- /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3617
- /* @__PURE__ */ e.jsx(H, { children: `${ra(s)} Chart` }),
3618
- /* @__PURE__ */ e.jsx(B, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3878
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3879
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3880
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3881
+ /* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3619
3882
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
3620
3883
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3621
3884
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
@@ -3637,237 +3900,21 @@ function os({
3637
3900
  ] })
3638
3901
  ] }) })
3639
3902
  ] }),
3640
- /* @__PURE__ */ e.jsxs(_, { value: "item-2", children: [
3641
- /* @__PURE__ */ e.jsx(H, { children: "Settings" }),
3642
- /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(ws, {}) })
3903
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3904
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3905
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
3643
3906
  ] }),
3644
- s !== "range" && /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3645
- /* @__PURE__ */ e.jsx(H, { children: "Filter on click" }),
3646
- /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ge, {}) })
3907
+ s !== "range" && /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3908
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3909
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3647
3910
  ] })
3648
3911
  ] }) });
3649
3912
  }
3650
- function Xn({ idx: s }) {
3651
- var c;
3652
- const n = r((h) => {
3653
- var g;
3654
- return (g = h.card) == null ? void 0 : g.preferences;
3655
- }), a = r(
3656
- (h) => {
3657
- var g;
3658
- return (g = h.card.preferences) == null ? void 0 : g.datasetOptions;
3659
- }
3660
- ), t = r(
3661
- (h) => h.actions.setCardPreferences
3662
- ), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((h) => h.idx === s);
3663
- function l(h, g) {
3664
- (h === "end" || h === "start") && Lt(Et());
3665
- const m = {
3666
- display: h !== "none",
3667
- align: h,
3668
- anchor: h,
3669
- clamp: !0
3670
- };
3671
- if (!o)
3672
- t({
3673
- ...n,
3674
- datasetOptions: [
3675
- ...a || [],
3676
- {
3677
- idx: g,
3678
- datalabels: m
3679
- }
3680
- ]
3681
- });
3682
- else {
3683
- const u = { ...o };
3684
- u.datalabels = m;
3685
- const N = a == null ? void 0 : a.map(
3686
- (d) => d.idx === g ? u : d
3687
- );
3688
- t({
3689
- ...n,
3690
- datasetOptions: N
3691
- });
3692
- }
3693
- }
3694
- return /* @__PURE__ */ e.jsxs(Ke, { children: [
3695
- /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(un, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3696
- /* @__PURE__ */ e.jsx(Pe, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3697
- /* @__PURE__ */ e.jsx(
3698
- z,
3699
- {
3700
- onClick: () => l("none", s),
3701
- size: "sm",
3702
- variant: "secondary",
3703
- className: "h-7 p-1 text-xs font-normal",
3704
- children: /* @__PURE__ */ e.jsx(At, { className: "size-4" })
3705
- }
3706
- ),
3707
- /* @__PURE__ */ e.jsx(
3708
- z,
3709
- {
3710
- onClick: () => l("start", s),
3711
- size: "sm",
3712
- variant: "secondary",
3713
- className: "h-7 p-1 text-xs font-normal",
3714
- children: /* @__PURE__ */ e.jsx(
3715
- sn,
3716
- {
3717
- className: W("h-4 w-4", {
3718
- "rotate-90": i === "y"
3719
- })
3720
- }
3721
- )
3722
- }
3723
- ),
3724
- /* @__PURE__ */ e.jsx(
3725
- z,
3726
- {
3727
- onClick: () => l("center", s),
3728
- size: "sm",
3729
- variant: "secondary",
3730
- className: "h-7 p-1 text-xs font-normal",
3731
- children: /* @__PURE__ */ e.jsx(
3732
- tn,
3733
- {
3734
- className: W("h-4 w-4", {
3735
- "rotate-90": i === "y"
3736
- })
3737
- }
3738
- )
3739
- }
3740
- ),
3741
- /* @__PURE__ */ e.jsx(
3742
- z,
3743
- {
3744
- onClick: () => l("end", s),
3745
- size: "sm",
3746
- variant: "secondary",
3747
- className: "h-7 p-1 text-xs font-normal",
3748
- children: /* @__PURE__ */ e.jsx(
3749
- an,
3750
- {
3751
- className: W("h-4 w-4", {
3752
- "rotate-90": i === "y"
3753
- })
3754
- }
3755
- )
3756
- }
3757
- )
3758
- ] }) })
3759
- ] });
3760
- }
3761
- function Zn() {
3762
- const s = r((h) => h.card), n = r(
3763
- (h) => {
3764
- var g, m, u;
3765
- return (u = (m = (g = h == null ? void 0 : h.card) == null ? void 0 : g.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3766
- }
3767
- ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3768
- keys: i,
3769
- metricKeys: o,
3770
- dimensionKeys: l
3771
- } = ds(s.data || []);
3772
- let c = o;
3773
- if (s.type === "stackedBar") {
3774
- const h = Dt({
3775
- dataArray: s.data || [],
3776
- groupKey: l[0],
3777
- pivotKey: l[1],
3778
- valueKey: c[0]
3779
- }), { metricKeys: g } = ds(h);
3780
- c = g;
3781
- }
3782
- return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3783
- /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3784
- /* @__PURE__ */ e.jsx(R, { children: a }),
3785
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: l[0] }) }) })
3786
- ] }),
3787
- /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3788
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3789
- /* @__PURE__ */ e.jsx(R, { children: t }),
3790
- /* @__PURE__ */ e.jsx(ka, {})
3791
- ] }),
3792
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((h, g) => /* @__PURE__ */ e.jsx(el, { col: h, idx: g }, h)) })
3793
- ] })
3794
- ] });
3795
- }
3796
- function el({ col: s, idx: n }) {
3797
- const a = r((c) => {
3798
- var h;
3799
- return (h = c.card) == null ? void 0 : h.preferences;
3800
- }), t = r(
3801
- (c) => {
3802
- var h;
3803
- return (h = c.card.preferences) == null ? void 0 : h.datasetOptions;
3804
- }
3805
- ), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
3806
- function l(c) {
3807
- if (!i)
3808
- o({
3809
- ...a,
3810
- datasetOptions: [
3811
- ...t || [],
3812
- {
3813
- idx: n,
3814
- type: c === "area" ? "line" : c,
3815
- fill: c === "area" ? "origin" : ""
3816
- }
3817
- ]
3818
- });
3819
- else {
3820
- const h = { ...i };
3821
- h.type = c === "area" ? "line" : c, h.fill = c === "area" ? "origin" : "";
3822
- const g = t == null ? void 0 : t.map(
3823
- (m) => m.idx === n ? h : m
3824
- );
3825
- o({
3826
- ...a,
3827
- datasetOptions: g
3828
- });
3829
- }
3830
- }
3831
- return /* @__PURE__ */ e.jsxs("div", { className: "group flex items-center justify-between gap-5 rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: [
3832
- /* @__PURE__ */ e.jsx("p", { children: s }),
3833
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3834
- /* @__PURE__ */ e.jsx(
3835
- Ss,
3836
- {
3837
- onClick: () => l("bar"),
3838
- className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3839
- }
3840
- ),
3841
- /* @__PURE__ */ e.jsx(
3842
- ks,
3843
- {
3844
- onClick: () => l("line"),
3845
- className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3846
- }
3847
- ),
3848
- /* @__PURE__ */ e.jsx(
3849
- Gt,
3850
- {
3851
- onClick: () => l("area"),
3852
- className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3853
- }
3854
- ),
3855
- /* @__PURE__ */ e.jsx(
3856
- Cs,
3857
- {
3858
- orientation: "vertical",
3859
- className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3860
- }
3861
- ),
3862
- /* @__PURE__ */ e.jsx(Xn, { idx: n })
3863
- ] })
3864
- ] });
3865
- }
3866
- function sl() {
3867
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
3868
- /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3869
- /* @__PURE__ */ e.jsx(H, { children: "Stacked Chart" }),
3870
- /* @__PURE__ */ e.jsxs(B, { className: "space-y-4 font-mono text-xs", children: [
3913
+ function al() {
3914
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3915
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3916
+ /* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
3917
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3871
3918
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
3872
3919
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3873
3920
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -3890,20 +3937,20 @@ function sl() {
3890
3937
  ] })
3891
3938
  ] })
3892
3939
  ] }),
3893
- /* @__PURE__ */ e.jsxs(_, { value: "item-2", children: [
3894
- /* @__PURE__ */ e.jsx(H, { children: "Settings" }),
3895
- /* @__PURE__ */ e.jsxs(B, { className: "space-y-4 px-2", children: [
3896
- /* @__PURE__ */ e.jsx(wa, {}),
3897
- /* @__PURE__ */ e.jsx(Zn, {})
3940
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3941
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3942
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3943
+ /* @__PURE__ */ e.jsx(Fs, {}),
3944
+ /* @__PURE__ */ e.jsx(za, {})
3898
3945
  ] })
3899
3946
  ] }),
3900
- /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3901
- /* @__PURE__ */ e.jsx(H, { children: "Filter on click" }),
3902
- /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ge, {}) })
3947
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3948
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3949
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3903
3950
  ] })
3904
3951
  ] }) });
3905
3952
  }
3906
- function al({}) {
3953
+ function tl({}) {
3907
3954
  const s = r((t) => {
3908
3955
  var i;
3909
3956
  return (i = t.card) == null ? void 0 : i.preferences;
@@ -3916,12 +3963,12 @@ function al({}) {
3916
3963
  });
3917
3964
  };
3918
3965
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3919
- /* @__PURE__ */ e.jsx(Ee, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3920
- /* @__PURE__ */ e.jsx(H, { children: "Filter on click" }),
3921
- /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ge, {}) })
3966
+ /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3967
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3968
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3922
3969
  ] }) }),
3923
3970
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3924
- /* @__PURE__ */ e.jsx($e, { onCheckedChange: a, id: "allow-download" }),
3971
+ /* @__PURE__ */ e.jsx(Ke, { onCheckedChange: a, id: "allow-download" }),
3925
3972
  /* @__PURE__ */ e.jsx(
3926
3973
  "label",
3927
3974
  {
@@ -3933,7 +3980,7 @@ function al({}) {
3933
3980
  ] })
3934
3981
  ] });
3935
3982
  }
3936
- const tl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3983
+ const nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3937
3984
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
3938
3985
  /* @__PURE__ */ e.jsxs("div", { children: [
3939
3986
  "See ",
@@ -3949,7 +3996,7 @@ const tl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3949
3996
  ),
3950
3997
  " in the docs."
3951
3998
  ] })
3952
- ] }), nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3999
+ ] }), ll = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3953
4000
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
3954
4001
  /* @__PURE__ */ e.jsxs("div", { children: [
3955
4002
  "See ",
@@ -3966,20 +4013,21 @@ const tl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3966
4013
  " in the docs."
3967
4014
  ] })
3968
4015
  ] });
3969
- function ll() {
4016
+ function rl() {
3970
4017
  const s = r((a) => a.card.type);
3971
4018
  function n(a) {
3972
4019
  switch (a) {
3973
4020
  case "stackedBar":
3974
- return /* @__PURE__ */ e.jsx(sl, {});
4021
+ return /* @__PURE__ */ e.jsx(al, {});
3975
4022
  case "pyramid":
3976
- return /* @__PURE__ */ e.jsx(os, { docContent: tl, cardType: a });
4023
+ return /* @__PURE__ */ e.jsx(os, { docContent: nl, cardType: a });
3977
4024
  case "kpi":
3978
- return /* @__PURE__ */ e.jsx(Yn, {});
4025
+ return /* @__PURE__ */ e.jsx(sl, {});
3979
4026
  case "line":
3980
4027
  case "bar":
4028
+ return /* @__PURE__ */ e.jsx(Jn, { cardType: a });
3981
4029
  case "range":
3982
- return /* @__PURE__ */ e.jsx(os, { docContent: nl, cardType: a });
4030
+ return /* @__PURE__ */ e.jsx(os, { docContent: ll, cardType: a });
3983
4031
  case "pie":
3984
4032
  case "doughnut":
3985
4033
  case "polarArea":
@@ -3987,73 +4035,73 @@ function ll() {
3987
4035
  return /* @__PURE__ */ e.jsx(os, { cardType: a });
3988
4036
  case "bubble":
3989
4037
  case "scatter":
3990
- return /* @__PURE__ */ e.jsx(Un, { cardType: a });
4038
+ return /* @__PURE__ */ e.jsx(Qn, { cardType: a });
3991
4039
  case "table":
3992
- return /* @__PURE__ */ e.jsx(al, { cardType: a });
4040
+ return /* @__PURE__ */ e.jsx(tl, { cardType: a });
3993
4041
  default:
3994
- return /* @__PURE__ */ e.jsx(Jn, {});
4042
+ return /* @__PURE__ */ e.jsx(Xn, {});
3995
4043
  }
3996
4044
  }
3997
- return /* @__PURE__ */ e.jsx(Ns, { className: "h-full w-full text-sm", children: n(s) });
4045
+ return /* @__PURE__ */ e.jsx(Cs, { className: "h-full w-full text-sm", children: n(s) });
3998
4046
  }
3999
- function rl() {
4047
+ function il() {
4000
4048
  const s = r((n) => n.isShowingVisual);
4001
4049
  return /* @__PURE__ */ e.jsxs(
4002
- hs,
4050
+ ms,
4003
4051
  {
4004
4052
  direction: "vertical",
4005
4053
  className: "min-w-full max-w-lg min-h-[250px]",
4006
4054
  children: [
4007
4055
  /* @__PURE__ */ e.jsx(
4008
- ze,
4056
+ Fe,
4009
4057
  {
4010
4058
  role: "query-section",
4011
4059
  className: "flex",
4012
4060
  minSize: 20,
4013
4061
  defaultSize: 40,
4014
- children: /* @__PURE__ */ e.jsx(qn, {})
4062
+ children: /* @__PURE__ */ e.jsx(Vn, {})
4015
4063
  }
4016
4064
  ),
4017
- /* @__PURE__ */ e.jsx(ms, { withHandle: !0, className: "border " }),
4065
+ /* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border " }),
4018
4066
  /* @__PURE__ */ e.jsx(
4019
- ze,
4067
+ Fe,
4020
4068
  {
4021
4069
  className: "pb-1",
4022
4070
  role: "visual-section",
4023
4071
  minSize: 0,
4024
4072
  defaultSize: 60,
4025
- children: s ? /* @__PURE__ */ e.jsxs(hs, { direction: "horizontal", children: [
4073
+ children: s ? /* @__PURE__ */ e.jsxs(ms, { direction: "horizontal", children: [
4026
4074
  /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
4027
- ze,
4075
+ Fe,
4028
4076
  {
4029
4077
  className: "flex min-w-[275px]",
4030
4078
  minSize: 20,
4031
4079
  defaultSize: 25,
4032
4080
  maxSize: 30,
4033
- children: /* @__PURE__ */ e.jsx(ll, {})
4081
+ children: /* @__PURE__ */ e.jsx(rl, {})
4034
4082
  }
4035
4083
  ) }),
4036
- /* @__PURE__ */ e.jsx(ms, { className: "border " }),
4037
- /* @__PURE__ */ e.jsx(ze, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Hs, {}) })
4038
- ] }) : /* @__PURE__ */ e.jsx(Hs, {})
4084
+ /* @__PURE__ */ e.jsx(us, { className: "border " }),
4085
+ /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx($s, {}) })
4086
+ ] }) : /* @__PURE__ */ e.jsx($s, {})
4039
4087
  }
4040
4088
  )
4041
4089
  ]
4042
4090
  }
4043
4091
  );
4044
4092
  }
4045
- function il({ authToken: s, onSave: n, onClose: a }) {
4093
+ function ol({ authToken: s, onSave: n, onClose: a }) {
4046
4094
  const t = r((l) => l.actions.setOnSave), i = r((l) => l.actions.setOnClose), o = k((l) => l.actions.setAuthToken);
4047
4095
  return K(() => {
4048
4096
  n && t(n), a && i(a);
4049
4097
  }, [n, t, a, i]), K(() => {
4050
4098
  s && s.accessToken && o(s);
4051
- }, [s, o]), /* @__PURE__ */ e.jsxs(It, { className: "rounded-none", role: "editor-panel", children: [
4052
- /* @__PURE__ */ e.jsx(qt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(xa, {}) }),
4053
- /* @__PURE__ */ e.jsx(Vt, { children: /* @__PURE__ */ e.jsx(rl, {}) })
4099
+ }, [s, o]), /* @__PURE__ */ e.jsxs(qt, { className: "rounded-none", role: "editor-panel", children: [
4100
+ /* @__PURE__ */ e.jsx(Vt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(pa, {}) }),
4101
+ /* @__PURE__ */ e.jsx(Rt, { children: /* @__PURE__ */ e.jsx(il, {}) })
4054
4102
  ] });
4055
4103
  }
4056
- function ol() {
4104
+ function cl() {
4057
4105
  k((l) => l.selectedCardId);
4058
4106
  const s = k((l) => l.selectedSheetId), { setIsVisualEditing: n } = k((l) => l.actions), a = k((l) => l.isVisualEditing), t = k((l) => l.actions.updateFrame);
4059
4107
  function i(l) {
@@ -4066,15 +4114,15 @@ function ol() {
4066
4114
  "div",
4067
4115
  {
4068
4116
  role: "editor-container",
4069
- className: W("flex grow", {
4117
+ className: Y("flex grow", {
4070
4118
  block: a,
4071
4119
  hidden: !a
4072
4120
  }),
4073
- children: /* @__PURE__ */ e.jsx(il, { onSave: i, onClose: o })
4121
+ children: /* @__PURE__ */ e.jsx(ol, { onSave: i, onClose: o })
4074
4122
  }
4075
4123
  );
4076
4124
  }
4077
- function cl({
4125
+ function dl({
4078
4126
  columns: s,
4079
4127
  tableName: n
4080
4128
  }) {
@@ -4082,7 +4130,7 @@ function cl({
4082
4130
  (u) => u.actions.removeFilterValue
4083
4131
  );
4084
4132
  function m(u) {
4085
- const N = he(u.column_name), d = he(t || ""), x = he(i || ""), f = he(n), w = cs(
4133
+ const N = he(u.column_name), d = he(t || ""), x = he(i || ""), f = he(n), w = ds(
4086
4134
  x,
4087
4135
  f
4088
4136
  ), b = `${w}.${N}`;
@@ -4092,11 +4140,11 @@ function cl({
4092
4140
  f,
4093
4141
  d
4094
4142
  );
4095
- const E = l == null ? void 0 : l.find(
4143
+ const L = l == null ? void 0 : l.find(
4096
4144
  (C) => C.column === b && C.table === f && (C.database === d || C.database === t)
4097
4145
  );
4098
- if (E)
4099
- g(E.id), h(E.id);
4146
+ if (L)
4147
+ g(L.id), h(L.id);
4100
4148
  else {
4101
4149
  if (n === "api" && a) {
4102
4150
  c({
@@ -4109,7 +4157,7 @@ function cl({
4109
4157
  // database: 'NA',
4110
4158
  connectionId: a,
4111
4159
  operation: "in",
4112
- sql: Vs(
4160
+ sql: _s(
4113
4161
  u.data_type,
4114
4162
  w,
4115
4163
  N
@@ -4127,7 +4175,7 @@ function cl({
4127
4175
  database: t || "",
4128
4176
  connectionId: a || "",
4129
4177
  operation: "in",
4130
- sql: Vs(
4178
+ sql: _s(
4131
4179
  u.data_type,
4132
4180
  w,
4133
4181
  N
@@ -4144,14 +4192,14 @@ function cl({
4144
4192
  "div",
4145
4193
  {
4146
4194
  onClick: () => m(u),
4147
- className: W(
4195
+ className: Y(
4148
4196
  "group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
4149
4197
  {
4150
4198
  "bg-muted": N
4151
4199
  }
4152
4200
  ),
4153
4201
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4154
- /* @__PURE__ */ e.jsx(ma, { column: u }),
4202
+ /* @__PURE__ */ e.jsx(ua, { column: u }),
4155
4203
  /* @__PURE__ */ e.jsx("span", { children: u.column_name })
4156
4204
  ] })
4157
4205
  },
@@ -4159,29 +4207,29 @@ function cl({
4159
4207
  );
4160
4208
  }) });
4161
4209
  }
4162
- function dl() {
4210
+ function hl() {
4163
4211
  k((n) => n.showFilters);
4164
4212
  const s = k(
4165
4213
  (n) => n.actions.setShowFilters
4166
4214
  );
4167
4215
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
4168
4216
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
4169
- /* @__PURE__ */ e.jsx(R, { className: "text-lg", children: "Filters" }),
4217
+ /* @__PURE__ */ e.jsx(B, { className: "text-lg", children: "Filters" }),
4170
4218
  /* @__PURE__ */ e.jsx(
4171
4219
  z,
4172
4220
  {
4173
4221
  onClick: () => s(!1),
4174
4222
  className: "h-7 w-7 p-0",
4175
4223
  variant: "ghost",
4176
- children: /* @__PURE__ */ e.jsx(Re, {})
4224
+ children: /* @__PURE__ */ e.jsx(_e, {})
4177
4225
  }
4178
4226
  )
4179
4227
  ] }),
4180
4228
  /* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
4181
- xa,
4229
+ pa,
4182
4230
  {
4183
4231
  ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
4184
- cl,
4232
+ dl,
4185
4233
  {
4186
4234
  schemaName: n,
4187
4235
  tableName: a,
@@ -4192,25 +4240,25 @@ function dl() {
4192
4240
  ) })
4193
4241
  ] });
4194
4242
  }
4195
- function hl() {
4243
+ function ml() {
4196
4244
  k((a) => a.dashboard);
4197
4245
  const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
4198
4246
  return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
4199
4247
  "div",
4200
4248
  {
4201
4249
  role: "dashboard-plus-main",
4202
- className: W("grow", {
4250
+ className: Y("grow", {
4203
4251
  hidden: n,
4204
4252
  flex: !n
4205
4253
  }),
4206
4254
  children: [
4207
- /* @__PURE__ */ e.jsx(Rt, {}),
4208
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(dl, {}) })
4255
+ /* @__PURE__ */ e.jsx(_t, {}),
4256
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hl, {}) })
4209
4257
  ]
4210
4258
  }
4211
4259
  );
4212
4260
  }
4213
- function ml() {
4261
+ function ul() {
4214
4262
  const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
4215
4263
  (t) => t.showDashboardJSON
4216
4264
  );
@@ -4219,11 +4267,11 @@ function ml() {
4219
4267
  ), /* @__PURE__ */ e.jsx(
4220
4268
  "div",
4221
4269
  {
4222
- className: W(" p-2", {
4270
+ className: Y(" p-2", {
4223
4271
  hidden: !a
4224
4272
  }),
4225
4273
  children: /* @__PURE__ */ e.jsx(
4226
- _t,
4274
+ Ht,
4227
4275
  {
4228
4276
  onChange: (t) => {
4229
4277
  if (t)
@@ -4254,25 +4302,25 @@ function ml() {
4254
4302
  }
4255
4303
  );
4256
4304
  }
4257
- function pl({
4305
+ function fl({
4258
4306
  showControls: s = !1,
4259
4307
  showFooter: n = !0,
4260
4308
  ...a
4261
4309
  }) {
4262
- return /* @__PURE__ */ e.jsxs(Ht, { dashboardProps: a, children: [
4263
- /* @__PURE__ */ e.jsx(Bt, {}),
4264
- /* @__PURE__ */ e.jsxs($t, { children: [
4265
- /* @__PURE__ */ e.jsx(ml, {}),
4266
- /* @__PURE__ */ e.jsxs(Kt, { ...a, children: [
4267
- s && /* @__PURE__ */ e.jsx(yn, {}),
4268
- /* @__PURE__ */ e.jsx(ol, {}),
4269
- /* @__PURE__ */ e.jsx(hl, {})
4310
+ return /* @__PURE__ */ e.jsxs(Bt, { dashboardProps: a, children: [
4311
+ /* @__PURE__ */ e.jsx($t, {}),
4312
+ /* @__PURE__ */ e.jsxs(Kt, { children: [
4313
+ /* @__PURE__ */ e.jsx(ul, {}),
4314
+ /* @__PURE__ */ e.jsxs(Pt, { ...a, children: [
4315
+ s && /* @__PURE__ */ e.jsx(vn, {}),
4316
+ /* @__PURE__ */ e.jsx(cl, {}),
4317
+ /* @__PURE__ */ e.jsx(ml, {})
4270
4318
  ] })
4271
4319
  ] })
4272
4320
  ] });
4273
4321
  }
4274
4322
  export {
4275
- pl as D,
4323
+ fl as D,
4276
4324
  Qe as S,
4277
- ua as u
4325
+ xa as u
4278
4326
  };