semaphor 0.0.48 → 0.0.50

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 T, b as k, j as e, Q as ds, R as hs, U as w, V as Us, W as ms, X as us, Y as xs, Z as ps, _ as B, $ as ae, a0 as Js, J as Ps, O as Ee, a1 as Ia, a2 as qa, a3 as Va, a4 as Ra, a5 as _a, a6 as Ha, a7 as Fs, a8 as Re, a9 as $e, aa as We, T as fs, e as Gs, g as gs, ab as Oe, ac as Me, f as W, ad as Te, ae as Ae, af as _e, ag as Le, ah as X, ai as js, G as r, aj as Ke, ak as Ue, al as Ba, am as Je, w as Qs, v as Ws, t as he, an as $a, r as Ka, N as Ys, s as Ua, ao as Ja, B as Pa, ap as Xs, aq as Ga, L as He, S as bs, z as Qa, n as Os, ar as Ms, A as rs, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Wa, aA as Ya, aB as na, aC as Xa, aD as Za, aE as et, aF as st, aG as at, aH as is, aI as tt, aJ as Qe, aK as os, aL as Fe, aM as cs, aN as Ts, aO as nt, aP as lt, aQ as rt, aR as it, aS as ot, aT as ls, aU as ct, aV as As, aW as dt, aX as Es, aY as ht, aZ as mt, a_ as ut, a$ as la, l as xt, C as pt, E as Ls, d as ft, h as gt, i as jt, o as bt, b0 as yt, m as vt, b1 as Nt, b2 as Ct, b3 as St, b4 as Ds, b5 as kt, b6 as Is, b7 as qs, K as wt, b8 as ys, b9 as zt, ba as ra, bb as Ye, bc as ia, bd as Ft, be as Ot, bf as Mt, bg as Tt, bh as At, bi as Et, bj as Se, bk as q, bl as V, bm as vs, bn as R, bo as Vs, bp as Lt, bq as Dt, br as It, bs as qt, bt as Rs, bu as Vt, bv as Rt, bw as _t, bx as Ht, by as Bt, bz as $t } from "./index-71zNxWPN.js";
2
- import me, { useState as M, useEffect as K, useMemo as Kt, useRef as Be } from "react";
1
+ import { P as E, b as k, j as e, Q as xs, R as ps, U as w, V as Ks, 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 Pe, 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 i, aj as Ke, ak as Ue, al as $a, am as Ge, w as Qs, v as Ws, t as he, an as Pa, r as Ka, 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 rt, aP as lt, aQ as it, aR as ot, aS as ct, aT as rs, aU as dt, aV as Ds, aW as ht, aX as Is, aY as mt, aZ as ut, a_ as xt, a$ as ra, 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 ls, b5 as zt, b6 as is, b7 as Vs, K as Ft, b8 as Ss, b9 as Ot, ba as la, 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 Pt, bz as Kt } from "./index-bnMt0Nkv.js";
2
+ import me, { useState as T, useEffect as P, 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 Ut = T("Activity", [
9
+ const Gt = E("Activity", [
10
10
  [
11
11
  "path",
12
12
  {
@@ -21,7 +21,7 @@ const Ut = T("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 Jt = T("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 Jt = T("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 Ns = T("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 Ns = T("BarChart4", [
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
45
  */
46
- const Pt = T("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 Pt = T("CircleX", [
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
56
  */
57
- const Gt = T("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 Gt = T("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 Qt = T("Eraser", [
68
+ const Yt = E("Eraser", [
69
69
  [
70
70
  "path",
71
71
  {
@@ -82,7 +82,7 @@ const Qt = T("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 oa = T("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,18 @@ const oa = T("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 Wt = T("Glasses", [
94
+ const ca = E("GanttChart", [
95
+ ["path", { d: "M8 6h10", key: "9lnwnk" }],
96
+ ["path", { d: "M6 12h9", key: "1g9pqf" }],
97
+ ["path", { d: "M11 18h7", key: "c8dzvl" }]
98
+ ]);
99
+ /**
100
+ * @license lucide-react v0.379.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */
105
+ const Xt = E("Glasses", [
95
106
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
96
107
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
97
108
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -104,7 +115,7 @@ const Wt = T("Glasses", [
104
115
  * This source code is licensed under the ISC license.
105
116
  * See the LICENSE file in the root directory of this source tree.
106
117
  */
107
- const Yt = T("Hammer", [
118
+ const Zt = E("Hammer", [
108
119
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
109
120
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
110
121
  [
@@ -121,7 +132,7 @@ const Yt = T("Hammer", [
121
132
  * This source code is licensed under the ISC license.
122
133
  * See the LICENSE file in the root directory of this source tree.
123
134
  */
124
- const Xt = T("Hash", [
135
+ const en = E("Hash", [
125
136
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
126
137
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
127
138
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -133,7 +144,7 @@ const Xt = T("Hash", [
133
144
  * This source code is licensed under the ISC license.
134
145
  * See the LICENSE file in the root directory of this source tree.
135
146
  */
136
- const Zt = T("Key", [
147
+ const sn = E("Key", [
137
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" }],
138
149
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
139
150
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -144,7 +155,7 @@ const Zt = T("Key", [
144
155
  * This source code is licensed under the ISC license.
145
156
  * See the LICENSE file in the root directory of this source tree.
146
157
  */
147
- const Cs = T("LineChart", [
158
+ const zs = E("LineChart", [
148
159
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
149
160
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
150
161
  ]);
@@ -154,7 +165,7 @@ const Cs = T("LineChart", [
154
165
  * This source code is licensed under the ISC license.
155
166
  * See the LICENSE file in the root directory of this source tree.
156
167
  */
157
- const en = T("ListEnd", [
168
+ const an = E("ListEnd", [
158
169
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
159
170
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
160
171
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -167,7 +178,7 @@ const en = T("ListEnd", [
167
178
  * This source code is licensed under the ISC license.
168
179
  * See the LICENSE file in the root directory of this source tree.
169
180
  */
170
- const sn = T("ListStart", [
181
+ const tn = E("ListStart", [
171
182
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
172
183
  ["path", { d: "M16 18H3", key: "12xzn7" }],
173
184
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -180,7 +191,7 @@ const sn = T("ListStart", [
180
191
  * This source code is licensed under the ISC license.
181
192
  * See the LICENSE file in the root directory of this source tree.
182
193
  */
183
- const an = T("ListX", [
194
+ const nn = E("ListX", [
184
195
  ["path", { d: "M11 12H3", key: "51ecnj" }],
185
196
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
186
197
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -193,7 +204,7 @@ const an = T("ListX", [
193
204
  * This source code is licensed under the ISC license.
194
205
  * See the LICENSE file in the root directory of this source tree.
195
206
  */
196
- const tn = T("MessageSquareMore", [
207
+ const rn = E("MessageSquareMore", [
197
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" }],
198
209
  ["path", { d: "M8 10h.01", key: "19clt8" }],
199
210
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -205,7 +216,7 @@ const tn = T("MessageSquareMore", [
205
216
  * This source code is licensed under the ISC license.
206
217
  * See the LICENSE file in the root directory of this source tree.
207
218
  */
208
- const nn = T("Network", [
219
+ const ln = E("Network", [
209
220
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
210
221
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
211
222
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -218,7 +229,7 @@ const nn = T("Network", [
218
229
  * This source code is licensed under the ISC license.
219
230
  * See the LICENSE file in the root directory of this source tree.
220
231
  */
221
- const ca = T("Pencil", [
232
+ const da = E("Pencil", [
222
233
  ["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
223
234
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
224
235
  ]);
@@ -228,7 +239,7 @@ const ca = T("Pencil", [
228
239
  * This source code is licensed under the ISC license.
229
240
  * See the LICENSE file in the root directory of this source tree.
230
241
  */
231
- const da = T("PieChart", [
242
+ const ha = E("PieChart", [
232
243
  ["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
233
244
  ["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
234
245
  ]);
@@ -238,7 +249,7 @@ const da = T("PieChart", [
238
249
  * This source code is licensed under the ISC license.
239
250
  * See the LICENSE file in the root directory of this source tree.
240
251
  */
241
- const ln = T("Play", [
252
+ const on = E("Play", [
242
253
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
243
254
  ]);
244
255
  /**
@@ -247,7 +258,7 @@ const ln = T("Play", [
247
258
  * This source code is licensed under the ISC license.
248
259
  * See the LICENSE file in the root directory of this source tree.
249
260
  */
250
- const rn = T("Plug2", [
261
+ const cn = E("Plug2", [
251
262
  ["path", { d: "M9 2v6", key: "17ngun" }],
252
263
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
253
264
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -260,7 +271,7 @@ const rn = T("Plug2", [
260
271
  * This source code is licensed under the ISC license.
261
272
  * See the LICENSE file in the root directory of this source tree.
262
273
  */
263
- const on = T("Save", [
274
+ const dn = E("Save", [
264
275
  [
265
276
  "path",
266
277
  {
@@ -277,7 +288,7 @@ const on = T("Save", [
277
288
  * This source code is licensed under the ISC license.
278
289
  * See the LICENSE file in the root directory of this source tree.
279
290
  */
280
- const ha = T("ScatterChart", [
291
+ const ma = E("ScatterChart", [
281
292
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
282
293
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
283
294
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -291,7 +302,7 @@ const ha = T("ScatterChart", [
291
302
  * This source code is licensed under the ISC license.
292
303
  * See the LICENSE file in the root directory of this source tree.
293
304
  */
294
- const cn = T("ShieldQuestion", [
305
+ const hn = E("ShieldQuestion", [
295
306
  [
296
307
  "path",
297
308
  {
@@ -308,7 +319,7 @@ const cn = T("ShieldQuestion", [
308
319
  * This source code is licensed under the ISC license.
309
320
  * See the LICENSE file in the root directory of this source tree.
310
321
  */
311
- const dn = T("Sigma", [
322
+ const mn = E("Sigma", [
312
323
  ["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
313
324
  ]);
314
325
  /**
@@ -317,7 +328,7 @@ const dn = T("Sigma", [
317
328
  * This source code is licensed under the ISC license.
318
329
  * See the LICENSE file in the root directory of this source tree.
319
330
  */
320
- const hn = T("SwatchBook", [
331
+ const un = E("SwatchBook", [
321
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" }],
322
333
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
323
334
  ["path", { d: "M 7 17h0.01", key: "10821z" }],
@@ -335,7 +346,7 @@ const hn = T("SwatchBook", [
335
346
  * This source code is licensed under the ISC license.
336
347
  * See the LICENSE file in the root directory of this source tree.
337
348
  */
338
- const mn = T("Tag", [
349
+ const xn = E("Tag", [
339
350
  [
340
351
  "path",
341
352
  {
@@ -351,7 +362,7 @@ const mn = T("Tag", [
351
362
  * This source code is licensed under the ISC license.
352
363
  * See the LICENSE file in the root directory of this source tree.
353
364
  */
354
- const un = T("ToggleLeft", [
365
+ const pn = E("ToggleLeft", [
355
366
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
356
367
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
357
368
  ]);
@@ -361,7 +372,7 @@ const un = T("ToggleLeft", [
361
372
  * This source code is licensed under the ISC license.
362
373
  * See the LICENSE file in the root directory of this source tree.
363
374
  */
364
- const xn = T("Type", [
375
+ const fn = E("Type", [
365
376
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
366
377
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
367
378
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -372,16 +383,16 @@ const xn = T("Type", [
372
383
  * This source code is licensed under the ISC license.
373
384
  * See the LICENSE file in the root directory of this source tree.
374
385
  */
375
- const pn = T("User", [
386
+ const gn = E("User", [
376
387
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
377
388
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
378
389
  ]);
379
- function fn() {
380
- const [s, n] = M(""), [a, t] = M(!1), [i, o] = M(!1), l = k((d) => d.dashboard);
381
- function c() {
382
- const d = Ps(l), f = Ee(l.id), m = JSON.parse(localStorage.getItem(f) || "[]");
390
+ function jn() {
391
+ const [s, n] = T(""), [a, t] = T(!1), [o, c] = T(!1), r = k((d) => d.dashboard);
392
+ function l() {
393
+ const d = Gs(r), f = Ee(r.id), m = JSON.parse(localStorage.getItem(f) || "[]");
383
394
  if (m.some(
384
- (C) => C.name === s
395
+ (S) => S.name === s
385
396
  )) {
386
397
  t(!0);
387
398
  return;
@@ -389,25 +400,25 @@ function fn() {
389
400
  m.push({
390
401
  name: s,
391
402
  template: d
392
- }), localStorage.setItem(f, JSON.stringify(m)), o(!1);
403
+ }), localStorage.setItem(f, JSON.stringify(m)), c(!1);
393
404
  }
394
- return /* @__PURE__ */ e.jsxs(ds, { open: i, onOpenChange: o, children: [
395
- /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
405
+ return /* @__PURE__ */ e.jsxs(xs, { open: o, onOpenChange: c, children: [
406
+ /* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
396
407
  w,
397
408
  {
398
409
  variant: "outline",
399
410
  className: "h-7 p-2",
400
411
  size: "sm",
401
412
  children: [
402
- /* @__PURE__ */ e.jsx(Us, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
413
+ /* @__PURE__ */ e.jsx(Ks, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
403
414
  "Add Lens"
404
415
  ]
405
416
  }
406
417
  ) }),
407
- /* @__PURE__ */ e.jsxs(ms, { className: "sm:max-w-[425px]", children: [
408
- /* @__PURE__ */ e.jsxs(us, { children: [
409
- /* @__PURE__ */ e.jsx(xs, { children: "Add a Lens" }),
410
- /* @__PURE__ */ e.jsx(ps, { 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." })
411
422
  ] }),
412
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: [
413
424
  /* @__PURE__ */ e.jsx(B, { className: "text-right", children: "Name" }),
@@ -424,70 +435,70 @@ function fn() {
424
435
  )
425
436
  ] }) }),
426
437
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
427
- /* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
438
+ /* @__PURE__ */ e.jsx(Us, { children: /* @__PURE__ */ e.jsx(
428
439
  w,
429
440
  {
430
441
  variant: "outline",
431
442
  type: "submit",
432
443
  disabled: !s,
433
- onClick: c,
444
+ onClick: l,
434
445
  children: "Save"
435
446
  }
436
447
  ) })
437
448
  ] })
438
449
  ] });
439
450
  }
440
- function gn() {
441
- const [s, n] = M(!1), [a, t] = M(""), i = k((h) => h.dashboard), o = k((h) => h.bookmarkKey), [l, c] = M([]), d = k((h) => h.actions.setDashboard), f = k(
451
+ function bn() {
452
+ const [s, n] = T(!1), [a, t] = T(""), o = k((h) => h.dashboard), c = k((h) => h.bookmarkKey), [r, l] = T([]), d = k((h) => h.actions.setDashboard), f = k(
442
453
  (h) => h.actions.setFilterValues
443
454
  ), m = k(
444
455
  (h) => h.actions.setBookmarkKey
445
456
  );
446
- K(() => {
447
- const h = Ee(i.id), x = JSON.parse(localStorage.getItem(h) || "[]");
448
- c(x);
457
+ P(() => {
458
+ const h = Ee(o.id), x = JSON.parse(localStorage.getItem(h) || "[]");
459
+ l(x);
449
460
  const g = x.find(
450
- (j) => j.default
461
+ (z) => z.default
451
462
  );
452
- g && g.name === o && t(g.name);
453
- }, [s, i, o]);
463
+ g && g.name === c && t(g.name);
464
+ }, [s, o, c]);
454
465
  function u(h) {
455
466
  if (h === a)
456
467
  return;
457
- const x = l.find((j) => j.name === h), g = x == null ? void 0 : x.template;
468
+ const x = r.find((z) => z.name === h), g = x == null ? void 0 : x.template;
458
469
  g && (d(g), f(x.filterValues || []), m(h === "Original" ? "" : h)), t(h);
459
470
  }
460
- function C(h) {
461
- const x = Ee(i.id), j = JSON.parse(localStorage.getItem(x) || "[]").filter(
471
+ function S(h) {
472
+ const x = Ee(o.id), z = JSON.parse(localStorage.getItem(x) || "[]").filter(
462
473
  (b) => b.name !== h
463
474
  );
464
- localStorage.setItem(x, JSON.stringify(j)), c(j);
475
+ localStorage.setItem(x, JSON.stringify(z)), l(z);
465
476
  }
466
- return /* @__PURE__ */ e.jsxs(Ia, { open: s, onOpenChange: n, children: [
467
- /* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Wt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
468
- /* @__PURE__ */ e.jsxs(Va, { className: "w-56", children: [
469
- /* @__PURE__ */ e.jsx(Ra, { children: "Lenses" }),
470
- /* @__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(w, { 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, {}),
471
482
  /* @__PURE__ */ e.jsxs(
472
- Ha,
483
+ Ba,
473
484
  {
474
485
  value: a,
475
486
  onValueChange: u,
476
487
  children: [
477
- /* @__PURE__ */ e.jsx(Fs, { value: "Original", children: "Original" }),
478
- l.filter((h) => h.name != "Original").map((h, x) => /* @__PURE__ */ e.jsxs(
479
- Fs,
488
+ /* @__PURE__ */ e.jsx(As, { value: "Original", children: "Original" }),
489
+ r.filter((h) => h.name != "Original").map((h, x) => /* @__PURE__ */ e.jsxs(
490
+ As,
480
491
  {
481
492
  className: "xbg-red-100 flex justify-between",
482
493
  value: h.name,
483
- defaultChecked: h.name === o,
494
+ defaultChecked: h.name === c,
484
495
  children: [
485
496
  /* @__PURE__ */ e.jsx("p", { children: h.name }),
486
497
  /* @__PURE__ */ e.jsx(
487
- Re,
498
+ _e,
488
499
  {
489
500
  onClick: (g) => {
490
- g.preventDefault(), C(h.name);
501
+ g.preventDefault(), S(h.name);
491
502
  },
492
503
  className: "h-3 w-3 hover:cursor-pointer",
493
504
  strokeWidth: 1.5
@@ -503,34 +514,34 @@ function gn() {
503
514
  ] })
504
515
  ] });
505
516
  }
506
- function jn() {
507
- const [s, n] = M(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
508
- K(() => {
517
+ function yn() {
518
+ const [s, n] = T(!1), a = k((c) => c.dashboard), t = k((c) => c.bookmarkKey);
519
+ P(() => {
509
520
  if (!t) {
510
521
  n(!1);
511
522
  return;
512
523
  }
513
- const o = Ee(a.id), c = JSON.parse(
514
- localStorage.getItem(o) || "[]"
524
+ const c = Ee(a.id), l = JSON.parse(
525
+ localStorage.getItem(c) || "[]"
515
526
  ).find(
516
527
  (d) => d.name === t
517
528
  );
518
- n(c ? c.default : !1);
529
+ n(l ? l.default : !1);
519
530
  }, [t, a.id]);
520
- function i(o) {
521
- if (n(o), !t)
531
+ function o(c) {
532
+ if (n(c), !t)
522
533
  return;
523
- const l = Ee(a.id), d = JSON.parse(
524
- localStorage.getItem(l) || "[]"
525
- ).map((f) => (f.name === t ? f.default = o : f.default = !1, f));
526
- console.log(d), localStorage.setItem(l, JSON.stringify(d));
534
+ const r = Ee(a.id), d = JSON.parse(
535
+ localStorage.getItem(r) || "[]"
536
+ ).map((f) => (f.name === t ? f.default = c : f.default = !1, f));
537
+ console.log(d), localStorage.setItem(r, JSON.stringify(d));
527
538
  }
528
539
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
529
540
  /* @__PURE__ */ e.jsx(
530
- $e,
541
+ Pe,
531
542
  {
532
543
  checked: s,
533
- onCheckedChange: i,
544
+ onCheckedChange: o,
534
545
  id: "terms"
535
546
  }
536
547
  ),
@@ -544,20 +555,20 @@ function jn() {
544
555
  )
545
556
  ] });
546
557
  }
547
- function bn() {
558
+ function vn() {
548
559
  const s = k((b) => b.bookmarkKey), n = k((b) => b.dashboard);
549
560
  k((b) => b.selectedSheetId);
550
561
  const a = k(
551
562
  (b) => b.isDashboardEditing
552
- ), t = k((b) => b.filterValues), i = k((b) => b.isVisualEditing), o = k((b) => b.showFilters);
563
+ ), t = k((b) => b.filterValues), o = k((b) => b.isVisualEditing), c = k((b) => b.showFilters);
553
564
  k(
554
565
  (b) => b.showDashboardJSON
555
566
  );
556
- const l = k((b) => b.onSaveFunction), c = k(
567
+ const r = k((b) => b.onSaveFunction), l = k(
557
568
  (b) => b.actions.setShowFilters
558
569
  ), { addFrame: d, setSelectedFrameId: f } = k(
559
570
  (b) => b.actions
560
- ), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: C } = k((b) => b.actions), h = m(), x = () => {
571
+ ), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: S } = k((b) => b.actions), h = m(), x = () => {
561
572
  if (!a || !h)
562
573
  return;
563
574
  const b = {
@@ -584,40 +595,40 @@ function bn() {
584
595
  }, g = () => {
585
596
  u(!0);
586
597
  };
587
- function j() {
598
+ function z() {
588
599
  if (!s || s === "")
589
600
  return;
590
- const b = Ps(n), L = Ee(n.id), A = JSON.parse(localStorage.getItem(L) || "[]"), O = A.findIndex(
591
- (y) => y.name === s
601
+ const b = Gs(n), L = Ee(n.id), N = JSON.parse(localStorage.getItem(L) || "[]"), O = N.findIndex(
602
+ (j) => j.name === s
592
603
  );
593
- O !== -1 ? A[O] = {
604
+ O !== -1 ? N[O] = {
594
605
  name: s,
595
606
  template: b,
596
- default: A[O].default,
607
+ default: N[O].default,
597
608
  filterValues: t
598
- } : A.push({
609
+ } : N.push({
599
610
  name: s,
600
611
  template: b,
601
612
  filterValues: t
602
- }), localStorage.setItem(L, JSON.stringify(A)), l == null || l(b);
613
+ }), localStorage.setItem(L, JSON.stringify(N)), r == null || r(b);
603
614
  }
604
- return i ? null : /* @__PURE__ */ e.jsxs(
615
+ return o ? null : /* @__PURE__ */ e.jsxs(
605
616
  "div",
606
617
  {
607
618
  className: "flex items-center justify-between gap-2 border-b bg-muted/50 px-2 py-2",
608
619
  role: "dashboard-controls",
609
620
  children: [
610
- !i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
621
+ !o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
611
622
  /* @__PURE__ */ e.jsx(B, { children: s }),
612
623
  !!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
613
624
  /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
614
- /* @__PURE__ */ e.jsx(jn, {})
625
+ /* @__PURE__ */ e.jsx(yn, {})
615
626
  ] })
616
627
  ] }),
617
628
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
618
- a && !i && /* @__PURE__ */ e.jsx(fn, {}),
619
- !i && /* @__PURE__ */ e.jsx(gn, {}),
620
- a && !i && /* @__PURE__ */ e.jsxs(
629
+ a && !o && /* @__PURE__ */ e.jsx(jn, {}),
630
+ !o && /* @__PURE__ */ e.jsx(bn, {}),
631
+ a && !o && /* @__PURE__ */ e.jsxs(
621
632
  w,
622
633
  {
623
634
  variant: "outline",
@@ -626,7 +637,7 @@ function bn() {
626
637
  disabled: !a,
627
638
  onClick: x,
628
639
  children: [
629
- /* @__PURE__ */ e.jsx(Us, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
640
+ /* @__PURE__ */ e.jsx(Ks, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
630
641
  "Add Frame"
631
642
  ]
632
643
  }
@@ -638,119 +649,119 @@ function bn() {
638
649
  className: "h-7 p-2",
639
650
  onClick: g,
640
651
  size: "sm",
641
- 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 })
642
653
  }
643
654
  ),
644
- a && !i && /* @__PURE__ */ e.jsx(
655
+ a && !o && /* @__PURE__ */ e.jsx(
645
656
  w,
646
657
  {
647
658
  variant: "outline",
648
659
  role: "close",
649
660
  className: "h-7 p-2",
650
661
  onClick: () => {
651
- u(!1), C(!1);
662
+ u(!1), S(!1);
652
663
  },
653
664
  size: "sm",
654
- 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 })
655
666
  }
656
667
  ),
657
- a && !i && /* @__PURE__ */ e.jsx(
668
+ a && !o && /* @__PURE__ */ e.jsx(
658
669
  w,
659
670
  {
660
671
  className: "h-7 p-2",
661
672
  variant: "outline",
662
- onClick: j,
673
+ onClick: z,
663
674
  size: "sm",
664
- children: /* @__PURE__ */ e.jsx(on, { className: "h-4 w-4", strokeWidth: 1.5 })
675
+ children: /* @__PURE__ */ e.jsx(dn, { className: "h-4 w-4", strokeWidth: 1.5 })
665
676
  }
666
677
  ),
667
- !o && !i && a && /* @__PURE__ */ e.jsx(
678
+ !c && !o && a && /* @__PURE__ */ e.jsx(
668
679
  w,
669
680
  {
670
681
  className: "h-7 p-2",
671
682
  variant: "outline",
672
- onClick: () => c(!0),
683
+ onClick: () => l(!0),
673
684
  size: "sm",
674
685
  children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
675
686
  }
676
687
  ),
677
- !i && a && !1,
678
- !i && !1
688
+ !o && a && !1,
689
+ !o && !1
679
690
  ] })
680
691
  ]
681
692
  }
682
693
  );
683
694
  }
684
- function Ge({
695
+ function Qe({
685
696
  title: s,
686
697
  items: n,
687
698
  value: a,
688
699
  isLoading: t,
689
- isError: i,
690
- connectionTooltip: o,
691
- onChange: l,
692
- className: c,
700
+ isError: o,
701
+ connectionTooltip: c,
702
+ onChange: r,
703
+ className: l,
693
704
  showIcon: d = !0,
694
705
  disabled: f = !1
695
706
  }) {
696
- const m = t ? "Loading..." : i ? "Error" : a;
707
+ const m = t ? "Loading..." : o ? "Error" : a;
697
708
  function u() {
698
709
  if (s === "Connection")
699
- return /* @__PURE__ */ e.jsx(rn, { className: "size-4 rotate-90" });
710
+ return /* @__PURE__ */ e.jsx(cn, { className: "size-4 rotate-90" });
700
711
  if (s === "Database")
701
- return /* @__PURE__ */ e.jsx(Gt, { className: "size-4" });
712
+ return /* @__PURE__ */ e.jsx(Wt, { className: "size-4" });
702
713
  if (s === "Schema")
703
- return /* @__PURE__ */ e.jsx(nn, { className: "size-4" });
714
+ return /* @__PURE__ */ e.jsx(ln, { className: "size-4" });
704
715
  if (s === "Table")
705
- return /* @__PURE__ */ e.jsx(js, { className: "size-4" });
716
+ return /* @__PURE__ */ e.jsx(Ns, { className: "size-4" });
706
717
  }
707
718
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
708
- d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(fs, { children: [
709
- /* @__PURE__ */ e.jsx(Gs, { children: u() }),
710
- /* @__PURE__ */ e.jsx(gs, { className: "text-xs", align: "start", children: o })
719
+ d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: c ? /* @__PURE__ */ e.jsxs(ys, { children: [
720
+ /* @__PURE__ */ e.jsx(Js, { children: u() }),
721
+ /* @__PURE__ */ e.jsx(vs, { className: "text-xs", align: "start", children: c })
711
722
  ] }) : u() }),
712
- /* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange: l, children: [
723
+ /* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange: r, children: [
713
724
  /* @__PURE__ */ e.jsx(
714
725
  Me,
715
726
  {
716
- className: W(
727
+ className: Y(
717
728
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
718
- c
729
+ l
719
730
  ),
720
731
  children: /* @__PURE__ */ e.jsx(
721
732
  Te,
722
733
  {
723
- placeholder: t ? "Loading..." : i ? "Error" : `Select ${s}`
734
+ placeholder: t ? "Loading..." : o ? "Error" : `Select ${s}`
724
735
  }
725
736
  )
726
737
  }
727
738
  ),
728
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
739
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
729
740
  t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
730
- /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((C, h) => /* @__PURE__ */ e.jsx(X, { value: C.id, children: C.name }, h)) }),
731
- (t || i) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
741
+ /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((S, h) => /* @__PURE__ */ e.jsx(X, { value: S.id, children: S.name }, h)) }),
742
+ (t || o) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
732
743
  ] }) })
733
744
  ] })
734
745
  ] });
735
746
  }
736
- function yn({ column: s }) {
737
- const [n, a] = M(!1), t = r((m) => m.selectedTableName), i = r(
747
+ function Nn({ column: s }) {
748
+ const [n, a] = T(!1), t = i((m) => m.selectedTableName), o = i(
738
749
  (m) => m.selectedSchemaName
739
- ), o = r((m) => m.sqlGen), l = r((m) => m.actions.setSqlGen), c = r((m) => m.actions.setCardSql), d = r((m) => m.actions.setRunSql);
750
+ ), c = i((m) => m.sqlGen), r = i((m) => m.actions.setSqlGen), l = i((m) => m.actions.setCardSql), d = i((m) => m.actions.setRunSql);
740
751
  function f(m, u) {
741
- const C = Qs(m, o, u);
742
- l(C);
752
+ const S = Qs(m, c, u);
753
+ r(S);
743
754
  const h = Ws(
744
- C,
745
- he(i || ""),
755
+ S,
756
+ he(o || ""),
746
757
  he(t)
747
758
  );
748
- h && (c(h), d(!0)), a(!1);
759
+ h && (l(h), d(!0)), a(!1);
749
760
  }
750
761
  return /* @__PURE__ */ e.jsxs(Ke, { open: n, onOpenChange: a, children: [
751
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ba, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
762
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx($a, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
752
763
  /* @__PURE__ */ e.jsx(
753
- Je,
764
+ Ge,
754
765
  {
755
766
  align: "center",
756
767
  className: "w-18 rounded-md p-0 shadow-none",
@@ -800,82 +811,84 @@ function yn({ column: s }) {
800
811
  )
801
812
  ] });
802
813
  }
803
- function ma({ column: s }) {
804
- return /* @__PURE__ */ e.jsxs(fs, { children: [
805
- /* @__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(Pa, { asChild: !0, children: Ka.includes(s.data_type.toLowerCase()) ? (
806
817
  // <span className=" font-thin">T</span>
807
- /* @__PURE__ */ e.jsx(xn, { className: "size-3" })
818
+ /* @__PURE__ */ e.jsx(fn, { className: "size-3" })
808
819
  ) : Ys.includes(s.data_type.toLowerCase()) ? (
809
820
  //
810
- /* @__PURE__ */ e.jsx(Xt, { className: "size-3" })
811
- ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ja, { className: "size-3" }) : Pa.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(un, { className: "size-3" }) : /* @__PURE__ */ e.jsx(cn, { className: "size-3" }) }),
812
- /* @__PURE__ */ e.jsx(gs, { 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 }) })
813
824
  ] });
814
825
  }
815
- function vn({
826
+ function Cn({
816
827
  schemaName: s,
817
828
  tableName: n,
818
829
  columns: a,
819
830
  status: t
820
831
  }) {
821
- const i = r((y) => y.sqlGen), o = r(
822
- (y) => y.selectedConnectionId
823
- ), l = r(
824
- (y) => y.selectedDatabaseName
825
- ), c = r(
826
- (y) => y.selectedSchemaName
827
- ), d = r((y) => y.selectedTableName), f = k(
828
- (y) => y.dashboard.aiScopeTables
829
- ), { setAIScopeTables: m } = k((y) => y.actions), u = r((y) => y.actions.setRunSql), C = r((y) => y.actions.setSqlGen), h = r(
830
- (y) => y.actions.setIsShowingVisual
831
- ), x = r((y) => y.actions.setCardSql), { connectionType: g } = ua();
832
- function j(y) {
833
- const z = Qs(y, i);
834
- C(z);
835
- const E = Ws(z, he(s), he(n));
836
- E && (x(E), u(!0));
832
+ const o = i((j) => j.sqlGen), c = i(
833
+ (j) => j.selectedConnectionId
834
+ ), r = i(
835
+ (j) => j.selectedDatabaseName
836
+ ), l = i(
837
+ (j) => j.selectedSchemaName
838
+ ), d = i((j) => j.selectedTableName), f = k(
839
+ (j) => j.dashboard.aiScopeTables
840
+ ), { setAIScopeTables: m } = k((j) => j.actions), u = i((j) => j.actions.setRunSql), S = i((j) => j.actions.setSqlGen), h = i(
841
+ (j) => j.actions.setIsShowingVisual
842
+ ), x = i((j) => j.actions.setCardSql), { connectionType: g } = xa();
843
+ function z(j) {
844
+ const F = Qs(j, o);
845
+ S(F);
846
+ const A = Ws(F, he(s), he(n));
847
+ A && (x(A), u(!0));
837
848
  }
838
849
  function b() {
839
850
  return (f == null ? void 0 : f.find(
840
- (y) => y.connectinonId === o && y.tableName === d
851
+ (j) => j.connectinonId === c && j.tableName === d
841
852
  )) !== void 0;
842
853
  }
843
- function L(y) {
844
- if (y === !0 && d && o) {
845
- const z = {
846
- connectinonId: o,
854
+ function L(j) {
855
+ if (j === !0 && d && c) {
856
+ const F = {
857
+ connectinonId: c,
847
858
  connectionType: g,
848
- databaseName: l,
849
- schemaName: c,
859
+ databaseName: r,
860
+ schemaName: l,
850
861
  tableName: d
851
- }, _ = [...f || [], z].filter(
852
- (Y, $, U) => U.findIndex(
853
- (D) => D.connectinonId === Y.connectinonId && D.tableName === Y.tableName
862
+ }, q = [...f || [], F].filter(
863
+ (K, $, G) => G.findIndex(
864
+ (D) => D.connectinonId === K.connectinonId && D.tableName === K.tableName
854
865
  ) === $
855
866
  );
856
- m(_), Ms.success(`Added '${d}' to AI Scope`, {
867
+ m(q), cs.success(`Added '${d}' to AI Scope`, {
857
868
  position: "top-right",
858
869
  duration: 2500,
859
870
  richColors: !0
860
871
  });
861
872
  } else {
862
- const z = (f || []).filter(
863
- (E) => E.connectinonId !== o && E.tableName !== d
873
+ const F = (f || []).filter(
874
+ (A) => A.connectinonId !== c && A.tableName !== d
864
875
  );
865
- m(z), Ms(`Removed '${d}' from AI Scope`, {
876
+ m(F), cs(`Removed '${d}' from AI Scope`, {
866
877
  position: "top-right",
867
878
  duration: 2e3,
868
879
  richColors: !0
869
880
  });
870
881
  }
871
882
  }
872
- function A() {
873
- let z = rs(s, n);
874
- ((_) => _.charAt(0) === _.charAt(0).toUpperCase())(n) && (z = `"${n}"`), h(!1), x(`SELECT * FROM ${z} LIMIT 10`), u(!0);
883
+ function N() {
884
+ let F = ds(s, n);
885
+ ((K) => K.charAt(0) === K.charAt(0).toUpperCase())(n) && (F = `"${n}"`), h(!1);
886
+ const q = g === "MSSQL" ? `SELECT top 10 * FROM ${F}` : `SELECT * FROM ${F} LIMIT 10`;
887
+ x(q), u(!0);
875
888
  }
876
889
  function O() {
877
- let z = rs(s, n);
878
- ((_) => _.charAt(0) === _.charAt(0).toUpperCase())(n) && (z = `"${n}"`), h(!1), x(`SELECT COUNT(*) FROM ${z}`), u(!0);
890
+ let F = ds(s, n);
891
+ ((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), h(!1), x(`SELECT COUNT(*) as count FROM ${F}`), u(!0);
879
892
  }
880
893
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
881
894
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
@@ -888,9 +901,9 @@ function vn({
888
901
  variant: "outline",
889
902
  className: "h-9 px-2",
890
903
  children: /* @__PURE__ */ e.jsx(
891
- Ga,
904
+ Qa,
892
905
  {
893
- className: W("size-4", {
906
+ className: Y("size-4", {
894
907
  "text-primary": b(),
895
908
  "text-muted-foreground": !b()
896
909
  })
@@ -902,12 +915,12 @@ function vn({
902
915
  w,
903
916
  {
904
917
  disabled: t !== "Success",
905
- onClick: A,
918
+ onClick: N,
906
919
  size: "sm",
907
920
  variant: "secondary",
908
921
  className: "flex",
909
922
  children: [
910
- 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" }),
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" }),
911
924
  "Top 10"
912
925
  ]
913
926
  }
@@ -921,84 +934,84 @@ function vn({
921
934
  variant: "secondary",
922
935
  className: "flex",
923
936
  children: [
924
- t !== "Success" ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(dn, { 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" }),
925
938
  "Count"
926
939
  ]
927
940
  }
928
941
  )
929
942
  ] }),
930
943
  /* @__PURE__ */ e.jsxs(
931
- bs,
944
+ Cs,
932
945
  {
933
946
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
934
947
  children: [
935
- a == null ? void 0 : a.map((y) => /* @__PURE__ */ e.jsxs(
948
+ a == null ? void 0 : a.map((j) => /* @__PURE__ */ e.jsxs(
936
949
  "div",
937
950
  {
938
- onClick: () => j(y),
939
- className: W(
951
+ onClick: () => z(j),
952
+ className: Y(
940
953
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
941
954
  {
942
- "bg-muted": Qa(y, i)
955
+ "bg-muted": Wa(j, o)
943
956
  }
944
957
  ),
945
958
  children: [
946
959
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
947
- /* @__PURE__ */ e.jsx(ma, { column: y }),
948
- /* @__PURE__ */ e.jsx("span", { children: y.column_name })
960
+ /* @__PURE__ */ e.jsx(ua, { column: j }),
961
+ /* @__PURE__ */ e.jsx("span", { children: j.column_name })
949
962
  ] }),
950
- Ys.includes(y.data_type) && /* @__PURE__ */ e.jsx(
963
+ Ys.includes(j.data_type) && /* @__PURE__ */ e.jsx(
951
964
  "div",
952
965
  {
953
- onClick: (z) => z.stopPropagation(),
966
+ onClick: (F) => F.stopPropagation(),
954
967
  className: "flex items-center justify-end",
955
- children: /* @__PURE__ */ e.jsx(yn, { column: y })
968
+ children: /* @__PURE__ */ e.jsx(Nn, { column: j })
956
969
  }
957
970
  )
958
971
  ]
959
972
  },
960
- y.column_name
973
+ j.column_name
961
974
  )),
962
- /* @__PURE__ */ e.jsx(Os, { orientation: "vertical" }),
963
- /* @__PURE__ */ e.jsx(Os, { orientation: "horizontal" })
975
+ /* @__PURE__ */ e.jsx(Es, { orientation: "vertical" }),
976
+ /* @__PURE__ */ e.jsx(Es, { orientation: "horizontal" })
964
977
  ]
965
978
  }
966
979
  )
967
980
  ] });
968
981
  }
969
- function ua(s, n) {
970
- var ss, ve, Pe, qe;
971
- let a = Kt(() => [], []);
972
- const t = es().authToken || s, i = r(
973
- (S) => S.selectedConnectionId
974
- ), o = r(
975
- (S) => S.selectedDatabaseName
976
- ), l = r(
977
- (S) => S.selectedSchemaName
978
- ), c = r((S) => S.selectedTableName), d = r(
979
- (S) => S.actions.setCurrentColumns
980
- ), f = r(
981
- (S) => S.actions.setSelectedConnectionId
982
- ), m = r(
983
- (S) => S.actions.setSelectedDatabaseName
984
- ), u = r(
985
- (S) => S.actions.setSelectedSchemaName
986
- ), C = r(
987
- (S) => S.actions.setSelectedTableName
988
- ), h = r((S) => S.actions.setCardSql);
989
- function x(S) {
990
- return i && o && l && o !== "NA" ? !0 : i && S === "API" ? !1 : !!(i && S === "S3");
982
+ function xa(s, n) {
983
+ var ss, ve, Je, qe;
984
+ let a = Ut(() => [], []);
985
+ const t = es().authToken || s, o = i(
986
+ (C) => C.selectedConnectionId
987
+ ), c = i(
988
+ (C) => C.selectedDatabaseName
989
+ ), r = i(
990
+ (C) => C.selectedSchemaName
991
+ ), l = i((C) => C.selectedTableName), d = i(
992
+ (C) => C.actions.setCurrentColumns
993
+ ), f = i(
994
+ (C) => C.actions.setSelectedConnectionId
995
+ ), m = i(
996
+ (C) => C.actions.setSelectedDatabaseName
997
+ ), u = i(
998
+ (C) => C.actions.setSelectedSchemaName
999
+ ), S = i(
1000
+ (C) => C.actions.setSelectedTableName
1001
+ ), h = i((C) => C.actions.setCardSql);
1002
+ function x(C) {
1003
+ return o && c && r && c !== "NA" ? !0 : o && C === "API" ? !1 : !!(o && C === "S3");
991
1004
  }
992
- function g(S) {
993
- return !!(i && o && o !== "NA" && l && c || i && (S === "S3" || S === "API"));
1005
+ function g(C) {
1006
+ return !!(o && c && c !== "NA" && r && l || o && (C === "S3" || C === "API"));
994
1007
  }
995
- function j(S) {
996
- return i && S ? !(S === "API" || S === "S3") : !1;
1008
+ function z(C) {
1009
+ return o && C ? !(C === "API" || C === "S3") : !1;
997
1010
  }
998
1011
  const {
999
1012
  data: b,
1000
1013
  isLoading: L,
1001
- isError: A
1014
+ isError: N
1002
1015
  } = Ce({
1003
1016
  queryKey: ["connections"],
1004
1017
  queryFn: () => ze(
@@ -1008,65 +1021,65 @@ function ua(s, n) {
1008
1021
  enabled: !!(t != null && t.accessToken)
1009
1022
  // Only fetch if authToken is present
1010
1023
  }), O = b == null ? void 0 : b.connections.find(
1011
- (S) => S.id === i
1012
- ), y = O == null ? void 0 : O.type, z = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1013
- data: E,
1014
- isLoading: _,
1015
- isFetching: Y,
1024
+ (C) => C.id === o
1025
+ ), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1026
+ data: A,
1027
+ isLoading: q,
1028
+ isFetching: K,
1016
1029
  isError: $,
1017
- refetch: U
1030
+ refetch: G
1018
1031
  } = Ce({
1019
- queryKey: ["databases", i],
1032
+ queryKey: ["databases", o],
1020
1033
  queryFn: () => ze(
1021
1034
  "https://semaphor.cloud/api/v1/databases",
1022
1035
  (t == null ? void 0 : t.accessToken) || "",
1023
1036
  {
1024
- connection_id: i
1037
+ connection_id: o
1025
1038
  }
1026
1039
  ),
1027
- enabled: j(y)
1040
+ enabled: z(j)
1028
1041
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1029
1042
  }), {
1030
1043
  data: D,
1031
1044
  isLoading: te,
1032
- isFetching: G,
1045
+ isFetching: Q,
1033
1046
  isError: ee,
1034
1047
  refetch: Z
1035
1048
  } = Ce({
1036
- queryKey: ["schemas", i, o],
1049
+ queryKey: ["schemas", o, c],
1037
1050
  queryFn: () => ze(
1038
1051
  "https://semaphor.cloud/api/v1/schemas",
1039
1052
  (t == null ? void 0 : t.accessToken) || "",
1040
1053
  {
1041
- connection_id: i,
1042
- database_name: o
1054
+ connection_id: o,
1055
+ database_name: c
1043
1056
  }
1044
1057
  ),
1045
- enabled: !!i && !!o && !z && o !== "NA"
1058
+ enabled: !!o && !!c && !F && c !== "NA"
1046
1059
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1047
1060
  }), {
1048
1061
  data: J,
1049
1062
  isLoading: I,
1050
- isFetching: v,
1051
- isError: N,
1052
- refetch: F
1063
+ isFetching: y,
1064
+ isError: v,
1065
+ refetch: M
1053
1066
  } = Ce({
1054
1067
  queryKey: [
1055
1068
  "tables",
1056
- i,
1057
1069
  o,
1058
- l
1070
+ c,
1071
+ r
1059
1072
  ],
1060
1073
  queryFn: () => ze(
1061
1074
  "https://semaphor.cloud/api/v1/tables",
1062
1075
  (t == null ? void 0 : t.accessToken) || "",
1063
1076
  {
1064
- connection_id: i,
1065
- database_name: o,
1066
- schema_name: l
1077
+ connection_id: o,
1078
+ database_name: c,
1079
+ schema_name: r
1067
1080
  }
1068
1081
  ),
1069
- enabled: x(y)
1082
+ enabled: x(j)
1070
1083
  }), {
1071
1084
  data: H,
1072
1085
  isLoading: ue,
@@ -1075,22 +1088,22 @@ function ua(s, n) {
1075
1088
  } = Ce({
1076
1089
  queryKey: [
1077
1090
  "columns",
1078
- i,
1079
1091
  o,
1080
- l,
1081
- c
1092
+ c,
1093
+ r,
1094
+ l
1082
1095
  ],
1083
1096
  queryFn: () => ze(
1084
1097
  "https://semaphor.cloud/api/v1/columns",
1085
1098
  (t == null ? void 0 : t.accessToken) || "",
1086
1099
  {
1087
- connection_id: i,
1088
- database_name: o,
1089
- schema_name: l,
1090
- table_name: c
1100
+ connection_id: o,
1101
+ database_name: c,
1102
+ schema_name: r,
1103
+ table_name: l
1091
1104
  }
1092
1105
  ),
1093
- enabled: g(y)
1106
+ enabled: g(j)
1094
1107
  // (!!selectedConnectionId &&
1095
1108
  // !!selectedDatabaseName &&
1096
1109
  // !!selectedSchemaName &&
@@ -1099,113 +1112,113 @@ function ua(s, n) {
1099
1112
  //currentConnection?.type === 'API',
1100
1113
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1101
1114
  });
1102
- K(() => {
1115
+ P(() => {
1103
1116
  d(a);
1104
- }, [H, d, a]), K(() => {
1117
+ }, [H, d, a]), P(() => {
1105
1118
  }, [
1106
- z,
1119
+ F,
1107
1120
  h,
1108
- C,
1121
+ S,
1109
1122
  u,
1110
1123
  m,
1111
1124
  O
1112
1125
  ]);
1113
- const je = (O == null ? void 0 : O.type) === "API" ? (ss = O == null ? void 0 : O.type) == null ? void 0 : ss.toLowerCase() : c || "", be = z ? "" : l || "";
1114
- function xe(S) {
1115
- u(S), C("");
1126
+ const je = (O == null ? void 0 : O.type) === "API" ? (ss = O == null ? void 0 : O.type) == null ? void 0 : ss.toLowerCase() : l || "", be = F ? "" : r || "";
1127
+ function xe(C) {
1128
+ u(C), S("");
1116
1129
  }
1117
- function P(S) {
1118
- m(S), u(""), C("");
1130
+ function U(C) {
1131
+ m(C), u(""), S("");
1119
1132
  }
1120
- function ne(S) {
1121
- f(S);
1133
+ function ne(C) {
1134
+ f(C);
1122
1135
  }
1123
- E && ((ve = E == null ? void 0 : E.databases) == null ? void 0 : ve.length) > 0, D && ((Pe = D == null ? void 0 : D.schemas) == null ? void 0 : Pe.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((S) => ({
1124
- ...S,
1125
- data_type: S.data_type.toLowerCase()
1126
- }))), $ && (a = []), (ge || A) && (a = []);
1127
- const le = b == null ? void 0 : b.connections.map(
1128
- (S) => ({
1129
- id: S.id,
1130
- name: S.name,
1131
- type: S.type
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((C) => ({
1137
+ ...C,
1138
+ data_type: C.data_type.toLowerCase()
1139
+ }))), $ && (a = []), (ge || N) && (a = []);
1140
+ const re = b == null ? void 0 : b.connections.map(
1141
+ (C) => ({
1142
+ id: C.id,
1143
+ name: C.name,
1144
+ type: C.type
1132
1145
  })
1133
- ), ye = E == null ? void 0 : E.databases.map((S) => ({
1134
- id: S.database_name,
1135
- name: S.database_name
1136
- })), re = D == null ? void 0 : D.schemas.map((S) => ({
1137
- id: S.schema_name,
1138
- name: S.schema_name
1139
- })), Ie = J == null ? void 0 : J.tables.map((S) => ({
1140
- id: S.table_name,
1141
- name: S.table_name
1146
+ ), ye = A == null ? void 0 : A.databases.map((C) => ({
1147
+ id: C.database_name,
1148
+ name: C.database_name
1149
+ })), le = D == null ? void 0 : D.schemas.map((C) => ({
1150
+ id: C.schema_name,
1151
+ name: C.schema_name
1152
+ })), Ie = J == null ? void 0 : J.tables.map((C) => ({
1153
+ id: C.table_name,
1154
+ name: C.table_name
1142
1155
  }));
1143
1156
  return {
1144
- connectionItems: le,
1157
+ connectionItems: re,
1145
1158
  isConnectionsLoading: L,
1146
- isConnectionsError: A,
1159
+ isConnectionsError: N,
1147
1160
  databaseItems: ye,
1148
- isDatabasesLoadingOrFetching: _ || Y,
1161
+ isDatabasesLoadingOrFetching: q || K,
1149
1162
  isDatabaseError: $,
1150
- schemaItems: re,
1151
- isSchemaLoadingOrFetching: te || G,
1163
+ schemaItems: le,
1164
+ isSchemaLoadingOrFetching: te || Q,
1152
1165
  isSchemaError: ee,
1153
1166
  tableItems: Ie,
1154
- isTableLoadingOrFetching: I || v,
1155
- isTableError: N,
1167
+ isTableLoadingOrFetching: I || y,
1168
+ isTableError: v,
1156
1169
  columns: a,
1157
1170
  isColumnsLoadingOrFetching: ue || se,
1158
1171
  isColumnsError: ge,
1159
- isNonDbConnection: z,
1160
- connectionType: y,
1172
+ isNonDbConnection: F,
1173
+ connectionType: j,
1161
1174
  tableName: je,
1162
1175
  schemaName: be,
1163
1176
  handleConnectionChange: ne,
1164
- handleDatabaseChange: P,
1177
+ handleDatabaseChange: U,
1165
1178
  handleSchemaChange: xe
1166
1179
  };
1167
1180
  }
1168
- function xa({
1181
+ function pa({
1169
1182
  ColumnsComponent: s
1170
1183
  }) {
1171
1184
  var J;
1172
- const n = r(
1185
+ const n = i(
1173
1186
  (I) => I.selectedConnectionId
1174
- ), a = r(
1187
+ ), a = i(
1175
1188
  (I) => I.selectedDatabaseName
1176
- ), t = r(
1189
+ ), t = i(
1177
1190
  (I) => I.selectedSchemaName
1178
- ), i = r((I) => I.selectedTableName), o = r(
1191
+ ), o = i((I) => I.selectedTableName), c = i(
1179
1192
  (I) => I.actions.setSelectedTableName
1180
1193
  ), {
1181
- connectionItems: l,
1182
- schemaItems: c,
1194
+ connectionItems: r,
1195
+ schemaItems: l,
1183
1196
  databaseItems: d,
1184
1197
  tableItems: f,
1185
1198
  columns: m,
1186
1199
  isConnectionsLoading: u,
1187
- isConnectionsError: C,
1200
+ isConnectionsError: S,
1188
1201
  isDatabasesLoadingOrFetching: h,
1189
1202
  isDatabaseError: x,
1190
1203
  isSchemaLoadingOrFetching: g,
1191
- isSchemaError: j,
1204
+ isSchemaError: z,
1192
1205
  isColumnsError: b,
1193
1206
  isColumnsLoadingOrFetching: L,
1194
- isTableLoadingOrFetching: A,
1207
+ isTableLoadingOrFetching: N,
1195
1208
  isTableError: O,
1196
- connectionType: y,
1197
- isNonDbConnection: z,
1198
- handleConnectionChange: E,
1199
- handleDatabaseChange: _,
1200
- handleSchemaChange: Y,
1209
+ connectionType: j,
1210
+ isNonDbConnection: F,
1211
+ handleConnectionChange: A,
1212
+ handleDatabaseChange: q,
1213
+ handleSchemaChange: K,
1201
1214
  tableName: $,
1202
- schemaName: U
1203
- } = ua();
1215
+ schemaName: G
1216
+ } = xa();
1204
1217
  function D() {
1205
- return s ? s(U, $, m) : /* @__PURE__ */ e.jsx(
1206
- vn,
1218
+ return s ? s(G, $, m) : /* @__PURE__ */ e.jsx(
1219
+ Cn,
1207
1220
  {
1208
- schemaName: U,
1221
+ schemaName: G,
1209
1222
  tableName: $,
1210
1223
  columns: m,
1211
1224
  status: L ? "Loading..." : b ? "Error" : "Success"
@@ -1215,11 +1228,11 @@ function xa({
1215
1228
  function te() {
1216
1229
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1217
1230
  }
1218
- function G() {
1219
- return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
1220
- Ge,
1231
+ function Q() {
1232
+ return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1233
+ Qe,
1221
1234
  {
1222
- onChange: _,
1235
+ onChange: q,
1223
1236
  isError: x,
1224
1237
  isLoading: h,
1225
1238
  items: d,
@@ -1229,27 +1242,27 @@ function xa({
1229
1242
  );
1230
1243
  }
1231
1244
  function ee() {
1232
- return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
1233
- Ge,
1245
+ return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1246
+ Qe,
1234
1247
  {
1235
- onChange: Y,
1236
- isError: j,
1248
+ onChange: K,
1249
+ isError: z,
1237
1250
  isLoading: g,
1238
- items: c,
1251
+ items: l,
1239
1252
  value: t || "",
1240
1253
  title: "Schema"
1241
1254
  }
1242
1255
  );
1243
1256
  }
1244
1257
  function Z() {
1245
- return y === "API" ? null : /* @__PURE__ */ e.jsx(
1246
- Ge,
1258
+ return j === "API" ? null : /* @__PURE__ */ e.jsx(
1259
+ Qe,
1247
1260
  {
1248
- onChange: o,
1261
+ onChange: c,
1249
1262
  isError: O,
1250
1263
  items: f,
1251
- isLoading: A,
1252
- value: i || "",
1264
+ isLoading: N,
1265
+ value: o || "",
1253
1266
  title: "Table"
1254
1267
  }
1255
1268
  );
@@ -1257,20 +1270,20 @@ function xa({
1257
1270
  return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
1258
1271
  /* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
1259
1272
  /* @__PURE__ */ e.jsx(
1260
- Ge,
1273
+ Qe,
1261
1274
  {
1262
- items: l,
1275
+ items: r,
1263
1276
  title: "Connection",
1264
1277
  value: n || "",
1265
- onChange: E,
1278
+ onChange: A,
1266
1279
  isLoading: u,
1267
- isError: C,
1268
- connectionTooltip: ((J = l == null ? void 0 : l.find(
1280
+ isError: S,
1281
+ connectionTooltip: ((J = r == null ? void 0 : r.find(
1269
1282
  (I) => I.id === n
1270
1283
  )) == null ? void 0 : J.type) || ""
1271
1284
  }
1272
1285
  ),
1273
- G(),
1286
+ Q(),
1274
1287
  ee(),
1275
1288
  Z()
1276
1289
  ] }),
@@ -1283,37 +1296,37 @@ function xa({
1283
1296
  variant: "secondary",
1284
1297
  className: "w-full",
1285
1298
  children: [
1286
- /* @__PURE__ */ e.jsx(tn, { className: "mr-2 size-4" }),
1299
+ /* @__PURE__ */ e.jsx(rn, { className: "mr-2 size-4" }),
1287
1300
  "Help"
1288
1301
  ]
1289
1302
  }
1290
1303
  ) })
1291
1304
  ] });
1292
1305
  }
1293
- function Nn(s) {
1294
- const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
1295
- let o = s.length;
1296
- if (i !== -1 && (o = i), t !== -1 && t < o && (o = t), n !== -1) {
1297
- const l = s.substring(0, n), c = s.substring(n);
1298
- return `${l} {{ filters | where }} AND ${c.substring(
1306
+ function Sn(s) {
1307
+ const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), o = s.toUpperCase().indexOf("ORDER BY");
1308
+ let c = s.length;
1309
+ if (o !== -1 && (c = o), t !== -1 && t < c && (c = t), n !== -1) {
1310
+ const r = s.substring(0, n), l = s.substring(n);
1311
+ return `${r} {{ filters | where }} AND ${l.substring(
1299
1312
  6
1300
1313
  )}`;
1301
1314
  } else if (a !== -1) {
1302
- const l = s.substring(0, a), c = s.substring(a);
1303
- return `${l} {{ filters | where }} ${c}`;
1315
+ const r = s.substring(0, a), l = s.substring(a);
1316
+ return `${r} {{ filters | where }} ${l}`;
1304
1317
  } else {
1305
- const l = s.substring(0, o), c = s.substring(o);
1306
- return `${l} {{ filters | where }} ${c}`;
1318
+ const r = s.substring(0, c), l = s.substring(c);
1319
+ return `${r} {{ filters | where }} ${l}`;
1307
1320
  }
1308
1321
  }
1309
- function Cn({
1322
+ function kn({
1310
1323
  error: s,
1311
1324
  setShowAIDialog: n,
1312
1325
  setUserInputforAI: a,
1313
1326
  setTriggerAIRun: t
1314
1327
  }) {
1315
1328
  return /* @__PURE__ */ e.jsxs(Zs, { openDelay: 0, children: [
1316
- /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Pt, { className: "h-4 w-4 text-red-500" }) }) }),
1329
+ /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Qt, { className: "h-4 w-4 text-red-500" }) }) }),
1317
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: [
1318
1331
  /* @__PURE__ */ e.jsxs(
1319
1332
  w,
@@ -1324,44 +1337,44 @@ function Cn({
1324
1337
  size: "sm",
1325
1338
  variant: "outline",
1326
1339
  children: [
1327
- /* @__PURE__ */ e.jsx(Yt, { className: "h-4 w-4 mr-2" }),
1340
+ /* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4 mr-2" }),
1328
1341
  "Fix It"
1329
1342
  ]
1330
1343
  }
1331
1344
  ),
1332
- /* @__PURE__ */ e.jsx(bs, { 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 }) })
1333
1346
  ] }) }) })
1334
1347
  ] });
1335
1348
  }
1336
- function Sn({
1349
+ function wn({
1337
1350
  text: s,
1338
1351
  onCheckedChange: n,
1339
1352
  checked: a
1340
1353
  }) {
1341
1354
  return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
1342
- /* @__PURE__ */ e.jsx($e, { checked: a, onCheckedChange: n }),
1355
+ /* @__PURE__ */ e.jsx(Pe, { checked: a, onCheckedChange: n }),
1343
1356
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1344
1357
  ] });
1345
1358
  }
1346
- function kn() {
1347
- const { authToken: s } = es(), n = Be(null), a = r((c) => c.applyFilters), [t, i] = M(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
1359
+ function zn() {
1360
+ const { authToken: s } = es(), n = $e(null), a = i((l) => l.applyFilters), [t, o] = T(""), c = i((l) => l.filterValues), r = i((l) => l.card.sql);
1348
1361
  return /* @__PURE__ */ e.jsxs(
1349
1362
  Zs,
1350
1363
  {
1351
1364
  openDelay: 0,
1352
- onOpenChange: async (c) => {
1353
- if (!c)
1365
+ onOpenChange: async (l) => {
1366
+ if (!l)
1354
1367
  return;
1355
1368
  console.log("onOpenChange");
1356
1369
  const d = await aa(
1357
1370
  "https://semaphor.cloud/api/v1/filter-sql",
1358
1371
  (s == null ? void 0 : s.accessToken) || "",
1359
1372
  {
1360
- sql: l,
1361
- active_filters: o
1373
+ sql: r,
1374
+ active_filters: c
1362
1375
  }
1363
1376
  );
1364
- console.log(d), d.sql ? (console.log(d.records), i(d.sql)) : i("Error");
1377
+ console.log(d), d.sql ? (console.log(d.records), o(d.sql)) : o("Error");
1365
1378
  },
1366
1379
  children: [
1367
1380
  /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
@@ -1371,13 +1384,13 @@ function kn() {
1371
1384
  /* @__PURE__ */ e.jsx(
1372
1385
  ta,
1373
1386
  {
1374
- onClick: () => Wa(n),
1387
+ onClick: () => Ya(n),
1375
1388
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
1376
1389
  }
1377
1390
  )
1378
1391
  ] }) }) }),
1379
1392
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
1380
- /* @__PURE__ */ e.jsx(Ya, { className: "h-4 w-4 opacity-70" }),
1393
+ /* @__PURE__ */ e.jsx(Xa, { className: "h-4 w-4 opacity-70" }),
1381
1394
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
1382
1395
  ] })
1383
1396
  ] })
@@ -1385,7 +1398,7 @@ function kn() {
1385
1398
  }
1386
1399
  );
1387
1400
  }
1388
- const wn = `
1401
+ const Fn = `
1389
1402
 
1390
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.
1391
1404
 
@@ -1432,73 +1445,73 @@ SELECT label, measure FROM table
1432
1445
  - Label - Category
1433
1446
  - Measure - Number
1434
1447
  `;
1435
- function zn({
1448
+ function On({
1436
1449
  open: s,
1437
1450
  setOpen: n,
1438
1451
  userInput: a,
1439
1452
  setUserInput: t,
1440
- triggerAIRun: i,
1441
- setTriggerAIRun: o
1453
+ triggerAIRun: o,
1454
+ setTriggerAIRun: c
1442
1455
  }) {
1443
- const l = Be(null), c = Be(null), { authToken: d } = es(), [f, m] = M(!1), u = r((v) => v.actions.setCardSql), C = k((v) => v.dashboard.baseQueries), h = r((v) => v.actions.setRunSql), x = r((v) => v.actions.setCardType), [g, j] = M([]), b = r((v) => v.currentColumns), L = r((v) => v.card.sql), A = r((v) => v.selectedTableName), O = `
1456
+ const r = $e(null), l = $e(null), { authToken: d } = es(), [f, m] = T(!1), u = i((y) => y.actions.setCardSql), S = k((y) => y.dashboard.baseQueries), h = i((y) => y.actions.setRunSql), x = i((y) => y.actions.setCardType), [g, z] = T([]), b = i((y) => y.currentColumns), L = i((y) => y.card.sql), N = i((y) => y.selectedTableName), O = `
1444
1457
  ${a}
1445
1458
 
1446
- Database Query Dialect: ${A === "api" || A === "s3" ? "DuckDb" : ""}
1447
- Table Name: ${A}
1448
- Table Columns: ${b == null ? void 0 : b.map((v) => `${v.column_name} | ${v.data_type}`).join(", ")}
1459
+ Database Query Dialect: ${N === "api" || N === "s3" ? "DuckDb" : ""}
1460
+ Table Name: ${N}
1461
+ Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
1449
1462
  User SQL: ${L}
1450
- ${C && `Base Queries: ${JSON.stringify(C)} `}`, y = ` 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.
1451
- Visual Query Syntax: ${wn}`, { data: z, isLoading: E, isFetching: _, isError: Y, refetch: $ } = Ce({
1463
+ ${S && `Base Queries: ${JSON.stringify(S)} `}`, 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.
1464
+ Visual Query Syntax: ${Fn}`, { data: F, isLoading: A, isFetching: q, isError: K, refetch: $ } = Ce({
1452
1465
  queryKey: ["ai-query"],
1453
1466
  queryFn: () => ze(
1454
1467
  "https://semaphor.cloud/api/v1/ai",
1455
1468
  (d == null ? void 0 : d.accessToken) || "",
1456
1469
  {
1457
- user_content: `userContent: ${O} ${f ? y : ""}`
1470
+ user_content: `userContent: ${O} ${f ? j : ""}`
1458
1471
  }
1459
1472
  ),
1460
1473
  enabled: !1
1461
1474
  // Do not run by default.
1462
1475
  });
1463
- function U(v) {
1464
- if (v.toLowerCase().includes("bar"))
1476
+ function G(y) {
1477
+ if (y.toLowerCase().includes("bar"))
1465
1478
  x("bar");
1466
- else if (v.toLowerCase().includes("line"))
1479
+ else if (y.toLowerCase().includes("line"))
1467
1480
  x("line");
1468
- else if (v.toLowerCase().includes("bubble"))
1481
+ else if (y.toLowerCase().includes("bubble"))
1469
1482
  x("bubble");
1470
- else if (v.toLowerCase().includes("scatter"))
1483
+ else if (y.toLowerCase().includes("scatter"))
1471
1484
  x("scatter");
1472
- else if (v.toLowerCase().includes("stacked"))
1485
+ else if (y.toLowerCase().includes("stacked"))
1473
1486
  x("stackedBar");
1474
- else if (v.toLowerCase().includes("pie"))
1487
+ else if (y.toLowerCase().includes("pie"))
1475
1488
  x("pie");
1476
- else if (v.toLowerCase().includes("donut") || v.toLowerCase().includes("doughnut"))
1489
+ else if (y.toLowerCase().includes("donut") || y.toLowerCase().includes("doughnut"))
1477
1490
  x("doughnut");
1478
- else if (v.toLowerCase().includes("radar"))
1491
+ else if (y.toLowerCase().includes("radar"))
1479
1492
  x("radar");
1480
1493
  else
1481
1494
  return x("bar"), !1;
1482
1495
  return !0;
1483
1496
  }
1484
- K(() => {
1485
- z && j((v) => [...v, { role: "ai", content: z.response }]);
1486
- }, [z]), K(() => {
1487
- const v = setTimeout(() => {
1488
- var N;
1489
- c.current && (c.current.scroll({
1490
- top: c.current.scrollHeight,
1497
+ P(() => {
1498
+ F && z((y) => [...y, { role: "ai", content: F.response }]);
1499
+ }, [F]), P(() => {
1500
+ const y = setTimeout(() => {
1501
+ var v;
1502
+ l.current && (l.current.scroll({
1503
+ top: l.current.scrollHeight,
1491
1504
  behavior: "smooth"
1492
- }), (N = l.current) == null || N.focus());
1505
+ }), (v = r.current) == null || v.focus());
1493
1506
  }, 100);
1494
- return () => clearTimeout(v);
1507
+ return () => clearTimeout(y);
1495
1508
  }, [g]);
1496
1509
  function D() {
1497
- a && (j((v) => [...v, { role: "user", content: a }]), U(a) && m(!0), t(""), $());
1510
+ a && (z((y) => [...y, { role: "user", content: a }]), G(a) && m(!0), t(""), $());
1498
1511
  }
1499
- K(() => {
1500
- i && (D(), o(!1));
1501
- }, [i, o]);
1512
+ P(() => {
1513
+ o && (D(), c(!1));
1514
+ }, [o, c]);
1502
1515
  const te = {
1503
1516
  //seleect a darker color
1504
1517
  // color: '#000',
@@ -1507,7 +1520,7 @@ function zn({
1507
1520
  fontSize: 15,
1508
1521
  // padding: '5px',
1509
1522
  width: "100%"
1510
- }, G = {
1523
+ }, Q = {
1511
1524
  // background: '#f6f8fa',
1512
1525
  // color: '#000',
1513
1526
  fontFamily: "monospace",
@@ -1526,59 +1539,59 @@ function zn({
1526
1539
  listStyleType: "disc"
1527
1540
  }, Z = {
1528
1541
  // Override how paragraphs are rendered
1529
- p: ({ node: v, ...N }) => /* @__PURE__ */ e.jsx("p", { style: te, ...N }),
1530
- code: ({ node: v, ...N }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...N }),
1531
- pre: ({ node: v, ...N }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: G, children: [
1532
- /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: N.children }),
1542
+ p: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("p", { style: te, ...v }),
1543
+ code: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...v }),
1544
+ pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Q, children: [
1545
+ /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
1533
1546
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1534
1547
  /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
1535
1548
  /* @__PURE__ */ e.jsx(
1536
1549
  w,
1537
1550
  {
1538
- onClick: (F) => {
1539
- const H = J(F);
1551
+ onClick: (M) => {
1552
+ const H = J(M);
1540
1553
  H && (n(!1), u(H), h(!0));
1541
1554
  },
1542
1555
  size: "sm",
1543
1556
  variant: "outline",
1544
- children: /* @__PURE__ */ e.jsx(et, {})
1557
+ children: /* @__PURE__ */ e.jsx(st, {})
1545
1558
  }
1546
1559
  )
1547
1560
  ] })
1548
1561
  ] }),
1549
- li: ({ node: v, ...N }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...N })
1562
+ li: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...v })
1550
1563
  // You can add more overrides for other elements like h1, h2, etc.
1551
1564
  };
1552
- function J(v) {
1553
- const N = v.currentTarget.closest("pre");
1554
- if (!N)
1565
+ function J(y) {
1566
+ const v = y.currentTarget.closest("pre");
1567
+ if (!v)
1555
1568
  return;
1556
- const F = N.textContent || N.innerText;
1557
- return navigator.clipboard.writeText(F).then(() => console.log("Text copied to clipboard")).catch((H) => console.error("Error in copying text: ", H)), F;
1569
+ const M = v.textContent || v.innerText;
1570
+ return navigator.clipboard.writeText(M).then(() => console.log("Text copied to clipboard")).catch((H) => console.error("Error in copying text: ", H)), M;
1558
1571
  }
1559
1572
  function I() {
1560
- return g == null ? void 0 : g.map((v, N) => v.role === "user" ? /* @__PURE__ */ e.jsxs(
1573
+ return g == null ? void 0 : g.map((y, v) => y.role === "user" ? /* @__PURE__ */ e.jsxs(
1561
1574
  "div",
1562
1575
  {
1563
1576
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1564
1577
  children: [
1565
- /* @__PURE__ */ e.jsx(pn, { className: "mr-2 h-5 w-5" }),
1566
- /* @__PURE__ */ e.jsx("div", { children: v.content })
1578
+ /* @__PURE__ */ e.jsx(gn, { className: "mr-2 h-5 w-5" }),
1579
+ /* @__PURE__ */ e.jsx("div", { children: y.content })
1567
1580
  ]
1568
1581
  },
1569
- N
1570
- ) : v.role === "ai" ? /* @__PURE__ */ e.jsx(
1571
- Za,
1582
+ v
1583
+ ) : y.role === "ai" ? /* @__PURE__ */ e.jsx(
1584
+ et,
1572
1585
  {
1573
1586
  className: "w-full overflow-auto py-1",
1574
1587
  components: Z,
1575
- children: z == null ? void 0 : z.response.replace(/DuckDB/gi, "Semaphor")
1588
+ children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
1576
1589
  },
1577
- N
1578
- ) : /* @__PURE__ */ e.jsx("div", {}, N));
1590
+ v
1591
+ ) : /* @__PURE__ */ e.jsx("div", {}, v));
1579
1592
  }
1580
- return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
1581
- /* @__PURE__ */ e.jsx(hs, { 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(
1582
1595
  w,
1583
1596
  {
1584
1597
  size: "sm",
@@ -1588,18 +1601,18 @@ function zn({
1588
1601
  }
1589
1602
  ) }),
1590
1603
  /* @__PURE__ */ e.jsxs(
1591
- ms,
1604
+ fs,
1592
1605
  {
1593
1606
  className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
1594
1607
  children: [
1595
- /* @__PURE__ */ e.jsxs(us, { children: [
1596
- /* @__PURE__ */ e.jsx(xs, { children: "Assistant" }),
1597
- /* @__PURE__ */ e.jsx(ps, { 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?" })
1598
1611
  ] }),
1599
1612
  /* @__PURE__ */ e.jsx(
1600
1613
  "div",
1601
1614
  {
1602
- ref: c,
1615
+ ref: l,
1603
1616
  className: "h-[625px] w-full overflow-auto border-t border-t-muted",
1604
1617
  children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: I() })
1605
1618
  }
@@ -1612,21 +1625,21 @@ function zn({
1612
1625
  na,
1613
1626
  {
1614
1627
  autoFocus: !0,
1615
- ref: l,
1616
- onKeyDown: (v) => {
1617
- v.key === "Enter" && !v.shiftKey && (v.preventDefault(), t(""), D());
1628
+ ref: r,
1629
+ onKeyDown: (y) => {
1630
+ y.key === "Enter" && !y.shiftKey && (y.preventDefault(), t(""), D());
1618
1631
  },
1619
1632
  placeholder: "Type your question here...",
1620
- onFocus: (v) => {
1621
- const N = v.target, F = N.value.length;
1622
- N.setSelectionRange(F, F);
1633
+ onFocus: (y) => {
1634
+ const v = y.target, M = v.value.length;
1635
+ v.setSelectionRange(M, M);
1623
1636
  },
1624
- className: W(
1637
+ className: Y(
1625
1638
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1626
1639
  ),
1627
- disabled: E || _,
1640
+ disabled: A || q,
1628
1641
  value: a,
1629
- onChange: (v) => t(v.target.value)
1642
+ onChange: (y) => t(y.target.value)
1630
1643
  }
1631
1644
  ),
1632
1645
  " ",
@@ -1637,7 +1650,7 @@ function zn({
1637
1650
  size: "sm",
1638
1651
  variant: "ghost",
1639
1652
  onClick: D,
1640
- children: !E && !_ ? /* @__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" })
1641
1654
  }
1642
1655
  )
1643
1656
  ] })
@@ -1648,30 +1661,30 @@ function zn({
1648
1661
  )
1649
1662
  ] });
1650
1663
  }
1651
- var pa = {
1664
+ var fa = {
1652
1665
  color: void 0,
1653
1666
  size: void 0,
1654
1667
  className: void 0,
1655
1668
  style: void 0,
1656
1669
  attr: void 0
1657
- }, _s = me.createContext && /* @__PURE__ */ me.createContext(pa), Fn = ["attr", "size", "title"];
1658
- function On(s, n) {
1670
+ }, Hs = me.createContext && /* @__PURE__ */ me.createContext(fa), Mn = ["attr", "size", "title"];
1671
+ function Tn(s, n) {
1659
1672
  if (s == null)
1660
1673
  return {};
1661
- var a = Mn(s, n), t, i;
1674
+ var a = An(s, n), t, o;
1662
1675
  if (Object.getOwnPropertySymbols) {
1663
- var o = Object.getOwnPropertySymbols(s);
1664
- for (i = 0; i < o.length; i++)
1665
- t = o[i], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
1676
+ var c = Object.getOwnPropertySymbols(s);
1677
+ for (o = 0; o < c.length; o++)
1678
+ t = c[o], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
1666
1679
  }
1667
1680
  return a;
1668
1681
  }
1669
- function Mn(s, n) {
1682
+ function An(s, n) {
1670
1683
  if (s == null)
1671
1684
  return {};
1672
- var a = {}, t = Object.keys(s), i, o;
1673
- for (o = 0; o < t.length; o++)
1674
- i = t[o], !(n.indexOf(i) >= 0) && (a[i] = s[i]);
1685
+ var a = {}, t = Object.keys(s), o, c;
1686
+ for (c = 0; c < t.length; c++)
1687
+ o = t[c], !(n.indexOf(o) >= 0) && (a[o] = s[o]);
1675
1688
  return a;
1676
1689
  }
1677
1690
  function Xe() {
@@ -1684,12 +1697,12 @@ function Xe() {
1684
1697
  return s;
1685
1698
  }, Xe.apply(this, arguments);
1686
1699
  }
1687
- function Hs(s, n) {
1700
+ function Bs(s, n) {
1688
1701
  var a = Object.keys(s);
1689
1702
  if (Object.getOwnPropertySymbols) {
1690
1703
  var t = Object.getOwnPropertySymbols(s);
1691
- n && (t = t.filter(function(i) {
1692
- return Object.getOwnPropertyDescriptor(s, i).enumerable;
1704
+ n && (t = t.filter(function(o) {
1705
+ return Object.getOwnPropertyDescriptor(s, o).enumerable;
1693
1706
  })), a.push.apply(a, t);
1694
1707
  }
1695
1708
  return a;
@@ -1697,22 +1710,22 @@ function Hs(s, n) {
1697
1710
  function Ze(s) {
1698
1711
  for (var n = 1; n < arguments.length; n++) {
1699
1712
  var a = arguments[n] != null ? arguments[n] : {};
1700
- n % 2 ? Hs(Object(a), !0).forEach(function(t) {
1701
- Tn(s, t, a[t]);
1702
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Hs(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) {
1703
1716
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
1704
1717
  });
1705
1718
  }
1706
1719
  return s;
1707
1720
  }
1708
- function Tn(s, n, a) {
1709
- return n = An(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1721
+ function En(s, n, a) {
1722
+ return n = Ln(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1710
1723
  }
1711
- function An(s) {
1712
- var n = En(s, "string");
1724
+ function Ln(s) {
1725
+ var n = Dn(s, "string");
1713
1726
  return typeof n == "symbol" ? n : String(n);
1714
1727
  }
1715
- function En(s, n) {
1728
+ function Dn(s, n) {
1716
1729
  if (typeof s != "object" || s === null)
1717
1730
  return s;
1718
1731
  var a = s[Symbol.toPrimitive];
@@ -1724,128 +1737,131 @@ function En(s, n) {
1724
1737
  }
1725
1738
  return (n === "string" ? String : Number)(s);
1726
1739
  }
1727
- function fa(s) {
1740
+ function ga(s) {
1728
1741
  return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, Ze({
1729
1742
  key: a
1730
- }, n.attr), fa(n.child)));
1743
+ }, n.attr), ga(n.child)));
1731
1744
  }
1732
1745
  function fe(s) {
1733
- return (n) => /* @__PURE__ */ me.createElement(Ln, Xe({
1746
+ return (n) => /* @__PURE__ */ me.createElement(In, Xe({
1734
1747
  attr: Ze({}, s.attr)
1735
- }, n), fa(s.child));
1748
+ }, n), ga(s.child));
1736
1749
  }
1737
- function Ln(s) {
1750
+ function In(s) {
1738
1751
  var n = (a) => {
1739
1752
  var {
1740
1753
  attr: t,
1741
- size: i,
1742
- title: o
1743
- } = s, l = On(s, Fn), c = i || a.size || "1em", d;
1754
+ size: o,
1755
+ title: c
1756
+ } = s, r = Tn(s, Mn), l = o || a.size || "1em", d;
1744
1757
  return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
1745
1758
  stroke: "currentColor",
1746
1759
  fill: "currentColor",
1747
1760
  strokeWidth: "0"
1748
- }, a.attr, t, l, {
1761
+ }, a.attr, t, r, {
1749
1762
  className: d,
1750
1763
  style: Ze(Ze({
1751
1764
  color: s.color || a.color
1752
1765
  }, a.style), s.style),
1753
- height: c,
1754
- width: c,
1766
+ height: l,
1767
+ width: l,
1755
1768
  xmlns: "http://www.w3.org/2000/svg"
1756
- }), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
1769
+ }), c && /* @__PURE__ */ me.createElement("title", null, c), s.children);
1757
1770
  };
1758
- return _s !== void 0 ? /* @__PURE__ */ me.createElement(_s.Consumer, null, (a) => n(a)) : n(pa);
1771
+ return Hs !== void 0 ? /* @__PURE__ */ me.createElement(Hs.Consumer, null, (a) => n(a)) : n(fa);
1759
1772
  }
1760
- function Dn(s) {
1773
+ function qn(s) {
1761
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);
1762
1775
  }
1763
- function In() {
1764
- const { theme: s } = st(), n = Be(), a = Be(), [t, i] = M(!1), [o, l] = M(!1), [c, d] = M(!1), [f, m] = M(""), [u, C] = M(!1), { authToken: h } = es();
1776
+ function Vn() {
1777
+ const { theme: s } = at(), n = $e(), a = $e(), [t, o] = T(!1), [c, r] = T(!1), [l, d] = T(!1), [f, m] = T(""), [u, S] = T(!1), { authToken: h } = es();
1765
1778
  k((p) => p.selectedSheetId);
1766
- const x = k((p) => p.dashboard.baseQueries), g = r((p) => p.card), j = k((p) => p.theme), b = r((p) => p.isShowingVisual), L = r(
1779
+ const x = k((p) => p.dashboard.baseQueries), g = i((p) => p.card), z = k((p) => p.theme), b = i((p) => p.isShowingVisual), L = i(
1767
1780
  (p) => p.selectedConnectionId
1768
- ), A = r(
1781
+ ), N = i(
1769
1782
  (p) => p.selectedDatabaseName
1770
- ), O = r(
1783
+ ), O = i(
1771
1784
  (p) => p.selectedSchemaName
1772
1785
  );
1773
1786
  k(
1774
1787
  (p) => p.actions.updateFrameCard
1775
1788
  );
1776
- const y = r((p) => p.selectedTableName), z = r((p) => p.card.sql), E = r((p) => p.card.python), _ = at(z, x), Y = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), U = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
1789
+ const j = i((p) => p.selectedTableName), F = i((p) => p.card.sql), A = i((p) => p.card.python), q = tt(F, x), K = i((p) => p.selectedConnectionId), $ = i((p) => p.frame), G = i((p) => p.filterValues), D = i((p) => p.applyFilters), {
1777
1790
  setCardCustomCfg: te,
1778
- setQueryResultColumns: G,
1791
+ setQueryResultColumns: Q,
1779
1792
  setFilterValues: ee,
1780
1793
  setCardSql: Z,
1781
1794
  setCardPython: J,
1782
1795
  setQueryError: I,
1783
- setPythonStdOut: v,
1784
- setCardPreferences: N
1785
- } = r((p) => p.actions), F = r((p) => p.onSave), H = r(
1796
+ setPythonStdOut: y,
1797
+ setCardPreferences: v
1798
+ } = i((p) => p.actions), M = i((p) => p.onSave), H = i(
1786
1799
  (p) => p.actions.setApplyFilters
1787
- ), ue = r((p) => p.onClose), se = r((p) => p.actions.setCardData), ge = r((p) => p.actions.setSqlGen), je = r((p) => p.runSql), be = r((p) => p.actions.setRunSql), xe = r(
1800
+ ), ue = i((p) => p.onClose), se = i((p) => p.actions.setCardData), ge = i((p) => p.actions.setSqlGen), je = i((p) => p.runSql), be = i((p) => p.actions.setRunSql), xe = i(
1788
1801
  (p) => p.actions.setIsSqlRunning
1789
1802
  ), {
1790
- data: P,
1803
+ data: U,
1791
1804
  isLoading: ne,
1792
- isFetching: le,
1805
+ isFetching: re,
1793
1806
  isSuccess: ye,
1794
- isError: re,
1807
+ isError: le,
1795
1808
  error: Ie,
1796
1809
  status: ss,
1797
1810
  refetch: ve
1798
1811
  } = Ce({
1799
- queryKey: [_, E],
1812
+ queryKey: [q, A],
1800
1813
  queryFn: () => aa(
1801
1814
  "https://semaphor.cloud/api/v1/query",
1802
1815
  (h == null ? void 0 : h.accessToken) || "",
1803
1816
  {
1804
- connection_id: Y,
1805
- sql: _,
1806
- python: E === Ts ? "" : E,
1807
- active_filters: D ? U : []
1817
+ connection_id: K,
1818
+ sql: q,
1819
+ python: A === Ls ? "" : A,
1820
+ active_filters: D ? G : []
1808
1821
  }
1809
1822
  ),
1810
1823
  enabled: !1,
1811
1824
  retry: !1
1812
1825
  });
1813
- K(() => {
1814
- if (P && (se(P.records), v((P == null ? void 0 : P.output) || ""), P.records.length > 0)) {
1815
- const { dimensionKeys: p } = is(P.records);
1816
- G(p);
1826
+ 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);
1817
1833
  }
1818
- }, [P, se, G, v]), K(() => {
1834
+ }, [U, se, Q, y]), P(() => {
1819
1835
  je && (ve(), be(!1));
1820
- }, [je, ve, be]), K(() => {
1821
- (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), G([]), v("")) : I("");
1836
+ }, [je, ve, be]), P(() => {
1837
+ (ne || re) && xe(!0), (le || ye) && xe(!1), le ? (I(Ie.message), se([]), Q([]), y("")) : I("");
1822
1838
  }, [
1823
1839
  ne,
1824
- le,
1825
- P,
1826
- v,
1827
1840
  re,
1841
+ U,
1842
+ y,
1843
+ le,
1828
1844
  ye,
1829
1845
  xe,
1830
1846
  se,
1831
- G,
1847
+ Q,
1832
1848
  I,
1833
1849
  Ie
1834
1850
  ]);
1835
- function Pe() {
1836
- Z(""), se([]), ge({}), te(""), N({});
1851
+ function Je() {
1852
+ Z(""), se([]), ge({}), te(""), v({});
1837
1853
  }
1838
1854
  const qe = (p) => {
1839
1855
  a.current = p;
1840
1856
  };
1841
- function S() {
1842
- let p = z;
1843
- z && !z.includes("{{") && (p = Nn(z), Z(p));
1857
+ function C() {
1858
+ let p = F;
1859
+ F && !F.includes("{{") && (p = Sn(F), Z(p));
1844
1860
  const ie = {
1845
1861
  ...g,
1846
1862
  lastSelectedSchema: O,
1847
- lastSelectedDatabase: A,
1848
- lastSelectedTable: y,
1863
+ lastSelectedDatabase: N,
1864
+ lastSelectedTable: j,
1849
1865
  connectionId: L,
1850
1866
  type: b ? g.type : "table",
1851
1867
  sql: p,
@@ -1853,34 +1869,34 @@ function In() {
1853
1869
  }, Ve = $.cards.map(
1854
1870
  (Ne) => Ne.id === g.id ? ie : Ne
1855
1871
  );
1856
- F == null || F({
1872
+ M == null || M({
1857
1873
  ...$,
1858
1874
  cards: Ve
1859
1875
  });
1860
1876
  }
1861
- function za() {
1877
+ function Fa() {
1862
1878
  ue == null || ue();
1863
1879
  }
1864
- function Fa(p) {
1880
+ function Oa(p) {
1865
1881
  const ie = getComputedStyle(
1866
1882
  document.documentElement
1867
1883
  ).getPropertyValue(p);
1868
- return Oa(ie);
1884
+ return Ma(ie);
1869
1885
  }
1870
- function Oa(p) {
1871
- const [ie, Ve, Ne] = p.split(" "), Q = parseFloat(ie), Aa = parseFloat(Ve), Ea = parseFloat(Ne), La = Aa / 100, zs = Ea / 100, pe = (1 - Math.abs(2 * zs - 1)) * La, ke = pe * (1 - Math.abs(Q / 60 % 2 - 1)), as = zs - 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;
1872
1888
  let oe = 0, ce = 0, de = 0;
1873
- 0 <= Q && Q < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= Q && Q < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= Q && Q < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= Q && Q < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= Q && Q < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= Q && Q < 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);
1874
- const ts = (Da) => {
1875
- 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);
1876
1892
  return ns.length == 1 ? "0" + ns : ns;
1877
1893
  };
1878
1894
  return `#${ts(oe)}${ts(ce)}${ts(de)}`;
1879
1895
  }
1880
- K(() => {
1896
+ P(() => {
1881
1897
  const p = n.current, ie = a.current;
1882
1898
  if (p) {
1883
- const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = j === "system" ? Ve : j;
1899
+ const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = z === "system" ? Ve : z;
1884
1900
  p.editor.defineTheme("default", {
1885
1901
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
1886
1902
  base: Ne === "light" ? "vs" : "vs-dark",
@@ -1888,7 +1904,7 @@ function In() {
1888
1904
  rules: [],
1889
1905
  colors: {
1890
1906
  // 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
1891
- "editor.background": Ne === "light" ? "#ffffff" : Fa("--background")
1907
+ "editor.background": Ne === "light" ? "#ffffff" : Oa("--background")
1892
1908
  }
1893
1909
  }), p.editor.setTheme("default");
1894
1910
  }
@@ -1899,13 +1915,13 @@ function In() {
1899
1915
  }
1900
1916
  ), () => {
1901
1917
  };
1902
- }, [s, j, n.current]);
1903
- function ws(p) {
1918
+ }, [s, z, n.current]);
1919
+ function Ms(p) {
1904
1920
  n.current = p;
1905
1921
  }
1906
- function Ma() {
1922
+ function Ta() {
1907
1923
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1908
- o && /* @__PURE__ */ e.jsx(
1924
+ c && /* @__PURE__ */ e.jsx(
1909
1925
  "div",
1910
1926
  {
1911
1927
  className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
@@ -1913,24 +1929,24 @@ function In() {
1913
1929
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
1914
1930
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
1915
1931
  /* @__PURE__ */ e.jsx(
1916
- Sn,
1932
+ wn,
1917
1933
  {
1918
1934
  checked: D,
1919
1935
  onCheckedChange: () => H(!D),
1920
1936
  text: "Apply Filters"
1921
1937
  }
1922
1938
  ),
1923
- /* @__PURE__ */ e.jsx(kn, {}),
1924
- U && o && /* @__PURE__ */ e.jsx(
1925
- Re,
1939
+ /* @__PURE__ */ e.jsx(zn, {}),
1940
+ G && c && /* @__PURE__ */ e.jsx(
1941
+ _e,
1926
1942
  {
1927
- onClick: () => l(!1),
1943
+ onClick: () => r(!1),
1928
1944
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
1929
1945
  }
1930
1946
  )
1931
1947
  ] }),
1932
1948
  /* @__PURE__ */ e.jsx(
1933
- Qe,
1949
+ Re,
1934
1950
  {
1935
1951
  theme: "default",
1936
1952
  onChange: (p) => {
@@ -1942,7 +1958,7 @@ function In() {
1942
1958
  },
1943
1959
  defaultLanguage: "json",
1944
1960
  className: "mt-1 min-h-[220px]",
1945
- value: JSON.stringify(U, null, 2),
1961
+ value: JSON.stringify(G, null, 2),
1946
1962
  options: {
1947
1963
  readOnly: !0,
1948
1964
  minimap: {
@@ -1963,11 +1979,11 @@ function In() {
1963
1979
  ] })
1964
1980
  }
1965
1981
  ),
1966
- U && !o && /* @__PURE__ */ e.jsx(
1982
+ G && !c && /* @__PURE__ */ e.jsx(
1967
1983
  oa,
1968
1984
  {
1969
- onClick: () => l(!0),
1970
- className: W(
1985
+ onClick: () => r(!0),
1986
+ className: Y(
1971
1987
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
1972
1988
  {
1973
1989
  "font-bold text-red-800": D
@@ -1977,9 +1993,9 @@ function In() {
1977
1993
  )
1978
1994
  ] });
1979
1995
  }
1980
- function Ta() {
1996
+ function Aa() {
1981
1997
  return /* @__PURE__ */ e.jsxs(
1982
- os,
1998
+ ms,
1983
1999
  {
1984
2000
  className: "flex grow pb-1",
1985
2001
  direction: "vertical",
@@ -1999,14 +2015,14 @@ function In() {
1999
2015
  role: "sql-container",
2000
2016
  className: "relative flex w-[99%]",
2001
2017
  children: /* @__PURE__ */ e.jsx(
2002
- Qe,
2018
+ Re,
2003
2019
  {
2004
2020
  theme: "default",
2005
2021
  className: "pt-3",
2006
2022
  onChange: (p) => {
2007
2023
  Z(p);
2008
2024
  },
2009
- value: z,
2025
+ value: F,
2010
2026
  options: {
2011
2027
  minimap: {
2012
2028
  enabled: !1
@@ -2021,7 +2037,7 @@ function In() {
2021
2037
  },
2022
2038
  defaultLanguage: "sql",
2023
2039
  defaultValue: "SELECT * FROM table",
2024
- beforeMount: ws,
2040
+ beforeMount: Ms,
2025
2041
  onMount: qe
2026
2042
  }
2027
2043
  )
@@ -2032,7 +2048,7 @@ function In() {
2032
2048
  }
2033
2049
  ),
2034
2050
  t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2035
- /* @__PURE__ */ e.jsx(cs, { withHandle: !0, className: "border" }),
2051
+ /* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border" }),
2036
2052
  /* @__PURE__ */ e.jsxs(
2037
2053
  Fe,
2038
2054
  {
@@ -2047,14 +2063,14 @@ function In() {
2047
2063
  role: "python-container",
2048
2064
  className: "relative flex w-[99%] pt-0",
2049
2065
  children: /* @__PURE__ */ e.jsx(
2050
- Qe,
2066
+ Re,
2051
2067
  {
2052
2068
  className: "pt-3",
2053
2069
  theme: "default",
2054
2070
  onChange: (p) => {
2055
2071
  J(p && p.trim() || "");
2056
2072
  },
2057
- value: E || Ts,
2073
+ value: A || Ls,
2058
2074
  options: {
2059
2075
  minimap: {
2060
2076
  enabled: !1
@@ -2068,7 +2084,7 @@ function In() {
2068
2084
  renderLineHighlight: "none"
2069
2085
  },
2070
2086
  defaultLanguage: "python",
2071
- beforeMount: ws,
2087
+ beforeMount: Ms,
2072
2088
  onMount: qe
2073
2089
  }
2074
2090
  )
@@ -2097,8 +2113,8 @@ function In() {
2097
2113
  role: "sql-editor",
2098
2114
  className: "relative flex grow justify-between overflow-y-scroll",
2099
2115
  children: [
2100
- Ta(),
2101
- Ma()
2116
+ Aa(),
2117
+ Ta()
2102
2118
  ]
2103
2119
  }
2104
2120
  ),
@@ -2113,7 +2129,7 @@ function In() {
2113
2129
  w,
2114
2130
  {
2115
2131
  title: "Shift + Enter",
2116
- disabled: ne || le,
2132
+ disabled: ne || re,
2117
2133
  onClick: () => {
2118
2134
  ve();
2119
2135
  },
@@ -2121,29 +2137,29 @@ function In() {
2121
2137
  size: "sm",
2122
2138
  variant: "outline",
2123
2139
  children: [
2124
- ne || le ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(ln, { className: "mr-2 h-4 w-4" }),
2140
+ ne || re ? /* @__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" }),
2125
2141
  "Run"
2126
2142
  ]
2127
2143
  }
2128
2144
  ),
2129
- re && /* @__PURE__ */ e.jsx(
2130
- Cn,
2145
+ le && /* @__PURE__ */ e.jsx(
2146
+ kn,
2131
2147
  {
2132
2148
  error: Ie.message,
2133
2149
  setShowAIDialog: d,
2134
- setTriggerAIRun: C,
2150
+ setTriggerAIRun: S,
2135
2151
  setUserInputforAI: m
2136
2152
  }
2137
2153
  ),
2138
2154
  /* @__PURE__ */ e.jsxs(
2139
2155
  w,
2140
2156
  {
2141
- onClick: Pe,
2157
+ onClick: Je,
2142
2158
  className: "",
2143
2159
  size: "sm",
2144
2160
  variant: "outline",
2145
2161
  children: [
2146
- /* @__PURE__ */ e.jsx(Qt, { className: "mr-2 size-4" }),
2162
+ /* @__PURE__ */ e.jsx(Yt, { className: "mr-2 size-4" }),
2147
2163
  "Clear"
2148
2164
  ]
2149
2165
  }
@@ -2152,21 +2168,21 @@ function In() {
2152
2168
  Xs,
2153
2169
  {
2154
2170
  pressed: t,
2155
- onPressedChange: (p) => i(p),
2171
+ onPressedChange: (p) => o(p),
2156
2172
  className: "",
2157
2173
  size: "sm",
2158
2174
  variant: "outline",
2159
- children: /* @__PURE__ */ e.jsx(Dn, { className: "size-4 text-foreground/70" })
2175
+ children: /* @__PURE__ */ e.jsx(qn, { className: "size-4 text-foreground/70" })
2160
2176
  }
2161
2177
  ),
2162
2178
  /* @__PURE__ */ e.jsx(
2163
- zn,
2179
+ On,
2164
2180
  {
2165
- open: c,
2181
+ open: l,
2166
2182
  setOpen: d,
2167
2183
  userInput: f,
2168
2184
  triggerAIRun: u,
2169
- setTriggerAIRun: C,
2185
+ setTriggerAIRun: S,
2170
2186
  setUserInput: (p) => m(p)
2171
2187
  }
2172
2188
  )
@@ -2175,11 +2191,11 @@ function In() {
2175
2191
  /* @__PURE__ */ e.jsxs(
2176
2192
  w,
2177
2193
  {
2178
- onClick: S,
2194
+ onClick: C,
2179
2195
  size: "sm",
2180
2196
  variant: "outline",
2181
2197
  children: [
2182
- /* @__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" }),
2183
2199
  "Accept"
2184
2200
  ]
2185
2201
  }
@@ -2187,12 +2203,12 @@ function In() {
2187
2203
  /* @__PURE__ */ e.jsxs(
2188
2204
  w,
2189
2205
  {
2190
- onClick: za,
2206
+ onClick: Fa,
2191
2207
  className: "w-full",
2192
2208
  size: "sm",
2193
2209
  variant: "outline",
2194
2210
  children: [
2195
- /* @__PURE__ */ e.jsx(Re, { className: "mr-2 size-4" }),
2211
+ /* @__PURE__ */ e.jsx(_e, { className: "mr-2 size-4" }),
2196
2212
  "Close"
2197
2213
  ]
2198
2214
  }
@@ -2206,11 +2222,11 @@ function In() {
2206
2222
  )
2207
2223
  );
2208
2224
  }
2209
- function qn({ data: s }) {
2210
- var l;
2211
- const [n, a] = me.useState([]), i = Object.keys(s[0]).map((c) => ({
2225
+ function Rn({ data: s }) {
2226
+ var r;
2227
+ const [n, a] = me.useState([]), o = Object.keys(s[0]).map((l) => ({
2212
2228
  // header: key,
2213
- accessorKey: c,
2229
+ accessorKey: l,
2214
2230
  header: ({ column: d }) => {
2215
2231
  const f = d.getIsSorted();
2216
2232
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
@@ -2219,48 +2235,49 @@ function qn({ data: s }) {
2219
2235
  className: "flex cursor-pointer items-center",
2220
2236
  onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2221
2237
  children: [
2222
- c,
2223
- f === "asc" ? /* @__PURE__ */ e.jsx(nt, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : null
2238
+ l,
2239
+ f === "asc" ? /* @__PURE__ */ e.jsx(rt, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : null
2224
2240
  ]
2225
2241
  }
2226
2242
  ) });
2227
2243
  }
2228
- })), o = rt({
2244
+ })), c = it({
2229
2245
  data: s,
2230
- columns: i,
2231
- getCoreRowModel: ht(),
2232
- getPaginationRowModel: mt(),
2246
+ columns: o,
2247
+ getCoreRowModel: mt(),
2248
+ getPaginationRowModel: ut(),
2233
2249
  onSortingChange: a,
2234
- getSortedRowModel: ut(),
2250
+ getSortedRowModel: xt(),
2235
2251
  manualPagination: !0,
2236
2252
  state: {
2237
2253
  sorting: n
2238
2254
  }
2239
2255
  });
2240
- return /* @__PURE__ */ e.jsxs(it, { children: [
2241
- /* @__PURE__ */ e.jsx(ot, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((d) => /* @__PURE__ */ e.jsx(ct, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : As(
2256
+ return /* @__PURE__ */ e.jsxs(ot, { children: [
2257
+ /* @__PURE__ */ e.jsx(ct, { children: c.getHeaderGroups().map((l) => /* @__PURE__ */ e.jsx(rs, { children: l.headers.map((d) => /* @__PURE__ */ e.jsx(dt, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Ds(
2242
2258
  d.column.columnDef.header,
2243
2259
  d.getContext()
2244
- ) }, d.id)) }, c.id)) }),
2245
- /* @__PURE__ */ e.jsx(dt, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2246
- ls,
2260
+ ) }, d.id)) }, l.id)) }),
2261
+ /* @__PURE__ */ e.jsx(ht, { children: (r = c.getRowModel().rows) != null && r.length ? c.getRowModel().rows.map((l) => /* @__PURE__ */ e.jsx(
2262
+ rs,
2247
2263
  {
2248
2264
  className: "whitespace-nowrap py-2",
2249
- "data-state": c.getIsSelected() && "selected",
2250
- children: c.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Es, { children: As(d.column.columnDef.cell, d.getContext()) }, d.id))
2265
+ "data-state": l.getIsSelected() && "selected",
2266
+ children: l.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Is, { children: Ds(d.column.columnDef.cell, d.getContext()) }, d.id))
2251
2267
  },
2252
- c.id
2253
- )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Es, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2268
+ l.id
2269
+ )) : /* @__PURE__ */ e.jsx(rs, { children: /* @__PURE__ */ e.jsx(Is, { colSpan: o.length, className: "h-24 text-center", children: "No results." }) }) })
2254
2270
  ] });
2255
2271
  }
2256
- function ga({
2272
+ function ja({
2257
2273
  // card,
2258
2274
  className: s,
2259
2275
  ...n
2260
2276
  }) {
2277
+ var r;
2261
2278
  me.useState(0);
2262
- const a = k((l) => l.themeStyle), t = r((l) => l.card), i = r((l) => l.actions.setCard);
2263
- if (K(() => {
2279
+ const a = k((l) => l.themeStyle), t = i((l) => l.card), o = i((l) => l.actions.setCard);
2280
+ if (P(() => {
2264
2281
  }, [
2265
2282
  t.data,
2266
2283
  t.type,
@@ -2270,36 +2287,36 @@ function ga({
2270
2287
  t.preferences
2271
2288
  ]), !t.id)
2272
2289
  return null;
2273
- let o;
2274
- return t.data && t.data.length > 0 && (o = la({
2290
+ let c;
2291
+ return t.data && t.data.length > 0 && (c = ra({
2275
2292
  data: t.data,
2276
2293
  cardType: t.type,
2277
2294
  cfg: t.cfg,
2278
2295
  customCfg: t.customCfg,
2279
2296
  preferences: t.preferences
2280
2297
  })), /* @__PURE__ */ e.jsxs(
2281
- xt,
2298
+ pt,
2282
2299
  {
2283
2300
  role: "editor-visual-card",
2284
- className: W("relative flex h-full flex-col rounded-none", s),
2301
+ className: Y("relative flex h-full flex-col rounded-none", s),
2285
2302
  ...n,
2286
2303
  children: [
2287
- /* @__PURE__ */ e.jsxs(pt, { className: "py-4", children: [
2304
+ /* @__PURE__ */ e.jsxs(ft, { className: "py-4", children: [
2288
2305
  /* @__PURE__ */ e.jsx(
2289
- Ls,
2306
+ qs,
2290
2307
  {
2291
2308
  text: t.title,
2292
- onSave: (l) => i({ ...t, title: l }),
2293
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ft, { className: "text-base", children: t.title }) })
2309
+ onSave: (l) => o({ ...t, title: l }),
2310
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(gt, { className: "text-base", children: t.title }) })
2294
2311
  },
2295
2312
  t.title
2296
2313
  ),
2297
2314
  /* @__PURE__ */ e.jsx(
2298
- Ls,
2315
+ qs,
2299
2316
  {
2300
2317
  text: t.description || "",
2301
- onSave: (l) => i({ ...t, description: l }),
2302
- children: /* @__PURE__ */ e.jsxs(gt, { children: [
2318
+ onSave: (l) => o({ ...t, description: l }),
2319
+ children: /* @__PURE__ */ e.jsxs(jt, { children: [
2303
2320
  " ",
2304
2321
  t.description
2305
2322
  ] })
@@ -2307,106 +2324,105 @@ function ga({
2307
2324
  t.description
2308
2325
  )
2309
2326
  ] }),
2310
- /* @__PURE__ */ e.jsxs(jt, { className: "flex grow flex-col pb-3", children: [
2311
- t.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
2327
+ /* @__PURE__ */ e.jsxs(bt, { className: "flex grow flex-col pb-3", children: [
2328
+ t.type !== "table" && c && // <ChartJsVisual key={visualKey} cfg={cfg} />
2312
2329
  /* @__PURE__ */ e.jsx(
2313
- bt,
2330
+ yt,
2314
2331
  {
2315
- cfg: o
2332
+ cfg: c
2316
2333
  },
2317
- JSON.stringify(o) + JSON.stringify(t.preferences)
2334
+ JSON.stringify(c) + JSON.stringify(t.preferences) + ((r = t == null ? void 0 : t.preferences) == null ? void 0 : r.customVisualCode)
2318
2335
  ),
2319
2336
  t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2320
- /* @__PURE__ */ e.jsx(yt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(vt, { card: t, data: t == null ? void 0 : t.data }) })
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 }) })
2321
2338
  ] })
2322
2339
  ]
2323
2340
  }
2324
2341
  );
2325
2342
  }
2326
- function Vn() {
2327
- const [s, n] = M(!1), [a, t] = M(""), [i, o] = M(""), [l, c] = M(""), d = r((j) => j.card), f = r(
2328
- (j) => j.card.customCfg
2329
- ), m = r(
2330
- (j) => j.actions.setCardCustomCfg
2331
- );
2332
- function u(j) {
2333
- var A, O;
2334
- const b = {
2335
- ...j,
2343
+ function _n() {
2344
+ const [s, n] = T(!1), [a, t] = T(""), [o, c] = T(""), [r, l] = T(""), [d, f] = T(""), m = i((N) => N.card), u = i(
2345
+ (N) => N.card.customCfg
2346
+ ), { setCardCustomCfg: S, setCustomVisualCode: h } = Ct();
2347
+ function x(N) {
2348
+ var F, A;
2349
+ const O = {
2350
+ ...N,
2336
2351
  data: {
2337
- ...j == null ? void 0 : j.data,
2338
- datasets: (O = (A = j == null ? void 0 : j.data) == null ? void 0 : A.datasets) == null ? void 0 : O.map((y) => ({
2339
- ...y,
2352
+ ...N == null ? void 0 : N.data,
2353
+ datasets: (A = (F = N == null ? void 0 : N.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((q) => ({
2354
+ ...q,
2340
2355
  data: []
2341
2356
  }))
2342
2357
  }
2343
2358
  };
2344
- return JSON.stringify(b, null, 1);
2359
+ return JSON.stringify(O, null, 1);
2345
2360
  }
2346
- function C() {
2347
- if (!d.data || d.data.length === 0)
2361
+ function g() {
2362
+ var O, j;
2363
+ if (!m.data || m.data.length === 0)
2348
2364
  return;
2349
- const j = la({
2350
- data: d.data,
2351
- cardType: d.type,
2352
- cfg: d.cfg,
2353
- preferences: d.preferences
2365
+ const N = ra({
2366
+ data: m.data,
2367
+ cardType: m.type,
2368
+ cfg: m.cfg,
2369
+ preferences: m.preferences
2354
2370
  });
2355
- j && (t(JSON.stringify(j, null, 1)), f && o(JSON.stringify(f, null, 1)));
2371
+ N && (t(JSON.stringify(N, null, 1)), (O = m == null ? void 0 : m.preferences) != null && O.customVisualCode && l((j = m == null ? void 0 : m.preferences) == null ? void 0 : j.customVisualCode), u && c(JSON.stringify(u, null, 1)));
2356
2372
  }
2357
- function h() {
2358
- if (i)
2373
+ function z() {
2374
+ if (r && h(r), !!o)
2359
2375
  try {
2360
- const j = JSON.parse(i);
2361
- return j ? (m(j), c(""), o(""), j) : void 0;
2362
- } catch (j) {
2363
- console.log(j), c("Invalid JSON");
2376
+ const N = JSON.parse(o);
2377
+ return N ? (S(N), f(""), c(""), N) : void 0;
2378
+ } catch (N) {
2379
+ console.log(N), f("Invalid JSON");
2364
2380
  }
2365
2381
  }
2366
- function x() {
2367
- o(""), m(null);
2382
+ function b() {
2383
+ c(""), S(null);
2368
2384
  }
2369
- function g() {
2370
- let j;
2371
- if (f) {
2372
- const b = qs.cloneDeep(d.cfg), L = qs.merge(b, f);
2373
- return j = u(L), j;
2385
+ function L() {
2386
+ let N;
2387
+ if (u) {
2388
+ const O = Vs.cloneDeep(m.cfg), j = Vs.merge(O, u);
2389
+ return N = x(j), N;
2374
2390
  }
2375
- return a ? (j = u(JSON.parse(a)), j) : "";
2391
+ return a ? (N = x(JSON.parse(a)), N) : "";
2376
2392
  }
2377
- return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
2378
- /* @__PURE__ */ e.jsx(hs, { 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(
2379
2395
  w,
2380
2396
  {
2381
- onClick: C,
2382
- className: ` ${f && "border-foreground/50 dark:border-foreground/70"}`,
2397
+ onClick: g,
2398
+ className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
2383
2399
  size: "sm",
2384
2400
  variant: "outline",
2385
- children: /* @__PURE__ */ e.jsx(Nt, { className: "h-4 w-4" })
2401
+ children: /* @__PURE__ */ e.jsx(St, { className: "h-4 w-4" })
2386
2402
  }
2387
2403
  ) }),
2388
2404
  /* @__PURE__ */ e.jsxs(
2389
- ms,
2405
+ fs,
2390
2406
  {
2391
- className: "max-h-[70vh] min-h-[70vh] min-w-[900px] overflow-auto",
2407
+ className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
2392
2408
  children: [
2393
- /* @__PURE__ */ e.jsxs(us, { className: "", children: [
2409
+ /* @__PURE__ */ e.jsxs(gs, { className: "", children: [
2394
2410
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2395
- /* @__PURE__ */ e.jsx(xs, { children: "Customize Card" }),
2396
- /* @__PURE__ */ e.jsxs(fs, { children: [
2397
- /* @__PURE__ */ e.jsx(Gs, { children: /* @__PURE__ */ e.jsx(
2398
- Zt,
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,
2399
2415
  {
2400
2416
  onClick: () => {
2401
- navigator.clipboard.writeText(d.id);
2417
+ navigator.clipboard.writeText(m.id);
2402
2418
  },
2403
2419
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
2404
2420
  }
2405
2421
  ) }),
2406
- /* @__PURE__ */ e.jsx(gs, { 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" }) })
2407
2423
  ] })
2408
2424
  ] }),
2409
- /* @__PURE__ */ e.jsxs(ps, { children: [
2425
+ /* @__PURE__ */ e.jsxs(bs, { children: [
2410
2426
  "See the configuration options and documentation",
2411
2427
  /* @__PURE__ */ e.jsx(
2412
2428
  "a",
@@ -2420,17 +2436,18 @@ function Vn() {
2420
2436
  ] })
2421
2437
  ] }),
2422
2438
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2423
- /* @__PURE__ */ e.jsx(ga, { className: "w-1/2 rounded shadow-none" }),
2424
- /* @__PURE__ */ e.jsxs(Ct, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2425
- /* @__PURE__ */ e.jsxs(St, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2426
- /* @__PURE__ */ e.jsxs(Ds, { value: "custom-config", children: [
2427
- f && /* @__PURE__ */ e.jsx(kt, { className: "mr-1 h-5 w-5 text-green-600" }),
2428
- f ? "Custom Config" : "Default Config"
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: [
2442
+ /* @__PURE__ */ e.jsxs(ls, { value: "custom-config", children: [
2443
+ u && /* @__PURE__ */ e.jsx(zt, { className: "mr-1 h-5 w-5 text-green-600" }),
2444
+ u ? "Custom Config" : "Default Config"
2429
2445
  ] }),
2430
- /* @__PURE__ */ e.jsx(Ds, { className: "", value: "output", children: "Output" })
2446
+ /* @__PURE__ */ e.jsx(ls, { className: "", value: "output", children: "Output" }),
2447
+ /* @__PURE__ */ e.jsx(ls, { className: "", value: "custom-code", children: "Custom Code" })
2431
2448
  ] }),
2432
2449
  /* @__PURE__ */ e.jsx(
2433
- Is,
2450
+ is,
2434
2451
  {
2435
2452
  className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
2436
2453
  value: "output",
@@ -2445,12 +2462,12 @@ function Vn() {
2445
2462
  }
2446
2463
  ),
2447
2464
  /* @__PURE__ */ e.jsx(
2448
- Is,
2465
+ is,
2449
2466
  {
2450
2467
  className: "mt-0 grow rounded-b border border-t-0",
2451
2468
  value: "custom-config",
2452
2469
  children: /* @__PURE__ */ e.jsx(
2453
- Qe,
2470
+ Re,
2454
2471
  {
2455
2472
  className: "h-full w-full overflow-hidden",
2456
2473
  theme: "default",
@@ -2467,26 +2484,55 @@ function Vn() {
2467
2484
  renderLineHighlight: "none"
2468
2485
  },
2469
2486
  defaultLanguage: "json",
2470
- value: g(),
2471
- onChange: (j) => o(j)
2487
+ value: L(),
2488
+ onChange: (N) => c(N)
2489
+ }
2490
+ )
2491
+ }
2492
+ ),
2493
+ /* @__PURE__ */ e.jsx(
2494
+ is,
2495
+ {
2496
+ className: "mt-0 grow rounded-b border border-t-0",
2497
+ value: "custom-code",
2498
+ children: /* @__PURE__ */ e.jsx(
2499
+ Re,
2500
+ {
2501
+ className: "h-full w-full overflow-hidden",
2502
+ theme: "default",
2503
+ options: {
2504
+ minimap: {
2505
+ enabled: !1
2506
+ },
2507
+ wordWrap: "on",
2508
+ scrollbar: {
2509
+ verticalScrollbarSize: 0,
2510
+ horizontalScrollbarSize: 0
2511
+ },
2512
+ fontSize: 14,
2513
+ renderLineHighlight: "none"
2514
+ },
2515
+ defaultLanguage: "javascript",
2516
+ value: r,
2517
+ onChange: (N) => l(N || "")
2472
2518
  }
2473
2519
  )
2474
2520
  }
2475
2521
  )
2476
2522
  ] })
2477
2523
  ] }),
2478
- /* @__PURE__ */ e.jsxs(Js, { className: "flex items-center", children: [
2479
- /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: l }),
2524
+ /* @__PURE__ */ e.jsxs(Us, { className: "flex items-center", children: [
2525
+ /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: d }),
2480
2526
  /* @__PURE__ */ e.jsx(
2481
2527
  w,
2482
2528
  {
2483
- disabled: !f,
2484
- onClick: x,
2529
+ disabled: !u,
2530
+ onClick: b,
2485
2531
  variant: "outline",
2486
2532
  children: "Reset"
2487
2533
  }
2488
2534
  ),
2489
- /* @__PURE__ */ e.jsx(w, { onClick: h, variant: "outline", children: "Apply" }),
2535
+ /* @__PURE__ */ e.jsx(w, { onClick: z, variant: "outline", children: "Apply" }),
2490
2536
  /* @__PURE__ */ e.jsx(w, { onClick: () => n(!1), variant: "outline", children: "Close" })
2491
2537
  ] })
2492
2538
  ]
@@ -2494,46 +2540,44 @@ function Vn() {
2494
2540
  )
2495
2541
  ] });
2496
2542
  }
2497
- function ja(s) {
2543
+ function ba(s) {
2498
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);
2499
2545
  }
2500
- function ba(s) {
2546
+ function ya(s) {
2501
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);
2502
2548
  }
2503
- function ya(s) {
2549
+ function va(s) {
2504
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);
2505
2551
  }
2506
- function va(s) {
2552
+ function Na(s) {
2507
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);
2508
2554
  }
2509
- function Na(s) {
2555
+ function Ca(s) {
2510
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);
2511
2557
  }
2512
- function Ca(s) {
2558
+ function Sa(s) {
2513
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);
2514
2560
  }
2515
- function Sa(s) {
2561
+ function ka(s) {
2516
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);
2517
2563
  }
2518
- function Rn() {
2519
- const [s, n] = M(!1), a = r((c) => c.card.type), { setCardType: t, setCardPreferences: i } = r(
2520
- (c) => c.actions
2521
- ), o = r(
2522
- (c) => c.actions.setCardCustomCfg
2564
+ function Hn() {
2565
+ const [s, n] = T(!1), a = i((d) => d.card.type), { setCardType: t, setCardPreferences: o, setChartOrientation: c } = i((d) => d.actions), r = i(
2566
+ (d) => d.actions.setCardCustomCfg
2523
2567
  );
2524
- function l(c) {
2525
- t(c), o(null), i({}), n(!1);
2568
+ function l(d) {
2569
+ r(null), o({}), t(d), n(!1);
2526
2570
  }
2527
2571
  return /* @__PURE__ */ e.jsxs(Ke, { open: s, onOpenChange: n, children: [
2528
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(_n, { className: "h-4 w-4", chartType: a }) }) }),
2529
- /* @__PURE__ */ e.jsx(Je, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2572
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", chartType: a }) }) }),
2573
+ /* @__PURE__ */ e.jsx(Ge, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2530
2574
  /* @__PURE__ */ e.jsx(
2531
2575
  w,
2532
2576
  {
2533
2577
  onClick: () => l("bar"),
2534
2578
  className: "font-normal",
2535
2579
  variant: "ghost",
2536
- children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
2580
+ children: /* @__PURE__ */ e.jsx(ws, { className: "size-5" })
2537
2581
  }
2538
2582
  ),
2539
2583
  /* @__PURE__ */ e.jsx(
@@ -2541,7 +2585,7 @@ function Rn() {
2541
2585
  {
2542
2586
  onClick: () => l("line"),
2543
2587
  variant: "ghost",
2544
- children: /* @__PURE__ */ e.jsx(Cs, { className: "size-5" })
2588
+ children: /* @__PURE__ */ e.jsx(zs, { className: "size-5" })
2545
2589
  }
2546
2590
  ),
2547
2591
  /* @__PURE__ */ e.jsx(
@@ -2549,7 +2593,7 @@ function Rn() {
2549
2593
  {
2550
2594
  onClick: () => l("stackedBar"),
2551
2595
  variant: "ghost",
2552
- children: /* @__PURE__ */ e.jsx(Na, { className: "size-5", strokeWidth: 0 })
2596
+ children: /* @__PURE__ */ e.jsx(Ca, { className: "size-5", strokeWidth: 0 })
2553
2597
  }
2554
2598
  ),
2555
2599
  /* @__PURE__ */ e.jsx(
@@ -2557,7 +2601,7 @@ function Rn() {
2557
2601
  {
2558
2602
  onClick: () => l("scatter"),
2559
2603
  variant: "ghost",
2560
- children: /* @__PURE__ */ e.jsx(ha, { className: "size-5" })
2604
+ children: /* @__PURE__ */ e.jsx(ma, { className: "size-5" })
2561
2605
  }
2562
2606
  ),
2563
2607
  /* @__PURE__ */ e.jsx(
@@ -2565,7 +2609,7 @@ function Rn() {
2565
2609
  {
2566
2610
  onClick: () => l("bubble"),
2567
2611
  variant: "ghost",
2568
- children: /* @__PURE__ */ e.jsx(va, { className: "size-4" })
2612
+ children: /* @__PURE__ */ e.jsx(Na, { className: "size-4" })
2569
2613
  }
2570
2614
  ),
2571
2615
  /* @__PURE__ */ e.jsx(
@@ -2573,7 +2617,7 @@ function Rn() {
2573
2617
  {
2574
2618
  onClick: () => l("pie"),
2575
2619
  variant: "ghost",
2576
- children: /* @__PURE__ */ e.jsx(da, { className: "size-5" })
2620
+ children: /* @__PURE__ */ e.jsx(ha, { className: "size-5" })
2577
2621
  }
2578
2622
  ),
2579
2623
  /* @__PURE__ */ e.jsx(
@@ -2581,7 +2625,7 @@ function Rn() {
2581
2625
  {
2582
2626
  onClick: () => l("doughnut"),
2583
2627
  variant: "ghost",
2584
- children: /* @__PURE__ */ e.jsx(ba, { className: "size-5", strokeWidth: 1 })
2628
+ children: /* @__PURE__ */ e.jsx(ya, { className: "size-5", strokeWidth: 1 })
2585
2629
  }
2586
2630
  ),
2587
2631
  /* @__PURE__ */ e.jsx(
@@ -2590,7 +2634,7 @@ function Rn() {
2590
2634
  onClick: () => l("radar"),
2591
2635
  variant: "ghost",
2592
2636
  children: /* @__PURE__ */ e.jsx(
2593
- ja,
2637
+ ba,
2594
2638
  {
2595
2639
  className: "size-5 font-extralight",
2596
2640
  strokeWidth: 0.5
@@ -2603,7 +2647,7 @@ function Rn() {
2603
2647
  {
2604
2648
  onClick: () => l("polarArea"),
2605
2649
  variant: "ghost",
2606
- children: /* @__PURE__ */ e.jsx(ya, { className: "size-5" })
2650
+ children: /* @__PURE__ */ e.jsx(va, { className: "size-5" })
2607
2651
  }
2608
2652
  ),
2609
2653
  /* @__PURE__ */ e.jsx(
@@ -2611,7 +2655,15 @@ function Rn() {
2611
2655
  {
2612
2656
  onClick: () => l("pyramid"),
2613
2657
  variant: "ghost",
2614
- children: /* @__PURE__ */ e.jsx(Sa, { className: "size-5" })
2658
+ children: /* @__PURE__ */ e.jsx(ka, { className: "size-5" })
2659
+ }
2660
+ ),
2661
+ /* @__PURE__ */ e.jsx(
2662
+ w,
2663
+ {
2664
+ onClick: () => l("range"),
2665
+ variant: "ghost",
2666
+ children: /* @__PURE__ */ e.jsx(ca, { className: "size-5" })
2615
2667
  }
2616
2668
  ),
2617
2669
  /* @__PURE__ */ e.jsx(
@@ -2619,7 +2671,7 @@ function Rn() {
2619
2671
  {
2620
2672
  onClick: () => l("table"),
2621
2673
  variant: "ghost",
2622
- children: /* @__PURE__ */ e.jsx(js, { className: "size-5" })
2674
+ children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
2623
2675
  }
2624
2676
  ),
2625
2677
  /* @__PURE__ */ e.jsx(
@@ -2627,49 +2679,51 @@ function Rn() {
2627
2679
  {
2628
2680
  onClick: () => l("kpi"),
2629
2681
  variant: "ghost",
2630
- children: /* @__PURE__ */ e.jsx(Ca, { className: "size-6" })
2682
+ children: /* @__PURE__ */ e.jsx(Sa, { className: "size-6" })
2631
2683
  }
2632
2684
  )
2633
2685
  ] }) })
2634
2686
  ] });
2635
2687
  }
2636
- function _n({ chartType: s, className: n }) {
2688
+ function Bn({ chartType: s, className: n }) {
2637
2689
  switch (s) {
2638
2690
  case "bar":
2639
- return /* @__PURE__ */ e.jsx(Ns, { className: n });
2691
+ return /* @__PURE__ */ e.jsx(ws, { className: n });
2640
2692
  case "line":
2641
- return /* @__PURE__ */ e.jsx(Cs, { className: n });
2693
+ return /* @__PURE__ */ e.jsx(zs, { className: n });
2642
2694
  case "pie":
2643
- return /* @__PURE__ */ e.jsx(da, { className: n });
2695
+ return /* @__PURE__ */ e.jsx(ha, { className: n });
2644
2696
  case "radar":
2645
- return /* @__PURE__ */ e.jsx(ja, { className: n });
2697
+ return /* @__PURE__ */ e.jsx(ba, { className: n });
2646
2698
  case "scatter":
2647
- return /* @__PURE__ */ e.jsx(ha, { className: n });
2699
+ return /* @__PURE__ */ e.jsx(ma, { className: n });
2648
2700
  case "bubble":
2649
- return /* @__PURE__ */ e.jsx(va, { className: n });
2701
+ return /* @__PURE__ */ e.jsx(Na, { className: n });
2650
2702
  case "doughnut":
2651
- return /* @__PURE__ */ e.jsx(ba, { className: n });
2703
+ return /* @__PURE__ */ e.jsx(ya, { className: n });
2652
2704
  case "stackedBar":
2653
- return /* @__PURE__ */ e.jsx(Na, { className: "size-4 text-foreground/70" });
2705
+ return /* @__PURE__ */ e.jsx(Ca, { className: "size-4 text-foreground/70" });
2654
2706
  case "polarArea":
2655
- return /* @__PURE__ */ e.jsx(ya, { className: n });
2707
+ return /* @__PURE__ */ e.jsx(va, { className: n });
2656
2708
  case "pyramid":
2657
- return /* @__PURE__ */ e.jsx(Sa, { className: n });
2709
+ return /* @__PURE__ */ e.jsx(ka, { className: n });
2710
+ case "range":
2711
+ return /* @__PURE__ */ e.jsx(ca, { className: n });
2658
2712
  case "kpi":
2659
- return /* @__PURE__ */ e.jsx(Ca, { className: n });
2713
+ return /* @__PURE__ */ e.jsx(Sa, { className: n });
2660
2714
  default:
2661
- return /* @__PURE__ */ e.jsx(js, { className: n });
2715
+ return /* @__PURE__ */ e.jsx(Ns, { className: n });
2662
2716
  }
2663
2717
  }
2664
- function Hn() {
2665
- const s = r(
2718
+ function $n() {
2719
+ const s = i(
2666
2720
  (a) => a.card.refreshInterval
2667
- ), n = r(
2721
+ ), n = i(
2668
2722
  (a) => a.actions.setCardRefreshInterval
2669
2723
  );
2670
2724
  return /* @__PURE__ */ e.jsxs(Ke, { children: [
2671
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ut, { className: "w-4 h-4" }) }) }),
2672
- /* @__PURE__ */ e.jsx(Je, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2725
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Gt, { className: "w-4 h-4" }) }) }),
2726
+ /* @__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: [
2673
2727
  /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2674
2728
  /* @__PURE__ */ e.jsx(
2675
2729
  ae,
@@ -2684,28 +2738,28 @@ function Hn() {
2684
2738
  ] }) }) }) })
2685
2739
  ] });
2686
2740
  }
2687
- function Bs() {
2688
- r((l) => l.frame);
2689
- const s = r((l) => l.card), n = r((l) => l.card.data), a = r((l) => l.isShowingVisual), t = r((l) => l.isSqlRunning), i = r((l) => l.queryError), o = r((l) => l.pythonStdOut);
2690
- return r((l) => l.onSave), r((l) => l.onClose), r((l) => l.actions.setCardSql), r((l) => l.actions.setCardType), r((l) => l.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2691
- 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" }),
2741
+ function $s() {
2742
+ i((r) => r.frame);
2743
+ const s = i((r) => r.card), n = i((r) => r.card.data), a = i((r) => r.isShowingVisual), t = i((r) => r.isSqlRunning), o = i((r) => r.queryError), c = i((r) => r.pythonStdOut);
2744
+ return i((r) => r.onSave), i((r) => r.onClose), i((r) => r.actions.setCardSql), i((r) => r.actions.setCardType), i((r) => r.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2745
+ 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" }),
2692
2746
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2693
2747
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2694
- /* @__PURE__ */ e.jsx(Rn, {}),
2695
- s.type !== "table" && /* @__PURE__ */ e.jsx(Vn, {}),
2696
- /* @__PURE__ */ e.jsx(Hn, {})
2748
+ /* @__PURE__ */ e.jsx(Hn, {}),
2749
+ s.type !== "table" && /* @__PURE__ */ e.jsx(_n, {}),
2750
+ /* @__PURE__ */ e.jsx($n, {})
2697
2751
  ] }),
2698
- /* @__PURE__ */ e.jsx($n, {})
2752
+ /* @__PURE__ */ e.jsx(Kn, {})
2699
2753
  ] }),
2700
- a ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(wt, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ga, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2701
- o && /* @__PURE__ */ e.jsx(Bn, {}),
2702
- s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(qn, { data: n || [] }),
2703
- i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
2754
+ 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: [
2755
+ c && /* @__PURE__ */ e.jsx(Pn, {}),
2756
+ s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Rn, { data: n || [] }),
2757
+ o && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: o })
2704
2758
  ] })
2705
2759
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2706
2760
  }
2707
- function Bn() {
2708
- const s = r((a) => a.pythonStdOut);
2761
+ function Pn() {
2762
+ const s = i((a) => a.pythonStdOut);
2709
2763
  if (!s)
2710
2764
  return null;
2711
2765
  const n = s.replace(/\n/g, "<br>");
@@ -2718,17 +2772,17 @@ function Bn() {
2718
2772
  className: "bg-muted p-2 font-mono text-sm"
2719
2773
  }
2720
2774
  ),
2721
- /* @__PURE__ */ e.jsx(ys, { className: "mb-2" })
2775
+ /* @__PURE__ */ e.jsx(Ss, { className: "mb-2" })
2722
2776
  ] });
2723
2777
  }
2724
- function $n() {
2725
- const s = r((a) => a.isShowingVisual), n = r(
2778
+ function Kn() {
2779
+ const s = i((a) => a.isShowingVisual), n = i(
2726
2780
  (a) => a.actions.setIsShowingVisual
2727
2781
  );
2728
2782
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2729
2783
  /* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
2730
2784
  /* @__PURE__ */ e.jsx(
2731
- zt,
2785
+ Ot,
2732
2786
  {
2733
2787
  checked: s,
2734
2788
  onCheckedChange: () => n(!s),
@@ -2739,24 +2793,24 @@ function $n() {
2739
2793
  ] });
2740
2794
  }
2741
2795
  function De() {
2742
- const [s, n] = M([]);
2743
- r(
2796
+ const [s, n] = T([]);
2797
+ i(
2744
2798
  (m) => m.card.cfg
2745
2799
  );
2746
- const a = r((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = r((m) => m.actions), l = r(
2800
+ const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: o, setCardPreferences: c } = i((m) => m.actions), r = i(
2747
2801
  (m) => m.queryResultColumns
2748
2802
  );
2749
- r(
2803
+ i(
2750
2804
  (m) => {
2751
2805
  var u;
2752
2806
  return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
2753
2807
  }
2754
- ), K(() => {
2755
- l && n(new Array(l.length).fill(!1));
2756
- }, [l]);
2757
- function c(m, u) {
2758
- var C, h;
2759
- u ? a != null && a.onClickFilter && ((C = a == null ? void 0 : a.onClickFilter) == null ? void 0 : C.length) > 0 ? o({
2808
+ ), P(() => {
2809
+ r && n(new Array(r.length).fill(!1));
2810
+ }, [r]);
2811
+ function l(m, u) {
2812
+ var S, h;
2813
+ u ? a != null && a.onClickFilter && ((S = a == null ? void 0 : a.onClickFilter) == null ? void 0 : S.length) > 0 ? c({
2760
2814
  ...a,
2761
2815
  onClickFilter: [
2762
2816
  ...a.onClickFilter,
@@ -2765,7 +2819,7 @@ function De() {
2765
2819
  expression: ""
2766
2820
  }
2767
2821
  ]
2768
- }) : o({
2822
+ }) : c({
2769
2823
  ...a,
2770
2824
  onClickFilter: [
2771
2825
  {
@@ -2773,7 +2827,7 @@ function De() {
2773
2827
  expression: ""
2774
2828
  }
2775
2829
  ]
2776
- }) : (o({
2830
+ }) : (c({
2777
2831
  ...a,
2778
2832
  onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
2779
2833
  (x) => x.columnIndex !== m
@@ -2785,18 +2839,18 @@ function De() {
2785
2839
  }
2786
2840
  function d(m, u) {
2787
2841
  var h;
2788
- const C = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
2842
+ const S = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
2789
2843
  ...x,
2790
2844
  expression: u.target.value
2791
2845
  } : x);
2792
- o({
2846
+ c({
2793
2847
  ...a,
2794
- onClickFilter: C
2848
+ onClickFilter: S
2795
2849
  });
2796
2850
  }
2797
2851
  function f(m) {
2798
- var u, C, h, x;
2799
- if (s != null && s[m] || (C = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((g) => g.columnIndex === m)) != null && C.expression)
2852
+ var u, S, h, x;
2853
+ if (s != null && s[m] || (S = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((g) => g.columnIndex === m)) != null && S.expression)
2800
2854
  return /* @__PURE__ */ e.jsx(
2801
2855
  ae,
2802
2856
  {
@@ -2808,8 +2862,8 @@ function De() {
2808
2862
  }
2809
2863
  );
2810
2864
  }
2811
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: l == null ? void 0 : l.map((m, u) => {
2812
- var C, h;
2865
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: r == null ? void 0 : r.map((m, u) => {
2866
+ var S, h;
2813
2867
  return /* @__PURE__ */ e.jsx(
2814
2868
  "div",
2815
2869
  {
@@ -2817,12 +2871,12 @@ function De() {
2817
2871
  children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
2818
2872
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
2819
2873
  /* @__PURE__ */ e.jsx(
2820
- $e,
2874
+ Pe,
2821
2875
  {
2822
- checked: !!((C = a == null ? void 0 : a.onClickFilter) != null && C.find(
2876
+ checked: !!((S = a == null ? void 0 : a.onClickFilter) != null && S.find(
2823
2877
  (x) => x.columnIndex === u
2824
2878
  )),
2825
- onCheckedChange: (x) => c(u, x)
2879
+ onCheckedChange: (x) => l(u, x)
2826
2880
  }
2827
2881
  ),
2828
2882
  /* @__PURE__ */ e.jsx(
@@ -2835,7 +2889,7 @@ function De() {
2835
2889
  /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
2836
2890
  (x) => x.columnIndex === u
2837
2891
  )) && /* @__PURE__ */ e.jsx(
2838
- ca,
2892
+ da,
2839
2893
  {
2840
2894
  onClick: () => {
2841
2895
  n((x) => {
@@ -2854,39 +2908,20 @@ function De() {
2854
2908
  );
2855
2909
  }) });
2856
2910
  }
2857
- function Ss() {
2858
- var o, l;
2859
- const s = r((c) => c.card.preferences), n = r(
2860
- (c) => c.card.cfg
2861
- ), { setCardCfg: a, setCardPreferences: t } = r(
2862
- (c) => c.actions
2863
- );
2864
- (o = n == null ? void 0 : n.options) != null && o.indexAxis;
2865
- function i(c) {
2866
- var m, u, C, h, x, g;
2867
- let d = {};
2868
- (m = s == null ? void 0 : s.chartOptions) != null && m.scales && (d = {
2869
- x: (C = (u = s == null ? void 0 : s.chartOptions) == null ? void 0 : u.scales) == null ? void 0 : C.y,
2870
- y: (x = (h = s == null ? void 0 : s.chartOptions) == null ? void 0 : h.scales) == null ? void 0 : x.x
2871
- });
2872
- const f = {
2873
- ...s,
2874
- chartOptions: {
2875
- ...s == null ? void 0 : s.chartOptions,
2876
- scales: {
2877
- ...(g = s == null ? void 0 : s.chartOptions) == null ? void 0 : g.scales,
2878
- ...d
2879
- },
2880
- indexAxis: c
2881
- }
2882
- };
2883
- t(f);
2911
+ function Fs() {
2912
+ var r, l, d;
2913
+ const s = i((f) => f.card.preferences), n = i(
2914
+ (f) => f.card.cfg
2915
+ ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: o } = i((f) => f.actions);
2916
+ (r = n == null ? void 0 : n.options) != null && r.indexAxis;
2917
+ function c(f) {
2918
+ o(f);
2884
2919
  }
2885
2920
  return /* @__PURE__ */ e.jsxs(
2886
- ra,
2921
+ la,
2887
2922
  {
2888
- value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || "x",
2889
- onValueChange: i,
2923
+ value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((d = n == null ? void 0 : n.options) == null ? void 0 : d.indexAxis) || "x",
2924
+ onValueChange: c,
2890
2925
  className: "flex gap-3",
2891
2926
  defaultValue: "x",
2892
2927
  children: [
@@ -2903,43 +2938,43 @@ function Ss() {
2903
2938
  );
2904
2939
  }
2905
2940
  const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2906
- function $s(s, n) {
2907
- var t, i, o;
2941
+ function Ps(s, n) {
2942
+ var t, o, c;
2908
2943
  const a = ia(s, n);
2909
- return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
2944
+ return ((c = (o = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : o[a]) == null ? void 0 : c.type) || "linear";
2910
2945
  }
2911
- function ka() {
2912
- var G, ee, Z, J, I, v;
2913
- const [s, n] = M(!1), a = r((N) => {
2914
- var F;
2915
- return (F = N.card) == null ? void 0 : F.preferences;
2916
- }), t = r((N) => {
2917
- var F;
2918
- return (F = N.card) == null ? void 0 : F.cfg;
2919
- }), i = ia(a, t), [o, l] = M(
2920
- $s(a)
2921
- ), [c, d] = M(
2922
- ((Z = (ee = (G = a == null ? void 0 : a.chartOptions) == null ? void 0 : G.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
2923
- ), [f, m] = M(
2924
- ((v = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[i]) == null ? void 0 : v.max) || ""
2925
- ), [u, C] = M(c || f ? "custom" : "auto"), [h, x] = M(""), [g, j] = M(0), [b, L] = M(""), [A, O] = M(""), [y, z] = M(""), E = r(
2926
- (N) => N.actions.setCardPreferences
2927
- ), _ = r((N) => {
2928
- var F;
2929
- return (F = N.card) == null ? void 0 : F.type;
2930
- }), Y = ["pie", "doughnut", "polarArea"].includes(_);
2931
- K(() => {
2932
- var N, F, H, ue, se, ge, je, be, xe, P, ne, le, ye, re;
2933
- l($s(a)), d(
2934
- ((H = (F = (N = a == null ? void 0 : a.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : F[i]) == null ? void 0 : H.min) === 0 ? 0 : ""
2935
- ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[i]) == null ? void 0 : ge.max) || ""), x(
2936
- ((P = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : P.stepSize) || ""
2937
- ), j(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), z(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
2938
- }, [s, a, i]);
2939
- function $(N, F) {
2940
- return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(N);
2946
+ function wa() {
2947
+ var Q, ee, Z, J, I, y;
2948
+ const [s, n] = T(!1), a = i((v) => {
2949
+ var M;
2950
+ return (M = v.card) == null ? void 0 : M.preferences;
2951
+ }), t = i((v) => {
2952
+ var M;
2953
+ return (M = v.card) == null ? void 0 : M.cfg;
2954
+ }), o = ia(a, t), [c, r] = T(
2955
+ Ps(a)
2956
+ ), [l, d] = T(
2957
+ ((Z = (ee = (Q = a == null ? void 0 : a.chartOptions) == null ? void 0 : Q.scales) == null ? void 0 : ee[o]) == null ? void 0 : Z.min) || ""
2958
+ ), [f, m] = T(
2959
+ ((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[o]) == null ? void 0 : y.max) || ""
2960
+ ), [u, S] = T(l || f ? "custom" : "auto"), [h, x] = T(""), [g, z] = T(0), [b, L] = T(""), [N, O] = T(""), [j, F] = T(""), A = i(
2961
+ (v) => v.actions.setCardPreferences
2962
+ ), q = i((v) => {
2963
+ var M;
2964
+ return (M = v.card) == null ? void 0 : M.type;
2965
+ }), K = ["pie", "doughnut", "polarArea"].includes(q);
2966
+ P(() => {
2967
+ var v, M, H, ue, se, ge, je, be, xe, U, ne, re, ye, le;
2968
+ r(Ps(a)), d(
2969
+ ((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[o]) == null ? void 0 : H.min) === 0 ? 0 : ""
2970
+ ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[o]) == null ? void 0 : ge.max) || ""), x(
2971
+ ((U = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[o]) == null ? void 0 : xe.ticks) == null ? void 0 : U.stepSize) || ""
2972
+ ), z(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.locale) || "");
2973
+ }, [s, a, o]);
2974
+ function $(v, M) {
2975
+ return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
2941
2976
  }
2942
- function U() {
2977
+ function G() {
2943
2978
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2944
2979
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
2945
2980
  /* @__PURE__ */ e.jsx(
@@ -2960,9 +2995,9 @@ function ka() {
2960
2995
  /* @__PURE__ */ e.jsx(
2961
2996
  ae,
2962
2997
  {
2963
- value: A,
2998
+ value: N,
2964
2999
  placeholder: "USD",
2965
- onChange: (N) => O(N.target.value),
3000
+ onChange: (v) => O(v.target.value),
2966
3001
  id: "currency",
2967
3002
  className: `col-span-2 h-8 w-full ${we}`
2968
3003
  }
@@ -2970,9 +3005,9 @@ function ka() {
2970
3005
  /* @__PURE__ */ e.jsx(
2971
3006
  ae,
2972
3007
  {
2973
- value: y,
3008
+ value: j,
2974
3009
  placeholder: "en-US",
2975
- onChange: (N) => z(N.target.value),
3010
+ onChange: (v) => F(v.target.value),
2976
3011
  id: "locale",
2977
3012
  className: `col-span-2 h-8 w-full ${we}`
2978
3013
  }
@@ -2984,7 +3019,7 @@ function ka() {
2984
3019
  ae,
2985
3020
  {
2986
3021
  value: g,
2987
- onChange: (N) => j(Number(N.target.value)),
3022
+ onChange: (v) => z(Number(v.target.value)),
2988
3023
  id: "format",
2989
3024
  className: `col-span-6 h-8 w-full tracking-wide ${we}`
2990
3025
  }
@@ -3000,8 +3035,8 @@ function ka() {
3000
3035
  ae,
3001
3036
  {
3002
3037
  id: "min",
3003
- value: c,
3004
- onChange: (N) => d((F) => $(F, N.target.value)),
3038
+ value: l,
3039
+ onChange: (v) => d((M) => $(M, v.target.value)),
3005
3040
  className: `col-span-1 h-8 w-full ${we}`
3006
3041
  }
3007
3042
  ),
@@ -3009,7 +3044,7 @@ function ka() {
3009
3044
  ae,
3010
3045
  {
3011
3046
  value: f,
3012
- onChange: (N) => m((F) => $(F, N.target.value)),
3047
+ onChange: (v) => m((M) => $(M, v.target.value)),
3013
3048
  id: "max",
3014
3049
  className: `col-span-1 h-8 w-full ${we}`
3015
3050
  }
@@ -3021,7 +3056,7 @@ function ka() {
3021
3056
  ae,
3022
3057
  {
3023
3058
  value: h,
3024
- onChange: (N) => x((F) => $(F, N.target.value)),
3059
+ onChange: (v) => x((M) => $(M, v.target.value)),
3025
3060
  id: "step-size",
3026
3061
  className: `col-span-1 h-8 w-full ${we}`
3027
3062
  }
@@ -3031,39 +3066,39 @@ function ka() {
3031
3066
  }
3032
3067
  function te() {
3033
3068
  var H;
3034
- let N = {};
3035
- u === "custom" && (N = {
3036
- min: c,
3069
+ let v = {};
3070
+ u === "custom" && (v = {
3071
+ min: l,
3037
3072
  max: f,
3038
3073
  ticks: {
3039
3074
  stepSize: h
3040
3075
  }
3041
3076
  });
3042
- const F = {
3077
+ const M = {
3043
3078
  ...a || {},
3044
3079
  chartOptions: {
3045
3080
  ...a == null ? void 0 : a.chartOptions,
3046
3081
  scales: {
3047
3082
  ...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
3048
- [i]: {
3083
+ [o]: {
3049
3084
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3050
- type: o,
3051
- ...o === "linear" ? N : {}
3085
+ type: c,
3086
+ ...c === "linear" ? v : {}
3052
3087
  }
3053
3088
  }
3054
3089
  },
3055
3090
  numberAxisFormat: {
3056
3091
  decimalPlaces: g,
3057
3092
  suffix: b,
3058
- currency: A,
3059
- locale: y
3093
+ currency: N,
3094
+ locale: j
3060
3095
  }
3061
3096
  };
3062
- E(F);
3097
+ console.log(M), A(M);
3063
3098
  }
3064
- return /* @__PURE__ */ e.jsxs(Ke, { onOpenChange: (N) => n(N), children: [
3065
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ft, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3066
- /* @__PURE__ */ e.jsx(Je, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3099
+ return /* @__PURE__ */ e.jsxs(Ke, { onOpenChange: (v) => n(v), children: [
3100
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3101
+ /* @__PURE__ */ e.jsx(Ge, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3067
3102
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3068
3103
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
3069
3104
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
@@ -3074,12 +3109,12 @@ function ka() {
3074
3109
  /* @__PURE__ */ e.jsxs(
3075
3110
  Oe,
3076
3111
  {
3077
- disabled: Y,
3078
- value: o,
3079
- onValueChange: (N) => l(N),
3112
+ disabled: K,
3113
+ value: c,
3114
+ onValueChange: (v) => r(v),
3080
3115
  children: [
3081
3116
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3082
- /* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(_e, { children: [
3117
+ /* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(He, { children: [
3083
3118
  /* @__PURE__ */ e.jsx(Le, { children: "Option" }),
3084
3119
  /* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
3085
3120
  /* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
@@ -3088,15 +3123,15 @@ function ka() {
3088
3123
  }
3089
3124
  )
3090
3125
  ] }),
3091
- o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3126
+ c == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3092
3127
  /* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
3093
3128
  /* @__PURE__ */ e.jsxs(
3094
- ra,
3129
+ la,
3095
3130
  {
3096
- disabled: Y,
3131
+ disabled: K,
3097
3132
  id: "scale-option",
3098
3133
  value: u,
3099
- onValueChange: (N) => C(N),
3134
+ onValueChange: (v) => S(v),
3100
3135
  className: "col-span-2 flex gap-3",
3101
3136
  defaultValue: "x",
3102
3137
  children: [
@@ -3112,9 +3147,9 @@ function ka() {
3112
3147
  }
3113
3148
  )
3114
3149
  ] }),
3115
- u === "custom" && o == "linear" && D(),
3116
- U(),
3117
- /* @__PURE__ */ e.jsx(Ot, {}),
3150
+ u === "custom" && c == "linear" && D(),
3151
+ G(),
3152
+ /* @__PURE__ */ e.jsx(Tt, {}),
3118
3153
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3119
3154
  w,
3120
3155
  {
@@ -3128,28 +3163,28 @@ function ka() {
3128
3163
  ] }) })
3129
3164
  ] });
3130
3165
  }
3131
- function Kn({ idx: s }) {
3132
- var c;
3133
- const n = r((d) => {
3166
+ function Un({ idx: s }) {
3167
+ var l;
3168
+ const n = i((d) => {
3134
3169
  var f;
3135
3170
  return (f = d.card) == null ? void 0 : f.preferences;
3136
- }), a = r(
3171
+ }), a = i(
3137
3172
  (d) => {
3138
3173
  var f;
3139
3174
  return (f = d.card.preferences) == null ? void 0 : f.datasetOptions;
3140
3175
  }
3141
- ), t = r(
3176
+ ), t = i(
3142
3177
  (d) => d.actions.setCardPreferences
3143
- ), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((d) => d.idx === s);
3144
- function l(d, f) {
3145
- (d === "end" || d === "start") && Tt(At());
3178
+ ), o = (l = n == null ? void 0 : n.chartOptions) == null ? void 0 : l.indexAxis, c = a == null ? void 0 : a.find((d) => d.idx === s);
3179
+ function r(d, f) {
3180
+ (d === "end" || d === "start") && Et(Lt());
3146
3181
  const m = {
3147
3182
  display: d !== "none",
3148
3183
  align: d,
3149
3184
  anchor: d,
3150
3185
  clamp: !0
3151
3186
  };
3152
- if (!o)
3187
+ if (!c)
3153
3188
  t({
3154
3189
  ...n,
3155
3190
  datasetOptions: [
@@ -3161,42 +3196,42 @@ function Kn({ idx: s }) {
3161
3196
  ]
3162
3197
  });
3163
3198
  else {
3164
- const u = { ...o };
3199
+ const u = { ...c };
3165
3200
  u.datalabels = m;
3166
- const C = a == null ? void 0 : a.map(
3201
+ const S = a == null ? void 0 : a.map(
3167
3202
  (h) => h.idx === f ? u : h
3168
3203
  );
3169
3204
  t({
3170
3205
  ...n,
3171
- datasetOptions: C
3206
+ datasetOptions: S
3172
3207
  });
3173
3208
  }
3174
3209
  }
3175
3210
  return /* @__PURE__ */ e.jsxs(Ke, { children: [
3176
- /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(mn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3177
- /* @__PURE__ */ e.jsx(Je, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3211
+ /* @__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" }) }),
3212
+ /* @__PURE__ */ e.jsx(Ge, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3178
3213
  /* @__PURE__ */ e.jsx(
3179
3214
  w,
3180
3215
  {
3181
- onClick: () => l("none", s),
3216
+ onClick: () => r("none", s),
3182
3217
  size: "sm",
3183
3218
  variant: "secondary",
3184
3219
  className: "h-7 p-1 text-xs font-normal",
3185
- children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4" })
3220
+ children: /* @__PURE__ */ e.jsx(At, { className: "size-4" })
3186
3221
  }
3187
3222
  ),
3188
3223
  /* @__PURE__ */ e.jsx(
3189
3224
  w,
3190
3225
  {
3191
- onClick: () => l("start", s),
3226
+ onClick: () => r("start", s),
3192
3227
  size: "sm",
3193
3228
  variant: "secondary",
3194
3229
  className: "h-7 p-1 text-xs font-normal",
3195
3230
  children: /* @__PURE__ */ e.jsx(
3196
- en,
3231
+ an,
3197
3232
  {
3198
- className: W("h-4 w-4", {
3199
- "rotate-90": i === "y"
3233
+ className: Y("h-4 w-4", {
3234
+ "rotate-90": o === "y"
3200
3235
  })
3201
3236
  }
3202
3237
  )
@@ -3205,15 +3240,15 @@ function Kn({ idx: s }) {
3205
3240
  /* @__PURE__ */ e.jsx(
3206
3241
  w,
3207
3242
  {
3208
- onClick: () => l("center", s),
3243
+ onClick: () => r("center", s),
3209
3244
  size: "sm",
3210
3245
  variant: "secondary",
3211
3246
  className: "h-7 p-1 text-xs font-normal",
3212
3247
  children: /* @__PURE__ */ e.jsx(
3213
- an,
3248
+ nn,
3214
3249
  {
3215
- className: W("h-4 w-4", {
3216
- "rotate-90": i === "y"
3250
+ className: Y("h-4 w-4", {
3251
+ "rotate-90": o === "y"
3217
3252
  })
3218
3253
  }
3219
3254
  )
@@ -3222,15 +3257,15 @@ function Kn({ idx: s }) {
3222
3257
  /* @__PURE__ */ e.jsx(
3223
3258
  w,
3224
3259
  {
3225
- onClick: () => l("end", s),
3260
+ onClick: () => r("end", s),
3226
3261
  size: "sm",
3227
3262
  variant: "secondary",
3228
3263
  className: "h-7 p-1 text-xs font-normal",
3229
3264
  children: /* @__PURE__ */ e.jsx(
3230
- sn,
3265
+ tn,
3231
3266
  {
3232
- className: W("h-4 w-4", {
3233
- "rotate-90": i === "y"
3267
+ className: Y("h-4 w-4", {
3268
+ "rotate-90": o === "y"
3234
3269
  })
3235
3270
  }
3236
3271
  )
@@ -3239,71 +3274,71 @@ function Kn({ idx: s }) {
3239
3274
  ] }) })
3240
3275
  ] });
3241
3276
  }
3242
- function wa() {
3243
- const s = r((d) => d.card), n = r(
3277
+ function za() {
3278
+ const s = i((d) => d.card), n = i(
3244
3279
  (d) => {
3245
3280
  var f, m, u;
3246
3281
  return (u = (m = (f = d == null ? void 0 : d.card) == null ? void 0 : f.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3247
3282
  }
3248
3283
  ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3249
- keys: i,
3250
- metricKeys: o,
3251
- dimensionKeys: l
3252
- } = is(s.data || []);
3253
- let c = o;
3284
+ keys: o,
3285
+ metricKeys: c,
3286
+ dimensionKeys: r
3287
+ } = hs(s.data || []);
3288
+ let l = c;
3254
3289
  if (s.type === "stackedBar") {
3255
- const d = Et({
3290
+ const d = Dt({
3256
3291
  dataArray: s.data || [],
3257
- groupKey: l[0],
3258
- pivotKey: l[1],
3259
- valueKey: c[0]
3260
- }), { metricKeys: f } = is(d);
3261
- c = f;
3292
+ groupKey: r[0],
3293
+ pivotKey: r[1],
3294
+ valueKey: l[0]
3295
+ }), { metricKeys: f } = hs(d);
3296
+ l = f;
3262
3297
  }
3263
- return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3298
+ return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3264
3299
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3265
3300
  /* @__PURE__ */ e.jsx(B, { children: a }),
3266
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: l[0] }) }) })
3301
+ /* @__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: r[0] }) }) })
3267
3302
  ] }),
3268
3303
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3269
3304
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3270
3305
  /* @__PURE__ */ e.jsx(B, { children: t }),
3271
- /* @__PURE__ */ e.jsx(ka, {})
3306
+ /* @__PURE__ */ e.jsx(wa, {})
3272
3307
  ] }),
3273
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((d, f) => /* @__PURE__ */ e.jsx(Un, { col: d, idx: f }, d)) })
3308
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: l.map((d, f) => /* @__PURE__ */ e.jsx(Gn, { col: d, idx: f }, d)) })
3274
3309
  ] })
3275
3310
  ] });
3276
3311
  }
3277
- function Un({ col: s, idx: n }) {
3278
- const a = r((c) => {
3312
+ function Gn({ col: s, idx: n }) {
3313
+ const a = i((l) => {
3279
3314
  var d;
3280
- return (d = c.card) == null ? void 0 : d.preferences;
3281
- }), t = r(
3282
- (c) => {
3315
+ return (d = l.card) == null ? void 0 : d.preferences;
3316
+ }), t = i(
3317
+ (l) => {
3283
3318
  var d;
3284
- return (d = c.card.preferences) == null ? void 0 : d.datasetOptions;
3319
+ return (d = l.card.preferences) == null ? void 0 : d.datasetOptions;
3285
3320
  }
3286
- ), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
3287
- function l(c) {
3288
- if (!i)
3289
- o({
3321
+ ), o = t == null ? void 0 : t.find((l) => l.idx === n), { setCardPreferences: c } = i((l) => l.actions);
3322
+ function r(l) {
3323
+ if (!o)
3324
+ c({
3290
3325
  ...a,
3291
3326
  datasetOptions: [
3292
3327
  ...t || [],
3293
3328
  {
3294
3329
  idx: n,
3295
- type: c === "area" ? "line" : c,
3296
- fill: c === "area" ? "origin" : ""
3330
+ type: l === "area" ? "line" : l,
3331
+ fill: l === "area" ? "origin" : ""
3297
3332
  }
3298
3333
  ]
3299
3334
  });
3300
3335
  else {
3301
- const d = { ...i };
3302
- d.type = c === "area" ? "line" : c, d.fill = c === "area" ? "origin" : "";
3336
+ const d = { ...o };
3337
+ d.type = l === "area" ? "line" : l, d.fill = l === "area" ? "origin" : "";
3303
3338
  const f = t == null ? void 0 : t.map(
3304
3339
  (m) => m.idx === n ? d : m
3305
3340
  );
3306
- o({
3341
+ c({
3307
3342
  ...a,
3308
3343
  datasetOptions: f
3309
3344
  });
@@ -3313,34 +3348,34 @@ function Un({ col: s, idx: n }) {
3313
3348
  /* @__PURE__ */ e.jsx("p", { children: s }),
3314
3349
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3315
3350
  /* @__PURE__ */ e.jsx(
3316
- Ns,
3351
+ ws,
3317
3352
  {
3318
- onClick: () => l("bar"),
3353
+ onClick: () => r("bar"),
3319
3354
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3320
3355
  }
3321
3356
  ),
3322
3357
  /* @__PURE__ */ e.jsx(
3323
- Cs,
3358
+ zs,
3324
3359
  {
3325
- onClick: () => l("line"),
3360
+ onClick: () => r("line"),
3326
3361
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3327
3362
  }
3328
3363
  ),
3329
3364
  /* @__PURE__ */ e.jsx(
3330
3365
  Jt,
3331
3366
  {
3332
- onClick: () => l("area"),
3367
+ onClick: () => r("area"),
3333
3368
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3334
3369
  }
3335
3370
  ),
3336
3371
  /* @__PURE__ */ e.jsx(
3337
- ys,
3372
+ Ss,
3338
3373
  {
3339
3374
  orientation: "vertical",
3340
3375
  className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3341
3376
  }
3342
3377
  ),
3343
- /* @__PURE__ */ e.jsx(Kn, { idx: n })
3378
+ /* @__PURE__ */ e.jsx(Un, { idx: n })
3344
3379
  ] })
3345
3380
  ] });
3346
3381
  }
@@ -3348,9 +3383,9 @@ function Jn({
3348
3383
  cardType: s
3349
3384
  }) {
3350
3385
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3351
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3352
- /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3353
- /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 font-mono text-xs", children: [
3386
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3387
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3388
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3354
3389
  /* @__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" }),
3355
3390
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3356
3391
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -3373,31 +3408,31 @@ function Jn({
3373
3408
  ] })
3374
3409
  ] })
3375
3410
  ] }),
3376
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3377
- /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3378
- /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
3379
- /* @__PURE__ */ e.jsx(Ss, {}),
3380
- /* @__PURE__ */ e.jsx(wa, {})
3411
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3412
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3413
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3414
+ /* @__PURE__ */ e.jsx(Fs, {}),
3415
+ /* @__PURE__ */ e.jsx(za, {})
3381
3416
  ] })
3382
3417
  ] }),
3383
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3384
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3385
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3418
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3419
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3420
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3386
3421
  ] })
3387
3422
  ] }) });
3388
3423
  }
3389
- function ks() {
3390
- var i, o, l;
3391
- const s = r(
3392
- (c) => c.card.cfg
3393
- ), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
3394
- function t(c) {
3424
+ function Os() {
3425
+ var o, c, r;
3426
+ const s = i(
3427
+ (l) => l.card.cfg
3428
+ ), n = i((l) => l.actions.setCardCfg), a = i((l) => l.card.type);
3429
+ function t(l) {
3395
3430
  var m;
3396
3431
  const d = {
3397
3432
  datalabels: {
3398
- display: c !== "none",
3399
- align: c,
3400
- anchor: c,
3433
+ display: l !== "none",
3434
+ align: l,
3435
+ anchor: l,
3401
3436
  clamp: !0
3402
3437
  }
3403
3438
  }, f = {
@@ -3410,22 +3445,22 @@ function ks() {
3410
3445
  }
3411
3446
  }
3412
3447
  };
3413
- n(f), console.log(c);
3448
+ n(f), console.log(l);
3414
3449
  }
3415
3450
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3416
3451
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3417
3452
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3418
- a !== "pyramid" && /* @__PURE__ */ e.jsx(ka, {})
3453
+ !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(wa, {})
3419
3454
  ] }),
3420
3455
  /* @__PURE__ */ e.jsxs(
3421
3456
  Oe,
3422
3457
  {
3423
- value: (l = (o = (i = s == null ? void 0 : s.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : l.anchor,
3458
+ value: (r = (c = (o = s == null ? void 0 : s.options) == null ? void 0 : o.plugins) == null ? void 0 : c.datalabels) == null ? void 0 : r.anchor,
3424
3459
  onValueChange: t,
3425
3460
  defaultValue: "none",
3426
3461
  children: [
3427
3462
  /* @__PURE__ */ e.jsx(Me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, { placeholder: "Select position" }) }),
3428
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3463
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3429
3464
  /* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
3430
3465
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
3431
3466
  a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
@@ -3437,13 +3472,13 @@ function ks() {
3437
3472
  )
3438
3473
  ] });
3439
3474
  }
3440
- function Pn({
3475
+ function Qn({
3441
3476
  cardType: s
3442
3477
  }) {
3443
3478
  function n(a) {
3444
- const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", i = "SELECT label, [group], x-axis, y-axis FROM table";
3479
+ const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", o = "SELECT label, [group], x-axis, y-axis FROM table";
3445
3480
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3446
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : i }),
3481
+ /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : o }),
3447
3482
  /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
3448
3483
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3449
3484
  /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
@@ -3457,7 +3492,7 @@ function Pn({
3457
3492
  "a",
3458
3493
  {
3459
3494
  target: "_blank",
3460
- onClick: (o) => o.stopPropagation(),
3495
+ onClick: (c) => c.stopPropagation(),
3461
3496
  className: "text-blue-700",
3462
3497
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3463
3498
  children: "example"
@@ -3468,21 +3503,21 @@ function Pn({
3468
3503
  ] });
3469
3504
  }
3470
3505
  return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3471
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3472
- /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3473
- /* @__PURE__ */ e.jsx(R, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3506
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3507
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3508
+ /* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3474
3509
  ] }),
3475
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3476
- /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3477
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ks, {}) })
3510
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3511
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3512
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
3478
3513
  ] }),
3479
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3480
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3481
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3514
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3515
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3516
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3482
3517
  ] })
3483
3518
  ] }) });
3484
3519
  }
3485
- const Gn = {
3520
+ const Wn = {
3486
3521
  datasets: [
3487
3522
  {
3488
3523
  type: "line",
@@ -3495,7 +3530,7 @@ const Gn = {
3495
3530
  data: []
3496
3531
  }
3497
3532
  ]
3498
- }, Qn = {
3533
+ }, Yn = {
3499
3534
  datasets: [
3500
3535
  {
3501
3536
  fill: "origin",
@@ -3505,50 +3540,50 @@ const Gn = {
3505
3540
  }
3506
3541
  ]
3507
3542
  };
3508
- function Wn() {
3509
- const s = r((n) => n.card.type);
3510
- return /* @__PURE__ */ e.jsxs("div", { className: "p-6 space-y-6", children: [
3543
+ function Xn() {
3544
+ const s = i((n) => n.card.type);
3545
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
3511
3546
  /* @__PURE__ */ e.jsx(
3512
3547
  Se,
3513
3548
  {
3514
3549
  className: " ",
3515
3550
  type: "single",
3516
3551
  collapsible: !0,
3517
- children: Yn(s)
3552
+ children: Zn(s)
3518
3553
  }
3519
3554
  ),
3520
- /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Ss, {}) }),
3521
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(ks, {}) }),
3555
+ /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Fs, {}) }),
3556
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Os, {}) }),
3522
3557
  /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(De, {}) })
3523
3558
  ] });
3524
3559
  }
3525
- function Yn(s) {
3560
+ function Zn(s) {
3526
3561
  if (["line", "bar"].includes(s))
3527
3562
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3528
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3529
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3530
- /* @__PURE__ */ e.jsxs(R, { className: " ", children: [
3531
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
3532
- /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
3563
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3564
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3565
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3566
+ /* @__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" }),
3567
+ /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3533
3568
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
3534
3569
  /* @__PURE__ */ e.jsx("li", { children: "Y-axis - Number (ex. population)" })
3535
3570
  ] })
3536
3571
  ] })
3537
3572
  ] }),
3538
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3539
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: "Mixed Chart" }),
3540
- /* @__PURE__ */ e.jsxs(R, { className: " text-xs space-y-2", children: [
3573
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3574
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
3575
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3541
3576
  /* @__PURE__ */ e.jsxs("p", { children: [
3542
3577
  "Click ",
3543
3578
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
3544
3579
  " and change the `type` property in the dataset."
3545
3580
  ] }),
3546
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gn, null, 2) })
3581
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Wn, null, 2) })
3547
3582
  ] })
3548
3583
  ] }),
3549
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3550
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: "Area Chart" }),
3551
- /* @__PURE__ */ e.jsxs(R, { className: " text-xs space-y-2", children: [
3584
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3585
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
3586
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3552
3587
  /* @__PURE__ */ e.jsxs("p", { children: [
3553
3588
  "Click ",
3554
3589
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
@@ -3556,7 +3591,7 @@ function Yn(s) {
3556
3591
  /* @__PURE__ */ e.jsx(
3557
3592
  "a",
3558
3593
  {
3559
- className: "text-blue-500 hover:underline mx-1",
3594
+ className: "mx-1 text-blue-500 hover:underline",
3560
3595
  href: "https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",
3561
3596
  target: "_blank",
3562
3597
  children: "docs"
@@ -3564,20 +3599,20 @@ function Yn(s) {
3564
3599
  ),
3565
3600
  "for more options."
3566
3601
  ] }),
3567
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Qn, null, 2) })
3602
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Yn, null, 2) })
3568
3603
  ] })
3569
3604
  ] })
3570
3605
  ] });
3571
3606
  if (s === "bubble")
3572
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3573
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3607
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3608
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3574
3609
  "How to create a ",
3575
3610
  /* @__PURE__ */ e.jsx("span", { children: s }),
3576
3611
  " chart query?"
3577
3612
  ] }) }),
3578
- /* @__PURE__ */ e.jsxs(R, { className: " ", children: [
3579
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
3580
- /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
3613
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3614
+ /* @__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" }),
3615
+ /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3581
3616
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
3582
3617
  /* @__PURE__ */ e.jsx("li", { children: "Bubble Group (opt) - Category (ex. state)" }),
3583
3618
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Number (ex. avg. age)" }),
@@ -3587,15 +3622,15 @@ function Yn(s) {
3587
3622
  ] })
3588
3623
  ] }) });
3589
3624
  if (s === "scatter")
3590
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3591
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3625
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3626
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3592
3627
  "How to create a ",
3593
3628
  /* @__PURE__ */ e.jsx("span", { children: s }),
3594
3629
  " chart query?"
3595
3630
  ] }) }),
3596
- /* @__PURE__ */ e.jsxs(R, { className: " ", children: [
3597
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, x-axis, y-axis FROM table" }),
3598
- /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
3631
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3632
+ /* @__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" }),
3633
+ /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3599
3634
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
3600
3635
  /* @__PURE__ */ e.jsx("li", { children: "Group (opt) - Category (ex. state)" }),
3601
3636
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Number (ex. avg. age)" }),
@@ -3604,60 +3639,60 @@ function Yn(s) {
3604
3639
  ] })
3605
3640
  ] }) });
3606
3641
  if (["pie", "doughnut", "polarArea"].includes(s))
3607
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3608
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3642
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3643
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3609
3644
  /* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
3610
3645
  " ",
3611
3646
  "chart query"
3612
3647
  ] }) }),
3613
- /* @__PURE__ */ e.jsxs(R, { className: " ", children: [
3614
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, measure FROM table" }),
3615
- /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
3648
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3649
+ /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
3650
+ /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3616
3651
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
3617
3652
  /* @__PURE__ */ e.jsx("li", { children: "Measure - Number (ex. population)" })
3618
3653
  ] })
3619
3654
  ] })
3620
3655
  ] }) });
3621
3656
  }
3622
- function Xn() {
3623
- var d, f, m, u, C;
3624
- const s = r((h) => h.card.preferences), n = r(
3657
+ function er() {
3658
+ var d, f, m, u, S;
3659
+ const s = i((h) => h.card.preferences), n = i(
3625
3660
  (h) => h.actions.setCardPreferences
3626
- ), a = r(
3661
+ ), a = i(
3627
3662
  (h) => h.actions.setNumberFormat
3628
3663
  );
3629
- r(
3664
+ i(
3630
3665
  (h) => {
3631
3666
  var x, g;
3632
3667
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.decimalPlaces;
3633
3668
  }
3634
3669
  );
3635
- const t = r(
3670
+ const t = i(
3636
3671
  (h) => {
3637
3672
  var x, g;
3638
3673
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.locale;
3639
3674
  }
3640
- ), i = r(
3675
+ ), o = i(
3641
3676
  (h) => {
3642
3677
  var x, g;
3643
3678
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.currency;
3644
3679
  }
3645
3680
  );
3646
- r(
3681
+ i(
3647
3682
  (h) => h.actions.setFilterOnClickField
3648
3683
  );
3649
- const o = r(
3684
+ const c = i(
3650
3685
  (h) => {
3651
3686
  var x, g;
3652
3687
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.colorRanges;
3653
3688
  }
3654
- ) || [], l = r(
3689
+ ) || [], r = i(
3655
3690
  (h) => h.actions.setColorRanges
3656
- ), c = [...new Set(Vs.map((h) => h.currency))];
3691
+ ), l = [...new Set(Rs.map((h) => h.currency))];
3657
3692
  return /* @__PURE__ */ e.jsxs("div", { children: [
3658
3693
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
3659
3694
  /* @__PURE__ */ e.jsx(
3660
- $e,
3695
+ Pe,
3661
3696
  {
3662
3697
  checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
3663
3698
  onCheckedChange: (h) => {
@@ -3683,19 +3718,19 @@ function Xn() {
3683
3718
  {
3684
3719
  value: t || "en-US",
3685
3720
  onValueChange: (h) => {
3686
- var x, g, j;
3721
+ var x, g, z;
3687
3722
  return a(
3688
3723
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3689
3724
  ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
3690
3725
  h || "en-US",
3691
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
3726
+ ((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
3692
3727
  );
3693
3728
  },
3694
3729
  children: [
3695
3730
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3696
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3731
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3697
3732
  /* @__PURE__ */ e.jsx(Le, { children: "Format" }),
3698
- Vs.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
3733
+ Rs.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
3699
3734
  ] }) })
3700
3735
  ]
3701
3736
  }
@@ -3706,22 +3741,22 @@ function Xn() {
3706
3741
  /* @__PURE__ */ e.jsxs(
3707
3742
  Oe,
3708
3743
  {
3709
- value: i || "none",
3744
+ value: o || "none",
3710
3745
  onValueChange: (h) => {
3711
- var x, g, j;
3746
+ var x, g, z;
3712
3747
  return a(
3713
3748
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3714
3749
  h === "none" ? "" : h,
3715
3750
  ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.locale) || "",
3716
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
3751
+ ((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
3717
3752
  );
3718
3753
  },
3719
3754
  children: [
3720
3755
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3721
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3756
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3722
3757
  /* @__PURE__ */ e.jsx(Le, { children: "Currency" }),
3723
3758
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
3724
- c.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
3759
+ l.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
3725
3760
  ] }) })
3726
3761
  ]
3727
3762
  }
@@ -3736,12 +3771,12 @@ function Xn() {
3736
3771
  {
3737
3772
  value: ((u = (m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : u.toString()) || "0",
3738
3773
  onValueChange: (h) => {
3739
- var x, g, j;
3774
+ var x, g, z;
3740
3775
  return a(
3741
3776
  Number(h),
3742
3777
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.currency) || "",
3743
3778
  ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.locale) || "",
3744
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
3779
+ ((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
3745
3780
  );
3746
3781
  },
3747
3782
  children: [
@@ -3756,15 +3791,15 @@ function Xn() {
3756
3791
  /* @__PURE__ */ e.jsx(
3757
3792
  ae,
3758
3793
  {
3759
- value: ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.suffix) || "",
3794
+ value: ((S = s == null ? void 0 : s.formatNumber) == null ? void 0 : S.suffix) || "",
3760
3795
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3761
3796
  placeholder: "K, M, B, %",
3762
3797
  onChange: (h) => {
3763
- var x, g, j;
3798
+ var x, g, z;
3764
3799
  return a(
3765
3800
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3766
3801
  ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
3767
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
3802
+ ((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.locale) || "",
3768
3803
  h.target.value
3769
3804
  );
3770
3805
  }
@@ -3773,22 +3808,22 @@ function Xn() {
3773
3808
  ] })
3774
3809
  ] })
3775
3810
  ] }) }),
3776
- /* @__PURE__ */ e.jsx(ys, { className: "my-3" }),
3811
+ /* @__PURE__ */ e.jsx(Ss, { className: "my-3" }),
3777
3812
  /* @__PURE__ */ e.jsx(
3778
- Lt,
3813
+ It,
3779
3814
  {
3780
- colorRanges: o,
3781
- setColorRanges: l
3815
+ colorRanges: c,
3816
+ setColorRanges: r
3782
3817
  }
3783
3818
  )
3784
3819
  ] })
3785
3820
  ] });
3786
3821
  }
3787
- function Zn() {
3822
+ function sr() {
3788
3823
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3789
- /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3790
- /* @__PURE__ */ e.jsx(V, { className: "", children: "KPI Query" }),
3791
- /* @__PURE__ */ e.jsxs(R, { className: "font-mono", children: [
3824
+ /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3825
+ /* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
3826
+ /* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
3792
3827
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
3793
3828
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
3794
3829
  /* @__PURE__ */ e.jsx("li", { children: "current - number" }),
@@ -3810,19 +3845,19 @@ function Zn() {
3810
3845
  ] })
3811
3846
  ] })
3812
3847
  ] }) }),
3813
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Xn, {}) }),
3848
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(er, {}) }),
3814
3849
  /* @__PURE__ */ e.jsx("div", {}),
3815
3850
  /* @__PURE__ */ e.jsx("div", {})
3816
3851
  ] });
3817
3852
  }
3818
- function Ks({
3853
+ function os({
3819
3854
  cardType: s,
3820
3855
  docContent: n
3821
3856
  }) {
3822
3857
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3823
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3824
- /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3825
- /* @__PURE__ */ e.jsx(R, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3858
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3859
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3860
+ /* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3826
3861
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
3827
3862
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3828
3863
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
@@ -3844,21 +3879,21 @@ function Ks({
3844
3879
  ] })
3845
3880
  ] }) })
3846
3881
  ] }),
3847
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3848
- /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3849
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ks, {}) })
3882
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3883
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3884
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
3850
3885
  ] }),
3851
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3852
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3853
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3886
+ s !== "range" && /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3887
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3888
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3854
3889
  ] })
3855
3890
  ] }) });
3856
3891
  }
3857
- function el() {
3892
+ function ar() {
3858
3893
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3859
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3860
- /* @__PURE__ */ e.jsx(V, { children: "Stacked Chart" }),
3861
- /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 font-mono text-xs", children: [
3894
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3895
+ /* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
3896
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3862
3897
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
3863
3898
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3864
3899
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -3881,24 +3916,24 @@ function el() {
3881
3916
  ] })
3882
3917
  ] })
3883
3918
  ] }),
3884
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3885
- /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3886
- /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
3887
- /* @__PURE__ */ e.jsx(Ss, {}),
3888
- /* @__PURE__ */ e.jsx(wa, {})
3919
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3920
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3921
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3922
+ /* @__PURE__ */ e.jsx(Fs, {}),
3923
+ /* @__PURE__ */ e.jsx(za, {})
3889
3924
  ] })
3890
3925
  ] }),
3891
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3892
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3893
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3926
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3927
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3928
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3894
3929
  ] })
3895
3930
  ] }) });
3896
3931
  }
3897
- function sl({}) {
3898
- const s = r((t) => {
3899
- var i;
3900
- return (i = t.card) == null ? void 0 : i.preferences;
3901
- }), n = r(
3932
+ function tr({}) {
3933
+ const s = i((t) => {
3934
+ var o;
3935
+ return (o = t.card) == null ? void 0 : o.preferences;
3936
+ }), n = i(
3902
3937
  (t) => t.actions.setCardPreferences
3903
3938
  ), a = (t) => {
3904
3939
  n({
@@ -3907,12 +3942,12 @@ function sl({}) {
3907
3942
  });
3908
3943
  };
3909
3944
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3910
- /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3911
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3912
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3945
+ /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3946
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3947
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3913
3948
  ] }) }),
3914
3949
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3915
- /* @__PURE__ */ e.jsx($e, { onCheckedChange: a, id: "allow-download" }),
3950
+ /* @__PURE__ */ e.jsx(Pe, { onCheckedChange: a, id: "allow-download" }),
3916
3951
  /* @__PURE__ */ e.jsx(
3917
3952
  "label",
3918
3953
  {
@@ -3924,7 +3959,7 @@ function sl({}) {
3924
3959
  ] })
3925
3960
  ] });
3926
3961
  }
3927
- const al = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3962
+ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3928
3963
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
3929
3964
  /* @__PURE__ */ e.jsxs("div", { children: [
3930
3965
  "See ",
@@ -3940,49 +3975,61 @@ const al = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3940
3975
  ),
3941
3976
  " in the docs."
3942
3977
  ] })
3978
+ ] }), rr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3979
+ /* @__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" }),
3980
+ /* @__PURE__ */ e.jsxs("div", { children: [
3981
+ "See ",
3982
+ /* @__PURE__ */ e.jsx(
3983
+ "a",
3984
+ {
3985
+ target: "_blank",
3986
+ onClick: (s) => s.stopPropagation(),
3987
+ className: "text-blue-700",
3988
+ href: "https://docs.semaphor.cloud/concepts/visuals#range-charts",
3989
+ children: "example"
3990
+ }
3991
+ ),
3992
+ " in the docs."
3993
+ ] })
3943
3994
  ] });
3944
- function tl() {
3945
- const s = r((a) => a.card.type);
3995
+ function lr() {
3996
+ const s = i((a) => a.card.type);
3946
3997
  function n(a) {
3947
3998
  switch (a) {
3948
3999
  case "stackedBar":
3949
- return /* @__PURE__ */ e.jsx(el, {});
4000
+ return /* @__PURE__ */ e.jsx(ar, {});
3950
4001
  case "pyramid":
3951
- return /* @__PURE__ */ e.jsx(
3952
- Ks,
3953
- {
3954
- docContent: al,
3955
- cardType: a
3956
- }
3957
- );
4002
+ return /* @__PURE__ */ e.jsx(os, { docContent: nr, cardType: a });
3958
4003
  case "kpi":
3959
- return /* @__PURE__ */ e.jsx(Zn, {});
4004
+ return /* @__PURE__ */ e.jsx(sr, {});
3960
4005
  case "line":
3961
4006
  case "bar":
3962
4007
  return /* @__PURE__ */ e.jsx(Jn, { cardType: a });
4008
+ case "range":
4009
+ return /* @__PURE__ */ e.jsx(os, { docContent: rr, cardType: a });
3963
4010
  case "pie":
3964
4011
  case "doughnut":
3965
4012
  case "polarArea":
3966
4013
  case "radar":
3967
- return /* @__PURE__ */ e.jsx(Ks, { cardType: a });
4014
+ return /* @__PURE__ */ e.jsx(os, { cardType: a });
3968
4015
  case "bubble":
3969
4016
  case "scatter":
3970
- return /* @__PURE__ */ e.jsx(Pn, { cardType: a });
4017
+ return /* @__PURE__ */ e.jsx(Qn, { cardType: a });
3971
4018
  case "table":
3972
- return /* @__PURE__ */ e.jsx(sl, { cardType: a });
4019
+ return /* @__PURE__ */ e.jsx(tr, { cardType: a });
3973
4020
  default:
3974
- return /* @__PURE__ */ e.jsx(Wn, {});
4021
+ return /* @__PURE__ */ e.jsx(Xn, {});
3975
4022
  }
3976
4023
  }
3977
- return /* @__PURE__ */ e.jsx(bs, { className: "h-full w-full text-sm", children: n(s) });
4024
+ return /* @__PURE__ */ e.jsx(Cs, { className: "h-full w-full text-sm", children: n(s) });
3978
4025
  }
3979
- function nl() {
3980
- const s = r((n) => n.isShowingVisual);
4026
+ function ir() {
4027
+ const s = i((n) => n.isShowingVisual);
3981
4028
  return /* @__PURE__ */ e.jsxs(
3982
- os,
4029
+ ms,
3983
4030
  {
3984
4031
  direction: "vertical",
3985
- className: "min-w-full max-w-lg min-h-[250px]",
4032
+ className: "min-h-[250px] min-w-full max-w-lg",
3986
4033
  children: [
3987
4034
  /* @__PURE__ */ e.jsx(
3988
4035
  Fe,
@@ -3991,10 +4038,10 @@ function nl() {
3991
4038
  className: "flex",
3992
4039
  minSize: 20,
3993
4040
  defaultSize: 40,
3994
- children: /* @__PURE__ */ e.jsx(In, {})
4041
+ children: /* @__PURE__ */ e.jsx(Vn, {})
3995
4042
  }
3996
4043
  ),
3997
- /* @__PURE__ */ e.jsx(cs, { withHandle: !0, className: "border " }),
4044
+ /* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border" }),
3998
4045
  /* @__PURE__ */ e.jsx(
3999
4046
  Fe,
4000
4047
  {
@@ -4002,7 +4049,7 @@ function nl() {
4002
4049
  role: "visual-section",
4003
4050
  minSize: 0,
4004
4051
  defaultSize: 60,
4005
- children: s ? /* @__PURE__ */ e.jsxs(os, { direction: "horizontal", children: [
4052
+ children: s ? /* @__PURE__ */ e.jsxs(ms, { direction: "horizontal", children: [
4006
4053
  /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
4007
4054
  Fe,
4008
4055
  {
@@ -4010,76 +4057,76 @@ function nl() {
4010
4057
  minSize: 20,
4011
4058
  defaultSize: 25,
4012
4059
  maxSize: 30,
4013
- children: /* @__PURE__ */ e.jsx(tl, {})
4060
+ children: /* @__PURE__ */ e.jsx(lr, {})
4014
4061
  }
4015
4062
  ) }),
4016
- /* @__PURE__ */ e.jsx(cs, { className: "border " }),
4017
- /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Bs, {}) })
4018
- ] }) : /* @__PURE__ */ e.jsx(Bs, {})
4063
+ /* @__PURE__ */ e.jsx(us, { className: "border" }),
4064
+ /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx($s, {}) })
4065
+ ] }) : /* @__PURE__ */ e.jsx($s, {})
4019
4066
  }
4020
4067
  )
4021
4068
  ]
4022
4069
  }
4023
4070
  );
4024
4071
  }
4025
- function ll({ authToken: s, onSave: n, onClose: a }) {
4026
- const t = r((l) => l.actions.setOnSave), i = r((l) => l.actions.setOnClose), o = k((l) => l.actions.setAuthToken);
4027
- return K(() => {
4028
- n && t(n), a && i(a);
4029
- }, [n, t, a, i]), K(() => {
4030
- s && s.accessToken && o(s);
4031
- }, [s, o]), /* @__PURE__ */ e.jsxs(Dt, { className: "rounded-none", role: "editor-panel", children: [
4032
- /* @__PURE__ */ e.jsx(It, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(xa, {}) }),
4033
- /* @__PURE__ */ e.jsx(qt, { children: /* @__PURE__ */ e.jsx(nl, {}) })
4072
+ function or({ authToken: s, onSave: n, onClose: a }) {
4073
+ const t = i((r) => r.actions.setOnSave), o = i((r) => r.actions.setOnClose), c = k((r) => r.actions.setAuthToken);
4074
+ return P(() => {
4075
+ n && t(n), a && o(a);
4076
+ }, [n, t, a, o]), P(() => {
4077
+ s && s.accessToken && c(s);
4078
+ }, [s, c]), /* @__PURE__ */ e.jsxs(qt, { className: "rounded-none", role: "editor-panel", children: [
4079
+ /* @__PURE__ */ e.jsx(Vt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(pa, {}) }),
4080
+ /* @__PURE__ */ e.jsx(Rt, { children: /* @__PURE__ */ e.jsx(ir, {}) })
4034
4081
  ] });
4035
4082
  }
4036
- function rl() {
4037
- k((l) => l.selectedCardId);
4038
- const s = k((l) => l.selectedSheetId), { setIsVisualEditing: n } = k((l) => l.actions), a = k((l) => l.isVisualEditing), t = k((l) => l.actions.updateFrame);
4039
- function i(l) {
4040
- s && (t(s, l), n(!1));
4083
+ function cr() {
4084
+ k((r) => r.selectedCardId);
4085
+ const s = k((r) => r.selectedSheetId), { setIsVisualEditing: n } = k((r) => r.actions), a = k((r) => r.isVisualEditing), t = k((r) => r.actions.updateFrame);
4086
+ function o(r) {
4087
+ s && (t(s, r), n(!1));
4041
4088
  }
4042
- function o() {
4089
+ function c() {
4043
4090
  n(!1);
4044
4091
  }
4045
4092
  return /* @__PURE__ */ e.jsx(
4046
4093
  "div",
4047
4094
  {
4048
4095
  role: "editor-container",
4049
- className: W("flex grow", {
4096
+ className: Y("flex grow", {
4050
4097
  block: a,
4051
4098
  hidden: !a
4052
4099
  }),
4053
- children: /* @__PURE__ */ e.jsx(ll, { onSave: i, onClose: o })
4100
+ children: /* @__PURE__ */ e.jsx(or, { onSave: o, onClose: c })
4054
4101
  }
4055
4102
  );
4056
4103
  }
4057
- function il({
4104
+ function dr({
4058
4105
  columns: s,
4059
4106
  tableName: n
4060
4107
  }) {
4061
- const a = r((u) => u.selectedConnectionId), t = r((u) => u.selectedDatabaseName), i = r((u) => u.selectedSchemaName), o = r((u) => u.selectedTableName), l = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter), d = k((u) => u.actions.removeFilter), f = k(
4108
+ const a = i((u) => u.selectedConnectionId), t = i((u) => u.selectedDatabaseName), o = i((u) => u.selectedSchemaName), c = i((u) => u.selectedTableName), r = k((u) => u.dashboard.filters) || [], l = k((u) => u.actions.addFilter), d = k((u) => u.actions.removeFilter), f = k(
4062
4109
  (u) => u.actions.removeFilterValue
4063
4110
  );
4064
4111
  function m(u) {
4065
- const C = he(u.column_name), h = he(t || ""), x = he(i || ""), g = he(n), j = rs(
4112
+ const S = he(u.column_name), h = he(t || ""), x = he(o || ""), g = he(n), z = ds(
4066
4113
  x,
4067
4114
  g
4068
- ), b = `${j}.${C}`;
4115
+ ), b = `${z}.${S}`;
4069
4116
  console.log(
4070
4117
  "find",
4071
4118
  b,
4072
4119
  g,
4073
4120
  h
4074
4121
  );
4075
- const L = l == null ? void 0 : l.find(
4076
- (A) => A.column === b && A.table === g && (A.database === h || A.database === t)
4122
+ const L = r == null ? void 0 : r.find(
4123
+ (N) => N.column === b && N.table === g && (N.database === h || N.database === t)
4077
4124
  );
4078
4125
  if (L)
4079
4126
  f(L.id), d(L.id);
4080
4127
  else {
4081
4128
  if (n === "api" && a) {
4082
- c({
4129
+ l({
4083
4130
  id: We(),
4084
4131
  column: b,
4085
4132
  title: u.column_name,
@@ -4089,49 +4136,49 @@ function il({
4089
4136
  // database: 'NA',
4090
4137
  connectionId: a,
4091
4138
  operation: "in",
4092
- sql: Rs(
4139
+ sql: _s(
4093
4140
  u.data_type,
4094
- j,
4095
- C
4141
+ z,
4142
+ S
4096
4143
  )
4097
4144
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4098
4145
  });
4099
4146
  return;
4100
4147
  }
4101
- c({
4148
+ l({
4102
4149
  id: We(),
4103
- column: `${j}.${C}`,
4150
+ column: `${z}.${S}`,
4104
4151
  title: u.column_name,
4105
4152
  dataType: u.data_type,
4106
- table: o || "",
4153
+ table: c || "",
4107
4154
  database: t || "",
4108
4155
  connectionId: a || "",
4109
4156
  operation: "in",
4110
- sql: Rs(
4157
+ sql: _s(
4111
4158
  u.data_type,
4112
- j,
4113
- C
4159
+ z,
4160
+ S
4114
4161
  )
4115
4162
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4116
4163
  });
4117
4164
  }
4118
4165
  }
4119
4166
  return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: s == null ? void 0 : s.map((u) => {
4120
- const C = l == null ? void 0 : l.find(
4121
- (h) => h.column === he(u.column_name) && h.table === o && h.database === t
4167
+ const S = r == null ? void 0 : r.find(
4168
+ (h) => h.column === he(u.column_name) && h.table === c && h.database === t
4122
4169
  );
4123
4170
  return /* @__PURE__ */ e.jsx(
4124
4171
  "div",
4125
4172
  {
4126
4173
  onClick: () => m(u),
4127
- className: W(
4174
+ className: Y(
4128
4175
  "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",
4129
4176
  {
4130
- "bg-muted": C
4177
+ "bg-muted": S
4131
4178
  }
4132
4179
  ),
4133
4180
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4134
- /* @__PURE__ */ e.jsx(ma, { column: u }),
4181
+ /* @__PURE__ */ e.jsx(ua, { column: u }),
4135
4182
  /* @__PURE__ */ e.jsx("span", { children: u.column_name })
4136
4183
  ] })
4137
4184
  },
@@ -4139,7 +4186,7 @@ function il({
4139
4186
  );
4140
4187
  }) });
4141
4188
  }
4142
- function ol() {
4189
+ function hr() {
4143
4190
  k((n) => n.showFilters);
4144
4191
  const s = k(
4145
4192
  (n) => n.actions.setShowFilters
@@ -4153,15 +4200,15 @@ function ol() {
4153
4200
  onClick: () => s(!1),
4154
4201
  className: "h-7 w-7 p-0",
4155
4202
  variant: "ghost",
4156
- children: /* @__PURE__ */ e.jsx(Re, {})
4203
+ children: /* @__PURE__ */ e.jsx(_e, {})
4157
4204
  }
4158
4205
  )
4159
4206
  ] }),
4160
4207
  /* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
4161
- xa,
4208
+ pa,
4162
4209
  {
4163
4210
  ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
4164
- il,
4211
+ dr,
4165
4212
  {
4166
4213
  schemaName: n,
4167
4214
  tableName: a,
@@ -4172,25 +4219,25 @@ function ol() {
4172
4219
  ) })
4173
4220
  ] });
4174
4221
  }
4175
- function cl() {
4222
+ function mr() {
4176
4223
  k((a) => a.dashboard);
4177
4224
  const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
4178
4225
  return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
4179
4226
  "div",
4180
4227
  {
4181
4228
  role: "dashboard-plus-main",
4182
- className: W("grow", {
4229
+ className: Y("grow", {
4183
4230
  hidden: n,
4184
4231
  flex: !n
4185
4232
  }),
4186
4233
  children: [
4187
- /* @__PURE__ */ e.jsx(Vt, {}),
4188
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(ol, {}) })
4234
+ /* @__PURE__ */ e.jsx(_t, {}),
4235
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hr, {}) })
4189
4236
  ]
4190
4237
  }
4191
4238
  );
4192
4239
  }
4193
- function dl() {
4240
+ function ur() {
4194
4241
  const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
4195
4242
  (t) => t.showDashboardJSON
4196
4243
  );
@@ -4199,11 +4246,11 @@ function dl() {
4199
4246
  ), /* @__PURE__ */ e.jsx(
4200
4247
  "div",
4201
4248
  {
4202
- className: W(" p-2", {
4249
+ className: Y(" p-2", {
4203
4250
  hidden: !a
4204
4251
  }),
4205
4252
  children: /* @__PURE__ */ e.jsx(
4206
- Rt,
4253
+ Ht,
4207
4254
  {
4208
4255
  onChange: (t) => {
4209
4256
  if (t)
@@ -4234,25 +4281,25 @@ function dl() {
4234
4281
  }
4235
4282
  );
4236
4283
  }
4237
- function ul({
4284
+ function fr({
4238
4285
  showControls: s = !1,
4239
4286
  showFooter: n = !0,
4240
4287
  ...a
4241
4288
  }) {
4242
- return /* @__PURE__ */ e.jsxs(_t, { dashboardProps: a, children: [
4243
- /* @__PURE__ */ e.jsx(Ht, {}),
4244
- /* @__PURE__ */ e.jsxs(Bt, { children: [
4245
- /* @__PURE__ */ e.jsx(dl, {}),
4246
- /* @__PURE__ */ e.jsxs($t, { ...a, children: [
4247
- s && /* @__PURE__ */ e.jsx(bn, {}),
4248
- /* @__PURE__ */ e.jsx(rl, {}),
4249
- /* @__PURE__ */ e.jsx(cl, {})
4289
+ return /* @__PURE__ */ e.jsxs(Bt, { dashboardProps: a, children: [
4290
+ /* @__PURE__ */ e.jsx($t, {}),
4291
+ /* @__PURE__ */ e.jsxs(Pt, { children: [
4292
+ /* @__PURE__ */ e.jsx(ur, {}),
4293
+ /* @__PURE__ */ e.jsxs(Kt, { ...a, children: [
4294
+ s && /* @__PURE__ */ e.jsx(vn, {}),
4295
+ /* @__PURE__ */ e.jsx(cr, {}),
4296
+ /* @__PURE__ */ e.jsx(mr, {})
4250
4297
  ] })
4251
4298
  ] })
4252
4299
  ] });
4253
4300
  }
4254
4301
  export {
4255
- ul as D,
4256
- Ge as S,
4257
- ua as u
4302
+ fr as D,
4303
+ Qe as S,
4304
+ xa as u
4258
4305
  };