react-semaphor 0.0.171 → 0.0.173

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 M, b as S, j as e, Q as is, R as os, U as k, V as cs, W as ds, X as hs, Y as us, Z as _, _ as Q, $ as Bs, J as $s, O as Oe, a0 as At, a1 as Et, a2 as Lt, a3 as Dt, a4 as It, a5 as qt, a6 as Os, a7 as Ee, a8 as Qe, a9 as $e, T as We, e as ms, g as Pe, aa as xs, ab as ps, f as W, ac as fs, ad as gs, ae as js, af as Ke, ag as me, G as i, ah as Ie, ai as qe, aj as Vt, ak as Ve, w as Ks, v as Us, t as oe, al as Rt, r as _t, N as Gs, s as Ht, am as Bt, B as $t, an as Js, L as Le, S as bs, z as Kt, n as zs, A as as, u as Ye, ao as ye, ap as we, aq as Ut, ar as Gt, as as Jt, at as Qs, au as Ws, av as Ps, aw as Ys, ax as Xs, ay as Qt, az as Zs, aA as et, aB as Wt, aC as Pt, aD as Yt, aE as Xt, aF as Zt, aG as ns, aH as ea, aI as Be, aJ as Ms, aK as sa, aL as ta, aM as aa, aN as na, aO as ra, aP as ts, aQ as la, aR as Ts, aS as ia, aT as As, aU as oa, aV as ca, aW as da, aX as st, l as ha, C as ua, E as Es, d as ma, h as xa, i as pa, o as fa, aY as ga, m as ja, aZ as ba, a_ as ya, a$ as va, b0 as Ls, b1 as Na, b2 as Ds, b3 as Is, K as Ca, b4 as tt, b5 as Sa, b6 as at, b7 as Ue, b8 as nt, b9 as ka, ba as wa, bb as Fa, bc as Oa, bd as za, be as Ma, bf as ve, bg as q, bh as V, bi as ys, bj as R, bk as Ta, bl as Aa, bm as Ea, bn as qs, bo as La, bp as Da, bq as Ia, br as qa, bs as Va } from "./index-I8_5WKph.js";
2
- import ce, { useState as z, useEffect as $, useMemo as Ra, useRef as De } from "react";
1
+ import { P as M, b as S, j as e, Q as is, R as os, U as w, V as cs, W as ds, X as hs, Y as us, Z as H, _ as W, $ as Bs, J as $s, O as ze, a0 as Et, a1 as Lt, a2 as Dt, a3 as It, a4 as qt, a5 as Vt, a6 as Os, a7 as Le, a8 as Qe, a9 as $e, T as We, e as ms, g as Pe, aa as xs, ab as ps, f as K, ac as fs, ad as gs, ae as js, af as Ke, ag as xe, ah as bs, G as l, ai as qe, aj as Ve, ak as Rt, al as Re, w as Ks, v as Us, t as ce, am as _t, r as Ht, N as Gs, s as Bt, an as $t, B as Kt, ao as Js, ap as Ut, L as De, S as ys, z as Gt, n as zs, A as as, u as Ye, aq as Ne, ar as Fe, as as Jt, at as Qt, au as Wt, av as Qs, aw as Ws, ax as Ps, ay as Ys, az as Xs, aA as Pt, aB as Zs, aC as et, aD as Yt, aE as Xt, aF as Zt, aG as ea, aH as sa, aI as ns, aJ as ta, aK as Be, aL as Ms, aM as aa, aN as na, aO as ra, aP as la, aQ as ia, aR as ts, aS as oa, aT as Ts, aU as ca, aV as As, aW as da, aX as ha, aY as ua, aZ as st, l as ma, C as xa, E as Es, d as pa, h as fa, i as ga, o as ja, a_ as ba, m as ya, a$ as va, b0 as Na, b1 as Ca, b2 as Ls, b3 as Sa, b4 as Ds, b5 as Is, K as ka, b6 as tt, b7 as wa, b8 as at, b9 as Ue, ba as nt, bb as Fa, bc as Oa, bd as za, be as Ma, bf as Ta, bg as Aa, bh as Ce, bi as q, bj as V, bk as vs, bl as R, bm as Ea, bn as La, bo as Da, bp as qs, bq as Ia, br as qa, bs as Va, bt as Ra, bu as _a } from "./index-YLj7M7ho.js";
2
+ import de, { useState as z, useEffect as $, useMemo as Ha, useRef as Ie } 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 _a = M("Activity", [
9
+ const Ba = M("Activity", [
10
10
  [
11
11
  "path",
12
12
  {
@@ -21,7 +21,7 @@ const _a = M("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 Ha = M("AreaChart", [
24
+ const $a = M("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 Ha = M("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 vs = M("BarChart4", [
34
+ const Ns = M("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,16 +43,7 @@ const vs = M("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 Ba = M("Bookmark", [
47
- ["path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z", key: "1fy3hk" }]
48
- ]);
49
- /**
50
- * @license lucide-react v0.379.0 - ISC
51
- *
52
- * This source code is licensed under the ISC license.
53
- * See the LICENSE file in the root directory of this source tree.
54
- */
55
- const $a = M("CircleX", [
46
+ const Ka = M("CircleX", [
56
47
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
57
48
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
58
49
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -63,7 +54,7 @@ const $a = M("CircleX", [
63
54
  * This source code is licensed under the ISC license.
64
55
  * See the LICENSE file in the root directory of this source tree.
65
56
  */
66
- const Ka = M("Database", [
57
+ const Ua = M("Database", [
67
58
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
68
59
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
69
60
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -74,7 +65,7 @@ const Ka = M("Database", [
74
65
  * This source code is licensed under the ISC license.
75
66
  * See the LICENSE file in the root directory of this source tree.
76
67
  */
77
- const Ua = M("Eraser", [
68
+ const Ga = M("Eraser", [
78
69
  [
79
70
  "path",
80
71
  {
@@ -100,7 +91,7 @@ const rt = M("Filter", [
100
91
  * This source code is licensed under the ISC license.
101
92
  * See the LICENSE file in the root directory of this source tree.
102
93
  */
103
- const Ga = M("Glasses", [
94
+ const Ja = M("Glasses", [
104
95
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
105
96
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
106
97
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -113,7 +104,7 @@ const Ga = M("Glasses", [
113
104
  * This source code is licensed under the ISC license.
114
105
  * See the LICENSE file in the root directory of this source tree.
115
106
  */
116
- const Ja = M("GripVertical", [
107
+ const Qa = M("GripVertical", [
117
108
  ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
118
109
  ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
119
110
  ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
@@ -127,7 +118,7 @@ const Ja = M("GripVertical", [
127
118
  * This source code is licensed under the ISC license.
128
119
  * See the LICENSE file in the root directory of this source tree.
129
120
  */
130
- const Qa = M("Hammer", [
121
+ const Wa = M("Hammer", [
131
122
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
132
123
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
133
124
  [
@@ -144,7 +135,7 @@ const Qa = M("Hammer", [
144
135
  * This source code is licensed under the ISC license.
145
136
  * See the LICENSE file in the root directory of this source tree.
146
137
  */
147
- const Wa = M("Hash", [
138
+ const Pa = M("Hash", [
148
139
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
149
140
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
150
141
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -156,7 +147,7 @@ const Wa = M("Hash", [
156
147
  * This source code is licensed under the ISC license.
157
148
  * See the LICENSE file in the root directory of this source tree.
158
149
  */
159
- const Pa = M("Key", [
150
+ const Ya = M("Key", [
160
151
  ["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" }],
161
152
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
162
153
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -167,7 +158,7 @@ const Pa = M("Key", [
167
158
  * This source code is licensed under the ISC license.
168
159
  * See the LICENSE file in the root directory of this source tree.
169
160
  */
170
- const Ns = M("LineChart", [
161
+ const Cs = M("LineChart", [
171
162
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
172
163
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
173
164
  ]);
@@ -177,7 +168,7 @@ const Ns = M("LineChart", [
177
168
  * This source code is licensed under the ISC license.
178
169
  * See the LICENSE file in the root directory of this source tree.
179
170
  */
180
- const Ya = M("ListEnd", [
171
+ const Xa = M("ListEnd", [
181
172
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
182
173
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
183
174
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -190,7 +181,7 @@ const Ya = M("ListEnd", [
190
181
  * This source code is licensed under the ISC license.
191
182
  * See the LICENSE file in the root directory of this source tree.
192
183
  */
193
- const Xa = M("ListStart", [
184
+ const Za = M("ListStart", [
194
185
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
195
186
  ["path", { d: "M16 18H3", key: "12xzn7" }],
196
187
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -203,7 +194,7 @@ const Xa = M("ListStart", [
203
194
  * This source code is licensed under the ISC license.
204
195
  * See the LICENSE file in the root directory of this source tree.
205
196
  */
206
- const Za = M("ListX", [
197
+ const en = M("ListX", [
207
198
  ["path", { d: "M11 12H3", key: "51ecnj" }],
208
199
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
209
200
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -216,7 +207,7 @@ const Za = M("ListX", [
216
207
  * This source code is licensed under the ISC license.
217
208
  * See the LICENSE file in the root directory of this source tree.
218
209
  */
219
- const en = M("MessageSquareMore", [
210
+ const sn = M("MessageSquareMore", [
220
211
  ["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" }],
221
212
  ["path", { d: "M8 10h.01", key: "19clt8" }],
222
213
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -228,7 +219,7 @@ const en = M("MessageSquareMore", [
228
219
  * This source code is licensed under the ISC license.
229
220
  * See the LICENSE file in the root directory of this source tree.
230
221
  */
231
- const sn = M("Network", [
222
+ const tn = M("Network", [
232
223
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
233
224
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
234
225
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -261,7 +252,7 @@ const it = M("PieChart", [
261
252
  * This source code is licensed under the ISC license.
262
253
  * See the LICENSE file in the root directory of this source tree.
263
254
  */
264
- const tn = M("Play", [
255
+ const an = M("Play", [
265
256
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
266
257
  ]);
267
258
  /**
@@ -270,7 +261,7 @@ const tn = M("Play", [
270
261
  * This source code is licensed under the ISC license.
271
262
  * See the LICENSE file in the root directory of this source tree.
272
263
  */
273
- const an = M("Plug2", [
264
+ const nn = M("Plug2", [
274
265
  ["path", { d: "M9 2v6", key: "17ngun" }],
275
266
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
276
267
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -293,7 +284,7 @@ const ot = M("Plus", [
293
284
  * This source code is licensed under the ISC license.
294
285
  * See the LICENSE file in the root directory of this source tree.
295
286
  */
296
- const nn = M("Save", [
287
+ const rn = M("Save", [
297
288
  [
298
289
  "path",
299
290
  {
@@ -324,7 +315,7 @@ const ct = M("ScatterChart", [
324
315
  * This source code is licensed under the ISC license.
325
316
  * See the LICENSE file in the root directory of this source tree.
326
317
  */
327
- const rn = M("ShieldQuestion", [
318
+ const ln = M("ShieldQuestion", [
328
319
  [
329
320
  "path",
330
321
  {
@@ -341,19 +332,7 @@ const rn = M("ShieldQuestion", [
341
332
  * This source code is licensed under the ISC license.
342
333
  * See the LICENSE file in the root directory of this source tree.
343
334
  */
344
- const Cs = M("Table", [
345
- ["path", { d: "M12 3v18", key: "108xh3" }],
346
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
347
- ["path", { d: "M3 9h18", key: "1pudct" }],
348
- ["path", { d: "M3 15h18", key: "5xshup" }]
349
- ]);
350
- /**
351
- * @license lucide-react v0.379.0 - ISC
352
- *
353
- * This source code is licensed under the ISC license.
354
- * See the LICENSE file in the root directory of this source tree.
355
- */
356
- const ln = M("Tag", [
335
+ const on = M("Tag", [
357
336
  [
358
337
  "path",
359
338
  {
@@ -369,7 +348,7 @@ const ln = M("Tag", [
369
348
  * This source code is licensed under the ISC license.
370
349
  * See the LICENSE file in the root directory of this source tree.
371
350
  */
372
- const on = M("ToggleLeft", [
351
+ const cn = M("ToggleLeft", [
373
352
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
374
353
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
375
354
  ]);
@@ -379,7 +358,7 @@ const on = M("ToggleLeft", [
379
358
  * This source code is licensed under the ISC license.
380
359
  * See the LICENSE file in the root directory of this source tree.
381
360
  */
382
- const cn = M("Type", [
361
+ const dn = M("Type", [
383
362
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
384
363
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
385
364
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -390,14 +369,14 @@ const cn = M("Type", [
390
369
  * This source code is licensed under the ISC license.
391
370
  * See the LICENSE file in the root directory of this source tree.
392
371
  */
393
- const dn = M("User", [
372
+ const hn = M("User", [
394
373
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
395
374
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
396
375
  ]);
397
- function hn() {
398
- const [s, n] = z(""), [t, a] = z(!1), [l, o] = z(!1), r = S((c) => c.dashboard);
376
+ function un() {
377
+ const [s, n] = z(""), [t, a] = z(!1), [i, o] = z(!1), r = S((c) => c.dashboard);
399
378
  function d() {
400
- const c = $s(r), m = Oe(r.id), h = JSON.parse(localStorage.getItem(m) || "[]");
379
+ const c = $s(r), m = ze(r.id), h = JSON.parse(localStorage.getItem(m) || "[]");
401
380
  if (h.some(
402
381
  (g) => g.name === s
403
382
  )) {
@@ -409,9 +388,9 @@ function hn() {
409
388
  template: c
410
389
  }), localStorage.setItem(m, JSON.stringify(h)), o(!1);
411
390
  }
412
- return /* @__PURE__ */ e.jsxs(is, { open: l, onOpenChange: o, children: [
391
+ return /* @__PURE__ */ e.jsxs(is, { open: i, onOpenChange: o, children: [
413
392
  /* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
414
- k,
393
+ w,
415
394
  {
416
395
  variant: "outline",
417
396
  className: "h-7 p-2",
@@ -428,9 +407,9 @@ function hn() {
428
407
  /* @__PURE__ */ e.jsx(us, { children: "Lenses are private by default and are only visible to you." })
429
408
  ] }),
430
409
  /* @__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: [
431
- /* @__PURE__ */ e.jsx(_, { className: "text-right", children: "Name" }),
410
+ /* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
432
411
  /* @__PURE__ */ e.jsx(
433
- Q,
412
+ W,
434
413
  {
435
414
  value: s,
436
415
  onChange: (c) => {
@@ -443,7 +422,7 @@ function hn() {
443
422
  ] }) }),
444
423
  t && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
445
424
  /* @__PURE__ */ e.jsx(Bs, { children: /* @__PURE__ */ e.jsx(
446
- k,
425
+ w,
447
426
  {
448
427
  variant: "outline",
449
428
  type: "submit",
@@ -455,57 +434,57 @@ function hn() {
455
434
  ] })
456
435
  ] });
457
436
  }
458
- function un() {
459
- const [s, n] = z(!1), [t, a] = z(""), l = S((p) => p.dashboard), o = S((p) => p.bookmarkKey), [r, d] = z([]), c = S((p) => p.actions.setDashboard), m = S(
460
- (p) => p.actions.setFilterValues
437
+ function mn() {
438
+ const [s, n] = z(!1), [t, a] = z(""), i = S((f) => f.dashboard), o = S((f) => f.bookmarkKey), [r, d] = z([]), c = S((f) => f.actions.setDashboard), m = S(
439
+ (f) => f.actions.setFilterValues
461
440
  ), h = S(
462
- (p) => p.actions.setBookmarkKey
441
+ (f) => f.actions.setBookmarkKey
463
442
  );
464
443
  $(() => {
465
- const p = Oe(l.id), j = JSON.parse(localStorage.getItem(p) || "[]");
444
+ const f = ze(i.id), j = JSON.parse(localStorage.getItem(f) || "[]");
466
445
  d(j);
467
446
  const C = j.find(
468
447
  (v) => v.default
469
448
  );
470
449
  C && C.name === o && a(C.name);
471
- }, [s, l, o]);
472
- function u(p) {
473
- if (p === t)
450
+ }, [s, i, o]);
451
+ function u(f) {
452
+ if (f === t)
474
453
  return;
475
- const j = r.find((v) => v.name === p), C = j == null ? void 0 : j.template;
476
- C && (c(C), m(j.filterValues || []), h(p === "Original" ? "" : p)), a(p);
454
+ const j = r.find((v) => v.name === f), C = j == null ? void 0 : j.template;
455
+ C && (c(C), m(j.filterValues || []), h(f === "Original" ? "" : f)), a(f);
477
456
  }
478
- function g(p) {
479
- const j = Oe(l.id), v = JSON.parse(localStorage.getItem(j) || "[]").filter(
480
- (y) => y.name !== p
457
+ function g(f) {
458
+ const j = ze(i.id), v = JSON.parse(localStorage.getItem(j) || "[]").filter(
459
+ (b) => b.name !== f
481
460
  );
482
461
  localStorage.setItem(j, JSON.stringify(v)), d(v);
483
462
  }
484
- return /* @__PURE__ */ e.jsxs(At, { open: s, onOpenChange: n, children: [
485
- /* @__PURE__ */ e.jsx(Et, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Ga, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
486
- /* @__PURE__ */ e.jsxs(Lt, { className: "w-56", children: [
487
- /* @__PURE__ */ e.jsx(Dt, { children: "Lenses" }),
488
- /* @__PURE__ */ e.jsx(It, {}),
463
+ return /* @__PURE__ */ e.jsxs(Et, { open: s, onOpenChange: n, children: [
464
+ /* @__PURE__ */ e.jsx(Lt, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Ja, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
465
+ /* @__PURE__ */ e.jsxs(Dt, { className: "w-56", children: [
466
+ /* @__PURE__ */ e.jsx(It, { children: "Lenses" }),
467
+ /* @__PURE__ */ e.jsx(qt, {}),
489
468
  /* @__PURE__ */ e.jsxs(
490
- qt,
469
+ Vt,
491
470
  {
492
471
  value: t,
493
472
  onValueChange: u,
494
473
  children: [
495
474
  /* @__PURE__ */ e.jsx(Os, { value: "Original", children: "Original" }),
496
- r.filter((p) => p.name != "Original").map((p, j) => /* @__PURE__ */ e.jsxs(
475
+ r.filter((f) => f.name != "Original").map((f, j) => /* @__PURE__ */ e.jsxs(
497
476
  Os,
498
477
  {
499
478
  className: "xbg-red-100 flex justify-between",
500
- value: p.name,
501
- defaultChecked: p.name === o,
479
+ value: f.name,
480
+ defaultChecked: f.name === o,
502
481
  children: [
503
- /* @__PURE__ */ e.jsx("p", { children: p.name }),
482
+ /* @__PURE__ */ e.jsx("p", { children: f.name }),
504
483
  /* @__PURE__ */ e.jsx(
505
- Ee,
484
+ Le,
506
485
  {
507
486
  onClick: (C) => {
508
- C.preventDefault(), g(p.name);
487
+ C.preventDefault(), g(f.name);
509
488
  },
510
489
  className: "h-3 w-3 hover:cursor-pointer",
511
490
  strokeWidth: 1.5
@@ -521,24 +500,24 @@ function un() {
521
500
  ] })
522
501
  ] });
523
502
  }
524
- function mn() {
503
+ function xn() {
525
504
  const [s, n] = z(!1), t = S((o) => o.dashboard), a = S((o) => o.bookmarkKey);
526
505
  $(() => {
527
506
  if (!a) {
528
507
  n(!1);
529
508
  return;
530
509
  }
531
- const o = Oe(t.id), d = JSON.parse(
510
+ const o = ze(t.id), d = JSON.parse(
532
511
  localStorage.getItem(o) || "[]"
533
512
  ).find(
534
513
  (c) => c.name === a
535
514
  );
536
515
  n(d ? d.default : !1);
537
516
  }, [a, t.id]);
538
- function l(o) {
517
+ function i(o) {
539
518
  if (n(o), !a)
540
519
  return;
541
- const r = Oe(t.id), c = JSON.parse(
520
+ const r = ze(t.id), c = JSON.parse(
542
521
  localStorage.getItem(r) || "[]"
543
522
  ).map((m) => (m.name === a ? m.default = o : m.default = !1, m));
544
523
  console.log(c), localStorage.setItem(r, JSON.stringify(c));
@@ -548,7 +527,7 @@ function mn() {
548
527
  Qe,
549
528
  {
550
529
  checked: s,
551
- onCheckedChange: l,
530
+ onCheckedChange: i,
552
531
  id: "terms"
553
532
  }
554
533
  ),
@@ -562,23 +541,23 @@ function mn() {
562
541
  )
563
542
  ] });
564
543
  }
565
- function xn() {
566
- const s = S((y) => y.bookmarkKey), n = S((y) => y.dashboard);
567
- S((y) => y.selectedSheetId);
544
+ function pn() {
545
+ const s = S((b) => b.bookmarkKey), n = S((b) => b.dashboard);
546
+ S((b) => b.selectedSheetId);
568
547
  const t = S(
569
- (y) => y.isDashboardEditing
570
- ), a = S((y) => y.filterValues), l = S((y) => y.isVisualEditing), o = S((y) => y.showFilters);
548
+ (b) => b.isDashboardEditing
549
+ ), a = S((b) => b.filterValues), i = S((b) => b.isVisualEditing), o = S((b) => b.showFilters);
571
550
  S(
572
- (y) => y.showDashboardJSON
551
+ (b) => b.showDashboardJSON
573
552
  );
574
- const r = S((y) => y.onSaveFunction), d = S(
575
- (y) => y.actions.setShowFilters
553
+ const r = S((b) => b.onSaveFunction), d = S(
554
+ (b) => b.actions.setShowFilters
576
555
  ), { addFrame: c, setSelectedFrameId: m } = S(
577
- (y) => y.actions
578
- ), { getSelectedSheet: h, setIsDashboardEditing: u, setShowDashboardJSON: g } = S((y) => y.actions), p = h(), j = () => {
579
- if (!t || !p)
556
+ (b) => b.actions
557
+ ), { getSelectedSheet: h, setIsDashboardEditing: u, setShowDashboardJSON: g } = S((b) => b.actions), f = h(), j = () => {
558
+ if (!t || !f)
580
559
  return;
581
- const y = {
560
+ const b = {
582
561
  id: $e(),
583
562
  title: "Title",
584
563
  description: "Description",
@@ -593,50 +572,50 @@ function xn() {
593
572
  type: "bar",
594
573
  sql: "select COUNT(*) from YOUR_TABLE",
595
574
  data: []
596
- }, D = {
575
+ }, E = {
597
576
  id: $e(),
598
- cards: [y],
599
- activeCardId: y.id
577
+ cards: [b],
578
+ activeCardId: b.id
600
579
  };
601
- c(p.id, D), m(D.id);
580
+ c(f.id, E), m(E.id);
602
581
  }, C = () => {
603
582
  u(!0);
604
583
  };
605
584
  function v() {
606
585
  if (!s || s === "")
607
586
  return;
608
- const y = $s(n), D = Oe(n.id), A = JSON.parse(localStorage.getItem(D) || "[]"), f = A.findIndex(
609
- (O) => O.name === s
587
+ const b = $s(n), E = ze(n.id), T = JSON.parse(localStorage.getItem(E) || "[]"), O = T.findIndex(
588
+ (y) => y.name === s
610
589
  );
611
- f !== -1 ? A[f] = {
590
+ O !== -1 ? T[O] = {
612
591
  name: s,
613
- template: y,
614
- default: A[f].default,
592
+ template: b,
593
+ default: T[O].default,
615
594
  filterValues: a
616
- } : A.push({
595
+ } : T.push({
617
596
  name: s,
618
- template: y,
597
+ template: b,
619
598
  filterValues: a
620
- }), localStorage.setItem(D, JSON.stringify(A)), r == null || r(y);
599
+ }), localStorage.setItem(E, JSON.stringify(T)), r == null || r(b);
621
600
  }
622
- return l ? null : /* @__PURE__ */ e.jsxs(
601
+ return i ? null : /* @__PURE__ */ e.jsxs(
623
602
  "div",
624
603
  {
625
604
  className: "flex items-center justify-between gap-2 px-2 pt-2",
626
605
  role: "dashboard-controls",
627
606
  children: [
628
- !l && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
629
- /* @__PURE__ */ e.jsx(_, { children: s }),
607
+ !i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
608
+ /* @__PURE__ */ e.jsx(H, { children: s }),
630
609
  !!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
631
610
  /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
632
- /* @__PURE__ */ e.jsx(mn, {})
611
+ /* @__PURE__ */ e.jsx(xn, {})
633
612
  ] })
634
613
  ] }),
635
614
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
636
- t && !l && /* @__PURE__ */ e.jsx(hn, {}),
637
- !l && /* @__PURE__ */ e.jsx(un, {}),
638
- t && !l && /* @__PURE__ */ e.jsxs(
639
- k,
615
+ t && !i && /* @__PURE__ */ e.jsx(un, {}),
616
+ !i && /* @__PURE__ */ e.jsx(mn, {}),
617
+ t && !i && /* @__PURE__ */ e.jsxs(
618
+ w,
640
619
  {
641
620
  variant: "outline",
642
621
  className: "h-7 p-2",
@@ -650,7 +629,7 @@ function xn() {
650
629
  }
651
630
  ),
652
631
  !t && /* @__PURE__ */ e.jsx(
653
- k,
632
+ w,
654
633
  {
655
634
  variant: "outline",
656
635
  className: "h-7 p-2",
@@ -659,8 +638,8 @@ function xn() {
659
638
  children: /* @__PURE__ */ e.jsx(lt, { className: "h-4 w-4", strokeWidth: 1.5 })
660
639
  }
661
640
  ),
662
- t && !l && /* @__PURE__ */ e.jsx(
663
- k,
641
+ t && !i && /* @__PURE__ */ e.jsx(
642
+ w,
664
643
  {
665
644
  variant: "outline",
666
645
  role: "close",
@@ -669,21 +648,21 @@ function xn() {
669
648
  u(!1), g(!1);
670
649
  },
671
650
  size: "sm",
672
- children: /* @__PURE__ */ e.jsx(Ee, { className: "h-4 w-4", strokeWidth: 1.5 })
651
+ children: /* @__PURE__ */ e.jsx(Le, { className: "h-4 w-4", strokeWidth: 1.5 })
673
652
  }
674
653
  ),
675
- t && !l && /* @__PURE__ */ e.jsx(
676
- k,
654
+ t && !i && /* @__PURE__ */ e.jsx(
655
+ w,
677
656
  {
678
657
  className: "h-7 p-2",
679
658
  variant: "outline",
680
659
  onClick: v,
681
660
  size: "sm",
682
- children: /* @__PURE__ */ e.jsx(nn, { className: "h-4 w-4", strokeWidth: 1.5 })
661
+ children: /* @__PURE__ */ e.jsx(rn, { className: "h-4 w-4", strokeWidth: 1.5 })
683
662
  }
684
663
  ),
685
- !o && !l && t && /* @__PURE__ */ e.jsx(
686
- k,
664
+ !o && !i && t && /* @__PURE__ */ e.jsx(
665
+ w,
687
666
  {
688
667
  className: "h-7 p-2",
689
668
  variant: "outline",
@@ -692,8 +671,8 @@ function xn() {
692
671
  children: /* @__PURE__ */ e.jsx(rt, { className: "h-4 w-4", strokeWidth: 1.5 })
693
672
  }
694
673
  ),
695
- !l && t && !1,
696
- !l && !1
674
+ !i && t && !1,
675
+ !i && !1
697
676
  ] })
698
677
  ]
699
678
  }
@@ -704,23 +683,23 @@ function He({
704
683
  items: n,
705
684
  value: t,
706
685
  isLoading: a,
707
- isError: l,
686
+ isError: i,
708
687
  connectionTooltip: o,
709
688
  onChange: r,
710
689
  className: d,
711
690
  showIcon: c = !0,
712
691
  disabled: m = !1
713
692
  }) {
714
- const h = a ? "Loading..." : l ? "Error" : t;
693
+ const h = a ? "Loading..." : i ? "Error" : t;
715
694
  function u() {
716
695
  if (s === "Connection")
717
- return /* @__PURE__ */ e.jsx(an, { className: "size-4 rotate-90" });
696
+ return /* @__PURE__ */ e.jsx(nn, { className: "size-4 rotate-90" });
718
697
  if (s === "Database")
719
- return /* @__PURE__ */ e.jsx(Ka, { className: "size-4" });
698
+ return /* @__PURE__ */ e.jsx(Ua, { className: "size-4" });
720
699
  if (s === "Schema")
721
- return /* @__PURE__ */ e.jsx(sn, { className: "size-4" });
700
+ return /* @__PURE__ */ e.jsx(tn, { className: "size-4" });
722
701
  if (s === "Table")
723
- return /* @__PURE__ */ e.jsx(Cs, { className: "size-4" });
702
+ return /* @__PURE__ */ e.jsx(bs, { className: "size-4" });
724
703
  }
725
704
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
726
705
  c && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(We, { children: [
@@ -731,44 +710,44 @@ function He({
731
710
  /* @__PURE__ */ e.jsx(
732
711
  ps,
733
712
  {
734
- className: W(
713
+ className: K(
735
714
  "h-9 w-[190px] focus:ring-1 focus:ring-offset-0",
736
715
  d
737
716
  ),
738
717
  children: /* @__PURE__ */ e.jsx(
739
718
  fs,
740
719
  {
741
- placeholder: a ? "Loading..." : l ? "Error" : `Select ${s}`
720
+ placeholder: a ? "Loading..." : i ? "Error" : `Select ${s}`
742
721
  }
743
722
  )
744
723
  }
745
724
  ),
746
725
  /* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsxs(js, { children: [
747
726
  a ? /* @__PURE__ */ e.jsx(Ke, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Ke, { children: s }),
748
- /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((g, p) => /* @__PURE__ */ e.jsx(me, { value: g.id, children: g.name }, p)) }),
749
- (a || l) && /* @__PURE__ */ e.jsx(me, { value: h, children: h })
727
+ /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((g, f) => /* @__PURE__ */ e.jsx(xe, { value: g.id, children: g.name }, f)) }),
728
+ (a || i) && /* @__PURE__ */ e.jsx(xe, { value: h, children: h })
750
729
  ] }) })
751
730
  ] })
752
731
  ] });
753
732
  }
754
- function pn({ column: s }) {
755
- const [n, t] = z(!1), a = i((h) => h.selectedTableName), l = i(
733
+ function fn({ column: s }) {
734
+ const [n, t] = z(!1), a = l((h) => h.selectedTableName), i = l(
756
735
  (h) => h.selectedSchemaName
757
- ), o = i((h) => h.sqlGen), r = i((h) => h.actions.setSqlGen), d = i((h) => h.actions.setCardSql), c = i((h) => h.actions.setRunSql);
736
+ ), o = l((h) => h.sqlGen), r = l((h) => h.actions.setSqlGen), d = l((h) => h.actions.setCardSql), c = l((h) => h.actions.setRunSql);
758
737
  function m(h, u) {
759
738
  const g = Ks(h, o, u);
760
739
  r(g);
761
- const p = Us(
740
+ const f = Us(
762
741
  g,
763
- oe(l || ""),
764
- oe(a)
742
+ ce(i || ""),
743
+ ce(a)
765
744
  );
766
- p && (d(p), c(!0)), t(!1);
745
+ f && (d(f), c(!0)), t(!1);
767
746
  }
768
- return /* @__PURE__ */ e.jsxs(Ie, { open: n, onOpenChange: t, children: [
769
- /* @__PURE__ */ e.jsx(qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(Vt, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
747
+ return /* @__PURE__ */ e.jsxs(qe, { open: n, onOpenChange: t, children: [
748
+ /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(Rt, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
770
749
  /* @__PURE__ */ e.jsx(
771
- Ve,
750
+ Re,
772
751
  {
773
752
  align: "center",
774
753
  className: "w-18 rounded-md p-0 shadow-none",
@@ -820,140 +799,154 @@ function pn({ column: s }) {
820
799
  }
821
800
  function dt({ column: s }) {
822
801
  return /* @__PURE__ */ e.jsxs(We, { children: [
823
- /* @__PURE__ */ e.jsx(Rt, { asChild: !0, children: _t.includes(s.data_type.toLowerCase()) ? (
802
+ /* @__PURE__ */ e.jsx(_t, { asChild: !0, children: Ht.includes(s.data_type.toLowerCase()) ? (
824
803
  // <span className=" font-thin">T</span>
825
- /* @__PURE__ */ e.jsx(cn, { className: "size-3" })
804
+ /* @__PURE__ */ e.jsx(dn, { className: "size-3" })
826
805
  ) : Gs.includes(s.data_type.toLowerCase()) ? (
827
806
  //
828
- /* @__PURE__ */ e.jsx(Wa, { className: "size-3" })
829
- ) : Ht.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Bt, { className: "size-3" }) : $t.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(on, { className: "size-3" }) : /* @__PURE__ */ e.jsx(rn, { className: "size-3" }) }),
807
+ /* @__PURE__ */ e.jsx(Pa, { className: "size-3" })
808
+ ) : Bt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx($t, { className: "size-3" }) : Kt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(cn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(ln, { className: "size-3" }) }),
830
809
  /* @__PURE__ */ e.jsx(Pe, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
831
810
  ] });
832
811
  }
833
- function fn({
812
+ function gn({
834
813
  schemaName: s,
835
814
  tableName: n,
836
815
  columns: t,
837
816
  status: a
838
817
  }) {
839
- const l = i((f) => f.sqlGen), o = i(
840
- (f) => f.selectedConnectionId
841
- ), r = i(
842
- (f) => f.selectedDatabaseName
843
- ), d = i(
844
- (f) => f.selectedSchemaName
845
- ), c = i((f) => f.selectedTableName), m = S(
846
- (f) => f.dashboard.aiScopeTables
847
- ), { setAIScopeTables: h } = S((f) => f.actions), u = i((f) => f.actions.setRunSql), g = i((f) => f.actions.setSqlGen), p = i(
848
- (f) => f.actions.setIsShowingVisual
849
- ), j = i((f) => f.actions.setCardSql), { connectionType: C } = ht();
850
- function v(f) {
851
- const O = Ks(f, l);
852
- g(O);
853
- const T = Us(O, oe(s), oe(n));
854
- T && (j(T), u(!0));
818
+ const i = l((y) => y.sqlGen), o = l(
819
+ (y) => y.selectedConnectionId
820
+ ), r = l(
821
+ (y) => y.selectedDatabaseName
822
+ ), d = l(
823
+ (y) => y.selectedSchemaName
824
+ ), c = l((y) => y.selectedTableName), m = S(
825
+ (y) => y.dashboard.aiScopeTables
826
+ ), { setAIScopeTables: h } = S((y) => y.actions), u = l((y) => y.actions.setRunSql), g = l((y) => y.actions.setSqlGen), f = l(
827
+ (y) => y.actions.setIsShowingVisual
828
+ ), j = l((y) => y.actions.setCardSql), { connectionType: C } = ht();
829
+ function v(y) {
830
+ const F = Ks(y, i);
831
+ g(F);
832
+ const A = Us(F, ce(s), ce(n));
833
+ A && (j(A), u(!0));
855
834
  }
856
- function y(f) {
857
- if (f === !0 && c && o) {
858
- const O = {
835
+ function b() {
836
+ return (m == null ? void 0 : m.find(
837
+ (y) => y.connectinonId === o && y.tableName === c
838
+ )) !== void 0;
839
+ }
840
+ function E(y) {
841
+ if (y === !0 && c && o) {
842
+ const F = {
859
843
  connectinonId: o,
860
844
  connectionType: C,
861
845
  databaseName: r,
862
846
  schemaName: d,
863
847
  tableName: c
864
- }, E = [...m || [], O].filter(
865
- (U, Z, G) => G.findIndex(
866
- (H) => H.connectinonId === U.connectinonId && H.tableName === U.tableName
867
- ) === Z
848
+ }, I = [...m || [], F].filter(
849
+ (P, U, G) => G.findIndex(
850
+ (L) => L.connectinonId === P.connectinonId && L.tableName === P.tableName
851
+ ) === U
868
852
  );
869
- h(E);
853
+ h(I);
870
854
  } else {
871
- const O = (m || []).filter(
872
- (T) => T.connectinonId !== o && T.tableName !== c
855
+ const F = (m || []).filter(
856
+ (A) => A.connectinonId !== o && A.tableName !== c
873
857
  );
874
- h(O);
858
+ h(F);
875
859
  }
876
860
  }
877
- function D() {
878
- let O = as(s, n);
879
- ((E) => E.charAt(0) === E.charAt(0).toUpperCase())(n) && (O = `"${n}"`), p(!1), j(`SELECT * FROM ${O} LIMIT 10`), u(!0);
861
+ function T() {
862
+ let F = as(s, n);
863
+ ((I) => I.charAt(0) === I.charAt(0).toUpperCase())(n) && (F = `"${n}"`), f(!1), j(`SELECT * FROM ${F} LIMIT 10`), u(!0);
880
864
  }
881
- function A() {
882
- let O = as(s, n);
883
- ((E) => E.charAt(0) === E.charAt(0).toUpperCase())(n) && (O = `"${n}"`), p(!1), j(`SELECT COUNT(*) FROM ${O}`), u(!0);
865
+ function O() {
866
+ let F = as(s, n);
867
+ ((I) => I.charAt(0) === I.charAt(0).toUpperCase())(n) && (F = `"${n}"`), f(!1), j(`SELECT COUNT(*) FROM ${F}`), u(!0);
884
868
  }
885
869
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-6", children: [
886
870
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
887
871
  /* @__PURE__ */ e.jsx(
888
872
  Js,
889
873
  {
890
- title: "Add to AI Scope",
891
- onPressedChange: y,
874
+ title: `${b() ? "Remove from" : "Add to"} AI Scope`,
875
+ pressed: b(),
876
+ onPressedChange: E,
892
877
  variant: "outline",
893
878
  className: "h-9 px-2",
894
- children: /* @__PURE__ */ e.jsx(Ba, { className: "size-4" })
879
+ children: /* @__PURE__ */ e.jsx(
880
+ Ut,
881
+ {
882
+ className: K("size-4", {
883
+ "text-primary": b(),
884
+ "text-muted-foreground": !b()
885
+ })
886
+ }
887
+ )
895
888
  }
896
889
  ),
897
890
  /* @__PURE__ */ e.jsxs(
898
- k,
891
+ w,
899
892
  {
900
893
  disabled: a !== "Success",
901
- onClick: D,
894
+ onClick: T,
902
895
  size: "sm",
903
896
  variant: "secondary",
904
897
  className: "flex w-full",
905
898
  children: [
906
- a !== "Success" ? /* @__PURE__ */ e.jsx(Le, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : null,
899
+ a !== "Success" ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : null,
907
900
  "Top 10"
908
901
  ]
909
902
  }
910
903
  ),
911
904
  /* @__PURE__ */ e.jsxs(
912
- k,
905
+ w,
913
906
  {
914
907
  disabled: a !== "Success",
915
- onClick: A,
908
+ onClick: O,
916
909
  size: "sm",
917
910
  variant: "secondary",
918
911
  className: "flex w-full",
919
912
  children: [
920
- a !== "Success" ? /* @__PURE__ */ e.jsx(Le, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : null,
913
+ a !== "Success" ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : null,
921
914
  "Count"
922
915
  ]
923
916
  }
924
917
  )
925
918
  ] }),
926
919
  /* @__PURE__ */ e.jsxs(
927
- bs,
920
+ ys,
928
921
  {
929
922
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
930
923
  children: [
931
- t == null ? void 0 : t.map((f) => /* @__PURE__ */ e.jsxs(
924
+ t == null ? void 0 : t.map((y) => /* @__PURE__ */ e.jsxs(
932
925
  "div",
933
926
  {
934
- onClick: () => v(f),
935
- className: W(
927
+ onClick: () => v(y),
928
+ className: K(
936
929
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
937
930
  {
938
- "bg-muted": Kt(f, l)
931
+ "bg-muted": Gt(y, i)
939
932
  }
940
933
  ),
941
934
  children: [
942
935
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
943
- /* @__PURE__ */ e.jsx(dt, { column: f }),
944
- /* @__PURE__ */ e.jsx("span", { children: f.column_name })
936
+ /* @__PURE__ */ e.jsx(dt, { column: y }),
937
+ /* @__PURE__ */ e.jsx("span", { children: y.column_name })
945
938
  ] }),
946
- Gs.includes(f.data_type) && /* @__PURE__ */ e.jsx(
939
+ Gs.includes(y.data_type) && /* @__PURE__ */ e.jsx(
947
940
  "div",
948
941
  {
949
- onClick: (O) => O.stopPropagation(),
942
+ onClick: (F) => F.stopPropagation(),
950
943
  className: "flex items-center justify-end",
951
- children: /* @__PURE__ */ e.jsx(pn, { column: f })
944
+ children: /* @__PURE__ */ e.jsx(fn, { column: y })
952
945
  }
953
946
  )
954
947
  ]
955
948
  },
956
- f.column_name
949
+ y.column_name
957
950
  )),
958
951
  /* @__PURE__ */ e.jsx(zs, { orientation: "vertical" }),
959
952
  /* @__PURE__ */ e.jsx(zs, { orientation: "horizontal" })
@@ -963,130 +956,130 @@ function fn({
963
956
  ] });
964
957
  }
965
958
  function ht(s, n) {
966
- var Xe, ge, _e, Te;
967
- let t = Ra(() => [], []);
968
- const a = Ye().authToken || s, l = i(
959
+ var Xe, be, _e, Ae;
960
+ let t = Ha(() => [], []);
961
+ const a = Ye().authToken || s, i = l(
969
962
  (N) => N.selectedConnectionId
970
- ), o = i(
963
+ ), o = l(
971
964
  (N) => N.selectedDatabaseName
972
- ), r = i(
965
+ ), r = l(
973
966
  (N) => N.selectedSchemaName
974
- ), d = i((N) => N.selectedTableName), c = i(
967
+ ), d = l((N) => N.selectedTableName), c = l(
975
968
  (N) => N.actions.setCurrentColumns
976
- ), m = i(
969
+ ), m = l(
977
970
  (N) => N.actions.setSelectedConnectionId
978
- ), h = i(
971
+ ), h = l(
979
972
  (N) => N.actions.setSelectedDatabaseName
980
- ), u = i(
973
+ ), u = l(
981
974
  (N) => N.actions.setSelectedSchemaName
982
- ), g = i(
975
+ ), g = l(
983
976
  (N) => N.actions.setSelectedTableName
984
- ), p = i((N) => N.actions.setCardSql);
977
+ ), f = l((N) => N.actions.setCardSql);
985
978
  function j(N) {
986
- return l && o && r && o !== "NA" ? !0 : l && N === "API" ? !1 : !!(l && N === "S3");
979
+ return i && o && r && o !== "NA" ? !0 : i && N === "API" ? !1 : !!(i && N === "S3");
987
980
  }
988
981
  function C(N) {
989
- return !!(l && o && o !== "NA" && r && d || l && (N === "S3" || N === "API"));
982
+ return !!(i && o && o !== "NA" && r && d || i && (N === "S3" || N === "API"));
990
983
  }
991
984
  function v(N) {
992
- return l && N ? !(N === "API" || N === "S3") : !1;
985
+ return i && N ? !(N === "API" || N === "S3") : !1;
993
986
  }
994
987
  const {
995
- data: y,
996
- isLoading: D,
997
- isError: A
998
- } = ye({
988
+ data: b,
989
+ isLoading: E,
990
+ isError: T
991
+ } = Ne({
999
992
  queryKey: ["connections"],
1000
- queryFn: () => we(
993
+ queryFn: () => Fe(
1001
994
  "https://semaphor.cloud/api/v1/connections",
1002
995
  (a == null ? void 0 : a.accessToken) || ""
1003
996
  ),
1004
997
  enabled: !!(a != null && a.accessToken)
1005
998
  // Only fetch if authToken is present
1006
- }), f = y == null ? void 0 : y.connections.find(
1007
- (N) => N.id === l
1008
- ), O = f == null ? void 0 : f.type, T = (f == null ? void 0 : f.type) === "API" || (f == null ? void 0 : f.type) === "S3", {
1009
- data: E,
1010
- isLoading: U,
1011
- isFetching: Z,
1012
- isError: G,
1013
- refetch: H
1014
- } = ye({
1015
- queryKey: ["databases", l],
1016
- queryFn: () => we(
999
+ }), O = b == null ? void 0 : b.connections.find(
1000
+ (N) => N.id === i
1001
+ ), y = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1002
+ data: A,
1003
+ isLoading: I,
1004
+ isFetching: P,
1005
+ isError: U,
1006
+ refetch: G
1007
+ } = Ne({
1008
+ queryKey: ["databases", i],
1009
+ queryFn: () => Fe(
1017
1010
  "https://semaphor.cloud/api/v1/databases",
1018
1011
  (a == null ? void 0 : a.accessToken) || "",
1019
1012
  {
1020
- connection_id: l
1013
+ connection_id: i
1021
1014
  }
1022
1015
  ),
1023
- enabled: v(O)
1016
+ enabled: v(y)
1024
1017
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1025
1018
  }), {
1026
- data: I,
1019
+ data: L,
1027
1020
  isLoading: ee,
1028
- isFetching: P,
1021
+ isFetching: Y,
1029
1022
  isError: se,
1030
- refetch: X
1031
- } = ye({
1032
- queryKey: ["schemas", l, o],
1033
- queryFn: () => we(
1023
+ refetch: Z
1024
+ } = Ne({
1025
+ queryKey: ["schemas", i, o],
1026
+ queryFn: () => Fe(
1034
1027
  "https://semaphor.cloud/api/v1/schemas",
1035
1028
  (a == null ? void 0 : a.accessToken) || "",
1036
1029
  {
1037
- connection_id: l,
1030
+ connection_id: i,
1038
1031
  database_name: o
1039
1032
  }
1040
1033
  ),
1041
- enabled: !!l && !!o && !T && o !== "NA"
1034
+ enabled: !!i && !!o && !F && o !== "NA"
1042
1035
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1043
1036
  }), {
1044
- data: w,
1045
- isLoading: F,
1046
- isFetching: b,
1047
- isError: L,
1048
- refetch: K
1049
- } = ye({
1037
+ data: J,
1038
+ isLoading: D,
1039
+ isFetching: x,
1040
+ isError: k,
1041
+ refetch: _
1042
+ } = Ne({
1050
1043
  queryKey: [
1051
1044
  "tables",
1052
- l,
1045
+ i,
1053
1046
  o,
1054
1047
  r
1055
1048
  ],
1056
- queryFn: () => we(
1049
+ queryFn: () => Fe(
1057
1050
  "https://semaphor.cloud/api/v1/tables",
1058
1051
  (a == null ? void 0 : a.accessToken) || "",
1059
1052
  {
1060
- connection_id: l,
1053
+ connection_id: i,
1061
1054
  database_name: o,
1062
1055
  schema_name: r
1063
1056
  }
1064
1057
  ),
1065
- enabled: j(O)
1058
+ enabled: j(y)
1066
1059
  }), {
1067
1060
  data: B,
1068
- isLoading: de,
1061
+ isLoading: he,
1069
1062
  isFetching: te,
1070
- isError: xe
1071
- } = ye({
1063
+ isError: pe
1064
+ } = Ne({
1072
1065
  queryKey: [
1073
1066
  "columns",
1074
- l,
1067
+ i,
1075
1068
  o,
1076
1069
  r,
1077
1070
  d
1078
1071
  ],
1079
- queryFn: () => we(
1072
+ queryFn: () => Fe(
1080
1073
  "https://semaphor.cloud/api/v1/columns",
1081
1074
  (a == null ? void 0 : a.accessToken) || "",
1082
1075
  {
1083
- connection_id: l,
1076
+ connection_id: i,
1084
1077
  database_name: o,
1085
1078
  schema_name: r,
1086
1079
  table_name: d
1087
1080
  }
1088
1081
  ),
1089
- enabled: C(O)
1082
+ enabled: C(y)
1090
1083
  // (!!selectedConnectionId &&
1091
1084
  // !!selectedDatabaseName &&
1092
1085
  // !!selectedSchemaName &&
@@ -1099,80 +1092,80 @@ function ht(s, n) {
1099
1092
  c(t);
1100
1093
  }, [B, c, t]), $(() => {
1101
1094
  }, [
1102
- T,
1103
- p,
1095
+ F,
1096
+ f,
1104
1097
  g,
1105
1098
  u,
1106
1099
  h,
1107
- f
1100
+ O
1108
1101
  ]);
1109
- const pe = (f == null ? void 0 : f.type) === "API" ? (Xe = f == null ? void 0 : f.type) == null ? void 0 : Xe.toLowerCase() : d || "", fe = T ? "" : r || "";
1110
- function he(N) {
1102
+ const fe = (O == null ? void 0 : O.type) === "API" ? (Xe = O == null ? void 0 : O.type) == null ? void 0 : Xe.toLowerCase() : d || "", ge = F ? "" : r || "";
1103
+ function ue(N) {
1111
1104
  u(N), g("");
1112
1105
  }
1113
- function J(N) {
1106
+ function Q(N) {
1114
1107
  h(N), u(""), g("");
1115
1108
  }
1116
1109
  function ae(N) {
1117
1110
  m(N);
1118
1111
  }
1119
- E && ((ge = E == null ? void 0 : E.databases) == null ? void 0 : ge.length) > 0, I && ((_e = I == null ? void 0 : I.schemas) == null ? void 0 : _e.length) > 0, B && ((Te = B == null ? void 0 : B.columns) == null ? void 0 : Te.length) > 0 && (t = B.columns.map((N) => ({
1112
+ A && ((be = A == null ? void 0 : A.databases) == null ? void 0 : be.length) > 0, L && ((_e = L == null ? void 0 : L.schemas) == null ? void 0 : _e.length) > 0, B && ((Ae = B == null ? void 0 : B.columns) == null ? void 0 : Ae.length) > 0 && (t = B.columns.map((N) => ({
1120
1113
  ...N,
1121
1114
  data_type: N.data_type.toLowerCase()
1122
- }))), G && (t = []), (xe || A) && (t = []);
1123
- const Ce = y == null ? void 0 : y.connections.map(
1115
+ }))), U && (t = []), (pe || T) && (t = []);
1116
+ const ne = b == null ? void 0 : b.connections.map(
1124
1117
  (N) => ({
1125
1118
  id: N.id,
1126
1119
  name: N.name,
1127
1120
  type: N.type
1128
1121
  })
1129
- ), Re = E == null ? void 0 : E.databases.map((N) => ({
1122
+ ), je = A == null ? void 0 : A.databases.map((N) => ({
1130
1123
  id: N.database_name,
1131
1124
  name: N.database_name
1132
- })), Se = I == null ? void 0 : I.schemas.map((N) => ({
1125
+ })), ke = L == null ? void 0 : L.schemas.map((N) => ({
1133
1126
  id: N.schema_name,
1134
1127
  name: N.schema_name
1135
- })), Me = w == null ? void 0 : w.tables.map((N) => ({
1128
+ })), Te = J == null ? void 0 : J.tables.map((N) => ({
1136
1129
  id: N.table_name,
1137
1130
  name: N.table_name
1138
1131
  }));
1139
1132
  return {
1140
- connectionItems: Ce,
1141
- isConnectionsLoading: D,
1142
- isConnectionsError: A,
1143
- databaseItems: Re,
1144
- isDatabasesLoadingOrFetching: U || Z,
1145
- isDatabaseError: G,
1146
- schemaItems: Se,
1147
- isSchemaLoadingOrFetching: ee || P,
1133
+ connectionItems: ne,
1134
+ isConnectionsLoading: E,
1135
+ isConnectionsError: T,
1136
+ databaseItems: je,
1137
+ isDatabasesLoadingOrFetching: I || P,
1138
+ isDatabaseError: U,
1139
+ schemaItems: ke,
1140
+ isSchemaLoadingOrFetching: ee || Y,
1148
1141
  isSchemaError: se,
1149
- tableItems: Me,
1150
- isTableLoadingOrFetching: F || b,
1151
- isTableError: L,
1142
+ tableItems: Te,
1143
+ isTableLoadingOrFetching: D || x,
1144
+ isTableError: k,
1152
1145
  columns: t,
1153
- isColumnsLoadingOrFetching: de || te,
1154
- isColumnsError: xe,
1155
- isNonDbConnection: T,
1156
- connectionType: O,
1157
- tableName: pe,
1158
- schemaName: fe,
1146
+ isColumnsLoadingOrFetching: he || te,
1147
+ isColumnsError: pe,
1148
+ isNonDbConnection: F,
1149
+ connectionType: y,
1150
+ tableName: fe,
1151
+ schemaName: ge,
1159
1152
  handleConnectionChange: ae,
1160
- handleDatabaseChange: J,
1161
- handleSchemaChange: he
1153
+ handleDatabaseChange: Q,
1154
+ handleSchemaChange: ue
1162
1155
  };
1163
1156
  }
1164
1157
  function ut({
1165
1158
  ColumnsComponent: s
1166
1159
  }) {
1167
- var w;
1168
- const n = i(
1169
- (F) => F.selectedConnectionId
1170
- ), t = i(
1171
- (F) => F.selectedDatabaseName
1172
- ), a = i(
1173
- (F) => F.selectedSchemaName
1174
- ), l = i((F) => F.selectedTableName), o = i(
1175
- (F) => F.actions.setSelectedTableName
1160
+ var J;
1161
+ const n = l(
1162
+ (D) => D.selectedConnectionId
1163
+ ), t = l(
1164
+ (D) => D.selectedDatabaseName
1165
+ ), a = l(
1166
+ (D) => D.selectedSchemaName
1167
+ ), i = l((D) => D.selectedTableName), o = l(
1168
+ (D) => D.actions.setSelectedTableName
1176
1169
  ), {
1177
1170
  connectionItems: r,
1178
1171
  schemaItems: d,
@@ -1181,43 +1174,43 @@ function ut({
1181
1174
  columns: h,
1182
1175
  isConnectionsLoading: u,
1183
1176
  isConnectionsError: g,
1184
- isDatabasesLoadingOrFetching: p,
1177
+ isDatabasesLoadingOrFetching: f,
1185
1178
  isDatabaseError: j,
1186
1179
  isSchemaLoadingOrFetching: C,
1187
1180
  isSchemaError: v,
1188
- isColumnsError: y,
1189
- isColumnsLoadingOrFetching: D,
1190
- isTableLoadingOrFetching: A,
1191
- isTableError: f,
1192
- connectionType: O,
1193
- isNonDbConnection: T,
1194
- handleConnectionChange: E,
1195
- handleDatabaseChange: U,
1196
- handleSchemaChange: Z,
1197
- tableName: G,
1198
- schemaName: H
1181
+ isColumnsError: b,
1182
+ isColumnsLoadingOrFetching: E,
1183
+ isTableLoadingOrFetching: T,
1184
+ isTableError: O,
1185
+ connectionType: y,
1186
+ isNonDbConnection: F,
1187
+ handleConnectionChange: A,
1188
+ handleDatabaseChange: I,
1189
+ handleSchemaChange: P,
1190
+ tableName: U,
1191
+ schemaName: G
1199
1192
  } = ht();
1200
- function I() {
1201
- return s ? s(H, G, h) : /* @__PURE__ */ e.jsx(
1202
- fn,
1193
+ function L() {
1194
+ return s ? s(G, U, h) : /* @__PURE__ */ e.jsx(
1195
+ gn,
1203
1196
  {
1204
- schemaName: H,
1205
- tableName: G,
1197
+ schemaName: G,
1198
+ tableName: U,
1206
1199
  columns: h,
1207
- status: D ? "Loading..." : y ? "Error" : "Success"
1200
+ status: E ? "Loading..." : b ? "Error" : "Success"
1208
1201
  }
1209
1202
  );
1210
1203
  }
1211
1204
  function ee() {
1212
1205
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1213
1206
  }
1214
- function P() {
1215
- return O === "S3" || O === "API" ? null : /* @__PURE__ */ e.jsx(
1207
+ function Y() {
1208
+ return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
1216
1209
  He,
1217
1210
  {
1218
- onChange: U,
1211
+ onChange: I,
1219
1212
  isError: j,
1220
- isLoading: p,
1213
+ isLoading: f,
1221
1214
  items: c,
1222
1215
  value: t || "",
1223
1216
  title: "Database"
@@ -1225,10 +1218,10 @@ function ut({
1225
1218
  );
1226
1219
  }
1227
1220
  function se() {
1228
- return O === "S3" || O === "API" ? null : /* @__PURE__ */ e.jsx(
1221
+ return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
1229
1222
  He,
1230
1223
  {
1231
- onChange: Z,
1224
+ onChange: P,
1232
1225
  isError: v,
1233
1226
  isLoading: C,
1234
1227
  items: d,
@@ -1237,15 +1230,15 @@ function ut({
1237
1230
  }
1238
1231
  );
1239
1232
  }
1240
- function X() {
1241
- return O === "API" ? null : /* @__PURE__ */ e.jsx(
1233
+ function Z() {
1234
+ return y === "API" ? null : /* @__PURE__ */ e.jsx(
1242
1235
  He,
1243
1236
  {
1244
1237
  onChange: o,
1245
- isError: f,
1238
+ isError: O,
1246
1239
  items: m,
1247
- isLoading: A,
1248
- value: l || "",
1240
+ isLoading: T,
1241
+ value: i || "",
1249
1242
  title: "Table"
1250
1243
  }
1251
1244
  );
@@ -1258,28 +1251,28 @@ function ut({
1258
1251
  items: r,
1259
1252
  title: "Connection",
1260
1253
  value: n || "",
1261
- onChange: E,
1254
+ onChange: A,
1262
1255
  isLoading: u,
1263
1256
  isError: g,
1264
- connectionTooltip: ((w = r == null ? void 0 : r.find(
1265
- (F) => F.id === n
1266
- )) == null ? void 0 : w.type) || ""
1257
+ connectionTooltip: ((J = r == null ? void 0 : r.find(
1258
+ (D) => D.id === n
1259
+ )) == null ? void 0 : J.type) || ""
1267
1260
  }
1268
1261
  ),
1269
- P(),
1262
+ Y(),
1270
1263
  se(),
1271
- X()
1264
+ Z()
1272
1265
  ] }),
1273
- I(),
1266
+ L(),
1274
1267
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1275
- k,
1268
+ w,
1276
1269
  {
1277
1270
  onClick: ee,
1278
1271
  size: "sm",
1279
1272
  variant: "secondary",
1280
1273
  className: "w-full",
1281
1274
  children: [
1282
- /* @__PURE__ */ e.jsx(en, { className: "mr-2 size-4" }),
1275
+ /* @__PURE__ */ e.jsx(sn, { className: "mr-2 size-4" }),
1283
1276
  "Help"
1284
1277
  ]
1285
1278
  }
@@ -1290,33 +1283,33 @@ const rs = ({
1290
1283
  className: s,
1291
1284
  ...n
1292
1285
  }) => /* @__PURE__ */ e.jsx(
1293
- Ut,
1286
+ Jt,
1294
1287
  {
1295
- className: W(
1288
+ className: K(
1296
1289
  "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
1297
1290
  s
1298
1291
  ),
1299
1292
  ...n
1300
1293
  }
1301
- ), Fe = Gt, ls = ({
1294
+ ), Oe = Qt, ls = ({
1302
1295
  withHandle: s,
1303
1296
  className: n,
1304
1297
  ...t
1305
1298
  }) => /* @__PURE__ */ e.jsx(
1306
- Jt,
1299
+ Wt,
1307
1300
  {
1308
- className: W(
1301
+ className: K(
1309
1302
  "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
1310
1303
  n
1311
1304
  ),
1312
1305
  ...t,
1313
- children: s && /* @__PURE__ */ e.jsx("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ e.jsx(Ja, { className: "h-2.5 w-2.5" }) })
1306
+ children: s && /* @__PURE__ */ e.jsx("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ e.jsx(Qa, { className: "h-2.5 w-2.5" }) })
1314
1307
  }
1315
1308
  );
1316
- function gn(s) {
1317
- const n = s.toUpperCase().indexOf("WHERE"), t = s.toUpperCase().indexOf("GROUP BY"), a = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1309
+ function jn(s) {
1310
+ const n = s.toUpperCase().indexOf("WHERE"), t = s.toUpperCase().indexOf("GROUP BY"), a = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
1318
1311
  let o = s.length;
1319
- if (l !== -1 && (o = l), a !== -1 && a < o && (o = a), n !== -1) {
1312
+ if (i !== -1 && (o = i), a !== -1 && a < o && (o = a), n !== -1) {
1320
1313
  const r = s.substring(0, n), d = s.substring(n);
1321
1314
  return `${r} {{ filters | where }} AND ${d.substring(
1322
1315
  6
@@ -1329,17 +1322,17 @@ function gn(s) {
1329
1322
  return `${r} {{ filters | where }} ${d}`;
1330
1323
  }
1331
1324
  }
1332
- function jn({
1325
+ function bn({
1333
1326
  error: s,
1334
1327
  setShowAIDialog: n,
1335
1328
  setUserInputforAI: t,
1336
1329
  setTriggerAIRun: a
1337
1330
  }) {
1338
1331
  return /* @__PURE__ */ e.jsxs(Qs, { openDelay: 0, children: [
1339
- /* @__PURE__ */ e.jsx(Ws, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx($a, { className: "h-4 w-4 text-red-500" }) }) }),
1332
+ /* @__PURE__ */ e.jsx(Ws, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Ka, { className: "h-4 w-4 text-red-500" }) }) }),
1340
1333
  /* @__PURE__ */ e.jsx(Ps, { 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: [
1341
1334
  /* @__PURE__ */ e.jsxs(
1342
- k,
1335
+ w,
1343
1336
  {
1344
1337
  onClick: () => {
1345
1338
  n(!0), t(s), a(!0);
@@ -1347,16 +1340,16 @@ function jn({
1347
1340
  size: "sm",
1348
1341
  variant: "outline",
1349
1342
  children: [
1350
- /* @__PURE__ */ e.jsx(Qa, { className: "h-4 w-4 mr-2" }),
1343
+ /* @__PURE__ */ e.jsx(Wa, { className: "h-4 w-4 mr-2" }),
1351
1344
  "Fix It"
1352
1345
  ]
1353
1346
  }
1354
1347
  ),
1355
- /* @__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 }) })
1348
+ /* @__PURE__ */ e.jsx(ys, { 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 }) })
1356
1349
  ] }) }) })
1357
1350
  ] });
1358
1351
  }
1359
- function bn({
1352
+ function yn({
1360
1353
  text: s,
1361
1354
  onCheckedChange: n,
1362
1355
  checked: t
@@ -1366,8 +1359,8 @@ function bn({
1366
1359
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1367
1360
  ] });
1368
1361
  }
1369
- function yn() {
1370
- const { authToken: s } = Ye(), n = De(null), t = i((d) => d.applyFilters), [a, l] = z(""), o = i((d) => d.filterValues), r = i((d) => d.card.sql);
1362
+ function vn() {
1363
+ const { authToken: s } = Ye(), n = Ie(null), t = l((d) => d.applyFilters), [a, i] = z(""), o = l((d) => d.filterValues), r = l((d) => d.card.sql);
1371
1364
  return /* @__PURE__ */ e.jsxs(
1372
1365
  Qs,
1373
1366
  {
@@ -1384,7 +1377,7 @@ function yn() {
1384
1377
  active_filters: o
1385
1378
  }
1386
1379
  );
1387
- console.log(c), c.sql ? (console.log(c.records), l(c.sql)) : l("Error");
1380
+ console.log(c), c.sql ? (console.log(c.records), i(c.sql)) : i("Error");
1388
1381
  },
1389
1382
  children: [
1390
1383
  /* @__PURE__ */ e.jsx(Ws, { asChild: !0, children: t && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
@@ -1394,7 +1387,7 @@ function yn() {
1394
1387
  /* @__PURE__ */ e.jsx(
1395
1388
  Xs,
1396
1389
  {
1397
- onClick: () => Qt(n),
1390
+ onClick: () => Pt(n),
1398
1391
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
1399
1392
  }
1400
1393
  )
@@ -1408,7 +1401,7 @@ function yn() {
1408
1401
  }
1409
1402
  );
1410
1403
  }
1411
- const vn = `
1404
+ const Nn = `
1412
1405
 
1413
1406
  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.
1414
1407
 
@@ -1455,73 +1448,73 @@ SELECT label, measure FROM table
1455
1448
  - Label - Category
1456
1449
  - Measure - Number
1457
1450
  `;
1458
- function Nn({
1451
+ function Cn({
1459
1452
  open: s,
1460
1453
  setOpen: n,
1461
1454
  userInput: t,
1462
1455
  setUserInput: a,
1463
- triggerAIRun: l,
1456
+ triggerAIRun: i,
1464
1457
  setTriggerAIRun: o
1465
1458
  }) {
1466
- const r = De(null), d = De(null), { authToken: c } = Ye(), [m, h] = z(!1), u = i((b) => b.actions.setCardSql), g = S((b) => b.dashboard.baseQueries), p = i((b) => b.actions.setRunSql), j = i((b) => b.actions.setCardType), [C, v] = z([]), y = i((b) => b.currentColumns), D = i((b) => b.card.sql), A = i((b) => b.selectedTableName), f = `
1459
+ const r = Ie(null), d = Ie(null), { authToken: c } = Ye(), [m, h] = z(!1), u = l((x) => x.actions.setCardSql), g = S((x) => x.dashboard.baseQueries), f = l((x) => x.actions.setRunSql), j = l((x) => x.actions.setCardType), [C, v] = z([]), b = l((x) => x.currentColumns), E = l((x) => x.card.sql), T = l((x) => x.selectedTableName), O = `
1467
1460
  ${t}
1468
1461
 
1469
- Database Query Dialect: ${A === "api" || A === "s3" ? "DuckDb" : ""}
1470
- Table Name: ${A}
1471
- Table Columns: ${y == null ? void 0 : y.map((b) => `${b.column_name} | ${b.data_type}`).join(", ")}
1472
- User SQL: ${D}
1473
- ${g && `Base Queries: ${JSON.stringify(g)} `}`, O = ` 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.
1474
- Visual Query Syntax: ${vn}`, { data: T, isLoading: E, isFetching: U, isError: Z, refetch: G } = ye({
1462
+ Database Query Dialect: ${T === "api" || T === "s3" ? "DuckDb" : ""}
1463
+ Table Name: ${T}
1464
+ Table Columns: ${b == null ? void 0 : b.map((x) => `${x.column_name} | ${x.data_type}`).join(", ")}
1465
+ User SQL: ${E}
1466
+ ${g && `Base Queries: ${JSON.stringify(g)} `}`, 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.
1467
+ Visual Query Syntax: ${Nn}`, { data: F, isLoading: A, isFetching: I, isError: P, refetch: U } = Ne({
1475
1468
  queryKey: ["ai-query"],
1476
- queryFn: () => we(
1469
+ queryFn: () => Fe(
1477
1470
  "https://semaphor.cloud/api/v1/ai",
1478
1471
  (c == null ? void 0 : c.accessToken) || "",
1479
1472
  {
1480
- user_content: `userContent: ${f} ${m ? O : ""}`
1473
+ user_content: `userContent: ${O} ${m ? y : ""}`
1481
1474
  }
1482
1475
  ),
1483
1476
  enabled: !1
1484
1477
  // Do not run by default.
1485
1478
  });
1486
- function H(b) {
1487
- if (b.toLowerCase().includes("bar"))
1479
+ function G(x) {
1480
+ if (x.toLowerCase().includes("bar"))
1488
1481
  j("bar");
1489
- else if (b.toLowerCase().includes("line"))
1482
+ else if (x.toLowerCase().includes("line"))
1490
1483
  j("line");
1491
- else if (b.toLowerCase().includes("bubble"))
1484
+ else if (x.toLowerCase().includes("bubble"))
1492
1485
  j("bubble");
1493
- else if (b.toLowerCase().includes("scatter"))
1486
+ else if (x.toLowerCase().includes("scatter"))
1494
1487
  j("scatter");
1495
- else if (b.toLowerCase().includes("stacked"))
1488
+ else if (x.toLowerCase().includes("stacked"))
1496
1489
  j("stackedBar");
1497
- else if (b.toLowerCase().includes("pie"))
1490
+ else if (x.toLowerCase().includes("pie"))
1498
1491
  j("pie");
1499
- else if (b.toLowerCase().includes("donut") || b.toLowerCase().includes("doughnut"))
1492
+ else if (x.toLowerCase().includes("donut") || x.toLowerCase().includes("doughnut"))
1500
1493
  j("doughnut");
1501
- else if (b.toLowerCase().includes("radar"))
1494
+ else if (x.toLowerCase().includes("radar"))
1502
1495
  j("radar");
1503
1496
  else
1504
1497
  return j("bar"), !1;
1505
1498
  return !0;
1506
1499
  }
1507
1500
  $(() => {
1508
- T && v((b) => [...b, { role: "ai", content: T.response }]);
1509
- }, [T]), $(() => {
1510
- const b = setTimeout(() => {
1511
- var L;
1501
+ F && v((x) => [...x, { role: "ai", content: F.response }]);
1502
+ }, [F]), $(() => {
1503
+ const x = setTimeout(() => {
1504
+ var k;
1512
1505
  d.current && (d.current.scroll({
1513
1506
  top: d.current.scrollHeight,
1514
1507
  behavior: "smooth"
1515
- }), (L = r.current) == null || L.focus());
1508
+ }), (k = r.current) == null || k.focus());
1516
1509
  }, 100);
1517
- return () => clearTimeout(b);
1510
+ return () => clearTimeout(x);
1518
1511
  }, [C]);
1519
- function I() {
1520
- t && (v((b) => [...b, { role: "user", content: t }]), H(t) && h(!0), a(""), G());
1512
+ function L() {
1513
+ t && (v((x) => [...x, { role: "user", content: t }]), G(t) && h(!0), a(""), U());
1521
1514
  }
1522
1515
  $(() => {
1523
- l && (I(), o(!1));
1524
- }, [l, o]);
1516
+ i && (L(), o(!1));
1517
+ }, [i, o]);
1525
1518
  const ee = {
1526
1519
  //seleect a darker color
1527
1520
  // color: '#000',
@@ -1530,7 +1523,7 @@ function Nn({
1530
1523
  fontSize: 15,
1531
1524
  // padding: '5px',
1532
1525
  width: "100%"
1533
- }, P = {
1526
+ }, Y = {
1534
1527
  // background: '#f6f8fa',
1535
1528
  // color: '#000',
1536
1529
  fontFamily: "monospace",
@@ -1547,62 +1540,62 @@ function Nn({
1547
1540
  marginLeft: 20,
1548
1541
  // add bullet points for unordered lists
1549
1542
  listStyleType: "disc"
1550
- }, X = {
1543
+ }, Z = {
1551
1544
  // Override how paragraphs are rendered
1552
- p: ({ node: b, ...L }) => /* @__PURE__ */ e.jsx("p", { style: ee, ...L }),
1553
- code: ({ node: b, ...L }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...L }),
1554
- pre: ({ node: b, ...L }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
1555
- /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: L.children }),
1545
+ p: ({ node: x, ...k }) => /* @__PURE__ */ e.jsx("p", { style: ee, ...k }),
1546
+ code: ({ node: x, ...k }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...k }),
1547
+ pre: ({ node: x, ...k }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Y, children: [
1548
+ /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: k.children }),
1556
1549
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1557
- /* @__PURE__ */ e.jsx(k, { onClick: w, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Xs, {}) }),
1550
+ /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Xs, {}) }),
1558
1551
  /* @__PURE__ */ e.jsx(
1559
- k,
1552
+ w,
1560
1553
  {
1561
- onClick: (K) => {
1562
- const B = w(K);
1563
- B && (n(!1), u(B), p(!0));
1554
+ onClick: (_) => {
1555
+ const B = J(_);
1556
+ B && (n(!1), u(B), f(!0));
1564
1557
  },
1565
1558
  size: "sm",
1566
1559
  variant: "outline",
1567
- children: /* @__PURE__ */ e.jsx(Yt, {})
1560
+ children: /* @__PURE__ */ e.jsx(Zt, {})
1568
1561
  }
1569
1562
  )
1570
1563
  ] })
1571
1564
  ] }),
1572
- li: ({ node: b, ...L }) => /* @__PURE__ */ e.jsx("li", { style: se, ...L })
1565
+ li: ({ node: x, ...k }) => /* @__PURE__ */ e.jsx("li", { style: se, ...k })
1573
1566
  // You can add more overrides for other elements like h1, h2, etc.
1574
1567
  };
1575
- function w(b) {
1576
- const L = b.currentTarget.closest("pre");
1577
- if (!L)
1568
+ function J(x) {
1569
+ const k = x.currentTarget.closest("pre");
1570
+ if (!k)
1578
1571
  return;
1579
- const K = L.textContent || L.innerText;
1580
- return navigator.clipboard.writeText(K).then(() => console.log("Text copied to clipboard")).catch((B) => console.error("Error in copying text: ", B)), K;
1572
+ const _ = k.textContent || k.innerText;
1573
+ return navigator.clipboard.writeText(_).then(() => console.log("Text copied to clipboard")).catch((B) => console.error("Error in copying text: ", B)), _;
1581
1574
  }
1582
- function F() {
1583
- return C == null ? void 0 : C.map((b, L) => b.role === "user" ? /* @__PURE__ */ e.jsxs(
1575
+ function D() {
1576
+ return C == null ? void 0 : C.map((x, k) => x.role === "user" ? /* @__PURE__ */ e.jsxs(
1584
1577
  "div",
1585
1578
  {
1586
1579
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1587
1580
  children: [
1588
- /* @__PURE__ */ e.jsx(dn, { className: "mr-2 h-5 w-5" }),
1589
- /* @__PURE__ */ e.jsx("div", { children: b.content })
1581
+ /* @__PURE__ */ e.jsx(hn, { className: "mr-2 h-5 w-5" }),
1582
+ /* @__PURE__ */ e.jsx("div", { children: x.content })
1590
1583
  ]
1591
1584
  },
1592
- L
1593
- ) : b.role === "ai" ? /* @__PURE__ */ e.jsx(
1594
- Pt,
1585
+ k
1586
+ ) : x.role === "ai" ? /* @__PURE__ */ e.jsx(
1587
+ Xt,
1595
1588
  {
1596
1589
  className: "w-full overflow-auto py-1",
1597
- components: X,
1598
- children: T == null ? void 0 : T.response.replace(/DuckDB/gi, "Semaphor")
1590
+ components: Z,
1591
+ children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
1599
1592
  },
1600
- L
1601
- ) : /* @__PURE__ */ e.jsx("div", {}, L));
1593
+ k
1594
+ ) : /* @__PURE__ */ e.jsx("div", {}, k));
1602
1595
  }
1603
1596
  return /* @__PURE__ */ e.jsxs(is, { open: s, onOpenChange: n, children: [
1604
1597
  /* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1605
- k,
1598
+ w,
1606
1599
  {
1607
1600
  size: "sm",
1608
1601
  className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
@@ -1624,7 +1617,7 @@ function Nn({
1624
1617
  {
1625
1618
  ref: d,
1626
1619
  className: "h-[625px] w-full overflow-auto border-t border-t-muted",
1627
- children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: F() })
1620
+ children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: D() })
1628
1621
  }
1629
1622
  ),
1630
1623
  /* @__PURE__ */ e.jsx(
@@ -1636,31 +1629,31 @@ function Nn({
1636
1629
  {
1637
1630
  autoFocus: !0,
1638
1631
  ref: r,
1639
- onKeyDown: (b) => {
1640
- b.key === "Enter" && !b.shiftKey && (b.preventDefault(), a(""), I());
1632
+ onKeyDown: (x) => {
1633
+ x.key === "Enter" && !x.shiftKey && (x.preventDefault(), a(""), L());
1641
1634
  },
1642
1635
  placeholder: "Type your question here...",
1643
- onFocus: (b) => {
1644
- const L = b.target, K = L.value.length;
1645
- L.setSelectionRange(K, K);
1636
+ onFocus: (x) => {
1637
+ const k = x.target, _ = k.value.length;
1638
+ k.setSelectionRange(_, _);
1646
1639
  },
1647
- className: W(
1640
+ className: K(
1648
1641
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1649
1642
  ),
1650
- disabled: E || U,
1643
+ disabled: A || I,
1651
1644
  value: t,
1652
- onChange: (b) => a(b.target.value)
1645
+ onChange: (x) => a(x.target.value)
1653
1646
  }
1654
1647
  ),
1655
1648
  " ",
1656
1649
  /* @__PURE__ */ e.jsx(
1657
- k,
1650
+ w,
1658
1651
  {
1659
1652
  className: "h-8",
1660
1653
  size: "sm",
1661
1654
  variant: "ghost",
1662
- onClick: I,
1663
- children: !E && !U ? /* @__PURE__ */ e.jsx(Wt, {}) : /* @__PURE__ */ e.jsx(Le, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1655
+ onClick: L,
1656
+ children: !A && !I ? /* @__PURE__ */ e.jsx(Yt, {}) : /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1664
1657
  }
1665
1658
  )
1666
1659
  ] })
@@ -1677,24 +1670,24 @@ var mt = {
1677
1670
  className: void 0,
1678
1671
  style: void 0,
1679
1672
  attr: void 0
1680
- }, Vs = ce.createContext && /* @__PURE__ */ ce.createContext(mt), Cn = ["attr", "size", "title"];
1681
- function Sn(s, n) {
1673
+ }, Vs = de.createContext && /* @__PURE__ */ de.createContext(mt), Sn = ["attr", "size", "title"];
1674
+ function kn(s, n) {
1682
1675
  if (s == null)
1683
1676
  return {};
1684
- var t = kn(s, n), a, l;
1677
+ var t = wn(s, n), a, i;
1685
1678
  if (Object.getOwnPropertySymbols) {
1686
1679
  var o = Object.getOwnPropertySymbols(s);
1687
- for (l = 0; l < o.length; l++)
1688
- a = o[l], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(s, a) && (t[a] = s[a]);
1680
+ for (i = 0; i < o.length; i++)
1681
+ a = o[i], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(s, a) && (t[a] = s[a]);
1689
1682
  }
1690
1683
  return t;
1691
1684
  }
1692
- function kn(s, n) {
1685
+ function wn(s, n) {
1693
1686
  if (s == null)
1694
1687
  return {};
1695
- var t = {}, a = Object.keys(s), l, o;
1688
+ var t = {}, a = Object.keys(s), i, o;
1696
1689
  for (o = 0; o < a.length; o++)
1697
- l = a[o], !(n.indexOf(l) >= 0) && (t[l] = s[l]);
1690
+ i = a[o], !(n.indexOf(i) >= 0) && (t[i] = s[i]);
1698
1691
  return t;
1699
1692
  }
1700
1693
  function Ge() {
@@ -1711,8 +1704,8 @@ function Rs(s, n) {
1711
1704
  var t = Object.keys(s);
1712
1705
  if (Object.getOwnPropertySymbols) {
1713
1706
  var a = Object.getOwnPropertySymbols(s);
1714
- n && (a = a.filter(function(l) {
1715
- return Object.getOwnPropertyDescriptor(s, l).enumerable;
1707
+ n && (a = a.filter(function(i) {
1708
+ return Object.getOwnPropertyDescriptor(s, i).enumerable;
1716
1709
  })), t.push.apply(t, a);
1717
1710
  }
1718
1711
  return t;
@@ -1721,21 +1714,21 @@ function Je(s) {
1721
1714
  for (var n = 1; n < arguments.length; n++) {
1722
1715
  var t = arguments[n] != null ? arguments[n] : {};
1723
1716
  n % 2 ? Rs(Object(t), !0).forEach(function(a) {
1724
- wn(s, a, t[a]);
1717
+ Fn(s, a, t[a]);
1725
1718
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(t)) : Rs(Object(t)).forEach(function(a) {
1726
1719
  Object.defineProperty(s, a, Object.getOwnPropertyDescriptor(t, a));
1727
1720
  });
1728
1721
  }
1729
1722
  return s;
1730
1723
  }
1731
- function wn(s, n, t) {
1732
- return n = Fn(n), n in s ? Object.defineProperty(s, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = t, s;
1724
+ function Fn(s, n, t) {
1725
+ return n = On(n), n in s ? Object.defineProperty(s, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = t, s;
1733
1726
  }
1734
- function Fn(s) {
1735
- var n = On(s, "string");
1727
+ function On(s) {
1728
+ var n = zn(s, "string");
1736
1729
  return typeof n == "symbol" ? n : String(n);
1737
1730
  }
1738
- function On(s, n) {
1731
+ function zn(s, n) {
1739
1732
  if (typeof s != "object" || s === null)
1740
1733
  return s;
1741
1734
  var t = s[Symbol.toPrimitive];
@@ -1748,23 +1741,23 @@ function On(s, n) {
1748
1741
  return (n === "string" ? String : Number)(s);
1749
1742
  }
1750
1743
  function xt(s) {
1751
- return s && s.map((n, t) => /* @__PURE__ */ ce.createElement(n.tag, Je({
1744
+ return s && s.map((n, t) => /* @__PURE__ */ de.createElement(n.tag, Je({
1752
1745
  key: t
1753
1746
  }, n.attr), xt(n.child)));
1754
1747
  }
1755
- function Ne(s) {
1756
- return (n) => /* @__PURE__ */ ce.createElement(zn, Ge({
1748
+ function Se(s) {
1749
+ return (n) => /* @__PURE__ */ de.createElement(Mn, Ge({
1757
1750
  attr: Je({}, s.attr)
1758
1751
  }, n), xt(s.child));
1759
1752
  }
1760
- function zn(s) {
1753
+ function Mn(s) {
1761
1754
  var n = (t) => {
1762
1755
  var {
1763
1756
  attr: a,
1764
- size: l,
1757
+ size: i,
1765
1758
  title: o
1766
- } = s, r = Sn(s, Cn), d = l || t.size || "1em", c;
1767
- return t.className && (c = t.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ ce.createElement("svg", Ge({
1759
+ } = s, r = kn(s, Sn), d = i || t.size || "1em", c;
1760
+ return t.className && (c = t.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ de.createElement("svg", Ge({
1768
1761
  stroke: "currentColor",
1769
1762
  fill: "currentColor",
1770
1763
  strokeWidth: "0"
@@ -1776,157 +1769,157 @@ function zn(s) {
1776
1769
  height: d,
1777
1770
  width: d,
1778
1771
  xmlns: "http://www.w3.org/2000/svg"
1779
- }), o && /* @__PURE__ */ ce.createElement("title", null, o), s.children);
1772
+ }), o && /* @__PURE__ */ de.createElement("title", null, o), s.children);
1780
1773
  };
1781
- return Vs !== void 0 ? /* @__PURE__ */ ce.createElement(Vs.Consumer, null, (t) => n(t)) : n(mt);
1774
+ return Vs !== void 0 ? /* @__PURE__ */ de.createElement(Vs.Consumer, null, (t) => n(t)) : n(mt);
1782
1775
  }
1783
- function Mn(s) {
1784
- return Ne({ 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);
1776
+ function Tn(s) {
1777
+ return Se({ 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);
1785
1778
  }
1786
- function Tn() {
1787
- const { theme: s } = Xt(), n = De(), t = De(), [a, l] = z(!1), [o, r] = z(!1), [d, c] = z(!1), [m, h] = z(""), [u, g] = z(!1), { authToken: p } = Ye();
1788
- S((x) => x.selectedSheetId);
1789
- const j = S((x) => x.dashboard.baseQueries), C = i((x) => x.card), v = S((x) => x.theme), y = i((x) => x.isShowingVisual), D = i(
1790
- (x) => x.selectedConnectionId
1791
- ), A = i(
1792
- (x) => x.selectedDatabaseName
1793
- ), f = i(
1794
- (x) => x.selectedSchemaName
1779
+ function An() {
1780
+ const { theme: s } = ea(), n = Ie(), t = Ie(), [a, i] = z(!1), [o, r] = z(!1), [d, c] = z(!1), [m, h] = z(""), [u, g] = z(!1), { authToken: f } = Ye();
1781
+ S((p) => p.selectedSheetId);
1782
+ const j = S((p) => p.dashboard.baseQueries), C = l((p) => p.card), v = S((p) => p.theme), b = l((p) => p.isShowingVisual), E = l(
1783
+ (p) => p.selectedConnectionId
1784
+ ), T = l(
1785
+ (p) => p.selectedDatabaseName
1786
+ ), O = l(
1787
+ (p) => p.selectedSchemaName
1795
1788
  );
1796
1789
  S(
1797
- (x) => x.actions.updateFrameCard
1790
+ (p) => p.actions.updateFrameCard
1798
1791
  );
1799
- const O = i((x) => x.selectedTableName), T = i((x) => x.card.sql), E = i((x) => x.card.python), U = Zt(T, j), Z = i((x) => x.selectedConnectionId), G = i((x) => x.frame), H = i((x) => x.filterValues), I = i((x) => x.applyFilters), {
1792
+ const y = l((p) => p.selectedTableName), F = l((p) => p.card.sql), A = l((p) => p.card.python), I = sa(F, j), P = l((p) => p.selectedConnectionId), U = l((p) => p.frame), G = l((p) => p.filterValues), L = l((p) => p.applyFilters), {
1800
1793
  setCardCustomCfg: ee,
1801
- setQueryResultColumns: P,
1794
+ setQueryResultColumns: Y,
1802
1795
  setFilterValues: se,
1803
- setCardSql: X,
1804
- setCardPython: w,
1805
- setQueryError: F,
1806
- setPythonStdOut: b,
1807
- setCardPreferences: L
1808
- } = i((x) => x.actions), K = i((x) => x.onSave), B = i(
1809
- (x) => x.actions.setApplyFilters
1810
- ), de = i((x) => x.onClose), te = i((x) => x.actions.setCardData), xe = i((x) => x.actions.setSqlGen), pe = i((x) => x.runSql), fe = i((x) => x.actions.setRunSql), he = i(
1811
- (x) => x.actions.setIsSqlRunning
1796
+ setCardSql: Z,
1797
+ setCardPython: J,
1798
+ setQueryError: D,
1799
+ setPythonStdOut: x,
1800
+ setCardPreferences: k
1801
+ } = l((p) => p.actions), _ = l((p) => p.onSave), B = l(
1802
+ (p) => p.actions.setApplyFilters
1803
+ ), he = l((p) => p.onClose), te = l((p) => p.actions.setCardData), pe = l((p) => p.actions.setSqlGen), fe = l((p) => p.runSql), ge = l((p) => p.actions.setRunSql), ue = l(
1804
+ (p) => p.actions.setIsSqlRunning
1812
1805
  ), {
1813
- data: J,
1806
+ data: Q,
1814
1807
  isLoading: ae,
1815
- isFetching: Ce,
1816
- isSuccess: Re,
1817
- isError: Se,
1818
- error: Me,
1808
+ isFetching: ne,
1809
+ isSuccess: je,
1810
+ isError: ke,
1811
+ error: Te,
1819
1812
  status: Xe,
1820
- refetch: ge
1821
- } = ye({
1822
- queryKey: [U, E],
1813
+ refetch: be
1814
+ } = Ne({
1815
+ queryKey: [I, A],
1823
1816
  queryFn: () => Ys(
1824
1817
  "https://semaphor.cloud/api/v1/query",
1825
- (p == null ? void 0 : p.accessToken) || "",
1818
+ (f == null ? void 0 : f.accessToken) || "",
1826
1819
  {
1827
- connection_id: Z,
1828
- sql: U,
1829
- python: E === Ms ? "" : E,
1830
- active_filters: I ? H : []
1820
+ connection_id: P,
1821
+ sql: I,
1822
+ python: A === Ms ? "" : A,
1823
+ active_filters: L ? G : []
1831
1824
  }
1832
1825
  ),
1833
1826
  enabled: !1,
1834
1827
  retry: !1
1835
1828
  });
1836
1829
  $(() => {
1837
- if (J && (te(J.records), b((J == null ? void 0 : J.output) || ""), J.records.length > 0)) {
1838
- const { dimensionKeys: x } = ns(J.records);
1839
- P(x);
1830
+ if (Q && (te(Q.records), x((Q == null ? void 0 : Q.output) || ""), Q.records.length > 0)) {
1831
+ const { dimensionKeys: p } = ns(Q.records);
1832
+ Y(p);
1840
1833
  }
1841
- }, [J, te, P, b]), $(() => {
1842
- pe && (ge(), fe(!1));
1843
- }, [pe, ge, fe]), $(() => {
1844
- (ae || Ce) && he(!0), (Se || Re) && he(!1), Se ? (F(Me.message), te([]), P([]), b("")) : F("");
1834
+ }, [Q, te, Y, x]), $(() => {
1835
+ fe && (be(), ge(!1));
1836
+ }, [fe, be, ge]), $(() => {
1837
+ (ae || ne) && ue(!0), (ke || je) && ue(!1), ke ? (D(Te.message), te([]), Y([]), x("")) : D("");
1845
1838
  }, [
1846
1839
  ae,
1847
- Ce,
1848
- J,
1849
- b,
1850
- Se,
1851
- Re,
1852
- he,
1840
+ ne,
1841
+ Q,
1842
+ x,
1843
+ ke,
1844
+ je,
1845
+ ue,
1853
1846
  te,
1854
- P,
1855
- F,
1856
- Me
1847
+ Y,
1848
+ D,
1849
+ Te
1857
1850
  ]);
1858
1851
  function _e() {
1859
- X(""), te([]), xe({}), ee(""), L({});
1852
+ Z(""), te([]), pe({}), ee(""), k({});
1860
1853
  }
1861
- const Te = (x) => {
1862
- t.current = x;
1854
+ const Ae = (p) => {
1855
+ t.current = p;
1863
1856
  };
1864
1857
  function N() {
1865
- let x = T;
1866
- T && !T.includes("{{") && (x = gn(T), X(x));
1867
- const ne = {
1858
+ let p = F;
1859
+ F && !F.includes("{{") && (p = jn(F), Z(p));
1860
+ const re = {
1868
1861
  ...C,
1869
- lastSelectedSchema: f,
1870
- lastSelectedDatabase: A,
1871
- lastSelectedTable: O,
1872
- connectionId: D,
1873
- type: y ? C.type : "table",
1874
- sql: x,
1875
- customCfg: y ? C.customCfg : null
1876
- }, Ae = G.cards.map(
1877
- (je) => je.id === C.id ? ne : je
1862
+ lastSelectedSchema: O,
1863
+ lastSelectedDatabase: T,
1864
+ lastSelectedTable: y,
1865
+ connectionId: E,
1866
+ type: b ? C.type : "table",
1867
+ sql: p,
1868
+ customCfg: b ? C.customCfg : null
1869
+ }, Ee = U.cards.map(
1870
+ (ye) => ye.id === C.id ? re : ye
1878
1871
  );
1879
- K == null || K({
1880
- ...G,
1881
- cards: Ae
1872
+ _ == null || _({
1873
+ ...U,
1874
+ cards: Ee
1882
1875
  });
1883
1876
  }
1884
- function Ct() {
1885
- de == null || de();
1877
+ function St() {
1878
+ he == null || he();
1886
1879
  }
1887
- function St(x) {
1888
- const ne = getComputedStyle(
1880
+ function kt(p) {
1881
+ const re = getComputedStyle(
1889
1882
  document.documentElement
1890
- ).getPropertyValue(x);
1891
- return kt(ne);
1883
+ ).getPropertyValue(p);
1884
+ return wt(re);
1892
1885
  }
1893
- function kt(x) {
1894
- const [ne, Ae, je] = x.split(" "), Y = parseFloat(ne), Ot = parseFloat(Ae), zt = parseFloat(je), Mt = Ot / 100, Fs = zt / 100, ue = (1 - Math.abs(2 * Fs - 1)) * Mt, ke = ue * (1 - Math.abs(Y / 60 % 2 - 1)), Ze = Fs - ue / 2;
1895
- let re = 0, le = 0, ie = 0;
1896
- 0 <= Y && Y < 60 ? (re = ue, le = ke, ie = 0) : 60 <= Y && Y < 120 ? (re = ke, le = ue, ie = 0) : 120 <= Y && Y < 180 ? (re = 0, le = ue, ie = ke) : 180 <= Y && Y < 240 ? (re = 0, le = ke, ie = ue) : 240 <= Y && Y < 300 ? (re = ke, le = 0, ie = ue) : 300 <= Y && Y < 360 && (re = ue, le = 0, ie = ke), re = Math.round((re + Ze) * 255), le = Math.round((le + Ze) * 255), ie = Math.round((ie + Ze) * 255);
1897
- const es = (Tt) => {
1898
- const ss = Tt.toString(16);
1886
+ function wt(p) {
1887
+ const [re, Ee, ye] = p.split(" "), X = parseFloat(re), zt = parseFloat(Ee), Mt = parseFloat(ye), Tt = zt / 100, Fs = Mt / 100, me = (1 - Math.abs(2 * Fs - 1)) * Tt, we = me * (1 - Math.abs(X / 60 % 2 - 1)), Ze = Fs - me / 2;
1888
+ let le = 0, ie = 0, oe = 0;
1889
+ 0 <= X && X < 60 ? (le = me, ie = we, oe = 0) : 60 <= X && X < 120 ? (le = we, ie = me, oe = 0) : 120 <= X && X < 180 ? (le = 0, ie = me, oe = we) : 180 <= X && X < 240 ? (le = 0, ie = we, oe = me) : 240 <= X && X < 300 ? (le = we, ie = 0, oe = me) : 300 <= X && X < 360 && (le = me, ie = 0, oe = we), le = Math.round((le + Ze) * 255), ie = Math.round((ie + Ze) * 255), oe = Math.round((oe + Ze) * 255);
1890
+ const es = (At) => {
1891
+ const ss = At.toString(16);
1899
1892
  return ss.length == 1 ? "0" + ss : ss;
1900
1893
  };
1901
- return `#${es(re)}${es(le)}${es(ie)}`;
1894
+ return `#${es(le)}${es(ie)}${es(oe)}`;
1902
1895
  }
1903
1896
  $(() => {
1904
- const x = n.current, ne = t.current;
1905
- if (x) {
1906
- const Ae = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", je = v === "system" ? Ae : v;
1907
- x.editor.defineTheme("default", {
1897
+ const p = n.current, re = t.current;
1898
+ if (p) {
1899
+ const Ee = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ye = v === "system" ? Ee : v;
1900
+ p.editor.defineTheme("default", {
1908
1901
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
1909
- base: je === "light" ? "vs" : "vs-dark",
1902
+ base: ye === "light" ? "vs" : "vs-dark",
1910
1903
  inherit: !0,
1911
1904
  rules: [],
1912
1905
  colors: {
1913
1906
  // 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
1914
- "editor.background": je === "light" ? "#ffffff" : St("--background")
1907
+ "editor.background": ye === "light" ? "#ffffff" : kt("--background")
1915
1908
  }
1916
- }), x.editor.setTheme("default");
1909
+ }), p.editor.setTheme("default");
1917
1910
  }
1918
- return ne && x && ne.addCommand(
1919
- x.KeyMod.Shift | x.KeyCode.Enter,
1911
+ return re && p && re.addCommand(
1912
+ p.KeyMod.Shift | p.KeyCode.Enter,
1920
1913
  function() {
1921
- return console.log("Executing query..."), ge(), !1;
1914
+ return console.log("Executing query..."), be(), !1;
1922
1915
  }
1923
1916
  ), () => {
1924
1917
  };
1925
1918
  }, [s, v, n.current]);
1926
- function ws(x) {
1927
- n.current = x;
1919
+ function ws(p) {
1920
+ n.current = p;
1928
1921
  }
1929
- function wt() {
1922
+ function Ft() {
1930
1923
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1931
1924
  o && /* @__PURE__ */ e.jsx(
1932
1925
  "div",
@@ -1936,16 +1929,16 @@ function Tn() {
1936
1929
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
1937
1930
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
1938
1931
  /* @__PURE__ */ e.jsx(
1939
- bn,
1932
+ yn,
1940
1933
  {
1941
- checked: I,
1942
- onCheckedChange: () => B(!I),
1934
+ checked: L,
1935
+ onCheckedChange: () => B(!L),
1943
1936
  text: "Apply Filters"
1944
1937
  }
1945
1938
  ),
1946
- /* @__PURE__ */ e.jsx(yn, {}),
1947
- H && o && /* @__PURE__ */ e.jsx(
1948
- Ee,
1939
+ /* @__PURE__ */ e.jsx(vn, {}),
1940
+ G && o && /* @__PURE__ */ e.jsx(
1941
+ Le,
1949
1942
  {
1950
1943
  onClick: () => r(!1),
1951
1944
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
@@ -1956,16 +1949,16 @@ function Tn() {
1956
1949
  Be,
1957
1950
  {
1958
1951
  theme: "default",
1959
- onChange: (x) => {
1960
- if (x)
1952
+ onChange: (p) => {
1953
+ if (p)
1961
1954
  try {
1962
- JSON.parse(x), se(JSON.parse(x));
1955
+ JSON.parse(p), se(JSON.parse(p));
1963
1956
  } catch {
1964
1957
  }
1965
1958
  },
1966
1959
  defaultLanguage: "json",
1967
1960
  className: "mt-1 min-h-[220px]",
1968
- value: JSON.stringify(H, null, 2),
1961
+ value: JSON.stringify(G, null, 2),
1969
1962
  options: {
1970
1963
  readOnly: !0,
1971
1964
  minimap: {
@@ -1986,21 +1979,21 @@ function Tn() {
1986
1979
  ] })
1987
1980
  }
1988
1981
  ),
1989
- H && !o && /* @__PURE__ */ e.jsx(
1982
+ G && !o && /* @__PURE__ */ e.jsx(
1990
1983
  rt,
1991
1984
  {
1992
1985
  onClick: () => r(!0),
1993
- className: W(
1986
+ className: K(
1994
1987
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
1995
1988
  {
1996
- "font-bold text-red-800": I
1989
+ "font-bold text-red-800": L
1997
1990
  }
1998
1991
  )
1999
1992
  }
2000
1993
  )
2001
1994
  ] });
2002
1995
  }
2003
- function Ft() {
1996
+ function Ot() {
2004
1997
  return /* @__PURE__ */ e.jsxs(
2005
1998
  rs,
2006
1999
  {
@@ -2009,7 +2002,7 @@ function Tn() {
2009
2002
  role: "editor-resizable-group",
2010
2003
  children: [
2011
2004
  /* @__PURE__ */ e.jsxs(
2012
- Fe,
2005
+ Oe,
2013
2006
  {
2014
2007
  id: "1",
2015
2008
  order: 1,
@@ -2026,10 +2019,10 @@ function Tn() {
2026
2019
  {
2027
2020
  theme: "default",
2028
2021
  className: "pt-3",
2029
- onChange: (x) => {
2030
- X(x);
2022
+ onChange: (p) => {
2023
+ Z(p);
2031
2024
  },
2032
- value: T,
2025
+ value: F,
2033
2026
  options: {
2034
2027
  minimap: {
2035
2028
  enabled: !1
@@ -2045,7 +2038,7 @@ function Tn() {
2045
2038
  defaultLanguage: "sql",
2046
2039
  defaultValue: "SELECT * FROM table",
2047
2040
  beforeMount: ws,
2048
- onMount: Te
2041
+ onMount: Ae
2049
2042
  }
2050
2043
  )
2051
2044
  }
@@ -2057,7 +2050,7 @@ function Tn() {
2057
2050
  a && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2058
2051
  /* @__PURE__ */ e.jsx(ls, { withHandle: !0, className: "border" }),
2059
2052
  /* @__PURE__ */ e.jsxs(
2060
- Fe,
2053
+ Oe,
2061
2054
  {
2062
2055
  id: "2",
2063
2056
  order: 2,
@@ -2074,10 +2067,10 @@ function Tn() {
2074
2067
  {
2075
2068
  className: "pt-3",
2076
2069
  theme: "default",
2077
- onChange: (x) => {
2078
- w(x && x.trim() || "");
2070
+ onChange: (p) => {
2071
+ J(p && p.trim() || "");
2079
2072
  },
2080
- value: E || Ms,
2073
+ value: A || Ms,
2081
2074
  options: {
2082
2075
  minimap: {
2083
2076
  enabled: !1
@@ -2092,7 +2085,7 @@ function Tn() {
2092
2085
  },
2093
2086
  defaultLanguage: "python",
2094
2087
  beforeMount: ws,
2095
- onMount: Te
2088
+ onMount: Ae
2096
2089
  }
2097
2090
  )
2098
2091
  }
@@ -2120,8 +2113,8 @@ function Tn() {
2120
2113
  role: "sql-editor",
2121
2114
  className: "relative flex grow justify-between overflow-y-scroll",
2122
2115
  children: [
2123
- Ft(),
2124
- wt()
2116
+ Ot(),
2117
+ Ft()
2125
2118
  ]
2126
2119
  }
2127
2120
  ),
@@ -2133,40 +2126,40 @@ function Tn() {
2133
2126
  children: [
2134
2127
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2135
2128
  /* @__PURE__ */ e.jsxs(
2136
- k,
2129
+ w,
2137
2130
  {
2138
2131
  title: "Shift + Enter",
2139
- disabled: ae || Ce,
2132
+ disabled: ae || ne,
2140
2133
  onClick: () => {
2141
- ge();
2134
+ be();
2142
2135
  },
2143
2136
  className: "shrink-0",
2144
2137
  size: "sm",
2145
2138
  variant: "outline",
2146
2139
  children: [
2147
- ae || Ce ? /* @__PURE__ */ e.jsx(Le, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(tn, { className: "mr-2 h-4 w-4" }),
2140
+ ae || ne ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(an, { className: "mr-2 h-4 w-4" }),
2148
2141
  "Run"
2149
2142
  ]
2150
2143
  }
2151
2144
  ),
2152
- Se && /* @__PURE__ */ e.jsx(
2153
- jn,
2145
+ ke && /* @__PURE__ */ e.jsx(
2146
+ bn,
2154
2147
  {
2155
- error: Me.message,
2148
+ error: Te.message,
2156
2149
  setShowAIDialog: c,
2157
2150
  setTriggerAIRun: g,
2158
2151
  setUserInputforAI: h
2159
2152
  }
2160
2153
  ),
2161
2154
  /* @__PURE__ */ e.jsxs(
2162
- k,
2155
+ w,
2163
2156
  {
2164
2157
  onClick: _e,
2165
2158
  className: "",
2166
2159
  size: "sm",
2167
2160
  variant: "outline",
2168
2161
  children: [
2169
- /* @__PURE__ */ e.jsx(Ua, { className: "mr-2 size-4" }),
2162
+ /* @__PURE__ */ e.jsx(Ga, { className: "mr-2 size-4" }),
2170
2163
  "Clear"
2171
2164
  ]
2172
2165
  }
@@ -2175,47 +2168,47 @@ function Tn() {
2175
2168
  Js,
2176
2169
  {
2177
2170
  pressed: a,
2178
- onPressedChange: (x) => l(x),
2171
+ onPressedChange: (p) => i(p),
2179
2172
  className: "",
2180
2173
  size: "sm",
2181
2174
  variant: "outline",
2182
- children: /* @__PURE__ */ e.jsx(Mn, { className: "size-4 text-foreground/70" })
2175
+ children: /* @__PURE__ */ e.jsx(Tn, { className: "size-4 text-foreground/70" })
2183
2176
  }
2184
2177
  ),
2185
2178
  /* @__PURE__ */ e.jsx(
2186
- Nn,
2179
+ Cn,
2187
2180
  {
2188
2181
  open: d,
2189
2182
  setOpen: c,
2190
2183
  userInput: m,
2191
2184
  triggerAIRun: u,
2192
2185
  setTriggerAIRun: g,
2193
- setUserInput: (x) => h(x)
2186
+ setUserInput: (p) => h(p)
2194
2187
  }
2195
2188
  )
2196
2189
  ] }),
2197
2190
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2198
2191
  /* @__PURE__ */ e.jsxs(
2199
- k,
2192
+ w,
2200
2193
  {
2201
2194
  onClick: N,
2202
2195
  size: "sm",
2203
2196
  variant: "outline",
2204
2197
  children: [
2205
- /* @__PURE__ */ e.jsx(ea, { className: "mr-2 size-4 font-bold text-green-600" }),
2198
+ /* @__PURE__ */ e.jsx(ta, { className: "mr-2 size-4 font-bold text-green-600" }),
2206
2199
  "Accept"
2207
2200
  ]
2208
2201
  }
2209
2202
  ),
2210
2203
  /* @__PURE__ */ e.jsxs(
2211
- k,
2204
+ w,
2212
2205
  {
2213
- onClick: Ct,
2206
+ onClick: St,
2214
2207
  className: "w-full",
2215
2208
  size: "sm",
2216
2209
  variant: "outline",
2217
2210
  children: [
2218
- /* @__PURE__ */ e.jsx(Ee, { className: "mr-2 size-4" }),
2211
+ /* @__PURE__ */ e.jsx(Le, { className: "mr-2 size-4" }),
2219
2212
  "Close"
2220
2213
  ]
2221
2214
  }
@@ -2229,9 +2222,9 @@ function Tn() {
2229
2222
  )
2230
2223
  );
2231
2224
  }
2232
- function An({ data: s }) {
2225
+ function En({ data: s }) {
2233
2226
  var r;
2234
- const [n, t] = ce.useState([]), l = Object.keys(s[0]).map((d) => ({
2227
+ const [n, t] = de.useState([]), i = Object.keys(s[0]).map((d) => ({
2235
2228
  // header: key,
2236
2229
  accessorKey: d,
2237
2230
  header: ({ column: c }) => {
@@ -2243,29 +2236,29 @@ function An({ data: s }) {
2243
2236
  onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
2244
2237
  children: [
2245
2238
  d,
2246
- m === "asc" ? /* @__PURE__ */ e.jsx(sa, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(ta, { className: "ml-2 h-5 w-5" }) : null
2239
+ m === "asc" ? /* @__PURE__ */ e.jsx(aa, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(na, { className: "ml-2 h-5 w-5" }) : null
2247
2240
  ]
2248
2241
  }
2249
2242
  ) });
2250
2243
  }
2251
- })), o = aa({
2244
+ })), o = ra({
2252
2245
  data: s,
2253
- columns: l,
2254
- getCoreRowModel: oa(),
2255
- getPaginationRowModel: ca(),
2246
+ columns: i,
2247
+ getCoreRowModel: da(),
2248
+ getPaginationRowModel: ha(),
2256
2249
  onSortingChange: t,
2257
- getSortedRowModel: da(),
2250
+ getSortedRowModel: ua(),
2258
2251
  manualPagination: !0,
2259
2252
  state: {
2260
2253
  sorting: n
2261
2254
  }
2262
2255
  });
2263
- return /* @__PURE__ */ e.jsxs(na, { children: [
2264
- /* @__PURE__ */ e.jsx(ra, { children: o.getHeaderGroups().map((d) => /* @__PURE__ */ e.jsx(ts, { children: d.headers.map((c) => /* @__PURE__ */ e.jsx(la, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Ts(
2256
+ return /* @__PURE__ */ e.jsxs(la, { children: [
2257
+ /* @__PURE__ */ e.jsx(ia, { children: o.getHeaderGroups().map((d) => /* @__PURE__ */ e.jsx(ts, { children: d.headers.map((c) => /* @__PURE__ */ e.jsx(oa, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Ts(
2265
2258
  c.column.columnDef.header,
2266
2259
  c.getContext()
2267
2260
  ) }, c.id)) }, d.id)) }),
2268
- /* @__PURE__ */ e.jsx(ia, { children: (r = o.getRowModel().rows) != null && r.length ? o.getRowModel().rows.map((d) => /* @__PURE__ */ e.jsx(
2261
+ /* @__PURE__ */ e.jsx(ca, { children: (r = o.getRowModel().rows) != null && r.length ? o.getRowModel().rows.map((d) => /* @__PURE__ */ e.jsx(
2269
2262
  ts,
2270
2263
  {
2271
2264
  className: "whitespace-nowrap py-2",
@@ -2273,7 +2266,7 @@ function An({ data: s }) {
2273
2266
  children: d.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(As, { children: Ts(c.column.columnDef.cell, c.getContext()) }, c.id))
2274
2267
  },
2275
2268
  d.id
2276
- )) : /* @__PURE__ */ e.jsx(ts, { children: /* @__PURE__ */ e.jsx(As, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2269
+ )) : /* @__PURE__ */ e.jsx(ts, { children: /* @__PURE__ */ e.jsx(As, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2277
2270
  ] });
2278
2271
  }
2279
2272
  function pt({
@@ -2281,8 +2274,8 @@ function pt({
2281
2274
  className: s,
2282
2275
  ...n
2283
2276
  }) {
2284
- ce.useState(0);
2285
- const t = S((r) => r.themeStyle), a = i((r) => r.card), l = i((r) => r.actions.setCard);
2277
+ de.useState(0);
2278
+ const t = S((r) => r.themeStyle), a = l((r) => r.card), i = l((r) => r.actions.setCard);
2286
2279
  if ($(() => {
2287
2280
  }, [
2288
2281
  a.data,
@@ -2301,19 +2294,19 @@ function pt({
2301
2294
  customCfg: a.customCfg,
2302
2295
  preferences: a.preferences
2303
2296
  })), /* @__PURE__ */ e.jsxs(
2304
- ha,
2297
+ ma,
2305
2298
  {
2306
2299
  role: "editor-visual-card",
2307
- className: W("relative flex h-full flex-col rounded-none", s),
2300
+ className: K("relative flex h-full flex-col rounded-none", s),
2308
2301
  ...n,
2309
2302
  children: [
2310
- /* @__PURE__ */ e.jsxs(ua, { className: "py-4", children: [
2303
+ /* @__PURE__ */ e.jsxs(xa, { className: "py-4", children: [
2311
2304
  /* @__PURE__ */ e.jsx(
2312
2305
  Es,
2313
2306
  {
2314
2307
  text: a.title,
2315
- onSave: (r) => l({ ...a, title: r }),
2316
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ma, { className: "text-base", children: a.title }) })
2308
+ onSave: (r) => i({ ...a, title: r }),
2309
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(pa, { className: "text-base", children: a.title }) })
2317
2310
  },
2318
2311
  a.title
2319
2312
  ),
@@ -2321,8 +2314,8 @@ function pt({
2321
2314
  Es,
2322
2315
  {
2323
2316
  text: a.description || "",
2324
- onSave: (r) => l({ ...a, description: r }),
2325
- children: /* @__PURE__ */ e.jsxs(xa, { children: [
2317
+ onSave: (r) => i({ ...a, description: r }),
2318
+ children: /* @__PURE__ */ e.jsxs(fa, { children: [
2326
2319
  " ",
2327
2320
  a.description
2328
2321
  ] })
@@ -2330,41 +2323,41 @@ function pt({
2330
2323
  a.description
2331
2324
  )
2332
2325
  ] }),
2333
- /* @__PURE__ */ e.jsxs(pa, { className: "flex grow flex-col pb-3", children: [
2326
+ /* @__PURE__ */ e.jsxs(ga, { className: "flex grow flex-col pb-3", children: [
2334
2327
  a.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
2335
2328
  /* @__PURE__ */ e.jsx(
2336
- fa,
2329
+ ja,
2337
2330
  {
2338
2331
  cfg: o
2339
2332
  },
2340
2333
  JSON.stringify(o) + JSON.stringify(a.preferences)
2341
2334
  ),
2342
2335
  a.type === "table" && a.data && a.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2343
- /* @__PURE__ */ e.jsx(ga, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(ja, { card: a, data: a == null ? void 0 : a.data }) })
2336
+ /* @__PURE__ */ e.jsx(ba, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(ya, { card: a, data: a == null ? void 0 : a.data }) })
2344
2337
  ] })
2345
2338
  ]
2346
2339
  }
2347
2340
  );
2348
2341
  }
2349
- function En() {
2350
- const [s, n] = z(!1), [t, a] = z(""), [l, o] = z(""), [r, d] = z(""), c = i((v) => v.card), m = i(
2342
+ function Ln() {
2343
+ const [s, n] = z(!1), [t, a] = z(""), [i, o] = z(""), [r, d] = z(""), c = l((v) => v.card), m = l(
2351
2344
  (v) => v.card.customCfg
2352
- ), h = i(
2345
+ ), h = l(
2353
2346
  (v) => v.actions.setCardCustomCfg
2354
2347
  );
2355
2348
  function u(v) {
2356
- var A, f;
2357
- const y = {
2349
+ var T, O;
2350
+ const b = {
2358
2351
  ...v,
2359
2352
  data: {
2360
2353
  ...v == null ? void 0 : v.data,
2361
- datasets: (f = (A = v == null ? void 0 : v.data) == null ? void 0 : A.datasets) == null ? void 0 : f.map((O) => ({
2362
- ...O,
2354
+ datasets: (O = (T = v == null ? void 0 : v.data) == null ? void 0 : T.datasets) == null ? void 0 : O.map((y) => ({
2355
+ ...y,
2363
2356
  data: []
2364
2357
  }))
2365
2358
  }
2366
2359
  };
2367
- return JSON.stringify(y, null, 1);
2360
+ return JSON.stringify(b, null, 1);
2368
2361
  }
2369
2362
  function g() {
2370
2363
  if (!c.data || c.data.length === 0)
@@ -2377,10 +2370,10 @@ function En() {
2377
2370
  });
2378
2371
  v && (a(JSON.stringify(v, null, 1)), m && o(JSON.stringify(m, null, 1)));
2379
2372
  }
2380
- function p() {
2381
- if (l)
2373
+ function f() {
2374
+ if (i)
2382
2375
  try {
2383
- const v = JSON.parse(l);
2376
+ const v = JSON.parse(i);
2384
2377
  return v ? (h(v), d(""), o(""), v) : void 0;
2385
2378
  } catch (v) {
2386
2379
  console.log(v), d("Invalid JSON");
@@ -2392,20 +2385,20 @@ function En() {
2392
2385
  function C() {
2393
2386
  let v;
2394
2387
  if (m) {
2395
- const y = Is.cloneDeep(c.cfg), D = Is.merge(y, m);
2396
- return v = u(D), v;
2388
+ const b = Is.cloneDeep(c.cfg), E = Is.merge(b, m);
2389
+ return v = u(E), v;
2397
2390
  }
2398
2391
  return t ? (v = u(JSON.parse(t)), v) : "";
2399
2392
  }
2400
2393
  return /* @__PURE__ */ e.jsxs(is, { open: s, onOpenChange: n, children: [
2401
2394
  /* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2402
- k,
2395
+ w,
2403
2396
  {
2404
2397
  onClick: g,
2405
2398
  className: ` ${m && "border-foreground/50 dark:border-foreground/70"}`,
2406
2399
  size: "sm",
2407
2400
  variant: "outline",
2408
- children: /* @__PURE__ */ e.jsx(ba, { className: "h-4 w-4" })
2401
+ children: /* @__PURE__ */ e.jsx(va, { className: "h-4 w-4" })
2409
2402
  }
2410
2403
  ) }),
2411
2404
  /* @__PURE__ */ e.jsxs(
@@ -2418,7 +2411,7 @@ function En() {
2418
2411
  /* @__PURE__ */ e.jsx(hs, { children: "Customize Card" }),
2419
2412
  /* @__PURE__ */ e.jsxs(We, { children: [
2420
2413
  /* @__PURE__ */ e.jsx(ms, { children: /* @__PURE__ */ e.jsx(
2421
- Pa,
2414
+ Ya,
2422
2415
  {
2423
2416
  onClick: () => {
2424
2417
  navigator.clipboard.writeText(c.id);
@@ -2444,10 +2437,10 @@ function En() {
2444
2437
  ] }),
2445
2438
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2446
2439
  /* @__PURE__ */ e.jsx(pt, { className: "w-1/2 rounded shadow-none" }),
2447
- /* @__PURE__ */ e.jsxs(ya, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2448
- /* @__PURE__ */ e.jsxs(va, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2440
+ /* @__PURE__ */ e.jsxs(Na, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2441
+ /* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2449
2442
  /* @__PURE__ */ e.jsxs(Ls, { value: "custom-config", children: [
2450
- m && /* @__PURE__ */ e.jsx(Na, { className: "mr-1 h-5 w-5 text-green-600" }),
2443
+ m && /* @__PURE__ */ e.jsx(Sa, { className: "mr-1 h-5 w-5 text-green-600" }),
2451
2444
  m ? "Custom Config" : "Default Config"
2452
2445
  ] }),
2453
2446
  /* @__PURE__ */ e.jsx(Ls, { className: "", value: "output", children: "Output" })
@@ -2499,9 +2492,9 @@ function En() {
2499
2492
  ] })
2500
2493
  ] }),
2501
2494
  /* @__PURE__ */ e.jsxs(Bs, { className: "flex items-center", children: [
2502
- /* @__PURE__ */ e.jsx(_, { className: "mr-2 text-red-500", children: r }),
2495
+ /* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: r }),
2503
2496
  /* @__PURE__ */ e.jsx(
2504
- k,
2497
+ w,
2505
2498
  {
2506
2499
  disabled: !m,
2507
2500
  onClick: j,
@@ -2509,8 +2502,8 @@ function En() {
2509
2502
  children: "Reset"
2510
2503
  }
2511
2504
  ),
2512
- /* @__PURE__ */ e.jsx(k, { onClick: p, variant: "outline", children: "Apply" }),
2513
- /* @__PURE__ */ e.jsx(k, { onClick: () => n(!1), variant: "outline", children: "Close" })
2505
+ /* @__PURE__ */ e.jsx(w, { onClick: f, variant: "outline", children: "Apply" }),
2506
+ /* @__PURE__ */ e.jsx(w, { onClick: () => n(!1), variant: "outline", children: "Close" })
2514
2507
  ] })
2515
2508
  ]
2516
2509
  }
@@ -2518,54 +2511,54 @@ function En() {
2518
2511
  ] });
2519
2512
  }
2520
2513
  function ft(s) {
2521
- return Ne({ 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);
2514
+ return Se({ 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);
2522
2515
  }
2523
2516
  function gt(s) {
2524
- return Ne({ 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);
2517
+ return Se({ 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);
2525
2518
  }
2526
2519
  function jt(s) {
2527
- return Ne({ 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);
2520
+ return Se({ 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);
2528
2521
  }
2529
2522
  function bt(s) {
2530
- return Ne({ 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);
2523
+ return Se({ 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);
2531
2524
  }
2532
2525
  function yt(s) {
2533
- return Ne({ 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);
2526
+ return Se({ 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);
2534
2527
  }
2535
2528
  function vt(s) {
2536
- return Ne({ 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);
2529
+ return Se({ 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);
2537
2530
  }
2538
- function Ln() {
2539
- const [s, n] = z(!1), t = i((d) => d.card.type), { setCardType: a, setCardPreferences: l } = i(
2531
+ function Dn() {
2532
+ const [s, n] = z(!1), t = l((d) => d.card.type), { setCardType: a, setCardPreferences: i } = l(
2540
2533
  (d) => d.actions
2541
- ), o = i(
2534
+ ), o = l(
2542
2535
  (d) => d.actions.setCardCustomCfg
2543
2536
  );
2544
2537
  function r(d) {
2545
- a(d), o(null), l({}), n(!1);
2538
+ a(d), o(null), i({}), n(!1);
2546
2539
  }
2547
- return /* @__PURE__ */ e.jsxs(Ie, { open: s, onOpenChange: n, children: [
2548
- /* @__PURE__ */ e.jsx(qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Dn, { className: "h-4 w-4", chartType: t }) }) }),
2549
- /* @__PURE__ */ e.jsx(Ve, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2540
+ return /* @__PURE__ */ e.jsxs(qe, { open: s, onOpenChange: n, children: [
2541
+ /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(In, { className: "h-4 w-4", chartType: t }) }) }),
2542
+ /* @__PURE__ */ e.jsx(Re, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2550
2543
  /* @__PURE__ */ e.jsx(
2551
- k,
2544
+ w,
2552
2545
  {
2553
2546
  onClick: () => r("bar"),
2554
2547
  className: "font-normal",
2555
2548
  variant: "ghost",
2556
- children: /* @__PURE__ */ e.jsx(vs, { className: "size-5" })
2549
+ children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
2557
2550
  }
2558
2551
  ),
2559
2552
  /* @__PURE__ */ e.jsx(
2560
- k,
2553
+ w,
2561
2554
  {
2562
2555
  onClick: () => r("line"),
2563
2556
  variant: "ghost",
2564
- children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
2557
+ children: /* @__PURE__ */ e.jsx(Cs, { className: "size-5" })
2565
2558
  }
2566
2559
  ),
2567
2560
  /* @__PURE__ */ e.jsx(
2568
- k,
2561
+ w,
2569
2562
  {
2570
2563
  onClick: () => r("stackedBar"),
2571
2564
  variant: "ghost",
@@ -2573,7 +2566,7 @@ function Ln() {
2573
2566
  }
2574
2567
  ),
2575
2568
  /* @__PURE__ */ e.jsx(
2576
- k,
2569
+ w,
2577
2570
  {
2578
2571
  onClick: () => r("scatter"),
2579
2572
  variant: "ghost",
@@ -2581,7 +2574,7 @@ function Ln() {
2581
2574
  }
2582
2575
  ),
2583
2576
  /* @__PURE__ */ e.jsx(
2584
- k,
2577
+ w,
2585
2578
  {
2586
2579
  onClick: () => r("bubble"),
2587
2580
  variant: "ghost",
@@ -2589,7 +2582,7 @@ function Ln() {
2589
2582
  }
2590
2583
  ),
2591
2584
  /* @__PURE__ */ e.jsx(
2592
- k,
2585
+ w,
2593
2586
  {
2594
2587
  onClick: () => r("pie"),
2595
2588
  variant: "ghost",
@@ -2597,7 +2590,7 @@ function Ln() {
2597
2590
  }
2598
2591
  ),
2599
2592
  /* @__PURE__ */ e.jsx(
2600
- k,
2593
+ w,
2601
2594
  {
2602
2595
  onClick: () => r("doughnut"),
2603
2596
  variant: "ghost",
@@ -2605,7 +2598,7 @@ function Ln() {
2605
2598
  }
2606
2599
  ),
2607
2600
  /* @__PURE__ */ e.jsx(
2608
- k,
2601
+ w,
2609
2602
  {
2610
2603
  onClick: () => r("radar"),
2611
2604
  variant: "ghost",
@@ -2619,7 +2612,7 @@ function Ln() {
2619
2612
  }
2620
2613
  ),
2621
2614
  /* @__PURE__ */ e.jsx(
2622
- k,
2615
+ w,
2623
2616
  {
2624
2617
  onClick: () => r("polarArea"),
2625
2618
  variant: "ghost",
@@ -2627,15 +2620,15 @@ function Ln() {
2627
2620
  }
2628
2621
  ),
2629
2622
  /* @__PURE__ */ e.jsx(
2630
- k,
2623
+ w,
2631
2624
  {
2632
2625
  onClick: () => r("table"),
2633
2626
  variant: "ghost",
2634
- children: /* @__PURE__ */ e.jsx(Cs, { className: "size-5" })
2627
+ children: /* @__PURE__ */ e.jsx(bs, { className: "size-5" })
2635
2628
  }
2636
2629
  ),
2637
2630
  /* @__PURE__ */ e.jsx(
2638
- k,
2631
+ w,
2639
2632
  {
2640
2633
  onClick: () => r("kpi"),
2641
2634
  variant: "ghost",
@@ -2645,12 +2638,12 @@ function Ln() {
2645
2638
  ] }) })
2646
2639
  ] });
2647
2640
  }
2648
- function Dn({ chartType: s, className: n }) {
2641
+ function In({ chartType: s, className: n }) {
2649
2642
  switch (s) {
2650
2643
  case "bar":
2651
- return /* @__PURE__ */ e.jsx(vs, { className: n });
2652
- case "line":
2653
2644
  return /* @__PURE__ */ e.jsx(Ns, { className: n });
2645
+ case "line":
2646
+ return /* @__PURE__ */ e.jsx(Cs, { className: n });
2654
2647
  case "pie":
2655
2648
  return /* @__PURE__ */ e.jsx(it, { className: n });
2656
2649
  case "radar":
@@ -2668,21 +2661,21 @@ function Dn({ chartType: s, className: n }) {
2668
2661
  case "kpi":
2669
2662
  return /* @__PURE__ */ e.jsx(vt, { className: n });
2670
2663
  default:
2671
- return /* @__PURE__ */ e.jsx(Cs, { className: n });
2664
+ return /* @__PURE__ */ e.jsx(bs, { className: n });
2672
2665
  }
2673
2666
  }
2674
- function In() {
2675
- const s = i(
2667
+ function qn() {
2668
+ const s = l(
2676
2669
  (t) => t.card.refreshInterval
2677
- ), n = i(
2670
+ ), n = l(
2678
2671
  (t) => t.actions.setCardRefreshInterval
2679
2672
  );
2680
- return /* @__PURE__ */ e.jsxs(Ie, { children: [
2681
- /* @__PURE__ */ e.jsx(qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(_a, { className: "w-4 h-4" }) }) }),
2682
- /* @__PURE__ */ e.jsx(Ve, { 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: [
2683
- /* @__PURE__ */ e.jsx(_, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2673
+ return /* @__PURE__ */ e.jsxs(qe, { children: [
2674
+ /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ba, { className: "w-4 h-4" }) }) }),
2675
+ /* @__PURE__ */ e.jsx(Re, { 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: [
2676
+ /* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2684
2677
  /* @__PURE__ */ e.jsx(
2685
- Q,
2678
+ W,
2686
2679
  {
2687
2680
  value: s || "",
2688
2681
  onChange: (t) => n(t.target.value),
@@ -2695,27 +2688,27 @@ function In() {
2695
2688
  ] });
2696
2689
  }
2697
2690
  function _s() {
2698
- i((r) => r.frame);
2699
- const s = i((r) => r.card), n = i((r) => r.card.data), t = i((r) => r.isShowingVisual), a = i((r) => r.isSqlRunning), l = i((r) => r.queryError), o = i((r) => r.pythonStdOut);
2700
- 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: [
2701
- a && /* @__PURE__ */ e.jsx(Le, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2691
+ l((r) => r.frame);
2692
+ const s = l((r) => r.card), n = l((r) => r.card.data), t = l((r) => r.isShowingVisual), a = l((r) => r.isSqlRunning), i = l((r) => r.queryError), o = l((r) => r.pythonStdOut);
2693
+ return l((r) => r.onSave), l((r) => r.onClose), l((r) => r.actions.setCardSql), l((r) => r.actions.setCardType), l((r) => r.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2694
+ a && /* @__PURE__ */ e.jsx(De, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2702
2695
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2703
2696
  t && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2697
+ /* @__PURE__ */ e.jsx(Dn, {}),
2704
2698
  /* @__PURE__ */ e.jsx(Ln, {}),
2705
- /* @__PURE__ */ e.jsx(En, {}),
2706
- /* @__PURE__ */ e.jsx(In, {})
2699
+ /* @__PURE__ */ e.jsx(qn, {})
2707
2700
  ] }),
2708
- /* @__PURE__ */ e.jsx(Vn, {})
2701
+ /* @__PURE__ */ e.jsx(Rn, {})
2709
2702
  ] }),
2710
- t ? 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(Ca, { isLoading: a, card: s }) }) }) : /* @__PURE__ */ e.jsx(pt, { 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: [
2711
- o && /* @__PURE__ */ e.jsx(qn, {}),
2712
- s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(An, { data: n || [] }),
2713
- l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
2703
+ t ? 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(ka, { isLoading: a, card: s }) }) }) : /* @__PURE__ */ e.jsx(pt, { 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: [
2704
+ o && /* @__PURE__ */ e.jsx(Vn, {}),
2705
+ s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(En, { data: n || [] }),
2706
+ i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
2714
2707
  ] })
2715
2708
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2716
2709
  }
2717
- function qn() {
2718
- const s = i((t) => t.pythonStdOut);
2710
+ function Vn() {
2711
+ const s = l((t) => t.pythonStdOut);
2719
2712
  if (!s)
2720
2713
  return null;
2721
2714
  const n = s.replace(/\n/g, "<br>");
@@ -2731,14 +2724,14 @@ function qn() {
2731
2724
  /* @__PURE__ */ e.jsx(tt, { className: "mb-2" })
2732
2725
  ] });
2733
2726
  }
2734
- function Vn() {
2735
- const s = i((t) => t.isShowingVisual), n = i(
2727
+ function Rn() {
2728
+ const s = l((t) => t.isShowingVisual), n = l(
2736
2729
  (t) => t.actions.setIsShowingVisual
2737
2730
  );
2738
2731
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2739
- /* @__PURE__ */ e.jsx(_, { htmlFor: "visualize", children: "Chart" }),
2732
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
2740
2733
  /* @__PURE__ */ e.jsx(
2741
- Sa,
2734
+ wa,
2742
2735
  {
2743
2736
  checked: s,
2744
2737
  onCheckedChange: () => n(!s),
@@ -2748,15 +2741,15 @@ function Vn() {
2748
2741
  )
2749
2742
  ] });
2750
2743
  }
2751
- function ze() {
2744
+ function Me() {
2752
2745
  const [s, n] = z([]);
2753
- i(
2746
+ l(
2754
2747
  (h) => h.card.cfg
2755
2748
  );
2756
- const t = i((h) => h.card.preferences), { setCardCfg: a, setFilterOnClickColumnIndex: l, setCardPreferences: o } = i((h) => h.actions), r = i(
2749
+ const t = l((h) => h.card.preferences), { setCardCfg: a, setFilterOnClickColumnIndex: i, setCardPreferences: o } = l((h) => h.actions), r = l(
2757
2750
  (h) => h.queryResultColumns
2758
2751
  );
2759
- i(
2752
+ l(
2760
2753
  (h) => {
2761
2754
  var u;
2762
2755
  return (u = h.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
@@ -2765,7 +2758,7 @@ function ze() {
2765
2758
  r && n(new Array(r.length).fill(!1));
2766
2759
  }, [r]);
2767
2760
  function d(h, u) {
2768
- var g, p;
2761
+ var g, f;
2769
2762
  u ? t != null && t.onClickFilter && ((g = t == null ? void 0 : t.onClickFilter) == null ? void 0 : g.length) > 0 ? o({
2770
2763
  ...t,
2771
2764
  onClickFilter: [
@@ -2785,7 +2778,7 @@ function ze() {
2785
2778
  ]
2786
2779
  }) : (o({
2787
2780
  ...t,
2788
- onClickFilter: (p = t == null ? void 0 : t.onClickFilter) == null ? void 0 : p.filter(
2781
+ onClickFilter: (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.filter(
2789
2782
  (j) => j.columnIndex !== h
2790
2783
  )
2791
2784
  }), n((j) => {
@@ -2794,8 +2787,8 @@ function ze() {
2794
2787
  }));
2795
2788
  }
2796
2789
  function c(h, u) {
2797
- var p;
2798
- const g = (p = t == null ? void 0 : t.onClickFilter) == null ? void 0 : p.map((j) => j.columnIndex === h ? {
2790
+ var f;
2791
+ const g = (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.map((j) => j.columnIndex === h ? {
2799
2792
  ...j,
2800
2793
  expression: u.target.value
2801
2794
  } : j);
@@ -2805,12 +2798,12 @@ function ze() {
2805
2798
  });
2806
2799
  }
2807
2800
  function m(h) {
2808
- var u, g, p, j;
2801
+ var u, g, f, j;
2809
2802
  if (s != null && s[h] || (g = (u = t == null ? void 0 : t.onClickFilter) == null ? void 0 : u.find((C) => C.columnIndex === h)) != null && g.expression)
2810
2803
  return /* @__PURE__ */ e.jsx(
2811
- Q,
2804
+ W,
2812
2805
  {
2813
- value: (j = (p = t == null ? void 0 : t.onClickFilter) == null ? void 0 : p.find((C) => C.columnIndex === h)) == null ? void 0 : j.expression,
2806
+ value: (j = (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.find((C) => C.columnIndex === h)) == null ? void 0 : j.expression,
2814
2807
  onChange: (C) => c(h, C),
2815
2808
  type: "text",
2816
2809
  className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
@@ -2819,7 +2812,7 @@ function ze() {
2819
2812
  );
2820
2813
  }
2821
2814
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: r == null ? void 0 : r.map((h, u) => {
2822
- var g, p;
2815
+ var g, f;
2823
2816
  return /* @__PURE__ */ e.jsx(
2824
2817
  "div",
2825
2818
  {
@@ -2842,7 +2835,7 @@ function ze() {
2842
2835
  children: h
2843
2836
  }
2844
2837
  ),
2845
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((p = t == null ? void 0 : t.onClickFilter) == null ? void 0 : p.find(
2838
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.find(
2846
2839
  (j) => j.columnIndex === u
2847
2840
  )) && /* @__PURE__ */ e.jsx(
2848
2841
  lt,
@@ -2866,18 +2859,18 @@ function ze() {
2866
2859
  }
2867
2860
  function Ss() {
2868
2861
  var o, r;
2869
- const s = i((d) => d.card.preferences), n = i(
2862
+ const s = l((d) => d.card.preferences), n = l(
2870
2863
  (d) => d.card.cfg
2871
- ), { setCardCfg: t, setCardPreferences: a } = i(
2864
+ ), { setCardCfg: t, setCardPreferences: a } = l(
2872
2865
  (d) => d.actions
2873
2866
  );
2874
2867
  (o = n == null ? void 0 : n.options) != null && o.indexAxis;
2875
- function l(d) {
2876
- var h, u, g, p, j, C;
2868
+ function i(d) {
2869
+ var h, u, g, f, j, C;
2877
2870
  let c = {};
2878
2871
  (h = s == null ? void 0 : s.chartOptions) != null && h.scales && (c = {
2879
2872
  x: (g = (u = s == null ? void 0 : s.chartOptions) == null ? void 0 : u.scales) == null ? void 0 : g.y,
2880
- y: (j = (p = s == null ? void 0 : s.chartOptions) == null ? void 0 : p.scales) == null ? void 0 : j.x
2873
+ y: (j = (f = s == null ? void 0 : s.chartOptions) == null ? void 0 : f.scales) == null ? void 0 : j.x
2881
2874
  });
2882
2875
  const m = {
2883
2876
  ...s,
@@ -2896,7 +2889,7 @@ function Ss() {
2896
2889
  at,
2897
2890
  {
2898
2891
  value: ((r = s == null ? void 0 : s.chartOptions) == null ? void 0 : r.indexAxis) || "x",
2899
- onValueChange: l,
2892
+ onValueChange: i,
2900
2893
  className: "flex gap-3",
2901
2894
  defaultValue: "x",
2902
2895
  children: [
@@ -2912,65 +2905,68 @@ function Ss() {
2912
2905
  }
2913
2906
  );
2914
2907
  }
2915
- const be = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2908
+ const ve = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2916
2909
  function Hs(s) {
2917
- var t, a, l;
2910
+ var t, a, i;
2918
2911
  const n = nt(s);
2919
- return ((l = (a = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : a[n]) == null ? void 0 : l.type) || "linear";
2912
+ return ((i = (a = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : a[n]) == null ? void 0 : i.type) || "linear";
2920
2913
  }
2921
- function Rn() {
2922
- var H, I, ee, P, se, X;
2923
- const [s, n] = z(!1), t = i((w) => {
2924
- var F;
2925
- return (F = w.card) == null ? void 0 : F.preferences;
2926
- }), a = nt(t), [l, o] = z(
2914
+ function Nt() {
2915
+ var ee, Y, se, Z, J, D;
2916
+ const [s, n] = z(!1), t = l((x) => {
2917
+ var k;
2918
+ return (k = x.card) == null ? void 0 : k.preferences;
2919
+ }), a = nt(t), [i, o] = z(
2927
2920
  Hs(t)
2928
2921
  ), [r, d] = z(
2929
- ((ee = (I = (H = t == null ? void 0 : t.chartOptions) == null ? void 0 : H.scales) == null ? void 0 : I[a]) == null ? void 0 : ee.min) || ""
2922
+ ((se = (Y = (ee = t == null ? void 0 : t.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : Y[a]) == null ? void 0 : se.min) || ""
2930
2923
  ), [c, m] = z(
2931
- ((X = (se = (P = t == null ? void 0 : t.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : se[a]) == null ? void 0 : X.max) || ""
2932
- ), [h, u] = z(r || c ? "custom" : "auto"), [g, p] = z(""), [j, C] = z(""), [v, y] = z(""), [D, A] = z(""), [f, O] = z(""), T = i(
2933
- (w) => w.actions.setCardPreferences
2934
- );
2924
+ ((D = (J = (Z = t == null ? void 0 : t.chartOptions) == null ? void 0 : Z.scales) == null ? void 0 : J[a]) == null ? void 0 : D.max) || ""
2925
+ ), [h, u] = z(r || c ? "custom" : "auto"), [g, f] = z(""), [j, C] = z(""), [v, b] = z(""), [E, T] = z(""), [O, y] = z(""), F = l(
2926
+ (x) => x.actions.setCardPreferences
2927
+ ), A = l((x) => {
2928
+ var k;
2929
+ return (k = x.card) == null ? void 0 : k.type;
2930
+ }), I = ["pie", "doughnut", "polarArea"].includes(A);
2935
2931
  $(() => {
2936
- var w, F, b, L, K, B, de, te, xe, pe, fe, he, J, ae;
2932
+ var x, k, _, B, he, te, pe, fe, ge, ue, Q, ae, ne, je;
2937
2933
  o(Hs(t)), d(
2938
- ((b = (F = (w = t == null ? void 0 : t.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : F[a]) == null ? void 0 : b.min) === 0 ? 0 : ""
2939
- ), m(((B = (K = (L = t == null ? void 0 : t.chartOptions) == null ? void 0 : L.scales) == null ? void 0 : K[a]) == null ? void 0 : B.max) || ""), p(
2940
- ((pe = (xe = (te = (de = t == null ? void 0 : t.chartOptions) == null ? void 0 : de.scales) == null ? void 0 : te[a]) == null ? void 0 : xe.ticks) == null ? void 0 : pe.stepSize) || ""
2941
- ), C(((fe = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : fe.format) || ""), y(((he = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : he.suffix) || ""), A(((J = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : J.currency) || ""), O(((ae = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ae.locale) || "");
2934
+ ((_ = (k = (x = t == null ? void 0 : t.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : k[a]) == null ? void 0 : _.min) === 0 ? 0 : ""
2935
+ ), m(((te = (he = (B = t == null ? void 0 : t.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : he[a]) == null ? void 0 : te.max) || ""), f(
2936
+ ((ue = (ge = (fe = (pe = t == null ? void 0 : t.chartOptions) == null ? void 0 : pe.scales) == null ? void 0 : fe[a]) == null ? void 0 : ge.ticks) == null ? void 0 : ue.stepSize) || ""
2937
+ ), C(((Q = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : Q.format) || ""), b(((ae = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ae.suffix) || ""), T(((ne = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ne.currency) || ""), y(((je = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : je.locale) || "");
2942
2938
  }, [s, t, a]);
2943
- function E(w, F) {
2944
- return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(w);
2939
+ function P(x, k) {
2940
+ return k === "" || /^[0-9\b]+$/.test(k) ? Number(k) : Number(x);
2945
2941
  }
2946
2942
  function U() {
2947
2943
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2948
2944
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
2949
- /* @__PURE__ */ e.jsx(_, { className: "col-span-3", htmlFor: "format", children: "Format" }),
2945
+ /* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "format", children: "Format" }),
2950
2946
  /* @__PURE__ */ e.jsx(
2951
- Q,
2947
+ W,
2952
2948
  {
2953
2949
  value: j,
2954
2950
  placeholder: "000,0.00",
2955
- onChange: (w) => C(w.target.value),
2951
+ onChange: (x) => C(x.target.value),
2956
2952
  id: "format",
2957
- className: `col-span-4 h-8 w-full tracking-wide ${be}`
2953
+ className: `col-span-4 h-8 w-full tracking-wide ${ve}`
2958
2954
  }
2959
2955
  ),
2960
2956
  /* @__PURE__ */ e.jsx(
2961
- Q,
2957
+ W,
2962
2958
  {
2963
2959
  value: v,
2964
2960
  placeholder: "M",
2965
- onChange: (w) => y(w.target.value),
2961
+ onChange: (x) => b(x.target.value),
2966
2962
  id: "unit",
2967
- className: `col-span-2 h-8 w-full ${be}`
2963
+ className: `col-span-2 h-8 w-full ${ve}`
2968
2964
  }
2969
2965
  )
2970
2966
  ] }),
2971
2967
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
2972
2968
  /* @__PURE__ */ e.jsx(
2973
- _,
2969
+ H,
2974
2970
  {
2975
2971
  className: "col-span-2 hover:cursor-pointer hover:underline",
2976
2972
  htmlFor: "currency",
@@ -2985,131 +2981,133 @@ function Rn() {
2985
2981
  }
2986
2982
  ),
2987
2983
  /* @__PURE__ */ e.jsx(
2988
- Q,
2984
+ W,
2989
2985
  {
2990
- value: D,
2986
+ value: E,
2991
2987
  placeholder: "USD",
2992
- onChange: (w) => A(w.target.value),
2988
+ onChange: (x) => T(x.target.value),
2993
2989
  id: "currency",
2994
- className: `col-span-2 h-8 w-full ${be}`
2990
+ className: `col-span-2 h-8 w-full ${ve}`
2995
2991
  }
2996
2992
  ),
2997
2993
  /* @__PURE__ */ e.jsx(
2998
- Q,
2994
+ W,
2999
2995
  {
3000
- value: f,
2996
+ value: O,
3001
2997
  placeholder: "en-US",
3002
- onChange: (w) => O(w.target.value),
2998
+ onChange: (x) => y(x.target.value),
3003
2999
  id: "locale",
3004
- className: `col-span-2 h-8 w-full ${be}`
3000
+ className: `col-span-2 h-8 w-full ${ve}`
3005
3001
  }
3006
3002
  )
3007
3003
  ] })
3008
3004
  ] });
3009
3005
  }
3010
- function Z() {
3006
+ function G() {
3011
3007
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3012
3008
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3013
- /* @__PURE__ */ e.jsx(_, { htmlFor: "range", children: "Range" }),
3009
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
3014
3010
  /* @__PURE__ */ e.jsx(
3015
- Q,
3011
+ W,
3016
3012
  {
3017
3013
  id: "min",
3018
3014
  value: r,
3019
- onChange: (w) => d((F) => E(F, w.target.value)),
3020
- className: `col-span-1 h-8 w-full ${be}`
3015
+ onChange: (x) => d((k) => P(k, x.target.value)),
3016
+ className: `col-span-1 h-8 w-full ${ve}`
3021
3017
  }
3022
3018
  ),
3023
3019
  /* @__PURE__ */ e.jsx(
3024
- Q,
3020
+ W,
3025
3021
  {
3026
3022
  value: c,
3027
- onChange: (w) => m((F) => E(F, w.target.value)),
3023
+ onChange: (x) => m((k) => P(k, x.target.value)),
3028
3024
  id: "max",
3029
- className: `col-span-1 h-8 w-full ${be}`
3025
+ className: `col-span-1 h-8 w-full ${ve}`
3030
3026
  }
3031
3027
  )
3032
3028
  ] }),
3033
3029
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3034
- /* @__PURE__ */ e.jsx(_, { htmlFor: "step-size", children: "Step Size" }),
3030
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "step-size", children: "Step Size" }),
3035
3031
  /* @__PURE__ */ e.jsx(
3036
- Q,
3032
+ W,
3037
3033
  {
3038
3034
  value: g,
3039
- onChange: (w) => p((F) => E(F, w.target.value)),
3035
+ onChange: (x) => f((k) => P(k, x.target.value)),
3040
3036
  id: "step-size",
3041
- className: `col-span-1 h-8 w-full ${be}`
3037
+ className: `col-span-1 h-8 w-full ${ve}`
3042
3038
  }
3043
3039
  )
3044
3040
  ] })
3045
3041
  ] });
3046
3042
  }
3047
- function G() {
3048
- var b;
3049
- let w = {};
3050
- h === "custom" && (w = {
3043
+ function L() {
3044
+ var _;
3045
+ let x = {};
3046
+ h === "custom" && (x = {
3051
3047
  min: r,
3052
3048
  max: c,
3053
3049
  ticks: {
3054
3050
  stepSize: g
3055
3051
  }
3056
3052
  });
3057
- const F = {
3053
+ const k = {
3058
3054
  ...t || {},
3059
3055
  chartOptions: {
3060
3056
  ...t == null ? void 0 : t.chartOptions,
3061
3057
  scales: {
3062
- ...(b = t == null ? void 0 : t.chartOptions) == null ? void 0 : b.scales,
3058
+ ...(_ = t == null ? void 0 : t.chartOptions) == null ? void 0 : _.scales,
3063
3059
  [a]: {
3064
3060
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3065
- type: l,
3066
- ...l === "linear" ? w : {}
3061
+ type: i,
3062
+ ...i === "linear" ? x : {}
3067
3063
  }
3068
3064
  }
3069
3065
  },
3070
3066
  numberAxisFormat: {
3071
3067
  format: j,
3072
3068
  suffix: v,
3073
- currency: D,
3074
- locale: f
3069
+ currency: E,
3070
+ locale: O
3075
3071
  }
3076
3072
  };
3077
- T(F);
3073
+ F(k);
3078
3074
  }
3079
- return /* @__PURE__ */ e.jsxs(Ie, { onOpenChange: (w) => n(w), children: [
3080
- /* @__PURE__ */ e.jsx(qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(ka, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3081
- /* @__PURE__ */ e.jsx(Ve, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3075
+ return /* @__PURE__ */ e.jsxs(qe, { onOpenChange: (x) => n(x), children: [
3076
+ /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3077
+ /* @__PURE__ */ e.jsx(Re, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3082
3078
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3083
3079
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
3084
3080
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
3085
3081
  ] }),
3086
3082
  /* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
3087
3083
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3088
- /* @__PURE__ */ e.jsx(_, { htmlFor: "scale", children: "Type" }),
3084
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "scale", children: "Type" }),
3089
3085
  /* @__PURE__ */ e.jsxs(
3090
3086
  xs,
3091
3087
  {
3092
- value: l,
3093
- onValueChange: (w) => o(w),
3088
+ disabled: I,
3089
+ value: i,
3090
+ onValueChange: (x) => o(x),
3094
3091
  children: [
3095
3092
  /* @__PURE__ */ e.jsx(ps, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(fs, {}) }),
3096
3093
  /* @__PURE__ */ e.jsx(gs, { id: "type", children: /* @__PURE__ */ e.jsxs(js, { children: [
3097
3094
  /* @__PURE__ */ e.jsx(Ke, { children: "Option" }),
3098
- /* @__PURE__ */ e.jsx(me, { value: "linear", children: "Linear" }),
3099
- /* @__PURE__ */ e.jsx(me, { value: "logarithmic", children: "Logarithmic" })
3095
+ /* @__PURE__ */ e.jsx(xe, { value: "linear", children: "Linear" }),
3096
+ /* @__PURE__ */ e.jsx(xe, { value: "logarithmic", children: "Logarithmic" })
3100
3097
  ] }) })
3101
3098
  ]
3102
3099
  }
3103
3100
  )
3104
3101
  ] }),
3105
- l == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3106
- /* @__PURE__ */ e.jsx(_, { htmlFor: "scale-option", children: "Setup" }),
3102
+ i == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3103
+ /* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
3107
3104
  /* @__PURE__ */ e.jsxs(
3108
3105
  at,
3109
3106
  {
3107
+ disabled: I,
3110
3108
  id: "scale-option",
3111
3109
  value: h,
3112
- onValueChange: (w) => u(w),
3110
+ onValueChange: (x) => u(x),
3113
3111
  className: "col-span-2 flex gap-3",
3114
3112
  defaultValue: "x",
3115
3113
  children: [
@@ -3125,13 +3123,13 @@ function Rn() {
3125
3123
  }
3126
3124
  )
3127
3125
  ] }),
3128
- h === "custom" && l == "linear" && Z(),
3126
+ h === "custom" && i == "linear" && G(),
3129
3127
  U(),
3130
- /* @__PURE__ */ e.jsx(wa, {}),
3128
+ /* @__PURE__ */ e.jsx(Oa, {}),
3131
3129
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3132
- k,
3130
+ w,
3133
3131
  {
3134
- onClick: G,
3132
+ onClick: L,
3135
3133
  variant: "secondary",
3136
3134
  className: "col-span-1 col-start-3 h-8 w-full",
3137
3135
  children: "Apply"
@@ -3143,19 +3141,19 @@ function Rn() {
3143
3141
  }
3144
3142
  function _n({ idx: s }) {
3145
3143
  var d;
3146
- const n = i((c) => {
3144
+ const n = l((c) => {
3147
3145
  var m;
3148
3146
  return (m = c.card) == null ? void 0 : m.preferences;
3149
- }), t = i(
3147
+ }), t = l(
3150
3148
  (c) => {
3151
3149
  var m;
3152
3150
  return (m = c.card.preferences) == null ? void 0 : m.datasetOptions;
3153
3151
  }
3154
- ), a = i(
3152
+ ), a = l(
3155
3153
  (c) => c.actions.setCardPreferences
3156
- ), l = (d = n == null ? void 0 : n.chartOptions) == null ? void 0 : d.indexAxis, o = t == null ? void 0 : t.find((c) => c.idx === s);
3154
+ ), i = (d = n == null ? void 0 : n.chartOptions) == null ? void 0 : d.indexAxis, o = t == null ? void 0 : t.find((c) => c.idx === s);
3157
3155
  function r(c, m) {
3158
- (c === "end" || c === "start") && Oa(za());
3156
+ (c === "end" || c === "start") && Ma(Ta());
3159
3157
  const h = {
3160
3158
  display: c !== "none",
3161
3159
  align: c,
@@ -3177,7 +3175,7 @@ function _n({ idx: s }) {
3177
3175
  const u = { ...o };
3178
3176
  u.datalabels = h;
3179
3177
  const g = t == null ? void 0 : t.map(
3180
- (p) => p.idx === m ? u : p
3178
+ (f) => f.idx === m ? u : f
3181
3179
  );
3182
3180
  a({
3183
3181
  ...n,
@@ -3185,65 +3183,65 @@ function _n({ idx: s }) {
3185
3183
  });
3186
3184
  }
3187
3185
  }
3188
- return /* @__PURE__ */ e.jsxs(Ie, { children: [
3189
- /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsx(ln, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3190
- /* @__PURE__ */ e.jsx(Ve, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3186
+ return /* @__PURE__ */ e.jsxs(qe, { children: [
3187
+ /* @__PURE__ */ e.jsx(Ve, { children: /* @__PURE__ */ e.jsx(on, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3188
+ /* @__PURE__ */ e.jsx(Re, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3191
3189
  /* @__PURE__ */ e.jsx(
3192
- k,
3190
+ w,
3193
3191
  {
3194
3192
  onClick: () => r("none", s),
3195
3193
  size: "sm",
3196
3194
  variant: "secondary",
3197
3195
  className: "h-7 p-1 text-xs font-normal",
3198
- children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4" })
3196
+ children: /* @__PURE__ */ e.jsx(za, { className: "size-4" })
3199
3197
  }
3200
3198
  ),
3201
3199
  /* @__PURE__ */ e.jsx(
3202
- k,
3200
+ w,
3203
3201
  {
3204
3202
  onClick: () => r("start", s),
3205
3203
  size: "sm",
3206
3204
  variant: "secondary",
3207
3205
  className: "h-7 p-1 text-xs font-normal",
3208
3206
  children: /* @__PURE__ */ e.jsx(
3209
- Ya,
3207
+ Xa,
3210
3208
  {
3211
- className: W("h-4 w-4", {
3212
- "rotate-90": l === "y"
3209
+ className: K("h-4 w-4", {
3210
+ "rotate-90": i === "y"
3213
3211
  })
3214
3212
  }
3215
3213
  )
3216
3214
  }
3217
3215
  ),
3218
3216
  /* @__PURE__ */ e.jsx(
3219
- k,
3217
+ w,
3220
3218
  {
3221
3219
  onClick: () => r("center", s),
3222
3220
  size: "sm",
3223
3221
  variant: "secondary",
3224
3222
  className: "h-7 p-1 text-xs font-normal",
3225
3223
  children: /* @__PURE__ */ e.jsx(
3226
- Za,
3224
+ en,
3227
3225
  {
3228
- className: W("h-4 w-4", {
3229
- "rotate-90": l === "y"
3226
+ className: K("h-4 w-4", {
3227
+ "rotate-90": i === "y"
3230
3228
  })
3231
3229
  }
3232
3230
  )
3233
3231
  }
3234
3232
  ),
3235
3233
  /* @__PURE__ */ e.jsx(
3236
- k,
3234
+ w,
3237
3235
  {
3238
3236
  onClick: () => r("end", s),
3239
3237
  size: "sm",
3240
3238
  variant: "secondary",
3241
3239
  className: "h-7 p-1 text-xs font-normal",
3242
3240
  children: /* @__PURE__ */ e.jsx(
3243
- Xa,
3241
+ Za,
3244
3242
  {
3245
- className: W("h-4 w-4", {
3246
- "rotate-90": l === "y"
3243
+ className: K("h-4 w-4", {
3244
+ "rotate-90": i === "y"
3247
3245
  })
3248
3246
  }
3249
3247
  )
@@ -3252,20 +3250,20 @@ function _n({ idx: s }) {
3252
3250
  ] }) })
3253
3251
  ] });
3254
3252
  }
3255
- function Nt() {
3256
- const s = i((c) => c.card), n = i(
3253
+ function Ct() {
3254
+ const s = l((c) => c.card), n = l(
3257
3255
  (c) => {
3258
3256
  var m, h, u;
3259
3257
  return (u = (h = (m = c == null ? void 0 : c.card) == null ? void 0 : m.preferences) == null ? void 0 : h.chartOptions) == null ? void 0 : u.indexAxis;
3260
3258
  }
3261
3259
  ), t = n === "y" ? "Y axis" : "X axis", a = n === "y" ? "X axis" : "Y axis", {
3262
- keys: l,
3260
+ keys: i,
3263
3261
  metricKeys: o,
3264
3262
  dimensionKeys: r
3265
3263
  } = ns(s.data || []);
3266
3264
  let d = o;
3267
3265
  if (s.type === "stackedBar") {
3268
- const c = Ma({
3266
+ const c = Aa({
3269
3267
  dataArray: s.data || [],
3270
3268
  groupKey: r[0],
3271
3269
  pivotKey: r[1],
@@ -3273,32 +3271,32 @@ function Nt() {
3273
3271
  }), { metricKeys: m } = ns(c);
3274
3272
  d = m;
3275
3273
  }
3276
- return l.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3274
+ return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3277
3275
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3278
- /* @__PURE__ */ e.jsx(_, { children: t }),
3276
+ /* @__PURE__ */ e.jsx(H, { children: t }),
3279
3277
  /* @__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] }) }) })
3280
3278
  ] }),
3281
3279
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3282
3280
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3283
- /* @__PURE__ */ e.jsx(_, { children: a }),
3284
- /* @__PURE__ */ e.jsx(Rn, {})
3281
+ /* @__PURE__ */ e.jsx(H, { children: a }),
3282
+ /* @__PURE__ */ e.jsx(Nt, {})
3285
3283
  ] }),
3286
3284
  /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((c, m) => /* @__PURE__ */ e.jsx(Hn, { col: c, idx: m }, c)) })
3287
3285
  ] })
3288
3286
  ] });
3289
3287
  }
3290
3288
  function Hn({ col: s, idx: n }) {
3291
- const t = i((d) => {
3289
+ const t = l((d) => {
3292
3290
  var c;
3293
3291
  return (c = d.card) == null ? void 0 : c.preferences;
3294
- }), a = i(
3292
+ }), a = l(
3295
3293
  (d) => {
3296
3294
  var c;
3297
3295
  return (c = d.card.preferences) == null ? void 0 : c.datasetOptions;
3298
3296
  }
3299
- ), l = a == null ? void 0 : a.find((d) => d.idx === n), { setCardPreferences: o } = i((d) => d.actions);
3297
+ ), i = a == null ? void 0 : a.find((d) => d.idx === n), { setCardPreferences: o } = l((d) => d.actions);
3300
3298
  function r(d) {
3301
- if (!l)
3299
+ if (!i)
3302
3300
  o({
3303
3301
  ...t,
3304
3302
  datasetOptions: [
@@ -3311,7 +3309,7 @@ function Hn({ col: s, idx: n }) {
3311
3309
  ]
3312
3310
  });
3313
3311
  else {
3314
- const c = { ...l };
3312
+ const c = { ...i };
3315
3313
  c.type = d === "area" ? "line" : d, c.fill = d === "area" ? "origin" : "";
3316
3314
  const m = a == null ? void 0 : a.map(
3317
3315
  (h) => h.idx === n ? c : h
@@ -3326,21 +3324,21 @@ function Hn({ col: s, idx: n }) {
3326
3324
  /* @__PURE__ */ e.jsx("p", { children: s }),
3327
3325
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3328
3326
  /* @__PURE__ */ e.jsx(
3329
- vs,
3327
+ Ns,
3330
3328
  {
3331
3329
  onClick: () => r("bar"),
3332
3330
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3333
3331
  }
3334
3332
  ),
3335
3333
  /* @__PURE__ */ e.jsx(
3336
- Ns,
3334
+ Cs,
3337
3335
  {
3338
3336
  onClick: () => r("line"),
3339
3337
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3340
3338
  }
3341
3339
  ),
3342
3340
  /* @__PURE__ */ e.jsx(
3343
- Ha,
3341
+ $a,
3344
3342
  {
3345
3343
  onClick: () => r("area"),
3346
3344
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
@@ -3360,9 +3358,9 @@ function Hn({ col: s, idx: n }) {
3360
3358
  function Bn({
3361
3359
  cardType: s
3362
3360
  }) {
3363
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(ve, { defaultValue: ["item-2"], type: "multiple", children: [
3361
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
3364
3362
  /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3365
- /* @__PURE__ */ e.jsx(V, { children: `${ys(s)} Chart` }),
3363
+ /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3366
3364
  /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 font-mono text-xs", children: [
3367
3365
  /* @__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" }),
3368
3366
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -3390,20 +3388,20 @@ function Bn({
3390
3388
  /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3391
3389
  /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
3392
3390
  /* @__PURE__ */ e.jsx(Ss, {}),
3393
- /* @__PURE__ */ e.jsx(Nt, {})
3391
+ /* @__PURE__ */ e.jsx(Ct, {})
3394
3392
  ] })
3395
3393
  ] }),
3396
3394
  /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3397
3395
  /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3398
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ze, {}) })
3396
+ /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
3399
3397
  ] })
3400
3398
  ] }) });
3401
3399
  }
3402
3400
  function ks() {
3403
- var a, l, o;
3404
- const s = i(
3401
+ var a, i, o;
3402
+ const s = l(
3405
3403
  (r) => r.card.cfg
3406
- ), n = i((r) => r.actions.setCardCfg);
3404
+ ), n = l((r) => r.actions.setCardCfg);
3407
3405
  function t(r) {
3408
3406
  var m;
3409
3407
  const d = {
@@ -3426,21 +3424,24 @@ function ks() {
3426
3424
  n(c), console.log(r);
3427
3425
  }
3428
3426
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3429
- /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3427
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3428
+ /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3429
+ /* @__PURE__ */ e.jsx(Nt, {})
3430
+ ] }),
3430
3431
  /* @__PURE__ */ e.jsxs(
3431
3432
  xs,
3432
3433
  {
3433
- value: (o = (l = (a = s == null ? void 0 : s.options) == null ? void 0 : a.plugins) == null ? void 0 : l.datalabels) == null ? void 0 : o.anchor,
3434
+ value: (o = (i = (a = s == null ? void 0 : s.options) == null ? void 0 : a.plugins) == null ? void 0 : i.datalabels) == null ? void 0 : o.anchor,
3434
3435
  onValueChange: t,
3435
3436
  defaultValue: "none",
3436
3437
  children: [
3437
- /* @__PURE__ */ e.jsx(ps, { className: "h-8 w-[180px] focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(fs, { placeholder: "Select position" }) }),
3438
+ /* @__PURE__ */ e.jsx(ps, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(fs, { placeholder: "Select position" }) }),
3438
3439
  /* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsxs(js, { children: [
3439
3440
  /* @__PURE__ */ e.jsx(Ke, { children: "Data Labels" }),
3440
- /* @__PURE__ */ e.jsx(me, { value: "none", children: "None" }),
3441
- /* @__PURE__ */ e.jsx(me, { value: "start", children: "Start" }),
3442
- /* @__PURE__ */ e.jsx(me, { value: "center", children: "Center" }),
3443
- /* @__PURE__ */ e.jsx(me, { value: "end", children: "End" })
3441
+ /* @__PURE__ */ e.jsx(xe, { value: "none", children: "None" }),
3442
+ /* @__PURE__ */ e.jsx(xe, { value: "start", children: "Start" }),
3443
+ /* @__PURE__ */ e.jsx(xe, { value: "center", children: "Center" }),
3444
+ /* @__PURE__ */ e.jsx(xe, { value: "end", children: "End" })
3444
3445
  ] }) })
3445
3446
  ]
3446
3447
  }
@@ -3451,9 +3452,9 @@ function $n({
3451
3452
  cardType: s
3452
3453
  }) {
3453
3454
  function n(t) {
3454
- const a = "SELECT label, [group], x-axis, y-axis, radius FROM table", l = "SELECT label, [group], x-axis, y-axis FROM table";
3455
+ const a = "SELECT label, [group], x-axis, y-axis, radius FROM table", i = "SELECT label, [group], x-axis, y-axis FROM table";
3455
3456
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3456
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: t === "bubble" ? a : l }),
3457
+ /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: t === "bubble" ? a : i }),
3457
3458
  /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
3458
3459
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3459
3460
  /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
@@ -3477,9 +3478,9 @@ function $n({
3477
3478
  ] })
3478
3479
  ] });
3479
3480
  }
3480
- return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(ve, { defaultValue: ["item-2"], type: "multiple", children: [
3481
+ return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
3481
3482
  /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3482
- /* @__PURE__ */ e.jsx(V, { children: `${ys(s)} Chart` }),
3483
+ /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3483
3484
  /* @__PURE__ */ e.jsx(R, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3484
3485
  ] }),
3485
3486
  /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
@@ -3488,7 +3489,7 @@ function $n({
3488
3489
  ] }),
3489
3490
  /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3490
3491
  /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3491
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ze, {}) })
3492
+ /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
3492
3493
  ] })
3493
3494
  ] }) });
3494
3495
  }
@@ -3516,10 +3517,10 @@ const Kn = {
3516
3517
  ]
3517
3518
  };
3518
3519
  function Gn() {
3519
- const s = i((n) => n.card.type);
3520
+ const s = l((n) => n.card.type);
3520
3521
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6 space-y-6", children: [
3521
3522
  /* @__PURE__ */ e.jsx(
3522
- ve,
3523
+ Ce,
3523
3524
  {
3524
3525
  className: " ",
3525
3526
  type: "single",
@@ -3529,7 +3530,7 @@ function Gn() {
3529
3530
  ),
3530
3531
  /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Ss, {}) }),
3531
3532
  /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(ks, {}) }),
3532
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(ze, {}) })
3533
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Me, {}) })
3533
3534
  ] });
3534
3535
  }
3535
3536
  function Jn(s) {
@@ -3631,27 +3632,27 @@ function Jn(s) {
3631
3632
  }
3632
3633
  function Qn() {
3633
3634
  var r, d, c;
3634
- const s = i((m) => m.card.preferences), n = i(
3635
+ const s = l((m) => m.card.preferences), n = l(
3635
3636
  (m) => m.actions.setCardPreferences
3636
- ), t = i(
3637
+ ), t = l(
3637
3638
  (m) => m.actions.setNumberFormat
3638
- ), a = i(
3639
+ ), a = l(
3639
3640
  (m) => {
3640
3641
  var h, u;
3641
3642
  return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.format;
3642
3643
  }
3643
- ), l = i(
3644
+ ), i = l(
3644
3645
  (m) => {
3645
3646
  var h, u;
3646
3647
  return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.locale;
3647
3648
  }
3648
- ), o = i(
3649
+ ), o = l(
3649
3650
  (m) => {
3650
3651
  var h, u;
3651
3652
  return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.currency;
3652
3653
  }
3653
3654
  );
3654
- return i(
3655
+ return l(
3655
3656
  (m) => m.actions.setFilterOnClickField
3656
3657
  ), /* @__PURE__ */ e.jsxs("div", { children: [
3657
3658
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
@@ -3670,14 +3671,14 @@ function Qn() {
3670
3671
  }
3671
3672
  }
3672
3673
  ),
3673
- /* @__PURE__ */ e.jsx(_, { children: "Format Number" })
3674
+ /* @__PURE__ */ e.jsx(H, { children: "Format Number" })
3674
3675
  ] }),
3675
3676
  ((d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
3676
3677
  /* @__PURE__ */ e.jsxs("div", { children: [
3677
- /* @__PURE__ */ e.jsx(_, { className: "text-xs", children: "Currency" }),
3678
+ /* @__PURE__ */ e.jsx(H, { className: "text-xs", children: "Currency" }),
3678
3679
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3679
3680
  /* @__PURE__ */ e.jsx(
3680
- Q,
3681
+ W,
3681
3682
  {
3682
3683
  value: o || "",
3683
3684
  className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
@@ -3694,9 +3695,9 @@ function Qn() {
3694
3695
  }
3695
3696
  ),
3696
3697
  /* @__PURE__ */ e.jsx(
3697
- Q,
3698
+ W,
3698
3699
  {
3699
- value: l || "",
3700
+ value: i || "",
3700
3701
  className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3701
3702
  placeholder: "en-US",
3702
3703
  onChange: (m) => {
@@ -3714,7 +3715,7 @@ function Qn() {
3714
3715
  ] }),
3715
3716
  /* @__PURE__ */ e.jsxs("div", { children: [
3716
3717
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3717
- /* @__PURE__ */ e.jsx(_, { className: "text-xs", children: "Format" }),
3718
+ /* @__PURE__ */ e.jsx(H, { className: "text-xs", children: "Format" }),
3718
3719
  /* @__PURE__ */ e.jsxs(We, { children: [
3719
3720
  /* @__PURE__ */ e.jsx(ms, { children: /* @__PURE__ */ e.jsx(
3720
3721
  Zs,
@@ -3730,7 +3731,7 @@ function Qn() {
3730
3731
  ] })
3731
3732
  ] }),
3732
3733
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
3733
- Q,
3734
+ W,
3734
3735
  {
3735
3736
  value: a || "",
3736
3737
  className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
@@ -3748,9 +3749,9 @@ function Qn() {
3748
3749
  ) })
3749
3750
  ] }),
3750
3751
  /* @__PURE__ */ e.jsxs("div", { children: [
3751
- /* @__PURE__ */ e.jsx(_, { className: "text-xs", children: "Suffix" }),
3752
+ /* @__PURE__ */ e.jsx(H, { className: "text-xs", children: "Suffix" }),
3752
3753
  /* @__PURE__ */ e.jsx(
3753
- Q,
3754
+ W,
3754
3755
  {
3755
3756
  value: ((c = s == null ? void 0 : s.formatNumber) == null ? void 0 : c.suffix) || "",
3756
3757
  className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
@@ -3772,7 +3773,7 @@ function Qn() {
3772
3773
  }
3773
3774
  function Wn() {
3774
3775
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3775
- /* @__PURE__ */ e.jsx(ve, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3776
+ /* @__PURE__ */ e.jsx(Ce, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3776
3777
  /* @__PURE__ */ e.jsx(V, { className: "", children: "KPI Query" }),
3777
3778
  /* @__PURE__ */ e.jsxs(R, { className: "font-mono", children: [
3778
3779
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
@@ -3804,9 +3805,9 @@ function Wn() {
3804
3805
  function Pn({
3805
3806
  cardType: s
3806
3807
  }) {
3807
- return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(ve, { defaultValue: ["item-2"], type: "multiple", children: [
3808
+ return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
3808
3809
  /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3809
- /* @__PURE__ */ e.jsx(V, { children: `${ys(s)} Chart` }),
3810
+ /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3810
3811
  /* @__PURE__ */ e.jsxs(R, { className: " space-y-4 font-mono text-xs ", children: [
3811
3812
  /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: "SELECT label, measure FROM table" }),
3812
3813
  /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
@@ -3835,12 +3836,12 @@ function Pn({
3835
3836
  ] }),
3836
3837
  /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3837
3838
  /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3838
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ze, {}) })
3839
+ /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
3839
3840
  ] })
3840
3841
  ] }) });
3841
3842
  }
3842
3843
  function Yn() {
3843
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(ve, { defaultValue: ["item-2"], type: "multiple", children: [
3844
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
3844
3845
  /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3845
3846
  /* @__PURE__ */ e.jsx(V, { children: "Stacked Chart" }),
3846
3847
  /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 font-mono text-xs", children: [
@@ -3870,25 +3871,25 @@ function Yn() {
3870
3871
  /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3871
3872
  /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
3872
3873
  /* @__PURE__ */ e.jsx(Ss, {}),
3873
- /* @__PURE__ */ e.jsx(Nt, {})
3874
+ /* @__PURE__ */ e.jsx(Ct, {})
3874
3875
  ] })
3875
3876
  ] }),
3876
3877
  /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3877
3878
  /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3878
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ze, {}) })
3879
+ /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
3879
3880
  ] })
3880
3881
  ] }) });
3881
3882
  }
3882
3883
  function Xn({
3883
3884
  cardType: s
3884
3885
  }) {
3885
- return console.log("TableVisualSettings", s), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsx(ve, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3886
+ return console.log("TableVisualSettings", s), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsx(Ce, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3886
3887
  /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3887
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ze, {}) })
3888
+ /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
3888
3889
  ] }) }) });
3889
3890
  }
3890
3891
  function Zn() {
3891
- const s = i((t) => t.card.type);
3892
+ const s = l((t) => t.card.type);
3892
3893
  function n(t) {
3893
3894
  switch (t) {
3894
3895
  case "stackedBar":
@@ -3912,10 +3913,10 @@ function Zn() {
3912
3913
  return /* @__PURE__ */ e.jsx(Gn, {});
3913
3914
  }
3914
3915
  }
3915
- return /* @__PURE__ */ e.jsx(bs, { className: "h-full w-full text-sm", children: n(s) });
3916
+ return /* @__PURE__ */ e.jsx(ys, { className: "h-full w-full text-sm", children: n(s) });
3916
3917
  }
3917
3918
  function er() {
3918
- const s = i((n) => n.isShowingVisual);
3919
+ const s = l((n) => n.isShowingVisual);
3919
3920
  return /* @__PURE__ */ e.jsxs(
3920
3921
  rs,
3921
3922
  {
@@ -3923,18 +3924,18 @@ function er() {
3923
3924
  className: "min-w-full max-w-lg min-h-[250px]",
3924
3925
  children: [
3925
3926
  /* @__PURE__ */ e.jsx(
3926
- Fe,
3927
+ Oe,
3927
3928
  {
3928
3929
  role: "query-section",
3929
3930
  className: "flex",
3930
3931
  minSize: 20,
3931
3932
  defaultSize: 40,
3932
- children: /* @__PURE__ */ e.jsx(Tn, {})
3933
+ children: /* @__PURE__ */ e.jsx(An, {})
3933
3934
  }
3934
3935
  ),
3935
3936
  /* @__PURE__ */ e.jsx(ls, { withHandle: !0, className: "border " }),
3936
3937
  /* @__PURE__ */ e.jsx(
3937
- Fe,
3938
+ Oe,
3938
3939
  {
3939
3940
  className: "pb-1",
3940
3941
  role: "visual-section",
@@ -3942,7 +3943,7 @@ function er() {
3942
3943
  defaultSize: 60,
3943
3944
  children: s ? /* @__PURE__ */ e.jsxs(rs, { direction: "horizontal", children: [
3944
3945
  /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
3945
- Fe,
3946
+ Oe,
3946
3947
  {
3947
3948
  className: "flex min-w-[275px]",
3948
3949
  minSize: 20,
@@ -3952,7 +3953,7 @@ function er() {
3952
3953
  }
3953
3954
  ) }),
3954
3955
  /* @__PURE__ */ e.jsx(ls, { className: "border " }),
3955
- /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(_s, {}) })
3956
+ /* @__PURE__ */ e.jsx(Oe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(_s, {}) })
3956
3957
  ] }) : /* @__PURE__ */ e.jsx(_s, {})
3957
3958
  }
3958
3959
  )
@@ -3961,20 +3962,20 @@ function er() {
3961
3962
  );
3962
3963
  }
3963
3964
  function sr({ authToken: s, onSave: n, onClose: t }) {
3964
- const a = i((r) => r.actions.setOnSave), l = i((r) => r.actions.setOnClose), o = S((r) => r.actions.setAuthToken);
3965
+ const a = l((r) => r.actions.setOnSave), i = l((r) => r.actions.setOnClose), o = S((r) => r.actions.setAuthToken);
3965
3966
  return $(() => {
3966
- n && a(n), t && l(t);
3967
- }, [n, a, t, l]), $(() => {
3967
+ n && a(n), t && i(t);
3968
+ }, [n, a, t, i]), $(() => {
3968
3969
  s && s.accessToken && o(s);
3969
- }, [s, o]), /* @__PURE__ */ e.jsxs(Ta, { className: "rounded-none", role: "editor-panel", children: [
3970
- /* @__PURE__ */ e.jsx(Aa, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(ut, {}) }),
3971
- /* @__PURE__ */ e.jsx(Ea, { children: /* @__PURE__ */ e.jsx(er, {}) })
3970
+ }, [s, o]), /* @__PURE__ */ e.jsxs(Ea, { className: "rounded-none", role: "editor-panel", children: [
3971
+ /* @__PURE__ */ e.jsx(La, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(ut, {}) }),
3972
+ /* @__PURE__ */ e.jsx(Da, { children: /* @__PURE__ */ e.jsx(er, {}) })
3972
3973
  ] });
3973
3974
  }
3974
3975
  function tr() {
3975
3976
  S((r) => r.selectedCardId);
3976
3977
  const s = S((r) => r.selectedSheetId), { setIsVisualEditing: n } = S((r) => r.actions), t = S((r) => r.isVisualEditing), a = S((r) => r.actions.updateFrame);
3977
- function l(r) {
3978
+ function i(r) {
3978
3979
  s && (a(s, r), n(!1));
3979
3980
  }
3980
3981
  function o() {
@@ -3984,11 +3985,11 @@ function tr() {
3984
3985
  "div",
3985
3986
  {
3986
3987
  role: "editor-container",
3987
- className: W("flex grow", {
3988
+ className: K("flex grow", {
3988
3989
  block: t,
3989
3990
  hidden: !t
3990
3991
  }),
3991
- children: /* @__PURE__ */ e.jsx(sr, { onSave: l, onClose: o })
3992
+ children: /* @__PURE__ */ e.jsx(sr, { onSave: i, onClose: o })
3992
3993
  }
3993
3994
  );
3994
3995
  }
@@ -3996,30 +3997,30 @@ function ar({
3996
3997
  columns: s,
3997
3998
  tableName: n
3998
3999
  }) {
3999
- const t = i((u) => u.selectedConnectionId), a = i((u) => u.selectedDatabaseName), l = i((u) => u.selectedSchemaName), o = i((u) => u.selectedTableName), r = S((u) => u.dashboard.filters) || [], d = S((u) => u.actions.addFilter), c = S((u) => u.actions.removeFilter), m = S(
4000
+ const t = l((u) => u.selectedConnectionId), a = l((u) => u.selectedDatabaseName), i = l((u) => u.selectedSchemaName), o = l((u) => u.selectedTableName), r = S((u) => u.dashboard.filters) || [], d = S((u) => u.actions.addFilter), c = S((u) => u.actions.removeFilter), m = S(
4000
4001
  (u) => u.actions.removeFilterValue
4001
4002
  );
4002
4003
  function h(u) {
4003
- const g = oe(u.column_name), p = oe(a || ""), j = oe(l || ""), C = oe(n), v = as(
4004
+ const g = ce(u.column_name), f = ce(a || ""), j = ce(i || ""), C = ce(n), v = as(
4004
4005
  j,
4005
4006
  C
4006
- ), y = `${v}.${g}`;
4007
+ ), b = `${v}.${g}`;
4007
4008
  console.log(
4008
4009
  "find",
4009
- y,
4010
+ b,
4010
4011
  C,
4011
- p
4012
+ f
4012
4013
  );
4013
- const D = r == null ? void 0 : r.find(
4014
- (A) => A.column === y && A.table === C && (A.database === p || A.database === a)
4014
+ const E = r == null ? void 0 : r.find(
4015
+ (T) => T.column === b && T.table === C && (T.database === f || T.database === a)
4015
4016
  );
4016
- if (D)
4017
- m(D.id), c(D.id);
4017
+ if (E)
4018
+ m(E.id), c(E.id);
4018
4019
  else {
4019
4020
  if (n === "api" && t) {
4020
4021
  d({
4021
4022
  id: $e(),
4022
- column: y,
4023
+ column: b,
4023
4024
  title: u.column_name,
4024
4025
  dataType: u.data_type,
4025
4026
  table: "api",
@@ -4056,13 +4057,13 @@ function ar({
4056
4057
  }
4057
4058
  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) => {
4058
4059
  const g = r == null ? void 0 : r.find(
4059
- (p) => p.column === oe(u.column_name) && p.table === o && p.database === a
4060
+ (f) => f.column === ce(u.column_name) && f.table === o && f.database === a
4060
4061
  );
4061
4062
  return /* @__PURE__ */ e.jsx(
4062
4063
  "div",
4063
4064
  {
4064
4065
  onClick: () => h(u),
4065
- className: W(
4066
+ className: K(
4066
4067
  "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",
4067
4068
  {
4068
4069
  "bg-muted": g
@@ -4084,14 +4085,14 @@ function nr() {
4084
4085
  );
4085
4086
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
4086
4087
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
4087
- /* @__PURE__ */ e.jsx(_, { className: "text-lg", children: "Filters" }),
4088
+ /* @__PURE__ */ e.jsx(H, { className: "text-lg", children: "Filters" }),
4088
4089
  /* @__PURE__ */ e.jsx(
4089
- k,
4090
+ w,
4090
4091
  {
4091
4092
  onClick: () => s(!1),
4092
4093
  className: "h-7 w-7 p-0",
4093
4094
  variant: "ghost",
4094
- children: /* @__PURE__ */ e.jsx(Ee, {})
4095
+ children: /* @__PURE__ */ e.jsx(Le, {})
4095
4096
  }
4096
4097
  )
4097
4098
  ] }),
@@ -4117,12 +4118,12 @@ function rr() {
4117
4118
  "div",
4118
4119
  {
4119
4120
  role: "dashboard-plus-main",
4120
- className: W("grow", {
4121
+ className: K("grow", {
4121
4122
  hidden: n,
4122
4123
  flex: !n
4123
4124
  }),
4124
4125
  children: [
4125
- /* @__PURE__ */ e.jsx(La, {}),
4126
+ /* @__PURE__ */ e.jsx(Ia, {}),
4126
4127
  s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(nr, {}) })
4127
4128
  ]
4128
4129
  }
@@ -4137,11 +4138,11 @@ function lr() {
4137
4138
  ), /* @__PURE__ */ e.jsx(
4138
4139
  "div",
4139
4140
  {
4140
- className: W(" p-2", {
4141
+ className: K(" p-2", {
4141
4142
  hidden: !t
4142
4143
  }),
4143
4144
  children: /* @__PURE__ */ e.jsx(
4144
- Da,
4145
+ qa,
4145
4146
  {
4146
4147
  onChange: (a) => {
4147
4148
  if (a)
@@ -4177,10 +4178,10 @@ function cr({
4177
4178
  showFooter: n = !0,
4178
4179
  ...t
4179
4180
  }) {
4180
- return /* @__PURE__ */ e.jsx(Ia, { dashboardProps: t, children: /* @__PURE__ */ e.jsxs(qa, { children: [
4181
+ return /* @__PURE__ */ e.jsx(Va, { dashboardProps: t, children: /* @__PURE__ */ e.jsxs(Ra, { children: [
4181
4182
  /* @__PURE__ */ e.jsx(lr, {}),
4182
- /* @__PURE__ */ e.jsxs(Va, { ...t, children: [
4183
- s && /* @__PURE__ */ e.jsx(xn, {}),
4183
+ /* @__PURE__ */ e.jsxs(_a, { ...t, children: [
4184
+ s && /* @__PURE__ */ e.jsx(pn, {}),
4184
4185
  /* @__PURE__ */ e.jsx(tr, {}),
4185
4186
  /* @__PURE__ */ e.jsx(rr, {})
4186
4187
  ] })