semaphor 0.0.63 → 0.0.64

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,13 +1,13 @@
1
- import { J as T, L as Pe, b as w, c as js, u as je, j as e, M as bs, O as ys, P as z, Q as vs, R as Ns, U as Cs, V as Ss, W as ws, X as H, Y as de, Z as et, _ as _t, $ as Rt, a0 as Ht, a1 as $t, a2 as Pt, a3 as Bt, a4 as Hs, f as Z, a5 as Ve, a6 as st, a7 as Ze, a8 as Xe, T as ks, e as tt, g as zs, a9 as ke, aa as ze, ab as Fe, ac as Le, ad as _e, ae as Me, af as te, ag as Fs, G as o, ah as Ls, ai as Ms, aj as Os, w as at, v as nt, t as ue, ak as Gt, r as Kt, N as rt, s as Ut, al as Wt, B as Qt, am as it, an as Jt, S as Ds, z as Yt, n as $s, A as lt, ao as ms, ap as he, aq as ge, ar as Re, as as ts, at as ot, au as Zt, av as Xt, aw as ct, ax as ea, ay as sa, az as ta, aA as aa, aB as na, aC as xs, aD as ra, aE as ia, aF as qe, aG as ps, aH as we, aI as fs, aJ as Ps, aK as la, aL as oa, aM as ca, aN as da, aO as ha, aP as us, aQ as ua, aR as Bs, aS as ma, aT as Gs, aU as xa, aV as pa, aW as fa, aX as dt, l as ga, C as ja, E as Qe, d as ba, h as ya, aY as va, i as Na, o as Ca, aZ as Sa, m as wa, H as as, a_ as ka, a$ as ht, b0 as ut, b1 as Je, b2 as mt, b3 as Ye, b4 as Ks, b5 as ns, b6 as rs, b7 as is, b8 as xt, K as za, b9 as Fa, ba as La, bb as Ts, bc as Oe, bd as pt, be as Ma, bf as Oa, bg as Da, bh as Ta, bi as Aa, bj as Us, bk as Ea, bl as Ia, bm as qa, bn as Va, bo as _a, bp as Ra, bq as Ha, br as $a, bs as Ne, bt as B, bu as G, bv as As, bw as K, bx as Ws, by as Pa, bz as Ba, bA as Ga, bB as Ka, bC as Ua, bD as Wa, bE as Qa, bF as Ja, bG as Ya, bH as Za } from "./index-hj7e5VOs.js";
2
- import * as Qs from "react";
3
- import me, { useState as A, useMemo as Xa, useEffect as Y, useRef as He } from "react";
1
+ import { J as D, L as Pe, b as w, c as bs, u as je, j as e, M as ys, O as vs, P as z, Q as Ns, R as Cs, U as Ss, V as ws, W as ks, X as $, Y as de, Z as st, _ as Rt, $ as Ht, a0 as $t, a1 as Pt, a2 as Bt, a3 as Gt, a4 as $s, f as Z, a5 as Ve, a6 as Ut, a7 as tt, a8 as Ze, a9 as Xe, T as zs, e as at, g as Fs, aa as ke, ab as ze, ac as Fe, ad as Le, ae as _e, af as Me, ag as te, ah as Ls, G as o, ai as Ms, aj as Os, ak as Ds, w as nt, v as rt, t as ue, al as Kt, r as Wt, N as it, s as Qt, am as Jt, B as Yt, an as lt, ao as Zt, S as Ts, z as Xt, n as Ps, A as ot, ap as ms, aq as he, ar as ge, as as Re, at as ts, au as ct, av as ea, aw as sa, ax as dt, ay as ta, az as aa, aA as na, aB as ra, aC as ia, aD as xs, aE as la, aF as oa, aG as qe, aH as ps, aI as we, aJ as fs, aK as Bs, aL as ca, aM as da, aN as ha, aO as ua, aP as ma, aQ as us, aR as xa, aS as Gs, aT as pa, aU as Us, aV as fa, aW as ga, aX as ja, aY as ht, l as ba, C as ya, E as Qe, d as va, h as Na, aZ as Ca, i as Sa, o as wa, a_ as ka, m as za, H as as, a$ as Fa, b0 as ut, b1 as mt, b2 as Je, b3 as xt, b4 as Ye, b5 as Ks, b6 as ns, b7 as rs, b8 as is, b9 as pt, K as La, ba as Ma, bb as Oa, bc as As, bd as Oe, be as ft, bf as Da, bg as Ta, bh as Aa, bi as Ia, bj as Ea, bk as Ws, bl as qa, bm as Va, bn as _a, bo as Ra, bp as Ha, bq as $a, br as Pa, bs as Ba, bt as Ne, bu as B, bv as G, bw as Is, bx as U, by as Qs, bz as Ga, bA as Ua, bB as Ka, bC as Wa, bD as Qa, bE as Ja, bF as Ya, bG as Za, bH as Xa, bI as en } from "./index-iGlNQo-C.js";
2
+ import * as Js from "react";
3
+ import me, { useState as T, useMemo as gs, useEffect as Y, useRef as He } from "react";
4
4
  /**
5
5
  * @license lucide-react v0.379.0 - ISC
6
6
  *
7
7
  * This source code is licensed under the ISC license.
8
8
  * See the LICENSE file in the root directory of this source tree.
9
9
  */
10
- const en = T("AreaChart", [
10
+ const sn = D("AreaChart", [
11
11
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
12
12
  ["path", { d: "M7 12v5h12V8l-5 5-4-4Z", key: "zxz28u" }]
13
13
  ]);
@@ -17,7 +17,7 @@ const en = T("AreaChart", [
17
17
  * This source code is licensed under the ISC license.
18
18
  * See the LICENSE file in the root directory of this source tree.
19
19
  */
20
- const Es = T("BarChart4", [
20
+ const Es = D("BarChart4", [
21
21
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
22
22
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
23
23
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
@@ -29,7 +29,7 @@ const Es = T("BarChart4", [
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
31
  */
32
- const sn = T("Box", [
32
+ const tn = D("Box", [
33
33
  [
34
34
  "path",
35
35
  {
@@ -46,7 +46,7 @@ const sn = T("Box", [
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
48
  */
49
- const tn = T("CircleX", [
49
+ const an = D("CircleX", [
50
50
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51
51
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
52
52
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -57,7 +57,7 @@ const tn = T("CircleX", [
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
59
  */
60
- const an = T("Database", [
60
+ const nn = D("Database", [
61
61
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
62
62
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
63
63
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -68,7 +68,7 @@ const an = T("Database", [
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
70
  */
71
- const nn = T("EllipsisVertical", [
71
+ const rn = D("EllipsisVertical", [
72
72
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
73
73
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
74
74
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
@@ -79,7 +79,7 @@ const nn = T("EllipsisVertical", [
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
81
  */
82
- const rn = T("Eraser", [
82
+ const ln = D("Eraser", [
83
83
  [
84
84
  "path",
85
85
  {
@@ -96,7 +96,7 @@ const rn = T("Eraser", [
96
96
  * This source code is licensed under the ISC license.
97
97
  * See the LICENSE file in the root directory of this source tree.
98
98
  */
99
- const ft = T("GanttChart", [
99
+ const gt = D("GanttChart", [
100
100
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
101
101
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
102
102
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -107,7 +107,7 @@ const ft = T("GanttChart", [
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
109
  */
110
- const ln = T("Glasses", [
110
+ const on = D("Glasses", [
111
111
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
112
112
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
113
113
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -120,7 +120,7 @@ const ln = T("Glasses", [
120
120
  * This source code is licensed under the ISC license.
121
121
  * See the LICENSE file in the root directory of this source tree.
122
122
  */
123
- const on = T("Hammer", [
123
+ const cn = D("Hammer", [
124
124
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
125
125
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
126
126
  [
@@ -137,7 +137,7 @@ const on = T("Hammer", [
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
139
  */
140
- const cn = T("Hash", [
140
+ const dn = D("Hash", [
141
141
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
142
142
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
143
143
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -149,7 +149,7 @@ const cn = T("Hash", [
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
151
  */
152
- const dn = T("Home", [
152
+ const hn = D("Home", [
153
153
  ["path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z", key: "y5dka4" }],
154
154
  ["polyline", { points: "9 22 9 12 15 12 15 22", key: "e2us08" }]
155
155
  ]);
@@ -159,7 +159,7 @@ const dn = T("Home", [
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
161
  */
162
- const hn = T("Key", [
162
+ const un = D("Key", [
163
163
  ["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" }],
164
164
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
165
165
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -170,7 +170,7 @@ const hn = T("Key", [
170
170
  * This source code is licensed under the ISC license.
171
171
  * See the LICENSE file in the root directory of this source tree.
172
172
  */
173
- const Is = T("LineChart", [
173
+ const qs = D("LineChart", [
174
174
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
175
175
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
176
176
  ]);
@@ -180,7 +180,7 @@ const Is = T("LineChart", [
180
180
  * This source code is licensed under the ISC license.
181
181
  * See the LICENSE file in the root directory of this source tree.
182
182
  */
183
- const un = T("ListEnd", [
183
+ const mn = D("ListEnd", [
184
184
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
185
185
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
186
186
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -193,7 +193,7 @@ const un = T("ListEnd", [
193
193
  * This source code is licensed under the ISC license.
194
194
  * See the LICENSE file in the root directory of this source tree.
195
195
  */
196
- const mn = T("ListStart", [
196
+ const xn = D("ListStart", [
197
197
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
198
198
  ["path", { d: "M16 18H3", key: "12xzn7" }],
199
199
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -206,7 +206,7 @@ const mn = T("ListStart", [
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */
209
- const xn = T("ListX", [
209
+ const pn = D("ListX", [
210
210
  ["path", { d: "M11 12H3", key: "51ecnj" }],
211
211
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
212
212
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -219,7 +219,7 @@ const xn = T("ListX", [
219
219
  * This source code is licensed under the ISC license.
220
220
  * See the LICENSE file in the root directory of this source tree.
221
221
  */
222
- const $e = T("LoaderCircle", [
222
+ const $e = D("LoaderCircle", [
223
223
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
224
224
  ]);
225
225
  /**
@@ -228,7 +228,7 @@ const $e = T("LoaderCircle", [
228
228
  * This source code is licensed under the ISC license.
229
229
  * See the LICENSE file in the root directory of this source tree.
230
230
  */
231
- const pn = T("MessageSquareMore", [
231
+ const fn = D("MessageSquareMore", [
232
232
  ["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" }],
233
233
  ["path", { d: "M8 10h.01", key: "19clt8" }],
234
234
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -240,7 +240,7 @@ const pn = T("MessageSquareMore", [
240
240
  * This source code is licensed under the ISC license.
241
241
  * See the LICENSE file in the root directory of this source tree.
242
242
  */
243
- const fn = T("Network", [
243
+ const gn = D("Network", [
244
244
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
245
245
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
246
246
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -253,7 +253,7 @@ const fn = T("Network", [
253
253
  * This source code is licensed under the ISC license.
254
254
  * See the LICENSE file in the root directory of this source tree.
255
255
  */
256
- const gt = T("Pencil", [
256
+ const jt = D("Pencil", [
257
257
  ["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
258
258
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
259
259
  ]);
@@ -263,7 +263,7 @@ const gt = T("Pencil", [
263
263
  * This source code is licensed under the ISC license.
264
264
  * See the LICENSE file in the root directory of this source tree.
265
265
  */
266
- const jt = T("PieChart", [
266
+ const bt = D("PieChart", [
267
267
  ["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
268
268
  ["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
269
269
  ]);
@@ -273,7 +273,7 @@ const jt = T("PieChart", [
273
273
  * This source code is licensed under the ISC license.
274
274
  * See the LICENSE file in the root directory of this source tree.
275
275
  */
276
- const gn = T("Play", [
276
+ const jn = D("Play", [
277
277
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
278
278
  ]);
279
279
  /**
@@ -282,7 +282,7 @@ const gn = T("Play", [
282
282
  * This source code is licensed under the ISC license.
283
283
  * See the LICENSE file in the root directory of this source tree.
284
284
  */
285
- const jn = T("Plug2", [
285
+ const bn = D("Plug2", [
286
286
  ["path", { d: "M9 2v6", key: "17ngun" }],
287
287
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
288
288
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -295,7 +295,7 @@ const jn = T("Plug2", [
295
295
  * This source code is licensed under the ISC license.
296
296
  * See the LICENSE file in the root directory of this source tree.
297
297
  */
298
- const bn = T("Save", [
298
+ const yn = D("Save", [
299
299
  [
300
300
  "path",
301
301
  {
@@ -312,7 +312,7 @@ const bn = T("Save", [
312
312
  * This source code is licensed under the ISC license.
313
313
  * See the LICENSE file in the root directory of this source tree.
314
314
  */
315
- const bt = T("ScatterChart", [
315
+ const yt = D("ScatterChart", [
316
316
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
317
317
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
318
318
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -326,7 +326,7 @@ const bt = T("ScatterChart", [
326
326
  * This source code is licensed under the ISC license.
327
327
  * See the LICENSE file in the root directory of this source tree.
328
328
  */
329
- const yn = T("ShieldQuestion", [
329
+ const vn = D("ShieldQuestion", [
330
330
  [
331
331
  "path",
332
332
  {
@@ -343,7 +343,7 @@ const yn = T("ShieldQuestion", [
343
343
  * This source code is licensed under the ISC license.
344
344
  * See the LICENSE file in the root directory of this source tree.
345
345
  */
346
- const vn = T("Sigma", [
346
+ const Nn = D("Sigma", [
347
347
  ["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
348
348
  ]);
349
349
  /**
@@ -352,7 +352,7 @@ const vn = T("Sigma", [
352
352
  * This source code is licensed under the ISC license.
353
353
  * See the LICENSE file in the root directory of this source tree.
354
354
  */
355
- const Nn = T("SwatchBook", [
355
+ const Cn = D("SwatchBook", [
356
356
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
357
357
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
358
358
  ["path", { d: "M 7 17h0.01", key: "10821z" }],
@@ -370,7 +370,7 @@ const Nn = T("SwatchBook", [
370
370
  * This source code is licensed under the ISC license.
371
371
  * See the LICENSE file in the root directory of this source tree.
372
372
  */
373
- const Cn = T("Tag", [
373
+ const Sn = D("Tag", [
374
374
  [
375
375
  "path",
376
376
  {
@@ -386,7 +386,7 @@ const Cn = T("Tag", [
386
386
  * This source code is licensed under the ISC license.
387
387
  * See the LICENSE file in the root directory of this source tree.
388
388
  */
389
- const Sn = T("ToggleLeft", [
389
+ const wn = D("ToggleLeft", [
390
390
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
391
391
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
392
392
  ]);
@@ -396,7 +396,7 @@ const Sn = T("ToggleLeft", [
396
396
  * This source code is licensed under the ISC license.
397
397
  * See the LICENSE file in the root directory of this source tree.
398
398
  */
399
- const qs = T("Type", [
399
+ const Vs = D("Type", [
400
400
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
401
401
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
402
402
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -407,11 +407,11 @@ const qs = T("Type", [
407
407
  * This source code is licensed under the ISC license.
408
408
  * See the LICENSE file in the root directory of this source tree.
409
409
  */
410
- const wn = T("User", [
410
+ const kn = D("User", [
411
411
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
412
412
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
413
413
  ]);
414
- function yt(s) {
414
+ function vt(s) {
415
415
  var n;
416
416
  return {
417
417
  ...s,
@@ -423,14 +423,14 @@ function yt(s) {
423
423
  var h;
424
424
  return {
425
425
  ...i,
426
- cards: (h = i.cards) == null ? void 0 : h.map((r) => kn(r))
426
+ cards: (h = i.cards) == null ? void 0 : h.map((r) => zn(r))
427
427
  };
428
428
  })
429
429
  };
430
430
  })
431
431
  };
432
432
  }
433
- function kn(s) {
433
+ function zn(s) {
434
434
  var n, t, a, i;
435
435
  return {
436
436
  ...s,
@@ -445,12 +445,12 @@ function kn(s) {
445
445
  }))
446
446
  }
447
447
  },
448
- customCfg: zn(s.customCfg),
448
+ customCfg: Fn(s.customCfg),
449
449
  // if customCfg is present, clean it, otherwise return null{
450
450
  data: []
451
451
  };
452
452
  }
453
- function zn(s) {
453
+ function Fn(s) {
454
454
  var n, t;
455
455
  return s ? {
456
456
  ...s,
@@ -464,7 +464,7 @@ function zn(s) {
464
464
  }
465
465
  } : null;
466
466
  }
467
- async function Fn(s, n, t, a) {
467
+ async function Ln(s, n, t, a) {
468
468
  if (!a)
469
469
  return null;
470
470
  const i = JSON.stringify(n);
@@ -475,7 +475,7 @@ async function Fn(s, n, t, a) {
475
475
  operation: "create"
476
476
  });
477
477
  }
478
- async function gs(s, n) {
478
+ async function js(s, n) {
479
479
  if (!n)
480
480
  return null;
481
481
  const { id: t, template: a, filterValues: i, isDefault: h, shared: r } = s;
@@ -488,52 +488,52 @@ async function gs(s, n) {
488
488
  operation: "update"
489
489
  });
490
490
  }
491
- async function Ln(s, n) {
491
+ async function Mn(s, n) {
492
492
  return n ? await Pe("https://semaphor.cloud/api/v1/lens", n, {
493
493
  operation: "delete",
494
494
  lensId: s
495
495
  }) : null;
496
496
  }
497
- function Mn() {
498
- const [s, n] = A(""), [t, a] = A(!1), i = w((y) => y.lenses), { setLenses: h, setSelectedLensId: r } = js(), [l, c] = A(!1), [m, u] = A(!1), g = w((y) => y.dashboard), j = w((y) => y.filterValues), { authToken: d } = je();
497
+ function On() {
498
+ const [s, n] = T(""), [t, a] = T(!1), i = w((v) => v.lenses), { setLenses: h, setSelectedLensId: r } = bs(), [l, c] = T(!1), [m, u] = T(!1), g = w((v) => v.dashboard), j = w((v) => v.filterValues), { authToken: d } = je();
499
499
  async function x() {
500
500
  c(!0);
501
- const y = yt(
501
+ const v = vt(
502
502
  g
503
- ), f = await Fn(
503
+ ), f = await Ln(
504
504
  s,
505
- y,
505
+ v,
506
506
  j,
507
507
  d == null ? void 0 : d.accessToken
508
508
  );
509
509
  f && (h([...i || [], f]), r(f.id), u(!1)), c(!1);
510
510
  }
511
- return /* @__PURE__ */ e.jsxs(bs, { open: m, onOpenChange: u, children: [
512
- /* @__PURE__ */ e.jsx(ys, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
511
+ return /* @__PURE__ */ e.jsxs(ys, { open: m, onOpenChange: u, children: [
512
+ /* @__PURE__ */ e.jsx(vs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
513
513
  z,
514
514
  {
515
515
  variant: "secondary",
516
516
  className: "h-7 p-2",
517
517
  size: "sm",
518
518
  children: [
519
- /* @__PURE__ */ e.jsx(vs, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
519
+ /* @__PURE__ */ e.jsx(Ns, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
520
520
  "Lens"
521
521
  ]
522
522
  }
523
523
  ) }),
524
- /* @__PURE__ */ e.jsxs(Ns, { className: "sm:max-w-[425px]", children: [
525
- /* @__PURE__ */ e.jsxs(Cs, { children: [
526
- /* @__PURE__ */ e.jsx(Ss, { children: "Create Lens" }),
527
- /* @__PURE__ */ e.jsx(ws, { children: "Lenses are private by default and are only visible to you." })
524
+ /* @__PURE__ */ e.jsxs(Cs, { className: "sm:max-w-[425px]", children: [
525
+ /* @__PURE__ */ e.jsxs(Ss, { children: [
526
+ /* @__PURE__ */ e.jsx(ws, { children: "Create Lens" }),
527
+ /* @__PURE__ */ e.jsx(ks, { children: "Lenses are private by default and are only visible to you." })
528
528
  ] }),
529
529
  /* @__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: [
530
- /* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
530
+ /* @__PURE__ */ e.jsx($, { className: "text-right", children: "Name" }),
531
531
  /* @__PURE__ */ e.jsx(
532
532
  de,
533
533
  {
534
534
  value: s,
535
- onChange: (y) => {
536
- n(y.target.value);
535
+ onChange: (v) => {
536
+ n(v.target.value);
537
537
  },
538
538
  id: "name",
539
539
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -541,7 +541,7 @@ function Mn() {
541
541
  )
542
542
  ] }) }),
543
543
  t && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
544
- /* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsx(
544
+ /* @__PURE__ */ e.jsx(st, { children: /* @__PURE__ */ e.jsx(
545
545
  z,
546
546
  {
547
547
  size: "sm",
@@ -555,13 +555,13 @@ function Mn() {
555
555
  ] })
556
556
  ] });
557
557
  }
558
- function On() {
559
- const [s, n] = A(!1), t = w((u) => u.lenses), a = w((u) => u.selectedLensId), { setLenses: i, setSelectedLensId: h } = js(), { authToken: r } = je();
558
+ function Dn() {
559
+ const [s, n] = T(!1), t = w((u) => u.lenses), a = w((u) => u.selectedLensId), { setLenses: i, setSelectedLensId: h } = bs(), { authToken: r } = je();
560
560
  async function l(u) {
561
561
  h(u);
562
562
  }
563
563
  async function c(u) {
564
- if (await Ln(u, r == null ? void 0 : r.accessToken)) {
564
+ if (await Mn(u, r == null ? void 0 : r.accessToken)) {
565
565
  const j = t == null ? void 0 : t.filter((d) => d.id !== u);
566
566
  i(j || []), h("original");
567
567
  }
@@ -579,30 +579,30 @@ function On() {
579
579
  ...u,
580
580
  isDefault: !u.isDefault
581
581
  };
582
- await gs(j, r == null ? void 0 : r.accessToken);
582
+ await js(j, r == null ? void 0 : r.accessToken);
583
583
  const d = t == null ? void 0 : t.find((x) => x.isDefault);
584
584
  if (d && d.id !== u.id) {
585
585
  const x = {
586
586
  ...d,
587
587
  isDefault: !1
588
588
  };
589
- await gs(x, r == null ? void 0 : r.accessToken);
589
+ await js(x, r == null ? void 0 : r.accessToken);
590
590
  }
591
591
  }
592
- return /* @__PURE__ */ e.jsxs(_t, { open: s, onOpenChange: n, children: [
593
- /* @__PURE__ */ e.jsx(Rt, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(ln, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
594
- /* @__PURE__ */ e.jsxs(Ht, { align: "end", className: "w-60", children: [
595
- /* @__PURE__ */ e.jsx($t, { className: "px-3", children: "Lenses" }),
596
- /* @__PURE__ */ e.jsx(Pt, {}),
592
+ return /* @__PURE__ */ e.jsxs(Rt, { open: s, onOpenChange: n, children: [
593
+ /* @__PURE__ */ e.jsx(Ht, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(on, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
594
+ /* @__PURE__ */ e.jsxs($t, { align: "end", className: "w-60", children: [
595
+ /* @__PURE__ */ e.jsx(Pt, { className: "px-3", children: "Lenses" }),
596
+ /* @__PURE__ */ e.jsx(Bt, {}),
597
597
  /* @__PURE__ */ e.jsxs(
598
- Bt,
598
+ Gt,
599
599
  {
600
600
  value: a,
601
601
  onValueChange: l,
602
602
  children: [
603
- /* @__PURE__ */ e.jsx(Hs, { value: "original", children: "Original" }),
603
+ /* @__PURE__ */ e.jsx($s, { value: "original", children: "Original" }),
604
604
  t == null ? void 0 : t.map((u) => /* @__PURE__ */ e.jsxs(
605
- Hs,
605
+ $s,
606
606
  {
607
607
  className: "group flex justify-between",
608
608
  value: u.id,
@@ -610,7 +610,7 @@ function On() {
610
610
  /* @__PURE__ */ e.jsx("p", { children: u.name }),
611
611
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
612
612
  /* @__PURE__ */ e.jsx(
613
- dn,
613
+ hn,
614
614
  {
615
615
  onClick: (g) => {
616
616
  g.preventDefault(), m(u);
@@ -645,23 +645,26 @@ function On() {
645
645
  ] })
646
646
  ] });
647
647
  }
648
- function Dn() {
649
- const { authToken: s } = je(), n = w((S) => S.lenses), t = w((S) => S.selectedLensId), a = n == null ? void 0 : n.find((S) => S.id === t), i = w((S) => S.dashboard);
650
- w((S) => S.selectedSheetId);
648
+ function Tn() {
649
+ const { authToken: s } = je(), n = w((b) => b.lenses), t = w((b) => b.selectedLensId), a = n == null ? void 0 : n.find((b) => b.id === t), i = w((b) => b.dashboard);
650
+ w((b) => b.selectedSheetId);
651
651
  const h = w(
652
- (S) => S.isDashboardEditing
653
- ), [r, l] = A(!1), c = w((S) => S.filterValues), m = w((S) => S.isVisualEditing), u = w((S) => S.showFilters);
652
+ (b) => b.isDashboardEditing
653
+ ), [r, l] = T(!1), c = w((b) => b.filterValues), m = w((b) => b.isVisualEditing), u = w((b) => b.showFilters);
654
654
  w(
655
- (S) => S.showDashboardJSON
655
+ (b) => b.showDashboardJSON
656
656
  );
657
- const g = w((S) => S.onSaveFunction), j = w(
658
- (S) => S.actions.setShowFilters
657
+ const g = w((b) => b.onSaveFunction), j = w(
658
+ (b) => b.actions.setShowFilters
659
659
  ), { addFrame: d, setSelectedFrameId: x } = w(
660
- (S) => S.actions
661
- ), { getSelectedSheet: y, setIsDashboardEditing: f, setShowDashboardJSON: L } = w((S) => S.actions), O = y(), v = () => {
662
- if (!h || !O)
660
+ (b) => b.actions
661
+ ), { getSelectedSheet: v, setIsDashboardEditing: f, setShowDashboardJSON: F } = w((b) => b.actions), M = v(), { tenantId: N, endUserId: V } = gs(
662
+ () => Ut(s == null ? void 0 : s.accessToken),
663
+ [s == null ? void 0 : s.accessToken]
664
+ ), q = gs(() => N || V, [N, V]), _ = () => {
665
+ if (!h || !M)
663
666
  return;
664
- const S = {
667
+ const b = {
665
668
  id: Ze(),
666
669
  title: "Title",
667
670
  description: "Description",
@@ -676,26 +679,26 @@ function Dn() {
676
679
  type: "bar",
677
680
  sql: "select COUNT(*) from YOUR_TABLE",
678
681
  data: []
679
- }, M = {
682
+ }, R = {
680
683
  id: Ze(),
681
- cards: [S],
682
- activeCardId: S.id
684
+ cards: [b],
685
+ activeCardId: b.id
683
686
  };
684
- d(O.id, M), x(M.id);
685
- }, V = () => {
687
+ d(M.id, R), x(R.id);
688
+ }, L = () => {
686
689
  f(!0);
687
690
  };
688
- async function _() {
691
+ async function C() {
689
692
  if (l(!0), !t || !a)
690
693
  return;
691
- const S = yt(
694
+ const b = vt(
692
695
  i
693
- ), M = JSON.stringify(S), N = {
696
+ ), R = JSON.stringify(b), H = {
694
697
  ...a,
695
- template: M,
698
+ template: R,
696
699
  filterValues: c
697
700
  };
698
- await gs(N, s == null ? void 0 : s.accessToken), Xe.success("Lens saved"), g == null || g(S), l(!1);
701
+ await js(H, s == null ? void 0 : s.accessToken), Xe.success("Lens saved"), g == null || g(b), l(!1);
699
702
  }
700
703
  return m ? null : /* @__PURE__ */ e.jsxs(
701
704
  "div",
@@ -703,10 +706,10 @@ function Dn() {
703
706
  className: "flex items-center justify-between gap-2 border-b bg-muted/50 py-2 pl-3 pr-2",
704
707
  role: "dashboard-controls",
705
708
  children: [
706
- !m && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: a == null ? void 0 : a.name }) }),
709
+ !m && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx($, { children: a == null ? void 0 : a.name }) }),
707
710
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
708
- h && !m && /* @__PURE__ */ e.jsx(Mn, {}),
709
- !m && /* @__PURE__ */ e.jsx(On, {}),
711
+ h && !m && q && /* @__PURE__ */ e.jsx(On, {}),
712
+ !m && q && /* @__PURE__ */ e.jsx(Dn, {}),
710
713
  h && !m && /* @__PURE__ */ e.jsxs(
711
714
  z,
712
715
  {
@@ -714,9 +717,9 @@ function Dn() {
714
717
  className: "h-7 p-2",
715
718
  size: "sm",
716
719
  disabled: !h,
717
- onClick: v,
720
+ onClick: _,
718
721
  children: [
719
- /* @__PURE__ */ e.jsx(vs, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
722
+ /* @__PURE__ */ e.jsx(Ns, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
720
723
  "Frame"
721
724
  ]
722
725
  }
@@ -726,9 +729,9 @@ function Dn() {
726
729
  {
727
730
  variant: "ghost",
728
731
  className: "h-7 p-2",
729
- onClick: V,
732
+ onClick: L,
730
733
  size: "sm",
731
- children: /* @__PURE__ */ e.jsx(gt, { className: "h-4 w-4", strokeWidth: 1.5 })
734
+ children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4", strokeWidth: 1.5 })
732
735
  }
733
736
  ),
734
737
  h && !m && /* @__PURE__ */ e.jsx(
@@ -738,21 +741,21 @@ function Dn() {
738
741
  role: "close",
739
742
  className: "h-7 p-2",
740
743
  onClick: () => {
741
- f(!1), L(!1);
744
+ f(!1), F(!1);
742
745
  },
743
746
  size: "sm",
744
747
  children: /* @__PURE__ */ e.jsx(Ve, { className: "h-4 w-4", strokeWidth: 1.5 })
745
748
  }
746
749
  ),
747
- h && !m && /* @__PURE__ */ e.jsx(
750
+ h && !m && q && /* @__PURE__ */ e.jsx(
748
751
  z,
749
752
  {
750
753
  className: "h-7 p-2",
751
754
  variant: "ghost",
752
755
  disabled: r,
753
- onClick: _,
756
+ onClick: C,
754
757
  size: "sm",
755
- children: /* @__PURE__ */ e.jsx(bn, { className: "h-4 w-4", strokeWidth: 1.5 })
758
+ children: /* @__PURE__ */ e.jsx(yn, { className: "h-4 w-4", strokeWidth: 1.5 })
756
759
  }
757
760
  ),
758
761
  !u && !m && h && /* @__PURE__ */ e.jsx(
@@ -762,7 +765,7 @@ function Dn() {
762
765
  variant: "ghost",
763
766
  onClick: () => j(!0),
764
767
  size: "sm",
765
- children: /* @__PURE__ */ e.jsx(st, { className: "h-4 w-4", strokeWidth: 1.5 })
768
+ children: /* @__PURE__ */ e.jsx(tt, { className: "h-4 w-4", strokeWidth: 1.5 })
766
769
  }
767
770
  ),
768
771
  !m && h && !1,
@@ -772,7 +775,7 @@ function Dn() {
772
775
  }
773
776
  );
774
777
  }
775
- function Ie({
778
+ function Ee({
776
779
  title: s,
777
780
  items: n,
778
781
  value: t,
@@ -788,20 +791,20 @@ function Ie({
788
791
  const g = a ? "Loading..." : i ? "Error" : t;
789
792
  function j() {
790
793
  if (s === "Connection")
791
- return /* @__PURE__ */ e.jsx(jn, { className: "size-4 rotate-90" });
794
+ return /* @__PURE__ */ e.jsx(bn, { className: "size-4 rotate-90" });
792
795
  if (s === "Database")
793
- return /* @__PURE__ */ e.jsx(an, { className: "size-4" });
796
+ return /* @__PURE__ */ e.jsx(nn, { className: "size-4" });
794
797
  if (s === "Schema")
795
- return /* @__PURE__ */ e.jsx(fn, { className: "size-4" });
798
+ return /* @__PURE__ */ e.jsx(gn, { className: "size-4" });
796
799
  if (s === "Table")
797
- return /* @__PURE__ */ e.jsx(Fs, { className: "size-4" });
800
+ return /* @__PURE__ */ e.jsx(Ls, { className: "size-4" });
798
801
  if (s === "Model")
799
- return /* @__PURE__ */ e.jsx(sn, { className: "size-4" });
802
+ return /* @__PURE__ */ e.jsx(tn, { className: "size-4" });
800
803
  }
801
804
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
802
- m && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: h ? /* @__PURE__ */ e.jsxs(ks, { children: [
803
- /* @__PURE__ */ e.jsx(tt, { children: j() }),
804
- /* @__PURE__ */ e.jsx(zs, { className: "text-xs", align: "start", children: h })
805
+ m && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: h ? /* @__PURE__ */ e.jsxs(zs, { children: [
806
+ /* @__PURE__ */ e.jsx(at, { children: j() }),
807
+ /* @__PURE__ */ e.jsx(Fs, { className: "text-xs", align: "start", children: h })
805
808
  ] }) : j() }),
806
809
  /* @__PURE__ */ e.jsxs(ke, { disabled: u, value: g, onValueChange: r, children: [
807
810
  /* @__PURE__ */ e.jsx(
@@ -830,25 +833,25 @@ function Ie({
830
833
  ] })
831
834
  ] });
832
835
  }
833
- function Tn({ column: s }) {
834
- const [n, t] = A(!1), a = o((d) => d.selectedTableName), i = o(
836
+ function An({ column: s }) {
837
+ const [n, t] = T(!1), a = o((d) => d.selectedTableName), i = o(
835
838
  (d) => d.selectedSchemaName
836
839
  ), h = o(
837
840
  (d) => d.selectedDatamodelId
838
841
  ), r = o((d) => d.sqlGen), { modelItems: l } = De(), c = o((d) => d.actions.setSqlGen), m = o((d) => d.actions.setCardSql), u = o((d) => d.actions.setRunSql);
839
842
  function g(d, x) {
840
- var O;
841
- const y = at(d, r, x), f = (O = l == null ? void 0 : l.find(
842
- (v) => v.id === h
843
- )) == null ? void 0 : O.name;
844
- c(y);
845
- const L = nt(
846
- y,
843
+ var M;
844
+ const v = nt(d, r, x), f = (M = l == null ? void 0 : l.find(
845
+ (N) => N.id === h
846
+ )) == null ? void 0 : M.name;
847
+ c(v);
848
+ const F = rt(
849
+ v,
847
850
  ue(i || ""),
848
851
  ue(a),
849
852
  f
850
853
  );
851
- L && (m(L), u(!0)), t(!1);
854
+ F && (m(F), u(!0)), t(!1);
852
855
  }
853
856
  function j() {
854
857
  return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
@@ -894,10 +897,10 @@ function Tn({ column: s }) {
894
897
  )
895
898
  ] });
896
899
  }
897
- return /* @__PURE__ */ e.jsxs(Ls, { openDelay: 0, open: n, onOpenChange: t, children: [
898
- /* @__PURE__ */ e.jsx(Ms, { asChild: !0, children: /* @__PURE__ */ e.jsx(nn, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
900
+ return /* @__PURE__ */ e.jsxs(Ms, { openDelay: 0, open: n, onOpenChange: t, children: [
901
+ /* @__PURE__ */ e.jsx(Os, { asChild: !0, children: /* @__PURE__ */ e.jsx(rn, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
899
902
  /* @__PURE__ */ e.jsx(
900
- Os,
903
+ Ds,
901
904
  {
902
905
  align: "center",
903
906
  className: "w-20 rounded-md p-0 shadow-none",
@@ -906,116 +909,116 @@ function Tn({ column: s }) {
906
909
  )
907
910
  ] });
908
911
  }
909
- function vt({ column: s }) {
910
- return /* @__PURE__ */ e.jsxs(ks, { children: [
911
- /* @__PURE__ */ e.jsx(Gt, { asChild: !0, children: Kt.includes(s.data_type.toLowerCase()) ? (
912
+ function Nt({ column: s }) {
913
+ return /* @__PURE__ */ e.jsxs(zs, { children: [
914
+ /* @__PURE__ */ e.jsx(Kt, { asChild: !0, children: Wt.includes(s.data_type.toLowerCase()) ? (
912
915
  // <span className=" font-thin">T</span>
913
- /* @__PURE__ */ e.jsx(qs, { className: "size-3" })
914
- ) : rt.includes(s.data_type.toLowerCase()) ? (
916
+ /* @__PURE__ */ e.jsx(Vs, { className: "size-3" })
917
+ ) : it.includes(s.data_type.toLowerCase()) ? (
915
918
  //
916
- /* @__PURE__ */ e.jsx(cn, { className: "size-3" })
917
- ) : Ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Wt, { className: "size-3" }) : Qt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Sn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(yn, { className: "size-3" }) }),
918
- /* @__PURE__ */ e.jsx(zs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
919
+ /* @__PURE__ */ e.jsx(dn, { className: "size-3" })
920
+ ) : Qt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Jt, { className: "size-3" }) : Yt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(wn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(vn, { className: "size-3" }) }),
921
+ /* @__PURE__ */ e.jsx(Fs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
919
922
  ] });
920
923
  }
921
- function An({
924
+ function In({
922
925
  schemaName: s,
923
926
  tableName: n,
924
927
  columns: t,
925
928
  status: a
926
929
  }) {
927
- const i = o((N) => N.sqlGen), h = o(
928
- (N) => N.selectedConnectionId
930
+ const i = o((C) => C.sqlGen), h = o(
931
+ (C) => C.selectedConnectionId
929
932
  ), r = o(
930
- (N) => N.selectedDatabaseName
933
+ (C) => C.selectedDatabaseName
931
934
  ), l = o(
932
- (N) => N.selectedSchemaName
933
- ), c = o((N) => N.selectedTableName), m = o(
934
- (N) => N.selectedDatamodelId
935
+ (C) => C.selectedSchemaName
936
+ ), c = o((C) => C.selectedTableName), m = o(
937
+ (C) => C.selectedDatamodelId
935
938
  ), u = w(
936
- (N) => N.dashboard.aiScopeTables
937
- ), { setAIScopeTables: g } = w((N) => N.actions), j = o((N) => N.actions.setRunSql), d = o((N) => N.actions.setSqlGen), x = o(
938
- (N) => N.actions.setIsShowingVisual
939
- ), y = o((N) => N.actions.setCardSql), { connectionType: f, modelItems: L } = De();
940
- function O(N) {
941
- var E;
942
- const F = at(N, i);
943
- d(F);
944
- const R = (E = L == null ? void 0 : L.find(
939
+ (C) => C.dashboard.aiScopeTables
940
+ ), { setAIScopeTables: g } = w((C) => C.actions), j = o((C) => C.actions.setRunSql), d = o((C) => C.actions.setSqlGen), x = o(
941
+ (C) => C.actions.setIsShowingVisual
942
+ ), v = o((C) => C.actions.setCardSql), { connectionType: f, modelItems: F } = De();
943
+ function M(C) {
944
+ var A;
945
+ const b = nt(C, i);
946
+ d(b);
947
+ const R = (A = F == null ? void 0 : F.find(
945
948
  (P) => P.id === m
946
- )) == null ? void 0 : E.name, $ = nt(F, ue(s), ue(n), R);
947
- $ && (y($), j(!0));
949
+ )) == null ? void 0 : A.name, H = rt(b, ue(s), ue(n), R);
950
+ H && (v(H), j(!0));
948
951
  }
949
- function v() {
952
+ function N() {
950
953
  return (u == null ? void 0 : u.find(
951
- (N) => N.connectinonId === h && N.tableName === c
954
+ (C) => C.connectinonId === h && C.tableName === c
952
955
  )) !== void 0;
953
956
  }
954
- function V(N) {
955
- if (N === !0 && c && h) {
956
- const F = {
957
+ function V(C) {
958
+ if (C === !0 && c && h) {
959
+ const b = {
957
960
  connectinonId: h,
958
961
  connectionType: f,
959
962
  databaseName: r,
960
963
  schemaName: l,
961
964
  tableName: c
962
- }, $ = [...u || [], F].filter(
963
- (E, P, X) => X.findIndex(
964
- (W) => W.connectinonId === E.connectinonId && W.tableName === E.tableName
965
+ }, H = [...u || [], b].filter(
966
+ (A, P, X) => X.findIndex(
967
+ (W) => W.connectinonId === A.connectinonId && W.tableName === A.tableName
965
968
  ) === P
966
969
  );
967
- g($), Xe.success(`Added '${c}' to AI Scope`, {
970
+ g(H), Xe.success(`Added '${c}' to AI Scope`, {
968
971
  position: "top-right",
969
972
  duration: 2500,
970
973
  richColors: !0
971
974
  });
972
975
  } else {
973
- const F = (u || []).filter(
976
+ const b = (u || []).filter(
974
977
  (R) => R.connectinonId !== h && R.tableName !== c
975
978
  );
976
- g(F), Xe(`Removed '${c}' from AI Scope`, {
979
+ g(b), Xe(`Removed '${c}' from AI Scope`, {
977
980
  position: "top-right",
978
981
  duration: 2e3,
979
982
  richColors: !0
980
983
  });
981
984
  }
982
985
  }
983
- function _() {
984
- var E;
985
- let N = lt(s, n);
986
- const F = (E = L == null ? void 0 : L.find(
986
+ function q() {
987
+ var A;
988
+ let C = ot(s, n);
989
+ const b = (A = F == null ? void 0 : F.find(
987
990
  (P) => P.id === m
988
- )) == null ? void 0 : E.name;
989
- console.log("modelName", F), m && m !== "none" && (N = `${ms}.${F}`);
990
- let R = N;
991
+ )) == null ? void 0 : A.name;
992
+ console.log("modelName", b), m && m !== "none" && (C = `${ms}.${b}`);
993
+ let R = C;
991
994
  return ((P) => /[A-Z]/.test(P))(n) && (R = R.split(".").map((X) => `"${X}"`).join(".")), R;
992
995
  }
993
- function S() {
994
- const N = _();
996
+ function _() {
997
+ const C = q();
995
998
  x(!1);
996
- const F = f === "MSSQL" ? `SELECT top 10 * FROM ${N}` : `SELECT * FROM ${N} LIMIT 10`;
997
- y(F), j(!0);
999
+ const b = f === "MSSQL" ? `SELECT top 10 * FROM ${C}` : `SELECT * FROM ${C} LIMIT 10`;
1000
+ v(b), j(!0);
998
1001
  }
999
- function M() {
1000
- const N = _();
1001
- y(`SELECT COUNT(*) as count FROM ${N}`), j(!0);
1002
+ function L() {
1003
+ const C = q();
1004
+ v(`SELECT COUNT(*) as count FROM ${C}`), j(!0);
1002
1005
  }
1003
1006
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
1004
1007
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
1005
1008
  /* @__PURE__ */ e.jsx(
1006
- it,
1009
+ lt,
1007
1010
  {
1008
- title: `${v() ? "Remove from" : "Add to"} AI Scope`,
1009
- pressed: v(),
1011
+ title: `${N() ? "Remove from" : "Add to"} AI Scope`,
1012
+ pressed: N(),
1010
1013
  onPressedChange: V,
1011
1014
  variant: "outline",
1012
1015
  className: "h-9 px-2",
1013
1016
  children: /* @__PURE__ */ e.jsx(
1014
- Jt,
1017
+ Zt,
1015
1018
  {
1016
1019
  className: Z("size-4", {
1017
- "text-primary": v(),
1018
- "text-muted-foreground": !v()
1020
+ "text-primary": N(),
1021
+ "text-muted-foreground": !N()
1019
1022
  })
1020
1023
  }
1021
1024
  )
@@ -1025,12 +1028,12 @@ function An({
1025
1028
  z,
1026
1029
  {
1027
1030
  disabled: a !== "Success",
1028
- onClick: S,
1031
+ onClick: _,
1029
1032
  size: "sm",
1030
1033
  variant: "secondary",
1031
1034
  className: "flex",
1032
1035
  children: [
1033
- a !== "Success" ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Nn, { className: "mr-2 size-4" }),
1036
+ a !== "Success" ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Cn, { className: "mr-2 size-4" }),
1034
1037
  "Top 10"
1035
1038
  ]
1036
1039
  }
@@ -1039,93 +1042,93 @@ function An({
1039
1042
  z,
1040
1043
  {
1041
1044
  disabled: a !== "Success",
1042
- onClick: M,
1045
+ onClick: L,
1043
1046
  size: "sm",
1044
1047
  variant: "secondary",
1045
1048
  className: "flex",
1046
1049
  children: [
1047
- a !== "Success" ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(vn, { className: "mr-2 size-4" }),
1050
+ a !== "Success" ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Nn, { className: "mr-2 size-4" }),
1048
1051
  "Count"
1049
1052
  ]
1050
1053
  }
1051
1054
  )
1052
1055
  ] }),
1053
1056
  /* @__PURE__ */ e.jsxs(
1054
- Ds,
1057
+ Ts,
1055
1058
  {
1056
1059
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
1057
1060
  children: [
1058
- t == null ? void 0 : t.map((N) => /* @__PURE__ */ e.jsxs(
1061
+ t == null ? void 0 : t.map((C) => /* @__PURE__ */ e.jsxs(
1059
1062
  "div",
1060
1063
  {
1061
- onClick: () => O(N),
1064
+ onClick: () => M(C),
1062
1065
  className: Z(
1063
1066
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
1064
1067
  {
1065
- "bg-muted": Yt(N, i)
1068
+ "bg-muted": Xt(C, i)
1066
1069
  }
1067
1070
  ),
1068
1071
  children: [
1069
1072
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1070
- /* @__PURE__ */ e.jsx(vt, { column: N }),
1071
- /* @__PURE__ */ e.jsx("span", { children: N.column_name })
1073
+ /* @__PURE__ */ e.jsx(Nt, { column: C }),
1074
+ /* @__PURE__ */ e.jsx("span", { children: C.column_name })
1072
1075
  ] }),
1073
1076
  /* @__PURE__ */ e.jsx(
1074
1077
  "div",
1075
1078
  {
1076
- onClick: (F) => F.stopPropagation(),
1079
+ onClick: (b) => b.stopPropagation(),
1077
1080
  className: "flex items-center justify-end",
1078
- children: rt.includes(N.data_type) && /* @__PURE__ */ e.jsx(Tn, { column: N })
1081
+ children: it.includes(C.data_type) && /* @__PURE__ */ e.jsx(An, { column: C })
1079
1082
  }
1080
1083
  )
1081
1084
  ]
1082
1085
  },
1083
- N.column_name
1086
+ C.column_name
1084
1087
  )),
1085
- /* @__PURE__ */ e.jsx($s, { orientation: "vertical" }),
1086
- /* @__PURE__ */ e.jsx($s, { orientation: "horizontal" })
1088
+ /* @__PURE__ */ e.jsx(Ps, { orientation: "vertical" }),
1089
+ /* @__PURE__ */ e.jsx(Ps, { orientation: "horizontal" })
1087
1090
  ]
1088
1091
  }
1089
1092
  )
1090
1093
  ] });
1091
1094
  }
1092
1095
  function De(s, n) {
1093
- var Ge, Ee, Ke, Ue, p;
1094
- let t = Xa(() => [], []);
1096
+ var Ge, Ie, Ue, Ke, p;
1097
+ let t = gs(() => [], []);
1095
1098
  const a = je().authToken || s, i = o(
1096
- (b) => b.selectedConnectionId
1099
+ (y) => y.selectedConnectionId
1097
1100
  ), h = o(
1098
- (b) => b.selectedDatamodelId
1101
+ (y) => y.selectedDatamodelId
1099
1102
  ), r = o(
1100
- (b) => b.selectedDatabaseName
1103
+ (y) => y.selectedDatabaseName
1101
1104
  ), l = o(
1102
- (b) => b.selectedSchemaName
1103
- ), c = o((b) => b.selectedTableName), m = o(
1104
- (b) => b.actions.setCurrentColumns
1105
+ (y) => y.selectedSchemaName
1106
+ ), c = o((y) => y.selectedTableName), m = o(
1107
+ (y) => y.actions.setCurrentColumns
1105
1108
  ), u = o(
1106
- (b) => b.actions.setSelectedConnectionId
1109
+ (y) => y.actions.setSelectedConnectionId
1107
1110
  ), g = o(
1108
- (b) => b.actions.setSelectedDatamodelId
1111
+ (y) => y.actions.setSelectedDatamodelId
1109
1112
  ), j = o(
1110
- (b) => b.actions.setSelectedDatabaseName
1113
+ (y) => y.actions.setSelectedDatabaseName
1111
1114
  ), d = o(
1112
- (b) => b.actions.setSelectedSchemaName
1115
+ (y) => y.actions.setSelectedSchemaName
1113
1116
  ), x = o(
1114
- (b) => b.actions.setSelectedTableName
1115
- ), y = o((b) => b.actions.setCardSql);
1116
- function f(b) {
1117
- return i && r && l && r !== "NA" ? !0 : i && b === "API" ? !1 : !!(i && b === "S3");
1117
+ (y) => y.actions.setSelectedTableName
1118
+ ), v = o((y) => y.actions.setCardSql);
1119
+ function f(y) {
1120
+ return i && r && l && r !== "NA" ? !0 : i && y === "API" ? !1 : !!(i && y === "S3");
1118
1121
  }
1119
- function L(b) {
1120
- return !!(i && r && r !== "NA" && l && c || i && (b === "S3" || b === "API") || h && h);
1122
+ function F(y) {
1123
+ return !!(i && r && r !== "NA" && l && c || i && (y === "S3" || y === "API") || h && h);
1121
1124
  }
1122
- function O(b) {
1123
- return i && b ? !(b === "API" || b === "S3") : !1;
1125
+ function M(y) {
1126
+ return i && y ? !(y === "API" || y === "S3") : !1;
1124
1127
  }
1125
1128
  const {
1126
- data: v,
1129
+ data: N,
1127
1130
  isLoading: V,
1128
- isError: _
1131
+ isError: q
1129
1132
  } = he({
1130
1133
  queryKey: ["connections"],
1131
1134
  queryFn: () => ge(
@@ -1135,9 +1138,9 @@ function De(s, n) {
1135
1138
  enabled: !!(a != null && a.accessToken)
1136
1139
  // Only fetch if authToken is present
1137
1140
  }), {
1138
- data: S,
1139
- isLoading: M,
1140
- isError: N
1141
+ data: _,
1142
+ isLoading: L,
1143
+ isError: C
1141
1144
  } = he({
1142
1145
  queryKey: ["models", i],
1143
1146
  queryFn: () => ge(
@@ -1149,10 +1152,10 @@ function De(s, n) {
1149
1152
  ),
1150
1153
  enabled: !!(a != null && a.accessToken) && !!i
1151
1154
  // Only fetch if authToken is present
1152
- }), F = v == null ? void 0 : v.connections.find(
1153
- (b) => b.id === i
1154
- ), R = F == null ? void 0 : F.type, $ = (F == null ? void 0 : F.type) === "API" || (F == null ? void 0 : F.type) === "S3", {
1155
- data: E,
1155
+ }), b = N == null ? void 0 : N.connections.find(
1156
+ (y) => y.id === i
1157
+ ), R = b == null ? void 0 : b.type, H = (b == null ? void 0 : b.type) === "API" || (b == null ? void 0 : b.type) === "S3", {
1158
+ data: A,
1156
1159
  isLoading: P,
1157
1160
  isFetching: X,
1158
1161
  isError: W,
@@ -1166,13 +1169,13 @@ function De(s, n) {
1166
1169
  connection_id: i
1167
1170
  }
1168
1171
  ),
1169
- enabled: O(R)
1172
+ enabled: M(R)
1170
1173
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1171
1174
  }), {
1172
- data: U,
1175
+ data: K,
1173
1176
  isLoading: ie,
1174
- isFetching: C,
1175
- isError: D,
1177
+ isFetching: S,
1178
+ isError: O,
1176
1179
  refetch: J
1177
1180
  } = he({
1178
1181
  queryKey: ["schemas", i, r],
@@ -1184,13 +1187,13 @@ function De(s, n) {
1184
1187
  database_name: r
1185
1188
  }
1186
1189
  ),
1187
- enabled: !!i && !!r && !$ && r !== "NA"
1190
+ enabled: !!i && !!r && !H && r !== "NA"
1188
1191
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1189
1192
  }), {
1190
1193
  data: k,
1191
1194
  isLoading: I,
1192
1195
  isFetching: ee,
1193
- isError: q,
1196
+ isError: E,
1194
1197
  refetch: se
1195
1198
  } = he({
1196
1199
  queryKey: [
@@ -1235,7 +1238,7 @@ function De(s, n) {
1235
1238
  table_name: c
1236
1239
  }
1237
1240
  ),
1238
- enabled: L(R)
1241
+ enabled: F(R)
1239
1242
  // (!!selectedConnectionId &&
1240
1243
  // !!selectedDatabaseName &&
1241
1244
  // !!selectedSchemaName &&
@@ -1248,92 +1251,92 @@ function De(s, n) {
1248
1251
  m(t);
1249
1252
  }, [ae, m, t]), Y(() => {
1250
1253
  }, [
1251
- $,
1252
- y,
1254
+ H,
1255
+ v,
1253
1256
  x,
1254
1257
  d,
1255
1258
  j,
1256
- F
1259
+ b
1257
1260
  ]);
1258
- const le = (F == null ? void 0 : F.type) === "API" ? (Ge = F == null ? void 0 : F.type) == null ? void 0 : Ge.toLowerCase() : c || "", oe = $ ? "" : l || "";
1259
- function ye(b) {
1260
- d(b), x("");
1261
+ const le = (b == null ? void 0 : b.type) === "API" ? (Ge = b == null ? void 0 : b.type) == null ? void 0 : Ge.toLowerCase() : c || "", oe = H ? "" : l || "";
1262
+ function ye(y) {
1263
+ d(y), x("");
1261
1264
  }
1262
- function ce(b) {
1263
- j(b === "none" ? "" : b), d(""), x(""), b !== "none" && b !== "" && g("");
1265
+ function ce(y) {
1266
+ j(y === "none" ? "" : y), d(""), x(""), y !== "none" && y !== "" && g("");
1264
1267
  }
1265
- function fe(b) {
1266
- u(b);
1268
+ function fe(y) {
1269
+ u(y);
1267
1270
  }
1268
- function _s(b) {
1269
- g(b === "none" ? "" : b), b !== "none" && b !== "" && j("");
1271
+ function Rs(y) {
1272
+ g(y === "none" ? "" : y), y !== "none" && y !== "" && j("");
1270
1273
  }
1271
- E && ((Ee = E == null ? void 0 : E.databases) == null ? void 0 : Ee.length) > 0, U && ((Ke = U == null ? void 0 : U.schemas) == null ? void 0 : Ke.length) > 0, ae && ((Ue = ae == null ? void 0 : ae.columns) == null ? void 0 : Ue.length) > 0 && (t = ae.columns.map((b) => ({
1272
- ...b,
1273
- data_type: b.data_type.toLowerCase()
1274
- }))), W && (t = []), (Q || _) && (t = []);
1275
- const Ce = v == null ? void 0 : v.connections.map(
1276
- (b) => ({
1277
- id: b.id,
1278
- name: b.name,
1279
- type: b.type
1274
+ A && ((Ie = A == null ? void 0 : A.databases) == null ? void 0 : Ie.length) > 0, K && ((Ue = K == null ? void 0 : K.schemas) == null ? void 0 : Ue.length) > 0, ae && ((Ke = ae == null ? void 0 : ae.columns) == null ? void 0 : Ke.length) > 0 && (t = ae.columns.map((y) => ({
1275
+ ...y,
1276
+ data_type: y.data_type.toLowerCase()
1277
+ }))), W && (t = []), (Q || q) && (t = []);
1278
+ const Ce = N == null ? void 0 : N.connections.map(
1279
+ (y) => ({
1280
+ id: y.id,
1281
+ name: y.name,
1282
+ type: y.type
1280
1283
  })
1281
- ), os = (p = S == null ? void 0 : S.datamodels) == null ? void 0 : p.map((b) => ({
1282
- id: b.id,
1283
- name: b.name
1284
- })), Be = E == null ? void 0 : E.databases.map((b) => ({
1285
- id: b.database_name,
1286
- name: b.database_name
1287
- })), cs = U == null ? void 0 : U.schemas.map((b) => ({
1288
- id: b.schema_name,
1289
- name: b.schema_name
1290
- })), ds = k == null ? void 0 : k.tables.map((b) => ({
1291
- id: b.table_name,
1292
- name: b.table_name
1284
+ ), os = (p = _ == null ? void 0 : _.datamodels) == null ? void 0 : p.map((y) => ({
1285
+ id: y.id,
1286
+ name: y.name
1287
+ })), Be = A == null ? void 0 : A.databases.map((y) => ({
1288
+ id: y.database_name,
1289
+ name: y.database_name
1290
+ })), cs = K == null ? void 0 : K.schemas.map((y) => ({
1291
+ id: y.schema_name,
1292
+ name: y.schema_name
1293
+ })), ds = k == null ? void 0 : k.tables.map((y) => ({
1294
+ id: y.table_name,
1295
+ name: y.table_name
1293
1296
  }));
1294
1297
  return {
1295
1298
  connectionItems: Ce,
1296
1299
  isConnectionsLoading: V,
1297
- isConnectionsError: _,
1300
+ isConnectionsError: q,
1298
1301
  modelItems: os,
1299
- isModelsLoading: M,
1300
- isModelsError: N,
1302
+ isModelsLoading: L,
1303
+ isModelsError: C,
1301
1304
  databaseItems: Be,
1302
1305
  isDatabasesLoadingOrFetching: P || X,
1303
1306
  isDatabaseError: W,
1304
1307
  schemaItems: cs,
1305
- isSchemaLoadingOrFetching: ie || C,
1306
- isSchemaError: D,
1308
+ isSchemaLoadingOrFetching: ie || S,
1309
+ isSchemaError: O,
1307
1310
  tableItems: ds,
1308
1311
  isTableLoadingOrFetching: I || ee,
1309
- isTableError: q,
1312
+ isTableError: E,
1310
1313
  columns: t,
1311
1314
  isColumnsLoadingOrFetching: be || pe,
1312
1315
  isColumnsError: Q,
1313
- isNonDbConnection: $,
1316
+ isNonDbConnection: H,
1314
1317
  connectionType: R,
1315
1318
  tableName: le,
1316
1319
  schemaName: oe,
1317
1320
  handleConnectionChange: fe,
1318
- handleDatamodelChange: _s,
1321
+ handleDatamodelChange: Rs,
1319
1322
  handleDatabaseChange: ce,
1320
1323
  handleSchemaChange: ye
1321
1324
  };
1322
1325
  }
1323
- function Nt({
1326
+ function Ct({
1324
1327
  ColumnsComponent: s
1325
1328
  }) {
1326
1329
  var ee;
1327
1330
  const n = o(
1328
- (q) => q.selectedConnectionId
1331
+ (E) => E.selectedConnectionId
1329
1332
  ), t = o(
1330
- (q) => q.selectedDatamodelId
1333
+ (E) => E.selectedDatamodelId
1331
1334
  ), a = o(
1332
- (q) => q.selectedDatabaseName
1335
+ (E) => E.selectedDatabaseName
1333
1336
  ), i = o(
1334
- (q) => q.selectedSchemaName
1335
- ), h = o((q) => q.selectedTableName), r = o(
1336
- (q) => q.actions.setSelectedTableName
1337
+ (E) => E.selectedSchemaName
1338
+ ), h = o((E) => E.selectedTableName), r = o(
1339
+ (E) => E.actions.setSelectedTableName
1337
1340
  ), {
1338
1341
  connectionItems: l,
1339
1342
  modelItems: c,
@@ -1343,70 +1346,70 @@ function Nt({
1343
1346
  columns: j,
1344
1347
  isConnectionsLoading: d,
1345
1348
  isModelsLoading: x,
1346
- isConnectionsError: y,
1349
+ isConnectionsError: v,
1347
1350
  isModelsError: f,
1348
- isDatabasesLoadingOrFetching: L,
1349
- isDatabaseError: O,
1350
- isSchemaLoadingOrFetching: v,
1351
+ isDatabasesLoadingOrFetching: F,
1352
+ isDatabaseError: M,
1353
+ isSchemaLoadingOrFetching: N,
1351
1354
  isSchemaError: V,
1352
- isColumnsError: _,
1353
- isColumnsLoadingOrFetching: S,
1354
- isTableLoadingOrFetching: M,
1355
- isTableError: N,
1356
- connectionType: F,
1355
+ isColumnsError: q,
1356
+ isColumnsLoadingOrFetching: _,
1357
+ isTableLoadingOrFetching: L,
1358
+ isTableError: C,
1359
+ connectionType: b,
1357
1360
  isNonDbConnection: R,
1358
- handleConnectionChange: $,
1359
- handleDatabaseChange: E,
1361
+ handleConnectionChange: H,
1362
+ handleDatabaseChange: A,
1360
1363
  handleSchemaChange: P,
1361
1364
  handleDatamodelChange: X,
1362
1365
  tableName: W,
1363
1366
  schemaName: re
1364
1367
  } = De();
1365
- function U() {
1368
+ function K() {
1366
1369
  return s ? s(re, W, j) : /* @__PURE__ */ e.jsx(
1367
- An,
1370
+ In,
1368
1371
  {
1369
1372
  schemaName: re,
1370
1373
  tableName: W,
1371
1374
  columns: j,
1372
- status: S ? "Loading..." : _ ? "Error" : "Success"
1375
+ status: _ ? "Loading..." : q ? "Error" : "Success"
1373
1376
  }
1374
1377
  );
1375
1378
  }
1376
1379
  function ie() {
1377
1380
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1378
1381
  }
1379
- function C() {
1380
- if (!n || F === "S3" || F === "API")
1382
+ function S() {
1383
+ if (!n || b === "S3" || b === "API")
1381
1384
  return null;
1382
1385
  if (!t || t === "none")
1383
1386
  return /* @__PURE__ */ e.jsx(
1384
- Ie,
1387
+ Ee,
1385
1388
  {
1386
1389
  showNone: !0,
1387
- onChange: E,
1388
- isError: O,
1389
- isLoading: L,
1390
+ onChange: A,
1391
+ isError: M,
1392
+ isLoading: F,
1390
1393
  items: u,
1391
1394
  value: a || "",
1392
1395
  title: "Database"
1393
1396
  }
1394
1397
  );
1395
1398
  }
1396
- function D() {
1399
+ function O() {
1397
1400
  if (n && !R && (!a || a === "none") && (!t || t === "none"))
1398
1401
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1399
1402
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Re, {}) }),
1400
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(H, { children: "OR" }) }),
1403
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx($, { children: "OR" }) }),
1401
1404
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Re, {}) })
1402
1405
  ] });
1403
1406
  }
1404
1407
  function J() {
1405
- if (!n || F === "S3" || F === "API")
1408
+ if (!n || b === "S3" || b === "API")
1406
1409
  return null;
1407
1410
  if (!a || a === "none")
1408
1411
  return /* @__PURE__ */ e.jsx(
1409
- Ie,
1412
+ Ee,
1410
1413
  {
1411
1414
  showNone: !0,
1412
1415
  onChange: X,
@@ -1419,12 +1422,12 @@ function Nt({
1419
1422
  );
1420
1423
  }
1421
1424
  function k() {
1422
- return !n || F === "S3" || F === "API" || !a || a === "none" ? null : /* @__PURE__ */ e.jsx(
1423
- Ie,
1425
+ return !n || b === "S3" || b === "API" || !a || a === "none" ? null : /* @__PURE__ */ e.jsx(
1426
+ Ee,
1424
1427
  {
1425
1428
  onChange: P,
1426
1429
  isError: V,
1427
- isLoading: v,
1430
+ isLoading: N,
1428
1431
  items: m,
1429
1432
  value: i || "",
1430
1433
  title: "Schema"
@@ -1432,17 +1435,17 @@ function Nt({
1432
1435
  );
1433
1436
  }
1434
1437
  function I() {
1435
- function q() {
1438
+ function E() {
1436
1439
  let se = !1;
1437
- return F === "API" ? (se = !1, se) : ((F === "S3" || n && a && a !== "none" && i) && (se = !0), se);
1440
+ return b === "API" ? (se = !1, se) : ((b === "S3" || n && a && a !== "none" && i) && (se = !0), se);
1438
1441
  }
1439
- return q() ? /* @__PURE__ */ e.jsx(
1440
- Ie,
1442
+ return E() ? /* @__PURE__ */ e.jsx(
1443
+ Ee,
1441
1444
  {
1442
1445
  onChange: r,
1443
- isError: N,
1446
+ isError: C,
1444
1447
  items: g,
1445
- isLoading: M,
1448
+ isLoading: L,
1446
1449
  value: h || "",
1447
1450
  title: "Table"
1448
1451
  }
@@ -1451,26 +1454,26 @@ function Nt({
1451
1454
  return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
1452
1455
  /* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
1453
1456
  /* @__PURE__ */ e.jsx(
1454
- Ie,
1457
+ Ee,
1455
1458
  {
1456
1459
  items: l,
1457
1460
  title: "Connection",
1458
1461
  value: n || "",
1459
- onChange: $,
1462
+ onChange: H,
1460
1463
  isLoading: d,
1461
- isError: y,
1464
+ isError: v,
1462
1465
  connectionTooltip: ((ee = l == null ? void 0 : l.find(
1463
- (q) => q.id === n
1466
+ (E) => E.id === n
1464
1467
  )) == null ? void 0 : ee.type) || ""
1465
1468
  }
1466
1469
  ),
1467
1470
  J(),
1468
- D(),
1469
- C(),
1471
+ O(),
1472
+ S(),
1470
1473
  k(),
1471
1474
  I()
1472
1475
  ] }),
1473
- U(),
1476
+ K(),
1474
1477
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1475
1478
  z,
1476
1479
  {
@@ -1479,7 +1482,7 @@ function Nt({
1479
1482
  variant: "secondary",
1480
1483
  className: "w-full",
1481
1484
  children: [
1482
- /* @__PURE__ */ e.jsx(pn, { className: "mr-2 size-4" }),
1485
+ /* @__PURE__ */ e.jsx(fn, { className: "mr-2 size-4" }),
1483
1486
  "Help"
1484
1487
  ]
1485
1488
  }
@@ -1502,16 +1505,16 @@ function En(s) {
1502
1505
  return `${r} {{ filters | where }} ${l}`;
1503
1506
  }
1504
1507
  }
1505
- function In({
1508
+ function qn({
1506
1509
  error: s,
1507
1510
  setShowAIDialog: n,
1508
1511
  setUserInputforAI: t,
1509
1512
  setTriggerAIRun: a
1510
1513
  }) {
1511
- return /* @__PURE__ */ e.jsxs(Ls, { openDelay: 0, children: [
1512
- /* @__PURE__ */ e.jsx(Ms, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(tn, { className: "h-4 w-4 text-red-500" }) }) }),
1513
- /* @__PURE__ */ e.jsx(Os, { 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: "flex grow flex-col space-y-2", children: [
1514
- /* @__PURE__ */ e.jsx(Ds, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
1514
+ return /* @__PURE__ */ e.jsxs(Ms, { openDelay: 0, children: [
1515
+ /* @__PURE__ */ e.jsx(Os, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(an, { className: "h-4 w-4 text-red-500" }) }) }),
1516
+ /* @__PURE__ */ e.jsx(Ds, { 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: "flex grow flex-col space-y-2", children: [
1517
+ /* @__PURE__ */ e.jsx(Ts, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
1515
1518
  /* @__PURE__ */ e.jsxs(
1516
1519
  z,
1517
1520
  {
@@ -1521,7 +1524,7 @@ function In({
1521
1524
  size: "sm",
1522
1525
  variant: "outline",
1523
1526
  children: [
1524
- /* @__PURE__ */ e.jsx(on, { className: "mr-2 h-4 w-4" }),
1527
+ /* @__PURE__ */ e.jsx(cn, { className: "mr-2 h-4 w-4" }),
1525
1528
  "Debug with AI"
1526
1529
  ]
1527
1530
  }
@@ -1529,7 +1532,7 @@ function In({
1529
1532
  ] }) }) })
1530
1533
  ] });
1531
1534
  }
1532
- function qn({
1535
+ function Vn({
1533
1536
  text: s,
1534
1537
  onCheckedChange: n,
1535
1538
  checked: t
@@ -1539,7 +1542,7 @@ function qn({
1539
1542
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1540
1543
  ] });
1541
1544
  }
1542
- function Vn() {
1545
+ function _n() {
1543
1546
  const { authToken: s } = je(), n = o(
1544
1547
  (h) => h.selectedConnectionId
1545
1548
  ), { data: t } = he({
@@ -1555,10 +1558,10 @@ function Vn() {
1555
1558
  );
1556
1559
  return a == null ? void 0 : a.type;
1557
1560
  }
1558
- function _n() {
1559
- const { authToken: s } = je(), n = He(null), t = o((c) => c.applyFilters), [a, i] = A(""), h = o((c) => c.filterValues), r = o((c) => c.card.sql), l = Vn();
1561
+ function Rn() {
1562
+ const { authToken: s } = je(), n = He(null), t = o((c) => c.applyFilters), [a, i] = T(""), h = o((c) => c.filterValues), r = o((c) => c.card.sql), l = _n();
1560
1563
  return /* @__PURE__ */ e.jsxs(
1561
- Ls,
1564
+ Ms,
1562
1565
  {
1563
1566
  openDelay: 0,
1564
1567
  onOpenChange: async (c) => {
@@ -1577,20 +1580,20 @@ function _n() {
1577
1580
  console.log(m), m.sql ? (console.log(m.records), i(m.sql)) : i("Error");
1578
1581
  },
1579
1582
  children: [
1580
- /* @__PURE__ */ e.jsx(Ms, { asChild: !0, children: t && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1581
- /* @__PURE__ */ e.jsxs(Os, { align: "end", className: "w-[600px]", children: [
1583
+ /* @__PURE__ */ e.jsx(Os, { asChild: !0, children: t && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1584
+ /* @__PURE__ */ e.jsxs(Ds, { align: "end", className: "w-[600px]", children: [
1582
1585
  /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: n, className: "font-mono text-sm", children: [
1583
1586
  a,
1584
1587
  /* @__PURE__ */ e.jsx(
1585
- ot,
1588
+ ct,
1586
1589
  {
1587
- onClick: () => Zt(n),
1590
+ onClick: () => ea(n),
1588
1591
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
1589
1592
  }
1590
1593
  )
1591
1594
  ] }) }) }),
1592
1595
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
1593
- /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4 opacity-70" }),
1596
+ /* @__PURE__ */ e.jsx(sa, { className: "h-4 w-4 opacity-70" }),
1594
1597
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
1595
1598
  ] })
1596
1599
  ] })
@@ -1598,7 +1601,7 @@ function _n() {
1598
1601
  }
1599
1602
  );
1600
1603
  }
1601
- const Rn = `
1604
+ const Hn = `
1602
1605
 
1603
1606
  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.
1604
1607
 
@@ -1645,7 +1648,7 @@ SELECT label, measure FROM table
1645
1648
  - Label - Category
1646
1649
  - Measure - Number
1647
1650
  `;
1648
- function Hn({
1651
+ function $n({
1649
1652
  open: s,
1650
1653
  setOpen: n,
1651
1654
  userInput: t,
@@ -1653,64 +1656,64 @@ function Hn({
1653
1656
  triggerAIRun: i,
1654
1657
  setTriggerAIRun: h
1655
1658
  }) {
1656
- const r = He(null), l = He(null), { authToken: c } = je(), [m, u] = A(!1), g = o((C) => C.actions.setCardSql), j = w((C) => C.dashboard.baseQueries), d = o((C) => C.actions.setRunSql), x = o((C) => C.actions.setCardType), [y, f] = A([]), L = o((C) => C.currentColumns), O = o((C) => C.card.sql), v = o((C) => C.selectedTableName), V = `
1659
+ const r = He(null), l = He(null), { authToken: c } = je(), [m, u] = T(!1), g = o((S) => S.actions.setCardSql), j = w((S) => S.dashboard.baseQueries), d = o((S) => S.actions.setRunSql), x = o((S) => S.actions.setCardType), [v, f] = T([]), F = o((S) => S.currentColumns), M = o((S) => S.card.sql), N = o((S) => S.selectedTableName), V = `
1657
1660
  ${t}
1658
1661
 
1659
- Database Query Dialect: ${v === "api" || v === "s3" ? "DuckDb" : ""}
1660
- Table Name: ${v}
1661
- Table Columns: ${L == null ? void 0 : L.map((C) => `${C.column_name} | ${C.data_type}`).join(", ")}
1662
- User SQL: ${O}
1663
- ${j && `Base Queries: ${JSON.stringify(j)} `}`, _ = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1664
- Visual Query Syntax: ${Rn}`, { data: S, isLoading: M, isFetching: N, isError: F, refetch: R } = he({
1662
+ Database Query Dialect: ${N === "api" || N === "s3" ? "DuckDb" : ""}
1663
+ Table Name: ${N}
1664
+ Table Columns: ${F == null ? void 0 : F.map((S) => `${S.column_name} | ${S.data_type}`).join(", ")}
1665
+ User SQL: ${M}
1666
+ ${j && `Base Queries: ${JSON.stringify(j)} `}`, q = ` 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.
1667
+ Visual Query Syntax: ${Hn}`, { data: _, isLoading: L, isFetching: C, isError: b, refetch: R } = he({
1665
1668
  queryKey: ["ai-query"],
1666
1669
  queryFn: () => ge(
1667
1670
  "https://semaphor.cloud/api/v1/ai",
1668
1671
  (c == null ? void 0 : c.accessToken) || "",
1669
1672
  {
1670
- user_content: `userContent: ${V} ${m ? _ : ""}`
1673
+ user_content: `userContent: ${V} ${m ? q : ""}`
1671
1674
  }
1672
1675
  ),
1673
1676
  enabled: !1
1674
1677
  // Do not run by default.
1675
1678
  });
1676
- function $(C) {
1677
- if (C.toLowerCase().includes("bar"))
1679
+ function H(S) {
1680
+ if (S.toLowerCase().includes("bar"))
1678
1681
  x("bar");
1679
- else if (C.toLowerCase().includes("line"))
1682
+ else if (S.toLowerCase().includes("line"))
1680
1683
  x("line");
1681
- else if (C.toLowerCase().includes("bubble"))
1684
+ else if (S.toLowerCase().includes("bubble"))
1682
1685
  x("bubble");
1683
- else if (C.toLowerCase().includes("scatter"))
1686
+ else if (S.toLowerCase().includes("scatter"))
1684
1687
  x("scatter");
1685
- else if (C.toLowerCase().includes("stacked"))
1688
+ else if (S.toLowerCase().includes("stacked"))
1686
1689
  x("stackedBar");
1687
- else if (C.toLowerCase().includes("pie"))
1690
+ else if (S.toLowerCase().includes("pie"))
1688
1691
  x("pie");
1689
- else if (C.toLowerCase().includes("donut") || C.toLowerCase().includes("doughnut"))
1692
+ else if (S.toLowerCase().includes("donut") || S.toLowerCase().includes("doughnut"))
1690
1693
  x("doughnut");
1691
- else if (C.toLowerCase().includes("radar"))
1694
+ else if (S.toLowerCase().includes("radar"))
1692
1695
  x("radar");
1693
1696
  else
1694
1697
  return x("bar"), !1;
1695
1698
  return !0;
1696
1699
  }
1697
1700
  Y(() => {
1698
- S && f((C) => [...C, { role: "ai", content: S.response }]);
1699
- }, [S]), Y(() => {
1700
- const C = setTimeout(() => {
1701
- var D;
1701
+ _ && f((S) => [...S, { role: "ai", content: _.response }]);
1702
+ }, [_]), Y(() => {
1703
+ const S = setTimeout(() => {
1704
+ var O;
1702
1705
  l.current && (l.current.scroll({
1703
1706
  top: l.current.scrollHeight,
1704
1707
  behavior: "smooth"
1705
- }), (D = r.current) == null || D.focus());
1708
+ }), (O = r.current) == null || O.focus());
1706
1709
  }, 100);
1707
- return () => clearTimeout(C);
1708
- }, [y]);
1709
- function E() {
1710
- t && (f((C) => [...C, { role: "user", content: t }]), $(t) && u(!0), a(""), R());
1710
+ return () => clearTimeout(S);
1711
+ }, [v]);
1712
+ function A() {
1713
+ t && (f((S) => [...S, { role: "user", content: t }]), H(t) && u(!0), a(""), R());
1711
1714
  }
1712
1715
  Y(() => {
1713
- i && (E(), h(!1));
1716
+ i && (A(), h(!1));
1714
1717
  }, [i, h]);
1715
1718
  const P = {
1716
1719
  //seleect a darker color
@@ -1739,59 +1742,59 @@ function Hn({
1739
1742
  listStyleType: "disc"
1740
1743
  }, re = {
1741
1744
  // Override how paragraphs are rendered
1742
- p: ({ node: C, ...D }) => /* @__PURE__ */ e.jsx("p", { style: P, ...D }),
1743
- code: ({ node: C, ...D }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...D }),
1744
- pre: ({ node: C, ...D }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: X, children: [
1745
- /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: D.children }),
1745
+ p: ({ node: S, ...O }) => /* @__PURE__ */ e.jsx("p", { style: P, ...O }),
1746
+ code: ({ node: S, ...O }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...O }),
1747
+ pre: ({ node: S, ...O }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: X, children: [
1748
+ /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: O.children }),
1746
1749
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1747
- /* @__PURE__ */ e.jsx(z, { onClick: U, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ot, {}) }),
1750
+ /* @__PURE__ */ e.jsx(z, { onClick: K, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ct, {}) }),
1748
1751
  /* @__PURE__ */ e.jsx(
1749
1752
  z,
1750
1753
  {
1751
1754
  onClick: (J) => {
1752
- const k = U(J);
1755
+ const k = K(J);
1753
1756
  k && (n(!1), g(k), d(!0));
1754
1757
  },
1755
1758
  size: "sm",
1756
1759
  variant: "outline",
1757
- children: /* @__PURE__ */ e.jsx(ta, {})
1760
+ children: /* @__PURE__ */ e.jsx(na, {})
1758
1761
  }
1759
1762
  )
1760
1763
  ] })
1761
1764
  ] }),
1762
- li: ({ node: C, ...D }) => /* @__PURE__ */ e.jsx("li", { style: W, ...D })
1765
+ li: ({ node: S, ...O }) => /* @__PURE__ */ e.jsx("li", { style: W, ...O })
1763
1766
  // You can add more overrides for other elements like h1, h2, etc.
1764
1767
  };
1765
- function U(C) {
1766
- const D = C.currentTarget.closest("pre");
1767
- if (!D)
1768
+ function K(S) {
1769
+ const O = S.currentTarget.closest("pre");
1770
+ if (!O)
1768
1771
  return;
1769
- const J = D.textContent || D.innerText;
1772
+ const J = O.textContent || O.innerText;
1770
1773
  return navigator.clipboard.writeText(J).then(() => console.log("Text copied to clipboard")).catch((k) => console.error("Error in copying text: ", k)), J;
1771
1774
  }
1772
1775
  function ie() {
1773
- return y == null ? void 0 : y.map((C, D) => C.role === "user" ? /* @__PURE__ */ e.jsxs(
1776
+ return v == null ? void 0 : v.map((S, O) => S.role === "user" ? /* @__PURE__ */ e.jsxs(
1774
1777
  "div",
1775
1778
  {
1776
1779
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1777
1780
  children: [
1778
- /* @__PURE__ */ e.jsx(wn, { className: "mr-2 h-5 w-5" }),
1779
- /* @__PURE__ */ e.jsx("div", { children: C.content })
1781
+ /* @__PURE__ */ e.jsx(kn, { className: "mr-2 h-5 w-5" }),
1782
+ /* @__PURE__ */ e.jsx("div", { children: S.content })
1780
1783
  ]
1781
1784
  },
1782
- D
1783
- ) : C.role === "ai" ? /* @__PURE__ */ e.jsx(
1784
- sa,
1785
+ O
1786
+ ) : S.role === "ai" ? /* @__PURE__ */ e.jsx(
1787
+ aa,
1785
1788
  {
1786
1789
  className: "w-full overflow-auto py-1",
1787
1790
  components: re,
1788
- children: S == null ? void 0 : S.response.replace(/DuckDB/gi, "Semaphor")
1791
+ children: _ == null ? void 0 : _.response.replace(/DuckDB/gi, "Semaphor")
1789
1792
  },
1790
- D
1791
- ) : /* @__PURE__ */ e.jsx("div", {}, D));
1793
+ O
1794
+ ) : /* @__PURE__ */ e.jsx("div", {}, O));
1792
1795
  }
1793
- return /* @__PURE__ */ e.jsxs(bs, { open: s, onOpenChange: n, children: [
1794
- /* @__PURE__ */ e.jsx(ys, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1796
+ return /* @__PURE__ */ e.jsxs(ys, { open: s, onOpenChange: n, children: [
1797
+ /* @__PURE__ */ e.jsx(vs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1795
1798
  z,
1796
1799
  {
1797
1800
  size: "sm",
@@ -1801,13 +1804,13 @@ function Hn({
1801
1804
  }
1802
1805
  ) }),
1803
1806
  /* @__PURE__ */ e.jsxs(
1804
- Ns,
1807
+ Cs,
1805
1808
  {
1806
1809
  className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
1807
1810
  children: [
1808
- /* @__PURE__ */ e.jsxs(Cs, { children: [
1809
- /* @__PURE__ */ e.jsx(Ss, { children: "Assistant" }),
1810
- /* @__PURE__ */ e.jsx(ws, { children: "What can I help you with?" })
1811
+ /* @__PURE__ */ e.jsxs(Ss, { children: [
1812
+ /* @__PURE__ */ e.jsx(ws, { children: "Assistant" }),
1813
+ /* @__PURE__ */ e.jsx(ks, { children: "What can I help you with?" })
1811
1814
  ] }),
1812
1815
  /* @__PURE__ */ e.jsx(
1813
1816
  "div",
@@ -1822,24 +1825,24 @@ function Hn({
1822
1825
  {
1823
1826
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
1824
1827
  /* @__PURE__ */ e.jsx(
1825
- ct,
1828
+ dt,
1826
1829
  {
1827
1830
  autoFocus: !0,
1828
1831
  ref: r,
1829
- onKeyDown: (C) => {
1830
- C.key === "Enter" && !C.shiftKey && (C.preventDefault(), a(""), E());
1832
+ onKeyDown: (S) => {
1833
+ S.key === "Enter" && !S.shiftKey && (S.preventDefault(), a(""), A());
1831
1834
  },
1832
1835
  placeholder: "Type your question here...",
1833
- onFocus: (C) => {
1834
- const D = C.target, J = D.value.length;
1835
- D.setSelectionRange(J, J);
1836
+ onFocus: (S) => {
1837
+ const O = S.target, J = O.value.length;
1838
+ O.setSelectionRange(J, J);
1836
1839
  },
1837
1840
  className: Z(
1838
1841
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1839
1842
  ),
1840
- disabled: M || N,
1843
+ disabled: L || C,
1841
1844
  value: t,
1842
- onChange: (C) => a(C.target.value)
1845
+ onChange: (S) => a(S.target.value)
1843
1846
  }
1844
1847
  ),
1845
1848
  " ",
@@ -1849,8 +1852,8 @@ function Hn({
1849
1852
  className: "h-8",
1850
1853
  size: "sm",
1851
1854
  variant: "ghost",
1852
- onClick: E,
1853
- children: !M && !N ? /* @__PURE__ */ e.jsx(ea, {}) : /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1855
+ onClick: A,
1856
+ children: !L && !C ? /* @__PURE__ */ e.jsx(ta, {}) : /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1854
1857
  }
1855
1858
  )
1856
1859
  ] })
@@ -1861,17 +1864,17 @@ function Hn({
1861
1864
  )
1862
1865
  ] });
1863
1866
  }
1864
- var Ct = {
1867
+ var St = {
1865
1868
  color: void 0,
1866
1869
  size: void 0,
1867
1870
  className: void 0,
1868
1871
  style: void 0,
1869
1872
  attr: void 0
1870
- }, Js = me.createContext && /* @__PURE__ */ me.createContext(Ct), $n = ["attr", "size", "title"];
1871
- function Pn(s, n) {
1873
+ }, Ys = me.createContext && /* @__PURE__ */ me.createContext(St), Pn = ["attr", "size", "title"];
1874
+ function Bn(s, n) {
1872
1875
  if (s == null)
1873
1876
  return {};
1874
- var t = Bn(s, n), a, i;
1877
+ var t = Gn(s, n), a, i;
1875
1878
  if (Object.getOwnPropertySymbols) {
1876
1879
  var h = Object.getOwnPropertySymbols(s);
1877
1880
  for (i = 0; i < h.length; i++)
@@ -1879,7 +1882,7 @@ function Pn(s, n) {
1879
1882
  }
1880
1883
  return t;
1881
1884
  }
1882
- function Bn(s, n) {
1885
+ function Gn(s, n) {
1883
1886
  if (s == null)
1884
1887
  return {};
1885
1888
  var t = {}, a = Object.keys(s), i, h;
@@ -1897,7 +1900,7 @@ function es() {
1897
1900
  return s;
1898
1901
  }, es.apply(this, arguments);
1899
1902
  }
1900
- function Ys(s, n) {
1903
+ function Zs(s, n) {
1901
1904
  var t = Object.keys(s);
1902
1905
  if (Object.getOwnPropertySymbols) {
1903
1906
  var a = Object.getOwnPropertySymbols(s);
@@ -1910,22 +1913,22 @@ function Ys(s, n) {
1910
1913
  function ss(s) {
1911
1914
  for (var n = 1; n < arguments.length; n++) {
1912
1915
  var t = arguments[n] != null ? arguments[n] : {};
1913
- n % 2 ? Ys(Object(t), !0).forEach(function(a) {
1914
- Gn(s, a, t[a]);
1915
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(t)) : Ys(Object(t)).forEach(function(a) {
1916
+ n % 2 ? Zs(Object(t), !0).forEach(function(a) {
1917
+ Un(s, a, t[a]);
1918
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(t)) : Zs(Object(t)).forEach(function(a) {
1916
1919
  Object.defineProperty(s, a, Object.getOwnPropertyDescriptor(t, a));
1917
1920
  });
1918
1921
  }
1919
1922
  return s;
1920
1923
  }
1921
- function Gn(s, n, t) {
1924
+ function Un(s, n, t) {
1922
1925
  return n = Kn(n), n in s ? Object.defineProperty(s, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = t, s;
1923
1926
  }
1924
1927
  function Kn(s) {
1925
- var n = Un(s, "string");
1928
+ var n = Wn(s, "string");
1926
1929
  return typeof n == "symbol" ? n : String(n);
1927
1930
  }
1928
- function Un(s, n) {
1931
+ function Wn(s, n) {
1929
1932
  if (typeof s != "object" || s === null)
1930
1933
  return s;
1931
1934
  var t = s[Symbol.toPrimitive];
@@ -1937,23 +1940,23 @@ function Un(s, n) {
1937
1940
  }
1938
1941
  return (n === "string" ? String : Number)(s);
1939
1942
  }
1940
- function St(s) {
1943
+ function wt(s) {
1941
1944
  return s && s.map((n, t) => /* @__PURE__ */ me.createElement(n.tag, ss({
1942
1945
  key: t
1943
- }, n.attr), St(n.child)));
1946
+ }, n.attr), wt(n.child)));
1944
1947
  }
1945
1948
  function xe(s) {
1946
- return (n) => /* @__PURE__ */ me.createElement(Wn, es({
1949
+ return (n) => /* @__PURE__ */ me.createElement(Qn, es({
1947
1950
  attr: ss({}, s.attr)
1948
- }, n), St(s.child));
1951
+ }, n), wt(s.child));
1949
1952
  }
1950
- function Wn(s) {
1953
+ function Qn(s) {
1951
1954
  var n = (t) => {
1952
1955
  var {
1953
1956
  attr: a,
1954
1957
  size: i,
1955
1958
  title: h
1956
- } = s, r = Pn(s, $n), l = i || t.size || "1em", c;
1959
+ } = s, r = Bn(s, Pn), l = i || t.size || "1em", c;
1957
1960
  return t.className && (c = t.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", es({
1958
1961
  stroke: "currentColor",
1959
1962
  fill: "currentColor",
@@ -1968,38 +1971,38 @@ function Wn(s) {
1968
1971
  xmlns: "http://www.w3.org/2000/svg"
1969
1972
  }), h && /* @__PURE__ */ me.createElement("title", null, h), s.children);
1970
1973
  };
1971
- return Js !== void 0 ? /* @__PURE__ */ me.createElement(Js.Consumer, null, (t) => n(t)) : n(Ct);
1974
+ return Ys !== void 0 ? /* @__PURE__ */ me.createElement(Ys.Consumer, null, (t) => n(t)) : n(St);
1972
1975
  }
1973
- function Qn(s) {
1976
+ function Jn(s) {
1974
1977
  return xe({ 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);
1975
1978
  }
1976
- function Jn() {
1977
- const { theme: s } = aa(), n = He(), t = He(), [a, i] = A(!1), [h, r] = A(!1), [l, c] = A(!1), [m, u] = A(""), [g, j] = A(!1), { authToken: d } = je();
1979
+ function Yn() {
1980
+ const { theme: s } = ra(), n = He(), t = He(), [a, i] = T(!1), [h, r] = T(!1), [l, c] = T(!1), [m, u] = T(""), [g, j] = T(!1), { authToken: d } = je();
1978
1981
  w((p) => p.selectedSheetId);
1979
- const x = w((p) => p.dashboard.baseQueries), y = o((p) => p.card), f = w((p) => p.theme), L = o((p) => p.isShowingVisual), O = o(
1982
+ const x = w((p) => p.dashboard.baseQueries), v = o((p) => p.card), f = w((p) => p.theme), F = o((p) => p.isShowingVisual), M = o(
1980
1983
  (p) => p.selectedConnectionId
1981
- ), v = o(
1984
+ ), N = o(
1982
1985
  (p) => p.selectedDatabaseName
1983
1986
  ), V = o(
1984
1987
  (p) => p.selectedDatamodelId
1985
- ), _ = o(
1988
+ ), q = o(
1986
1989
  (p) => p.selectedSchemaName
1987
1990
  );
1988
1991
  w(
1989
1992
  (p) => p.actions.updateFrameCard
1990
1993
  );
1991
- const S = o((p) => p.selectedTableName), M = o((p) => p.card.sql), N = o((p) => p.card.python), F = na(M, x), R = o((p) => p.selectedConnectionId), $ = o((p) => p.frame), E = w((p) => p.filterValues), P = o((p) => p.applyFilters), {
1994
+ const _ = o((p) => p.selectedTableName), L = o((p) => p.card.sql), C = o((p) => p.card.python), b = ia(L, x), R = o((p) => p.selectedConnectionId), H = o((p) => p.frame), A = w((p) => p.filterValues), P = o((p) => p.applyFilters), {
1992
1995
  setCardCustomCfg: X,
1993
1996
  setQueryResultColumns: W,
1994
1997
  setFilterValues: re,
1995
- setCardSql: U,
1998
+ setCardSql: K,
1996
1999
  setCardPython: ie,
1997
- setQueryError: C,
1998
- setPythonStdOut: D,
2000
+ setQueryError: S,
2001
+ setPythonStdOut: O,
1999
2002
  setCardPreferences: J
2000
2003
  } = o((p) => p.actions), k = o((p) => p.onSave), I = o(
2001
2004
  (p) => p.actions.setApplyFilters
2002
- ), ee = o((p) => p.onClose), q = o((p) => p.actions.setCardData), se = o((p) => p.actions.setSqlGen), ae = o((p) => p.runSql), be = o((p) => p.actions.setRunSql), pe = o(
2005
+ ), ee = o((p) => p.onClose), E = o((p) => p.actions.setCardData), se = o((p) => p.actions.setSqlGen), ae = o((p) => p.runSql), be = o((p) => p.actions.setRunSql), pe = o(
2003
2006
  (p) => p.actions.setIsSqlRunning
2004
2007
  ), {
2005
2008
  data: Q,
@@ -2008,93 +2011,93 @@ function Jn() {
2008
2011
  isSuccess: ye,
2009
2012
  isError: ce,
2010
2013
  error: fe,
2011
- status: _s,
2014
+ status: Rs,
2012
2015
  refetch: Ce
2013
2016
  } = he({
2014
- queryKey: [F, N],
2017
+ queryKey: [b, C],
2015
2018
  queryFn: () => Pe(
2016
2019
  "https://semaphor.cloud/api/v1/query",
2017
2020
  (d == null ? void 0 : d.accessToken) || "",
2018
2021
  {
2019
2022
  connection_id: R,
2020
- sql: F,
2021
- python: N === Ps ? "" : N,
2022
- active_filters: P ? E : []
2023
+ sql: b,
2024
+ python: C === Bs ? "" : C,
2025
+ active_filters: P ? A : []
2023
2026
  }
2024
2027
  ),
2025
2028
  enabled: !1,
2026
2029
  retry: !1
2027
2030
  });
2028
2031
  Y(() => {
2029
- if (Q && (q(Q.records), Q.rowLimitExceeded && Xe.error("Row limit (10,000) exceeded. Refine your query.", {
2032
+ if (Q && (E(Q.records), Q.rowLimitExceeded && Xe.error("Row limit (10,000) exceeded. Refine your query.", {
2030
2033
  position: "top-center",
2031
2034
  richColors: !0
2032
- }), D((Q == null ? void 0 : Q.output) || ""), Q.records.length > 0)) {
2035
+ }), O((Q == null ? void 0 : Q.output) || ""), Q.records.length > 0)) {
2033
2036
  const { dimensionKeys: p } = xs(Q.records);
2034
2037
  W(p);
2035
2038
  }
2036
- }, [Q, q, W, D]), Y(() => {
2039
+ }, [Q, E, W, O]), Y(() => {
2037
2040
  ae && (Ce(), be(!1));
2038
2041
  }, [ae, Ce, be]), Y(() => {
2039
- (le || oe) && pe(!0), (ce || ye) && pe(!1), ce ? (C(fe.message), q([]), W([]), D("")) : C("");
2042
+ (le || oe) && pe(!0), (ce || ye) && pe(!1), ce ? (S(fe.message), E([]), W([]), O("")) : S("");
2040
2043
  }, [
2041
2044
  le,
2042
2045
  oe,
2043
2046
  Q,
2044
- D,
2047
+ O,
2045
2048
  ce,
2046
2049
  ye,
2047
2050
  pe,
2048
- q,
2051
+ E,
2049
2052
  W,
2050
- C,
2053
+ S,
2051
2054
  fe
2052
2055
  ]);
2053
2056
  function os() {
2054
- U(""), q([]), se({}), X(""), J({});
2057
+ K(""), E([]), se({}), X(""), J({});
2055
2058
  }
2056
2059
  const Be = (p) => {
2057
2060
  t.current = p;
2058
2061
  };
2059
- function cs(p, b) {
2062
+ function cs(p, y) {
2060
2063
  if (p.length === 0)
2061
2064
  return "";
2062
- if (b) {
2063
- const ve = p.find((ne) => ne.id === b);
2065
+ if (y) {
2066
+ const ve = p.find((ne) => ne.id === y);
2064
2067
  if (ve) {
2065
2068
  const ne = ve.tabTitle;
2066
2069
  if (ne == "All__Header")
2067
2070
  return p[0].id;
2068
2071
  if (ne && ne.endsWith("__Header")) {
2069
- const qt = ne.split("__")[0], Rs = p.find(
2070
- (Vt) => Vt.tabTitle === qt
2072
+ const Vt = ne.split("__")[0], Hs = p.find(
2073
+ (_t) => _t.tabTitle === Vt
2071
2074
  );
2072
- return Rs ? Rs.id : p[0].id;
2075
+ return Hs ? Hs.id : p[0].id;
2073
2076
  }
2074
- return b;
2077
+ return y;
2075
2078
  }
2076
2079
  }
2077
2080
  return p[0].id;
2078
2081
  }
2079
2082
  function ds() {
2080
- let p = M;
2081
- M && !M.includes("{{") && (p = En(M), U(p));
2082
- const b = {
2083
- ...y,
2084
- lastSelectedSchema: _,
2083
+ let p = L;
2084
+ L && !L.includes("{{") && (p = En(L), K(p));
2085
+ const y = {
2086
+ ...v,
2087
+ lastSelectedSchema: q,
2085
2088
  lastSelectedDatamodelId: V,
2086
- lastSelectedDatabase: v,
2087
- lastSelectedTable: S,
2088
- connectionId: O,
2089
- type: L ? y.type : "table",
2089
+ lastSelectedDatabase: N,
2090
+ lastSelectedTable: _,
2091
+ connectionId: M,
2092
+ type: F ? v.type : "table",
2090
2093
  sql: p,
2091
- customCfg: L ? y.customCfg : null
2092
- }, ve = $.cards.map(
2093
- (hs) => hs.id === y.id ? b : hs
2094
+ customCfg: F ? v.customCfg : null
2095
+ }, ve = H.cards.map(
2096
+ (hs) => hs.id === v.id ? y : hs
2094
2097
  ), ne = {
2095
- ...$,
2098
+ ...H,
2096
2099
  cards: ve,
2097
- activeCardId: cs(ve, $.activeCardId)
2100
+ activeCardId: cs(ve, H.activeCardId)
2098
2101
  };
2099
2102
  k == null || k(ne);
2100
2103
  }
@@ -2102,7 +2105,7 @@ function Jn() {
2102
2105
  ee == null || ee();
2103
2106
  }
2104
2107
  Y(() => {
2105
- const p = n.current, b = t.current;
2108
+ const p = n.current, y = t.current;
2106
2109
  if (p) {
2107
2110
  const ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ne = f === "system" ? ve : f;
2108
2111
  p.editor.defineTheme("default", {
@@ -2112,11 +2115,11 @@ function Jn() {
2112
2115
  rules: [],
2113
2116
  colors: {
2114
2117
  // 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
2115
- "editor.background": ne === "light" ? "#ffffff" : ra("--semaphor-background")
2118
+ "editor.background": ne === "light" ? "#ffffff" : la("--semaphor-background")
2116
2119
  }
2117
2120
  }), p.editor.setTheme("default");
2118
2121
  }
2119
- return b && p && b.addCommand(
2122
+ return y && p && y.addCommand(
2120
2123
  p.KeyMod.Shift | p.KeyCode.Enter,
2121
2124
  function() {
2122
2125
  return console.log("Executing query..."), Ce(), !1;
@@ -2124,10 +2127,10 @@ function Jn() {
2124
2127
  ), () => {
2125
2128
  };
2126
2129
  }, [s, f, n.current]);
2127
- function Ee(p) {
2130
+ function Ie(p) {
2128
2131
  n.current = p;
2129
2132
  }
2130
- function Ke() {
2133
+ function Ue() {
2131
2134
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2132
2135
  h && /* @__PURE__ */ e.jsx(
2133
2136
  "div",
@@ -2137,15 +2140,15 @@ function Jn() {
2137
2140
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
2138
2141
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
2139
2142
  /* @__PURE__ */ e.jsx(
2140
- qn,
2143
+ Vn,
2141
2144
  {
2142
2145
  checked: P,
2143
2146
  onCheckedChange: () => I(!P),
2144
2147
  text: "Apply Filters"
2145
2148
  }
2146
2149
  ),
2147
- /* @__PURE__ */ e.jsx(_n, {}),
2148
- E && h && /* @__PURE__ */ e.jsx(
2150
+ /* @__PURE__ */ e.jsx(Rn, {}),
2151
+ A && h && /* @__PURE__ */ e.jsx(
2149
2152
  Ve,
2150
2153
  {
2151
2154
  onClick: () => r(!1),
@@ -2166,7 +2169,7 @@ function Jn() {
2166
2169
  },
2167
2170
  defaultLanguage: "json",
2168
2171
  className: "mt-1 min-h-[220px]",
2169
- value: JSON.stringify(E, null, 2),
2172
+ value: JSON.stringify(A, null, 2),
2170
2173
  options: {
2171
2174
  readOnly: !0,
2172
2175
  minimap: {
@@ -2187,8 +2190,8 @@ function Jn() {
2187
2190
  ] })
2188
2191
  }
2189
2192
  ),
2190
- E && !h && /* @__PURE__ */ e.jsx(
2191
- st,
2193
+ A && !h && /* @__PURE__ */ e.jsx(
2194
+ tt,
2192
2195
  {
2193
2196
  onClick: () => r(!0),
2194
2197
  className: Z(
@@ -2201,7 +2204,7 @@ function Jn() {
2201
2204
  )
2202
2205
  ] });
2203
2206
  }
2204
- function Ue() {
2207
+ function Ke() {
2205
2208
  return /* @__PURE__ */ e.jsxs(
2206
2209
  ps,
2207
2210
  {
@@ -2228,9 +2231,9 @@ function Jn() {
2228
2231
  theme: "default",
2229
2232
  className: "pt-3",
2230
2233
  onChange: (p) => {
2231
- U(p);
2234
+ K(p);
2232
2235
  },
2233
- value: M,
2236
+ value: L,
2234
2237
  options: {
2235
2238
  minimap: {
2236
2239
  enabled: !1
@@ -2244,7 +2247,7 @@ function Jn() {
2244
2247
  renderLineHighlight: "none"
2245
2248
  },
2246
2249
  defaultLanguage: "sql",
2247
- beforeMount: Ee,
2250
+ beforeMount: Ie,
2248
2251
  onMount: Be
2249
2252
  }
2250
2253
  )
@@ -2277,7 +2280,7 @@ function Jn() {
2277
2280
  onChange: (p) => {
2278
2281
  ie(p && p.trim() || "");
2279
2282
  },
2280
- value: N || Ps,
2283
+ value: C || Bs,
2281
2284
  options: {
2282
2285
  minimap: {
2283
2286
  enabled: !1
@@ -2291,7 +2294,7 @@ function Jn() {
2291
2294
  renderLineHighlight: "none"
2292
2295
  },
2293
2296
  defaultLanguage: "python",
2294
- beforeMount: Ee,
2297
+ beforeMount: Ie,
2295
2298
  onMount: Be
2296
2299
  }
2297
2300
  )
@@ -2320,8 +2323,8 @@ function Jn() {
2320
2323
  role: "sql-editor",
2321
2324
  className: "relative flex grow justify-between overflow-y-scroll",
2322
2325
  children: [
2323
- Ue(),
2324
- Ke()
2326
+ Ke(),
2327
+ Ue()
2325
2328
  ]
2326
2329
  }
2327
2330
  ),
@@ -2344,13 +2347,13 @@ function Jn() {
2344
2347
  size: "sm",
2345
2348
  variant: "outline",
2346
2349
  children: [
2347
- le || oe ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(gn, { className: "mr-2 h-4 w-4" }),
2350
+ le || oe ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(jn, { className: "mr-2 h-4 w-4" }),
2348
2351
  "Run"
2349
2352
  ]
2350
2353
  }
2351
2354
  ),
2352
2355
  ce && /* @__PURE__ */ e.jsx(
2353
- In,
2356
+ qn,
2354
2357
  {
2355
2358
  error: fe.message,
2356
2359
  setShowAIDialog: c,
@@ -2366,24 +2369,24 @@ function Jn() {
2366
2369
  size: "sm",
2367
2370
  variant: "outline",
2368
2371
  children: [
2369
- /* @__PURE__ */ e.jsx(rn, { className: "mr-2 size-4" }),
2372
+ /* @__PURE__ */ e.jsx(ln, { className: "mr-2 size-4" }),
2370
2373
  "Clear"
2371
2374
  ]
2372
2375
  }
2373
2376
  ),
2374
2377
  /* @__PURE__ */ e.jsx(
2375
- it,
2378
+ lt,
2376
2379
  {
2377
2380
  pressed: a,
2378
2381
  onPressedChange: (p) => i(p),
2379
2382
  className: "",
2380
2383
  size: "sm",
2381
2384
  variant: "outline",
2382
- children: /* @__PURE__ */ e.jsx(Qn, { className: "size-4 text-foreground/70" })
2385
+ children: /* @__PURE__ */ e.jsx(Jn, { className: "size-4 text-foreground/70" })
2383
2386
  }
2384
2387
  ),
2385
2388
  /* @__PURE__ */ e.jsx(
2386
- Hn,
2389
+ $n,
2387
2390
  {
2388
2391
  open: l,
2389
2392
  setOpen: c,
@@ -2402,7 +2405,7 @@ function Jn() {
2402
2405
  size: "sm",
2403
2406
  variant: "outline",
2404
2407
  children: [
2405
- /* @__PURE__ */ e.jsx(ia, { className: "mr-2 size-4 font-bold text-green-600" }),
2408
+ /* @__PURE__ */ e.jsx(oa, { className: "mr-2 size-4 font-bold text-green-600" }),
2406
2409
  "Accept"
2407
2410
  ]
2408
2411
  }
@@ -2429,7 +2432,7 @@ function Jn() {
2429
2432
  )
2430
2433
  );
2431
2434
  }
2432
- function Yn({ data: s }) {
2435
+ function Zn({ data: s }) {
2433
2436
  var r;
2434
2437
  const [n, t] = me.useState([]), i = Object.keys(s[0]).map((l) => ({
2435
2438
  // header: key,
@@ -2443,40 +2446,40 @@ function Yn({ data: s }) {
2443
2446
  onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
2444
2447
  children: [
2445
2448
  l,
2446
- m === "asc" ? /* @__PURE__ */ e.jsx(la, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(oa, { className: "ml-2 h-5 w-5" }) : null
2449
+ m === "asc" ? /* @__PURE__ */ e.jsx(ca, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(da, { className: "ml-2 h-5 w-5" }) : null
2447
2450
  ]
2448
2451
  }
2449
2452
  ) });
2450
2453
  }
2451
- })), h = ca({
2454
+ })), h = ha({
2452
2455
  data: s,
2453
2456
  columns: i,
2454
- getCoreRowModel: xa(),
2455
- getPaginationRowModel: pa(),
2457
+ getCoreRowModel: fa(),
2458
+ getPaginationRowModel: ga(),
2456
2459
  onSortingChange: t,
2457
- getSortedRowModel: fa(),
2460
+ getSortedRowModel: ja(),
2458
2461
  manualPagination: !0,
2459
2462
  state: {
2460
2463
  sorting: n
2461
2464
  }
2462
2465
  });
2463
- return /* @__PURE__ */ e.jsxs(da, { children: [
2464
- /* @__PURE__ */ e.jsx(ha, { children: h.getHeaderGroups().map((l) => /* @__PURE__ */ e.jsx(us, { children: l.headers.map((c) => /* @__PURE__ */ e.jsx(ua, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Bs(
2466
+ return /* @__PURE__ */ e.jsxs(ua, { children: [
2467
+ /* @__PURE__ */ e.jsx(ma, { children: h.getHeaderGroups().map((l) => /* @__PURE__ */ e.jsx(us, { children: l.headers.map((c) => /* @__PURE__ */ e.jsx(xa, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Gs(
2465
2468
  c.column.columnDef.header,
2466
2469
  c.getContext()
2467
2470
  ) }, c.id)) }, l.id)) }),
2468
- /* @__PURE__ */ e.jsx(ma, { children: (r = h.getRowModel().rows) != null && r.length ? h.getRowModel().rows.map((l) => /* @__PURE__ */ e.jsx(
2471
+ /* @__PURE__ */ e.jsx(pa, { children: (r = h.getRowModel().rows) != null && r.length ? h.getRowModel().rows.map((l) => /* @__PURE__ */ e.jsx(
2469
2472
  us,
2470
2473
  {
2471
2474
  className: "whitespace-nowrap py-2",
2472
2475
  "data-state": l.getIsSelected() && "selected",
2473
- children: l.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Gs, { children: Bs(c.column.columnDef.cell, c.getContext()) }, c.id))
2476
+ children: l.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Us, { children: Gs(c.column.columnDef.cell, c.getContext()) }, c.id))
2474
2477
  },
2475
2478
  l.id
2476
- )) : /* @__PURE__ */ e.jsx(us, { children: /* @__PURE__ */ e.jsx(Gs, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2479
+ )) : /* @__PURE__ */ e.jsx(us, { children: /* @__PURE__ */ e.jsx(Us, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2477
2480
  ] });
2478
2481
  }
2479
- function wt({
2482
+ function kt({
2480
2483
  // card,
2481
2484
  // showCard,
2482
2485
  className: s,
@@ -2484,7 +2487,7 @@ function wt({
2484
2487
  }) {
2485
2488
  var j;
2486
2489
  me.useState(0);
2487
- const t = w((d) => d.themeStyle), a = o((d) => d.card), i = o((d) => d.frame), h = w((d) => d.dashboard.filters), r = w((d) => d.filterValues), l = o((d) => d.actions.setRunSql), { updateFilter: c } = js(), m = h == null ? void 0 : h.find((d) => d.id === i.filterId), u = o((d) => d.actions.setCard);
2490
+ const t = w((d) => d.themeStyle), a = o((d) => d.card), i = o((d) => d.frame), h = w((d) => d.dashboard.filters), r = w((d) => d.filterValues), l = o((d) => d.actions.setRunSql), { updateFilter: c } = bs(), m = h == null ? void 0 : h.find((d) => d.id === i.filterId), u = o((d) => d.actions.setCard);
2488
2491
  if (Y(() => {
2489
2492
  a.sql && l(!0);
2490
2493
  }, [r]), Y(() => {
@@ -2498,27 +2501,27 @@ function wt({
2498
2501
  ]), !a.id)
2499
2502
  return null;
2500
2503
  let g;
2501
- return a.data && a.data.length > 0 && (g = dt({
2504
+ return a.data && a.data.length > 0 && (g = ht({
2502
2505
  data: a.data,
2503
2506
  cardType: a.type,
2504
2507
  cfg: a.cfg,
2505
2508
  customCfg: a.customCfg,
2506
2509
  preferences: a.preferences
2507
2510
  })), /* @__PURE__ */ e.jsxs(
2508
- ga,
2511
+ ba,
2509
2512
  {
2510
2513
  role: "editor-visual-card",
2511
2514
  className: Z("relative flex h-full flex-col rounded-none", s),
2512
2515
  ...n,
2513
2516
  children: [
2514
- /* @__PURE__ */ e.jsxs(ja, { className: "flex flex-row items-start justify-between py-4", children: [
2517
+ /* @__PURE__ */ e.jsxs(ya, { className: "flex flex-row items-start justify-between py-4", children: [
2515
2518
  /* @__PURE__ */ e.jsxs("div", { children: [
2516
2519
  /* @__PURE__ */ e.jsx(
2517
2520
  Qe,
2518
2521
  {
2519
2522
  text: a.title,
2520
2523
  onSave: (d) => u({ ...a, title: d }),
2521
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ba, { className: "text-base", children: a.title }) })
2524
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(va, { className: "text-base", children: a.title }) })
2522
2525
  },
2523
2526
  a.title
2524
2527
  ),
@@ -2527,7 +2530,7 @@ function wt({
2527
2530
  {
2528
2531
  text: a.description || "",
2529
2532
  onSave: (d) => u({ ...a, description: d }),
2530
- children: /* @__PURE__ */ e.jsxs(ya, { children: [
2533
+ children: /* @__PURE__ */ e.jsxs(Na, { children: [
2531
2534
  " ",
2532
2535
  a.description
2533
2536
  ] })
@@ -2542,100 +2545,100 @@ function wt({
2542
2545
  className: "my-1",
2543
2546
  text: m.title || m.column,
2544
2547
  onSave: (d) => c({ ...m, title: d }),
2545
- children: /* @__PURE__ */ e.jsx(H, { children: m.title })
2548
+ children: /* @__PURE__ */ e.jsx($, { children: m.title })
2546
2549
  }
2547
2550
  ),
2548
- va(m)
2551
+ Ca(m)
2549
2552
  ] })
2550
2553
  ] }),
2551
- /* @__PURE__ */ e.jsxs(Na, { className: "flex grow flex-col pb-3", children: [
2554
+ /* @__PURE__ */ e.jsxs(Sa, { className: "flex grow flex-col pb-3", children: [
2552
2555
  a.type !== "table" && g && // <ChartJsVisual key={visualKey} cfg={cfg} />
2553
2556
  /* @__PURE__ */ e.jsx(
2554
- Ca,
2557
+ wa,
2555
2558
  {
2556
2559
  cfg: g
2557
2560
  },
2558
2561
  JSON.stringify(g) + JSON.stringify(a.preferences) + ((j = a == null ? void 0 : a.preferences) == null ? void 0 : j.customVisualCode)
2559
2562
  ),
2560
2563
  a.type === "table" && a.data && a.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2561
- /* @__PURE__ */ e.jsx(Sa, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(wa, { card: a, data: a == null ? void 0 : a.data }) })
2564
+ /* @__PURE__ */ e.jsx(ka, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(za, { card: a, data: a == null ? void 0 : a.data }) })
2562
2565
  ] })
2563
2566
  ]
2564
2567
  }
2565
2568
  );
2566
2569
  }
2567
- function Zn() {
2568
- const [s, n] = A(!1), [t, a] = A(""), [i, h] = A(""), [r, l] = A(""), [c, m] = A(""), u = o((v) => v.card), g = o(
2569
- (v) => v.card.customCfg
2570
+ function Xn() {
2571
+ const [s, n] = T(!1), [t, a] = T(""), [i, h] = T(""), [r, l] = T(""), [c, m] = T(""), u = o((N) => N.card), g = o(
2572
+ (N) => N.card.customCfg
2570
2573
  ), { setCardCustomCfg: j, setCustomVisualCode: d } = as();
2571
- function x(v) {
2572
- var S, M;
2574
+ function x(N) {
2575
+ var _, L;
2573
2576
  const V = {
2574
- ...v,
2577
+ ...N,
2575
2578
  data: {
2576
- ...v == null ? void 0 : v.data,
2577
- datasets: (M = (S = v == null ? void 0 : v.data) == null ? void 0 : S.datasets) == null ? void 0 : M.map((N) => ({
2578
- ...N,
2579
+ ...N == null ? void 0 : N.data,
2580
+ datasets: (L = (_ = N == null ? void 0 : N.data) == null ? void 0 : _.datasets) == null ? void 0 : L.map((C) => ({
2581
+ ...C,
2579
2582
  data: []
2580
2583
  }))
2581
2584
  }
2582
2585
  };
2583
2586
  return JSON.stringify(V, null, 1);
2584
2587
  }
2585
- function y() {
2586
- var V, _;
2588
+ function v() {
2589
+ var V, q;
2587
2590
  if (!u.data || u.data.length === 0)
2588
2591
  return;
2589
- const v = dt({
2592
+ const N = ht({
2590
2593
  data: u.data,
2591
2594
  cardType: u.type,
2592
2595
  cfg: u.cfg,
2593
2596
  preferences: u.preferences
2594
2597
  });
2595
- v && (a(JSON.stringify(v, null, 1)), (V = u == null ? void 0 : u.preferences) != null && V.customVisualCode && l((_ = u == null ? void 0 : u.preferences) == null ? void 0 : _.customVisualCode), g && h(JSON.stringify(g, null, 1)));
2598
+ N && (a(JSON.stringify(N, null, 1)), (V = u == null ? void 0 : u.preferences) != null && V.customVisualCode && l((q = u == null ? void 0 : u.preferences) == null ? void 0 : q.customVisualCode), g && h(JSON.stringify(g, null, 1)));
2596
2599
  }
2597
2600
  function f() {
2598
2601
  if (r && d(r), !!i)
2599
2602
  try {
2600
- const v = JSON.parse(i);
2601
- return v ? (j(v), m(""), h(""), v) : void 0;
2602
- } catch (v) {
2603
- console.log(v), m("Invalid JSON");
2603
+ const N = JSON.parse(i);
2604
+ return N ? (j(N), m(""), h(""), N) : void 0;
2605
+ } catch (N) {
2606
+ console.log(N), m("Invalid JSON");
2604
2607
  }
2605
2608
  }
2606
- function L() {
2609
+ function F() {
2607
2610
  h(""), j(null);
2608
2611
  }
2609
- function O() {
2610
- let v;
2612
+ function M() {
2613
+ let N;
2611
2614
  if (g) {
2612
- const V = Ks.cloneDeep(u.cfg), _ = Ks.merge(V, g);
2613
- return v = x(_), v;
2615
+ const V = Ks.cloneDeep(u.cfg), q = Ks.merge(V, g);
2616
+ return N = x(q), N;
2614
2617
  }
2615
- return t ? (v = x(JSON.parse(t)), v) : "";
2618
+ return t ? (N = x(JSON.parse(t)), N) : "";
2616
2619
  }
2617
- return /* @__PURE__ */ e.jsxs(bs, { open: s, onOpenChange: n, children: [
2618
- /* @__PURE__ */ e.jsx(ys, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2620
+ return /* @__PURE__ */ e.jsxs(ys, { open: s, onOpenChange: n, children: [
2621
+ /* @__PURE__ */ e.jsx(vs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2619
2622
  z,
2620
2623
  {
2621
- onClick: y,
2624
+ onClick: v,
2622
2625
  className: ` ${g && "border-foreground/50 dark:border-foreground/70"}`,
2623
2626
  size: "sm",
2624
2627
  variant: "outline",
2625
- children: /* @__PURE__ */ e.jsx(ka, { className: "h-4 w-4" })
2628
+ children: /* @__PURE__ */ e.jsx(Fa, { className: "h-4 w-4" })
2626
2629
  }
2627
2630
  ) }),
2628
2631
  /* @__PURE__ */ e.jsxs(
2629
- Ns,
2632
+ Cs,
2630
2633
  {
2631
2634
  className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
2632
2635
  children: [
2633
- /* @__PURE__ */ e.jsxs(Cs, { className: "", children: [
2636
+ /* @__PURE__ */ e.jsxs(Ss, { className: "", children: [
2634
2637
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2635
- /* @__PURE__ */ e.jsx(Ss, { children: "Customize Card" }),
2636
- /* @__PURE__ */ e.jsxs(ks, { children: [
2637
- /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsx(
2638
- hn,
2638
+ /* @__PURE__ */ e.jsx(ws, { children: "Customize Card" }),
2639
+ /* @__PURE__ */ e.jsxs(zs, { children: [
2640
+ /* @__PURE__ */ e.jsx(at, { children: /* @__PURE__ */ e.jsx(
2641
+ un,
2639
2642
  {
2640
2643
  onClick: () => {
2641
2644
  navigator.clipboard.writeText(u.id);
@@ -2643,10 +2646,10 @@ function Zn() {
2643
2646
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
2644
2647
  }
2645
2648
  ) }),
2646
- /* @__PURE__ */ e.jsx(zs, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2649
+ /* @__PURE__ */ e.jsx(Fs, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2647
2650
  ] })
2648
2651
  ] }),
2649
- /* @__PURE__ */ e.jsxs(ws, { children: [
2652
+ /* @__PURE__ */ e.jsxs(ks, { children: [
2650
2653
  "See the configuration options and documentation",
2651
2654
  /* @__PURE__ */ e.jsx(
2652
2655
  "a",
@@ -2660,11 +2663,11 @@ function Zn() {
2660
2663
  ] })
2661
2664
  ] }),
2662
2665
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2663
- /* @__PURE__ */ e.jsx(wt, { className: "w-1/2 rounded shadow-none" }),
2664
- /* @__PURE__ */ e.jsxs(ht, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2665
- /* @__PURE__ */ e.jsxs(ut, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2666
+ /* @__PURE__ */ e.jsx(kt, { className: "w-1/2 rounded shadow-none" }),
2667
+ /* @__PURE__ */ e.jsxs(ut, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2668
+ /* @__PURE__ */ e.jsxs(mt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2666
2669
  /* @__PURE__ */ e.jsxs(Je, { value: "custom-config", children: [
2667
- g && /* @__PURE__ */ e.jsx(mt, { className: "mr-1 h-5 w-5 text-green-600" }),
2670
+ g && /* @__PURE__ */ e.jsx(xt, { className: "mr-1 h-5 w-5 text-green-600" }),
2668
2671
  g ? "Custom Config" : "Default Config"
2669
2672
  ] }),
2670
2673
  /* @__PURE__ */ e.jsx(Je, { className: "", value: "output", children: "Output" }),
@@ -2676,7 +2679,7 @@ function Zn() {
2676
2679
  className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
2677
2680
  value: "output",
2678
2681
  children: /* @__PURE__ */ e.jsx(
2679
- ct,
2682
+ dt,
2680
2683
  {
2681
2684
  disabled: !0,
2682
2685
  value: t,
@@ -2708,8 +2711,8 @@ function Zn() {
2708
2711
  renderLineHighlight: "none"
2709
2712
  },
2710
2713
  defaultLanguage: "json",
2711
- value: O(),
2712
- onChange: (v) => h(v)
2714
+ value: M(),
2715
+ onChange: (N) => h(N)
2713
2716
  }
2714
2717
  )
2715
2718
  }
@@ -2738,20 +2741,20 @@ function Zn() {
2738
2741
  },
2739
2742
  defaultLanguage: "javascript",
2740
2743
  value: r,
2741
- onChange: (v) => l(v || "")
2744
+ onChange: (N) => l(N || "")
2742
2745
  }
2743
2746
  )
2744
2747
  }
2745
2748
  )
2746
2749
  ] })
2747
2750
  ] }),
2748
- /* @__PURE__ */ e.jsxs(et, { className: "flex items-center", children: [
2749
- /* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: c }),
2751
+ /* @__PURE__ */ e.jsxs(st, { className: "flex items-center", children: [
2752
+ /* @__PURE__ */ e.jsx($, { className: "mr-2 text-red-500", children: c }),
2750
2753
  /* @__PURE__ */ e.jsx(
2751
2754
  z,
2752
2755
  {
2753
2756
  disabled: !g,
2754
- onClick: L,
2757
+ onClick: F,
2755
2758
  variant: "outline",
2756
2759
  children: "Reset"
2757
2760
  }
@@ -2764,39 +2767,39 @@ function Zn() {
2764
2767
  )
2765
2768
  ] });
2766
2769
  }
2767
- function kt(s) {
2770
+ function zt(s) {
2768
2771
  return xe({ 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);
2769
2772
  }
2770
- function zt(s) {
2773
+ function Ft(s) {
2771
2774
  return xe({ 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);
2772
2775
  }
2773
- function Ft(s) {
2776
+ function Lt(s) {
2774
2777
  return xe({ 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);
2775
2778
  }
2776
- function Lt(s) {
2779
+ function Mt(s) {
2777
2780
  return xe({ 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);
2778
2781
  }
2779
- function Mt(s) {
2782
+ function Ot(s) {
2780
2783
  return xe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
2781
2784
  }
2782
- function Ot(s) {
2785
+ function Dt(s) {
2783
2786
  return xe({ 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);
2784
2787
  }
2785
- function Dt(s) {
2788
+ function Tt(s) {
2786
2789
  return xe({ 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);
2787
2790
  }
2788
- function Tt(s) {
2791
+ function At(s) {
2789
2792
  return xe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
2790
2793
  }
2791
- function Xn() {
2792
- const [s, n] = A(!1), t = o((c) => c.card.type), { setCardType: a, setCardPreferences: i, setChartOrientation: h } = o((c) => c.actions), r = o(
2794
+ function er() {
2795
+ const [s, n] = T(!1), t = o((c) => c.card.type), { setCardType: a, setCardPreferences: i, setChartOrientation: h } = o((c) => c.actions), r = o(
2793
2796
  (c) => c.actions.setCardCustomCfg
2794
2797
  );
2795
2798
  function l(c) {
2796
2799
  r(null), i({}), a(c), n(!1);
2797
2800
  }
2798
2801
  return /* @__PURE__ */ e.jsxs(ns, { open: s, onOpenChange: n, children: [
2799
- /* @__PURE__ */ e.jsx(rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(er, { className: "h-4 w-4", chartType: t }) }) }),
2802
+ /* @__PURE__ */ e.jsx(rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(sr, { className: "h-4 w-4", chartType: t }) }) }),
2800
2803
  /* @__PURE__ */ e.jsx(is, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2801
2804
  /* @__PURE__ */ e.jsx(
2802
2805
  z,
@@ -2812,7 +2815,7 @@ function Xn() {
2812
2815
  {
2813
2816
  onClick: () => l("line"),
2814
2817
  variant: "ghost",
2815
- children: /* @__PURE__ */ e.jsx(Is, { className: "size-5" })
2818
+ children: /* @__PURE__ */ e.jsx(qs, { className: "size-5" })
2816
2819
  }
2817
2820
  ),
2818
2821
  /* @__PURE__ */ e.jsx(
@@ -2820,7 +2823,7 @@ function Xn() {
2820
2823
  {
2821
2824
  onClick: () => l("stackedBar"),
2822
2825
  variant: "ghost",
2823
- children: /* @__PURE__ */ e.jsx(Ot, { className: "size-5", strokeWidth: 0 })
2826
+ children: /* @__PURE__ */ e.jsx(Dt, { className: "size-5", strokeWidth: 0 })
2824
2827
  }
2825
2828
  ),
2826
2829
  /* @__PURE__ */ e.jsx(
@@ -2828,7 +2831,7 @@ function Xn() {
2828
2831
  {
2829
2832
  onClick: () => l("stackedLine"),
2830
2833
  variant: "ghost",
2831
- children: /* @__PURE__ */ e.jsx(Mt, { className: "size-5", strokeWidth: 0 })
2834
+ children: /* @__PURE__ */ e.jsx(Ot, { className: "size-5", strokeWidth: 0 })
2832
2835
  }
2833
2836
  ),
2834
2837
  /* @__PURE__ */ e.jsx(
@@ -2836,7 +2839,7 @@ function Xn() {
2836
2839
  {
2837
2840
  onClick: () => l("scatter"),
2838
2841
  variant: "ghost",
2839
- children: /* @__PURE__ */ e.jsx(bt, { className: "size-5" })
2842
+ children: /* @__PURE__ */ e.jsx(yt, { className: "size-5" })
2840
2843
  }
2841
2844
  ),
2842
2845
  /* @__PURE__ */ e.jsx(
@@ -2844,7 +2847,7 @@ function Xn() {
2844
2847
  {
2845
2848
  onClick: () => l("bubble"),
2846
2849
  variant: "ghost",
2847
- children: /* @__PURE__ */ e.jsx(Lt, { className: "size-4" })
2850
+ children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4" })
2848
2851
  }
2849
2852
  ),
2850
2853
  /* @__PURE__ */ e.jsx(
@@ -2852,7 +2855,7 @@ function Xn() {
2852
2855
  {
2853
2856
  onClick: () => l("pie"),
2854
2857
  variant: "ghost",
2855
- children: /* @__PURE__ */ e.jsx(jt, { className: "size-5" })
2858
+ children: /* @__PURE__ */ e.jsx(bt, { className: "size-5" })
2856
2859
  }
2857
2860
  ),
2858
2861
  /* @__PURE__ */ e.jsx(
@@ -2860,7 +2863,7 @@ function Xn() {
2860
2863
  {
2861
2864
  onClick: () => l("doughnut"),
2862
2865
  variant: "ghost",
2863
- children: /* @__PURE__ */ e.jsx(zt, { className: "size-5", strokeWidth: 1 })
2866
+ children: /* @__PURE__ */ e.jsx(Ft, { className: "size-5", strokeWidth: 1 })
2864
2867
  }
2865
2868
  ),
2866
2869
  /* @__PURE__ */ e.jsx(
@@ -2869,7 +2872,7 @@ function Xn() {
2869
2872
  onClick: () => l("radar"),
2870
2873
  variant: "ghost",
2871
2874
  children: /* @__PURE__ */ e.jsx(
2872
- kt,
2875
+ zt,
2873
2876
  {
2874
2877
  className: "size-5 font-extralight",
2875
2878
  strokeWidth: 0.5
@@ -2882,7 +2885,7 @@ function Xn() {
2882
2885
  {
2883
2886
  onClick: () => l("polarArea"),
2884
2887
  variant: "ghost",
2885
- children: /* @__PURE__ */ e.jsx(Ft, { className: "size-5" })
2888
+ children: /* @__PURE__ */ e.jsx(Lt, { className: "size-5" })
2886
2889
  }
2887
2890
  ),
2888
2891
  /* @__PURE__ */ e.jsx(
@@ -2890,7 +2893,7 @@ function Xn() {
2890
2893
  {
2891
2894
  onClick: () => l("pyramid"),
2892
2895
  variant: "ghost",
2893
- children: /* @__PURE__ */ e.jsx(Tt, { className: "size-5" })
2896
+ children: /* @__PURE__ */ e.jsx(At, { className: "size-5" })
2894
2897
  }
2895
2898
  ),
2896
2899
  /* @__PURE__ */ e.jsx(
@@ -2898,7 +2901,7 @@ function Xn() {
2898
2901
  {
2899
2902
  onClick: () => l("range"),
2900
2903
  variant: "ghost",
2901
- children: /* @__PURE__ */ e.jsx(ft, { className: "size-5" })
2904
+ children: /* @__PURE__ */ e.jsx(gt, { className: "size-5" })
2902
2905
  }
2903
2906
  ),
2904
2907
  /* @__PURE__ */ e.jsx(
@@ -2906,7 +2909,7 @@ function Xn() {
2906
2909
  {
2907
2910
  onClick: () => l("table"),
2908
2911
  variant: "ghost",
2909
- children: /* @__PURE__ */ e.jsx(Fs, { className: "size-5" })
2912
+ children: /* @__PURE__ */ e.jsx(Ls, { className: "size-5" })
2910
2913
  }
2911
2914
  ),
2912
2915
  /* @__PURE__ */ e.jsx(
@@ -2914,7 +2917,7 @@ function Xn() {
2914
2917
  {
2915
2918
  onClick: () => l("kpi"),
2916
2919
  variant: "ghost",
2917
- children: /* @__PURE__ */ e.jsx(Dt, { className: "size-6" })
2920
+ children: /* @__PURE__ */ e.jsx(Tt, { className: "size-6" })
2918
2921
  }
2919
2922
  ),
2920
2923
  /* @__PURE__ */ e.jsx(
@@ -2922,47 +2925,47 @@ function Xn() {
2922
2925
  {
2923
2926
  onClick: () => l("text"),
2924
2927
  variant: "ghost",
2925
- children: /* @__PURE__ */ e.jsx(qs, { className: "size-4" })
2928
+ children: /* @__PURE__ */ e.jsx(Vs, { className: "size-4" })
2926
2929
  }
2927
2930
  )
2928
2931
  ] }) })
2929
2932
  ] });
2930
2933
  }
2931
- function er({ chartType: s, className: n }) {
2934
+ function sr({ chartType: s, className: n }) {
2932
2935
  switch (s) {
2933
2936
  case "bar":
2934
2937
  return /* @__PURE__ */ e.jsx(Es, { className: n });
2935
2938
  case "line":
2936
- return /* @__PURE__ */ e.jsx(Is, { className: n });
2939
+ return /* @__PURE__ */ e.jsx(qs, { className: n });
2937
2940
  case "pie":
2938
- return /* @__PURE__ */ e.jsx(jt, { className: n });
2941
+ return /* @__PURE__ */ e.jsx(bt, { className: n });
2939
2942
  case "radar":
2940
- return /* @__PURE__ */ e.jsx(kt, { className: n });
2943
+ return /* @__PURE__ */ e.jsx(zt, { className: n });
2941
2944
  case "scatter":
2942
- return /* @__PURE__ */ e.jsx(bt, { className: n });
2945
+ return /* @__PURE__ */ e.jsx(yt, { className: n });
2943
2946
  case "bubble":
2944
- return /* @__PURE__ */ e.jsx(Lt, { className: n });
2947
+ return /* @__PURE__ */ e.jsx(Mt, { className: n });
2945
2948
  case "doughnut":
2946
- return /* @__PURE__ */ e.jsx(zt, { className: n });
2949
+ return /* @__PURE__ */ e.jsx(Ft, { className: n });
2947
2950
  case "stackedBar":
2948
- return /* @__PURE__ */ e.jsx(Ot, { className: "size-4 text-foreground/70" });
2951
+ return /* @__PURE__ */ e.jsx(Dt, { className: "size-4 text-foreground/70" });
2949
2952
  case "stackedLine":
2950
- return /* @__PURE__ */ e.jsx(Mt, { className: "size-4 text-foreground/70" });
2953
+ return /* @__PURE__ */ e.jsx(Ot, { className: "size-4 text-foreground/70" });
2951
2954
  case "polarArea":
2952
- return /* @__PURE__ */ e.jsx(Ft, { className: n });
2955
+ return /* @__PURE__ */ e.jsx(Lt, { className: n });
2953
2956
  case "pyramid":
2954
- return /* @__PURE__ */ e.jsx(Tt, { className: n });
2957
+ return /* @__PURE__ */ e.jsx(At, { className: n });
2955
2958
  case "range":
2956
- return /* @__PURE__ */ e.jsx(ft, { className: n });
2959
+ return /* @__PURE__ */ e.jsx(gt, { className: n });
2957
2960
  case "kpi":
2958
- return /* @__PURE__ */ e.jsx(Dt, { className: n });
2961
+ return /* @__PURE__ */ e.jsx(Tt, { className: n });
2959
2962
  case "text":
2960
- return /* @__PURE__ */ e.jsx(qs, { className: n });
2963
+ return /* @__PURE__ */ e.jsx(Vs, { className: n });
2961
2964
  default:
2962
- return /* @__PURE__ */ e.jsx(Fs, { className: n });
2965
+ return /* @__PURE__ */ e.jsx(Ls, { className: n });
2963
2966
  }
2964
2967
  }
2965
- function Zs() {
2968
+ function Xs() {
2966
2969
  const s = o((f) => f.frame), n = o((f) => f.card), t = o((f) => f.card.data), a = o((f) => f.isShowingVisual), i = o((f) => f.isSqlRunning), h = o((f) => f.queryError), r = o((f) => f.pythonStdOut), l = o((f) => f.actions.setRunSql);
2967
2970
  o((f) => f.onSave), o((f) => f.onClose), o((f) => f.actions.setCardSql), o((f) => f.actions.setCardType), o((f) => f.actions.setSqlGen);
2968
2971
  const { setFrame: c, setCard: m, updateCardInFrame: u } = as();
@@ -2984,53 +2987,53 @@ function Zs() {
2984
2987
  type: "bar",
2985
2988
  sql: "",
2986
2989
  data: []
2987
- }, L = {
2990
+ }, F = {
2988
2991
  ...s,
2989
2992
  cards: [...s.cards, f],
2990
2993
  activeCardId: f.id
2991
2994
  };
2992
- c(L), m(f);
2995
+ c(F), m(f);
2993
2996
  }
2994
2997
  function j(f) {
2995
- const L = s.cards.filter((V) => V.id !== f), O = L[0], v = {
2998
+ const F = s.cards.filter((V) => V.id !== f), M = F[0], N = {
2996
2999
  ...s,
2997
- cards: L,
3000
+ cards: F,
2998
3001
  // update the active card to the first card in the frame
2999
- activeCardId: O.id
3002
+ activeCardId: M.id
3000
3003
  };
3001
- c(v), m(O);
3004
+ c(N), m(M);
3002
3005
  }
3003
3006
  function d(f) {
3004
- const L = {
3007
+ const F = {
3005
3008
  ...s,
3006
- cards: s.cards.map((v) => v.id === n.id ? n : v),
3009
+ cards: s.cards.map((N) => N.id === n.id ? n : N),
3007
3010
  activeCardId: f
3008
3011
  };
3009
- c(L);
3010
- const O = L.cards.find((v) => v.id === f);
3011
- m(O), O.sql && (console.log("newActiveCard.sql", O.sql), O.data && O.data.length === 0 && l(!0));
3012
+ c(F);
3013
+ const M = F.cards.find((N) => N.id === f);
3014
+ m(M), M.sql && (console.log("newActiveCard.sql", M.sql), M.data && M.data.length === 0 && l(!0));
3012
3015
  }
3013
3016
  function x() {
3014
3017
  return /* @__PURE__ */ e.jsxs(
3015
- ht,
3018
+ ut,
3016
3019
  {
3017
3020
  onValueChange: d,
3018
3021
  value: s.activeCardId,
3019
3022
  className: "flex grow flex-col pb-3",
3020
3023
  children: [
3021
- s.cards.map((f) => /* @__PURE__ */ e.jsx(Ye, { className: "mt-0 grow", value: f.id, children: y() }, f.id)),
3022
- /* @__PURE__ */ e.jsx(ut, { className: "mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3024
+ s.cards.map((f) => /* @__PURE__ */ e.jsx(Ye, { className: "mt-0 grow", value: f.id, children: v() }, f.id)),
3025
+ /* @__PURE__ */ e.jsx(mt, { className: "mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3023
3026
  s.cards.map((f) => /* @__PURE__ */ e.jsx(
3024
3027
  Qe,
3025
3028
  {
3026
3029
  text: f.tabTitle || f.title,
3027
- onSave: (L) => {
3028
- m({ ...n, tabTitle: L }), u({ ...n, tabTitle: L });
3030
+ onSave: (F) => {
3031
+ m({ ...n, tabTitle: F }), u({ ...n, tabTitle: F });
3029
3032
  },
3030
3033
  children: /* @__PURE__ */ e.jsxs(Je, { className: "", value: f.id, children: [
3031
3034
  f.tabTitle || f.title,
3032
3035
  s.activeCardId === f.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3033
- xt,
3036
+ pt,
3034
3037
  {
3035
3038
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
3036
3039
  onClick: () => j(f.id)
@@ -3046,7 +3049,7 @@ function Zs() {
3046
3049
  className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
3047
3050
  variant: "outline",
3048
3051
  onClick: g,
3049
- children: /* @__PURE__ */ e.jsx(vs, { className: "h-4 w-4" })
3052
+ children: /* @__PURE__ */ e.jsx(Ns, { className: "h-4 w-4" })
3050
3053
  }
3051
3054
  )
3052
3055
  ] }) })
@@ -3054,26 +3057,26 @@ function Zs() {
3054
3057
  }
3055
3058
  );
3056
3059
  }
3057
- function y() {
3058
- return n.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(za, { isLoading: i, card: n }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Fa, { isLoading: i, card: n }) }) }) : /* @__PURE__ */ e.jsx(wt, { className: "grow border-none shadow-none" });
3060
+ function v() {
3061
+ return n.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(La, { isLoading: i, card: n }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Ma, { isLoading: i, card: n }) }) }) : /* @__PURE__ */ e.jsx(kt, { className: "grow border-none shadow-none" });
3059
3062
  }
3060
3063
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
3061
3064
  i && /* @__PURE__ */ e.jsx($e, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3062
3065
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3063
3066
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3064
- /* @__PURE__ */ e.jsx(Xn, {}),
3065
- n.type !== "table" && /* @__PURE__ */ e.jsx(Zn, {})
3067
+ /* @__PURE__ */ e.jsx(er, {}),
3068
+ n.type !== "table" && /* @__PURE__ */ e.jsx(Xn, {})
3066
3069
  ] }),
3067
- /* @__PURE__ */ e.jsx(tr, {})
3070
+ /* @__PURE__ */ e.jsx(ar, {})
3068
3071
  ] }),
3069
3072
  a ? x() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
3070
- r && /* @__PURE__ */ e.jsx(sr, {}),
3071
- n.data && n.data.length > 0 && /* @__PURE__ */ e.jsx(Yn, { data: t || [] }),
3073
+ r && /* @__PURE__ */ e.jsx(tr, {}),
3074
+ n.data && n.data.length > 0 && /* @__PURE__ */ e.jsx(Zn, { data: t || [] }),
3072
3075
  h && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: h })
3073
3076
  ] })
3074
3077
  ] });
3075
3078
  }
3076
- function sr() {
3079
+ function tr() {
3077
3080
  const s = o((t) => t.pythonStdOut);
3078
3081
  if (!s)
3079
3082
  return null;
@@ -3090,14 +3093,14 @@ function sr() {
3090
3093
  /* @__PURE__ */ e.jsx(Re, { className: "mb-2" })
3091
3094
  ] });
3092
3095
  }
3093
- function tr() {
3096
+ function ar() {
3094
3097
  const s = o((t) => t.isShowingVisual), n = o(
3095
3098
  (t) => t.actions.setIsShowingVisual
3096
3099
  );
3097
3100
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3098
- /* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
3101
+ /* @__PURE__ */ e.jsx($, { htmlFor: "visualize", children: "Chart" }),
3099
3102
  /* @__PURE__ */ e.jsx(
3100
- La,
3103
+ Oa,
3101
3104
  {
3102
3105
  checked: s,
3103
3106
  onCheckedChange: () => n(!s),
@@ -3108,7 +3111,7 @@ function tr() {
3108
3111
  ] });
3109
3112
  }
3110
3113
  function Te() {
3111
- const [s, n] = A([]);
3114
+ const [s, n] = T([]);
3112
3115
  o(
3113
3116
  (u) => u.card.cfg
3114
3117
  );
@@ -3148,8 +3151,8 @@ function Te() {
3148
3151
  (x) => x.columnIndex !== u
3149
3152
  )
3150
3153
  }), n((x) => {
3151
- const y = [...x];
3152
- return y[u] = !1, y;
3154
+ const v = [...x];
3155
+ return v[u] = !1, v;
3153
3156
  }));
3154
3157
  }
3155
3158
  function c(u, g) {
@@ -3165,12 +3168,12 @@ function Te() {
3165
3168
  }
3166
3169
  function m(u) {
3167
3170
  var g, j, d, x;
3168
- if (s != null && s[u] || (j = (g = t == null ? void 0 : t.onClickFilter) == null ? void 0 : g.find((y) => y.columnIndex === u)) != null && j.expression)
3171
+ if (s != null && s[u] || (j = (g = t == null ? void 0 : t.onClickFilter) == null ? void 0 : g.find((v) => v.columnIndex === u)) != null && j.expression)
3169
3172
  return /* @__PURE__ */ e.jsx(
3170
3173
  de,
3171
3174
  {
3172
- value: (x = (d = t == null ? void 0 : t.onClickFilter) == null ? void 0 : d.find((y) => y.columnIndex === u)) == null ? void 0 : x.expression,
3173
- onChange: (y) => c(u, y),
3175
+ value: (x = (d = t == null ? void 0 : t.onClickFilter) == null ? void 0 : d.find((v) => v.columnIndex === u)) == null ? void 0 : x.expression,
3176
+ onChange: (v) => c(u, v),
3174
3177
  type: "text",
3175
3178
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3176
3179
  placeholder: "Expression"
@@ -3178,7 +3181,7 @@ function Te() {
3178
3181
  );
3179
3182
  }
3180
3183
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3181
- /* @__PURE__ */ e.jsx(H, { children: "On Click" }),
3184
+ /* @__PURE__ */ e.jsx($, { children: "On Click" }),
3182
3185
  r == null ? void 0 : r.map((u, g) => {
3183
3186
  var j, d;
3184
3187
  return /* @__PURE__ */ e.jsx(
@@ -3206,12 +3209,12 @@ function Te() {
3206
3209
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((d = t == null ? void 0 : t.onClickFilter) == null ? void 0 : d.find(
3207
3210
  (x) => x.columnIndex === g
3208
3211
  )) && /* @__PURE__ */ e.jsx(
3209
- gt,
3212
+ jt,
3210
3213
  {
3211
3214
  onClick: () => {
3212
3215
  n((x) => {
3213
- const y = [...x];
3214
- return y[g] = !x[g], y;
3216
+ const v = [...x];
3217
+ return v[g] = !x[g], v;
3215
3218
  });
3216
3219
  },
3217
3220
  className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
@@ -3236,7 +3239,7 @@ function ls() {
3236
3239
  i(m);
3237
3240
  }
3238
3241
  return /* @__PURE__ */ e.jsxs(
3239
- Ts,
3242
+ As,
3240
3243
  {
3241
3244
  value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
3242
3245
  onValueChange: h,
@@ -3256,47 +3259,47 @@ function ls() {
3256
3259
  );
3257
3260
  }
3258
3261
  const Se = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
3259
- function Xs(s, n) {
3262
+ function et(s, n) {
3260
3263
  var a, i, h;
3261
- const t = pt(s, n);
3264
+ const t = ft(s, n);
3262
3265
  return ((h = (i = (a = s == null ? void 0 : s.chartOptions) == null ? void 0 : a.scales) == null ? void 0 : i[t]) == null ? void 0 : h.type) || "linear";
3263
3266
  }
3264
- function At() {
3265
- var re, U, ie, C, D, J;
3266
- const [s, n] = A(!1), t = o((k) => {
3267
+ function It() {
3268
+ var re, K, ie, S, O, J;
3269
+ const [s, n] = T(!1), t = o((k) => {
3267
3270
  var I;
3268
3271
  return (I = k.card) == null ? void 0 : I.preferences;
3269
3272
  }), a = o((k) => {
3270
3273
  var I;
3271
3274
  return (I = k.card) == null ? void 0 : I.cfg;
3272
- }), i = pt(t, a), [h, r] = A(
3273
- Xs(t)
3274
- ), [l, c] = A(
3275
- ((ie = (U = (re = t == null ? void 0 : t.chartOptions) == null ? void 0 : re.scales) == null ? void 0 : U[i]) == null ? void 0 : ie.min) || ""
3276
- ), [m, u] = A(
3277
- ((J = (D = (C = t == null ? void 0 : t.chartOptions) == null ? void 0 : C.scales) == null ? void 0 : D[i]) == null ? void 0 : J.max) || ""
3278
- ), [g, j] = A(l || m ? "custom" : "auto"), [d, x] = A(""), [y, f] = A(0), [L, O] = A(""), [v, V] = A(""), [_, S] = A(""), M = o(
3275
+ }), i = ft(t, a), [h, r] = T(
3276
+ et(t)
3277
+ ), [l, c] = T(
3278
+ ((ie = (K = (re = t == null ? void 0 : t.chartOptions) == null ? void 0 : re.scales) == null ? void 0 : K[i]) == null ? void 0 : ie.min) || ""
3279
+ ), [m, u] = T(
3280
+ ((J = (O = (S = t == null ? void 0 : t.chartOptions) == null ? void 0 : S.scales) == null ? void 0 : O[i]) == null ? void 0 : J.max) || ""
3281
+ ), [g, j] = T(l || m ? "custom" : "auto"), [d, x] = T(""), [v, f] = T(0), [F, M] = T(""), [N, V] = T(""), [q, _] = T(""), L = o(
3279
3282
  (k) => k.actions.setCardPreferences
3280
- ), { updateCardInFrame: N } = as(), F = o((k) => k.card), R = o((k) => {
3283
+ ), { updateCardInFrame: C } = as(), b = o((k) => k.card), R = o((k) => {
3281
3284
  var I;
3282
3285
  return (I = k.card) == null ? void 0 : I.type;
3283
- }), $ = ["pie", "doughnut", "polarArea"].includes(R);
3286
+ }), H = ["pie", "doughnut", "polarArea"].includes(R);
3284
3287
  Y(() => {
3285
- var k, I, ee, q, se, ae, be, pe, Q, le, oe, ye, ce, fe;
3286
- r(Xs(t)), c(
3288
+ var k, I, ee, E, se, ae, be, pe, Q, le, oe, ye, ce, fe;
3289
+ r(et(t)), c(
3287
3290
  ((ee = (I = (k = t == null ? void 0 : t.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : I[i]) == null ? void 0 : ee.min) === 0 ? 0 : ""
3288
- ), u(((ae = (se = (q = t == null ? void 0 : t.chartOptions) == null ? void 0 : q.scales) == null ? void 0 : se[i]) == null ? void 0 : ae.max) || ""), x(
3291
+ ), u(((ae = (se = (E = t == null ? void 0 : t.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : se[i]) == null ? void 0 : ae.max) || ""), x(
3289
3292
  ((le = (Q = (pe = (be = t == null ? void 0 : t.chartOptions) == null ? void 0 : be.scales) == null ? void 0 : pe[i]) == null ? void 0 : Q.ticks) == null ? void 0 : le.stepSize) || ""
3290
- ), f(((oe = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : oe.decimalPlaces) || 0), O(((ye = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ye.suffix) || ""), V(((ce = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ce.currency) || ""), S(((fe = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : fe.locale) || "");
3293
+ ), f(((oe = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : oe.decimalPlaces) || 0), M(((ye = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ye.suffix) || ""), V(((ce = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ce.currency) || ""), _(((fe = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : fe.locale) || "");
3291
3294
  }, [s, t, i]);
3292
- function E(k, I) {
3295
+ function A(k, I) {
3293
3296
  return I === "" || /^[0-9\b]+$/.test(I) ? Number(I) : Number(k);
3294
3297
  }
3295
3298
  function P() {
3296
3299
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3297
3300
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
3298
3301
  /* @__PURE__ */ e.jsx(
3299
- H,
3302
+ $,
3300
3303
  {
3301
3304
  className: "col-span-2 hover:cursor-pointer hover:underline",
3302
3305
  htmlFor: "currency",
@@ -3313,7 +3316,7 @@ function At() {
3313
3316
  /* @__PURE__ */ e.jsx(
3314
3317
  de,
3315
3318
  {
3316
- value: v,
3319
+ value: N,
3317
3320
  placeholder: "USD",
3318
3321
  onChange: (k) => V(k.target.value),
3319
3322
  id: "currency",
@@ -3323,20 +3326,20 @@ function At() {
3323
3326
  /* @__PURE__ */ e.jsx(
3324
3327
  de,
3325
3328
  {
3326
- value: _,
3329
+ value: q,
3327
3330
  placeholder: "en-US",
3328
- onChange: (k) => S(k.target.value),
3331
+ onChange: (k) => _(k.target.value),
3329
3332
  id: "locale",
3330
3333
  className: `col-span-2 h-8 w-full ${Se}`
3331
3334
  }
3332
3335
  )
3333
3336
  ] }),
3334
3337
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
3335
- /* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
3338
+ /* @__PURE__ */ e.jsx($, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
3336
3339
  /* @__PURE__ */ e.jsx(
3337
3340
  de,
3338
3341
  {
3339
- value: y,
3342
+ value: v,
3340
3343
  onChange: (k) => f(Number(k.target.value)),
3341
3344
  id: "format",
3342
3345
  className: `col-span-6 h-8 w-full tracking-wide ${Se}`
@@ -3348,13 +3351,13 @@ function At() {
3348
3351
  function X() {
3349
3352
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3350
3353
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3351
- /* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
3354
+ /* @__PURE__ */ e.jsx($, { htmlFor: "range", children: "Range" }),
3352
3355
  /* @__PURE__ */ e.jsx(
3353
3356
  de,
3354
3357
  {
3355
3358
  id: "min",
3356
3359
  value: l,
3357
- onChange: (k) => c((I) => E(I, k.target.value)),
3360
+ onChange: (k) => c((I) => A(I, k.target.value)),
3358
3361
  className: `col-span-1 h-8 w-full ${Se}`
3359
3362
  }
3360
3363
  ),
@@ -3362,19 +3365,19 @@ function At() {
3362
3365
  de,
3363
3366
  {
3364
3367
  value: m,
3365
- onChange: (k) => u((I) => E(I, k.target.value)),
3368
+ onChange: (k) => u((I) => A(I, k.target.value)),
3366
3369
  id: "max",
3367
3370
  className: `col-span-1 h-8 w-full ${Se}`
3368
3371
  }
3369
3372
  )
3370
3373
  ] }),
3371
3374
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3372
- /* @__PURE__ */ e.jsx(H, { htmlFor: "step-size", children: "Step Size" }),
3375
+ /* @__PURE__ */ e.jsx($, { htmlFor: "step-size", children: "Step Size" }),
3373
3376
  /* @__PURE__ */ e.jsx(
3374
3377
  de,
3375
3378
  {
3376
3379
  value: d,
3377
- onChange: (k) => x((I) => E(I, k.target.value)),
3380
+ onChange: (k) => x((I) => A(I, k.target.value)),
3378
3381
  id: "step-size",
3379
3382
  className: `col-span-1 h-8 w-full ${Se}`
3380
3383
  }
@@ -3383,7 +3386,7 @@ function At() {
3383
3386
  ] });
3384
3387
  }
3385
3388
  function W() {
3386
- var q;
3389
+ var E;
3387
3390
  let k = {};
3388
3391
  g === "custom" && (k = {
3389
3392
  min: l,
@@ -3397,7 +3400,7 @@ function At() {
3397
3400
  chartOptions: {
3398
3401
  ...t == null ? void 0 : t.chartOptions,
3399
3402
  scales: {
3400
- ...(q = t == null ? void 0 : t.chartOptions) == null ? void 0 : q.scales,
3403
+ ...(E = t == null ? void 0 : t.chartOptions) == null ? void 0 : E.scales,
3401
3404
  [i]: {
3402
3405
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3403
3406
  type: h,
@@ -3406,21 +3409,21 @@ function At() {
3406
3409
  }
3407
3410
  },
3408
3411
  numberAxisFormat: {
3409
- decimalPlaces: y,
3410
- suffix: L,
3411
- currency: v,
3412
- locale: _
3412
+ decimalPlaces: v,
3413
+ suffix: F,
3414
+ currency: N,
3415
+ locale: q
3413
3416
  }
3414
3417
  };
3415
- console.log(I), M(I);
3418
+ console.log(I), L(I);
3416
3419
  const ee = {
3417
- ...F,
3420
+ ...b,
3418
3421
  preferences: I
3419
3422
  };
3420
- N(ee);
3423
+ C(ee);
3421
3424
  }
3422
3425
  return /* @__PURE__ */ e.jsxs(ns, { onOpenChange: (k) => n(k), children: [
3423
- /* @__PURE__ */ e.jsx(rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ma, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3426
+ /* @__PURE__ */ e.jsx(rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Da, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3424
3427
  /* @__PURE__ */ e.jsx(is, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3425
3428
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3426
3429
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
@@ -3428,11 +3431,11 @@ function At() {
3428
3431
  ] }),
3429
3432
  /* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
3430
3433
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3431
- /* @__PURE__ */ e.jsx(H, { htmlFor: "scale", children: "Type" }),
3434
+ /* @__PURE__ */ e.jsx($, { htmlFor: "scale", children: "Type" }),
3432
3435
  /* @__PURE__ */ e.jsxs(
3433
3436
  ke,
3434
3437
  {
3435
- disabled: $,
3438
+ disabled: H,
3436
3439
  value: h,
3437
3440
  onValueChange: (k) => r(k),
3438
3441
  children: [
@@ -3447,11 +3450,11 @@ function At() {
3447
3450
  )
3448
3451
  ] }),
3449
3452
  h == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3450
- /* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
3453
+ /* @__PURE__ */ e.jsx($, { htmlFor: "scale-option", children: "Setup" }),
3451
3454
  /* @__PURE__ */ e.jsxs(
3452
- Ts,
3455
+ As,
3453
3456
  {
3454
- disabled: $,
3457
+ disabled: H,
3455
3458
  id: "scale-option",
3456
3459
  value: g,
3457
3460
  onValueChange: (k) => j(k),
@@ -3472,7 +3475,7 @@ function At() {
3472
3475
  ] }),
3473
3476
  g === "custom" && h == "linear" && X(),
3474
3477
  P(),
3475
- /* @__PURE__ */ e.jsx(Oa, {}),
3478
+ /* @__PURE__ */ e.jsx(Ta, {}),
3476
3479
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3477
3480
  z,
3478
3481
  {
@@ -3486,7 +3489,7 @@ function At() {
3486
3489
  ] }) })
3487
3490
  ] });
3488
3491
  }
3489
- function ar({ idx: s }) {
3492
+ function nr({ idx: s }) {
3490
3493
  var l;
3491
3494
  const n = o((c) => {
3492
3495
  var m;
@@ -3500,7 +3503,7 @@ function ar({ idx: s }) {
3500
3503
  (c) => c.actions.setCardPreferences
3501
3504
  ), i = (l = n == null ? void 0 : n.chartOptions) == null ? void 0 : l.indexAxis, h = t == null ? void 0 : t.find((c) => c.idx === s);
3502
3505
  function r(c, m) {
3503
- (c === "end" || c === "start") && Da(Ta());
3506
+ (c === "end" || c === "start") && Aa(Ia());
3504
3507
  const u = {
3505
3508
  display: c !== "none",
3506
3509
  align: c,
@@ -3531,7 +3534,7 @@ function ar({ idx: s }) {
3531
3534
  }
3532
3535
  }
3533
3536
  return /* @__PURE__ */ e.jsxs(ns, { children: [
3534
- /* @__PURE__ */ e.jsx(rs, { children: /* @__PURE__ */ e.jsx(Cn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3537
+ /* @__PURE__ */ e.jsx(rs, { children: /* @__PURE__ */ e.jsx(Sn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3535
3538
  /* @__PURE__ */ e.jsx(is, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3536
3539
  /* @__PURE__ */ e.jsx(
3537
3540
  z,
@@ -3540,7 +3543,7 @@ function ar({ idx: s }) {
3540
3543
  size: "sm",
3541
3544
  variant: "secondary",
3542
3545
  className: "h-7 p-1 text-xs font-normal",
3543
- children: /* @__PURE__ */ e.jsx(xt, { className: "size-4" })
3546
+ children: /* @__PURE__ */ e.jsx(pt, { className: "size-4" })
3544
3547
  }
3545
3548
  ),
3546
3549
  /* @__PURE__ */ e.jsx(
@@ -3551,7 +3554,7 @@ function ar({ idx: s }) {
3551
3554
  variant: "secondary",
3552
3555
  className: "h-7 p-1 text-xs font-normal",
3553
3556
  children: /* @__PURE__ */ e.jsx(
3554
- un,
3557
+ mn,
3555
3558
  {
3556
3559
  className: Z("h-4 w-4", {
3557
3560
  "rotate-90": i === "y"
@@ -3568,7 +3571,7 @@ function ar({ idx: s }) {
3568
3571
  variant: "secondary",
3569
3572
  className: "h-7 p-1 text-xs font-normal",
3570
3573
  children: /* @__PURE__ */ e.jsx(
3571
- xn,
3574
+ pn,
3572
3575
  {
3573
3576
  className: Z("h-4 w-4", {
3574
3577
  "rotate-90": i === "y"
@@ -3585,7 +3588,7 @@ function ar({ idx: s }) {
3585
3588
  variant: "secondary",
3586
3589
  className: "h-7 p-1 text-xs font-normal",
3587
3590
  children: /* @__PURE__ */ e.jsx(
3588
- mn,
3591
+ xn,
3589
3592
  {
3590
3593
  className: Z("h-4 w-4", {
3591
3594
  "rotate-90": i === "y"
@@ -3610,7 +3613,7 @@ function Et() {
3610
3613
  } = xs(s.data || []);
3611
3614
  let l = h;
3612
3615
  if (["stackedBar", "stackedLine"].includes(s.type)) {
3613
- const c = Aa({
3616
+ const c = Ea({
3614
3617
  dataArray: s.data || [],
3615
3618
  groupKey: r[0],
3616
3619
  pivotKey: r[1],
@@ -3620,19 +3623,19 @@ function Et() {
3620
3623
  }
3621
3624
  return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3622
3625
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3623
- /* @__PURE__ */ e.jsx(H, { children: t }),
3626
+ /* @__PURE__ */ e.jsx($, { children: t }),
3624
3627
  /* @__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] }) }) })
3625
3628
  ] }),
3626
3629
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3627
3630
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3628
- /* @__PURE__ */ e.jsx(H, { children: a }),
3629
- /* @__PURE__ */ e.jsx(At, {})
3631
+ /* @__PURE__ */ e.jsx($, { children: a }),
3632
+ /* @__PURE__ */ e.jsx(It, {})
3630
3633
  ] }),
3631
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: l.map((c, m) => /* @__PURE__ */ e.jsx(nr, { col: c, idx: m }, c)) })
3634
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: l.map((c, m) => /* @__PURE__ */ e.jsx(rr, { col: c, idx: m }, c)) })
3632
3635
  ] })
3633
3636
  ] });
3634
3637
  }
3635
- function nr({ col: s, idx: n }) {
3638
+ function rr({ col: s, idx: n }) {
3636
3639
  const t = o((l) => {
3637
3640
  var c;
3638
3641
  return (c = l.card) == null ? void 0 : c.preferences;
@@ -3678,14 +3681,14 @@ function nr({ col: s, idx: n }) {
3678
3681
  }
3679
3682
  ),
3680
3683
  /* @__PURE__ */ e.jsx(
3681
- Is,
3684
+ qs,
3682
3685
  {
3683
3686
  onClick: () => r("line"),
3684
3687
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3685
3688
  }
3686
3689
  ),
3687
3690
  /* @__PURE__ */ e.jsx(
3688
- en,
3691
+ sn,
3689
3692
  {
3690
3693
  onClick: () => r("area"),
3691
3694
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
@@ -3698,37 +3701,37 @@ function nr({ col: s, idx: n }) {
3698
3701
  className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3699
3702
  }
3700
3703
  ),
3701
- /* @__PURE__ */ e.jsx(ar, { idx: n })
3704
+ /* @__PURE__ */ e.jsx(nr, { idx: n })
3702
3705
  ] })
3703
3706
  ] });
3704
3707
  }
3705
- function It() {
3708
+ function qt() {
3706
3709
  const s = o((j) => j.selectedConnectionId), n = o((j) => j.selectedDatamodelId), t = o((j) => j.selectedDatabaseName), a = o((j) => j.selectedSchemaName), i = o((j) => j.selectedTableName), h = w((j) => j.dashboard.filters) || [], r = w((j) => j.actions.addFilter), l = w((j) => j.actions.removeFilter), c = w(
3707
3710
  (j) => j.actions.removeFilterValue
3708
3711
  ), { modelItems: m, tableName: u } = De();
3709
3712
  function g(j, d = "dashboard") {
3710
- var S;
3711
- const x = ue(j.column_name), y = ue(t || ""), f = ue(a || ""), L = ue(u);
3712
- let O = lt(
3713
+ var _;
3714
+ const x = ue(j.column_name), v = ue(t || ""), f = ue(a || ""), F = ue(u);
3715
+ let M = ot(
3713
3716
  f,
3714
- L
3715
- ), v = `${O}.${x}`;
3716
- const V = (S = m == null ? void 0 : m.find(
3717
- (M) => M.id === n
3718
- )) == null ? void 0 : S.name;
3719
- n && n !== "none" && (v = `${ms}.${V}.${x}`, O = `${ms}.${V}`);
3720
- const _ = h == null ? void 0 : h.find(
3721
- (M) => M.column === v && M.table === L && (M.database === y || M.database === t)
3717
+ F
3718
+ ), N = `${M}.${x}`;
3719
+ const V = (_ = m == null ? void 0 : m.find(
3720
+ (L) => L.id === n
3721
+ )) == null ? void 0 : _.name;
3722
+ n && n !== "none" && (N = `${ms}.${V}.${x}`, M = `${ms}.${V}`);
3723
+ const q = h == null ? void 0 : h.find(
3724
+ (L) => L.column === N && L.table === F && (L.database === v || L.database === t)
3722
3725
  );
3723
- if (_)
3724
- c(_.id), l(_.id);
3726
+ if (q)
3727
+ c(q.id), l(q.id);
3725
3728
  else {
3726
- const M = Ze();
3729
+ const L = Ze();
3727
3730
  return u === "api" && s ? (r({
3728
3731
  location: d,
3729
- id: M,
3732
+ id: L,
3730
3733
  //uuidv4(),
3731
- column: v,
3734
+ column: N,
3732
3735
  title: j.column_name,
3733
3736
  dataType: j.data_type,
3734
3737
  table: "api",
@@ -3736,17 +3739,17 @@ function It() {
3736
3739
  // database: 'NA',
3737
3740
  connectionId: s,
3738
3741
  operation: "in",
3739
- sql: Us(
3742
+ sql: Ws(
3740
3743
  j.data_type,
3741
- O,
3744
+ M,
3742
3745
  x
3743
3746
  )
3744
3747
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
3745
- }), M) : (r({
3746
- id: M,
3748
+ }), L) : (r({
3749
+ id: L,
3747
3750
  //uuidv4(),
3748
3751
  location: d,
3749
- column: v,
3752
+ column: N,
3750
3753
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
3751
3754
  title: j.column_name,
3752
3755
  dataType: j.data_type,
@@ -3754,13 +3757,13 @@ function It() {
3754
3757
  database: t || "",
3755
3758
  connectionId: s || "",
3756
3759
  operation: "in",
3757
- sql: Us(
3760
+ sql: Ws(
3758
3761
  j.data_type,
3759
- O,
3762
+ M,
3760
3763
  x
3761
3764
  )
3762
3765
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
3763
- }), M);
3766
+ }), L);
3764
3767
  }
3765
3768
  }
3766
3769
  return { assignFilter: g };
@@ -3768,24 +3771,24 @@ function It() {
3768
3771
  function Ae() {
3769
3772
  const s = w(
3770
3773
  (l) => l.dashboard.filters
3771
- ), n = o((l) => l.frame), { setFrame: t } = as(), { columns: a } = De(), { assignFilter: i } = It();
3774
+ ), n = o((l) => l.frame), { setFrame: t } = as(), { columns: a } = De(), { assignFilter: i } = qt();
3772
3775
  function h(l) {
3773
3776
  const c = i(l, "frame");
3774
3777
  t({ ...n, filterId: c });
3775
3778
  }
3776
3779
  const r = s == null ? void 0 : s.find((l) => l.id === n.filterId);
3777
3780
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3778
- /* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
3779
- /* @__PURE__ */ e.jsx(rr, { onSelect: h, columns: a }),
3780
- r && /* @__PURE__ */ e.jsx(Ea, { filter: r })
3781
+ /* @__PURE__ */ e.jsx($, { children: "Card Filter" }),
3782
+ /* @__PURE__ */ e.jsx(ir, { onSelect: h, columns: a }),
3783
+ r && /* @__PURE__ */ e.jsx(qa, { filter: r })
3781
3784
  ] });
3782
3785
  }
3783
- function rr({
3786
+ function ir({
3784
3787
  columns: s,
3785
3788
  onSelect: n
3786
3789
  }) {
3787
3790
  var r;
3788
- const [t, a] = Qs.useState(!1), [i, h] = Qs.useState("");
3791
+ const [t, a] = Js.useState(!1), [i, h] = Js.useState("");
3789
3792
  return /* @__PURE__ */ e.jsxs(ns, { open: t, onOpenChange: a, children: [
3790
3793
  /* @__PURE__ */ e.jsx(rs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
3791
3794
  z,
@@ -3797,16 +3800,16 @@ function rr({
3797
3800
  className: "w-full justify-between font-normal",
3798
3801
  children: [
3799
3802
  i ? (r = s.find((l) => l.column_name === i)) == null ? void 0 : r.column_name : "Select Column...",
3800
- /* @__PURE__ */ e.jsx(Ia, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
3803
+ /* @__PURE__ */ e.jsx(Va, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
3801
3804
  ]
3802
3805
  }
3803
3806
  ) }),
3804
- /* @__PURE__ */ e.jsx(is, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(qa, { children: [
3805
- /* @__PURE__ */ e.jsx(Va, { placeholder: "Search column", className: "h-9" }),
3806
- /* @__PURE__ */ e.jsxs(_a, { children: [
3807
- /* @__PURE__ */ e.jsx(Ra, { children: "No framework found." }),
3808
- /* @__PURE__ */ e.jsx(Ha, { children: s.map((l) => /* @__PURE__ */ e.jsxs(
3809
- $a,
3807
+ /* @__PURE__ */ e.jsx(is, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(_a, { children: [
3808
+ /* @__PURE__ */ e.jsx(Ra, { placeholder: "Search column", className: "h-9" }),
3809
+ /* @__PURE__ */ e.jsxs(Ha, { children: [
3810
+ /* @__PURE__ */ e.jsx($a, { children: "No framework found." }),
3811
+ /* @__PURE__ */ e.jsx(Pa, { children: s.map((l) => /* @__PURE__ */ e.jsxs(
3812
+ Ba,
3810
3813
  {
3811
3814
  value: l.column_name,
3812
3815
  onSelect: (c) => {
@@ -3816,7 +3819,7 @@ function rr({
3816
3819
  children: [
3817
3820
  l.column_name,
3818
3821
  /* @__PURE__ */ e.jsx(
3819
- mt,
3822
+ xt,
3820
3823
  {
3821
3824
  className: Z(
3822
3825
  "ml-auto h-4 w-4",
@@ -3832,13 +3835,13 @@ function rr({
3832
3835
  ] }) })
3833
3836
  ] });
3834
3837
  }
3835
- function ir({
3838
+ function lr({
3836
3839
  cardType: s
3837
3840
  }) {
3838
3841
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ne, { defaultValue: ["item-2"], type: "multiple", children: [
3839
3842
  /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
3840
- /* @__PURE__ */ e.jsx(G, { children: `${As(s)} Chart` }),
3841
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 font-mono text-xs", children: [
3843
+ /* @__PURE__ */ e.jsx(G, { children: `${Is(s)} Chart` }),
3844
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 font-mono text-xs", children: [
3842
3845
  /* @__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" }),
3843
3846
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3844
3847
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -3863,21 +3866,21 @@ function ir({
3863
3866
  ] }),
3864
3867
  /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
3865
3868
  /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
3866
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
3869
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 px-2", children: [
3867
3870
  /* @__PURE__ */ e.jsx(ls, {}),
3868
3871
  /* @__PURE__ */ e.jsx(Et, {})
3869
3872
  ] })
3870
3873
  ] }),
3871
3874
  /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
3872
3875
  /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
3873
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
3876
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 px-2", children: [
3874
3877
  /* @__PURE__ */ e.jsx(Te, {}),
3875
3878
  /* @__PURE__ */ e.jsx(Ae, {})
3876
3879
  ] })
3877
3880
  ] })
3878
3881
  ] }) });
3879
3882
  }
3880
- function Vs() {
3883
+ function _s() {
3881
3884
  var i, h, r;
3882
3885
  const s = o(
3883
3886
  (l) => l.card.cfg
@@ -3906,7 +3909,7 @@ function Vs() {
3906
3909
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3907
3910
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3908
3911
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3909
- !["pyramid"].includes(t) && /* @__PURE__ */ e.jsx(At, {})
3912
+ !["pyramid"].includes(t) && /* @__PURE__ */ e.jsx(It, {})
3910
3913
  ] }),
3911
3914
  /* @__PURE__ */ e.jsxs(
3912
3915
  ke,
@@ -3928,7 +3931,7 @@ function Vs() {
3928
3931
  )
3929
3932
  ] });
3930
3933
  }
3931
- function lr({
3934
+ function or({
3932
3935
  cardType: s
3933
3936
  }) {
3934
3937
  function n(t) {
@@ -3960,23 +3963,23 @@ function lr({
3960
3963
  }
3961
3964
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ne, { defaultValue: ["item-2"], type: "multiple", children: [
3962
3965
  /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
3963
- /* @__PURE__ */ e.jsx(G, { children: `${As(s)} Chart` }),
3964
- /* @__PURE__ */ e.jsx(K, { className: "space-y-4 font-mono text-xs", children: n(s) })
3966
+ /* @__PURE__ */ e.jsx(G, { children: `${Is(s)} Chart` }),
3967
+ /* @__PURE__ */ e.jsx(U, { className: "space-y-4 font-mono text-xs", children: n(s) })
3965
3968
  ] }),
3966
3969
  /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
3967
3970
  /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
3968
- /* @__PURE__ */ e.jsx(K, { className: "px-2", children: /* @__PURE__ */ e.jsx(Vs, {}) })
3971
+ /* @__PURE__ */ e.jsx(U, { className: "px-2", children: /* @__PURE__ */ e.jsx(_s, {}) })
3969
3972
  ] }),
3970
3973
  /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
3971
3974
  /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
3972
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
3975
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 px-2", children: [
3973
3976
  /* @__PURE__ */ e.jsx(Te, {}),
3974
3977
  /* @__PURE__ */ e.jsx(Ae, {})
3975
3978
  ] })
3976
3979
  ] })
3977
3980
  ] }) });
3978
3981
  }
3979
- const or = {
3982
+ const cr = {
3980
3983
  datasets: [
3981
3984
  {
3982
3985
  type: "line",
@@ -3989,7 +3992,7 @@ const or = {
3989
3992
  data: []
3990
3993
  }
3991
3994
  ]
3992
- }, cr = {
3995
+ }, dr = {
3993
3996
  datasets: [
3994
3997
  {
3995
3998
  fill: "origin",
@@ -3999,7 +4002,7 @@ const or = {
3999
4002
  }
4000
4003
  ]
4001
4004
  };
4002
- function dr() {
4005
+ function hr() {
4003
4006
  const s = o((n) => n.card.type);
4004
4007
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4005
4008
  /* @__PURE__ */ e.jsx(
@@ -4008,23 +4011,23 @@ function dr() {
4008
4011
  className: " ",
4009
4012
  type: "single",
4010
4013
  collapsible: !0,
4011
- children: hr(s)
4014
+ children: ur(s)
4012
4015
  }
4013
4016
  ),
4014
4017
  /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(ls, {}) }),
4015
4018
  !["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4016
- /* @__PURE__ */ e.jsx(Vs, {}),
4019
+ /* @__PURE__ */ e.jsx(_s, {}),
4017
4020
  /* @__PURE__ */ e.jsx(Te, {}),
4018
4021
  /* @__PURE__ */ e.jsx(Ae, {})
4019
4022
  ] })
4020
4023
  ] });
4021
4024
  }
4022
- function hr(s) {
4025
+ function ur(s) {
4023
4026
  if (["line", "bar"].includes(s))
4024
4027
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4025
4028
  /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4026
4029
  /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
4027
- /* @__PURE__ */ e.jsxs(K, { className: " ", children: [
4030
+ /* @__PURE__ */ e.jsxs(U, { className: " ", children: [
4028
4031
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
4029
4032
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
4030
4033
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
@@ -4034,18 +4037,18 @@ function hr(s) {
4034
4037
  ] }),
4035
4038
  /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
4036
4039
  /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: "Mixed Chart" }),
4037
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-2 text-xs", children: [
4040
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-2 text-xs", children: [
4038
4041
  /* @__PURE__ */ e.jsxs("p", { children: [
4039
4042
  "Click ",
4040
4043
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
4041
4044
  " and change the `type` property in the dataset."
4042
4045
  ] }),
4043
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(or, null, 2) })
4046
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(cr, null, 2) })
4044
4047
  ] })
4045
4048
  ] }),
4046
4049
  /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4047
4050
  /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: "Area Chart" }),
4048
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-2 text-xs", children: [
4051
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-2 text-xs", children: [
4049
4052
  /* @__PURE__ */ e.jsxs("p", { children: [
4050
4053
  "Click ",
4051
4054
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
@@ -4061,7 +4064,7 @@ function hr(s) {
4061
4064
  ),
4062
4065
  "for more options."
4063
4066
  ] }),
4064
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(cr, null, 2) })
4067
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(dr, null, 2) })
4065
4068
  ] })
4066
4069
  ] })
4067
4070
  ] });
@@ -4072,7 +4075,7 @@ function hr(s) {
4072
4075
  /* @__PURE__ */ e.jsx("span", { children: s }),
4073
4076
  " chart query?"
4074
4077
  ] }) }),
4075
- /* @__PURE__ */ e.jsxs(K, { className: " ", children: [
4078
+ /* @__PURE__ */ e.jsxs(U, { className: " ", children: [
4076
4079
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
4077
4080
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
4078
4081
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -4090,7 +4093,7 @@ function hr(s) {
4090
4093
  /* @__PURE__ */ e.jsx("span", { children: s }),
4091
4094
  " chart query?"
4092
4095
  ] }) }),
4093
- /* @__PURE__ */ e.jsxs(K, { className: " ", children: [
4096
+ /* @__PURE__ */ e.jsxs(U, { className: " ", children: [
4094
4097
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis FROM table" }),
4095
4098
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
4096
4099
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -4107,7 +4110,7 @@ function hr(s) {
4107
4110
  " ",
4108
4111
  "chart query"
4109
4112
  ] }) }),
4110
- /* @__PURE__ */ e.jsxs(K, { className: " ", children: [
4113
+ /* @__PURE__ */ e.jsxs(U, { className: " ", children: [
4111
4114
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
4112
4115
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
4113
4116
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -4116,7 +4119,7 @@ function hr(s) {
4116
4119
  ] })
4117
4120
  ] }) });
4118
4121
  }
4119
- function ur() {
4122
+ function mr() {
4120
4123
  var c, m, u, g, j;
4121
4124
  const s = o((d) => d.card.preferences), n = o(
4122
4125
  (d) => d.actions.setCardPreferences
@@ -4125,19 +4128,19 @@ function ur() {
4125
4128
  );
4126
4129
  o(
4127
4130
  (d) => {
4128
- var x, y;
4129
- return (y = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : y.decimalPlaces;
4131
+ var x, v;
4132
+ return (v = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : v.decimalPlaces;
4130
4133
  }
4131
4134
  );
4132
4135
  const a = o(
4133
4136
  (d) => {
4134
- var x, y;
4135
- return (y = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : y.locale;
4137
+ var x, v;
4138
+ return (v = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : v.locale;
4136
4139
  }
4137
4140
  ), i = o(
4138
4141
  (d) => {
4139
- var x, y;
4140
- return (y = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : y.currency;
4142
+ var x, v;
4143
+ return (v = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : v.currency;
4141
4144
  }
4142
4145
  );
4143
4146
  o(
@@ -4145,12 +4148,12 @@ function ur() {
4145
4148
  );
4146
4149
  const h = o(
4147
4150
  (d) => {
4148
- var x, y;
4149
- return (y = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : y.colorRanges;
4151
+ var x, v;
4152
+ return (v = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : v.colorRanges;
4150
4153
  }
4151
4154
  ) || [], r = o(
4152
4155
  (d) => d.actions.setColorRanges
4153
- ), l = [...new Set(Ws.map((d) => d.currency))];
4156
+ ), l = [...new Set(Qs.map((d) => d.currency))];
4154
4157
  return /* @__PURE__ */ e.jsxs("div", { children: [
4155
4158
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
4156
4159
  /* @__PURE__ */ e.jsx(
@@ -4168,22 +4171,22 @@ function ur() {
4168
4171
  }
4169
4172
  }
4170
4173
  ),
4171
- /* @__PURE__ */ e.jsx(H, { children: "Format Number" })
4174
+ /* @__PURE__ */ e.jsx($, { children: "Format Number" })
4172
4175
  ] }),
4173
4176
  ((m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4174
4177
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
4175
4178
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4176
4179
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4177
- /* @__PURE__ */ e.jsx(H, { children: "Locale" }),
4180
+ /* @__PURE__ */ e.jsx($, { children: "Locale" }),
4178
4181
  /* @__PURE__ */ e.jsxs(
4179
4182
  ke,
4180
4183
  {
4181
4184
  value: a || "en-US",
4182
4185
  onValueChange: (d) => {
4183
- var x, y, f;
4186
+ var x, v, f;
4184
4187
  return t(
4185
4188
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
4186
- ((y = s == null ? void 0 : s.formatNumber) == null ? void 0 : y.currency) || "",
4189
+ ((v = s == null ? void 0 : s.formatNumber) == null ? void 0 : v.currency) || "",
4187
4190
  d || "en-US",
4188
4191
  ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.suffix) || ""
4189
4192
  );
@@ -4192,24 +4195,24 @@ function ur() {
4192
4195
  /* @__PURE__ */ e.jsx(ze, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Fe, {}) }),
4193
4196
  /* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
4194
4197
  /* @__PURE__ */ e.jsx(Me, { children: "Format" }),
4195
- Ws.map((d) => /* @__PURE__ */ e.jsx(te, { value: d.locale, children: d.locale }, d.locale))
4198
+ Qs.map((d) => /* @__PURE__ */ e.jsx(te, { value: d.locale, children: d.locale }, d.locale))
4196
4199
  ] }) })
4197
4200
  ]
4198
4201
  }
4199
4202
  )
4200
4203
  ] }),
4201
4204
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4202
- /* @__PURE__ */ e.jsx(H, { children: "Currency" }),
4205
+ /* @__PURE__ */ e.jsx($, { children: "Currency" }),
4203
4206
  /* @__PURE__ */ e.jsxs(
4204
4207
  ke,
4205
4208
  {
4206
4209
  value: i || "none",
4207
4210
  onValueChange: (d) => {
4208
- var x, y, f;
4211
+ var x, v, f;
4209
4212
  return t(
4210
4213
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
4211
4214
  d === "none" ? "" : d,
4212
- ((y = s == null ? void 0 : s.formatNumber) == null ? void 0 : y.locale) || "",
4215
+ ((v = s == null ? void 0 : s.formatNumber) == null ? void 0 : v.locale) || "",
4213
4216
  ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.suffix) || ""
4214
4217
  );
4215
4218
  },
@@ -4227,17 +4230,17 @@ function ur() {
4227
4230
  ] }),
4228
4231
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
4229
4232
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4230
- /* @__PURE__ */ e.jsx(H, { children: "Decimals" }),
4233
+ /* @__PURE__ */ e.jsx($, { children: "Decimals" }),
4231
4234
  /* @__PURE__ */ e.jsxs(
4232
4235
  ke,
4233
4236
  {
4234
4237
  value: ((g = (u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) == null ? void 0 : g.toString()) || "0",
4235
4238
  onValueChange: (d) => {
4236
- var x, y, f;
4239
+ var x, v, f;
4237
4240
  return t(
4238
4241
  Number(d),
4239
4242
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.currency) || "",
4240
- ((y = s == null ? void 0 : s.formatNumber) == null ? void 0 : y.locale) || "",
4243
+ ((v = s == null ? void 0 : s.formatNumber) == null ? void 0 : v.locale) || "",
4241
4244
  ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.suffix) || ""
4242
4245
  );
4243
4246
  },
@@ -4249,7 +4252,7 @@ function ur() {
4249
4252
  )
4250
4253
  ] }),
4251
4254
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4252
- /* @__PURE__ */ e.jsx(H, { children: "Suffix" }),
4255
+ /* @__PURE__ */ e.jsx($, { children: "Suffix" }),
4253
4256
  /* @__PURE__ */ e.jsx(
4254
4257
  de,
4255
4258
  {
@@ -4257,10 +4260,10 @@ function ur() {
4257
4260
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
4258
4261
  placeholder: "K, M, B, %",
4259
4262
  onChange: (d) => {
4260
- var x, y, f;
4263
+ var x, v, f;
4261
4264
  return t(
4262
4265
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
4263
- ((y = s == null ? void 0 : s.formatNumber) == null ? void 0 : y.currency) || "",
4266
+ ((v = s == null ? void 0 : s.formatNumber) == null ? void 0 : v.currency) || "",
4264
4267
  ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
4265
4268
  d.target.value
4266
4269
  );
@@ -4272,7 +4275,7 @@ function ur() {
4272
4275
  ] }) }),
4273
4276
  /* @__PURE__ */ e.jsx(Re, { className: "my-3" }),
4274
4277
  /* @__PURE__ */ e.jsx(
4275
- Pa,
4278
+ Ga,
4276
4279
  {
4277
4280
  colorRanges: h,
4278
4281
  setColorRanges: r
@@ -4281,11 +4284,11 @@ function ur() {
4281
4284
  ] })
4282
4285
  ] });
4283
4286
  }
4284
- function mr() {
4287
+ function xr() {
4285
4288
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4286
4289
  /* @__PURE__ */ e.jsx(Ne, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4287
4290
  /* @__PURE__ */ e.jsx(G, { className: "", children: "KPI Query" }),
4288
- /* @__PURE__ */ e.jsxs(K, { className: "font-mono", children: [
4291
+ /* @__PURE__ */ e.jsxs(U, { className: "font-mono", children: [
4289
4292
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
4290
4293
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
4291
4294
  /* @__PURE__ */ e.jsx("li", { children: "current - number" }),
@@ -4307,12 +4310,12 @@ function mr() {
4307
4310
  ] })
4308
4311
  ] })
4309
4312
  ] }) }),
4310
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(ur, {}) }),
4313
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(mr, {}) }),
4311
4314
  /* @__PURE__ */ e.jsx("div", {}),
4312
4315
  /* @__PURE__ */ e.jsx("div", {})
4313
4316
  ] });
4314
4317
  }
4315
- function xr() {
4318
+ function pr() {
4316
4319
  var a;
4317
4320
  const s = o((i) => i.card.preferences), { setCardPreferences: n } = o((i) => i.actions);
4318
4321
  function t(i) {
@@ -4325,7 +4328,7 @@ function xr() {
4325
4328
  });
4326
4329
  }
4327
4330
  return /* @__PURE__ */ e.jsxs(
4328
- Ts,
4331
+ As,
4329
4332
  {
4330
4333
  value: (a = s == null ? void 0 : s.textVisualOptions) != null && a.isDynamicText ? "dynamic" : "static",
4331
4334
  onValueChange: t,
@@ -4351,8 +4354,8 @@ function We({
4351
4354
  }) {
4352
4355
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ne, { defaultValue: ["item-2"], type: "multiple", children: [
4353
4356
  /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4354
- /* @__PURE__ */ e.jsx(G, { children: `${As(s)} ${t}` }),
4355
- /* @__PURE__ */ e.jsx(K, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4357
+ /* @__PURE__ */ e.jsx(G, { children: `${Is(s)} ${t}` }),
4358
+ /* @__PURE__ */ e.jsx(U, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4356
4359
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
4357
4360
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
4358
4361
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
@@ -4376,26 +4379,26 @@ function We({
4376
4379
  ] }),
4377
4380
  /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
4378
4381
  /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
4379
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4382
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 px-2", children: [
4380
4383
  s === "range" && /* @__PURE__ */ e.jsx(ls, {}),
4381
- s !== "text" && /* @__PURE__ */ e.jsx(Vs, {}),
4382
- s === "text" && /* @__PURE__ */ e.jsx(xr, {})
4384
+ s !== "text" && /* @__PURE__ */ e.jsx(_s, {}),
4385
+ s === "text" && /* @__PURE__ */ e.jsx(pr, {})
4383
4386
  ] })
4384
4387
  ] }),
4385
4388
  !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4386
4389
  /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
4387
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4390
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 px-2", children: [
4388
4391
  /* @__PURE__ */ e.jsx(Te, {}),
4389
4392
  /* @__PURE__ */ e.jsx(Ae, {})
4390
4393
  ] })
4391
4394
  ] })
4392
4395
  ] }) });
4393
4396
  }
4394
- function pr() {
4397
+ function fr() {
4395
4398
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ne, { defaultValue: ["item-2"], type: "multiple", children: [
4396
4399
  /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4397
4400
  /* @__PURE__ */ e.jsx(G, { children: "Stacked Chart" }),
4398
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 font-mono text-xs", children: [
4401
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 font-mono text-xs", children: [
4399
4402
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
4400
4403
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
4401
4404
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -4420,21 +4423,21 @@ function pr() {
4420
4423
  ] }),
4421
4424
  /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
4422
4425
  /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
4423
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4426
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 px-2", children: [
4424
4427
  /* @__PURE__ */ e.jsx(ls, {}),
4425
4428
  /* @__PURE__ */ e.jsx(Et, {})
4426
4429
  ] })
4427
4430
  ] }),
4428
4431
  /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4429
4432
  /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
4430
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4433
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 px-2", children: [
4431
4434
  /* @__PURE__ */ e.jsx(Te, {}),
4432
4435
  /* @__PURE__ */ e.jsx(Ae, {})
4433
4436
  ] })
4434
4437
  ] })
4435
4438
  ] }) });
4436
4439
  }
4437
- function fr({}) {
4440
+ function gr({}) {
4438
4441
  const s = o((a) => {
4439
4442
  var i;
4440
4443
  return (i = a.card) == null ? void 0 : i.preferences;
@@ -4449,7 +4452,7 @@ function fr({}) {
4449
4452
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4450
4453
  /* @__PURE__ */ e.jsx(Ne, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4451
4454
  /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
4452
- /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4455
+ /* @__PURE__ */ e.jsxs(U, { className: "space-y-4 px-2", children: [
4453
4456
  /* @__PURE__ */ e.jsx(Te, {}),
4454
4457
  /* @__PURE__ */ e.jsx(Ae, {})
4455
4458
  ] })
@@ -4467,7 +4470,7 @@ function fr({}) {
4467
4470
  ] })
4468
4471
  ] });
4469
4472
  }
4470
- const gr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4473
+ const jr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4471
4474
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
4472
4475
  /* @__PURE__ */ e.jsxs("div", { children: [
4473
4476
  "See ",
@@ -4483,7 +4486,7 @@ const gr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
4483
4486
  ),
4484
4487
  " in the docs."
4485
4488
  ] })
4486
- ] }), jr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4489
+ ] }), br = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4487
4490
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
4488
4491
  /* @__PURE__ */ e.jsxs("div", { children: [
4489
4492
  "See ",
@@ -4499,7 +4502,7 @@ const gr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
4499
4502
  ),
4500
4503
  " in the docs."
4501
4504
  ] })
4502
- ] }), br = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4505
+ ] }), yr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4503
4506
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
4504
4507
  /* @__PURE__ */ e.jsxs("div", { children: [
4505
4508
  "See ",
@@ -4516,22 +4519,22 @@ const gr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
4516
4519
  " in the docs."
4517
4520
  ] })
4518
4521
  ] });
4519
- function yr() {
4522
+ function vr() {
4520
4523
  const s = o((t) => t.card.type);
4521
4524
  function n(t) {
4522
4525
  switch (t) {
4523
4526
  case "stackedBar":
4524
4527
  case "stackedLine":
4525
- return /* @__PURE__ */ e.jsx(pr, {});
4528
+ return /* @__PURE__ */ e.jsx(fr, {});
4526
4529
  case "pyramid":
4527
- return /* @__PURE__ */ e.jsx(We, { docContent: gr, cardType: t });
4530
+ return /* @__PURE__ */ e.jsx(We, { docContent: jr, cardType: t });
4528
4531
  case "kpi":
4529
- return /* @__PURE__ */ e.jsx(mr, {});
4532
+ return /* @__PURE__ */ e.jsx(xr, {});
4530
4533
  case "line":
4531
4534
  case "bar":
4532
- return /* @__PURE__ */ e.jsx(ir, { cardType: t });
4535
+ return /* @__PURE__ */ e.jsx(lr, { cardType: t });
4533
4536
  case "range":
4534
- return /* @__PURE__ */ e.jsx(We, { docContent: jr, cardType: t });
4537
+ return /* @__PURE__ */ e.jsx(We, { docContent: br, cardType: t });
4535
4538
  case "pie":
4536
4539
  case "doughnut":
4537
4540
  case "polarArea":
@@ -4539,25 +4542,25 @@ function yr() {
4539
4542
  return /* @__PURE__ */ e.jsx(We, { cardType: t });
4540
4543
  case "bubble":
4541
4544
  case "scatter":
4542
- return /* @__PURE__ */ e.jsx(lr, { cardType: t });
4545
+ return /* @__PURE__ */ e.jsx(or, { cardType: t });
4543
4546
  case "table":
4544
- return /* @__PURE__ */ e.jsx(fr, { cardType: t });
4547
+ return /* @__PURE__ */ e.jsx(gr, { cardType: t });
4545
4548
  case "text":
4546
4549
  return /* @__PURE__ */ e.jsx(
4547
4550
  We,
4548
4551
  {
4549
- docContent: br,
4552
+ docContent: yr,
4550
4553
  cardType: t,
4551
4554
  suffix: "Visual"
4552
4555
  }
4553
4556
  );
4554
4557
  default:
4555
- return /* @__PURE__ */ e.jsx(dr, {});
4558
+ return /* @__PURE__ */ e.jsx(hr, {});
4556
4559
  }
4557
4560
  }
4558
- return /* @__PURE__ */ e.jsx(Ds, { className: "h-full w-full text-sm", children: n(s) });
4561
+ return /* @__PURE__ */ e.jsx(Ts, { className: "h-full w-full text-sm", children: n(s) });
4559
4562
  }
4560
- function vr() {
4563
+ function Nr() {
4561
4564
  const s = o((n) => n.isShowingVisual);
4562
4565
  return /* @__PURE__ */ e.jsxs(
4563
4566
  ps,
@@ -4572,7 +4575,7 @@ function vr() {
4572
4575
  className: "flex",
4573
4576
  minSize: 20,
4574
4577
  defaultSize: 40,
4575
- children: /* @__PURE__ */ e.jsx(Jn, {})
4578
+ children: /* @__PURE__ */ e.jsx(Yn, {})
4576
4579
  }
4577
4580
  ),
4578
4581
  /* @__PURE__ */ e.jsx(fs, { withHandle: !0, className: "border" }),
@@ -4591,30 +4594,30 @@ function vr() {
4591
4594
  minSize: 20,
4592
4595
  defaultSize: 25,
4593
4596
  maxSize: 30,
4594
- children: /* @__PURE__ */ e.jsx(yr, {})
4597
+ children: /* @__PURE__ */ e.jsx(vr, {})
4595
4598
  }
4596
4599
  ) }),
4597
4600
  /* @__PURE__ */ e.jsx(fs, { className: "border" }),
4598
- /* @__PURE__ */ e.jsx(we, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Zs, {}) })
4599
- ] }) : /* @__PURE__ */ e.jsx(Zs, {})
4601
+ /* @__PURE__ */ e.jsx(we, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Xs, {}) })
4602
+ ] }) : /* @__PURE__ */ e.jsx(Xs, {})
4600
4603
  }
4601
4604
  )
4602
4605
  ]
4603
4606
  }
4604
4607
  );
4605
4608
  }
4606
- function Nr({ authToken: s, onSave: n, onClose: t }) {
4609
+ function Cr({ authToken: s, onSave: n, onClose: t }) {
4607
4610
  const a = o((r) => r.actions.setOnSave), i = o((r) => r.actions.setOnClose), h = w((r) => r.actions.setAuthToken);
4608
4611
  return Y(() => {
4609
4612
  n && a(n), t && i(t);
4610
4613
  }, [n, a, t, i]), Y(() => {
4611
4614
  s && s.accessToken && h(s);
4612
- }, [s, h]), /* @__PURE__ */ e.jsxs(Ba, { className: "rounded-none", role: "editor-panel", children: [
4613
- /* @__PURE__ */ e.jsx(Ga, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Nt, {}) }),
4614
- /* @__PURE__ */ e.jsx(Ka, { children: /* @__PURE__ */ e.jsx(vr, {}) })
4615
+ }, [s, h]), /* @__PURE__ */ e.jsxs(Ua, { className: "rounded-none", role: "editor-panel", children: [
4616
+ /* @__PURE__ */ e.jsx(Ka, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Ct, {}) }),
4617
+ /* @__PURE__ */ e.jsx(Wa, { children: /* @__PURE__ */ e.jsx(Nr, {}) })
4615
4618
  ] });
4616
4619
  }
4617
- function Cr() {
4620
+ function Sr() {
4618
4621
  w((r) => r.selectedCardId);
4619
4622
  const s = w((r) => r.selectedSheetId), { setIsVisualEditing: n } = w((r) => r.actions), t = w((r) => r.isVisualEditing), a = w((r) => r.actions.updateFrame);
4620
4623
  function i(r) {
@@ -4631,11 +4634,11 @@ function Cr() {
4631
4634
  block: t,
4632
4635
  hidden: !t
4633
4636
  }),
4634
- children: /* @__PURE__ */ e.jsx(Nr, { onSave: i, onClose: h })
4637
+ children: /* @__PURE__ */ e.jsx(Cr, { onSave: i, onClose: h })
4635
4638
  }
4636
4639
  );
4637
4640
  }
4638
- function Sr() {
4641
+ function wr() {
4639
4642
  o((r) => r.selectedConnectionId), o((r) => r.selectedDatamodelId);
4640
4643
  const s = o((r) => r.selectedDatabaseName);
4641
4644
  o((r) => r.selectedSchemaName);
@@ -4643,7 +4646,7 @@ function Sr() {
4643
4646
  w((r) => r.actions.addFilter), w((r) => r.actions.removeFilter), w(
4644
4647
  (r) => r.actions.removeFilterValue
4645
4648
  );
4646
- const { modelItems: a, columns: i } = De(), { assignFilter: h } = It();
4649
+ const { modelItems: a, columns: i } = De(), { assignFilter: h } = qt();
4647
4650
  return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: i == null ? void 0 : i.map((r) => {
4648
4651
  const l = t == null ? void 0 : t.find(
4649
4652
  (c) => c.column === ue(r.column_name) && c.table === n && c.database === s
@@ -4659,7 +4662,7 @@ function Sr() {
4659
4662
  }
4660
4663
  ),
4661
4664
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4662
- /* @__PURE__ */ e.jsx(vt, { column: r }),
4665
+ /* @__PURE__ */ e.jsx(Nt, { column: r }),
4663
4666
  /* @__PURE__ */ e.jsx("span", { children: r.column_name })
4664
4667
  ] })
4665
4668
  },
@@ -4667,14 +4670,14 @@ function Sr() {
4667
4670
  );
4668
4671
  }) });
4669
4672
  }
4670
- function wr() {
4673
+ function kr() {
4671
4674
  w((n) => n.showFilters);
4672
4675
  const s = w(
4673
4676
  (n) => n.actions.setShowFilters
4674
4677
  );
4675
4678
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
4676
4679
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
4677
- /* @__PURE__ */ e.jsx(H, { className: "text-lg", children: "Filters" }),
4680
+ /* @__PURE__ */ e.jsx($, { className: "text-lg", children: "Filters" }),
4678
4681
  /* @__PURE__ */ e.jsx(
4679
4682
  z,
4680
4683
  {
@@ -4686,12 +4689,12 @@ function wr() {
4686
4689
  )
4687
4690
  ] }),
4688
4691
  /* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
4689
- Nt,
4692
+ Ct,
4690
4693
  {
4691
4694
  ColumnsComponent: () => (
4692
4695
  // schemaName, tableName, columns
4693
4696
  /* @__PURE__ */ e.jsx(
4694
- Sr,
4697
+ wr,
4695
4698
  {}
4696
4699
  )
4697
4700
  )
@@ -4699,7 +4702,7 @@ function wr() {
4699
4702
  ) })
4700
4703
  ] });
4701
4704
  }
4702
- function kr() {
4705
+ function zr() {
4703
4706
  const s = w((t) => t.showFilters), n = w((t) => t.isVisualEditing);
4704
4707
  return /* @__PURE__ */ e.jsxs(
4705
4708
  "div",
@@ -4710,13 +4713,13 @@ function kr() {
4710
4713
  flex: !n
4711
4714
  }),
4712
4715
  children: [
4713
- /* @__PURE__ */ e.jsx(Ua, {}),
4714
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(wr, {}) })
4716
+ /* @__PURE__ */ e.jsx(Qa, {}),
4717
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(kr, {}) })
4715
4718
  ]
4716
4719
  }
4717
4720
  );
4718
4721
  }
4719
- function zr() {
4722
+ function Fr() {
4720
4723
  const s = w((a) => a.dashboard), n = w((a) => a.actions.setDashboard), t = w(
4721
4724
  (a) => a.showDashboardJSON
4722
4725
  );
@@ -4729,7 +4732,7 @@ function zr() {
4729
4732
  hidden: !t
4730
4733
  }),
4731
4734
  children: /* @__PURE__ */ e.jsx(
4732
- Wa,
4735
+ Ja,
4733
4736
  {
4734
4737
  onChange: (a) => {
4735
4738
  if (a)
@@ -4760,28 +4763,28 @@ function zr() {
4760
4763
  }
4761
4764
  );
4762
4765
  }
4763
- function Mr({
4766
+ function Or({
4764
4767
  showControls: s = !1,
4765
4768
  showFooter: n = !0,
4766
4769
  ...t
4767
4770
  }) {
4768
- return /* @__PURE__ */ e.jsxs(Qa, { dashboardProps: t, children: [
4769
- /* @__PURE__ */ e.jsx(Ja, {}),
4770
- /* @__PURE__ */ e.jsxs(Ya, { children: [
4771
- /* @__PURE__ */ e.jsx(zr, {}),
4772
- /* @__PURE__ */ e.jsxs(Za, { ...t, children: [
4773
- s && /* @__PURE__ */ e.jsx(Dn, {}),
4774
- /* @__PURE__ */ e.jsx(Cr, {}),
4775
- /* @__PURE__ */ e.jsx(kr, {})
4771
+ return /* @__PURE__ */ e.jsxs(Ya, { dashboardProps: t, children: [
4772
+ /* @__PURE__ */ e.jsx(Za, {}),
4773
+ /* @__PURE__ */ e.jsxs(Xa, { children: [
4774
+ /* @__PURE__ */ e.jsx(Fr, {}),
4775
+ /* @__PURE__ */ e.jsxs(en, { ...t, children: [
4776
+ s && /* @__PURE__ */ e.jsx(Tn, {}),
4777
+ /* @__PURE__ */ e.jsx(Sr, {}),
4778
+ /* @__PURE__ */ e.jsx(zr, {})
4776
4779
  ] })
4777
4780
  ] })
4778
4781
  ] });
4779
4782
  }
4780
4783
  export {
4781
- Mr as D,
4784
+ Or as D,
4782
4785
  $e as L,
4783
- Ie as S,
4784
- kn as c,
4785
- yt as g,
4786
+ Ee as S,
4787
+ zn as c,
4788
+ vt as g,
4786
4789
  De as u
4787
4790
  };