semaphor 0.0.88 → 0.0.90

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,6 +1,6 @@
1
- import { c as R, u as vs, v as M, w as is, x as Se, y as e, z as Cs, A as Ns, H as O, o as Ss, J as ws, K as ks, M as zs, N as Os, O as H, Q as ie, R as ta, V as na, W as la, Y as ra, Z as st, _ as at, $ as tt, a0 as Gs, a1 as Y, a2 as Be, i as nt, a3 as u, a4 as lt, P as ia, F as oa, a5 as Ue, a6 as Ge, a7 as Ds, a8 as ca, a9 as Ms, aa as ue, ab as he, ac as me, ad as xe, ae as ve, af as pe, ag as Z, T as Is, ah as Fs, ai as Ts, aj as Ls, ak as da, al as ua, am as ce, an as rt, ao as it, ap as ha, aq as ot, C as ct, ar as dt, as as ma, B as ut, at as fe, au as ht, av as Ke, aw as xa, ax as gs, ay as be, az as ze, aA as Ce, aB as pa, aC as mt, aD as xt, aE as pt, aF as ft, l as gt, aG as jt, aH as bt, aI as De, aJ as te, aK as fa, aL as yt, aM as os, aN as vt, aO as Ct, aP as js, a as Nt, aQ as ss, aR as ye, aS as as, aT as St, aU as wt, aV as kt, aW as zt, aX as fs, aY as Ot, aZ as Ks, a_ as Dt, a$ as Qs, b0 as Mt, b1 as It, b2 as Ft, b3 as Tt, b4 as ga, b5 as Lt, b6 as Es, b7 as ja, b8 as Et, b9 as Vt, ba as Ze, bb as At, bc as qt, bd as ba, be as Rt, s as _t, bf as Ht, bg as $t, r as Pt, bh as cs, bi as ya, bj as va, bk as Ca, bl as Xe, bm as Na, bn as es, bo as Js, bp as Bt, bq as Ut, br as ds, bs as us, bt as hs, bu as Gt, I as Kt, X as Sa, bv as Qt, bw as Jt, bx as Wt, E as Yt, by as ms, bz as Oe, f as Zt, bA as $e, bB as Vs, bC as wa, bD as Xt, bE as en, bF as ts, bG as sn, bH as an, bI as tn, bJ as Ws, bK as ka, bL as nn, bM as ln, bN as rn, bO as on, bP as cn, bQ as dn, bR as un, bS as Me, bT as Q, bU as J, bV as As, bW as W, bX as hn, bY as za, bZ as mn, b_ as xn, b$ as pn, c0 as fn, c1 as gn, c2 as jn, c3 as bn, c4 as yn, c5 as vn } from "./index-ssiDVD0o.js";
1
+ import { c as R, u as vs, v as M, w as is, x as Se, y as e, z as Cs, A as Ns, H as O, o as Ss, J as ws, K as ks, M as zs, N as Os, O as H, Q as ie, R as ta, V as na, W as la, Y as ra, Z as st, _ as at, $ as tt, a0 as Gs, a1 as Y, a2 as Be, i as nt, a3 as u, a4 as lt, a5 as rt, P as ia, F as oa, a6 as Ue, a7 as Ge, a8 as Ds, a9 as ca, aa as Ms, ab as ue, ac as he, ad as me, ae as xe, af as ve, ag as pe, ah as X, T as Is, ai as Ts, aj as Fs, ak as Ls, al as da, am as ua, an as ce, ao as it, ap as ot, aq as ha, ar as ct, C as dt, as as ut, at as ma, B as ht, au as fe, av as mt, aw as Ke, ax as xa, ay as gs, az as be, aA as ze, aB as Ce, aC as pa, aD as xt, aE as pt, aF as ft, aG as gt, l as jt, aH as bt, aI as yt, aJ as De, aK as te, aL as fa, aM as vt, aN as os, aO as Ct, aP as Nt, aQ as js, a as St, aR as ss, aS as ye, aT as as, aU as wt, aV as kt, aW as zt, aX as Ot, aY as fs, aZ as Dt, a_ as Ks, a$ as Mt, b0 as Qs, b1 as It, b2 as Tt, b3 as Ft, b4 as Lt, b5 as ga, b6 as Et, b7 as Es, b8 as ja, b9 as Vt, ba as At, bb as Xe, bc as qt, bd as Rt, be as ba, bf as _t, s as Ht, bg as $t, bh as Pt, r as Bt, bi as cs, bj as ya, bk as va, bl as Ca, bm as Ze, bn as Na, bo as es, bp as Js, bq as Ut, br as Gt, bs as ds, bt as us, bu as hs, bv as Kt, I as Qt, X as Sa, bw as Jt, bx as Wt, by as Yt, E as Xt, bz as ms, bA as Oe, f as Zt, bB as $e, bC as Vs, bD as wa, bE as en, bF as sn, bG as ts, bH as an, bI as tn, bJ as nn, bK as Ws, bL as ka, bM as ln, bN as rn, bO as on, bP as cn, bQ as dn, bR as un, bS as hn, bT as Me, bU as Q, bV as J, bW as As, bX as W, bY as mn, bZ as za, b_ as xn, b$ as pn, c0 as fn, c1 as gn, c2 as jn, c3 as bn, c4 as yn, c5 as vn, c6 as Cn } from "./index-DUkNWR9M.js";
2
2
  import * as Ys from "react";
3
- import Ne, { useState as q, useMemo as bs, useEffect as X, useRef as ns, useCallback as Oa, Suspense as Cn } from "react";
3
+ import Ne, { useState as q, useMemo as bs, useEffect as Z, useRef as ns, useCallback as Oa, Suspense as Nn } from "react";
4
4
  import "react-dom";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
@@ -8,7 +8,7 @@ import "react-dom";
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
10
10
  */
11
- const Nn = R("Box", [
11
+ const Sn = R("Box", [
12
12
  [
13
13
  "path",
14
14
  {
@@ -25,7 +25,7 @@ const Nn = R("Box", [
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
27
  */
28
- const Sn = R("Braces", [
28
+ const wn = R("Braces", [
29
29
  [
30
30
  "path",
31
31
  { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
@@ -44,7 +44,7 @@ const Sn = R("Braces", [
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
46
  */
47
- const wn = R("ChartArea", [
47
+ const kn = R("ChartArea", [
48
48
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
49
49
  [
50
50
  "path",
@@ -123,7 +123,7 @@ const Ia = R("ChartScatter", [
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
125
  */
126
- const kn = R("CircleX", [
126
+ const zn = R("CircleX", [
127
127
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
128
128
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
129
129
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -134,7 +134,7 @@ const kn = R("CircleX", [
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
136
  */
137
- const zn = R("CopyPlus", [
137
+ const On = R("CopyPlus", [
138
138
  ["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
139
139
  ["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
140
140
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
@@ -146,7 +146,7 @@ const zn = R("CopyPlus", [
146
146
  * This source code is licensed under the ISC license.
147
147
  * See the LICENSE file in the root directory of this source tree.
148
148
  */
149
- const On = R("Database", [
149
+ const Dn = R("Database", [
150
150
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
151
151
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
152
152
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -157,7 +157,7 @@ const On = R("Database", [
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
159
  */
160
- const Fa = R("EllipsisVertical", [
160
+ const Ta = R("EllipsisVertical", [
161
161
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
162
162
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
163
163
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
@@ -168,7 +168,7 @@ const Fa = R("EllipsisVertical", [
168
168
  * This source code is licensed under the ISC license.
169
169
  * See the LICENSE file in the root directory of this source tree.
170
170
  */
171
- const Dn = R("Eraser", [
171
+ const Mn = R("Eraser", [
172
172
  [
173
173
  "path",
174
174
  {
@@ -185,7 +185,7 @@ const Dn = R("Eraser", [
185
185
  * This source code is licensed under the ISC license.
186
186
  * See the LICENSE file in the root directory of this source tree.
187
187
  */
188
- const Mn = R("EyeClosed", [
188
+ const In = R("EyeClosed", [
189
189
  ["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
190
190
  ["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
191
191
  ["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
@@ -198,7 +198,7 @@ const Mn = R("EyeClosed", [
198
198
  * This source code is licensed under the ISC license.
199
199
  * See the LICENSE file in the root directory of this source tree.
200
200
  */
201
- const In = R("Glasses", [
201
+ const Tn = R("Glasses", [
202
202
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
203
203
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
204
204
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -228,7 +228,7 @@ const Fn = R("Hammer", [
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 Tn = R("Hash", [
231
+ const Ln = R("Hash", [
232
232
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
233
233
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
234
234
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -240,7 +240,7 @@ const Tn = R("Hash", [
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 Ln = R("House", [
243
+ const En = R("House", [
244
244
  ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
245
245
  [
246
246
  "path",
@@ -256,7 +256,7 @@ const Ln = R("House", [
256
256
  * This source code is licensed under the ISC license.
257
257
  * See the LICENSE file in the root directory of this source tree.
258
258
  */
259
- const En = R("Key", [
259
+ const Vn = R("Key", [
260
260
  ["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" }],
261
261
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
262
262
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -267,7 +267,7 @@ const En = R("Key", [
267
267
  * This source code is licensed under the ISC license.
268
268
  * See the LICENSE file in the root directory of this source tree.
269
269
  */
270
- const Vn = R("ListEnd", [
270
+ const An = R("ListEnd", [
271
271
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
272
272
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
273
273
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -280,7 +280,7 @@ const Vn = R("ListEnd", [
280
280
  * This source code is licensed under the ISC license.
281
281
  * See the LICENSE file in the root directory of this source tree.
282
282
  */
283
- const An = R("ListStart", [
283
+ const qn = R("ListStart", [
284
284
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
285
285
  ["path", { d: "M16 18H3", key: "12xzn7" }],
286
286
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -293,7 +293,7 @@ const An = R("ListStart", [
293
293
  * This source code is licensed under the ISC license.
294
294
  * See the LICENSE file in the root directory of this source tree.
295
295
  */
296
- const qn = R("ListX", [
296
+ const Rn = R("ListX", [
297
297
  ["path", { d: "M11 12H3", key: "51ecnj" }],
298
298
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
299
299
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -315,7 +315,7 @@ const Ae = R("LoaderCircle", [
315
315
  * This source code is licensed under the ISC license.
316
316
  * See the LICENSE file in the root directory of this source tree.
317
317
  */
318
- const Ta = R("Map", [
318
+ const Fa = R("Map", [
319
319
  [
320
320
  "path",
321
321
  {
@@ -332,7 +332,7 @@ const Ta = R("Map", [
332
332
  * This source code is licensed under the ISC license.
333
333
  * See the LICENSE file in the root directory of this source tree.
334
334
  */
335
- const Rn = R("MessageSquareMore", [
335
+ const _n = R("MessageSquareMore", [
336
336
  ["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" }],
337
337
  ["path", { d: "M8 10h.01", key: "19clt8" }],
338
338
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -344,7 +344,7 @@ const Rn = R("MessageSquareMore", [
344
344
  * This source code is licensed under the ISC license.
345
345
  * See the LICENSE file in the root directory of this source tree.
346
346
  */
347
- const _n = R("Network", [
347
+ const Hn = R("Network", [
348
348
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
349
349
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
350
350
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -357,7 +357,7 @@ const _n = R("Network", [
357
357
  * This source code is licensed under the ISC license.
358
358
  * See the LICENSE file in the root directory of this source tree.
359
359
  */
360
- const Hn = R("Play", [
360
+ const $n = R("Play", [
361
361
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
362
362
  ]);
363
363
  /**
@@ -366,7 +366,7 @@ const Hn = R("Play", [
366
366
  * This source code is licensed under the ISC license.
367
367
  * See the LICENSE file in the root directory of this source tree.
368
368
  */
369
- const $n = R("Plug2", [
369
+ const Pn = R("Plug2", [
370
370
  ["path", { d: "M9 2v6", key: "17ngun" }],
371
371
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
372
372
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -379,7 +379,7 @@ const $n = R("Plug2", [
379
379
  * This source code is licensed under the ISC license.
380
380
  * See the LICENSE file in the root directory of this source tree.
381
381
  */
382
- const Pn = R("Save", [
382
+ const Bn = R("Save", [
383
383
  [
384
384
  "path",
385
385
  {
@@ -413,7 +413,7 @@ const La = R("Shapes", [
413
413
  * This source code is licensed under the ISC license.
414
414
  * See the LICENSE file in the root directory of this source tree.
415
415
  */
416
- const Bn = R("ShieldQuestion", [
416
+ const Un = R("ShieldQuestion", [
417
417
  [
418
418
  "path",
419
419
  {
@@ -430,7 +430,7 @@ const Bn = R("ShieldQuestion", [
430
430
  * This source code is licensed under the ISC license.
431
431
  * See the LICENSE file in the root directory of this source tree.
432
432
  */
433
- const Un = R("Sigma", [
433
+ const Gn = R("Sigma", [
434
434
  [
435
435
  "path",
436
436
  {
@@ -445,7 +445,7 @@ const Un = R("Sigma", [
445
445
  * This source code is licensed under the ISC license.
446
446
  * See the LICENSE file in the root directory of this source tree.
447
447
  */
448
- const Gn = R("SwatchBook", [
448
+ const Kn = R("SwatchBook", [
449
449
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
450
450
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
451
451
  ["path", { d: "M 7 17h.01", key: "1euzgo" }],
@@ -463,7 +463,7 @@ const Gn = R("SwatchBook", [
463
463
  * This source code is licensed under the ISC license.
464
464
  * See the LICENSE file in the root directory of this source tree.
465
465
  */
466
- const Kn = R("Tag", [
466
+ const Qn = R("Tag", [
467
467
  [
468
468
  "path",
469
469
  {
@@ -479,7 +479,24 @@ const Kn = R("Tag", [
479
479
  * This source code is licensed under the ISC license.
480
480
  * See the LICENSE file in the root directory of this source tree.
481
481
  */
482
- const Qn = R("ToggleLeft", [
482
+ const Jn = R("TicketX", [
483
+ [
484
+ "path",
485
+ {
486
+ d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",
487
+ key: "qn84l0"
488
+ }
489
+ ],
490
+ ["path", { d: "m9.5 14.5 5-5", key: "qviqfa" }],
491
+ ["path", { d: "m9.5 9.5 5 5", key: "18nt4w" }]
492
+ ]);
493
+ /**
494
+ * @license lucide-react v0.453.0 - ISC
495
+ *
496
+ * This source code is licensed under the ISC license.
497
+ * See the LICENSE file in the root directory of this source tree.
498
+ */
499
+ const Wn = R("ToggleLeft", [
483
500
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
484
501
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
485
502
  ]);
@@ -500,7 +517,7 @@ const _s = R("Type", [
500
517
  * This source code is licensed under the ISC license.
501
518
  * See the LICENSE file in the root directory of this source tree.
502
519
  */
503
- const Jn = R("User", [
520
+ const Yn = R("User", [
504
521
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
505
522
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
506
523
  ]);
@@ -516,14 +533,14 @@ function Ea(s) {
516
533
  var r;
517
534
  return {
518
535
  ...l,
519
- cards: (r = l.cards) == null ? void 0 : r.map((o) => Wn(o))
536
+ cards: (r = l.cards) == null ? void 0 : r.map((o) => Xn(o))
520
537
  };
521
538
  })
522
539
  };
523
540
  })
524
541
  };
525
542
  }
526
- function Wn(s) {
543
+ function Xn(s) {
527
544
  var n, a, t, l;
528
545
  return {
529
546
  ...s,
@@ -538,12 +555,12 @@ function Wn(s) {
538
555
  }))
539
556
  }
540
557
  },
541
- customCfg: Yn(s.customCfg),
558
+ customCfg: Zn(s.customCfg),
542
559
  // if customCfg is present, clean it, otherwise return null{
543
560
  data: []
544
561
  };
545
562
  }
546
- function Yn(s) {
563
+ function Zn(s) {
547
564
  var n, a;
548
565
  return s ? {
549
566
  ...s,
@@ -557,7 +574,7 @@ function Yn(s) {
557
574
  }
558
575
  } : null;
559
576
  }
560
- async function Zn(s, n, a, t) {
577
+ async function el(s, n, a, t) {
561
578
  if (!t)
562
579
  return null;
563
580
  const l = JSON.stringify(n);
@@ -581,19 +598,19 @@ async function ys(s, n) {
581
598
  operation: "update"
582
599
  });
583
600
  }
584
- async function Xn(s, n) {
601
+ async function sl(s, n) {
585
602
  return n ? await vs("https://semaphor.cloud/api/v1/lens", n, {
586
603
  operation: "delete",
587
604
  lensId: s
588
605
  }) : null;
589
606
  }
590
- function el() {
591
- const [s, n] = q(""), [a, t] = q(!1), l = M((p) => p.lenses), { setLenses: r, setSelectedLensId: o } = is(), [i, d] = q(!1), [x, c] = q(!1), b = M((p) => p.dashboard), g = M((p) => p.filterValues), { authToken: h } = Se();
607
+ function al() {
608
+ const [s, n] = q(""), [a, t] = q(!1), l = M((p) => p.lenses), { setLenses: r, setSelectedLensId: o } = is(), [i, d] = q(!1), [m, c] = q(!1), b = M((p) => p.dashboard), g = M((p) => p.filterValues), { authToken: h } = Se();
592
609
  async function f() {
593
610
  d(!0);
594
611
  const p = Ea(
595
612
  b
596
- ), N = await Zn(
613
+ ), N = await el(
597
614
  s,
598
615
  p,
599
616
  g,
@@ -601,7 +618,7 @@ function el() {
601
618
  );
602
619
  N && (r([...l || [], N]), o(N.id), c(!1)), d(!1);
603
620
  }
604
- return /* @__PURE__ */ e.jsxs(Cs, { open: x, onOpenChange: c, children: [
621
+ return /* @__PURE__ */ e.jsxs(Cs, { open: m, onOpenChange: c, children: [
605
622
  /* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
606
623
  O,
607
624
  {
@@ -648,18 +665,18 @@ function el() {
648
665
  ] })
649
666
  ] });
650
667
  }
651
- function sl() {
668
+ function tl() {
652
669
  const [s, n] = q(!1), a = M((c) => c.lenses), t = M((c) => c.selectedLensId), { setLenses: l, setSelectedLensId: r } = is(), { authToken: o } = Se();
653
670
  async function i(c) {
654
671
  r(c);
655
672
  }
656
673
  async function d(c) {
657
- if (await Xn(c, o == null ? void 0 : o.accessToken)) {
674
+ if (await sl(c, o == null ? void 0 : o.accessToken)) {
658
675
  const g = a == null ? void 0 : a.filter((h) => h.id !== c);
659
676
  l(g || []), r("original");
660
677
  }
661
678
  }
662
- async function x(c) {
679
+ async function m(c) {
663
680
  const b = a == null ? void 0 : a.map((f) => f.id === c.id ? {
664
681
  ...f,
665
682
  isDefault: !c.isDefault
@@ -683,7 +700,7 @@ function sl() {
683
700
  }
684
701
  }
685
702
  return /* @__PURE__ */ e.jsxs(na, { open: s, onOpenChange: n, children: [
686
- /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(In, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
703
+ /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
687
704
  /* @__PURE__ */ e.jsxs(ra, { align: "end", className: "w-60", children: [
688
705
  /* @__PURE__ */ e.jsx(st, { className: "px-3", children: "Lenses" }),
689
706
  /* @__PURE__ */ e.jsx(at, {}),
@@ -703,10 +720,10 @@ function sl() {
703
720
  /* @__PURE__ */ e.jsx("p", { children: c.name }),
704
721
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
705
722
  /* @__PURE__ */ e.jsx(
706
- Ln,
723
+ En,
707
724
  {
708
725
  onClick: (b) => {
709
- b.preventDefault(), x(c);
726
+ b.preventDefault(), m(c);
710
727
  },
711
728
  className: Y(
712
729
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
@@ -739,7 +756,7 @@ function sl() {
739
756
  ] })
740
757
  ] });
741
758
  }
742
- function al({
759
+ function nl({
743
760
  iconClassName: s
744
761
  }) {
745
762
  const [n, a] = q(!1), { authToken: t } = Se(), l = M((i) => i.theme), r = M((i) => i.filterValues);
@@ -774,7 +791,7 @@ function al({
774
791
  }
775
792
  );
776
793
  }
777
- function tl() {
794
+ function ll() {
778
795
  const { authToken: s } = Se();
779
796
  M((j) => j.theme);
780
797
  const n = M((j) => j.lenses), a = M((j) => j.selectedLensId), t = n == null ? void 0 : n.find((j) => j.id === a), l = M((j) => j.dashboard);
@@ -783,7 +800,7 @@ function tl() {
783
800
  (j) => j.isDashboardEditing
784
801
  ), o = u(
785
802
  (j) => j.selectedConnectionId
786
- ), [i, d] = q(!1), x = M((j) => j.filterValues), c = M((j) => j.isVisualEditing), b = M((j) => j.showFilters);
803
+ ), [i, d] = q(!1), m = M((j) => j.filterValues), c = M((j) => j.isVisualEditing), b = M((j) => j.showFilters);
787
804
  M(
788
805
  (j) => j.showDashboardJSON
789
806
  );
@@ -791,10 +808,10 @@ function tl() {
791
808
  (j) => j.actions.setShowFilters
792
809
  ), { addFrame: f, setSelectedFrameId: p } = M(
793
810
  (j) => j.actions
794
- ), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON: V } = M((j) => j.actions), I = N(), { tenantId: z, endUserId: F } = bs(
811
+ ), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON: V } = M((j) => j.actions), I = N(), { tenantId: z, endUserId: T } = bs(
795
812
  () => lt(s == null ? void 0 : s.accessToken),
796
813
  [s == null ? void 0 : s.accessToken]
797
- ), T = bs(() => z || F, [z, F]), A = () => {
814
+ ), F = bs(() => z || T, [z, T]), A = () => {
798
815
  if (!r || !I) return;
799
816
  const j = {
800
817
  connectionId: o,
@@ -818,7 +835,7 @@ function tl() {
818
835
  activeCardId: j.id
819
836
  };
820
837
  f(I.id, D), p(D.id);
821
- }, m = () => {
838
+ }, x = () => {
822
839
  y(!0);
823
840
  };
824
841
  async function v() {
@@ -828,7 +845,7 @@ function tl() {
828
845
  ), D = JSON.stringify(j), S = {
829
846
  ...t,
830
847
  template: D,
831
- filterValues: x
848
+ filterValues: m
832
849
  };
833
850
  await ys(S, s == null ? void 0 : s.accessToken), Ge.success("Lens saved"), g == null || g(j), d(!1);
834
851
  }
@@ -840,9 +857,10 @@ function tl() {
840
857
  children: [
841
858
  !c && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: t == null ? void 0 : t.name }) }),
842
859
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
843
- /* @__PURE__ */ e.jsx(al, {}),
844
- r && !c && T && /* @__PURE__ */ e.jsx(el, {}),
845
- !c && T && /* @__PURE__ */ e.jsx(sl, {}),
860
+ /* @__PURE__ */ e.jsx("button", { onClick: rt, children: /* @__PURE__ */ e.jsx(Jn, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
861
+ /* @__PURE__ */ e.jsx(nl, {}),
862
+ r && !c && F && /* @__PURE__ */ e.jsx(al, {}),
863
+ !c && F && /* @__PURE__ */ e.jsx(tl, {}),
846
864
  r && !c && /* @__PURE__ */ e.jsxs(
847
865
  O,
848
866
  {
@@ -862,7 +880,7 @@ function tl() {
862
880
  {
863
881
  variant: "ghost",
864
882
  className: "h-7 p-2",
865
- onClick: m,
883
+ onClick: x,
866
884
  size: "sm",
867
885
  children: /* @__PURE__ */ e.jsx(ia, { className: "h-4 w-4", strokeWidth: 1.5 })
868
886
  }
@@ -880,7 +898,7 @@ function tl() {
880
898
  children: /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4", strokeWidth: 1.5 })
881
899
  }
882
900
  ),
883
- r && !c && T && /* @__PURE__ */ e.jsx(
901
+ r && !c && F && /* @__PURE__ */ e.jsx(
884
902
  O,
885
903
  {
886
904
  className: "h-7 p-2",
@@ -888,7 +906,7 @@ function tl() {
888
906
  disabled: i,
889
907
  onClick: v,
890
908
  size: "sm",
891
- children: /* @__PURE__ */ e.jsx(Pn, { className: "h-4 w-4", strokeWidth: 1.5 })
909
+ children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", strokeWidth: 1.5 })
892
910
  }
893
911
  ),
894
912
  !b && !c && r && /* @__PURE__ */ e.jsx(
@@ -918,24 +936,24 @@ function He({
918
936
  onChange: o,
919
937
  showNone: i = !1,
920
938
  className: d,
921
- showIcon: x = !0,
939
+ showIcon: m = !0,
922
940
  disabled: c = !1
923
941
  }) {
924
942
  const b = t ? "Loading..." : l ? "Error" : a;
925
943
  function g() {
926
944
  if (s === "Connection")
927
- return /* @__PURE__ */ e.jsx($n, { className: "size-4 rotate-90" });
945
+ return /* @__PURE__ */ e.jsx(Pn, { className: "size-4 rotate-90" });
928
946
  if (s === "Database")
929
- return /* @__PURE__ */ e.jsx(On, { className: "size-4" });
947
+ return /* @__PURE__ */ e.jsx(Dn, { className: "size-4" });
930
948
  if (s === "Schema")
931
- return /* @__PURE__ */ e.jsx(_n, { className: "size-4" });
949
+ return /* @__PURE__ */ e.jsx(Hn, { className: "size-4" });
932
950
  if (s === "Table")
933
951
  return /* @__PURE__ */ e.jsx(Is, { className: "size-4" });
934
952
  if (s === "Model")
935
- return /* @__PURE__ */ e.jsx(Nn, { className: "size-4" });
953
+ return /* @__PURE__ */ e.jsx(Sn, { className: "size-4" });
936
954
  }
937
955
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
938
- x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(Ds, { children: [
956
+ m && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(Ds, { children: [
939
957
  /* @__PURE__ */ e.jsx(ca, { children: g() }),
940
958
  /* @__PURE__ */ e.jsx(Ms, { className: "text-xs", align: "start", children: r })
941
959
  ] }) : g() }),
@@ -958,20 +976,20 @@ function He({
958
976
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
959
977
  t ? /* @__PURE__ */ e.jsx(pe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(pe, { children: s }),
960
978
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
961
- i && /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
962
- n && n.map((h, f) => /* @__PURE__ */ e.jsx(Z, { value: h.id, children: h.name }, f))
979
+ i && /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
980
+ n && n.map((h, f) => /* @__PURE__ */ e.jsx(X, { value: h.id, children: h.name }, f))
963
981
  ] }),
964
- (t || l) && /* @__PURE__ */ e.jsx(Z, { value: b, children: b })
982
+ (t || l) && /* @__PURE__ */ e.jsx(X, { value: b, children: b })
965
983
  ] }) })
966
984
  ] })
967
985
  ] });
968
986
  }
969
- function nl({ column: s }) {
987
+ function rl({ column: s }) {
970
988
  const [n, a] = q(!1), t = u((h) => h.selectedTableName), l = u(
971
989
  (h) => h.selectedSchemaName
972
990
  ), r = u(
973
991
  (h) => h.selectedDatamodelId
974
- ), o = u((h) => h.sqlGen), { modelItems: i } = qe(), d = u((h) => h.actions.setSqlGen), x = u((h) => h.actions.setCardSql), c = u((h) => h.actions.setRunSql);
992
+ ), o = u((h) => h.sqlGen), { modelItems: i } = qe(), d = u((h) => h.actions.setSqlGen), m = u((h) => h.actions.setCardSql), c = u((h) => h.actions.setRunSql);
975
993
  function b(h, f) {
976
994
  var V;
977
995
  const p = da(h, o, f), N = (V = i == null ? void 0 : i.find(
@@ -984,7 +1002,7 @@ function nl({ column: s }) {
984
1002
  ce(t),
985
1003
  N
986
1004
  );
987
- y && (x(y), c(!0)), a(!1);
1005
+ y && (m(y), c(!0)), a(!1);
988
1006
  }
989
1007
  function g() {
990
1008
  return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
@@ -1030,8 +1048,8 @@ function nl({ column: s }) {
1030
1048
  )
1031
1049
  ] });
1032
1050
  }
1033
- return /* @__PURE__ */ e.jsxs(Fs, { openDelay: 0, open: n, onOpenChange: a, children: [
1034
- /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1051
+ return /* @__PURE__ */ e.jsxs(Ts, { openDelay: 0, open: n, onOpenChange: a, children: [
1052
+ /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ta, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1035
1053
  /* @__PURE__ */ e.jsx(
1036
1054
  Ls,
1037
1055
  {
@@ -1044,45 +1062,45 @@ function nl({ column: s }) {
1044
1062
  }
1045
1063
  function Va({ column: s }) {
1046
1064
  return /* @__PURE__ */ e.jsxs(Ds, { children: [
1047
- /* @__PURE__ */ e.jsx(rt, { asChild: !0, children: it(s.data_type) ? /* @__PURE__ */ e.jsx(_s, { className: "size-3" }) : ha(s.data_type) ? /* @__PURE__ */ e.jsx(Tn, { className: "size-3" }) : ot(s.data_type) ? /* @__PURE__ */ e.jsx(ct, { className: "size-3" }) : dt(s.data_type) ? /* @__PURE__ */ e.jsx(Qn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(Sn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Bn, { className: "size-3" }) }),
1065
+ /* @__PURE__ */ e.jsx(it, { asChild: !0, children: ot(s.data_type) ? /* @__PURE__ */ e.jsx(_s, { className: "size-3" }) : ha(s.data_type) ? /* @__PURE__ */ e.jsx(Ln, { className: "size-3" }) : ct(s.data_type) ? /* @__PURE__ */ e.jsx(dt, { className: "size-3" }) : ut(s.data_type) ? /* @__PURE__ */ e.jsx(Wn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(wn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Un, { className: "size-3" }) }),
1048
1066
  /* @__PURE__ */ e.jsx(Ms, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1049
1067
  ] });
1050
1068
  }
1051
- function ll({
1069
+ function il({
1052
1070
  schemaName: s,
1053
1071
  tableName: n,
1054
1072
  columns: a,
1055
1073
  status: t
1056
1074
  }) {
1057
- const l = u((m) => m.sqlGen), r = u(
1058
- (m) => m.selectedConnectionId
1075
+ const l = u((x) => x.sqlGen), r = u(
1076
+ (x) => x.selectedConnectionId
1059
1077
  ), o = u(
1060
- (m) => m.selectedDatabaseName
1078
+ (x) => x.selectedDatabaseName
1061
1079
  ), i = u(
1062
- (m) => m.selectedSchemaName
1063
- ), d = u((m) => m.selectedTableName), x = u(
1064
- (m) => m.selectedDatamodelId
1080
+ (x) => x.selectedSchemaName
1081
+ ), d = u((x) => x.selectedTableName), m = u(
1082
+ (x) => x.selectedDatamodelId
1065
1083
  ), c = M(
1066
- (m) => m.dashboard.aiScopeTables
1067
- ), { setAIScopeTables: b } = M((m) => m.actions), g = u((m) => m.actions.setRunSql), h = u((m) => m.actions.setSqlGen), f = u(
1068
- (m) => m.actions.setIsShowingVisual
1069
- ), p = u((m) => m.actions.setCardSql), { connectionType: N, modelItems: y } = qe();
1070
- function V(m) {
1084
+ (x) => x.dashboard.aiScopeTables
1085
+ ), { setAIScopeTables: b } = M((x) => x.actions), g = u((x) => x.actions.setRunSql), h = u((x) => x.actions.setSqlGen), f = u(
1086
+ (x) => x.actions.setIsShowingVisual
1087
+ ), p = u((x) => x.actions.setCardSql), { connectionType: N, modelItems: y } = qe();
1088
+ function V(x) {
1071
1089
  var S;
1072
- const v = da(m, l);
1090
+ const v = da(x, l);
1073
1091
  h(v);
1074
1092
  const j = (S = y == null ? void 0 : y.find(
1075
- (_) => _.id === x
1093
+ (_) => _.id === m
1076
1094
  )) == null ? void 0 : S.name, D = ua(v, ce(s), ce(n), j);
1077
1095
  D && (p(D), g(!0));
1078
1096
  }
1079
1097
  function I() {
1080
1098
  return (c == null ? void 0 : c.find(
1081
- (m) => m.connectinonId === r && m.tableName === d
1099
+ (x) => x.connectinonId === r && x.tableName === d
1082
1100
  )) !== void 0;
1083
1101
  }
1084
- function z(m) {
1085
- if (m === !0 && d && r) {
1102
+ function z(x) {
1103
+ if (x === !0 && d && r) {
1086
1104
  const v = {
1087
1105
  connectinonId: r,
1088
1106
  connectionType: N,
@@ -1110,25 +1128,25 @@ function ll({
1110
1128
  });
1111
1129
  }
1112
1130
  }
1113
- function F() {
1131
+ function T() {
1114
1132
  var S;
1115
- let m = xa(s, n);
1133
+ let x = xa(s, n);
1116
1134
  const v = (S = y == null ? void 0 : y.find(
1117
- (_) => _.id === x
1135
+ (_) => _.id === m
1118
1136
  )) == null ? void 0 : S.name;
1119
- x && x !== "none" && (m = `${gs}.${v}`);
1120
- let j = m;
1137
+ m && m !== "none" && (x = `${gs}.${v}`);
1138
+ let j = x;
1121
1139
  return ((_) => /[A-Z]/.test(_))(n) && (j = j.split(".").map((P) => `"${P}"`).join(".")), j;
1122
1140
  }
1123
- function T() {
1124
- const m = F();
1141
+ function F() {
1142
+ const x = T();
1125
1143
  f(!1);
1126
- const v = N === "MSSQL" ? `SELECT top 10 * FROM ${m}` : `SELECT * FROM ${m} LIMIT 10`;
1144
+ const v = N === "MSSQL" ? `SELECT top 10 * FROM ${x}` : `SELECT * FROM ${x} LIMIT 10`;
1127
1145
  p(v), g(!0);
1128
1146
  }
1129
1147
  function A() {
1130
- const m = F();
1131
- p(`SELECT COUNT(*) as count FROM ${m}`), g(!0);
1148
+ const x = T();
1149
+ p(`SELECT COUNT(*) as count FROM ${x}`), g(!0);
1132
1150
  }
1133
1151
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
1134
1152
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
@@ -1141,7 +1159,7 @@ function ll({
1141
1159
  variant: "outline",
1142
1160
  className: "h-9 px-2",
1143
1161
  children: /* @__PURE__ */ e.jsx(
1144
- ut,
1162
+ ht,
1145
1163
  {
1146
1164
  className: Y("size-4", {
1147
1165
  "text-primary": I(),
@@ -1155,12 +1173,12 @@ function ll({
1155
1173
  O,
1156
1174
  {
1157
1175
  disabled: t !== "Success",
1158
- onClick: T,
1176
+ onClick: F,
1159
1177
  size: "sm",
1160
1178
  variant: "secondary",
1161
1179
  className: "flex",
1162
1180
  children: [
1163
- t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
1181
+ t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Kn, { className: "mr-2 size-4" }),
1164
1182
  "Top 10"
1165
1183
  ]
1166
1184
  }
@@ -1174,7 +1192,7 @@ function ll({
1174
1192
  variant: "secondary",
1175
1193
  className: "flex",
1176
1194
  children: [
1177
- t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Un, { className: "mr-2 size-4" }),
1195
+ t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
1178
1196
  "Count"
1179
1197
  ]
1180
1198
  }
@@ -1185,32 +1203,32 @@ function ll({
1185
1203
  {
1186
1204
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
1187
1205
  children: [
1188
- a == null ? void 0 : a.map((m) => /* @__PURE__ */ e.jsxs(
1206
+ a == null ? void 0 : a.map((x) => /* @__PURE__ */ e.jsxs(
1189
1207
  "div",
1190
1208
  {
1191
- onClick: () => V(m),
1209
+ onClick: () => V(x),
1192
1210
  className: Y(
1193
1211
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
1194
1212
  {
1195
- "bg-muted": ht(m, l)
1213
+ "bg-muted": mt(x, l)
1196
1214
  }
1197
1215
  ),
1198
1216
  children: [
1199
1217
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1200
- /* @__PURE__ */ e.jsx(Va, { column: m }),
1201
- /* @__PURE__ */ e.jsx("span", { children: m.column_name })
1218
+ /* @__PURE__ */ e.jsx(Va, { column: x }),
1219
+ /* @__PURE__ */ e.jsx("span", { children: x.column_name })
1202
1220
  ] }),
1203
1221
  /* @__PURE__ */ e.jsx(
1204
1222
  "div",
1205
1223
  {
1206
1224
  onClick: (v) => v.stopPropagation(),
1207
1225
  className: "flex items-center justify-end",
1208
- children: ha(m.data_type) && /* @__PURE__ */ e.jsx(nl, { column: m })
1226
+ children: ha(x.data_type) && /* @__PURE__ */ e.jsx(rl, { column: x })
1209
1227
  }
1210
1228
  )
1211
1229
  ]
1212
1230
  },
1213
- m.column_name
1231
+ x.column_name
1214
1232
  )),
1215
1233
  /* @__PURE__ */ e.jsx(Ke, { orientation: "vertical" }),
1216
1234
  /* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
@@ -1230,7 +1248,7 @@ function qe(s, n) {
1230
1248
  (C) => C.selectedDatabaseName
1231
1249
  ), i = u(
1232
1250
  (C) => C.selectedSchemaName
1233
- ), d = u((C) => C.selectedTableName), x = u(
1251
+ ), d = u((C) => C.selectedTableName), m = u(
1234
1252
  (C) => C.actions.setCurrentColumns
1235
1253
  ), c = u(
1236
1254
  (C) => C.actions.setSelectedConnectionId
@@ -1255,7 +1273,7 @@ function qe(s, n) {
1255
1273
  const {
1256
1274
  data: I,
1257
1275
  isLoading: z,
1258
- isError: F
1276
+ isError: T
1259
1277
  } = be({
1260
1278
  queryKey: ["connections"],
1261
1279
  queryFn: () => ze(
@@ -1265,9 +1283,9 @@ function qe(s, n) {
1265
1283
  enabled: !!(t != null && t.accessToken)
1266
1284
  // Only fetch if authToken is present
1267
1285
  }), {
1268
- data: T,
1286
+ data: F,
1269
1287
  isLoading: A,
1270
- isError: m
1288
+ isError: x
1271
1289
  } = be({
1272
1290
  queryKey: ["models", l],
1273
1291
  queryFn: () => ze(
@@ -1342,7 +1360,7 @@ function qe(s, n) {
1342
1360
  }), {
1343
1361
  data: ne,
1344
1362
  isLoading: je,
1345
- isFetching: Fe,
1363
+ isFetching: Te,
1346
1364
  isError: we
1347
1365
  } = be({
1348
1366
  queryKey: [
@@ -1374,9 +1392,9 @@ function qe(s, n) {
1374
1392
  //currentConnection?.type === 'API',
1375
1393
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1376
1394
  });
1377
- X(() => {
1378
- x(a);
1379
- }, [ne, x, a]), X(() => {
1395
+ Z(() => {
1396
+ m(a);
1397
+ }, [ne, m, a]), Z(() => {
1380
1398
  }, [
1381
1399
  D,
1382
1400
  p,
@@ -1385,7 +1403,7 @@ function qe(s, n) {
1385
1403
  g,
1386
1404
  v
1387
1405
  ]);
1388
- const Te = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() : d || "", Le = D ? "" : i || "";
1406
+ const Fe = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() : d || "", Le = D ? "" : i || "";
1389
1407
  function Ee(C) {
1390
1408
  h(C), f("");
1391
1409
  }
@@ -1401,14 +1419,14 @@ function qe(s, n) {
1401
1419
  S && (($s = S == null ? void 0 : S.databases) == null ? void 0 : $s.length) > 0, G && ((Ps = G == null ? void 0 : G.schemas) == null ? void 0 : Ps.length) > 0, ne && ((Bs = ne == null ? void 0 : ne.columns) == null ? void 0 : Bs.length) > 0 && (a = ne.columns.map((C) => ({
1402
1420
  ...C,
1403
1421
  data_type: C.data_type.toLowerCase()
1404
- }))), K && (a = []), (we || F) && (a = []);
1422
+ }))), K && (a = []), (we || T) && (a = []);
1405
1423
  const ke = I == null ? void 0 : I.connections.map(
1406
1424
  (C) => ({
1407
1425
  id: C.id,
1408
1426
  name: C.name,
1409
1427
  type: C.type
1410
1428
  })
1411
- ), oe = (Us = T == null ? void 0 : T.datamodels) == null ? void 0 : Us.map((C) => ({
1429
+ ), oe = (Us = F == null ? void 0 : F.datamodels) == null ? void 0 : Us.map((C) => ({
1412
1430
  id: C.id,
1413
1431
  name: C.name
1414
1432
  })), _e = S == null ? void 0 : S.databases.map((C) => ({
@@ -1424,10 +1442,10 @@ function qe(s, n) {
1424
1442
  return {
1425
1443
  connectionItems: ke,
1426
1444
  isConnectionsLoading: z,
1427
- isConnectionsError: F,
1445
+ isConnectionsError: T,
1428
1446
  modelItems: oe,
1429
1447
  isModelsLoading: A,
1430
- isModelsError: m,
1448
+ isModelsError: x,
1431
1449
  databaseItems: _e,
1432
1450
  isDatabasesLoadingOrFetching: _ || P,
1433
1451
  isDatabaseError: K,
@@ -1438,11 +1456,11 @@ function qe(s, n) {
1438
1456
  isTableLoadingOrFetching: L || re,
1439
1457
  isTableError: B,
1440
1458
  columns: a,
1441
- isColumnsLoadingOrFetching: je || Fe,
1459
+ isColumnsLoadingOrFetching: je || Te,
1442
1460
  isColumnsError: we,
1443
1461
  isNonDbConnection: D,
1444
1462
  connectionType: j,
1445
- tableName: Te,
1463
+ tableName: Fe,
1446
1464
  schemaName: Le,
1447
1465
  handleConnectionChange: w,
1448
1466
  handleDatamodelChange: le,
@@ -1467,7 +1485,7 @@ function Aa({
1467
1485
  ), {
1468
1486
  connectionItems: i,
1469
1487
  modelItems: d,
1470
- schemaItems: x,
1488
+ schemaItems: m,
1471
1489
  databaseItems: c,
1472
1490
  tableItems: b,
1473
1491
  columns: g,
@@ -1479,10 +1497,10 @@ function Aa({
1479
1497
  isDatabaseError: V,
1480
1498
  isSchemaLoadingOrFetching: I,
1481
1499
  isSchemaError: z,
1482
- isColumnsError: F,
1483
- isColumnsLoadingOrFetching: T,
1500
+ isColumnsError: T,
1501
+ isColumnsLoadingOrFetching: F,
1484
1502
  isTableLoadingOrFetching: A,
1485
- isTableError: m,
1503
+ isTableError: x,
1486
1504
  connectionType: v,
1487
1505
  isNonDbConnection: j,
1488
1506
  handleConnectionChange: D,
@@ -1494,12 +1512,12 @@ function Aa({
1494
1512
  } = qe();
1495
1513
  function G() {
1496
1514
  return s ? s(ee, K, g) : /* @__PURE__ */ e.jsx(
1497
- ll,
1515
+ il,
1498
1516
  {
1499
1517
  schemaName: ee,
1500
1518
  tableName: K,
1501
1519
  columns: g,
1502
- status: T ? "Loading..." : F ? "Error" : "Success"
1520
+ status: F ? "Loading..." : T ? "Error" : "Success"
1503
1521
  }
1504
1522
  );
1505
1523
  }
@@ -1553,7 +1571,7 @@ function Aa({
1553
1571
  onChange: _,
1554
1572
  isError: z,
1555
1573
  isLoading: I,
1556
- items: x,
1574
+ items: m,
1557
1575
  value: l || "",
1558
1576
  title: "Schema"
1559
1577
  }
@@ -1568,7 +1586,7 @@ function Aa({
1568
1586
  He,
1569
1587
  {
1570
1588
  onChange: o,
1571
- isError: m,
1589
+ isError: x,
1572
1590
  items: b,
1573
1591
  isLoading: A,
1574
1592
  value: r || "",
@@ -1607,14 +1625,14 @@ function Aa({
1607
1625
  variant: "secondary",
1608
1626
  className: "w-full",
1609
1627
  children: [
1610
- /* @__PURE__ */ e.jsx(Rn, { className: "mr-2 size-4" }),
1628
+ /* @__PURE__ */ e.jsx(_n, { className: "mr-2 size-4" }),
1611
1629
  "Help"
1612
1630
  ]
1613
1631
  }
1614
1632
  ) })
1615
1633
  ] });
1616
1634
  }
1617
- function rl(s) {
1635
+ function ol(s) {
1618
1636
  const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1619
1637
  let r = s.length;
1620
1638
  if (l !== -1 && (r = l), t !== -1 && t < r && (r = t), n !== -1) {
@@ -1630,14 +1648,14 @@ function rl(s) {
1630
1648
  return `${o} {{ filters | where }} ${i}`;
1631
1649
  }
1632
1650
  }
1633
- function il({
1651
+ function cl({
1634
1652
  error: s,
1635
1653
  setShowAIDialog: n,
1636
1654
  setUserInputforAI: a,
1637
1655
  setTriggerAIRun: t
1638
1656
  }) {
1639
- return /* @__PURE__ */ e.jsxs(Fs, { openDelay: 0, children: [
1640
- /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
1657
+ return /* @__PURE__ */ e.jsxs(Ts, { openDelay: 0, children: [
1658
+ /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4 text-red-500" }) }) }),
1641
1659
  /* @__PURE__ */ e.jsx(
1642
1660
  Ls,
1643
1661
  {
@@ -1664,7 +1682,7 @@ function il({
1664
1682
  )
1665
1683
  ] });
1666
1684
  }
1667
- const ol = `
1685
+ const dl = `
1668
1686
 
1669
1687
  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.
1670
1688
 
@@ -1711,7 +1729,7 @@ SELECT label, measure FROM table
1711
1729
  - Label - Category
1712
1730
  - Measure - Number
1713
1731
  `;
1714
- function cl({
1732
+ function ul({
1715
1733
  open: s,
1716
1734
  setOpen: n,
1717
1735
  userInput: a,
@@ -1719,21 +1737,21 @@ function cl({
1719
1737
  triggerAIRun: l,
1720
1738
  setTriggerAIRun: r
1721
1739
  }) {
1722
- const o = ns(null), i = ns(null), { authToken: d } = Se(), [x, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns), V = u((k) => k.card.sql), I = u((k) => k.selectedTableName), z = `
1740
+ const o = ns(null), i = ns(null), { authToken: d } = Se(), [m, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns), V = u((k) => k.card.sql), I = u((k) => k.selectedTableName), z = `
1723
1741
  ${a}
1724
1742
 
1725
1743
  Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
1726
1744
  Table Name: ${I}
1727
1745
  Table Columns: ${y == null ? void 0 : y.map((k) => `${k.column_name} | ${k.data_type}`).join(", ")}
1728
1746
  User SQL: ${V}
1729
- ${g && `Base Queries: ${JSON.stringify(g)} `}`, F = ` 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.
1730
- Visual Query Syntax: ${ol}`, { data: T, isLoading: A, isFetching: m, isError: v, refetch: j } = be({
1747
+ ${g && `Base Queries: ${JSON.stringify(g)} `}`, T = ` 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.
1748
+ Visual Query Syntax: ${dl}`, { data: F, isLoading: A, isFetching: x, isError: v, refetch: j } = be({
1731
1749
  queryKey: ["ai-query"],
1732
1750
  queryFn: () => ze(
1733
1751
  "https://semaphor.cloud/api/v1/ai",
1734
1752
  (d == null ? void 0 : d.accessToken) || "",
1735
1753
  {
1736
- user_content: `userContent: ${z} ${x ? F : ""}`
1754
+ user_content: `userContent: ${z} ${m ? T : ""}`
1737
1755
  }
1738
1756
  ),
1739
1757
  enabled: !1
@@ -1760,9 +1778,9 @@ function cl({
1760
1778
  return f("bar"), !1;
1761
1779
  return !0;
1762
1780
  }
1763
- X(() => {
1764
- T && N((k) => [...k, { role: "ai", content: T.response }]);
1765
- }, [T]), X(() => {
1781
+ Z(() => {
1782
+ F && N((k) => [...k, { role: "ai", content: F.response }]);
1783
+ }, [F]), Z(() => {
1766
1784
  const k = setTimeout(() => {
1767
1785
  var $;
1768
1786
  i.current && (i.current.scroll({
@@ -1775,7 +1793,7 @@ function cl({
1775
1793
  function S() {
1776
1794
  a && (N((k) => [...k, { role: "user", content: a }]), D(a) && c(!0), t(""), j());
1777
1795
  }
1778
- X(() => {
1796
+ Z(() => {
1779
1797
  l && (S(), r(!1));
1780
1798
  }, [l, r]);
1781
1799
  const _ = {
@@ -1810,7 +1828,7 @@ function cl({
1810
1828
  pre: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
1811
1829
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: $.children }),
1812
1830
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1813
- /* @__PURE__ */ e.jsx(O, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(pt, {}) }),
1831
+ /* @__PURE__ */ e.jsx(O, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ft, {}) }),
1814
1832
  /* @__PURE__ */ e.jsx(
1815
1833
  O,
1816
1834
  {
@@ -1820,7 +1838,7 @@ function cl({
1820
1838
  },
1821
1839
  size: "sm",
1822
1840
  variant: "outline",
1823
- children: /* @__PURE__ */ e.jsx(ft, {})
1841
+ children: /* @__PURE__ */ e.jsx(gt, {})
1824
1842
  }
1825
1843
  )
1826
1844
  ] })
@@ -1840,17 +1858,17 @@ function cl({
1840
1858
  {
1841
1859
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1842
1860
  children: [
1843
- /* @__PURE__ */ e.jsx(Jn, { className: "mr-2 h-5 w-5" }),
1861
+ /* @__PURE__ */ e.jsx(Yn, { className: "mr-2 h-5 w-5" }),
1844
1862
  /* @__PURE__ */ e.jsx("div", { children: k.content })
1845
1863
  ]
1846
1864
  },
1847
1865
  $
1848
1866
  ) : k.role === "ai" ? /* @__PURE__ */ e.jsx(
1849
- xt,
1867
+ pt,
1850
1868
  {
1851
1869
  className: "w-full overflow-auto py-1",
1852
1870
  components: ee,
1853
- children: T == null ? void 0 : T.response.replace(/DuckDB/gi, "Semaphor")
1871
+ children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
1854
1872
  },
1855
1873
  $
1856
1874
  ) : /* @__PURE__ */ e.jsx("div", {}, $));
@@ -1902,7 +1920,7 @@ function cl({
1902
1920
  className: Y(
1903
1921
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1904
1922
  ),
1905
- disabled: A || m,
1923
+ disabled: A || x,
1906
1924
  value: a,
1907
1925
  onChange: (k) => t(k.target.value)
1908
1926
  }
@@ -1915,7 +1933,7 @@ function cl({
1915
1933
  size: "sm",
1916
1934
  variant: "ghost",
1917
1935
  onClick: S,
1918
- children: !A && !m ? /* @__PURE__ */ e.jsx(mt, {}) : /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1936
+ children: !A && !x ? /* @__PURE__ */ e.jsx(xt, {}) : /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1919
1937
  }
1920
1938
  )
1921
1939
  ] })
@@ -1932,10 +1950,10 @@ var qa = {
1932
1950
  className: void 0,
1933
1951
  style: void 0,
1934
1952
  attr: void 0
1935
- }, Zs = Ne.createContext && /* @__PURE__ */ Ne.createContext(qa), dl = ["attr", "size", "title"];
1936
- function ul(s, n) {
1953
+ }, Xs = Ne.createContext && /* @__PURE__ */ Ne.createContext(qa), hl = ["attr", "size", "title"];
1954
+ function ml(s, n) {
1937
1955
  if (s == null) return {};
1938
- var a = hl(s, n), t, l;
1956
+ var a = xl(s, n), t, l;
1939
1957
  if (Object.getOwnPropertySymbols) {
1940
1958
  var r = Object.getOwnPropertySymbols(s);
1941
1959
  for (l = 0; l < r.length; l++)
@@ -1943,7 +1961,7 @@ function ul(s, n) {
1943
1961
  }
1944
1962
  return a;
1945
1963
  }
1946
- function hl(s, n) {
1964
+ function xl(s, n) {
1947
1965
  if (s == null) return {};
1948
1966
  var a = {};
1949
1967
  for (var t in s)
@@ -1963,7 +1981,7 @@ function ls() {
1963
1981
  return s;
1964
1982
  }, ls.apply(this, arguments);
1965
1983
  }
1966
- function Xs(s, n) {
1984
+ function Zs(s, n) {
1967
1985
  var a = Object.keys(s);
1968
1986
  if (Object.getOwnPropertySymbols) {
1969
1987
  var t = Object.getOwnPropertySymbols(s);
@@ -1976,22 +1994,22 @@ function Xs(s, n) {
1976
1994
  function rs(s) {
1977
1995
  for (var n = 1; n < arguments.length; n++) {
1978
1996
  var a = arguments[n] != null ? arguments[n] : {};
1979
- n % 2 ? Xs(Object(a), !0).forEach(function(t) {
1980
- ml(s, t, a[t]);
1981
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Xs(Object(a)).forEach(function(t) {
1997
+ n % 2 ? Zs(Object(a), !0).forEach(function(t) {
1998
+ pl(s, t, a[t]);
1999
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Zs(Object(a)).forEach(function(t) {
1982
2000
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
1983
2001
  });
1984
2002
  }
1985
2003
  return s;
1986
2004
  }
1987
- function ml(s, n, a) {
1988
- return n = xl(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
2005
+ function pl(s, n, a) {
2006
+ return n = fl(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1989
2007
  }
1990
- function xl(s) {
1991
- var n = pl(s, "string");
2008
+ function fl(s) {
2009
+ var n = gl(s, "string");
1992
2010
  return typeof n == "symbol" ? n : n + "";
1993
2011
  }
1994
- function pl(s, n) {
2012
+ function gl(s, n) {
1995
2013
  if (typeof s != "object" || !s) return s;
1996
2014
  var a = s[Symbol.toPrimitive];
1997
2015
  if (a !== void 0) {
@@ -2007,17 +2025,17 @@ function Ra(s) {
2007
2025
  }, n.attr), Ra(n.child)));
2008
2026
  }
2009
2027
  function ge(s) {
2010
- return (n) => /* @__PURE__ */ Ne.createElement(fl, ls({
2028
+ return (n) => /* @__PURE__ */ Ne.createElement(jl, ls({
2011
2029
  attr: rs({}, s.attr)
2012
2030
  }, n), Ra(s.child));
2013
2031
  }
2014
- function fl(s) {
2032
+ function jl(s) {
2015
2033
  var n = (a) => {
2016
2034
  var {
2017
2035
  attr: t,
2018
2036
  size: l,
2019
2037
  title: r
2020
- } = s, o = ul(s, dl), i = l || a.size || "1em", d;
2038
+ } = s, o = ml(s, hl), i = l || a.size || "1em", d;
2021
2039
  return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ Ne.createElement("svg", ls({
2022
2040
  stroke: "currentColor",
2023
2041
  fill: "currentColor",
@@ -2032,14 +2050,14 @@ function fl(s) {
2032
2050
  xmlns: "http://www.w3.org/2000/svg"
2033
2051
  }), r && /* @__PURE__ */ Ne.createElement("title", null, r), s.children);
2034
2052
  };
2035
- return Zs !== void 0 ? /* @__PURE__ */ Ne.createElement(Zs.Consumer, null, (a) => n(a)) : n(qa);
2053
+ return Xs !== void 0 ? /* @__PURE__ */ Ne.createElement(Xs.Consumer, null, (a) => n(a)) : n(qa);
2036
2054
  }
2037
- function gl(s) {
2055
+ function bl(s) {
2038
2056
  return ge({ 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);
2039
2057
  }
2040
- function jl({ sql: s }) {
2041
- return /* @__PURE__ */ e.jsxs(Fs, { children: [
2042
- /* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(gt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2058
+ function yl({ sql: s }) {
2059
+ return /* @__PURE__ */ e.jsxs(Ts, { children: [
2060
+ /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2043
2061
  /* @__PURE__ */ e.jsx(
2044
2062
  Ls,
2045
2063
  {
@@ -2054,11 +2072,11 @@ function jl({ sql: s }) {
2054
2072
  ] });
2055
2073
  }
2056
2074
  function _a(s) {
2057
- const { theme: n } = jt(), a = M((p) => p.theme), t = u((p) => p.frame), l = u((p) => p.card), r = u((p) => p.activeTabCardId), o = bt(), { refetch: i } = De(l), { updateCardTab: d, setRunSql: x } = te(), c = ns(), b = ns({}), g = t.cards.find((p) => p.id === r), h = Oa(() => {
2075
+ const { theme: n } = bt(), a = M((p) => p.theme), t = u((p) => p.frame), l = u((p) => p.card), r = u((p) => p.activeTabCardId), o = yt(), { refetch: i } = De(l), { updateCardTab: d, setRunSql: m } = te(), c = ns(), b = ns({}), g = t.cards.find((p) => p.id === r), h = Oa(() => {
2058
2076
  let p = "";
2059
2077
  return s === "python" && (p = (g == null ? void 0 : g.python) || fa), s === "sql" && (p = (g == null ? void 0 : g.sql) || ""), p;
2060
2078
  }, [s, g]);
2061
- X(() => {
2079
+ Z(() => {
2062
2080
  if (r && l.id && l.id !== r) {
2063
2081
  if (c.current && o) {
2064
2082
  const p = c.current.getModel();
@@ -2070,17 +2088,17 @@ function _a(s) {
2070
2088
  }
2071
2089
  c.current.setModel(N);
2072
2090
  }
2073
- d(r, l), x(!0);
2091
+ d(r, l), m(!0);
2074
2092
  }
2075
2093
  }, [
2076
2094
  r,
2077
2095
  l,
2078
2096
  d,
2079
2097
  o,
2080
- x,
2098
+ m,
2081
2099
  s,
2082
2100
  h
2083
- ]), X(() => {
2101
+ ]), Z(() => {
2084
2102
  if (!o) return;
2085
2103
  const p = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", N = a === "system" ? p : a;
2086
2104
  o.editor.defineTheme("default", {
@@ -2089,14 +2107,14 @@ function _a(s) {
2089
2107
  inherit: !0,
2090
2108
  rules: [],
2091
2109
  colors: {
2092
- "editor.background": N === "light" ? "#ffffff" : yt("240 10% 10%")
2110
+ "editor.background": N === "light" ? "#ffffff" : vt("240 10% 10%")
2093
2111
  // 'editor.background':
2094
2112
  // activeTheme === 'light'
2095
2113
  // ? '#ffffff'
2096
2114
  // : getCssVariableValue('--semaphor-background'),
2097
2115
  }
2098
2116
  }), o.editor.setTheme("default");
2099
- }, [n, a, o]), X(() => {
2117
+ }, [n, a, o]), Z(() => {
2100
2118
  const p = c.current;
2101
2119
  p && o && l && p.addCommand(
2102
2120
  o.KeyMod.Shift | o.KeyCode.Enter,
@@ -2114,10 +2132,10 @@ function _a(s) {
2114
2132
  }
2115
2133
  return { handleEditorDidMount: f };
2116
2134
  }
2117
- function bl() {
2135
+ function vl() {
2118
2136
  const s = u((o) => o.card.sql), n = u((o) => o.sqlGen), { setCardSql: a, setSqlGen: t } = te(), { handleEditorDidMount: l } = _a("sql");
2119
2137
  function r(o) {
2120
- a(o), vt(n) || t({});
2138
+ a(o), Ct(n) || t({});
2121
2139
  }
2122
2140
  return /* @__PURE__ */ e.jsx(
2123
2141
  os,
@@ -2143,7 +2161,7 @@ function bl() {
2143
2161
  }
2144
2162
  );
2145
2163
  }
2146
- function yl() {
2164
+ function Cl() {
2147
2165
  const s = u((l) => l.card.python), { setCardPython: n } = te(), { handleEditorDidMount: a } = _a("python");
2148
2166
  function t(l) {
2149
2167
  n(l);
@@ -2172,7 +2190,7 @@ function yl() {
2172
2190
  }
2173
2191
  );
2174
2192
  }
2175
- function vl() {
2193
+ function Nl() {
2176
2194
  const s = M((r) => r.dashboard.filters), n = M((r) => r.filterValues), a = M((r) => r.selectedSheetId), t = s == null ? void 0 : s.filter(
2177
2195
  (r) => r.sheetId === a || !r.sheetId
2178
2196
  ), l = n == null ? void 0 : n.filter(
@@ -2203,11 +2221,11 @@ function vl() {
2203
2221
  }
2204
2222
  );
2205
2223
  }
2206
- function Cl() {
2224
+ function Sl() {
2207
2225
  const [s, n] = q({
2208
2226
  queryKey: [],
2209
2227
  queryData: null
2210
- }), a = Ct(), [t, l] = q(!1), [r, o] = q(!1), [i, d] = q(!1), [x, c] = q(""), [b, g] = q(!1), h = u((w) => w.frame), f = u((w) => w.card), p = u((w) => w.isShowingVisual), N = u(
2228
+ }), a = Nt(), [t, l] = q(!1), [r, o] = q(!1), [i, d] = q(!1), [m, c] = q(""), [b, g] = q(!1), h = u((w) => w.frame), f = u((w) => w.card), p = u((w) => w.isShowingVisual), N = u(
2211
2229
  (w) => w.selectedConnectionId
2212
2230
  ), y = u(
2213
2231
  (w) => w.selectedDatabaseName
@@ -2215,12 +2233,12 @@ function Cl() {
2215
2233
  (w) => w.selectedDatamodelId
2216
2234
  ), I = u(
2217
2235
  (w) => w.selectedSchemaName
2218
- ), z = u((w) => w.selectedTableName), F = u((w) => {
2236
+ ), z = u((w) => w.selectedTableName), T = u((w) => {
2219
2237
  var le;
2220
2238
  return (le = w == null ? void 0 : w.card) == null ? void 0 : le.sql;
2221
- }), T = u((w) => w.applyFilters), {
2239
+ }), F = u((w) => w.applyFilters), {
2222
2240
  setCardCustomCfg: A,
2223
- setQueryResultColumns: m,
2241
+ setQueryResultColumns: x,
2224
2242
  setCardSql: v,
2225
2243
  setQueryError: j,
2226
2244
  setPythonStdOut: D,
@@ -2238,16 +2256,16 @@ function Cl() {
2238
2256
  queryKey: ne,
2239
2257
  refetch: je
2240
2258
  } = De(f);
2241
- X(() => {
2259
+ Z(() => {
2242
2260
  if (U && (U.rowLimitExceeded && Ge.error("Row limit (10,000) exceeded. Refine your query.", {
2243
2261
  position: "top-center",
2244
2262
  richColors: !0
2245
2263
  }), D((U == null ? void 0 : U.output) || ""), U.records.length > 0)) {
2246
2264
  const { dimensionKeys: w } = js(U.records);
2247
- m(w);
2265
+ x(w);
2248
2266
  }
2249
- }, [U, m, D]), X(() => {
2250
- (E || L) && $(!0), (B || re) && $(!1), B ? (j(ae.message), m([]), D("")) : j("");
2267
+ }, [U, x, D]), Z(() => {
2268
+ (E || L) && $(!0), (B || re) && $(!1), B ? (j(ae.message), x([]), D("")) : j("");
2251
2269
  }, [
2252
2270
  E,
2253
2271
  L,
@@ -2256,13 +2274,13 @@ function Cl() {
2256
2274
  B,
2257
2275
  re,
2258
2276
  $,
2259
- m,
2277
+ x,
2260
2278
  j,
2261
2279
  ae
2262
- ]), X(() => {
2280
+ ]), Z(() => {
2263
2281
  G && (a.getQueryData(ne) || je(), se(!1));
2264
2282
  }, [G, je, se, ne, a]);
2265
- function Fe() {
2283
+ function Te() {
2266
2284
  const w = a.getQueryData(ne);
2267
2285
  s.queryData || n({
2268
2286
  queryKey: ne,
@@ -2289,9 +2307,9 @@ function Cl() {
2289
2307
  }
2290
2308
  return w[0].id;
2291
2309
  }
2292
- function Te() {
2293
- let w = F;
2294
- F && !F.includes("{{") && (w = rl(F), v(w));
2310
+ function Fe() {
2311
+ let w = T;
2312
+ T && !T.includes("{{") && (w = ol(T), v(w));
2295
2313
  const le = {
2296
2314
  ...f,
2297
2315
  lastSelectedSchema: I,
@@ -2333,7 +2351,7 @@ function Cl() {
2333
2351
  }
2334
2352
  )
2335
2353
  ] }),
2336
- /* @__PURE__ */ e.jsx(vl, {})
2354
+ /* @__PURE__ */ e.jsx(Nl, {})
2337
2355
  ] })
2338
2356
  }
2339
2357
  ),
@@ -2344,7 +2362,7 @@ function Cl() {
2344
2362
  className: Y(
2345
2363
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
2346
2364
  {
2347
- "font-bold text-red-800": T
2365
+ "font-bold text-red-800": F
2348
2366
  }
2349
2367
  )
2350
2368
  }
@@ -2372,7 +2390,7 @@ function Cl() {
2372
2390
  {
2373
2391
  id: "sql-container",
2374
2392
  className: "relative flex w-[99%]",
2375
- children: /* @__PURE__ */ e.jsx(bl, {})
2393
+ children: /* @__PURE__ */ e.jsx(vl, {})
2376
2394
  }
2377
2395
  ),
2378
2396
  t && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-xs text-muted-foreground/70", children: "sql" })
@@ -2394,7 +2412,7 @@ function Cl() {
2394
2412
  {
2395
2413
  id: "python-container",
2396
2414
  className: "relative flex w-[99%] pt-0",
2397
- children: /* @__PURE__ */ e.jsx(yl, {})
2415
+ children: /* @__PURE__ */ e.jsx(Cl, {})
2398
2416
  }
2399
2417
  ),
2400
2418
  /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-xs text-muted-foreground/70", children: "python" })
@@ -2437,13 +2455,13 @@ function Cl() {
2437
2455
  size: "sm",
2438
2456
  variant: "outline",
2439
2457
  children: [
2440
- E || L ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Hn, { className: "mr-2 h-4 w-4" }),
2458
+ E || L ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx($n, { className: "mr-2 h-4 w-4" }),
2441
2459
  "Run"
2442
2460
  ]
2443
2461
  }
2444
2462
  ),
2445
2463
  B && /* @__PURE__ */ e.jsx(
2446
- il,
2464
+ cl,
2447
2465
  {
2448
2466
  error: ae.message,
2449
2467
  setShowAIDialog: d,
@@ -2454,12 +2472,12 @@ function Cl() {
2454
2472
  /* @__PURE__ */ e.jsxs(
2455
2473
  O,
2456
2474
  {
2457
- onClick: Fe,
2475
+ onClick: Te,
2458
2476
  className: "",
2459
2477
  size: "sm",
2460
2478
  variant: "outline",
2461
2479
  children: [
2462
- /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-4" }),
2480
+ /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 size-4" }),
2463
2481
  "Clear"
2464
2482
  ]
2465
2483
  }
@@ -2472,15 +2490,15 @@ function Cl() {
2472
2490
  className: "",
2473
2491
  size: "sm",
2474
2492
  variant: "outline",
2475
- children: /* @__PURE__ */ e.jsx(gl, { className: "size-4 text-foreground/70" })
2493
+ children: /* @__PURE__ */ e.jsx(bl, { className: "size-4 text-foreground/70" })
2476
2494
  }
2477
2495
  ),
2478
2496
  /* @__PURE__ */ e.jsx(
2479
- cl,
2497
+ ul,
2480
2498
  {
2481
2499
  open: i,
2482
2500
  setOpen: d,
2483
- userInput: x,
2501
+ userInput: m,
2484
2502
  triggerAIRun: b,
2485
2503
  setTriggerAIRun: g,
2486
2504
  setUserInput: (w) => c(w)
@@ -2488,7 +2506,7 @@ function Cl() {
2488
2506
  )
2489
2507
  ] }),
2490
2508
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2491
- (U == null ? void 0 : U.sql) && /* @__PURE__ */ e.jsx(jl, { sql: U.sql }),
2509
+ (U == null ? void 0 : U.sql) && /* @__PURE__ */ e.jsx(yl, { sql: U.sql }),
2492
2510
  /* @__PURE__ */ e.jsxs(
2493
2511
  O,
2494
2512
  {
@@ -2505,11 +2523,11 @@ function Cl() {
2505
2523
  /* @__PURE__ */ e.jsxs(
2506
2524
  O,
2507
2525
  {
2508
- onClick: Te,
2526
+ onClick: Fe,
2509
2527
  size: "sm",
2510
2528
  variant: "outline",
2511
2529
  children: [
2512
- /* @__PURE__ */ e.jsx(Nt, { className: "mr-2 size-4 font-bold text-green-600" }),
2530
+ /* @__PURE__ */ e.jsx(St, { className: "mr-2 size-4 font-bold text-green-600" }),
2513
2531
  "Accept"
2514
2532
  ]
2515
2533
  }
@@ -2523,13 +2541,13 @@ function Cl() {
2523
2541
  )
2524
2542
  );
2525
2543
  }
2526
- function Nl({ data: s }) {
2544
+ function wl({ data: s }) {
2527
2545
  var o;
2528
2546
  const [n, a] = Ne.useState([]), l = Object.keys(s[0]).map((i) => ({
2529
2547
  // header: key,
2530
2548
  accessorKey: i,
2531
2549
  header: ({ column: d }) => {
2532
- const x = d.getIsSorted();
2550
+ const m = d.getIsSorted();
2533
2551
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2534
2552
  "div",
2535
2553
  {
@@ -2537,16 +2555,16 @@ function Nl({ data: s }) {
2537
2555
  onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2538
2556
  children: [
2539
2557
  i,
2540
- x === "asc" ? /* @__PURE__ */ e.jsx(St, { className: "ml-2 h-5 w-5" }) : x === "desc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : null
2558
+ m === "asc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(kt, { className: "ml-2 h-5 w-5" }) : null
2541
2559
  ]
2542
2560
  }
2543
2561
  ) });
2544
2562
  }
2545
- })), r = kt({
2563
+ })), r = zt({
2546
2564
  data: s,
2547
2565
  columns: l,
2548
- getCoreRowModel: Mt(),
2549
- getPaginationRowModel: It(),
2566
+ getCoreRowModel: It(),
2567
+ getPaginationRowModel: Tt(),
2550
2568
  onSortingChange: a,
2551
2569
  getSortedRowModel: Ft(),
2552
2570
  manualPagination: !0,
@@ -2555,8 +2573,8 @@ function Nl({ data: s }) {
2555
2573
  }
2556
2574
  });
2557
2575
  return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
2558
- /* @__PURE__ */ e.jsx(zt, { children: r.getHeaderGroups().map((i) => /* @__PURE__ */ e.jsx(fs, { children: i.headers.map((d) => /* @__PURE__ */ e.jsx(
2559
- Ot,
2576
+ /* @__PURE__ */ e.jsx(Ot, { children: r.getHeaderGroups().map((i) => /* @__PURE__ */ e.jsx(fs, { children: i.headers.map((d) => /* @__PURE__ */ e.jsx(
2577
+ Dt,
2560
2578
  {
2561
2579
  className: "sticky top-0 h-11 bg-muted font-semibold",
2562
2580
  children: d.isPlaceholder ? null : Ks(
@@ -2566,7 +2584,7 @@ function Nl({ data: s }) {
2566
2584
  },
2567
2585
  d.id
2568
2586
  )) }, i.id)) }),
2569
- /* @__PURE__ */ e.jsx(Dt, { children: (o = r.getRowModel().rows) != null && o.length ? r.getRowModel().rows.map((i) => /* @__PURE__ */ e.jsx(
2587
+ /* @__PURE__ */ e.jsx(Mt, { children: (o = r.getRowModel().rows) != null && o.length ? r.getRowModel().rows.map((i) => /* @__PURE__ */ e.jsx(
2570
2588
  fs,
2571
2589
  {
2572
2590
  className: "whitespace-nowrap py-2",
@@ -2577,15 +2595,15 @@ function Nl({ data: s }) {
2577
2595
  )) : /* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Qs, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2578
2596
  ] }) });
2579
2597
  }
2580
- function Sl({ card: s }) {
2581
- var y, V, I, z, F, T, A, m, v, j, D;
2598
+ function kl({ card: s }) {
2599
+ var y, V, I, z, T, F, A, x, v, j, D;
2582
2600
  const [n, a] = q(!1), [t, l] = q(
2583
2601
  []
2584
- ), { authToken: r } = Se(), o = Tt(r == null ? void 0 : r.accessToken), i = M((S) => S.themeStyle), d = {
2602
+ ), { authToken: r } = Se(), o = Lt(r == null ? void 0 : r.accessToken), i = M((S) => S.themeStyle), d = {
2585
2603
  colors: ((V = (y = i == null ? void 0 : i.chart) == null ? void 0 : y.dataset) == null ? void 0 : V.backgroundColor) || []
2586
2604
  };
2587
2605
  (I = s.customCardPreferences) != null && I.inputData;
2588
- const { getCard: x } = ga(((z = s.customCardPreferences) == null ? void 0 : z.url) || ""), c = ((F = s.customCardPreferences) == null ? void 0 : F.visualType) || "single", b = u((S) => S.frame);
2606
+ const { getCard: m } = ga(((z = s.customCardPreferences) == null ? void 0 : z.url) || ""), c = ((T = s.customCardPreferences) == null ? void 0 : T.visualType) || "single", b = u((S) => S.frame);
2589
2607
  te();
2590
2608
  const { data: g } = De(s), h = Oa((S, _) => {
2591
2609
  l((P) => ({
@@ -2593,23 +2611,23 @@ function Sl({ card: s }) {
2593
2611
  [S]: _
2594
2612
  }));
2595
2613
  }, []);
2596
- if (!((T = s.customCardPreferences) != null && T.componentName))
2614
+ if (!((F = s.customCardPreferences) != null && F.componentName))
2597
2615
  return null;
2598
- const f = x(
2616
+ const f = m(
2599
2617
  (A = s.customCardPreferences) == null ? void 0 : A.componentName
2600
2618
  );
2601
2619
  function p(S) {
2602
2620
  a(S);
2603
2621
  }
2604
2622
  const N = Object.keys(
2605
- ((m = s.customCardPreferences) == null ? void 0 : m.dataInputCardIds) || {}
2623
+ ((x = s.customCardPreferences) == null ? void 0 : x.dataInputCardIds) || {}
2606
2624
  ).map((S) => {
2607
2625
  var K, ee, G;
2608
2626
  const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find((se) => se.id === _);
2609
2627
  return P || null;
2610
2628
  });
2611
2629
  return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
2612
- Cn,
2630
+ Nn,
2613
2631
  {
2614
2632
  fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
2615
2633
  children: [
@@ -2633,7 +2651,7 @@ function Sl({ card: s }) {
2633
2651
  );
2634
2652
  if (P)
2635
2653
  return /* @__PURE__ */ e.jsx(
2636
- Lt,
2654
+ Et,
2637
2655
  {
2638
2656
  onLoadingStatus: p,
2639
2657
  onDataChange: h,
@@ -2672,7 +2690,7 @@ function Ha({
2672
2690
  var N;
2673
2691
  const a = u((y) => y.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = u((y) => y.frame), r = M((y) => y.dashboard.filters);
2674
2692
  u((y) => y.actions.setRunSql);
2675
- const { updateFilter: o } = is(), i = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: d, isLoading: x, isFetching: c } = De(a), { setCard: b } = te(), { data: g } = Es(a);
2693
+ const { updateFilter: o } = is(), i = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: d, isLoading: m, isFetching: c } = De(a), { setCard: b } = te(), { data: g } = Es(a);
2676
2694
  if (!a.id) return null;
2677
2695
  let h;
2678
2696
  d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (h = ja({
@@ -2684,20 +2702,20 @@ function Ha({
2684
2702
  topoJson: g
2685
2703
  }));
2686
2704
  function f(y) {
2687
- return /* @__PURE__ */ e.jsx(Sl, { card: y });
2705
+ return /* @__PURE__ */ e.jsx(kl, { card: y });
2688
2706
  }
2689
2707
  function p() {
2690
2708
  var y;
2691
- if (d != null && d.records && (d == null ? void 0 : d.records.length) === 0 && !x && !c)
2709
+ if (d != null && d.records && (d == null ? void 0 : d.records.length) === 0 && !m && !c)
2692
2710
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
2693
- /* @__PURE__ */ e.jsx(_t, { className: "size-8 text-muted-foreground" }),
2711
+ /* @__PURE__ */ e.jsx(Ht, { className: "size-8 text-muted-foreground" }),
2694
2712
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
2695
2713
  ] });
2696
2714
  if (a.type === "custom")
2697
2715
  return f(a);
2698
2716
  if (!["table", "custom"].includes(a.type) && h)
2699
2717
  return /* @__PURE__ */ e.jsx(
2700
- Ht,
2718
+ $t,
2701
2719
  {
2702
2720
  cfg: h
2703
2721
  },
@@ -2705,41 +2723,41 @@ function Ha({
2705
2723
  );
2706
2724
  if (a.type === "table" && (d != null && d.records) && (d == null ? void 0 : d.records.length) > 0)
2707
2725
  return /* @__PURE__ */ e.jsxs(fe, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
2708
- /* @__PURE__ */ e.jsx($t, { card: a, data: d == null ? void 0 : d.records }),
2726
+ /* @__PURE__ */ e.jsx(Pt, { card: a, data: d == null ? void 0 : d.records }),
2709
2727
  /* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
2710
2728
  ] });
2711
2729
  }
2712
2730
  return /* @__PURE__ */ e.jsxs(
2713
- Et,
2731
+ Vt,
2714
2732
  {
2715
2733
  role: "editor-visual-card",
2716
2734
  className: Y("relative flex h-full flex-col rounded-none", s),
2717
2735
  ...n,
2718
2736
  children: [
2719
- t && /* @__PURE__ */ e.jsxs(Vt, { className: "flex flex-row items-start justify-between py-4", children: [
2737
+ t && /* @__PURE__ */ e.jsxs(At, { className: "flex flex-row items-start justify-between py-4", children: [
2720
2738
  /* @__PURE__ */ e.jsxs("div", { children: [
2721
2739
  /* @__PURE__ */ e.jsx(
2722
- Ze,
2740
+ Xe,
2723
2741
  {
2724
2742
  text: a.title,
2725
2743
  onSave: (y) => b({ ...a, title: y }),
2726
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(At, { className: "text-base", children: a.title || "Edit title..." }) })
2744
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(qt, { className: "text-base", children: a.title || "Edit title..." }) })
2727
2745
  },
2728
2746
  a.title
2729
2747
  ),
2730
2748
  /* @__PURE__ */ e.jsx(
2731
- Ze,
2749
+ Xe,
2732
2750
  {
2733
2751
  text: a.description || "",
2734
2752
  onSave: (y) => b({ ...a, description: y }),
2735
- children: /* @__PURE__ */ e.jsx(qt, { children: a.description || "Edit description..." })
2753
+ children: /* @__PURE__ */ e.jsx(Rt, { children: a.description || "Edit description..." })
2736
2754
  },
2737
2755
  a.description
2738
2756
  )
2739
2757
  ] }),
2740
2758
  i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2741
2759
  /* @__PURE__ */ e.jsx(
2742
- Ze,
2760
+ Xe,
2743
2761
  {
2744
2762
  className: "my-1",
2745
2763
  text: i.title || i.column,
@@ -2750,7 +2768,7 @@ function Ha({
2750
2768
  /* @__PURE__ */ e.jsx(ba, { filter: i })
2751
2769
  ] })
2752
2770
  ] }),
2753
- /* @__PURE__ */ e.jsx(Rt, { className: "flex grow flex-col", children: p() })
2771
+ /* @__PURE__ */ e.jsx(_t, { className: "flex grow flex-col", children: p() })
2754
2772
  ]
2755
2773
  }
2756
2774
  );
@@ -2774,12 +2792,12 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2774
2792
  value: n,
2775
2793
  onChange: a
2776
2794
  }
2777
- ), wl = ({ card: s }) => /* @__PURE__ */ e.jsxs(ks, { children: [
2795
+ ), zl = ({ card: s }) => /* @__PURE__ */ e.jsxs(ks, { children: [
2778
2796
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2779
2797
  /* @__PURE__ */ e.jsx(zs, { children: "Customize Card" }),
2780
2798
  /* @__PURE__ */ e.jsxs(Ds, { children: [
2781
2799
  /* @__PURE__ */ e.jsx(ca, { children: /* @__PURE__ */ e.jsx(
2782
- En,
2800
+ Vn,
2783
2801
  {
2784
2802
  onClick: () => navigator.clipboard.writeText(s.id),
2785
2803
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
@@ -2800,7 +2818,7 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2800
2818
  }
2801
2819
  )
2802
2820
  ] })
2803
- ] }), kl = ({
2821
+ ] }), Ol = ({
2804
2822
  defaultConfig: s,
2805
2823
  customCode: n,
2806
2824
  customConfig: a,
@@ -2808,12 +2826,12 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2808
2826
  onCodeChange: l
2809
2827
  }) => /* @__PURE__ */ e.jsxs(va, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2810
2828
  /* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2811
- /* @__PURE__ */ e.jsxs(Xe, { value: "custom-config", children: [
2829
+ /* @__PURE__ */ e.jsxs(Ze, { value: "custom-config", children: [
2812
2830
  a && /* @__PURE__ */ e.jsx(Na, { className: "mr-1 h-5 w-5 text-green-600" }),
2813
2831
  a ? "Custom Config" : "Default Config"
2814
2832
  ] }),
2815
- /* @__PURE__ */ e.jsx(Xe, { value: "output", children: "Output" }),
2816
- /* @__PURE__ */ e.jsx(Xe, { value: "custom-code", children: "Custom Code" })
2833
+ /* @__PURE__ */ e.jsx(Ze, { value: "output", children: "Output" }),
2834
+ /* @__PURE__ */ e.jsx(Ze, { value: "custom-code", children: "Custom Code" })
2817
2835
  ] }),
2818
2836
  /* @__PURE__ */ e.jsx(
2819
2837
  es,
@@ -2860,7 +2878,7 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2860
2878
  )
2861
2879
  }
2862
2880
  )
2863
- ] }), zl = ({
2881
+ ] }), Dl = ({
2864
2882
  error: s,
2865
2883
  hasCustomConfig: n,
2866
2884
  onReset: a,
@@ -2872,15 +2890,15 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2872
2890
  /* @__PURE__ */ e.jsx(O, { onClick: t, variant: "outline", children: "Apply" }),
2873
2891
  /* @__PURE__ */ e.jsx(O, { onClick: l, variant: "outline", children: "Close" })
2874
2892
  ] });
2875
- function Ol() {
2876
- const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [o, i] = q(""), [d, x] = q(""), c = u((z) => z.card), b = u((z) => z.card.customCfg), { data: g } = De(c), { data: h } = Es(c), { setCardCustomCfg: f, setCustomVisualCode: p } = te(), N = (z) => {
2877
- var F, T;
2893
+ function Ml() {
2894
+ const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [o, i] = q(""), [d, m] = q(""), c = u((z) => z.card), b = u((z) => z.card.customCfg), { data: g } = De(c), { data: h } = Es(c), { setCardCustomCfg: f, setCustomVisualCode: p } = te(), N = (z) => {
2895
+ var T, F;
2878
2896
  return JSON.stringify(
2879
2897
  {
2880
2898
  ...z,
2881
2899
  data: {
2882
2900
  ...z.data,
2883
- datasets: (T = (F = z.data) == null ? void 0 : F.datasets) == null ? void 0 : T.map((A) => ({
2901
+ datasets: (F = (T = z.data) == null ? void 0 : T.datasets) == null ? void 0 : F.map((A) => ({
2884
2902
  ...A,
2885
2903
  data: []
2886
2904
  }))
@@ -2890,8 +2908,8 @@ function Ol() {
2890
2908
  2
2891
2909
  );
2892
2910
  }, y = () => {
2893
- var F, T;
2894
- if (!((F = g == null ? void 0 : g.records) != null && F.length)) return;
2911
+ var T, F;
2912
+ if (!((T = g == null ? void 0 : g.records) != null && T.length)) return;
2895
2913
  const z = ja({
2896
2914
  data: g.records,
2897
2915
  cardType: c.type,
@@ -2899,17 +2917,17 @@ function Ol() {
2899
2917
  preferences: c.preferences,
2900
2918
  topoJson: h
2901
2919
  });
2902
- z && (t(N(z)), i(((T = c.preferences) == null ? void 0 : T.customVisualCode) || ""), r(
2920
+ z && (t(N(z)), i(((F = c.preferences) == null ? void 0 : F.customVisualCode) || ""), r(
2903
2921
  b ? JSON.stringify(b, null, 2) : ""
2904
2922
  ));
2905
2923
  }, V = () => {
2906
2924
  try {
2907
2925
  if (o && p(o), l) {
2908
2926
  const z = JSON.parse(l);
2909
- f(z), x("");
2927
+ f(z), m("");
2910
2928
  }
2911
2929
  } catch {
2912
- x("Invalid JSON configuration");
2930
+ m("Invalid JSON configuration");
2913
2931
  }
2914
2932
  }, I = () => {
2915
2933
  if (b) {
@@ -2926,15 +2944,15 @@ function Ol() {
2926
2944
  size: "sm",
2927
2945
  variant: "outline",
2928
2946
  className: b ? "border-foreground/50 dark:border-foreground/70" : "",
2929
- children: /* @__PURE__ */ e.jsx(Pt, { className: "h-4 w-4" })
2947
+ children: /* @__PURE__ */ e.jsx(Bt, { className: "h-4 w-4" })
2930
2948
  }
2931
2949
  ) }),
2932
2950
  /* @__PURE__ */ e.jsxs(ws, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
2933
- /* @__PURE__ */ e.jsx(wl, { card: c }),
2951
+ /* @__PURE__ */ e.jsx(zl, { card: c }),
2934
2952
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2935
2953
  /* @__PURE__ */ e.jsx(cs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ha, { className: "w-1/2 rounded shadow-none" }) }),
2936
2954
  /* @__PURE__ */ e.jsx(
2937
- kl,
2955
+ Ol,
2938
2956
  {
2939
2957
  defaultConfig: a,
2940
2958
  customCode: o,
@@ -2945,7 +2963,7 @@ function Ol() {
2945
2963
  )
2946
2964
  ] }),
2947
2965
  /* @__PURE__ */ e.jsx(
2948
- zl,
2966
+ Dl,
2949
2967
  {
2950
2968
  error: d,
2951
2969
  hasCustomConfig: !!b,
@@ -2985,9 +3003,9 @@ function Ja(s) {
2985
3003
  }
2986
3004
  function Wa(s) {
2987
3005
  const [n, a] = q(null);
2988
- return X(() => {
3006
+ return Z(() => {
2989
3007
  s && (async () => {
2990
- const r = (await import("./lucide-react-CiT3aGYQ.js"))[s];
3008
+ const r = (await import("./lucide-react-CZLCF1dV.js"))[s];
2991
3009
  a(r);
2992
3010
  })();
2993
3011
  }, [s]), n;
@@ -2995,21 +3013,21 @@ function Wa(s) {
2995
3013
  function Ya() {
2996
3014
  const { authToken: s } = Se(), { data: n, isLoading: a, isFetching: t, isError: l } = be({
2997
3015
  queryKey: ["plugins", s == null ? void 0 : s.accessToken],
2998
- queryFn: () => Bt(s == null ? void 0 : s.accessToken)
3016
+ queryFn: () => Ut(s == null ? void 0 : s.accessToken)
2999
3017
  // staleTime: Infinity,
3000
3018
  });
3001
3019
  return { data: n, isLoading: a, isFetching: t, isError: l };
3002
3020
  }
3003
- function Dl({
3021
+ function Il({
3004
3022
  onChartTypeChange: s
3005
3023
  }) {
3006
3024
  const [n, a] = q([]), { data: t } = Ya();
3007
- return X(() => {
3025
+ return Z(() => {
3008
3026
  (async () => {
3009
3027
  var r;
3010
3028
  if (t) {
3011
3029
  const i = (await Promise.all(
3012
- (r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (d) => (await Ut(d.value)).visuals.map((b) => ({
3030
+ (r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (d) => (await Gt(d.value)).visuals.map((b) => ({
3013
3031
  name: b.name,
3014
3032
  icon: b.icon,
3015
3033
  url: d.value
@@ -3021,7 +3039,7 @@ function Dl({
3021
3039
  }, [t]), n.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3022
3040
  /* @__PURE__ */ e.jsx(Ce, { className: "my-2" }),
3023
3041
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: n.map((l, r) => /* @__PURE__ */ e.jsx(
3024
- Ml,
3042
+ Tl,
3025
3043
  {
3026
3044
  text: l.name,
3027
3045
  onClick: () => s("custom", l),
@@ -3031,7 +3049,7 @@ function Dl({
3031
3049
  )) })
3032
3050
  ] });
3033
3051
  }
3034
- const Ml = ({
3052
+ const Tl = ({
3035
3053
  text: s,
3036
3054
  icon: n,
3037
3055
  onClick: a
@@ -3039,10 +3057,10 @@ const Ml = ({
3039
3057
  const t = Wa(n || ""), l = s.charAt(0).toUpperCase();
3040
3058
  return /* @__PURE__ */ e.jsx(O, { onClick: a, title: s, variant: "ghost", children: t ? /* @__PURE__ */ e.jsx(t, { className: "h-4 w-4" }) : l });
3041
3059
  };
3042
- function Il() {
3060
+ function Fl() {
3043
3061
  var c, b;
3044
3062
  const [s, n] = q(!1), a = u((g) => g.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: o } = u((g) => g.actions), { setCardCustomCfg: i, setCustomCardPreferences: d } = te();
3045
- function x(g, h) {
3063
+ function m(g, h) {
3046
3064
  i(null), r({}), l(g), h && d({
3047
3065
  type: "component",
3048
3066
  visualType: "single",
@@ -3053,7 +3071,7 @@ function Il() {
3053
3071
  }
3054
3072
  return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
3055
3073
  /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3056
- Fl,
3074
+ Ll,
3057
3075
  {
3058
3076
  className: "h-4 w-4",
3059
3077
  chartType: t,
@@ -3066,7 +3084,7 @@ function Il() {
3066
3084
  /* @__PURE__ */ e.jsx(
3067
3085
  O,
3068
3086
  {
3069
- onClick: () => x("bar"),
3087
+ onClick: () => m("bar"),
3070
3088
  className: "font-normal",
3071
3089
  variant: "ghost",
3072
3090
  children: /* @__PURE__ */ e.jsx(qs, { className: "size-5" })
@@ -3075,7 +3093,7 @@ function Il() {
3075
3093
  /* @__PURE__ */ e.jsx(
3076
3094
  O,
3077
3095
  {
3078
- onClick: () => x("line"),
3096
+ onClick: () => m("line"),
3079
3097
  variant: "ghost",
3080
3098
  children: /* @__PURE__ */ e.jsx(Rs, { className: "size-5" })
3081
3099
  }
@@ -3083,7 +3101,7 @@ function Il() {
3083
3101
  /* @__PURE__ */ e.jsx(
3084
3102
  O,
3085
3103
  {
3086
- onClick: () => x("stackedBar"),
3104
+ onClick: () => m("stackedBar"),
3087
3105
  variant: "ghost",
3088
3106
  children: /* @__PURE__ */ e.jsx(Ka, { className: "size-5", strokeWidth: 0 })
3089
3107
  }
@@ -3091,7 +3109,7 @@ function Il() {
3091
3109
  /* @__PURE__ */ e.jsx(
3092
3110
  O,
3093
3111
  {
3094
- onClick: () => x("stackedLine"),
3112
+ onClick: () => m("stackedLine"),
3095
3113
  variant: "ghost",
3096
3114
  children: /* @__PURE__ */ e.jsx(Ga, { className: "size-5", strokeWidth: 0 })
3097
3115
  }
@@ -3099,7 +3117,7 @@ function Il() {
3099
3117
  /* @__PURE__ */ e.jsx(
3100
3118
  O,
3101
3119
  {
3102
- onClick: () => x("scatter"),
3120
+ onClick: () => m("scatter"),
3103
3121
  variant: "ghost",
3104
3122
  children: /* @__PURE__ */ e.jsx(Ia, { className: "size-5" })
3105
3123
  }
@@ -3107,7 +3125,7 @@ function Il() {
3107
3125
  /* @__PURE__ */ e.jsx(
3108
3126
  O,
3109
3127
  {
3110
- onClick: () => x("bubble"),
3128
+ onClick: () => m("bubble"),
3111
3129
  variant: "ghost",
3112
3130
  children: /* @__PURE__ */ e.jsx(Ua, { className: "size-4" })
3113
3131
  }
@@ -3115,7 +3133,7 @@ function Il() {
3115
3133
  /* @__PURE__ */ e.jsx(
3116
3134
  O,
3117
3135
  {
3118
- onClick: () => x("pie"),
3136
+ onClick: () => m("pie"),
3119
3137
  variant: "ghost",
3120
3138
  children: /* @__PURE__ */ e.jsx(Ma, { className: "size-5" })
3121
3139
  }
@@ -3123,7 +3141,7 @@ function Il() {
3123
3141
  /* @__PURE__ */ e.jsx(
3124
3142
  O,
3125
3143
  {
3126
- onClick: () => x("doughnut"),
3144
+ onClick: () => m("doughnut"),
3127
3145
  variant: "ghost",
3128
3146
  children: /* @__PURE__ */ e.jsx(Pa, { className: "size-5", strokeWidth: 1 })
3129
3147
  }
@@ -3131,7 +3149,7 @@ function Il() {
3131
3149
  /* @__PURE__ */ e.jsx(
3132
3150
  O,
3133
3151
  {
3134
- onClick: () => x("radar"),
3152
+ onClick: () => m("radar"),
3135
3153
  variant: "ghost",
3136
3154
  children: /* @__PURE__ */ e.jsx(
3137
3155
  $a,
@@ -3145,7 +3163,7 @@ function Il() {
3145
3163
  /* @__PURE__ */ e.jsx(
3146
3164
  O,
3147
3165
  {
3148
- onClick: () => x("polarArea"),
3166
+ onClick: () => m("polarArea"),
3149
3167
  variant: "ghost",
3150
3168
  children: /* @__PURE__ */ e.jsx(Ba, { className: "size-5" })
3151
3169
  }
@@ -3153,7 +3171,7 @@ function Il() {
3153
3171
  /* @__PURE__ */ e.jsx(
3154
3172
  O,
3155
3173
  {
3156
- onClick: () => x("pyramid"),
3174
+ onClick: () => m("pyramid"),
3157
3175
  variant: "ghost",
3158
3176
  children: /* @__PURE__ */ e.jsx(Ja, { className: "size-5" })
3159
3177
  }
@@ -3161,7 +3179,7 @@ function Il() {
3161
3179
  /* @__PURE__ */ e.jsx(
3162
3180
  O,
3163
3181
  {
3164
- onClick: () => x("range"),
3182
+ onClick: () => m("range"),
3165
3183
  variant: "ghost",
3166
3184
  children: /* @__PURE__ */ e.jsx(Da, { className: "size-5" })
3167
3185
  }
@@ -3169,7 +3187,7 @@ function Il() {
3169
3187
  /* @__PURE__ */ e.jsx(
3170
3188
  O,
3171
3189
  {
3172
- onClick: () => x("table"),
3190
+ onClick: () => m("table"),
3173
3191
  variant: "ghost",
3174
3192
  children: /* @__PURE__ */ e.jsx(Is, { className: "size-5" })
3175
3193
  }
@@ -3177,7 +3195,7 @@ function Il() {
3177
3195
  /* @__PURE__ */ e.jsx(
3178
3196
  O,
3179
3197
  {
3180
- onClick: () => x("kpi"),
3198
+ onClick: () => m("kpi"),
3181
3199
  variant: "ghost",
3182
3200
  children: /* @__PURE__ */ e.jsx(Qa, { className: "size-6" })
3183
3201
  }
@@ -3185,7 +3203,7 @@ function Il() {
3185
3203
  /* @__PURE__ */ e.jsx(
3186
3204
  O,
3187
3205
  {
3188
- onClick: () => x("text"),
3206
+ onClick: () => m("text"),
3189
3207
  variant: "ghost",
3190
3208
  children: /* @__PURE__ */ e.jsx(_s, { className: "size-4" })
3191
3209
  }
@@ -3193,25 +3211,25 @@ function Il() {
3193
3211
  /* @__PURE__ */ e.jsx(
3194
3212
  O,
3195
3213
  {
3196
- onClick: () => x("map"),
3214
+ onClick: () => m("map"),
3197
3215
  variant: "ghost",
3198
- children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4" })
3216
+ children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4" })
3199
3217
  }
3200
3218
  ),
3201
3219
  /* @__PURE__ */ e.jsx(
3202
3220
  O,
3203
3221
  {
3204
- onClick: () => x("custom"),
3222
+ onClick: () => m("custom"),
3205
3223
  variant: "ghost",
3206
3224
  children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
3207
3225
  }
3208
3226
  )
3209
3227
  ] }),
3210
- /* @__PURE__ */ e.jsx(Dl, { onChartTypeChange: x })
3228
+ /* @__PURE__ */ e.jsx(Il, { onChartTypeChange: m })
3211
3229
  ] })
3212
3230
  ] });
3213
3231
  }
3214
- function Fl({
3232
+ function Ll({
3215
3233
  chartType: s,
3216
3234
  className: n,
3217
3235
  customIcon: a,
@@ -3248,27 +3266,27 @@ function Fl({
3248
3266
  case "text":
3249
3267
  return /* @__PURE__ */ e.jsx(_s, { className: n });
3250
3268
  case "map":
3251
- return /* @__PURE__ */ e.jsx(Ta, { className: n });
3269
+ return /* @__PURE__ */ e.jsx(Fa, { className: n });
3252
3270
  case "custom":
3253
3271
  return a && l ? /* @__PURE__ */ e.jsx(l, { className: n }) : t ? t == null ? void 0 : t.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(La, { className: n });
3254
3272
  default:
3255
3273
  return /* @__PURE__ */ e.jsx(Is, { className: n });
3256
3274
  }
3257
3275
  }
3258
- function Tl() {
3276
+ function El() {
3259
3277
  var n;
3260
3278
  const s = u((a) => a.card);
3261
3279
  return (n = s.customCardPreferences) == null || n.showCardHeader, te(), /* @__PURE__ */ e.jsxs(na, { children: [
3262
- /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3280
+ /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3263
3281
  /* @__PURE__ */ e.jsx(ra, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
3264
- Gt,
3282
+ Kt,
3265
3283
  {
3266
3284
  onClick: () => {
3267
3285
  navigator.clipboard.writeText(s.id), Ge.success("Card ID copied to clipboard");
3268
3286
  },
3269
3287
  className: "cursor-pointer space-x-2",
3270
3288
  children: [
3271
- /* @__PURE__ */ e.jsx(Kt, { className: "size-5" }),
3289
+ /* @__PURE__ */ e.jsx(Qt, { className: "size-5" }),
3272
3290
  /* @__PURE__ */ e.jsx("span", { children: "Copy Card ID" })
3273
3291
  ]
3274
3292
  }
@@ -3276,12 +3294,12 @@ function Tl() {
3276
3294
  ] });
3277
3295
  }
3278
3296
  function sa() {
3279
- const s = u((m) => m.frame), n = u((m) => m.card), a = u((m) => m.isShowingVisual), t = u((m) => m.isSqlRunning), l = u((m) => m.queryError), r = u((m) => m.pythonStdOut);
3280
- u((m) => m.actions.setRunSql);
3281
- const { setFrame: o, setCard: i, updateCardInFrame: d, setActiveTabCardId: x } = te(), { data: c, isLoading: b, isFetching: g } = De(n);
3297
+ const s = u((x) => x.frame), n = u((x) => x.card), a = u((x) => x.isShowingVisual), t = u((x) => x.isSqlRunning), l = u((x) => x.queryError), r = u((x) => x.pythonStdOut);
3298
+ u((x) => x.actions.setRunSql);
3299
+ const { setFrame: o, setCard: i, updateCardInFrame: d, setActiveTabCardId: m } = te(), { data: c, isLoading: b, isFetching: g } = De(n);
3282
3300
  if (!n) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3283
3301
  function h() {
3284
- const m = {
3302
+ const x = {
3285
3303
  connectionId: n.connectionId,
3286
3304
  id: Ue(),
3287
3305
  title: "Title",
@@ -3298,49 +3316,49 @@ function sa() {
3298
3316
  sql: "",
3299
3317
  data: []
3300
3318
  };
3301
- f(m);
3319
+ f(x);
3302
3320
  }
3303
- function f(m) {
3321
+ function f(x) {
3304
3322
  const v = {
3305
3323
  ...s,
3306
- cards: [...s.cards, m],
3307
- activeCardId: m.id
3324
+ cards: [...s.cards, x],
3325
+ activeCardId: x.id
3308
3326
  };
3309
- o(v), x(m.id);
3327
+ o(v), m(x.id);
3310
3328
  }
3311
3329
  function p() {
3312
- const m = {
3330
+ const x = {
3313
3331
  ...n,
3314
3332
  id: Ue(),
3315
3333
  title: `${n.title} Copy`,
3316
3334
  tabTitle: `${n.tabTitle || n.title} Copy`
3317
3335
  };
3318
- f(m);
3336
+ f(x);
3319
3337
  }
3320
- function N(m) {
3321
- const v = s.cards.filter((S) => S.id !== m), j = v[0], D = {
3338
+ function N(x) {
3339
+ const v = s.cards.filter((S) => S.id !== x), j = v[0], D = {
3322
3340
  ...s,
3323
3341
  cards: v,
3324
3342
  // update the active card to the first card in the frame
3325
3343
  activeCardId: j.id
3326
3344
  };
3327
- o(D), i(j);
3345
+ o(D), m(j.id), i(j);
3328
3346
  }
3329
- function y(m) {
3330
- x(m);
3347
+ function y(x) {
3348
+ m(x);
3331
3349
  }
3332
- const V = (m, v) => {
3333
- console.log("handleDragStart", v), m.dataTransfer.setData("tabIndex", v.toString());
3334
- }, I = (m) => {
3335
- m.preventDefault();
3336
- }, z = (m, v) => {
3337
- const j = m.dataTransfer.getData("tabIndex");
3350
+ const V = (x, v) => {
3351
+ console.log("handleDragStart", v), x.dataTransfer.setData("tabIndex", v.toString());
3352
+ }, I = (x) => {
3353
+ x.preventDefault();
3354
+ }, z = (x, v) => {
3355
+ const j = x.dataTransfer.getData("tabIndex");
3338
3356
  if (j === v.toString()) return;
3339
3357
  const D = Array.from(s.cards), [S] = D.splice(parseInt(j), 1);
3340
3358
  D.splice(v, 0, S), o({ ...s, cards: D });
3341
3359
  };
3342
- function F(m, v) {
3343
- return m.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || m.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3360
+ function T(x, v) {
3361
+ return x.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || x.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3344
3362
  "div",
3345
3363
  {
3346
3364
  onClick: () => {
@@ -3350,11 +3368,11 @@ function sa() {
3350
3368
  displayTab: j
3351
3369
  });
3352
3370
  },
3353
- children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Yt, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3371
+ children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Xt, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3354
3372
  }
3355
3373
  );
3356
3374
  }
3357
- function T() {
3375
+ function F() {
3358
3376
  return /* @__PURE__ */ e.jsxs(
3359
3377
  va,
3360
3378
  {
@@ -3362,39 +3380,39 @@ function sa() {
3362
3380
  value: s.activeCardId,
3363
3381
  className: "flex grow flex-col",
3364
3382
  children: [
3365
- s.cards.map((m) => /* @__PURE__ */ e.jsx(es, { className: "mt-0 grow", value: m.id, children: A() }, m.id)),
3383
+ s.cards.map((x) => /* @__PURE__ */ e.jsx(es, { className: "mt-0 grow", value: x.id, children: A() }, x.id)),
3366
3384
  /* @__PURE__ */ e.jsx(Ca, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3367
- s.cards.map((m, v) => /* @__PURE__ */ e.jsx(
3368
- Ze,
3385
+ s.cards.map((x, v) => /* @__PURE__ */ e.jsx(
3386
+ Xe,
3369
3387
  {
3370
- text: m.tabTitle || m.title,
3388
+ text: x.tabTitle || x.title,
3371
3389
  onSave: (j) => {
3372
3390
  i({ ...n, tabTitle: j }), d({ ...n, tabTitle: j });
3373
3391
  },
3374
3392
  children: /* @__PURE__ */ e.jsxs(
3375
- Xe,
3393
+ Ze,
3376
3394
  {
3377
3395
  draggable: !0,
3378
3396
  onDragStart: (j) => V(j, v),
3379
3397
  onDragOver: I,
3380
3398
  onDrop: (j) => z(j, v),
3381
3399
  className: "",
3382
- value: m.id,
3400
+ value: x.id,
3383
3401
  children: [
3384
- F(s, m),
3385
- m.tabTitle || m.title,
3386
- s.activeCardId === m.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3402
+ T(s, x),
3403
+ x.tabTitle || x.title,
3404
+ s.activeCardId === x.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3387
3405
  Sa,
3388
3406
  {
3389
3407
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
3390
- onClick: () => N(m.id)
3408
+ onClick: () => N(x.id)
3391
3409
  }
3392
3410
  )
3393
3411
  ]
3394
3412
  }
3395
3413
  )
3396
3414
  },
3397
- m.id
3415
+ x.id
3398
3416
  )),
3399
3417
  /* @__PURE__ */ e.jsx(
3400
3418
  O,
@@ -3411,7 +3429,7 @@ function sa() {
3411
3429
  className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
3412
3430
  variant: "outline",
3413
3431
  onClick: p,
3414
- children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4" })
3432
+ children: /* @__PURE__ */ e.jsx(On, { className: "h-4 w-4" })
3415
3433
  }
3416
3434
  )
3417
3435
  ] }) })
@@ -3420,8 +3438,8 @@ function sa() {
3420
3438
  );
3421
3439
  }
3422
3440
  function A() {
3423
- 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(Qt, { card: n, data: c == null ? void 0 : c.records }) }) }) : 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(fe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3424
- Jt,
3441
+ 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(Jt, { card: n, data: c == null ? void 0 : c.records }) }) }) : 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(fe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3442
+ Wt,
3425
3443
  {
3426
3444
  isLoading: t,
3427
3445
  card: n,
@@ -3433,13 +3451,13 @@ function sa() {
3433
3451
  (b || g) && /* @__PURE__ */ e.jsx(Ae, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3434
3452
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3435
3453
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3436
- /* @__PURE__ */ e.jsx(Il, {}),
3437
- !["table", "custom"].includes(n.type) && /* @__PURE__ */ e.jsx(Ol, {}),
3438
- /* @__PURE__ */ e.jsx(Tl, {})
3454
+ /* @__PURE__ */ e.jsx(Fl, {}),
3455
+ !["table", "custom"].includes(n.type) && /* @__PURE__ */ e.jsx(Ml, {}),
3456
+ /* @__PURE__ */ e.jsx(El, {})
3439
3457
  ] }),
3440
- /* @__PURE__ */ e.jsx(El, {})
3458
+ /* @__PURE__ */ e.jsx(Al, {})
3441
3459
  ] }),
3442
- a ? T() : /* @__PURE__ */ e.jsxs(
3460
+ a ? F() : /* @__PURE__ */ e.jsxs(
3443
3461
  ss,
3444
3462
  {
3445
3463
  className: "px-6",
@@ -3454,7 +3472,7 @@ function sa() {
3454
3472
  defaultSize: 30,
3455
3473
  minSize: 10,
3456
3474
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3457
- children: r && /* @__PURE__ */ e.jsx(Ll, {})
3475
+ children: r && /* @__PURE__ */ e.jsx(Vl, {})
3458
3476
  }
3459
3477
  ),
3460
3478
  /* @__PURE__ */ e.jsx(as, {})
@@ -3467,7 +3485,7 @@ function sa() {
3467
3485
  minSize: 10,
3468
3486
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3469
3487
  children: /* @__PURE__ */ e.jsxs(fe, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
3470
- (c == null ? void 0 : c.records) && (c == null ? void 0 : c.records.length) > 0 && /* @__PURE__ */ e.jsx(Nl, { data: (c == null ? void 0 : c.records) || [] }),
3488
+ (c == null ? void 0 : c.records) && (c == null ? void 0 : c.records.length) > 0 && /* @__PURE__ */ e.jsx(wl, { data: (c == null ? void 0 : c.records) || [] }),
3471
3489
  l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: l }),
3472
3490
  /* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
3473
3491
  ] })
@@ -3478,7 +3496,7 @@ function sa() {
3478
3496
  )
3479
3497
  ] });
3480
3498
  }
3481
- function Ll() {
3499
+ function Vl() {
3482
3500
  const s = u((a) => a.pythonStdOut);
3483
3501
  if (!s) return null;
3484
3502
  const n = s.replace(/\n/g, "<br>");
@@ -3490,14 +3508,14 @@ function Ll() {
3490
3508
  ] })
3491
3509
  ] });
3492
3510
  }
3493
- function El() {
3511
+ function Al() {
3494
3512
  const s = u((a) => a.isShowingVisual), n = u(
3495
3513
  (a) => a.actions.setIsShowingVisual
3496
3514
  );
3497
3515
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3498
3516
  /* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
3499
3517
  /* @__PURE__ */ e.jsx(
3500
- Wt,
3518
+ Yt,
3501
3519
  {
3502
3520
  checked: s,
3503
3521
  onCheckedChange: () => n(!s),
@@ -3507,7 +3525,7 @@ function El() {
3507
3525
  )
3508
3526
  ] });
3509
3527
  }
3510
- function Vl({
3528
+ function ql({
3511
3529
  options: s,
3512
3530
  value: n,
3513
3531
  onValueChange: a
@@ -3543,7 +3561,7 @@ function de({
3543
3561
  ),
3544
3562
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3545
3563
  /* @__PURE__ */ e.jsx(pe, { children: s }),
3546
- n.map((r) => /* @__PURE__ */ e.jsx(Z, { value: r.value, children: r.label }, r.value))
3564
+ n.map((r) => /* @__PURE__ */ e.jsx(X, { value: r.value, children: r.label }, r.value))
3547
3565
  ] }) })
3548
3566
  ] });
3549
3567
  }
@@ -3568,13 +3586,13 @@ function Pe({
3568
3586
  }
3569
3587
  );
3570
3588
  }
3571
- function Al() {
3589
+ function Rl() {
3572
3590
  var p, N;
3573
3591
  const s = u(
3574
3592
  (y) => y.card.customCardPreferences
3575
3593
  ), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((y) => y.card), l = u((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: o } = te(), { components: i, manifest: d } = ga(
3576
3594
  (s == null ? void 0 : s.url) || ""
3577
- ), x = (p = d == null ? void 0 : d.visuals) == null ? void 0 : p.find(
3595
+ ), m = (p = d == null ? void 0 : d.visuals) == null ? void 0 : p.find(
3578
3596
  (y) => y.name === (s == null ? void 0 : s.componentName)
3579
3597
  );
3580
3598
  function c(y, V) {
@@ -3593,50 +3611,50 @@ function Al() {
3593
3611
  }
3594
3612
  function b(y) {
3595
3613
  var I, z;
3596
- const V = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((F) => {
3597
- var T;
3598
- return ((T = F == null ? void 0 : F.customCardPreferences) == null ? void 0 : T.visualType) !== "multiple";
3599
- }).map((F) => ({
3600
- value: F.id,
3601
- label: F.tabTitle || F.title
3614
+ const V = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((T) => {
3615
+ var F;
3616
+ return ((F = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : F.visualType) !== "multiple";
3617
+ }).map((T) => ({
3618
+ value: T.id,
3619
+ label: T.tabTitle || T.title
3602
3620
  }));
3603
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (z = y == null ? void 0 : y.dataInputs) == null ? void 0 : z.map((F, T) => {
3604
- var A, m;
3621
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (z = y == null ? void 0 : y.dataInputs) == null ? void 0 : z.map((T, F) => {
3622
+ var A, x;
3605
3623
  return /* @__PURE__ */ e.jsxs(
3606
3624
  "div",
3607
3625
  {
3608
3626
  className: "grid grid-cols-10 gap-2",
3609
3627
  children: [
3610
- /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: F }),
3628
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: T }),
3611
3629
  /* @__PURE__ */ e.jsx(
3612
3630
  de,
3613
3631
  {
3614
3632
  className: "col-span-6 h-8 w-full justify-between",
3615
3633
  label: "",
3616
3634
  options: V || [],
3617
- value: ((m = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[T]) == null ? void 0 : m.cardId) || "",
3618
- onValueChange: (v) => c(T, v)
3635
+ value: ((x = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[F]) == null ? void 0 : x.cardId) || "",
3636
+ onValueChange: (v) => c(F, v)
3619
3637
  }
3620
3638
  )
3621
3639
  ]
3622
3640
  },
3623
- T + Math.random()
3641
+ F + Math.random()
3624
3642
  );
3625
3643
  }) });
3626
3644
  }
3627
3645
  function g(y, V, I = []) {
3628
- var z, F;
3646
+ var z, T;
3629
3647
  return s ? y === "input" ? /* @__PURE__ */ e.jsx(
3630
3648
  ie,
3631
3649
  {
3632
3650
  className: `h-8 w-full ${$e}`,
3633
3651
  value: ((z = s == null ? void 0 : s.settings) == null ? void 0 : z[V]) || "",
3634
- onChange: (T) => {
3652
+ onChange: (F) => {
3635
3653
  o({
3636
3654
  ...s,
3637
3655
  settings: {
3638
3656
  ...s == null ? void 0 : s.settings,
3639
- [V]: T.target.value
3657
+ [V]: F.target.value
3640
3658
  }
3641
3659
  });
3642
3660
  }
@@ -3648,11 +3666,11 @@ function Al() {
3648
3666
  className: "h-8 w-full",
3649
3667
  label: "",
3650
3668
  options: I,
3651
- value: ((F = s == null ? void 0 : s.settings) == null ? void 0 : F[V]) || "",
3652
- onValueChange: (T) => {
3669
+ value: ((T = s == null ? void 0 : s.settings) == null ? void 0 : T[V]) || "",
3670
+ onValueChange: (F) => {
3653
3671
  o({
3654
3672
  ...s,
3655
- settings: { ...s == null ? void 0 : s.settings, [V]: T }
3673
+ settings: { ...s == null ? void 0 : s.settings, [V]: F }
3656
3674
  });
3657
3675
  }
3658
3676
  }
@@ -3699,7 +3717,7 @@ function Al() {
3699
3717
  }
3700
3718
  ) }) }),
3701
3719
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
3702
- Vl,
3720
+ ql,
3703
3721
  {
3704
3722
  options: [
3705
3723
  { value: "single", label: "Single Visual" },
@@ -3735,11 +3753,11 @@ function Al() {
3735
3753
  ] }) }) }),
3736
3754
  /* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
3737
3755
  ((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs(Pe, { summary: "Component Settings", children: [
3738
- x && x.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3756
+ m && m.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3739
3757
  /* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
3740
- /* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(x) })
3758
+ /* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(m) })
3741
3759
  ] }),
3742
- x && x.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: h(x) }) })
3760
+ m && m.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: h(m) }) })
3743
3761
  ] })
3744
3762
  ]
3745
3763
  }
@@ -3758,7 +3776,7 @@ function Ie() {
3758
3776
  var b;
3759
3777
  return (b = c.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
3760
3778
  }
3761
- ), X(() => {
3779
+ ), Z(() => {
3762
3780
  o && n(new Array(o.length).fill(!1));
3763
3781
  }, [o]);
3764
3782
  function i(c, b) {
@@ -3801,7 +3819,7 @@ function Ie() {
3801
3819
  onClickFilter: g
3802
3820
  });
3803
3821
  }
3804
- function x(c) {
3822
+ function m(c) {
3805
3823
  var b, g, h, f;
3806
3824
  if (s != null && s[c] || (g = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((p) => p.columnIndex === c)) != null && g.expression)
3807
3825
  return /* @__PURE__ */ e.jsx(
@@ -3856,7 +3874,7 @@ function Ie() {
3856
3874
  }
3857
3875
  ) })
3858
3876
  ] }),
3859
- x(b)
3877
+ m(b)
3860
3878
  ] })
3861
3879
  },
3862
3880
  c
@@ -3866,12 +3884,12 @@ function Ie() {
3866
3884
  }
3867
3885
  function xs() {
3868
3886
  var o, i, d;
3869
- const s = u((x) => x.card.preferences), n = u(
3870
- (x) => x.card.cfg
3871
- ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = u((x) => x.actions);
3887
+ const s = u((m) => m.card.preferences), n = u(
3888
+ (m) => m.card.cfg
3889
+ ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = u((m) => m.actions);
3872
3890
  (o = n == null ? void 0 : n.options) != null && o.indexAxis;
3873
- function r(x) {
3874
- l(x);
3891
+ function r(m) {
3892
+ l(m);
3875
3893
  }
3876
3894
  return /* @__PURE__ */ e.jsxs(
3877
3895
  ms,
@@ -3899,7 +3917,7 @@ function aa(s, n) {
3899
3917
  const a = wa(s, n);
3900
3918
  return ((r = (l = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : l[a]) == null ? void 0 : r.type) || "linear";
3901
3919
  }
3902
- function Za() {
3920
+ function Xa() {
3903
3921
  var ee, G, se, k, $, U;
3904
3922
  const [s, n] = q(!1), a = u((E) => {
3905
3923
  var L;
@@ -3911,21 +3929,21 @@ function Za() {
3911
3929
  aa(a)
3912
3930
  ), [i, d] = q(
3913
3931
  ((se = (G = (ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : G[l]) == null ? void 0 : se.min) || ""
3914
- ), [x, c] = q(
3932
+ ), [m, c] = q(
3915
3933
  ((U = ($ = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : $[l]) == null ? void 0 : U.max) || ""
3916
- ), [b, g] = q(i || x ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y, V] = q(""), [I, z] = q(""), [F, T] = q(""), A = u(
3934
+ ), [b, g] = q(i || m ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y, V] = q(""), [I, z] = q(""), [T, F] = q(""), A = u(
3917
3935
  (E) => E.actions.setCardPreferences
3918
- ), { updateCardInFrame: m } = te(), v = u((E) => E.card), j = u((E) => {
3936
+ ), { updateCardInFrame: x } = te(), v = u((E) => E.card), j = u((E) => {
3919
3937
  var L;
3920
3938
  return (L = E.card) == null ? void 0 : L.type;
3921
3939
  }), D = ["pie", "doughnut", "polarArea"].includes(j);
3922
- X(() => {
3923
- var E, L, re, B, ae, ne, je, Fe, we, Te, Le, Ee, Ve, w;
3940
+ Z(() => {
3941
+ var E, L, re, B, ae, ne, je, Te, we, Fe, Le, Ee, Ve, w;
3924
3942
  o(aa(a)), d(
3925
3943
  ((re = (L = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : L[l]) == null ? void 0 : re.min) === 0 ? 0 : ""
3926
3944
  ), c(((ne = (ae = (B = a == null ? void 0 : a.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : ae[l]) == null ? void 0 : ne.max) || ""), f(
3927
- ((Te = (we = (Fe = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : Fe[l]) == null ? void 0 : we.ticks) == null ? void 0 : Te.stepSize) || ""
3928
- ), N(((Le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Le.decimalPlaces) || 0), V(((Ee = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ee.suffix) || ""), z(((Ve = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ve.currency) || ""), T(((w = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : w.locale) || "");
3945
+ ((Fe = (we = (Te = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : Te[l]) == null ? void 0 : we.ticks) == null ? void 0 : Fe.stepSize) || ""
3946
+ ), N(((Le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Le.decimalPlaces) || 0), V(((Ee = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ee.suffix) || ""), z(((Ve = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ve.currency) || ""), F(((w = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : w.locale) || "");
3929
3947
  }, [s, a, l]);
3930
3948
  function S(E, L) {
3931
3949
  return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(E);
@@ -3960,13 +3978,13 @@ function Za() {
3960
3978
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
3961
3979
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3962
3980
  /* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
3963
- /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }),
3964
- E.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L, children: L }, L))
3981
+ /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
3982
+ E.map((L) => /* @__PURE__ */ e.jsx(X, { value: L, children: L }, L))
3965
3983
  ] }) })
3966
3984
  ]
3967
3985
  }
3968
3986
  ),
3969
- /* @__PURE__ */ e.jsxs(ue, { value: F, onValueChange: (L) => T(L), children: [
3987
+ /* @__PURE__ */ e.jsxs(ue, { value: T, onValueChange: (L) => F(L), children: [
3970
3988
  /* @__PURE__ */ e.jsx(
3971
3989
  he,
3972
3990
  {
@@ -3976,7 +3994,7 @@ function Za() {
3976
3994
  ),
3977
3995
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3978
3996
  /* @__PURE__ */ e.jsx(pe, { children: "Locale" }),
3979
- ts.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L.locale, children: L.locale }, L.locale))
3997
+ ts.map((L) => /* @__PURE__ */ e.jsx(X, { value: L.locale, children: L.locale }, L.locale))
3980
3998
  ] }) })
3981
3999
  ] })
3982
4000
  ] }),
@@ -4010,7 +4028,7 @@ function Za() {
4010
4028
  /* @__PURE__ */ e.jsx(
4011
4029
  ie,
4012
4030
  {
4013
- value: x,
4031
+ value: m,
4014
4032
  onChange: (E) => c((L) => S(L, E.target.value)),
4015
4033
  id: "max",
4016
4034
  className: `col-span-1 h-8 w-full ${We}`
@@ -4036,7 +4054,7 @@ function Za() {
4036
4054
  let E = {};
4037
4055
  b === "custom" && (E = {
4038
4056
  min: i,
4039
- max: x,
4057
+ max: m,
4040
4058
  ticks: {
4041
4059
  stepSize: h
4042
4060
  }
@@ -4058,7 +4076,7 @@ function Za() {
4058
4076
  decimalPlaces: p,
4059
4077
  suffix: y,
4060
4078
  currency: I,
4061
- locale: F
4079
+ locale: T
4062
4080
  }
4063
4081
  };
4064
4082
  console.log(L), A(L);
@@ -4066,10 +4084,10 @@ function Za() {
4066
4084
  ...v,
4067
4085
  preferences: L
4068
4086
  };
4069
- m(re);
4087
+ x(re);
4070
4088
  }
4071
4089
  return /* @__PURE__ */ e.jsxs(ds, { onOpenChange: (E) => n(E), children: [
4072
- /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(Xt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4090
+ /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(en, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4073
4091
  /* @__PURE__ */ e.jsx(hs, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
4074
4092
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4075
4093
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
@@ -4088,8 +4106,8 @@ function Za() {
4088
4106
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4089
4107
  /* @__PURE__ */ e.jsx(xe, { id: "type", children: /* @__PURE__ */ e.jsxs(ve, { children: [
4090
4108
  /* @__PURE__ */ e.jsx(pe, { children: "Option" }),
4091
- /* @__PURE__ */ e.jsx(Z, { value: "linear", children: "Linear" }),
4092
- /* @__PURE__ */ e.jsx(Z, { value: "logarithmic", children: "Logarithmic" })
4109
+ /* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
4110
+ /* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
4093
4111
  ] }) })
4094
4112
  ]
4095
4113
  }
@@ -4121,7 +4139,7 @@ function Za() {
4121
4139
  ] }),
4122
4140
  b === "custom" && r == "linear" && P(),
4123
4141
  _(),
4124
- /* @__PURE__ */ e.jsx(en, {}),
4142
+ /* @__PURE__ */ e.jsx(sn, {}),
4125
4143
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
4126
4144
  O,
4127
4145
  {
@@ -4135,21 +4153,21 @@ function Za() {
4135
4153
  ] }) })
4136
4154
  ] });
4137
4155
  }
4138
- function ql({ idx: s }) {
4156
+ function _l({ idx: s }) {
4139
4157
  var i;
4140
4158
  const n = u((d) => {
4141
- var x;
4142
- return (x = d.card) == null ? void 0 : x.preferences;
4159
+ var m;
4160
+ return (m = d.card) == null ? void 0 : m.preferences;
4143
4161
  }), a = u(
4144
4162
  (d) => {
4145
- var x;
4146
- return (x = d.card.preferences) == null ? void 0 : x.datasetOptions;
4163
+ var m;
4164
+ return (m = d.card.preferences) == null ? void 0 : m.datasetOptions;
4147
4165
  }
4148
4166
  ), t = u(
4149
4167
  (d) => d.actions.setCardPreferences
4150
4168
  ), l = (i = n == null ? void 0 : n.chartOptions) == null ? void 0 : i.indexAxis, r = a == null ? void 0 : a.find((d) => d.idx === s);
4151
- function o(d, x) {
4152
- (d === "end" || d === "start") && sn(an());
4169
+ function o(d, m) {
4170
+ (d === "end" || d === "start") && an(tn());
4153
4171
  const c = {
4154
4172
  display: d !== "none",
4155
4173
  align: d,
@@ -4162,7 +4180,7 @@ function ql({ idx: s }) {
4162
4180
  datasetOptions: [
4163
4181
  ...a || [],
4164
4182
  {
4165
- idx: x,
4183
+ idx: m,
4166
4184
  datalabels: c
4167
4185
  }
4168
4186
  ]
@@ -4171,7 +4189,7 @@ function ql({ idx: s }) {
4171
4189
  const b = { ...r };
4172
4190
  b.datalabels = c;
4173
4191
  const g = a == null ? void 0 : a.map(
4174
- (h) => h.idx === x ? b : h
4192
+ (h) => h.idx === m ? b : h
4175
4193
  );
4176
4194
  t({
4177
4195
  ...n,
@@ -4180,7 +4198,7 @@ function ql({ idx: s }) {
4180
4198
  }
4181
4199
  }
4182
4200
  return /* @__PURE__ */ e.jsxs(ds, { children: [
4183
- /* @__PURE__ */ e.jsx(us, { children: /* @__PURE__ */ e.jsx(Kn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4201
+ /* @__PURE__ */ e.jsx(us, { children: /* @__PURE__ */ e.jsx(Qn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4184
4202
  /* @__PURE__ */ e.jsx(hs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4185
4203
  /* @__PURE__ */ e.jsx(
4186
4204
  O,
@@ -4200,7 +4218,7 @@ function ql({ idx: s }) {
4200
4218
  variant: "secondary",
4201
4219
  className: "h-7 p-1 text-xs font-normal",
4202
4220
  children: /* @__PURE__ */ e.jsx(
4203
- Vn,
4221
+ An,
4204
4222
  {
4205
4223
  className: Y("h-4 w-4", {
4206
4224
  "rotate-90": l === "y"
@@ -4217,7 +4235,7 @@ function ql({ idx: s }) {
4217
4235
  variant: "secondary",
4218
4236
  className: "h-7 p-1 text-xs font-normal",
4219
4237
  children: /* @__PURE__ */ e.jsx(
4220
- qn,
4238
+ Rn,
4221
4239
  {
4222
4240
  className: Y("h-4 w-4", {
4223
4241
  "rotate-90": l === "y"
@@ -4234,7 +4252,7 @@ function ql({ idx: s }) {
4234
4252
  variant: "secondary",
4235
4253
  className: "h-7 p-1 text-xs font-normal",
4236
4254
  children: /* @__PURE__ */ e.jsx(
4237
- An,
4255
+ qn,
4238
4256
  {
4239
4257
  className: Y("h-4 w-4", {
4240
4258
  "rotate-90": l === "y"
@@ -4246,11 +4264,11 @@ function ql({ idx: s }) {
4246
4264
  ] }) })
4247
4265
  ] });
4248
4266
  }
4249
- function Xa() {
4250
- const s = u((x) => x.card), n = u(
4251
- (x) => {
4267
+ function Za() {
4268
+ const s = u((m) => m.card), n = u(
4269
+ (m) => {
4252
4270
  var c, b, g;
4253
- return (g = (b = (c = x == null ? void 0 : x.card) == null ? void 0 : c.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : g.indexAxis;
4271
+ return (g = (b = (c = m == null ? void 0 : m.card) == null ? void 0 : c.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : g.indexAxis;
4254
4272
  }
4255
4273
  ), { data: a } = De(s), t = n === "y" ? "Y axis" : "X axis", l = n === "y" ? "X axis" : "Y axis", {
4256
4274
  keys: r,
@@ -4259,12 +4277,12 @@ function Xa() {
4259
4277
  } = js((a == null ? void 0 : a.records) || []);
4260
4278
  let d = o;
4261
4279
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4262
- const x = tn({
4280
+ const m = nn({
4263
4281
  dataArray: (a == null ? void 0 : a.records) || [],
4264
4282
  groupKey: i[0],
4265
4283
  pivotKey: i[1],
4266
4284
  valueKey: d[0]
4267
- }), { metricKeys: c } = js(x);
4285
+ }), { metricKeys: c } = js(m);
4268
4286
  d = c;
4269
4287
  }
4270
4288
  return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
@@ -4275,13 +4293,13 @@ function Xa() {
4275
4293
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4276
4294
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
4277
4295
  /* @__PURE__ */ e.jsx(H, { children: l }),
4278
- /* @__PURE__ */ e.jsx(Za, {})
4296
+ /* @__PURE__ */ e.jsx(Xa, {})
4279
4297
  ] }),
4280
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((x, c) => /* @__PURE__ */ e.jsx(Rl, { col: x, idx: c }, x)) })
4298
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((m, c) => /* @__PURE__ */ e.jsx(Hl, { col: m, idx: c }, m)) })
4281
4299
  ] })
4282
4300
  ] });
4283
4301
  }
4284
- function Rl({ col: s, idx: n }) {
4302
+ function Hl({ col: s, idx: n }) {
4285
4303
  const a = u((i) => {
4286
4304
  var d;
4287
4305
  return (d = i.card) == null ? void 0 : d.preferences;
@@ -4307,12 +4325,12 @@ function Rl({ col: s, idx: n }) {
4307
4325
  else {
4308
4326
  const d = { ...l };
4309
4327
  d.type = i === "area" ? "line" : i, d.fill = i === "area" ? "origin" : "";
4310
- const x = t == null ? void 0 : t.map(
4328
+ const m = t == null ? void 0 : t.map(
4311
4329
  (c) => c.idx === n ? d : c
4312
4330
  );
4313
4331
  r({
4314
4332
  ...a,
4315
- datasetOptions: x
4333
+ datasetOptions: m
4316
4334
  });
4317
4335
  }
4318
4336
  }
@@ -4334,34 +4352,34 @@ function Rl({ col: s, idx: n }) {
4334
4352
  }
4335
4353
  ),
4336
4354
  /* @__PURE__ */ e.jsx(
4337
- wn,
4355
+ kn,
4338
4356
  {
4339
4357
  onClick: () => o("area"),
4340
4358
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4341
4359
  }
4342
4360
  ),
4343
- /* @__PURE__ */ e.jsx(ql, { idx: n })
4361
+ /* @__PURE__ */ e.jsx(_l, { idx: n })
4344
4362
  ] })
4345
4363
  ] });
4346
4364
  }
4347
4365
  function et() {
4348
- const s = u((g) => g.selectedConnectionId), n = u((g) => g.selectedDatamodelId), a = u((g) => g.selectedDatabaseName), t = u((g) => g.selectedSchemaName), l = u((g) => g.selectedTableName), r = M((g) => g.dashboard.filters) || [], o = M((g) => g.actions.addFilter), i = M((g) => g.actions.removeFilter), { removeFilterValues: d } = is(), { modelItems: x, tableName: c } = qe();
4366
+ const s = u((g) => g.selectedConnectionId), n = u((g) => g.selectedDatamodelId), a = u((g) => g.selectedDatabaseName), t = u((g) => g.selectedSchemaName), l = u((g) => g.selectedTableName), r = M((g) => g.dashboard.filters) || [], o = M((g) => g.actions.addFilter), i = M((g) => g.actions.removeFilter), { removeFilterValues: d } = is(), { modelItems: m, tableName: c } = qe();
4349
4367
  function b(g, h = "dashboard") {
4350
- var T;
4368
+ var F;
4351
4369
  const f = ce(g.column_name), p = ce(a || ""), N = ce(t || ""), y = ce(c);
4352
4370
  let V = xa(
4353
4371
  N,
4354
4372
  y
4355
4373
  ), I = `${V}.${f}`;
4356
- const z = (T = x == null ? void 0 : x.find(
4374
+ const z = (F = m == null ? void 0 : m.find(
4357
4375
  (A) => A.id === n
4358
- )) == null ? void 0 : T.name;
4376
+ )) == null ? void 0 : F.name;
4359
4377
  n && n !== "none" && (I = `${gs}.${z}.${f}`, V = `${gs}.${z}`);
4360
- const F = r == null ? void 0 : r.find(
4378
+ const T = r == null ? void 0 : r.find(
4361
4379
  (A) => A.column === I && A.table === y && (A.database === p || A.database === a)
4362
4380
  );
4363
- if (F)
4364
- d(F.id), i(F.id);
4381
+ if (T)
4382
+ d(T.id), i(T.id);
4365
4383
  else {
4366
4384
  const A = Ue();
4367
4385
  return c === "api" && s ? (o({
@@ -4416,11 +4434,11 @@ function Re() {
4416
4434
  const o = s == null ? void 0 : s.find((i) => i.id === n.filterId);
4417
4435
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4418
4436
  /* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
4419
- /* @__PURE__ */ e.jsx(_l, { onSelect: r, columns: t }),
4437
+ /* @__PURE__ */ e.jsx($l, { onSelect: r, columns: t }),
4420
4438
  o && /* @__PURE__ */ e.jsx(ka, { filter: o })
4421
4439
  ] });
4422
4440
  }
4423
- function _l({
4441
+ function $l({
4424
4442
  columns: s,
4425
4443
  onSelect: n
4426
4444
  }) {
@@ -4437,21 +4455,21 @@ function _l({
4437
4455
  className: "w-full justify-between font-normal",
4438
4456
  children: [
4439
4457
  l ? (o = s.find((i) => i.column_name === l)) == null ? void 0 : o.column_name : "Select Column...",
4440
- /* @__PURE__ */ e.jsx(nn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4458
+ /* @__PURE__ */ e.jsx(ln, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4441
4459
  ]
4442
4460
  }
4443
4461
  ) }),
4444
- /* @__PURE__ */ e.jsx(hs, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(ln, { children: [
4445
- /* @__PURE__ */ e.jsx(rn, { placeholder: "Search column", className: "h-9" }),
4446
- /* @__PURE__ */ e.jsxs(on, { children: [
4447
- /* @__PURE__ */ e.jsx(cn, { children: "No framework found." }),
4448
- /* @__PURE__ */ e.jsx(dn, { children: s.map((i) => /* @__PURE__ */ e.jsxs(
4449
- un,
4462
+ /* @__PURE__ */ e.jsx(hs, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(rn, { children: [
4463
+ /* @__PURE__ */ e.jsx(on, { placeholder: "Search column", className: "h-9" }),
4464
+ /* @__PURE__ */ e.jsxs(cn, { children: [
4465
+ /* @__PURE__ */ e.jsx(dn, { children: "No framework found." }),
4466
+ /* @__PURE__ */ e.jsx(un, { children: s.map((i) => /* @__PURE__ */ e.jsxs(
4467
+ hn,
4450
4468
  {
4451
4469
  value: i.column_name,
4452
4470
  onSelect: (d) => {
4453
- const x = d === l ? "" : d;
4454
- r(x), t(!1), x && n(i);
4471
+ const m = d === l ? "" : d;
4472
+ r(m), t(!1), m && n(i);
4455
4473
  },
4456
4474
  children: [
4457
4475
  i.column_name,
@@ -4472,7 +4490,7 @@ function _l({
4472
4490
  ] }) })
4473
4491
  ] });
4474
4492
  }
4475
- function Hl({
4493
+ function Pl({
4476
4494
  cardType: s
4477
4495
  }) {
4478
4496
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
@@ -4505,7 +4523,7 @@ function Hl({
4505
4523
  /* @__PURE__ */ e.jsx(J, { children: "Settings" }),
4506
4524
  /* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
4507
4525
  /* @__PURE__ */ e.jsx(xs, {}),
4508
- /* @__PURE__ */ e.jsx(Xa, {})
4526
+ /* @__PURE__ */ e.jsx(Za, {})
4509
4527
  ] })
4510
4528
  ] }),
4511
4529
  /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
@@ -4531,7 +4549,7 @@ function Hs() {
4531
4549
  anchor: i,
4532
4550
  clamp: !0
4533
4551
  }
4534
- }, x = {
4552
+ }, m = {
4535
4553
  ...s,
4536
4554
  options: {
4537
4555
  ...s == null ? void 0 : s.options,
@@ -4541,12 +4559,12 @@ function Hs() {
4541
4559
  }
4542
4560
  }
4543
4561
  };
4544
- n(x), console.log(i);
4562
+ n(m), console.log(i);
4545
4563
  }
4546
4564
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4547
4565
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
4548
4566
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
4549
- !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Za, {})
4567
+ !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Xa, {})
4550
4568
  ] }),
4551
4569
  /* @__PURE__ */ e.jsxs(
4552
4570
  ue,
@@ -4558,17 +4576,17 @@ function Hs() {
4558
4576
  /* @__PURE__ */ e.jsx(he, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, { placeholder: "Select position" }) }),
4559
4577
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4560
4578
  /* @__PURE__ */ e.jsx(pe, { children: "Data Labels" }),
4561
- /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }),
4562
- a !== "pyramid" && /* @__PURE__ */ e.jsx(Z, { value: "start", children: "Start" }),
4563
- /* @__PURE__ */ e.jsx(Z, { value: "center", children: "Center" }),
4564
- a !== "pyramid" && /* @__PURE__ */ e.jsx(Z, { value: "end", children: "End" })
4579
+ /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
4580
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
4581
+ /* @__PURE__ */ e.jsx(X, { value: "center", children: "Center" }),
4582
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "end", children: "End" })
4565
4583
  ] }) })
4566
4584
  ]
4567
4585
  }
4568
4586
  )
4569
4587
  ] });
4570
4588
  }
4571
- function $l({
4589
+ function Bl({
4572
4590
  cardType: s
4573
4591
  }) {
4574
4592
  function n(a) {
@@ -4615,7 +4633,7 @@ function $l({
4615
4633
  ] })
4616
4634
  ] }) });
4617
4635
  }
4618
- const Pl = {
4636
+ const Ul = {
4619
4637
  datasets: [
4620
4638
  {
4621
4639
  type: "line",
@@ -4628,7 +4646,7 @@ const Pl = {
4628
4646
  data: []
4629
4647
  }
4630
4648
  ]
4631
- }, Bl = {
4649
+ }, Gl = {
4632
4650
  datasets: [
4633
4651
  {
4634
4652
  fill: "origin",
@@ -4638,7 +4656,7 @@ const Pl = {
4638
4656
  }
4639
4657
  ]
4640
4658
  };
4641
- function Ul() {
4659
+ function Kl() {
4642
4660
  const s = u((n) => n.card.type);
4643
4661
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4644
4662
  /* @__PURE__ */ e.jsx(
@@ -4647,7 +4665,7 @@ function Ul() {
4647
4665
  className: " ",
4648
4666
  type: "single",
4649
4667
  collapsible: !0,
4650
- children: Gl(s)
4668
+ children: Ql(s)
4651
4669
  }
4652
4670
  ),
4653
4671
  /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(xs, {}) }),
@@ -4658,7 +4676,7 @@ function Ul() {
4658
4676
  ] })
4659
4677
  ] });
4660
4678
  }
4661
- function Gl(s) {
4679
+ function Ql(s) {
4662
4680
  if (["line", "bar"].includes(s))
4663
4681
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4664
4682
  /* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
@@ -4679,7 +4697,7 @@ function Gl(s) {
4679
4697
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
4680
4698
  " and change the `type` property in the dataset."
4681
4699
  ] }),
4682
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Pl, null, 2) })
4700
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Ul, null, 2) })
4683
4701
  ] })
4684
4702
  ] }),
4685
4703
  /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
@@ -4700,7 +4718,7 @@ function Gl(s) {
4700
4718
  ),
4701
4719
  "for more options."
4702
4720
  ] }),
4703
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Bl, null, 2) })
4721
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gl, null, 2) })
4704
4722
  ] })
4705
4723
  ] })
4706
4724
  ] });
@@ -4755,8 +4773,8 @@ function Gl(s) {
4755
4773
  ] })
4756
4774
  ] }) });
4757
4775
  }
4758
- function Kl() {
4759
- var d, x, c, b, g;
4776
+ function Jl() {
4777
+ var d, m, c, b, g;
4760
4778
  const s = u((h) => h.card.preferences), n = u(
4761
4779
  (h) => h.actions.setCardPreferences
4762
4780
  ), a = u(
@@ -4809,7 +4827,7 @@ function Kl() {
4809
4827
  ),
4810
4828
  /* @__PURE__ */ e.jsx(H, { children: "Format Number" })
4811
4829
  ] }),
4812
- ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4830
+ ((m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4813
4831
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
4814
4832
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4815
4833
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
@@ -4831,8 +4849,8 @@ function Kl() {
4831
4849
  /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4832
4850
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4833
4851
  /* @__PURE__ */ e.jsx(pe, { children: "Format" }),
4834
- /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
4835
- ts.map((h) => /* @__PURE__ */ e.jsx(Z, { value: h.locale, children: h.locale }, h.locale))
4852
+ /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
4853
+ ts.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
4836
4854
  ] }) })
4837
4855
  ]
4838
4856
  }
@@ -4857,8 +4875,8 @@ function Kl() {
4857
4875
  /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4858
4876
  /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4859
4877
  /* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
4860
- /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
4861
- i.map((h) => /* @__PURE__ */ e.jsx(Z, { value: h, children: h }, h))
4878
+ /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
4879
+ i.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
4862
4880
  ] }) })
4863
4881
  ]
4864
4882
  }
@@ -4883,7 +4901,7 @@ function Kl() {
4883
4901
  },
4884
4902
  children: [
4885
4903
  /* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4886
- /* @__PURE__ */ e.jsx(xe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(Z, { value: h, children: h }, h)) })
4904
+ /* @__PURE__ */ e.jsx(xe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h)) })
4887
4905
  ]
4888
4906
  }
4889
4907
  )
@@ -4912,7 +4930,7 @@ function Kl() {
4912
4930
  ] }) }),
4913
4931
  /* @__PURE__ */ e.jsx(Ce, { className: "my-3" }),
4914
4932
  /* @__PURE__ */ e.jsx(
4915
- hn,
4933
+ mn,
4916
4934
  {
4917
4935
  colorRanges: r,
4918
4936
  setColorRanges: o
@@ -4921,7 +4939,7 @@ function Kl() {
4921
4939
  ] })
4922
4940
  ] });
4923
4941
  }
4924
- function Ql() {
4942
+ function Wl() {
4925
4943
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4926
4944
  /* @__PURE__ */ e.jsx(Me, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
4927
4945
  /* @__PURE__ */ e.jsx(J, { className: "", children: "KPI Query" }),
@@ -4947,12 +4965,12 @@ function Ql() {
4947
4965
  ] })
4948
4966
  ] })
4949
4967
  ] }) }),
4950
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Kl, {}) }),
4968
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Jl, {}) }),
4951
4969
  /* @__PURE__ */ e.jsx("div", {}),
4952
4970
  /* @__PURE__ */ e.jsx("div", {})
4953
4971
  ] });
4954
4972
  }
4955
- const Jl = [
4973
+ const Yl = [
4956
4974
  {
4957
4975
  label: "Mercator",
4958
4976
  value: "mercator"
@@ -5009,7 +5027,7 @@ const Jl = [
5009
5027
  label: "Natural Earth 1",
5010
5028
  value: "naturalEarth1"
5011
5029
  }
5012
- ], Wl = [
5030
+ ], Xl = [
5013
5031
  "blues",
5014
5032
  "brBG",
5015
5033
  "buGn",
@@ -5048,13 +5066,13 @@ const Jl = [
5048
5066
  "ylGnBu",
5049
5067
  "ylOrBr",
5050
5068
  "ylOrRd"
5051
- ], Yl = Wl.map((s) => ({
5069
+ ], Zl = Xl.map((s) => ({
5052
5070
  label: s,
5053
5071
  value: s
5054
5072
  }));
5055
- function Zl() {
5056
- var d, x, c, b, g, h, f, p, N, y, V, I, z, F, T, A, m, v;
5057
- const s = u((j) => j.card), n = (x = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, t] = q(
5073
+ function er() {
5074
+ var d, m, c, b, g, h, f, p, N, y, V, I, z, T, F, A, x, v;
5075
+ const s = u((j) => j.card), n = (m = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : m.topoJsonUrl, [a, t] = q(
5058
5076
  ((b = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
5059
5077
  ), { setCardPreferences: l } = te(), { data: r } = Es(s), o = Object.keys((r == null ? void 0 : r.objects) || {}).map((j) => ({
5060
5078
  label: j,
@@ -5145,7 +5163,7 @@ function Zl() {
5145
5163
  de,
5146
5164
  {
5147
5165
  className: "h-9",
5148
- options: Jl,
5166
+ options: Yl,
5149
5167
  value: ((p = (f = s.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : p.projection) || "",
5150
5168
  label: "Projection",
5151
5169
  onValueChange: (j) => {
@@ -5167,7 +5185,7 @@ function Zl() {
5167
5185
  de,
5168
5186
  {
5169
5187
  className: "h-9",
5170
- options: Yl,
5188
+ options: Zl,
5171
5189
  value: ((y = (N = s.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : y.colorScale) || "",
5172
5190
  label: "Select Color Scale",
5173
5191
  onValueChange: (j) => {
@@ -5213,7 +5231,7 @@ function Zl() {
5213
5231
  className: `h-9 w-full ${$e}`,
5214
5232
  type: "number",
5215
5233
  step: 10,
5216
- value: ((T = (F = (z = s.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : F.projectionOffset) == null ? void 0 : T[0]) || 0,
5234
+ value: ((F = (T = (z = s.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : F[0]) || 0,
5217
5235
  onChange: (j) => {
5218
5236
  var D, S, _, P;
5219
5237
  l({
@@ -5236,7 +5254,7 @@ function Zl() {
5236
5254
  className: `h-9 w-full ${$e}`,
5237
5255
  type: "number",
5238
5256
  step: 10,
5239
- value: ((v = (m = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : m.projectionOffset) == null ? void 0 : v[1]) || 0,
5257
+ value: ((v = (x = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : x.projectionOffset) == null ? void 0 : v[1]) || 0,
5240
5258
  onChange: (j) => {
5241
5259
  var D, S, _, P;
5242
5260
  l({
@@ -5257,7 +5275,7 @@ function Zl() {
5257
5275
  /* @__PURE__ */ e.jsx(Ie, {})
5258
5276
  ] });
5259
5277
  }
5260
- function Xl() {
5278
+ function sr() {
5261
5279
  var t;
5262
5280
  const s = u((l) => l.card.preferences), { setCardPreferences: n } = u((l) => l.actions);
5263
5281
  function a(l) {
@@ -5325,7 +5343,7 @@ function Ye({
5325
5343
  /* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
5326
5344
  s === "range" && /* @__PURE__ */ e.jsx(xs, {}),
5327
5345
  s !== "text" && /* @__PURE__ */ e.jsx(Hs, {}),
5328
- s === "text" && /* @__PURE__ */ e.jsx(Xl, {})
5346
+ s === "text" && /* @__PURE__ */ e.jsx(sr, {})
5329
5347
  ] })
5330
5348
  ] }),
5331
5349
  !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
@@ -5337,7 +5355,7 @@ function Ye({
5337
5355
  ] })
5338
5356
  ] }) });
5339
5357
  }
5340
- function er() {
5358
+ function ar() {
5341
5359
  const s = u(
5342
5360
  (t) => {
5343
5361
  var l, r;
@@ -5405,7 +5423,7 @@ function er() {
5405
5423
  /* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
5406
5424
  /* @__PURE__ */ e.jsx(xs, {}),
5407
5425
  a(),
5408
- /* @__PURE__ */ e.jsx(Xa, {})
5426
+ /* @__PURE__ */ e.jsx(Za, {})
5409
5427
  ] })
5410
5428
  ] }),
5411
5429
  /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
@@ -5417,7 +5435,7 @@ function er() {
5417
5435
  ] })
5418
5436
  ] }) });
5419
5437
  }
5420
- function sr({}) {
5438
+ function tr({}) {
5421
5439
  const s = u((t) => {
5422
5440
  var l;
5423
5441
  return (l = t.card) == null ? void 0 : l.preferences;
@@ -5450,7 +5468,7 @@ function sr({}) {
5450
5468
  ] })
5451
5469
  ] });
5452
5470
  }
5453
- const ar = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5471
+ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5454
5472
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
5455
5473
  /* @__PURE__ */ e.jsxs("div", { children: [
5456
5474
  "See ",
@@ -5466,7 +5484,7 @@ const ar = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5466
5484
  ),
5467
5485
  " in the docs."
5468
5486
  ] })
5469
- ] }), tr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5487
+ ] }), lr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5470
5488
  /* @__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" }),
5471
5489
  /* @__PURE__ */ e.jsxs("div", { children: [
5472
5490
  "See ",
@@ -5482,7 +5500,7 @@ const ar = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5482
5500
  ),
5483
5501
  " in the docs."
5484
5502
  ] })
5485
- ] }), nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5503
+ ] }), rr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5486
5504
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
5487
5505
  /* @__PURE__ */ e.jsxs("div", { children: [
5488
5506
  "See ",
@@ -5499,22 +5517,22 @@ const ar = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5499
5517
  " in the docs."
5500
5518
  ] })
5501
5519
  ] });
5502
- function lr() {
5520
+ function ir() {
5503
5521
  const s = u((a) => a.card.type);
5504
5522
  function n(a) {
5505
5523
  switch (a) {
5506
5524
  case "stackedBar":
5507
5525
  case "stackedLine":
5508
- return /* @__PURE__ */ e.jsx(er, {});
5526
+ return /* @__PURE__ */ e.jsx(ar, {});
5509
5527
  case "pyramid":
5510
- return /* @__PURE__ */ e.jsx(Ye, { docContent: ar, cardType: a });
5528
+ return /* @__PURE__ */ e.jsx(Ye, { docContent: nr, cardType: a });
5511
5529
  case "kpi":
5512
- return /* @__PURE__ */ e.jsx(Ql, {});
5530
+ return /* @__PURE__ */ e.jsx(Wl, {});
5513
5531
  case "line":
5514
5532
  case "bar":
5515
- return /* @__PURE__ */ e.jsx(Hl, { cardType: a });
5533
+ return /* @__PURE__ */ e.jsx(Pl, { cardType: a });
5516
5534
  case "range":
5517
- return /* @__PURE__ */ e.jsx(Ye, { docContent: tr, cardType: a });
5535
+ return /* @__PURE__ */ e.jsx(Ye, { docContent: lr, cardType: a });
5518
5536
  case "pie":
5519
5537
  case "doughnut":
5520
5538
  case "polarArea":
@@ -5522,29 +5540,29 @@ function lr() {
5522
5540
  return /* @__PURE__ */ e.jsx(Ye, { cardType: a });
5523
5541
  case "bubble":
5524
5542
  case "scatter":
5525
- return /* @__PURE__ */ e.jsx($l, { cardType: a });
5543
+ return /* @__PURE__ */ e.jsx(Bl, { cardType: a });
5526
5544
  case "table":
5527
- return /* @__PURE__ */ e.jsx(sr, { cardType: a });
5545
+ return /* @__PURE__ */ e.jsx(tr, { cardType: a });
5528
5546
  case "text":
5529
5547
  return /* @__PURE__ */ e.jsx(
5530
5548
  Ye,
5531
5549
  {
5532
- docContent: nr,
5550
+ docContent: rr,
5533
5551
  cardType: a,
5534
5552
  suffix: "Visual"
5535
5553
  }
5536
5554
  );
5537
5555
  case "map":
5538
- return /* @__PURE__ */ e.jsx(Zl, {});
5556
+ return /* @__PURE__ */ e.jsx(er, {});
5539
5557
  case "custom":
5540
- return /* @__PURE__ */ e.jsx(Al, {});
5558
+ return /* @__PURE__ */ e.jsx(Rl, {});
5541
5559
  default:
5542
- return /* @__PURE__ */ e.jsx(Ul, {});
5560
+ return /* @__PURE__ */ e.jsx(Kl, {});
5543
5561
  }
5544
5562
  }
5545
5563
  return /* @__PURE__ */ e.jsx(fe, { className: "h-full w-full text-sm", children: n(s) });
5546
5564
  }
5547
- function rr() {
5565
+ function or() {
5548
5566
  const s = u((n) => n.isShowingVisual);
5549
5567
  return /* @__PURE__ */ e.jsxs(
5550
5568
  ss,
@@ -5559,7 +5577,7 @@ function rr() {
5559
5577
  className: "flex",
5560
5578
  minSize: 20,
5561
5579
  defaultSize: 40,
5562
- children: /* @__PURE__ */ e.jsx(Cl, {})
5580
+ children: /* @__PURE__ */ e.jsx(Sl, {})
5563
5581
  }
5564
5582
  ),
5565
5583
  /* @__PURE__ */ e.jsx(as, { withHandle: !0, className: "border" }),
@@ -5578,7 +5596,7 @@ function rr() {
5578
5596
  minSize: 20,
5579
5597
  defaultSize: 25,
5580
5598
  maxSize: 30,
5581
- children: /* @__PURE__ */ e.jsx(lr, {})
5599
+ children: /* @__PURE__ */ e.jsx(ir, {})
5582
5600
  }
5583
5601
  ) }),
5584
5602
  /* @__PURE__ */ e.jsx(as, { className: "border" }),
@@ -5590,15 +5608,15 @@ function rr() {
5590
5608
  }
5591
5609
  );
5592
5610
  }
5593
- function ir({ authToken: s, onSave: n, onClose: a }) {
5611
+ function cr({ authToken: s, onSave: n, onClose: a }) {
5594
5612
  M((o) => o.themeStyle);
5595
5613
  const t = u((o) => o.actions.setOnSave), l = u((o) => o.actions.setOnClose), r = M((o) => o.actions.setAuthToken);
5596
- return X(() => {
5614
+ return Z(() => {
5597
5615
  n && t(n), a && l(a);
5598
- }, [n, t, a, l]), X(() => {
5616
+ }, [n, t, a, l]), Z(() => {
5599
5617
  s && s.accessToken && r(s);
5600
5618
  }, [s, r]), /* @__PURE__ */ e.jsx(cs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(
5601
- mn,
5619
+ xn,
5602
5620
  {
5603
5621
  style: {
5604
5622
  // borderRadius: currentStyle?.chart?.options?.borderRadius,
@@ -5607,13 +5625,13 @@ function ir({ authToken: s, onSave: n, onClose: a }) {
5607
5625
  className: "rounded-none",
5608
5626
  role: "editor-panel",
5609
5627
  children: [
5610
- /* @__PURE__ */ e.jsx(xn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
5611
- /* @__PURE__ */ e.jsx(pn, { children: /* @__PURE__ */ e.jsx(rr, {}) })
5628
+ /* @__PURE__ */ e.jsx(pn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
5629
+ /* @__PURE__ */ e.jsx(fn, { children: /* @__PURE__ */ e.jsx(or, {}) })
5612
5630
  ]
5613
5631
  }
5614
5632
  ) });
5615
5633
  }
5616
- function or() {
5634
+ function dr() {
5617
5635
  M((o) => o.selectedCardId);
5618
5636
  const s = M((o) => o.selectedSheetId), { setIsVisualEditing: n } = M((o) => o.actions), a = M((o) => o.isVisualEditing), t = M((o) => o.actions.updateFrame);
5619
5637
  function l(o) {
@@ -5629,11 +5647,11 @@ function or() {
5629
5647
  className: Y("flex grow", {
5630
5648
  "max-h-0 overflow-hidden": !a
5631
5649
  }),
5632
- children: /* @__PURE__ */ e.jsx(ir, { onSave: l, onClose: r })
5650
+ children: /* @__PURE__ */ e.jsx(cr, { onSave: l, onClose: r })
5633
5651
  }
5634
5652
  );
5635
5653
  }
5636
- function cr() {
5654
+ function ur() {
5637
5655
  const s = u((r) => r.selectedDatabaseName), n = u((r) => r.selectedTableName), a = M((r) => r.dashboard.filters) || [], { columns: t } = qe(), { assignFilter: l } = et();
5638
5656
  return /* @__PURE__ */ e.jsx(fe, { className: "flex-1 basis-0 flex-col px-3", children: t == null ? void 0 : t.map((r) => {
5639
5657
  const o = a == null ? void 0 : a.find(
@@ -5658,7 +5676,7 @@ function cr() {
5658
5676
  );
5659
5677
  }) });
5660
5678
  }
5661
- function dr() {
5679
+ function hr() {
5662
5680
  M((n) => n.showFilters);
5663
5681
  const s = M(
5664
5682
  (n) => n.actions.setShowFilters
@@ -5682,7 +5700,7 @@ function dr() {
5682
5700
  ColumnsComponent: () => (
5683
5701
  // schemaName, tableName, columns
5684
5702
  /* @__PURE__ */ e.jsx(
5685
- cr,
5703
+ ur,
5686
5704
  {}
5687
5705
  )
5688
5706
  )
@@ -5690,7 +5708,7 @@ function dr() {
5690
5708
  ) })
5691
5709
  ] });
5692
5710
  }
5693
- function ur() {
5711
+ function mr() {
5694
5712
  const s = M((t) => t.dashboard.filters), n = M((t) => t.theme), a = s == null ? void 0 : s.filter((t) => t.hide);
5695
5713
  return a != null && a.length ? /* @__PURE__ */ e.jsx(
5696
5714
  "div",
@@ -5713,7 +5731,7 @@ function ur() {
5713
5731
  }
5714
5732
  ) : null;
5715
5733
  }
5716
- function hr() {
5734
+ function xr() {
5717
5735
  const s = M((t) => t.showFilters), n = M((t) => t.isVisualEditing), a = M(
5718
5736
  (t) => t.isDashboardEditing
5719
5737
  );
@@ -5727,15 +5745,15 @@ function hr() {
5727
5745
  }),
5728
5746
  children: [
5729
5747
  /* @__PURE__ */ e.jsxs("section", { className: "flex grow flex-col", children: [
5730
- a && /* @__PURE__ */ e.jsx(ur, {}),
5731
- /* @__PURE__ */ e.jsx(fn, {})
5748
+ a && /* @__PURE__ */ e.jsx(mr, {}),
5749
+ /* @__PURE__ */ e.jsx(gn, {})
5732
5750
  ] }),
5733
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(dr, {}) })
5751
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hr, {}) })
5734
5752
  ]
5735
5753
  }
5736
5754
  );
5737
5755
  }
5738
- function mr() {
5756
+ function pr() {
5739
5757
  const s = M((t) => t.dashboard), n = M((t) => t.actions.setDashboard), a = M(
5740
5758
  (t) => t.showDashboardJSON
5741
5759
  );
@@ -5748,7 +5766,7 @@ function mr() {
5748
5766
  hidden: !a
5749
5767
  }),
5750
5768
  children: /* @__PURE__ */ e.jsx(
5751
- gn,
5769
+ jn,
5752
5770
  {
5753
5771
  onChange: (t) => {
5754
5772
  if (t)
@@ -5779,64 +5797,65 @@ function mr() {
5779
5797
  }
5780
5798
  );
5781
5799
  }
5782
- function gr({
5800
+ function br({
5783
5801
  showControls: s = !1,
5784
5802
  showFooter: n = !0,
5785
5803
  ...a
5786
5804
  }) {
5787
- return /* @__PURE__ */ e.jsx(cs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(jn, { dashboardProps: a, children: [
5788
- /* @__PURE__ */ e.jsx(bn, {}),
5789
- /* @__PURE__ */ e.jsxs(yn, { children: [
5790
- /* @__PURE__ */ e.jsx(mr, {}),
5791
- /* @__PURE__ */ e.jsxs(vn, { ...a, children: [
5792
- s && /* @__PURE__ */ e.jsx(tl, {}),
5793
- /* @__PURE__ */ e.jsx(or, {}),
5794
- /* @__PURE__ */ e.jsx(hr, {})
5805
+ return /* @__PURE__ */ e.jsx(cs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(bn, { dashboardProps: a, children: [
5806
+ /* @__PURE__ */ e.jsx(yn, {}),
5807
+ /* @__PURE__ */ e.jsxs(vn, { children: [
5808
+ /* @__PURE__ */ e.jsx(pr, {}),
5809
+ /* @__PURE__ */ e.jsxs(Cn, { ...a, children: [
5810
+ s && /* @__PURE__ */ e.jsx(ll, {}),
5811
+ /* @__PURE__ */ e.jsx(dr, {}),
5812
+ /* @__PURE__ */ e.jsx(xr, {})
5795
5813
  ] })
5796
5814
  ] })
5797
5815
  ] }) });
5798
5816
  }
5799
5817
  export {
5800
- Ea as A,
5801
- Nn as B,
5802
- wn as C,
5803
- gr as D,
5804
- Fa as E,
5805
- Wn as F,
5806
- In as G,
5818
+ He as A,
5819
+ Sn as B,
5820
+ kn as C,
5821
+ br as D,
5822
+ Ta as E,
5823
+ Ea as F,
5824
+ Tn as G,
5807
5825
  Fn as H,
5808
- En as K,
5809
- Vn as L,
5810
- Ta as M,
5811
- _n as N,
5812
- Hn as P,
5813
- Pn as S,
5814
- Kn as T,
5815
- Jn as U,
5816
- Sn as a,
5826
+ Xn as I,
5827
+ Vn as K,
5828
+ An as L,
5829
+ Fa as M,
5830
+ Hn as N,
5831
+ $n as P,
5832
+ Bn as S,
5833
+ Qn as T,
5834
+ Yn as U,
5835
+ wn as a,
5817
5836
  qs as b,
5818
5837
  Rs as c,
5819
5838
  Da as d,
5820
5839
  Ma as e,
5821
5840
  Ia as f,
5822
- kn as g,
5823
- zn as h,
5824
- On as i,
5825
- Dn as j,
5826
- Mn as k,
5827
- Tn as l,
5828
- Ln as m,
5829
- An as n,
5830
- qn as o,
5841
+ zn as g,
5842
+ On as h,
5843
+ Dn as i,
5844
+ Mn as j,
5845
+ In as k,
5846
+ Ln as l,
5847
+ En as m,
5848
+ qn as n,
5849
+ Rn as o,
5831
5850
  Ae as p,
5832
- Rn as q,
5833
- $n as r,
5851
+ _n as q,
5852
+ Pn as r,
5834
5853
  La as s,
5835
- Bn as t,
5836
- Un as u,
5837
- Gn as v,
5838
- Qn as w,
5839
- _s as x,
5840
- qe as y,
5841
- He as z
5854
+ Un as t,
5855
+ Gn as u,
5856
+ Kn as v,
5857
+ Jn as w,
5858
+ Wn as x,
5859
+ _s as y,
5860
+ qe as z
5842
5861
  };