semaphor 0.0.76 → 0.0.77

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 { J as A, L as We, b as z, c as cs, u as je, j as e, M as ws, O as ks, P as F, Q as zs, R as Fs, U as Is, V as Ts, W as Ds, X as _, Y as Se, Z as la, _ as ra, $ as ia, a0 as oa, a1 as st, a2 as at, a3 as tt, a4 as Gs, f as Z, a5 as Be, a6 as nt, a7 as ca, a8 as Ue, a9 as Ge, T as Ls, e as da, g as Ms, aa as he, ab as me, ac as xe, ad as pe, ae as we, af as fe, ag as J, ah as Os, G as o, ai as As, aj as Es, ak as Vs, w as ua, v as ha, t as ue, al as lt, r as rt, N as ma, s as it, am as ot, B as ct, an as xa, ao as dt, S as qs, z as ut, n as Ks, A as pa, ap as bs, aq as ie, ar as Ne, as as Ie, at as ds, au as fa, av as ht, aw as mt, ax as ga, ay as xt, az as pt, aA as ft, aB as gt, aC as jt, aD as ys, aE as bt, aF as yt, aG as Pe, aH as vs, aI as Ae, aJ as Cs, aK as Qs, aL as vt, aM as Ct, aN as Nt, aO as St, aP as wt, aQ as kt, aR as js, aS as zt, aT as Ws, aU as Ft, aV as Js, aW as It, aX as Tt, aY as Dt, aZ as ja, H as be, a_ as ba, l as Lt, C as Mt, E as ts, d as Ot, h as At, a$ as Et, i as Vt, o as qt, b0 as Rt, m as _t, b1 as Ht, b2 as ya, b3 as va, b4 as ns, b5 as Ca, b6 as ls, b7 as Ys, b8 as $t, b9 as Pt, ba as us, bb as hs, bc as ms, bd as Bt, be as Ut, bf as Na, K as Gt, bg as Kt, bh as Qt, bi as xs, bj as Te, bk as Wt, bl as Jt, bm as Sa, bn as Yt, bo as Xt, bp as rs, bq as Zt, br as en, bs as sn, bt as Xs, bu as an, bv as tn, bw as nn, bx as ln, by as rn, bz as on, bA as cn, bB as dn, bC as De, bD as B, bE as U, bF as Rs, bG as G, bH as un, bI as wa, bJ as ka, bK as hn, bL as mn, bM as xn, bN as pn, bO as fn, bP as gn, bQ as jn, bR as bn, bS as yn } from "./index-CbTZvlIM.js";
1
+ import { J as A, L as Je, b as z, c as Ss, u as je, j as e, M as ws, O as ks, P as F, Q as zs, R as Fs, U as Is, V as Ts, W as Ds, X as _, Y as Se, Z as la, _ as ra, $ as ia, a0 as oa, a1 as tt, a2 as nt, a3 as lt, a4 as Gs, f as X, a5 as Ue, a6 as rt, a7 as ca, a8 as Ge, a9 as Ke, T as Ls, e as da, g as Ms, aa as he, ab as me, ac as xe, ad as pe, ae as we, af as fe, ag as W, ah as Os, G as o, ai as As, aj as Es, ak as Vs, w as ua, v as ha, t as ue, al as it, r as ot, N as ma, s as ct, am as dt, B as ut, an as xa, ao as ht, S as qs, z as mt, n as Ks, A as pa, ap as js, aq as ce, ar as Ne, as as Te, at as ds, au as fa, av as xt, aw as pt, ax as ga, ay as ft, az as gt, aA as jt, aB as bt, aC as yt, aD as bs, aE as vt, aF as Ct, aG as Be, aH as ys, aI as Ee, aJ as vs, aK as Qs, aL as Nt, aM as St, aN as wt, aO as kt, aP as zt, aQ as Ft, aR as gs, aS as It, aT as Ws, aU as Tt, aV as Js, aW as Dt, aX as Lt, aY as Mt, aZ as ja, H as be, a_ as ba, l as Ot, C as At, E as ns, d as Et, h as Vt, a$ as qt, i as Rt, o as _t, b0 as Ht, m as $t, b1 as Pt, b2 as ya, b3 as va, b4 as ls, b5 as Ca, b6 as rs, b7 as Ys, b8 as Bt, b9 as Ut, ba as us, bb as hs, bc as ms, bd as Gt, be as Kt, bf as Na, K as Qt, bg as Wt, bh as Jt, bi as xs, bj as De, bk as Yt, bl as Xt, bm as Sa, bn as Zt, bo as en, bp as is, bq as sn, br as an, bs as tn, bt as Xs, bu as nn, bv as ln, bw as rn, bx as on, by as cn, bz as dn, bA as un, bB as hn, bC as Le, bD as U, bE as G, bF as Rs, bG as K, bH as mn, bI as wa, bJ as ka, bK as xn, bL as pn, bM as fn, bN as gn, bO as jn, bP as bn, bQ as yn, bR as vn, bS as Cn } from "./index-MEy4VWWZ.js";
2
2
  import * as Zs from "react";
3
- import ge, { useState as E, useMemo as Ns, useEffect as X, useRef as Ke, Suspense as vn } from "react";
3
+ import ge, { useState as E, useMemo as Cs, useEffect as Y, useRef as Qe, 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 Cn = A("Box", [
11
+ const Sn = A("Box", [
12
12
  [
13
13
  "path",
14
14
  {
@@ -25,7 +25,7 @@ const Cn = A("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 Nn = A("ChartArea", [
28
+ const wn = A("ChartArea", [
29
29
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
30
30
  [
31
31
  "path",
@@ -104,7 +104,7 @@ const Ia = A("ChartScatter", [
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
106
  */
107
- const Sn = A("CircleX", [
107
+ const kn = A("CircleX", [
108
108
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
109
109
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
110
110
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -115,7 +115,7 @@ const Sn = A("CircleX", [
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- const wn = A("CopyPlus", [
118
+ const zn = A("CopyPlus", [
119
119
  ["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
120
120
  ["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
121
121
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
@@ -127,7 +127,7 @@ const wn = A("CopyPlus", [
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
129
  */
130
- const kn = A("Database", [
130
+ const Fn = A("Database", [
131
131
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
132
132
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
133
133
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -149,7 +149,7 @@ const Ta = A("EllipsisVertical", [
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
151
  */
152
- const zn = A("Eraser", [
152
+ const In = A("Eraser", [
153
153
  [
154
154
  "path",
155
155
  {
@@ -166,7 +166,7 @@ const zn = A("Eraser", [
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
168
  */
169
- const Fn = A("EyeClosed", [
169
+ const Tn = A("EyeClosed", [
170
170
  ["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
171
171
  ["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
172
172
  ["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
@@ -179,7 +179,7 @@ const Fn = A("EyeClosed", [
179
179
  * This source code is licensed under the ISC license.
180
180
  * See the LICENSE file in the root directory of this source tree.
181
181
  */
182
- const In = A("Eye", [
182
+ const Dn = A("Eye", [
183
183
  [
184
184
  "path",
185
185
  {
@@ -195,7 +195,7 @@ const In = A("Eye", [
195
195
  * This source code is licensed under the ISC license.
196
196
  * See the LICENSE file in the root directory of this source tree.
197
197
  */
198
- const Tn = A("Glasses", [
198
+ const Ln = A("Glasses", [
199
199
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
200
200
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
201
201
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -208,7 +208,7 @@ const Tn = A("Glasses", [
208
208
  * This source code is licensed under the ISC license.
209
209
  * See the LICENSE file in the root directory of this source tree.
210
210
  */
211
- const Dn = A("Hammer", [
211
+ const Mn = A("Hammer", [
212
212
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
213
213
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
214
214
  [
@@ -225,7 +225,7 @@ const Dn = A("Hammer", [
225
225
  * This source code is licensed under the ISC license.
226
226
  * See the LICENSE file in the root directory of this source tree.
227
227
  */
228
- const Ln = A("Hash", [
228
+ const On = A("Hash", [
229
229
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
230
230
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
231
231
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -237,7 +237,7 @@ const Ln = A("Hash", [
237
237
  * This source code is licensed under the ISC license.
238
238
  * See the LICENSE file in the root directory of this source tree.
239
239
  */
240
- const Mn = A("House", [
240
+ const An = A("House", [
241
241
  ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
242
242
  [
243
243
  "path",
@@ -264,7 +264,7 @@ const Da = A("Key", [
264
264
  * This source code is licensed under the ISC license.
265
265
  * See the LICENSE file in the root directory of this source tree.
266
266
  */
267
- const On = A("ListEnd", [
267
+ const En = A("ListEnd", [
268
268
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
269
269
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
270
270
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -277,7 +277,7 @@ const On = A("ListEnd", [
277
277
  * This source code is licensed under the ISC license.
278
278
  * See the LICENSE file in the root directory of this source tree.
279
279
  */
280
- const An = A("ListStart", [
280
+ const Vn = A("ListStart", [
281
281
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
282
282
  ["path", { d: "M16 18H3", key: "12xzn7" }],
283
283
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -290,7 +290,7 @@ const An = A("ListStart", [
290
290
  * This source code is licensed under the ISC license.
291
291
  * See the LICENSE file in the root directory of this source tree.
292
292
  */
293
- const En = A("ListX", [
293
+ const qn = A("ListX", [
294
294
  ["path", { d: "M11 12H3", key: "51ecnj" }],
295
295
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
296
296
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -303,7 +303,7 @@ const En = A("ListX", [
303
303
  * This source code is licensed under the ISC license.
304
304
  * See the LICENSE file in the root directory of this source tree.
305
305
  */
306
- const Qe = A("LoaderCircle", [
306
+ const We = A("LoaderCircle", [
307
307
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
308
308
  ]);
309
309
  /**
@@ -312,7 +312,7 @@ const Qe = A("LoaderCircle", [
312
312
  * This source code is licensed under the ISC license.
313
313
  * See the LICENSE file in the root directory of this source tree.
314
314
  */
315
- const Vn = A("MessageSquareMore", [
315
+ const Rn = A("MessageSquareMore", [
316
316
  ["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" }],
317
317
  ["path", { d: "M8 10h.01", key: "19clt8" }],
318
318
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -324,7 +324,7 @@ const Vn = A("MessageSquareMore", [
324
324
  * This source code is licensed under the ISC license.
325
325
  * See the LICENSE file in the root directory of this source tree.
326
326
  */
327
- const qn = A("Network", [
327
+ const _n = A("Network", [
328
328
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
329
329
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
330
330
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -353,7 +353,7 @@ const La = A("Pencil", [
353
353
  * This source code is licensed under the ISC license.
354
354
  * See the LICENSE file in the root directory of this source tree.
355
355
  */
356
- const Rn = A("Play", [
356
+ const Hn = A("Play", [
357
357
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
358
358
  ]);
359
359
  /**
@@ -362,7 +362,7 @@ const Rn = A("Play", [
362
362
  * This source code is licensed under the ISC license.
363
363
  * See the LICENSE file in the root directory of this source tree.
364
364
  */
365
- const _n = A("Plug2", [
365
+ const $n = A("Plug2", [
366
366
  ["path", { d: "M9 2v6", key: "17ngun" }],
367
367
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
368
368
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -375,7 +375,7 @@ const _n = A("Plug2", [
375
375
  * This source code is licensed under the ISC license.
376
376
  * See the LICENSE file in the root directory of this source tree.
377
377
  */
378
- const Hn = A("Save", [
378
+ const Pn = A("Save", [
379
379
  [
380
380
  "path",
381
381
  {
@@ -409,7 +409,7 @@ const Ma = A("Shapes", [
409
409
  * This source code is licensed under the ISC license.
410
410
  * See the LICENSE file in the root directory of this source tree.
411
411
  */
412
- const $n = A("ShieldQuestion", [
412
+ const Bn = A("ShieldQuestion", [
413
413
  [
414
414
  "path",
415
415
  {
@@ -426,7 +426,7 @@ const $n = A("ShieldQuestion", [
426
426
  * This source code is licensed under the ISC license.
427
427
  * See the LICENSE file in the root directory of this source tree.
428
428
  */
429
- const Pn = A("Sigma", [
429
+ const Un = A("Sigma", [
430
430
  [
431
431
  "path",
432
432
  {
@@ -441,7 +441,7 @@ const Pn = A("Sigma", [
441
441
  * This source code is licensed under the ISC license.
442
442
  * See the LICENSE file in the root directory of this source tree.
443
443
  */
444
- const Bn = A("SwatchBook", [
444
+ const Gn = A("SwatchBook", [
445
445
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
446
446
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
447
447
  ["path", { d: "M 7 17h.01", key: "1euzgo" }],
@@ -459,7 +459,7 @@ const Bn = A("SwatchBook", [
459
459
  * This source code is licensed under the ISC license.
460
460
  * See the LICENSE file in the root directory of this source tree.
461
461
  */
462
- const Un = A("Tag", [
462
+ const Kn = A("Tag", [
463
463
  [
464
464
  "path",
465
465
  {
@@ -475,7 +475,7 @@ const Un = A("Tag", [
475
475
  * This source code is licensed under the ISC license.
476
476
  * See the LICENSE file in the root directory of this source tree.
477
477
  */
478
- const Gn = A("ToggleLeft", [
478
+ const Qn = A("ToggleLeft", [
479
479
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
480
480
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
481
481
  ]);
@@ -496,7 +496,7 @@ const $s = A("Type", [
496
496
  * This source code is licensed under the ISC license.
497
497
  * See the LICENSE file in the root directory of this source tree.
498
498
  */
499
- const Kn = A("User", [
499
+ const Wn = A("User", [
500
500
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
501
501
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
502
502
  ]);
@@ -512,14 +512,14 @@ function Oa(s) {
512
512
  var i;
513
513
  return {
514
514
  ...l,
515
- cards: (i = l.cards) == null ? void 0 : i.map((r) => Qn(r))
515
+ cards: (i = l.cards) == null ? void 0 : i.map((r) => Jn(r))
516
516
  };
517
517
  })
518
518
  };
519
519
  })
520
520
  };
521
521
  }
522
- function Qn(s) {
522
+ function Jn(s) {
523
523
  var n, a, t, l;
524
524
  return {
525
525
  ...s,
@@ -534,12 +534,12 @@ function Qn(s) {
534
534
  }))
535
535
  }
536
536
  },
537
- customCfg: Wn(s.customCfg),
537
+ customCfg: Yn(s.customCfg),
538
538
  // if customCfg is present, clean it, otherwise return null{
539
539
  data: []
540
540
  };
541
541
  }
542
- function Wn(s) {
542
+ function Yn(s) {
543
543
  var n, a;
544
544
  return s ? {
545
545
  ...s,
@@ -553,22 +553,22 @@ function Wn(s) {
553
553
  }
554
554
  } : null;
555
555
  }
556
- async function Jn(s, n, a, t) {
556
+ async function Xn(s, n, a, t) {
557
557
  if (!t)
558
558
  return null;
559
559
  const l = JSON.stringify(n);
560
- return await We("https://semaphor.cloud/api/v1/lens", t, {
560
+ return await Je("https://semaphor.cloud/api/v1/lens", t, {
561
561
  name: s,
562
562
  template: l,
563
563
  filterValues: a,
564
564
  operation: "create"
565
565
  });
566
566
  }
567
- async function Ss(s, n) {
567
+ async function Ns(s, n) {
568
568
  if (!n)
569
569
  return null;
570
570
  const { id: a, template: t, filterValues: l, isDefault: i, shared: r } = s;
571
- return await We("https://semaphor.cloud/api/v1/lens", n, {
571
+ return await Je("https://semaphor.cloud/api/v1/lens", n, {
572
572
  lensId: a,
573
573
  template: t,
574
574
  filterValues: l,
@@ -577,22 +577,22 @@ async function Ss(s, n) {
577
577
  operation: "update"
578
578
  });
579
579
  }
580
- async function Yn(s, n) {
581
- return n ? await We("https://semaphor.cloud/api/v1/lens", n, {
580
+ async function Zn(s, n) {
581
+ return n ? await Je("https://semaphor.cloud/api/v1/lens", n, {
582
582
  operation: "delete",
583
583
  lensId: s
584
584
  }) : null;
585
585
  }
586
- function Xn() {
587
- const [s, n] = E(""), [a, t] = E(!1), l = z((C) => C.lenses), { setLenses: i, setSelectedLensId: r } = cs(), [d, c] = E(!1), [u, m] = E(!1), b = z((C) => C.dashboard), g = z((C) => C.filterValues), { authToken: h } = je();
586
+ function el() {
587
+ const [s, n] = E(""), [a, t] = E(!1), l = z((C) => C.lenses), { setLenses: i, setSelectedLensId: r } = Ss(), [d, c] = E(!1), [u, m] = E(!1), y = z((C) => C.dashboard), j = z((C) => C.filterValues), { authToken: h } = je();
588
588
  async function x() {
589
589
  c(!0);
590
590
  const C = Oa(
591
- b
592
- ), I = await Jn(
591
+ y
592
+ ), I = await Xn(
593
593
  s,
594
594
  C,
595
- g,
595
+ j,
596
596
  h == null ? void 0 : h.accessToken
597
597
  );
598
598
  I && (i([...l || [], I]), r(I.id), m(!1)), c(!1);
@@ -644,47 +644,47 @@ function Xn() {
644
644
  ] })
645
645
  ] });
646
646
  }
647
- function Zn() {
648
- const [s, n] = E(!1), a = z((m) => m.lenses), t = z((m) => m.selectedLensId), { setLenses: l, setSelectedLensId: i } = cs(), { authToken: r } = je();
647
+ function sl() {
648
+ const [s, n] = E(!1), a = z((m) => m.lenses), t = z((m) => m.selectedLensId), { setLenses: l, setSelectedLensId: i } = Ss(), { authToken: r } = je();
649
649
  async function d(m) {
650
650
  i(m);
651
651
  }
652
652
  async function c(m) {
653
- if (await Yn(m, r == null ? void 0 : r.accessToken)) {
654
- const g = a == null ? void 0 : a.filter((h) => h.id !== m);
655
- l(g || []), i("original");
653
+ if (await Zn(m, r == null ? void 0 : r.accessToken)) {
654
+ const j = a == null ? void 0 : a.filter((h) => h.id !== m);
655
+ l(j || []), i("original");
656
656
  }
657
657
  }
658
658
  async function u(m) {
659
- const b = a == null ? void 0 : a.map((x) => x.id === m.id ? {
659
+ const y = a == null ? void 0 : a.map((x) => x.id === m.id ? {
660
660
  ...x,
661
661
  isDefault: !m.isDefault
662
662
  } : {
663
663
  ...x,
664
664
  isDefault: !1
665
665
  });
666
- l(b || []);
667
- const g = {
666
+ l(y || []);
667
+ const j = {
668
668
  ...m,
669
669
  isDefault: !m.isDefault
670
670
  };
671
- await Ss(g, r == null ? void 0 : r.accessToken);
671
+ await Ns(j, r == null ? void 0 : r.accessToken);
672
672
  const h = a == null ? void 0 : a.find((x) => x.isDefault);
673
673
  if (h && h.id !== m.id) {
674
674
  const x = {
675
675
  ...h,
676
676
  isDefault: !1
677
677
  };
678
- await Ss(x, r == null ? void 0 : r.accessToken);
678
+ await Ns(x, r == null ? void 0 : r.accessToken);
679
679
  }
680
680
  }
681
681
  return /* @__PURE__ */ e.jsxs(ra, { open: s, onOpenChange: n, children: [
682
- /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
682
+ /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Ln, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
683
683
  /* @__PURE__ */ e.jsxs(oa, { align: "end", className: "w-60", children: [
684
- /* @__PURE__ */ e.jsx(st, { className: "px-3", children: "Lenses" }),
685
- /* @__PURE__ */ e.jsx(at, {}),
684
+ /* @__PURE__ */ e.jsx(tt, { className: "px-3", children: "Lenses" }),
685
+ /* @__PURE__ */ e.jsx(nt, {}),
686
686
  /* @__PURE__ */ e.jsxs(
687
- tt,
687
+ lt,
688
688
  {
689
689
  value: t,
690
690
  onValueChange: d,
@@ -699,12 +699,12 @@ function Zn() {
699
699
  /* @__PURE__ */ e.jsx("p", { children: m.name }),
700
700
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
701
701
  /* @__PURE__ */ e.jsx(
702
- Mn,
702
+ An,
703
703
  {
704
- onClick: (b) => {
705
- b.preventDefault(), u(m);
704
+ onClick: (y) => {
705
+ y.preventDefault(), u(m);
706
706
  },
707
- className: Z(
707
+ className: X(
708
708
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
709
709
  {
710
710
  invisible: !m.isDefault,
@@ -715,10 +715,10 @@ function Zn() {
715
715
  }
716
716
  ),
717
717
  /* @__PURE__ */ e.jsx(
718
- Be,
718
+ Ue,
719
719
  {
720
- onClick: (b) => {
721
- b.preventDefault(), c(m.id);
720
+ onClick: (y) => {
721
+ y.preventDefault(), c(m.id);
722
722
  },
723
723
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
724
724
  strokeWidth: 1.5
@@ -735,27 +735,27 @@ function Zn() {
735
735
  ] })
736
736
  ] });
737
737
  }
738
- function el() {
739
- const { authToken: s } = je(), n = z((f) => f.lenses), a = z((f) => f.selectedLensId), t = n == null ? void 0 : n.find((f) => f.id === a), l = z((f) => f.dashboard);
740
- z((f) => f.selectedSheetId);
738
+ function al() {
739
+ const { authToken: s } = je(), n = z((g) => g.lenses), a = z((g) => g.selectedLensId), t = n == null ? void 0 : n.find((g) => g.id === a), l = z((g) => g.dashboard);
740
+ z((g) => g.selectedSheetId);
741
741
  const i = z(
742
- (f) => f.isDashboardEditing
743
- ), [r, d] = E(!1), c = z((f) => f.filterValues), u = z((f) => f.isVisualEditing), m = z((f) => f.showFilters);
742
+ (g) => g.isDashboardEditing
743
+ ), [r, d] = E(!1), c = z((g) => g.filterValues), u = z((g) => g.isVisualEditing), m = z((g) => g.showFilters);
744
744
  z(
745
- (f) => f.showDashboardJSON
745
+ (g) => g.showDashboardJSON
746
746
  );
747
- const b = z((f) => f.onSaveFunction), g = z(
748
- (f) => f.actions.setShowFilters
747
+ const y = z((g) => g.onSaveFunction), j = z(
748
+ (g) => g.actions.setShowFilters
749
749
  ), { addFrame: h, setSelectedFrameId: x } = z(
750
- (f) => f.actions
751
- ), { getSelectedSheet: C, setIsDashboardEditing: I, setShowDashboardJSON: S } = z((f) => f.actions), O = C(), { tenantId: y, endUserId: M } = Ns(
752
- () => nt(s == null ? void 0 : s.accessToken),
750
+ (g) => g.actions
751
+ ), { getSelectedSheet: C, setIsDashboardEditing: I, setShowDashboardJSON: S } = z((g) => g.actions), O = C(), { tenantId: v, endUserId: L } = Cs(
752
+ () => rt(s == null ? void 0 : s.accessToken),
753
753
  [s == null ? void 0 : s.accessToken]
754
- ), L = Ns(() => y || M, [y, M]), p = () => {
754
+ ), D = Cs(() => v || L, [v, L]), p = () => {
755
755
  if (!i || !O)
756
756
  return;
757
- const f = {
758
- id: Ue(),
757
+ const g = {
758
+ id: Ge(),
759
759
  title: "Title",
760
760
  description: "Description",
761
761
  preferences: {
@@ -770,25 +770,25 @@ function el() {
770
770
  sql: "select COUNT(*) from YOUR_TABLE",
771
771
  data: []
772
772
  }, V = {
773
- id: Ue(),
774
- cards: [f],
775
- activeCardId: f.id
773
+ id: Ge(),
774
+ cards: [g],
775
+ activeCardId: g.id
776
776
  };
777
777
  h(O.id, V), x(V.id);
778
778
  }, w = () => {
779
779
  I(!0);
780
780
  };
781
- async function j() {
781
+ async function b() {
782
782
  if (d(!0), !a || !t)
783
783
  return;
784
- const f = Oa(
784
+ const g = Oa(
785
785
  l
786
- ), V = JSON.stringify(f), $ = {
786
+ ), V = JSON.stringify(g), $ = {
787
787
  ...t,
788
788
  template: V,
789
789
  filterValues: c
790
790
  };
791
- await Ss($, s == null ? void 0 : s.accessToken), Ge.success("Lens saved"), b == null || b(f), d(!1);
791
+ await Ns($, s == null ? void 0 : s.accessToken), Ke.success("Lens saved"), y == null || y(g), d(!1);
792
792
  }
793
793
  return u ? null : /* @__PURE__ */ e.jsxs(
794
794
  "div",
@@ -798,8 +798,8 @@ function el() {
798
798
  children: [
799
799
  !u && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(_, { children: t == null ? void 0 : t.name }) }),
800
800
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
801
- i && !u && L && /* @__PURE__ */ e.jsx(Xn, {}),
802
- !u && L && /* @__PURE__ */ e.jsx(Zn, {}),
801
+ i && !u && D && /* @__PURE__ */ e.jsx(el, {}),
802
+ !u && D && /* @__PURE__ */ e.jsx(sl, {}),
803
803
  i && !u && /* @__PURE__ */ e.jsxs(
804
804
  F,
805
805
  {
@@ -834,18 +834,18 @@ function el() {
834
834
  I(!1), S(!1);
835
835
  },
836
836
  size: "sm",
837
- children: /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4", strokeWidth: 1.5 })
837
+ children: /* @__PURE__ */ e.jsx(Ue, { className: "h-4 w-4", strokeWidth: 1.5 })
838
838
  }
839
839
  ),
840
- i && !u && L && /* @__PURE__ */ e.jsx(
840
+ i && !u && D && /* @__PURE__ */ e.jsx(
841
841
  F,
842
842
  {
843
843
  className: "h-7 p-2",
844
844
  variant: "ghost",
845
845
  disabled: r,
846
- onClick: j,
846
+ onClick: b,
847
847
  size: "sm",
848
- children: /* @__PURE__ */ e.jsx(Hn, { className: "h-4 w-4", strokeWidth: 1.5 })
848
+ children: /* @__PURE__ */ e.jsx(Pn, { className: "h-4 w-4", strokeWidth: 1.5 })
849
849
  }
850
850
  ),
851
851
  !m && !u && i && /* @__PURE__ */ e.jsx(
@@ -853,7 +853,7 @@ function el() {
853
853
  {
854
854
  className: "h-7 p-2",
855
855
  variant: "ghost",
856
- onClick: () => g(!0),
856
+ onClick: () => j(!0),
857
857
  size: "sm",
858
858
  children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
859
859
  }
@@ -865,7 +865,7 @@ function el() {
865
865
  }
866
866
  );
867
867
  }
868
- function He({
868
+ function $e({
869
869
  title: s,
870
870
  items: n,
871
871
  value: a,
@@ -878,29 +878,29 @@ function He({
878
878
  showIcon: u = !0,
879
879
  disabled: m = !1
880
880
  }) {
881
- const b = t ? "Loading..." : l ? "Error" : a;
882
- function g() {
881
+ const y = t ? "Loading..." : l ? "Error" : a;
882
+ function j() {
883
883
  if (s === "Connection")
884
- return /* @__PURE__ */ e.jsx(_n, { className: "size-4 rotate-90" });
884
+ return /* @__PURE__ */ e.jsx($n, { className: "size-4 rotate-90" });
885
885
  if (s === "Database")
886
- return /* @__PURE__ */ e.jsx(kn, { className: "size-4" });
886
+ return /* @__PURE__ */ e.jsx(Fn, { className: "size-4" });
887
887
  if (s === "Schema")
888
- return /* @__PURE__ */ e.jsx(qn, { className: "size-4" });
888
+ return /* @__PURE__ */ e.jsx(_n, { className: "size-4" });
889
889
  if (s === "Table")
890
890
  return /* @__PURE__ */ e.jsx(Os, { className: "size-4" });
891
891
  if (s === "Model")
892
- return /* @__PURE__ */ e.jsx(Cn, { className: "size-4" });
892
+ return /* @__PURE__ */ e.jsx(Sn, { className: "size-4" });
893
893
  }
894
894
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
895
895
  u && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: i ? /* @__PURE__ */ e.jsxs(Ls, { children: [
896
- /* @__PURE__ */ e.jsx(da, { children: g() }),
896
+ /* @__PURE__ */ e.jsx(da, { children: j() }),
897
897
  /* @__PURE__ */ e.jsx(Ms, { className: "text-xs", align: "start", children: i })
898
- ] }) : g() }),
899
- /* @__PURE__ */ e.jsxs(he, { disabled: m, value: b, onValueChange: r, children: [
898
+ ] }) : j() }),
899
+ /* @__PURE__ */ e.jsxs(he, { disabled: m, value: y, onValueChange: r, children: [
900
900
  /* @__PURE__ */ e.jsx(
901
901
  me,
902
902
  {
903
- className: Z(
903
+ className: X(
904
904
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
905
905
  c
906
906
  ),
@@ -915,24 +915,24 @@ function He({
915
915
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(we, { children: [
916
916
  t ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
917
917
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
918
- d && /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }, "none"),
919
- n && n.map((h, x) => /* @__PURE__ */ e.jsx(J, { value: h.id, children: h.name }, x))
918
+ d && /* @__PURE__ */ e.jsx(W, { value: "none", children: "None" }, "none"),
919
+ n && n.map((h, x) => /* @__PURE__ */ e.jsx(W, { value: h.id, children: h.name }, x))
920
920
  ] }),
921
- (t || l) && /* @__PURE__ */ e.jsx(J, { value: b, children: b })
921
+ (t || l) && /* @__PURE__ */ e.jsx(W, { value: y, children: y })
922
922
  ] }) })
923
923
  ] })
924
924
  ] });
925
925
  }
926
- function sl({ column: s }) {
926
+ function tl({ column: s }) {
927
927
  const [n, a] = E(!1), t = o((h) => h.selectedTableName), l = o(
928
928
  (h) => h.selectedSchemaName
929
929
  ), i = o(
930
930
  (h) => h.selectedDatamodelId
931
- ), r = o((h) => h.sqlGen), { modelItems: d } = Ee(), c = o((h) => h.actions.setSqlGen), u = o((h) => h.actions.setCardSql), m = o((h) => h.actions.setRunSql);
932
- function b(h, x) {
931
+ ), r = o((h) => h.sqlGen), { modelItems: d } = Ve(), c = o((h) => h.actions.setSqlGen), u = o((h) => h.actions.setCardSql), m = o((h) => h.actions.setRunSql);
932
+ function y(h, x) {
933
933
  var O;
934
934
  const C = ua(h, r, x), I = (O = d == null ? void 0 : d.find(
935
- (y) => y.id === i
935
+ (v) => v.id === i
936
936
  )) == null ? void 0 : O.name;
937
937
  c(C);
938
938
  const S = ha(
@@ -943,12 +943,12 @@ function sl({ column: s }) {
943
943
  );
944
944
  S && (u(S), m(!0)), a(!1);
945
945
  }
946
- function g() {
946
+ function j() {
947
947
  return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
948
948
  /* @__PURE__ */ e.jsx(
949
949
  "li",
950
950
  {
951
- onClick: () => b(s, "COUNT"),
951
+ onClick: () => y(s, "COUNT"),
952
952
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
953
953
  children: "Count"
954
954
  }
@@ -956,7 +956,7 @@ function sl({ column: s }) {
956
956
  /* @__PURE__ */ e.jsx(
957
957
  "li",
958
958
  {
959
- onClick: () => b(s, "AVG"),
959
+ onClick: () => y(s, "AVG"),
960
960
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
961
961
  children: "Avg"
962
962
  }
@@ -964,7 +964,7 @@ function sl({ column: s }) {
964
964
  /* @__PURE__ */ e.jsx(
965
965
  "li",
966
966
  {
967
- onClick: () => b(s, "SUM"),
967
+ onClick: () => y(s, "SUM"),
968
968
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
969
969
  children: "Sum"
970
970
  }
@@ -972,7 +972,7 @@ function sl({ column: s }) {
972
972
  /* @__PURE__ */ e.jsx(
973
973
  "li",
974
974
  {
975
- onClick: () => b(s, "MAX"),
975
+ onClick: () => y(s, "MAX"),
976
976
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
977
977
  children: "Max"
978
978
  }
@@ -980,7 +980,7 @@ function sl({ column: s }) {
980
980
  /* @__PURE__ */ e.jsx(
981
981
  "li",
982
982
  {
983
- onClick: () => b(s, "MIN"),
983
+ onClick: () => y(s, "MIN"),
984
984
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
985
985
  children: "Min"
986
986
  }
@@ -994,121 +994,121 @@ function sl({ column: s }) {
994
994
  {
995
995
  align: "center",
996
996
  className: "w-20 rounded-md p-0 shadow-none",
997
- children: g()
997
+ children: j()
998
998
  }
999
999
  )
1000
1000
  ] });
1001
1001
  }
1002
1002
  function Aa({ column: s }) {
1003
1003
  return /* @__PURE__ */ e.jsxs(Ls, { children: [
1004
- /* @__PURE__ */ e.jsx(lt, { asChild: !0, children: rt.includes(s.data_type.toLowerCase()) ? (
1004
+ /* @__PURE__ */ e.jsx(it, { asChild: !0, children: ot.includes(s.data_type.toLowerCase()) ? (
1005
1005
  // <span className=" font-thin">T</span>
1006
1006
  /* @__PURE__ */ e.jsx($s, { className: "size-3" })
1007
1007
  ) : ma.includes(s.data_type.toLowerCase()) ? (
1008
1008
  //
1009
- /* @__PURE__ */ e.jsx(Ln, { className: "size-3" })
1010
- ) : it.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(ot, { className: "size-3" }) : ct.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Gn, { className: "size-3" }) : /* @__PURE__ */ e.jsx($n, { className: "size-3" }) }),
1009
+ /* @__PURE__ */ e.jsx(On, { className: "size-3" })
1010
+ ) : ct.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(dt, { className: "size-3" }) : ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Qn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Bn, { className: "size-3" }) }),
1011
1011
  /* @__PURE__ */ e.jsx(Ms, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1012
1012
  ] });
1013
1013
  }
1014
- function al({
1014
+ function nl({
1015
1015
  schemaName: s,
1016
1016
  tableName: n,
1017
1017
  columns: a,
1018
1018
  status: t
1019
1019
  }) {
1020
- const l = o((j) => j.sqlGen), i = o(
1021
- (j) => j.selectedConnectionId
1020
+ const l = o((b) => b.sqlGen), i = o(
1021
+ (b) => b.selectedConnectionId
1022
1022
  ), r = o(
1023
- (j) => j.selectedDatabaseName
1023
+ (b) => b.selectedDatabaseName
1024
1024
  ), d = o(
1025
- (j) => j.selectedSchemaName
1026
- ), c = o((j) => j.selectedTableName), u = o(
1027
- (j) => j.selectedDatamodelId
1025
+ (b) => b.selectedSchemaName
1026
+ ), c = o((b) => b.selectedTableName), u = o(
1027
+ (b) => b.selectedDatamodelId
1028
1028
  ), m = z(
1029
- (j) => j.dashboard.aiScopeTables
1030
- ), { setAIScopeTables: b } = z((j) => j.actions), g = o((j) => j.actions.setRunSql), h = o((j) => j.actions.setSqlGen), x = o(
1031
- (j) => j.actions.setIsShowingVisual
1032
- ), C = o((j) => j.actions.setCardSql), { connectionType: I, modelItems: S } = Ee();
1033
- function O(j) {
1029
+ (b) => b.dashboard.aiScopeTables
1030
+ ), { setAIScopeTables: y } = z((b) => b.actions), j = o((b) => b.actions.setRunSql), h = o((b) => b.actions.setSqlGen), x = o(
1031
+ (b) => b.actions.setIsShowingVisual
1032
+ ), C = o((b) => b.actions.setCardSql), { connectionType: I, modelItems: S } = Ve();
1033
+ function O(b) {
1034
1034
  var q;
1035
- const f = ua(j, l);
1036
- h(f);
1035
+ const g = ua(b, l);
1036
+ h(g);
1037
1037
  const V = (q = S == null ? void 0 : S.find(
1038
- (K) => K.id === u
1039
- )) == null ? void 0 : q.name, $ = ha(f, ue(s), ue(n), V);
1040
- $ && (C($), g(!0));
1038
+ (P) => P.id === u
1039
+ )) == null ? void 0 : q.name, $ = ha(g, ue(s), ue(n), V);
1040
+ $ && (C($), j(!0));
1041
1041
  }
1042
- function y() {
1042
+ function v() {
1043
1043
  return (m == null ? void 0 : m.find(
1044
- (j) => j.connectinonId === i && j.tableName === c
1044
+ (b) => b.connectinonId === i && b.tableName === c
1045
1045
  )) !== void 0;
1046
1046
  }
1047
- function M(j) {
1048
- if (j === !0 && c && i) {
1049
- const f = {
1047
+ function L(b) {
1048
+ if (b === !0 && c && i) {
1049
+ const g = {
1050
1050
  connectinonId: i,
1051
1051
  connectionType: I,
1052
1052
  databaseName: r,
1053
1053
  schemaName: d,
1054
1054
  tableName: c
1055
- }, $ = [...m || [], f].filter(
1056
- (q, K, Y) => Y.findIndex(
1057
- (Q) => Q.connectinonId === q.connectinonId && Q.tableName === q.tableName
1058
- ) === K
1055
+ }, $ = [...m || [], g].filter(
1056
+ (q, P, Z) => Z.findIndex(
1057
+ (J) => J.connectinonId === q.connectinonId && J.tableName === q.tableName
1058
+ ) === P
1059
1059
  );
1060
- b($), Ge.success(`Added '${c}' to AI Scope`, {
1060
+ y($), Ke.success(`Added '${c}' to AI Scope`, {
1061
1061
  position: "top-right",
1062
1062
  duration: 2500,
1063
1063
  richColors: !0
1064
1064
  });
1065
1065
  } else {
1066
- const f = (m || []).filter(
1066
+ const g = (m || []).filter(
1067
1067
  (V) => V.connectinonId !== i && V.tableName !== c
1068
1068
  );
1069
- b(f), Ge(`Removed '${c}' from AI Scope`, {
1069
+ y(g), Ke(`Removed '${c}' from AI Scope`, {
1070
1070
  position: "top-right",
1071
1071
  duration: 2e3,
1072
1072
  richColors: !0
1073
1073
  });
1074
1074
  }
1075
1075
  }
1076
- function L() {
1076
+ function D() {
1077
1077
  var q;
1078
- let j = pa(s, n);
1079
- const f = (q = S == null ? void 0 : S.find(
1080
- (K) => K.id === u
1078
+ let b = pa(s, n);
1079
+ const g = (q = S == null ? void 0 : S.find(
1080
+ (P) => P.id === u
1081
1081
  )) == null ? void 0 : q.name;
1082
- console.log("modelName", f), u && u !== "none" && (j = `${bs}.${f}`);
1083
- let V = j;
1084
- return ((K) => /[A-Z]/.test(K))(n) && (V = V.split(".").map((Y) => `"${Y}"`).join(".")), V;
1082
+ console.log("modelName", g), u && u !== "none" && (b = `${js}.${g}`);
1083
+ let V = b;
1084
+ return ((P) => /[A-Z]/.test(P))(n) && (V = V.split(".").map((Z) => `"${Z}"`).join(".")), V;
1085
1085
  }
1086
1086
  function p() {
1087
- const j = L();
1087
+ const b = D();
1088
1088
  x(!1);
1089
- const f = I === "MSSQL" ? `SELECT top 10 * FROM ${j}` : `SELECT * FROM ${j} LIMIT 10`;
1090
- C(f), g(!0);
1089
+ const g = I === "MSSQL" ? `SELECT top 10 * FROM ${b}` : `SELECT * FROM ${b} LIMIT 10`;
1090
+ C(g), j(!0);
1091
1091
  }
1092
1092
  function w() {
1093
- const j = L();
1094
- C(`SELECT COUNT(*) as count FROM ${j}`), g(!0);
1093
+ const b = D();
1094
+ C(`SELECT COUNT(*) as count FROM ${b}`), j(!0);
1095
1095
  }
1096
1096
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
1097
1097
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
1098
1098
  /* @__PURE__ */ e.jsx(
1099
1099
  xa,
1100
1100
  {
1101
- title: `${y() ? "Remove from" : "Add to"} AI Scope`,
1102
- pressed: y(),
1103
- onPressedChange: M,
1101
+ title: `${v() ? "Remove from" : "Add to"} AI Scope`,
1102
+ pressed: v(),
1103
+ onPressedChange: L,
1104
1104
  variant: "outline",
1105
1105
  className: "h-9 px-2",
1106
1106
  children: /* @__PURE__ */ e.jsx(
1107
- dt,
1107
+ ht,
1108
1108
  {
1109
- className: Z("size-4", {
1110
- "text-primary": y(),
1111
- "text-muted-foreground": !y()
1109
+ className: X("size-4", {
1110
+ "text-primary": v(),
1111
+ "text-muted-foreground": !v()
1112
1112
  })
1113
1113
  }
1114
1114
  )
@@ -1123,7 +1123,7 @@ function al({
1123
1123
  variant: "secondary",
1124
1124
  className: "flex",
1125
1125
  children: [
1126
- t !== "Success" ? /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Bn, { className: "mr-2 size-4" }),
1126
+ t !== "Success" ? /* @__PURE__ */ e.jsx(We, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
1127
1127
  "Top 10"
1128
1128
  ]
1129
1129
  }
@@ -1137,7 +1137,7 @@ function al({
1137
1137
  variant: "secondary",
1138
1138
  className: "flex",
1139
1139
  children: [
1140
- t !== "Success" ? /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Pn, { className: "mr-2 size-4" }),
1140
+ t !== "Success" ? /* @__PURE__ */ e.jsx(We, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Un, { className: "mr-2 size-4" }),
1141
1141
  "Count"
1142
1142
  ]
1143
1143
  }
@@ -1148,32 +1148,32 @@ function al({
1148
1148
  {
1149
1149
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
1150
1150
  children: [
1151
- a == null ? void 0 : a.map((j) => /* @__PURE__ */ e.jsxs(
1151
+ a == null ? void 0 : a.map((b) => /* @__PURE__ */ e.jsxs(
1152
1152
  "div",
1153
1153
  {
1154
- onClick: () => O(j),
1155
- className: Z(
1154
+ onClick: () => O(b),
1155
+ className: X(
1156
1156
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
1157
1157
  {
1158
- "bg-muted": ut(j, l)
1158
+ "bg-muted": mt(b, l)
1159
1159
  }
1160
1160
  ),
1161
1161
  children: [
1162
1162
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1163
- /* @__PURE__ */ e.jsx(Aa, { column: j }),
1164
- /* @__PURE__ */ e.jsx("span", { children: j.column_name })
1163
+ /* @__PURE__ */ e.jsx(Aa, { column: b }),
1164
+ /* @__PURE__ */ e.jsx("span", { children: b.column_name })
1165
1165
  ] }),
1166
1166
  /* @__PURE__ */ e.jsx(
1167
1167
  "div",
1168
1168
  {
1169
- onClick: (f) => f.stopPropagation(),
1169
+ onClick: (g) => g.stopPropagation(),
1170
1170
  className: "flex items-center justify-end",
1171
- children: ma.includes(j.data_type) && /* @__PURE__ */ e.jsx(sl, { column: j })
1171
+ children: ma.includes(b.data_type) && /* @__PURE__ */ e.jsx(tl, { column: b })
1172
1172
  }
1173
1173
  )
1174
1174
  ]
1175
1175
  },
1176
- j.column_name
1176
+ b.column_name
1177
1177
  )),
1178
1178
  /* @__PURE__ */ e.jsx(Ks, { orientation: "vertical" }),
1179
1179
  /* @__PURE__ */ e.jsx(Ks, { orientation: "horizontal" })
@@ -1182,9 +1182,9 @@ function al({
1182
1182
  )
1183
1183
  ] });
1184
1184
  }
1185
- function Ee(s, n) {
1186
- var Ye, Xe, Ze, _e, es;
1187
- let a = Ns(() => [], []);
1185
+ function Ve(s, n) {
1186
+ var Xe, He, Ze, es, ss;
1187
+ let a = Cs(() => [], []);
1188
1188
  const t = je().authToken || s, l = o(
1189
1189
  (N) => N.selectedConnectionId
1190
1190
  ), i = o(
@@ -1197,9 +1197,9 @@ function Ee(s, n) {
1197
1197
  (N) => N.actions.setCurrentColumns
1198
1198
  ), m = o(
1199
1199
  (N) => N.actions.setSelectedConnectionId
1200
- ), b = o(
1200
+ ), y = o(
1201
1201
  (N) => N.actions.setSelectedDatamodelId
1202
- ), g = o(
1202
+ ), j = o(
1203
1203
  (N) => N.actions.setSelectedDatabaseName
1204
1204
  ), h = o(
1205
1205
  (N) => N.actions.setSelectedSchemaName
@@ -1216,10 +1216,10 @@ function Ee(s, n) {
1216
1216
  return l && N ? !(N === "API" || N === "S3") : !1;
1217
1217
  }
1218
1218
  const {
1219
- data: y,
1220
- isLoading: M,
1221
- isError: L
1222
- } = ie({
1219
+ data: v,
1220
+ isLoading: L,
1221
+ isError: D
1222
+ } = ce({
1223
1223
  queryKey: ["connections"],
1224
1224
  queryFn: () => Ne(
1225
1225
  "https://semaphor.cloud/api/v1/connections",
@@ -1230,8 +1230,8 @@ function Ee(s, n) {
1230
1230
  }), {
1231
1231
  data: p,
1232
1232
  isLoading: w,
1233
- isError: j
1234
- } = ie({
1233
+ isError: b
1234
+ } = ce({
1235
1235
  queryKey: ["models", l],
1236
1236
  queryFn: () => Ne(
1237
1237
  "https://semaphor.cloud/api/v1/datamodels",
@@ -1242,15 +1242,15 @@ function Ee(s, n) {
1242
1242
  ),
1243
1243
  enabled: !!(t != null && t.accessToken) && !!l
1244
1244
  // Only fetch if authToken is present
1245
- }), f = y == null ? void 0 : y.connections.find(
1245
+ }), g = v == null ? void 0 : v.connections.find(
1246
1246
  (N) => N.id === l
1247
- ), V = f == null ? void 0 : f.type, $ = (f == null ? void 0 : f.type) === "API" || (f == null ? void 0 : f.type) === "S3", {
1247
+ ), V = g == null ? void 0 : g.type, $ = (g == null ? void 0 : g.type) === "API" || (g == null ? void 0 : g.type) === "S3", {
1248
1248
  data: q,
1249
- isLoading: K,
1250
- isFetching: Y,
1251
- isError: Q,
1252
- refetch: le
1253
- } = ie({
1249
+ isLoading: P,
1250
+ isFetching: Z,
1251
+ isError: J,
1252
+ refetch: te
1253
+ } = ce({
1254
1254
  queryKey: ["databases", l],
1255
1255
  queryFn: () => Ne(
1256
1256
  "https://semaphor.cloud/api/v1/databases",
@@ -1262,12 +1262,12 @@ function Ee(s, n) {
1262
1262
  enabled: O(V)
1263
1263
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1264
1264
  }), {
1265
- data: P,
1266
- isLoading: re,
1265
+ data: B,
1266
+ isLoading: ie,
1267
1267
  isFetching: k,
1268
1268
  isError: R,
1269
- refetch: W
1270
- } = ie({
1269
+ refetch: Q
1270
+ } = ce({
1271
1271
  queryKey: ["schemas", l, r],
1272
1272
  queryFn: () => Ne(
1273
1273
  "https://semaphor.cloud/api/v1/schemas",
@@ -1280,12 +1280,12 @@ function Ee(s, n) {
1280
1280
  enabled: !!l && !!r && !$ && r !== "NA"
1281
1281
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1282
1282
  }), {
1283
- data: D,
1283
+ data: M,
1284
1284
  isLoading: T,
1285
- isFetching: te,
1285
+ isFetching: ae,
1286
1286
  isError: H,
1287
1287
  refetch: ee
1288
- } = ie({
1288
+ } = ce({
1289
1289
  queryKey: [
1290
1290
  "tables",
1291
1291
  l,
@@ -1303,11 +1303,11 @@ function Ee(s, n) {
1303
1303
  ),
1304
1304
  enabled: I(V)
1305
1305
  }), {
1306
- data: se,
1307
- isLoading: Le,
1308
- isFetching: ke,
1309
- isError: ve
1310
- } = ie({
1306
+ data: ne,
1307
+ isLoading: ve,
1308
+ isFetching: oe,
1309
+ isError: ke
1310
+ } = ce({
1311
1311
  queryKey: [
1312
1312
  "columns",
1313
1313
  l,
@@ -1337,86 +1337,86 @@ function Ee(s, n) {
1337
1337
  //currentConnection?.type === 'API',
1338
1338
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1339
1339
  });
1340
- X(() => {
1340
+ Y(() => {
1341
1341
  u(a);
1342
- }, [se, u, a]), X(() => {
1342
+ }, [ne, u, a]), Y(() => {
1343
1343
  }, [
1344
1344
  $,
1345
1345
  C,
1346
1346
  x,
1347
1347
  h,
1348
- g,
1349
- f
1348
+ j,
1349
+ g
1350
1350
  ]);
1351
- const Ce = (f == null ? void 0 : f.type) === "API" ? (Ye = f == null ? void 0 : f.type) == null ? void 0 : Ye.toLowerCase() : c || "", ae = $ ? "" : d || "";
1352
- function oe(N) {
1351
+ const ze = (g == null ? void 0 : g.type) === "API" ? (Xe = g == null ? void 0 : g.type) == null ? void 0 : Xe.toLowerCase() : c || "", Fe = $ ? "" : d || "";
1352
+ function Ce(N) {
1353
1353
  h(N), x("");
1354
1354
  }
1355
- function ce(N) {
1356
- g(N === "none" ? "" : N), h(""), x(""), N !== "none" && N !== "" && b("");
1355
+ function se(N) {
1356
+ j(N === "none" ? "" : N), h(""), x(""), N !== "none" && N !== "" && y("");
1357
1357
  }
1358
- function ze(N) {
1358
+ function de(N) {
1359
1359
  m(N);
1360
1360
  }
1361
1361
  function Me(N) {
1362
- b(N === "none" ? "" : N), N !== "none" && N !== "" && g("");
1362
+ y(N === "none" ? "" : N), N !== "none" && N !== "" && j("");
1363
1363
  }
1364
- q && ((Xe = q == null ? void 0 : q.databases) == null ? void 0 : Xe.length) > 0, P && ((Ze = P == null ? void 0 : P.schemas) == null ? void 0 : Ze.length) > 0, se && ((_e = se == null ? void 0 : se.columns) == null ? void 0 : _e.length) > 0 && (a = se.columns.map((N) => ({
1364
+ q && ((He = q == null ? void 0 : q.databases) == null ? void 0 : He.length) > 0, B && ((Ze = B == null ? void 0 : B.schemas) == null ? void 0 : Ze.length) > 0, ne && ((es = ne == null ? void 0 : ne.columns) == null ? void 0 : es.length) > 0 && (a = ne.columns.map((N) => ({
1365
1365
  ...N,
1366
1366
  data_type: N.data_type.toLowerCase()
1367
- }))), Q && (a = []), (ve || L) && (a = []);
1368
- const Re = y == null ? void 0 : y.connections.map(
1367
+ }))), J && (a = []), (ke || D) && (a = []);
1368
+ const Ye = v == null ? void 0 : v.connections.map(
1369
1369
  (N) => ({
1370
1370
  id: N.id,
1371
1371
  name: N.name,
1372
1372
  type: N.type
1373
1373
  })
1374
- ), Bs = (es = p == null ? void 0 : p.datamodels) == null ? void 0 : es.map((N) => ({
1374
+ ), Oe = (ss = p == null ? void 0 : p.datamodels) == null ? void 0 : ss.map((N) => ({
1375
1375
  id: N.id,
1376
1376
  name: N.name
1377
- })), Oe = q == null ? void 0 : q.databases.map((N) => ({
1377
+ })), _e = q == null ? void 0 : q.databases.map((N) => ({
1378
1378
  id: N.database_name,
1379
1379
  name: N.database_name
1380
- })), fs = P == null ? void 0 : P.schemas.map((N) => ({
1380
+ })), Bs = B == null ? void 0 : B.schemas.map((N) => ({
1381
1381
  id: N.schema_name,
1382
1382
  name: N.schema_name
1383
- })), Je = D == null ? void 0 : D.tables.map((N) => ({
1383
+ })), Ae = M == null ? void 0 : M.tables.map((N) => ({
1384
1384
  id: N.table_name,
1385
1385
  name: N.table_name
1386
1386
  }));
1387
1387
  return {
1388
- connectionItems: Re,
1389
- isConnectionsLoading: M,
1390
- isConnectionsError: L,
1391
- modelItems: Bs,
1388
+ connectionItems: Ye,
1389
+ isConnectionsLoading: L,
1390
+ isConnectionsError: D,
1391
+ modelItems: Oe,
1392
1392
  isModelsLoading: w,
1393
- isModelsError: j,
1394
- databaseItems: Oe,
1395
- isDatabasesLoadingOrFetching: K || Y,
1396
- isDatabaseError: Q,
1397
- schemaItems: fs,
1398
- isSchemaLoadingOrFetching: re || k,
1393
+ isModelsError: b,
1394
+ databaseItems: _e,
1395
+ isDatabasesLoadingOrFetching: P || Z,
1396
+ isDatabaseError: J,
1397
+ schemaItems: Bs,
1398
+ isSchemaLoadingOrFetching: ie || k,
1399
1399
  isSchemaError: R,
1400
- tableItems: Je,
1401
- isTableLoadingOrFetching: T || te,
1400
+ tableItems: Ae,
1401
+ isTableLoadingOrFetching: T || ae,
1402
1402
  isTableError: H,
1403
1403
  columns: a,
1404
- isColumnsLoadingOrFetching: Le || ke,
1405
- isColumnsError: ve,
1404
+ isColumnsLoadingOrFetching: ve || oe,
1405
+ isColumnsError: ke,
1406
1406
  isNonDbConnection: $,
1407
1407
  connectionType: V,
1408
- tableName: Ce,
1409
- schemaName: ae,
1410
- handleConnectionChange: ze,
1408
+ tableName: ze,
1409
+ schemaName: Fe,
1410
+ handleConnectionChange: de,
1411
1411
  handleDatamodelChange: Me,
1412
- handleDatabaseChange: ce,
1413
- handleSchemaChange: oe
1412
+ handleDatabaseChange: se,
1413
+ handleSchemaChange: Ce
1414
1414
  };
1415
1415
  }
1416
1416
  function Ea({
1417
1417
  ColumnsComponent: s
1418
1418
  }) {
1419
- var te;
1419
+ var ae;
1420
1420
  const n = o(
1421
1421
  (H) => H.selectedConnectionId
1422
1422
  ), a = o(
@@ -1432,49 +1432,49 @@ function Ea({
1432
1432
  modelItems: c,
1433
1433
  schemaItems: u,
1434
1434
  databaseItems: m,
1435
- tableItems: b,
1436
- columns: g,
1435
+ tableItems: y,
1436
+ columns: j,
1437
1437
  isConnectionsLoading: h,
1438
1438
  isModelsLoading: x,
1439
1439
  isConnectionsError: C,
1440
1440
  isModelsError: I,
1441
1441
  isDatabasesLoadingOrFetching: S,
1442
1442
  isDatabaseError: O,
1443
- isSchemaLoadingOrFetching: y,
1444
- isSchemaError: M,
1445
- isColumnsError: L,
1443
+ isSchemaLoadingOrFetching: v,
1444
+ isSchemaError: L,
1445
+ isColumnsError: D,
1446
1446
  isColumnsLoadingOrFetching: p,
1447
1447
  isTableLoadingOrFetching: w,
1448
- isTableError: j,
1449
- connectionType: f,
1448
+ isTableError: b,
1449
+ connectionType: g,
1450
1450
  isNonDbConnection: V,
1451
1451
  handleConnectionChange: $,
1452
1452
  handleDatabaseChange: q,
1453
- handleSchemaChange: K,
1454
- handleDatamodelChange: Y,
1455
- tableName: Q,
1456
- schemaName: le
1457
- } = Ee();
1458
- function P() {
1459
- return s ? s(le, Q, g) : /* @__PURE__ */ e.jsx(
1460
- al,
1453
+ handleSchemaChange: P,
1454
+ handleDatamodelChange: Z,
1455
+ tableName: J,
1456
+ schemaName: te
1457
+ } = Ve();
1458
+ function B() {
1459
+ return s ? s(te, J, j) : /* @__PURE__ */ e.jsx(
1460
+ nl,
1461
1461
  {
1462
- schemaName: le,
1463
- tableName: Q,
1464
- columns: g,
1465
- status: p ? "Loading..." : L ? "Error" : "Success"
1462
+ schemaName: te,
1463
+ tableName: J,
1464
+ columns: j,
1465
+ status: p ? "Loading..." : D ? "Error" : "Success"
1466
1466
  }
1467
1467
  );
1468
1468
  }
1469
- function re() {
1469
+ function ie() {
1470
1470
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1471
1471
  }
1472
1472
  function k() {
1473
- if (!n || f === "S3" || f === "API")
1473
+ if (!n || g === "S3" || g === "API")
1474
1474
  return null;
1475
1475
  if (!a || a === "none")
1476
1476
  return /* @__PURE__ */ e.jsx(
1477
- He,
1477
+ $e,
1478
1478
  {
1479
1479
  showNone: !0,
1480
1480
  onChange: q,
@@ -1489,20 +1489,20 @@ function Ea({
1489
1489
  function R() {
1490
1490
  if (n && !V && (!t || t === "none") && (!a || a === "none"))
1491
1491
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1492
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ie, {}) }),
1492
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Te, {}) }),
1493
1493
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(_, { children: "OR" }) }),
1494
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ie, {}) })
1494
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Te, {}) })
1495
1495
  ] });
1496
1496
  }
1497
- function W() {
1498
- if (!n || f === "S3" || f === "API")
1497
+ function Q() {
1498
+ if (!n || g === "S3" || g === "API")
1499
1499
  return null;
1500
1500
  if (!t || t === "none")
1501
1501
  return /* @__PURE__ */ e.jsx(
1502
- He,
1502
+ $e,
1503
1503
  {
1504
1504
  showNone: !0,
1505
- onChange: Y,
1505
+ onChange: Z,
1506
1506
  isError: I,
1507
1507
  isLoading: x,
1508
1508
  items: c,
@@ -1511,13 +1511,13 @@ function Ea({
1511
1511
  }
1512
1512
  );
1513
1513
  }
1514
- function D() {
1515
- return !n || f === "S3" || f === "API" || !t || t === "none" ? null : /* @__PURE__ */ e.jsx(
1516
- He,
1514
+ function M() {
1515
+ return !n || g === "S3" || g === "API" || !t || t === "none" ? null : /* @__PURE__ */ e.jsx(
1516
+ $e,
1517
1517
  {
1518
- onChange: K,
1519
- isError: M,
1520
- isLoading: y,
1518
+ onChange: P,
1519
+ isError: L,
1520
+ isLoading: v,
1521
1521
  items: u,
1522
1522
  value: l || "",
1523
1523
  title: "Schema"
@@ -1527,14 +1527,14 @@ function Ea({
1527
1527
  function T() {
1528
1528
  function H() {
1529
1529
  let ee = !1;
1530
- return f === "API" ? (ee = !1, ee) : ((f === "S3" || n && t && t !== "none" && l) && (ee = !0), ee);
1530
+ return g === "API" ? (ee = !1, ee) : ((g === "S3" || n && t && t !== "none" && l) && (ee = !0), ee);
1531
1531
  }
1532
1532
  return H() ? /* @__PURE__ */ e.jsx(
1533
- He,
1533
+ $e,
1534
1534
  {
1535
1535
  onChange: r,
1536
- isError: j,
1537
- items: b,
1536
+ isError: b,
1537
+ items: y,
1538
1538
  isLoading: w,
1539
1539
  value: i || "",
1540
1540
  title: "Table"
@@ -1544,7 +1544,7 @@ function Ea({
1544
1544
  return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
1545
1545
  /* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
1546
1546
  /* @__PURE__ */ e.jsx(
1547
- He,
1547
+ $e,
1548
1548
  {
1549
1549
  items: d,
1550
1550
  title: "Connection",
@@ -1552,34 +1552,34 @@ function Ea({
1552
1552
  onChange: $,
1553
1553
  isLoading: h,
1554
1554
  isError: C,
1555
- connectionTooltip: ((te = d == null ? void 0 : d.find(
1555
+ connectionTooltip: ((ae = d == null ? void 0 : d.find(
1556
1556
  (H) => H.id === n
1557
- )) == null ? void 0 : te.type) || ""
1557
+ )) == null ? void 0 : ae.type) || ""
1558
1558
  }
1559
1559
  ),
1560
- W(),
1560
+ Q(),
1561
1561
  R(),
1562
1562
  k(),
1563
- D(),
1563
+ M(),
1564
1564
  T()
1565
1565
  ] }),
1566
- P(),
1566
+ B(),
1567
1567
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1568
1568
  F,
1569
1569
  {
1570
- onClick: re,
1570
+ onClick: ie,
1571
1571
  size: "sm",
1572
1572
  variant: "secondary",
1573
1573
  className: "w-full",
1574
1574
  children: [
1575
- /* @__PURE__ */ e.jsx(Vn, { className: "mr-2 size-4" }),
1575
+ /* @__PURE__ */ e.jsx(Rn, { className: "mr-2 size-4" }),
1576
1576
  "Help"
1577
1577
  ]
1578
1578
  }
1579
1579
  ) })
1580
1580
  ] });
1581
1581
  }
1582
- function tl(s) {
1582
+ function ll(s) {
1583
1583
  const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1584
1584
  let i = s.length;
1585
1585
  if (l !== -1 && (i = l), t !== -1 && t < i && (i = t), n !== -1) {
@@ -1595,14 +1595,14 @@ function tl(s) {
1595
1595
  return `${r} {{ filters | where }} ${d}`;
1596
1596
  }
1597
1597
  }
1598
- function nl({
1598
+ function rl({
1599
1599
  error: s,
1600
1600
  setShowAIDialog: n,
1601
1601
  setUserInputforAI: a,
1602
1602
  setTriggerAIRun: t
1603
1603
  }) {
1604
1604
  return /* @__PURE__ */ e.jsxs(As, { openDelay: 0, children: [
1605
- /* @__PURE__ */ e.jsx(Es, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(Sn, { className: "h-4 w-4 text-red-500" }) }) }),
1605
+ /* @__PURE__ */ e.jsx(Es, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
1606
1606
  /* @__PURE__ */ e.jsx(Vs, { align: "start", className: "min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
1607
1607
  /* @__PURE__ */ e.jsx(qs, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
1608
1608
  /* @__PURE__ */ e.jsxs(
@@ -1614,7 +1614,7 @@ function nl({
1614
1614
  size: "sm",
1615
1615
  variant: "outline",
1616
1616
  children: [
1617
- /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 h-4 w-4" }),
1617
+ /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 h-4 w-4" }),
1618
1618
  "Debug with AI"
1619
1619
  ]
1620
1620
  }
@@ -1622,7 +1622,7 @@ function nl({
1622
1622
  ] }) }) })
1623
1623
  ] });
1624
1624
  }
1625
- function ll({
1625
+ function il({
1626
1626
  text: s,
1627
1627
  onCheckedChange: n,
1628
1628
  checked: a
@@ -1632,10 +1632,10 @@ function ll({
1632
1632
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1633
1633
  ] });
1634
1634
  }
1635
- function rl() {
1635
+ function ol() {
1636
1636
  const { authToken: s } = je(), n = o(
1637
1637
  (i) => i.selectedConnectionId
1638
- ), { data: a } = ie({
1638
+ ), { data: a } = ce({
1639
1639
  queryKey: ["connections"],
1640
1640
  queryFn: () => Ne(
1641
1641
  "https://semaphor.cloud/api/v1/connections",
@@ -1648,8 +1648,8 @@ function rl() {
1648
1648
  );
1649
1649
  return t == null ? void 0 : t.type;
1650
1650
  }
1651
- function il() {
1652
- const { authToken: s } = je(), n = Ke(null), a = o((c) => c.applyFilters), [t, l] = E(""), i = o((c) => c.filterValues), r = o((c) => c.card.sql), d = rl();
1651
+ function cl() {
1652
+ const { authToken: s } = je(), n = Qe(null), a = o((c) => c.applyFilters), [t, l] = E(""), i = o((c) => c.filterValues), r = o((c) => c.card.sql), d = ol();
1653
1653
  return /* @__PURE__ */ e.jsxs(
1654
1654
  As,
1655
1655
  {
@@ -1658,7 +1658,7 @@ function il() {
1658
1658
  if (!c)
1659
1659
  return;
1660
1660
  console.log("onOpenChange");
1661
- const u = await We(
1661
+ const u = await Je(
1662
1662
  "https://semaphor.cloud/api/v1/filter-sql",
1663
1663
  (s == null ? void 0 : s.accessToken) || "",
1664
1664
  {
@@ -1677,13 +1677,13 @@ function il() {
1677
1677
  /* @__PURE__ */ e.jsx(
1678
1678
  fa,
1679
1679
  {
1680
- onClick: () => ht(n),
1680
+ onClick: () => xt(n),
1681
1681
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
1682
1682
  }
1683
1683
  )
1684
1684
  ] }) }) }),
1685
1685
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
1686
- /* @__PURE__ */ e.jsx(mt, { className: "h-4 w-4 opacity-70" }),
1686
+ /* @__PURE__ */ e.jsx(pt, { className: "h-4 w-4 opacity-70" }),
1687
1687
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
1688
1688
  ] })
1689
1689
  ] })
@@ -1691,7 +1691,7 @@ function il() {
1691
1691
  }
1692
1692
  );
1693
1693
  }
1694
- const ol = `
1694
+ const dl = `
1695
1695
 
1696
1696
  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.
1697
1697
 
@@ -1738,7 +1738,7 @@ SELECT label, measure FROM table
1738
1738
  - Label - Category
1739
1739
  - Measure - Number
1740
1740
  `;
1741
- function cl({
1741
+ function ul({
1742
1742
  open: s,
1743
1743
  setOpen: n,
1744
1744
  userInput: a,
@@ -1746,21 +1746,21 @@ function cl({
1746
1746
  triggerAIRun: l,
1747
1747
  setTriggerAIRun: i
1748
1748
  }) {
1749
- const r = Ke(null), d = Ke(null), { authToken: c } = je(), [u, m] = E(!1), b = o((k) => k.actions.setCardSql), g = z((k) => k.dashboard.baseQueries), h = o((k) => k.actions.setRunSql), x = o((k) => k.actions.setCardType), [C, I] = E([]), S = o((k) => k.currentColumns), O = o((k) => k.card.sql), y = o((k) => k.selectedTableName), M = `
1749
+ const r = Qe(null), d = Qe(null), { authToken: c } = je(), [u, m] = E(!1), y = o((k) => k.actions.setCardSql), j = z((k) => k.dashboard.baseQueries), h = o((k) => k.actions.setRunSql), x = o((k) => k.actions.setCardType), [C, I] = E([]), S = o((k) => k.currentColumns), O = o((k) => k.card.sql), v = o((k) => k.selectedTableName), L = `
1750
1750
  ${a}
1751
1751
 
1752
- Database Query Dialect: ${y === "api" || y === "s3" ? "DuckDb" : ""}
1753
- Table Name: ${y}
1752
+ Database Query Dialect: ${v === "api" || v === "s3" ? "DuckDb" : ""}
1753
+ Table Name: ${v}
1754
1754
  Table Columns: ${S == null ? void 0 : S.map((k) => `${k.column_name} | ${k.data_type}`).join(", ")}
1755
1755
  User SQL: ${O}
1756
- ${g && `Base Queries: ${JSON.stringify(g)} `}`, L = ` 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.
1757
- Visual Query Syntax: ${ol}`, { data: p, isLoading: w, isFetching: j, isError: f, refetch: V } = ie({
1756
+ ${j && `Base Queries: ${JSON.stringify(j)} `}`, D = ` 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.
1757
+ Visual Query Syntax: ${dl}`, { data: p, isLoading: w, isFetching: b, isError: g, refetch: V } = ce({
1758
1758
  queryKey: ["ai-query"],
1759
1759
  queryFn: () => Ne(
1760
1760
  "https://semaphor.cloud/api/v1/ai",
1761
1761
  (c == null ? void 0 : c.accessToken) || "",
1762
1762
  {
1763
- user_content: `userContent: ${M} ${u ? L : ""}`
1763
+ user_content: `userContent: ${L} ${u ? D : ""}`
1764
1764
  }
1765
1765
  ),
1766
1766
  enabled: !1
@@ -1787,9 +1787,9 @@ function cl({
1787
1787
  return x("bar"), !1;
1788
1788
  return !0;
1789
1789
  }
1790
- X(() => {
1790
+ Y(() => {
1791
1791
  p && I((k) => [...k, { role: "ai", content: p.response }]);
1792
- }, [p]), X(() => {
1792
+ }, [p]), Y(() => {
1793
1793
  const k = setTimeout(() => {
1794
1794
  var R;
1795
1795
  d.current && (d.current.scroll({
@@ -1802,10 +1802,10 @@ function cl({
1802
1802
  function q() {
1803
1803
  a && (I((k) => [...k, { role: "user", content: a }]), $(a) && m(!0), t(""), V());
1804
1804
  }
1805
- X(() => {
1805
+ Y(() => {
1806
1806
  l && (q(), i(!1));
1807
1807
  }, [l, i]);
1808
- const K = {
1808
+ const P = {
1809
1809
  //seleect a darker color
1810
1810
  // color: '#000',
1811
1811
  fontFamily: "Arial, sans-serif",
@@ -1813,14 +1813,14 @@ function cl({
1813
1813
  fontSize: 15,
1814
1814
  // padding: '5px',
1815
1815
  width: "100%"
1816
- }, Y = {
1816
+ }, Z = {
1817
1817
  // background: '#f6f8fa',
1818
1818
  // color: '#000',
1819
1819
  fontFamily: "monospace",
1820
1820
  fontSize: 14,
1821
1821
  lineHeight: 1.6
1822
1822
  // padding: 20,
1823
- }, Q = {
1823
+ }, J = {
1824
1824
  // color: '#000',
1825
1825
  fontFamily: "Arial, sans-serif",
1826
1826
  lineHeight: 1.6,
@@ -1830,54 +1830,54 @@ function cl({
1830
1830
  marginLeft: 20,
1831
1831
  // add bullet points for unordered lists
1832
1832
  listStyleType: "disc"
1833
- }, le = {
1833
+ }, te = {
1834
1834
  // Override how paragraphs are rendered
1835
- p: ({ node: k, ...R }) => /* @__PURE__ */ e.jsx("p", { style: K, ...R }),
1835
+ p: ({ node: k, ...R }) => /* @__PURE__ */ e.jsx("p", { style: P, ...R }),
1836
1836
  code: ({ node: k, ...R }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...R }),
1837
- pre: ({ node: k, ...R }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Y, children: [
1837
+ pre: ({ node: k, ...R }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Z, children: [
1838
1838
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: R.children }),
1839
1839
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1840
- /* @__PURE__ */ e.jsx(F, { onClick: P, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(fa, {}) }),
1840
+ /* @__PURE__ */ e.jsx(F, { onClick: B, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(fa, {}) }),
1841
1841
  /* @__PURE__ */ e.jsx(
1842
1842
  F,
1843
1843
  {
1844
- onClick: (W) => {
1845
- const D = P(W);
1846
- D && (n(!1), b(D), h(!0));
1844
+ onClick: (Q) => {
1845
+ const M = B(Q);
1846
+ M && (n(!1), y(M), h(!0));
1847
1847
  },
1848
1848
  size: "sm",
1849
1849
  variant: "outline",
1850
- children: /* @__PURE__ */ e.jsx(ft, {})
1850
+ children: /* @__PURE__ */ e.jsx(jt, {})
1851
1851
  }
1852
1852
  )
1853
1853
  ] })
1854
1854
  ] }),
1855
- li: ({ node: k, ...R }) => /* @__PURE__ */ e.jsx("li", { style: Q, ...R })
1855
+ li: ({ node: k, ...R }) => /* @__PURE__ */ e.jsx("li", { style: J, ...R })
1856
1856
  // You can add more overrides for other elements like h1, h2, etc.
1857
1857
  };
1858
- function P(k) {
1858
+ function B(k) {
1859
1859
  const R = k.currentTarget.closest("pre");
1860
1860
  if (!R)
1861
1861
  return;
1862
- const W = R.textContent || R.innerText;
1863
- return navigator.clipboard.writeText(W).then(() => console.log("Text copied to clipboard")).catch((D) => console.error("Error in copying text: ", D)), W;
1862
+ const Q = R.textContent || R.innerText;
1863
+ return navigator.clipboard.writeText(Q).then(() => console.log("Text copied to clipboard")).catch((M) => console.error("Error in copying text: ", M)), Q;
1864
1864
  }
1865
- function re() {
1865
+ function ie() {
1866
1866
  return C == null ? void 0 : C.map((k, R) => k.role === "user" ? /* @__PURE__ */ e.jsxs(
1867
1867
  "div",
1868
1868
  {
1869
1869
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1870
1870
  children: [
1871
- /* @__PURE__ */ e.jsx(Kn, { className: "mr-2 h-5 w-5" }),
1871
+ /* @__PURE__ */ e.jsx(Wn, { className: "mr-2 h-5 w-5" }),
1872
1872
  /* @__PURE__ */ e.jsx("div", { children: k.content })
1873
1873
  ]
1874
1874
  },
1875
1875
  R
1876
1876
  ) : k.role === "ai" ? /* @__PURE__ */ e.jsx(
1877
- pt,
1877
+ gt,
1878
1878
  {
1879
1879
  className: "w-full overflow-auto py-1",
1880
- components: le,
1880
+ components: te,
1881
1881
  children: p == null ? void 0 : p.response.replace(/DuckDB/gi, "Semaphor")
1882
1882
  },
1883
1883
  R
@@ -1907,7 +1907,7 @@ function cl({
1907
1907
  {
1908
1908
  ref: d,
1909
1909
  className: "h-[625px] w-full overflow-auto border-t border-t-muted",
1910
- children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: re() })
1910
+ children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: ie() })
1911
1911
  }
1912
1912
  ),
1913
1913
  /* @__PURE__ */ e.jsx(
@@ -1924,13 +1924,13 @@ function cl({
1924
1924
  },
1925
1925
  placeholder: "Type your question here...",
1926
1926
  onFocus: (k) => {
1927
- const R = k.target, W = R.value.length;
1928
- R.setSelectionRange(W, W);
1927
+ const R = k.target, Q = R.value.length;
1928
+ R.setSelectionRange(Q, Q);
1929
1929
  },
1930
- className: Z(
1930
+ className: X(
1931
1931
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1932
1932
  ),
1933
- disabled: w || j,
1933
+ disabled: w || b,
1934
1934
  value: a,
1935
1935
  onChange: (k) => t(k.target.value)
1936
1936
  }
@@ -1943,7 +1943,7 @@ function cl({
1943
1943
  size: "sm",
1944
1944
  variant: "ghost",
1945
1945
  onClick: q,
1946
- children: !w && !j ? /* @__PURE__ */ e.jsx(xt, {}) : /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1946
+ children: !w && !b ? /* @__PURE__ */ e.jsx(ft, {}) : /* @__PURE__ */ e.jsx(We, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1947
1947
  }
1948
1948
  )
1949
1949
  ] })
@@ -1960,11 +1960,11 @@ var Va = {
1960
1960
  className: void 0,
1961
1961
  style: void 0,
1962
1962
  attr: void 0
1963
- }, ea = ge.createContext && /* @__PURE__ */ ge.createContext(Va), dl = ["attr", "size", "title"];
1964
- function ul(s, n) {
1963
+ }, ea = ge.createContext && /* @__PURE__ */ ge.createContext(Va), hl = ["attr", "size", "title"];
1964
+ function ml(s, n) {
1965
1965
  if (s == null)
1966
1966
  return {};
1967
- var a = hl(s, n), t, l;
1967
+ var a = xl(s, n), t, l;
1968
1968
  if (Object.getOwnPropertySymbols) {
1969
1969
  var i = Object.getOwnPropertySymbols(s);
1970
1970
  for (l = 0; l < i.length; l++)
@@ -1972,7 +1972,7 @@ function ul(s, n) {
1972
1972
  }
1973
1973
  return a;
1974
1974
  }
1975
- function hl(s, n) {
1975
+ function xl(s, n) {
1976
1976
  if (s == null)
1977
1977
  return {};
1978
1978
  var a = {}, t = Object.keys(s), l, i;
@@ -1980,15 +1980,15 @@ function hl(s, n) {
1980
1980
  l = t[i], !(n.indexOf(l) >= 0) && (a[l] = s[l]);
1981
1981
  return a;
1982
1982
  }
1983
- function is() {
1984
- return is = Object.assign ? Object.assign.bind() : function(s) {
1983
+ function os() {
1984
+ return os = Object.assign ? Object.assign.bind() : function(s) {
1985
1985
  for (var n = 1; n < arguments.length; n++) {
1986
1986
  var a = arguments[n];
1987
1987
  for (var t in a)
1988
1988
  Object.prototype.hasOwnProperty.call(a, t) && (s[t] = a[t]);
1989
1989
  }
1990
1990
  return s;
1991
- }, is.apply(this, arguments);
1991
+ }, os.apply(this, arguments);
1992
1992
  }
1993
1993
  function sa(s, n) {
1994
1994
  var a = Object.keys(s);
@@ -2000,25 +2000,25 @@ function sa(s, n) {
2000
2000
  }
2001
2001
  return a;
2002
2002
  }
2003
- function os(s) {
2003
+ function cs(s) {
2004
2004
  for (var n = 1; n < arguments.length; n++) {
2005
2005
  var a = arguments[n] != null ? arguments[n] : {};
2006
2006
  n % 2 ? sa(Object(a), !0).forEach(function(t) {
2007
- ml(s, t, a[t]);
2007
+ pl(s, t, a[t]);
2008
2008
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : sa(Object(a)).forEach(function(t) {
2009
2009
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
2010
2010
  });
2011
2011
  }
2012
2012
  return s;
2013
2013
  }
2014
- function ml(s, n, a) {
2015
- return n = xl(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
2014
+ function pl(s, n, a) {
2015
+ return n = fl(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
2016
2016
  }
2017
- function xl(s) {
2018
- var n = pl(s, "string");
2017
+ function fl(s) {
2018
+ var n = gl(s, "string");
2019
2019
  return typeof n == "symbol" ? n : String(n);
2020
2020
  }
2021
- function pl(s, n) {
2021
+ function gl(s, n) {
2022
2022
  if (typeof s != "object" || s === null)
2023
2023
  return s;
2024
2024
  var a = s[Symbol.toPrimitive];
@@ -2031,29 +2031,29 @@ function pl(s, n) {
2031
2031
  return (n === "string" ? String : Number)(s);
2032
2032
  }
2033
2033
  function qa(s) {
2034
- return s && s.map((n, a) => /* @__PURE__ */ ge.createElement(n.tag, os({
2034
+ return s && s.map((n, a) => /* @__PURE__ */ ge.createElement(n.tag, cs({
2035
2035
  key: a
2036
2036
  }, n.attr), qa(n.child)));
2037
2037
  }
2038
2038
  function ye(s) {
2039
- return (n) => /* @__PURE__ */ ge.createElement(fl, is({
2040
- attr: os({}, s.attr)
2039
+ return (n) => /* @__PURE__ */ ge.createElement(jl, os({
2040
+ attr: cs({}, s.attr)
2041
2041
  }, n), qa(s.child));
2042
2042
  }
2043
- function fl(s) {
2043
+ function jl(s) {
2044
2044
  var n = (a) => {
2045
2045
  var {
2046
2046
  attr: t,
2047
2047
  size: l,
2048
2048
  title: i
2049
- } = s, r = ul(s, dl), d = l || a.size || "1em", c;
2050
- return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ ge.createElement("svg", is({
2049
+ } = s, r = ml(s, hl), d = l || a.size || "1em", c;
2050
+ return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ ge.createElement("svg", os({
2051
2051
  stroke: "currentColor",
2052
2052
  fill: "currentColor",
2053
2053
  strokeWidth: "0"
2054
2054
  }, a.attr, t, r, {
2055
2055
  className: c,
2056
- style: os(os({
2056
+ style: cs(cs({
2057
2057
  color: s.color || a.color
2058
2058
  }, a.style), s.style),
2059
2059
  height: d,
@@ -2063,165 +2063,169 @@ function fl(s) {
2063
2063
  };
2064
2064
  return ea !== void 0 ? /* @__PURE__ */ ge.createElement(ea.Consumer, null, (a) => n(a)) : n(Va);
2065
2065
  }
2066
- function gl(s) {
2066
+ function bl(s) {
2067
2067
  return ye({ 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);
2068
2068
  }
2069
- function jl() {
2070
- const { theme: s } = gt(), n = Ke(), a = Ke(), [t, l] = E(!1), [i, r] = E(!1), [d, c] = E(!1), [u, m] = E(""), [b, g] = E(!1), { authToken: h } = je(), x = z((v) => v.selectedSheetId), C = z((v) => v.dashboard.baseQueries), I = o((v) => v.card), S = z((v) => v.theme), O = o((v) => v.isShowingVisual);
2071
- z((v) => v.onAcceptChanges);
2072
- const y = o(
2073
- (v) => v.selectedConnectionId
2074
- ), M = o(
2075
- (v) => v.selectedDatabaseName
2069
+ function yl() {
2070
+ const { theme: s } = bt(), n = Qe(), a = Qe(), [t, l] = E(!1), [i, r] = E(!1), [d, c] = E(!1), [u, m] = E(""), [y, j] = E(!1), { authToken: h } = je(), x = z((f) => f.selectedSheetId), C = z((f) => f.dashboard.baseQueries), I = o((f) => f.card), S = z((f) => f.theme), O = o((f) => f.isShowingVisual);
2071
+ z((f) => f.onAcceptChanges);
2072
+ const v = o(
2073
+ (f) => f.selectedConnectionId
2076
2074
  ), L = o(
2077
- (v) => v.selectedDatamodelId
2075
+ (f) => f.selectedDatabaseName
2076
+ ), D = o(
2077
+ (f) => f.selectedDatamodelId
2078
2078
  ), p = o(
2079
- (v) => v.selectedSchemaName
2079
+ (f) => f.selectedSchemaName
2080
2080
  );
2081
2081
  z(
2082
- (v) => v.actions.updateFrameCard
2082
+ (f) => f.actions.updateFrameCard
2083
2083
  );
2084
- const w = o((v) => v.selectedTableName), j = o((v) => v.card.sql), f = o((v) => v.card.python), V = jt(j, C), $ = o((v) => v.selectedConnectionId), q = o((v) => v.frame), { getSheetFilterValues: K } = cs(), Y = K(x), Q = o((v) => v.applyFilters), {
2085
- setCardCustomCfg: le,
2086
- setQueryResultColumns: P,
2087
- setFilterValues: re,
2088
- setCardSql: k,
2089
- setCardPython: R,
2090
- setQueryError: W,
2091
- setPythonStdOut: D,
2092
- setCardPreferences: T
2093
- } = o((v) => v.actions), te = o((v) => v.onSave), H = o(
2094
- (v) => v.actions.setApplyFilters
2095
- ), ee = o((v) => v.onClose), se = o((v) => v.actions.setCardData), Le = o((v) => v.actions.setSqlGen), ke = o((v) => v.runSql), ve = o((v) => v.actions.setRunSql), Ce = o(
2096
- (v) => v.actions.setIsSqlRunning
2084
+ const w = o((f) => f.selectedTableName), b = o((f) => f.card.sql), g = o((f) => f.card.python), V = yt(b, C), $ = o((f) => f.selectedConnectionId), q = o((f) => f.frame), P = z((f) => f.dashboard.filters), Z = z((f) => f.filterValues), J = P == null ? void 0 : P.filter(
2085
+ (f) => f.sheetId === x || !f.sheetId
2086
+ ), te = Z == null ? void 0 : Z.filter(
2087
+ (f) => (J == null ? void 0 : J.some((le) => le.id === f.filterId)) || f.filterId.endsWith(x)
2088
+ ), B = o((f) => f.applyFilters), {
2089
+ setCardCustomCfg: ie,
2090
+ setQueryResultColumns: k,
2091
+ setFilterValues: R,
2092
+ setCardSql: Q,
2093
+ setCardPython: M,
2094
+ setQueryError: T,
2095
+ setPythonStdOut: ae,
2096
+ setCardPreferences: H
2097
+ } = o((f) => f.actions), ee = o((f) => f.onSave), ne = o(
2098
+ (f) => f.actions.setApplyFilters
2099
+ ), ve = o((f) => f.onClose), oe = o((f) => f.actions.setCardData), ke = o((f) => f.actions.setSqlGen), ze = o((f) => f.runSql), Fe = o((f) => f.actions.setRunSql), Ce = o(
2100
+ (f) => f.actions.setIsSqlRunning
2097
2101
  ), {
2098
- data: ae,
2099
- isLoading: oe,
2100
- isFetching: ce,
2101
- isSuccess: ze,
2102
- isError: Me,
2103
- error: Re,
2102
+ data: se,
2103
+ isLoading: de,
2104
+ isFetching: Me,
2105
+ isSuccess: Ye,
2106
+ isError: Oe,
2107
+ error: _e,
2104
2108
  status: Bs,
2105
- refetch: Oe
2106
- } = ie({
2107
- queryKey: [V, f],
2108
- queryFn: () => We(
2109
+ refetch: Ae
2110
+ } = ce({
2111
+ queryKey: [V, g],
2112
+ queryFn: () => Je(
2109
2113
  "https://semaphor.cloud/api/v1/query",
2110
2114
  (h == null ? void 0 : h.accessToken) || "",
2111
2115
  {
2112
2116
  connection_id: $,
2113
2117
  sql: V,
2114
- python: f === Qs ? "" : f,
2115
- active_filters: Q ? Y : [],
2116
- cache_config: vt()
2118
+ python: g === Qs ? "" : g,
2119
+ active_filters: B ? te : [],
2120
+ cache_config: Nt()
2117
2121
  }
2118
2122
  ),
2119
2123
  enabled: !1,
2120
2124
  retry: !1
2121
2125
  });
2122
- X(() => {
2123
- if (ae && (se(ae.records), ae.rowLimitExceeded && Ge.error("Row limit (10,000) exceeded. Refine your query.", {
2126
+ Y(() => {
2127
+ if (se && (oe(se.records), se.rowLimitExceeded && Ke.error("Row limit (10,000) exceeded. Refine your query.", {
2124
2128
  position: "top-center",
2125
2129
  richColors: !0
2126
- }), D((ae == null ? void 0 : ae.output) || ""), ae.records.length > 0)) {
2127
- const { dimensionKeys: v } = ys(ae.records);
2128
- P(v);
2130
+ }), ae((se == null ? void 0 : se.output) || ""), se.records.length > 0)) {
2131
+ const { dimensionKeys: f } = bs(se.records);
2132
+ k(f);
2129
2133
  }
2130
- }, [ae, se, P, D]), X(() => {
2131
- ke && (Oe(), ve(!1));
2132
- }, [ke, Oe, ve]), X(() => {
2133
- (oe || ce) && Ce(!0), (Me || ze) && Ce(!1), Me ? (W(Re.message), se([]), P([]), D("")) : W("");
2134
+ }, [se, oe, k, ae]), Y(() => {
2135
+ ze && (Ae(), Fe(!1));
2136
+ }, [ze, Ae, Fe]), Y(() => {
2137
+ (de || Me) && Ce(!0), (Oe || Ye) && Ce(!1), Oe ? (T(_e.message), oe([]), k([]), ae("")) : T("");
2134
2138
  }, [
2135
- oe,
2136
- ce,
2137
- ae,
2138
- D,
2139
+ de,
2139
2140
  Me,
2140
- ze,
2141
- Ce,
2142
2141
  se,
2143
- P,
2144
- W,
2145
- Re
2142
+ ae,
2143
+ Oe,
2144
+ Ye,
2145
+ Ce,
2146
+ oe,
2147
+ k,
2148
+ T,
2149
+ _e
2146
2150
  ]);
2147
- function fs() {
2148
- k(""), se([]), Le({}), le(""), T({});
2151
+ function Xe() {
2152
+ Q(""), oe([]), ke({}), ie(""), H({});
2149
2153
  }
2150
- const Je = (v) => {
2151
- a.current = v;
2154
+ const He = (f) => {
2155
+ a.current = f;
2152
2156
  };
2153
- function Ye(v, de) {
2154
- if (v.length === 0)
2157
+ function Ze(f, le) {
2158
+ if (f.length === 0)
2155
2159
  return "";
2156
- if (de) {
2157
- const Fe = v.find((ne) => ne.id === de);
2158
- if (Fe) {
2159
- const ne = Fe.tabTitle;
2160
- if (ne == "All__Header")
2161
- return v[0].id;
2162
- if (ne && ne.endsWith("__Header")) {
2163
- const Za = ne.split("__")[0], Us = v.find(
2164
- (et) => et.tabTitle === Za
2160
+ if (le) {
2161
+ const Ie = f.find((re) => re.id === le);
2162
+ if (Ie) {
2163
+ const re = Ie.tabTitle;
2164
+ if (re == "All__Header")
2165
+ return f[0].id;
2166
+ if (re && re.endsWith("__Header")) {
2167
+ const st = re.split("__")[0], Us = f.find(
2168
+ (at) => at.tabTitle === st
2165
2169
  );
2166
- return Us ? Us.id : v[0].id;
2170
+ return Us ? Us.id : f[0].id;
2167
2171
  }
2168
- return de;
2172
+ return le;
2169
2173
  }
2170
2174
  }
2171
- return v[0].id;
2175
+ return f[0].id;
2172
2176
  }
2173
- function Xe() {
2174
- let v = j;
2175
- j && !j.includes("{{") && (v = tl(j), k(v));
2176
- const de = {
2177
+ function es() {
2178
+ let f = b;
2179
+ b && !b.includes("{{") && (f = ll(b), Q(f));
2180
+ const le = {
2177
2181
  ...I,
2178
2182
  lastSelectedSchema: p,
2179
- lastSelectedDatamodelId: L,
2180
- lastSelectedDatabase: M,
2183
+ lastSelectedDatamodelId: D,
2184
+ lastSelectedDatabase: L,
2181
2185
  lastSelectedTable: w,
2182
- connectionId: y,
2186
+ connectionId: v,
2183
2187
  type: O ? I.type : "table",
2184
- sql: v,
2188
+ sql: f,
2185
2189
  customCfg: O ? I.customCfg : null
2186
- }, Fe = q.cards.map(
2187
- (gs) => gs.id === I.id ? de : gs
2188
- ), ne = {
2190
+ }, Ie = q.cards.map(
2191
+ (fs) => fs.id === I.id ? le : fs
2192
+ ), re = {
2189
2193
  ...q,
2190
- cards: Fe,
2191
- activeCardId: Ye(Fe, q.activeCardId)
2194
+ cards: Ie,
2195
+ activeCardId: Ze(Ie, q.activeCardId)
2192
2196
  };
2193
- te == null || te(ne);
2197
+ ee == null || ee(re);
2194
2198
  }
2195
- function Ze() {
2196
- ee == null || ee();
2199
+ function ss() {
2200
+ ve == null || ve();
2197
2201
  }
2198
- X(() => {
2199
- const v = n.current, de = a.current;
2200
- if (v) {
2201
- const Fe = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ne = S === "system" ? Fe : S;
2202
- v.editor.defineTheme("default", {
2202
+ Y(() => {
2203
+ const f = n.current, le = a.current;
2204
+ if (f) {
2205
+ const Ie = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", re = S === "system" ? Ie : S;
2206
+ f.editor.defineTheme("default", {
2203
2207
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2204
- base: ne === "light" ? "vs" : "vs-dark",
2208
+ base: re === "light" ? "vs" : "vs-dark",
2205
2209
  inherit: !0,
2206
2210
  rules: [],
2207
2211
  colors: {
2208
2212
  // 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
2209
- "editor.background": ne === "light" ? "#ffffff" : bt("--semaphor-background")
2213
+ "editor.background": re === "light" ? "#ffffff" : vt("--semaphor-background")
2210
2214
  }
2211
- }), v.editor.setTheme("default");
2215
+ }), f.editor.setTheme("default");
2212
2216
  }
2213
- return de && v && de.addCommand(
2214
- v.KeyMod.Shift | v.KeyCode.Enter,
2217
+ return le && f && le.addCommand(
2218
+ f.KeyMod.Shift | f.KeyCode.Enter,
2215
2219
  function() {
2216
- return console.log("Executing query..."), Oe(), !1;
2220
+ return console.log("Executing query..."), Ae(), !1;
2217
2221
  }
2218
2222
  ), () => {
2219
2223
  };
2220
2224
  }, [s, S, n.current]);
2221
- function _e(v) {
2222
- n.current = v;
2225
+ function N(f) {
2226
+ n.current = f;
2223
2227
  }
2224
- function es() {
2228
+ function Za() {
2225
2229
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2226
2230
  i && /* @__PURE__ */ e.jsx(
2227
2231
  "div",
@@ -2231,16 +2235,16 @@ function jl() {
2231
2235
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
2232
2236
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
2233
2237
  /* @__PURE__ */ e.jsx(
2234
- ll,
2238
+ il,
2235
2239
  {
2236
- checked: Q,
2237
- onCheckedChange: () => H(!Q),
2240
+ checked: B,
2241
+ onCheckedChange: () => ne(!B),
2238
2242
  text: "Apply Filters"
2239
2243
  }
2240
2244
  ),
2241
- /* @__PURE__ */ e.jsx(il, {}),
2242
- Y && i && /* @__PURE__ */ e.jsx(
2243
- Be,
2245
+ /* @__PURE__ */ e.jsx(cl, {}),
2246
+ te && i && /* @__PURE__ */ e.jsx(
2247
+ Ue,
2244
2248
  {
2245
2249
  onClick: () => r(!1),
2246
2250
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
@@ -2248,19 +2252,19 @@ function jl() {
2248
2252
  )
2249
2253
  ] }),
2250
2254
  /* @__PURE__ */ e.jsx(
2251
- Pe,
2255
+ Be,
2252
2256
  {
2253
2257
  theme: "default",
2254
- onChange: (v) => {
2255
- if (v)
2258
+ onChange: (f) => {
2259
+ if (f)
2256
2260
  try {
2257
- JSON.parse(v), re(JSON.parse(v));
2261
+ JSON.parse(f), R(JSON.parse(f));
2258
2262
  } catch {
2259
2263
  }
2260
2264
  },
2261
2265
  defaultLanguage: "json",
2262
2266
  className: "mt-1 min-h-[220px]",
2263
- value: JSON.stringify(Y, null, 2),
2267
+ value: JSON.stringify(te, null, 2),
2264
2268
  options: {
2265
2269
  readOnly: !0,
2266
2270
  minimap: {
@@ -2281,30 +2285,30 @@ function jl() {
2281
2285
  ] })
2282
2286
  }
2283
2287
  ),
2284
- Y && !i && /* @__PURE__ */ e.jsx(
2288
+ te && !i && /* @__PURE__ */ e.jsx(
2285
2289
  ca,
2286
2290
  {
2287
2291
  onClick: () => r(!0),
2288
- className: Z(
2292
+ className: X(
2289
2293
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
2290
2294
  {
2291
- "font-bold text-red-800": Q
2295
+ "font-bold text-red-800": B
2292
2296
  }
2293
2297
  )
2294
2298
  }
2295
2299
  )
2296
2300
  ] });
2297
2301
  }
2298
- function N() {
2302
+ function et() {
2299
2303
  return /* @__PURE__ */ e.jsxs(
2300
- vs,
2304
+ ys,
2301
2305
  {
2302
2306
  className: "flex grow pb-1",
2303
2307
  direction: "vertical",
2304
2308
  role: "editor-resizable-group",
2305
2309
  children: [
2306
2310
  /* @__PURE__ */ e.jsxs(
2307
- Ae,
2311
+ Ee,
2308
2312
  {
2309
2313
  id: "1",
2310
2314
  order: 1,
@@ -2317,14 +2321,14 @@ function jl() {
2317
2321
  role: "sql-container",
2318
2322
  className: "relative flex w-[99%]",
2319
2323
  children: /* @__PURE__ */ e.jsx(
2320
- Pe,
2324
+ Be,
2321
2325
  {
2322
2326
  theme: "default",
2323
2327
  className: "pt-3",
2324
- onChange: (v) => {
2325
- k(v);
2328
+ onChange: (f) => {
2329
+ Q(f);
2326
2330
  },
2327
- value: j,
2331
+ value: b,
2328
2332
  options: {
2329
2333
  minimap: {
2330
2334
  enabled: !1
@@ -2338,8 +2342,8 @@ function jl() {
2338
2342
  renderLineHighlight: "none"
2339
2343
  },
2340
2344
  defaultLanguage: "sql",
2341
- beforeMount: _e,
2342
- onMount: Je
2345
+ beforeMount: N,
2346
+ onMount: He
2343
2347
  }
2344
2348
  )
2345
2349
  }
@@ -2349,9 +2353,9 @@ function jl() {
2349
2353
  }
2350
2354
  ),
2351
2355
  t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2352
- /* @__PURE__ */ e.jsx(Cs, { withHandle: !0, className: "border" }),
2356
+ /* @__PURE__ */ e.jsx(vs, { withHandle: !0, className: "border" }),
2353
2357
  /* @__PURE__ */ e.jsxs(
2354
- Ae,
2358
+ Ee,
2355
2359
  {
2356
2360
  id: "2",
2357
2361
  order: 2,
@@ -2364,14 +2368,14 @@ function jl() {
2364
2368
  role: "python-container",
2365
2369
  className: "relative flex w-[99%] pt-0",
2366
2370
  children: /* @__PURE__ */ e.jsx(
2367
- Pe,
2371
+ Be,
2368
2372
  {
2369
2373
  className: "pt-3",
2370
2374
  theme: "default",
2371
- onChange: (v) => {
2372
- R(v && v.trim() || "");
2375
+ onChange: (f) => {
2376
+ M(f && f.trim() || "");
2373
2377
  },
2374
- value: f || Qs,
2378
+ value: g || Qs,
2375
2379
  options: {
2376
2380
  minimap: {
2377
2381
  enabled: !1
@@ -2385,8 +2389,8 @@ function jl() {
2385
2389
  renderLineHighlight: "none"
2386
2390
  },
2387
2391
  defaultLanguage: "python",
2388
- beforeMount: _e,
2389
- onMount: Je
2392
+ beforeMount: N,
2393
+ onMount: He
2390
2394
  }
2391
2395
  )
2392
2396
  }
@@ -2414,8 +2418,8 @@ function jl() {
2414
2418
  role: "sql-editor",
2415
2419
  className: "relative flex grow justify-between overflow-y-scroll",
2416
2420
  children: [
2417
- N(),
2418
- es()
2421
+ et(),
2422
+ Za()
2419
2423
  ]
2420
2424
  }
2421
2425
  ),
@@ -2430,37 +2434,37 @@ function jl() {
2430
2434
  F,
2431
2435
  {
2432
2436
  title: "Shift + Enter",
2433
- disabled: oe || ce,
2437
+ disabled: de || Me,
2434
2438
  onClick: () => {
2435
- Oe();
2439
+ Ae();
2436
2440
  },
2437
2441
  className: "shrink-0",
2438
2442
  size: "sm",
2439
2443
  variant: "outline",
2440
2444
  children: [
2441
- oe || ce ? /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Rn, { className: "mr-2 h-4 w-4" }),
2445
+ de || Me ? /* @__PURE__ */ e.jsx(We, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Hn, { className: "mr-2 h-4 w-4" }),
2442
2446
  "Run"
2443
2447
  ]
2444
2448
  }
2445
2449
  ),
2446
- Me && /* @__PURE__ */ e.jsx(
2447
- nl,
2450
+ Oe && /* @__PURE__ */ e.jsx(
2451
+ rl,
2448
2452
  {
2449
- error: Re.message,
2453
+ error: _e.message,
2450
2454
  setShowAIDialog: c,
2451
- setTriggerAIRun: g,
2455
+ setTriggerAIRun: j,
2452
2456
  setUserInputforAI: m
2453
2457
  }
2454
2458
  ),
2455
2459
  /* @__PURE__ */ e.jsxs(
2456
2460
  F,
2457
2461
  {
2458
- onClick: fs,
2462
+ onClick: Xe,
2459
2463
  className: "",
2460
2464
  size: "sm",
2461
2465
  variant: "outline",
2462
2466
  children: [
2463
- /* @__PURE__ */ e.jsx(zn, { className: "mr-2 size-4" }),
2467
+ /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-4" }),
2464
2468
  "Clear"
2465
2469
  ]
2466
2470
  }
@@ -2469,22 +2473,22 @@ function jl() {
2469
2473
  xa,
2470
2474
  {
2471
2475
  pressed: t,
2472
- onPressedChange: (v) => l(v),
2476
+ onPressedChange: (f) => l(f),
2473
2477
  className: "",
2474
2478
  size: "sm",
2475
2479
  variant: "outline",
2476
- children: /* @__PURE__ */ e.jsx(gl, { className: "size-4 text-foreground/70" })
2480
+ children: /* @__PURE__ */ e.jsx(bl, { className: "size-4 text-foreground/70" })
2477
2481
  }
2478
2482
  ),
2479
2483
  /* @__PURE__ */ e.jsx(
2480
- cl,
2484
+ ul,
2481
2485
  {
2482
2486
  open: d,
2483
2487
  setOpen: c,
2484
2488
  userInput: u,
2485
- triggerAIRun: b,
2486
- setTriggerAIRun: g,
2487
- setUserInput: (v) => m(v)
2489
+ triggerAIRun: y,
2490
+ setTriggerAIRun: j,
2491
+ setUserInput: (f) => m(f)
2488
2492
  }
2489
2493
  )
2490
2494
  ] }),
@@ -2492,11 +2496,11 @@ function jl() {
2492
2496
  /* @__PURE__ */ e.jsxs(
2493
2497
  F,
2494
2498
  {
2495
- onClick: Xe,
2499
+ onClick: es,
2496
2500
  size: "sm",
2497
2501
  variant: "outline",
2498
2502
  children: [
2499
- /* @__PURE__ */ e.jsx(yt, { className: "mr-2 size-4 font-bold text-green-600" }),
2503
+ /* @__PURE__ */ e.jsx(Ct, { className: "mr-2 size-4 font-bold text-green-600" }),
2500
2504
  "Accept"
2501
2505
  ]
2502
2506
  }
@@ -2504,12 +2508,12 @@ function jl() {
2504
2508
  /* @__PURE__ */ e.jsxs(
2505
2509
  F,
2506
2510
  {
2507
- onClick: Ze,
2511
+ onClick: ss,
2508
2512
  className: "w-full",
2509
2513
  size: "sm",
2510
2514
  variant: "outline",
2511
2515
  children: [
2512
- /* @__PURE__ */ e.jsx(Be, { className: "mr-2 size-4" }),
2516
+ /* @__PURE__ */ e.jsx(Ue, { className: "mr-2 size-4" }),
2513
2517
  "Close"
2514
2518
  ]
2515
2519
  }
@@ -2523,7 +2527,7 @@ function jl() {
2523
2527
  )
2524
2528
  );
2525
2529
  }
2526
- function bl({ data: s }) {
2530
+ function vl({ data: s }) {
2527
2531
  var r;
2528
2532
  const [n, a] = ge.useState([]), l = Object.keys(s[0]).map((d) => ({
2529
2533
  // header: key,
@@ -2537,61 +2541,61 @@ function bl({ data: s }) {
2537
2541
  onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
2538
2542
  children: [
2539
2543
  d,
2540
- u === "asc" ? /* @__PURE__ */ e.jsx(Ct, { className: "ml-2 h-5 w-5" }) : u === "desc" ? /* @__PURE__ */ e.jsx(Nt, { className: "ml-2 h-5 w-5" }) : null
2544
+ u === "asc" ? /* @__PURE__ */ e.jsx(St, { className: "ml-2 h-5 w-5" }) : u === "desc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : null
2541
2545
  ]
2542
2546
  }
2543
2547
  ) });
2544
2548
  }
2545
- })), i = St({
2549
+ })), i = kt({
2546
2550
  data: s,
2547
2551
  columns: l,
2548
- getCoreRowModel: It(),
2549
- getPaginationRowModel: Tt(),
2552
+ getCoreRowModel: Dt(),
2553
+ getPaginationRowModel: Lt(),
2550
2554
  onSortingChange: a,
2551
- getSortedRowModel: Dt(),
2555
+ getSortedRowModel: Mt(),
2552
2556
  manualPagination: !0,
2553
2557
  state: {
2554
2558
  sorting: n
2555
2559
  }
2556
2560
  });
2557
- return /* @__PURE__ */ e.jsxs(wt, { children: [
2558
- /* @__PURE__ */ e.jsx(kt, { children: i.getHeaderGroups().map((d) => /* @__PURE__ */ e.jsx(js, { children: d.headers.map((c) => /* @__PURE__ */ e.jsx(zt, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Ws(
2561
+ return /* @__PURE__ */ e.jsxs(zt, { children: [
2562
+ /* @__PURE__ */ e.jsx(Ft, { children: i.getHeaderGroups().map((d) => /* @__PURE__ */ e.jsx(gs, { children: d.headers.map((c) => /* @__PURE__ */ e.jsx(It, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Ws(
2559
2563
  c.column.columnDef.header,
2560
2564
  c.getContext()
2561
2565
  ) }, c.id)) }, d.id)) }),
2562
- /* @__PURE__ */ e.jsx(Ft, { children: (r = i.getRowModel().rows) != null && r.length ? i.getRowModel().rows.map((d) => /* @__PURE__ */ e.jsx(
2563
- js,
2566
+ /* @__PURE__ */ e.jsx(Tt, { children: (r = i.getRowModel().rows) != null && r.length ? i.getRowModel().rows.map((d) => /* @__PURE__ */ e.jsx(
2567
+ gs,
2564
2568
  {
2565
2569
  className: "whitespace-nowrap py-2",
2566
2570
  "data-state": d.getIsSelected() && "selected",
2567
2571
  children: d.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Js, { children: Ws(c.column.columnDef.cell, c.getContext()) }, c.id))
2568
2572
  },
2569
2573
  d.id
2570
- )) : /* @__PURE__ */ e.jsx(js, { children: /* @__PURE__ */ e.jsx(Js, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2574
+ )) : /* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsx(Js, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2571
2575
  ] });
2572
2576
  }
2573
- function yl({ card: s }) {
2574
- var u, m, b, g, h, x, C, I, S, O;
2575
- const n = z((y) => y.themeStyle), a = {
2577
+ function Cl({ card: s }) {
2578
+ var u, m, y, j, h, x, C, I, S, O;
2579
+ const n = z((v) => v.themeStyle), a = {
2576
2580
  colors: ((m = (u = n == null ? void 0 : n.chart) == null ? void 0 : u.dataset) == null ? void 0 : m.backgroundColor) || []
2577
2581
  };
2578
- (b = s.customCardPreferences) != null && b.inputData;
2579
- const { getCard: t } = ja(((g = s.customCardPreferences) == null ? void 0 : g.url) || ""), l = ((h = s.customCardPreferences) == null ? void 0 : h.visualType) || "single", i = o((y) => y.frame);
2582
+ (y = s.customCardPreferences) != null && y.inputData;
2583
+ const { getCard: t } = ja(((j = s.customCardPreferences) == null ? void 0 : j.url) || ""), l = ((h = s.customCardPreferences) == null ? void 0 : h.visualType) || "single", i = o((v) => v.frame);
2580
2584
  if (be(), !((x = s.customCardPreferences) != null && x.componentName))
2581
2585
  return null;
2582
2586
  const r = t(
2583
2587
  (C = s.customCardPreferences) == null ? void 0 : C.componentName
2584
- ), d = (y) => {
2585
- console.log("data", y), s.customCardPreferences;
2588
+ ), d = (v) => {
2589
+ console.log("data", v), s.customCardPreferences;
2586
2590
  }, c = Object.keys(
2587
2591
  ((I = s.customCardPreferences) == null ? void 0 : I.dataInputCardIds) || {}
2588
- ).map((y) => {
2589
- var p, w, j;
2590
- const M = (w = (p = s.customCardPreferences) == null ? void 0 : p.dataInputCardIds) == null ? void 0 : w[y].cardId, L = (j = i == null ? void 0 : i.cards) == null ? void 0 : j.find((f) => f.id === M);
2591
- return L || null;
2592
+ ).map((v) => {
2593
+ var p, w, b;
2594
+ const L = (w = (p = s.customCardPreferences) == null ? void 0 : p.dataInputCardIds) == null ? void 0 : w[v].cardId, D = (b = i == null ? void 0 : i.cards) == null ? void 0 : b.find((g) => g.id === L);
2595
+ return D || null;
2592
2596
  });
2593
2597
  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(
2594
- vn,
2598
+ Nn,
2595
2599
  {
2596
2600
  fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
2597
2601
  children: [
@@ -2610,12 +2614,12 @@ function yl({ card: s }) {
2610
2614
  theme: a,
2611
2615
  onDataChange: d,
2612
2616
  settings: c.map(
2613
- (y) => {
2614
- var M;
2615
- return (M = y == null ? void 0 : y.customCardPreferences) == null ? void 0 : M.settings;
2617
+ (v) => {
2618
+ var L;
2619
+ return (L = v == null ? void 0 : v.customCardPreferences) == null ? void 0 : L.settings;
2616
2620
  }
2617
2621
  ),
2618
- data: c.map((y) => (y == null ? void 0 : y.data) || [])
2622
+ data: c.map((v) => (v == null ? void 0 : v.data) || [])
2619
2623
  }
2620
2624
  ) })
2621
2625
  ]
@@ -2629,12 +2633,12 @@ function Ra({
2629
2633
  className: s,
2630
2634
  ...n
2631
2635
  }) {
2632
- var g, h;
2636
+ var j, h;
2633
2637
  ge.useState(0);
2634
- const a = z((x) => x.themeStyle), t = o((x) => x.card), l = ((g = t.customCardPreferences) == null ? void 0 : g.showCardHeader) ?? !0, i = o((x) => x.frame), r = z((x) => x.dashboard.filters);
2638
+ const a = z((x) => x.themeStyle), t = o((x) => x.card), l = ((j = t.customCardPreferences) == null ? void 0 : j.showCardHeader) ?? !0, i = o((x) => x.frame), r = z((x) => x.dashboard.filters);
2635
2639
  z((x) => x.filterValues), o((x) => x.actions.setRunSql);
2636
- const { updateFilter: d } = cs(), c = r == null ? void 0 : r.find((x) => x.id === i.filterId), u = o((x) => x.actions.setCard);
2637
- if (X(() => {
2640
+ const { updateFilter: d } = Ss(), c = r == null ? void 0 : r.find((x) => x.id === i.filterId), u = o((x) => x.actions.setCard);
2641
+ if (Y(() => {
2638
2642
  }, [
2639
2643
  t.data,
2640
2644
  t.type,
@@ -2652,40 +2656,40 @@ function Ra({
2652
2656
  customCfg: t.customCfg,
2653
2657
  preferences: t.preferences
2654
2658
  }));
2655
- function b(x) {
2656
- return /* @__PURE__ */ e.jsx(yl, { card: x });
2659
+ function y(x) {
2660
+ return /* @__PURE__ */ e.jsx(Cl, { card: x });
2657
2661
  }
2658
2662
  return /* @__PURE__ */ e.jsxs(
2659
- Lt,
2663
+ Ot,
2660
2664
  {
2661
2665
  role: "editor-visual-card",
2662
- className: Z("relative flex h-full flex-col rounded-none", s),
2666
+ className: X("relative flex h-full flex-col rounded-none", s),
2663
2667
  ...n,
2664
2668
  children: [
2665
- l && /* @__PURE__ */ e.jsxs(Mt, { className: "flex flex-row items-start justify-between py-4", children: [
2669
+ l && /* @__PURE__ */ e.jsxs(At, { className: "flex flex-row items-start justify-between py-4", children: [
2666
2670
  /* @__PURE__ */ e.jsxs("div", { children: [
2667
2671
  /* @__PURE__ */ e.jsx(
2668
- ts,
2672
+ ns,
2669
2673
  {
2670
2674
  text: t.title,
2671
2675
  onSave: (x) => u({ ...t, title: x }),
2672
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(Ot, { className: "text-base", children: t.title || "Edit title..." }) })
2676
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(Et, { className: "text-base", children: t.title || "Edit title..." }) })
2673
2677
  },
2674
2678
  t.title
2675
2679
  ),
2676
2680
  /* @__PURE__ */ e.jsx(
2677
- ts,
2681
+ ns,
2678
2682
  {
2679
2683
  text: t.description || "",
2680
2684
  onSave: (x) => u({ ...t, description: x }),
2681
- children: /* @__PURE__ */ e.jsx(At, { children: t.description || "Edit description..." })
2685
+ children: /* @__PURE__ */ e.jsx(Vt, { children: t.description || "Edit description..." })
2682
2686
  },
2683
2687
  t.description
2684
2688
  )
2685
2689
  ] }),
2686
2690
  c && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2687
2691
  /* @__PURE__ */ e.jsx(
2688
- ts,
2692
+ ns,
2689
2693
  {
2690
2694
  className: "my-1",
2691
2695
  text: c.title || c.column,
@@ -2693,85 +2697,85 @@ function Ra({
2693
2697
  children: /* @__PURE__ */ e.jsx(_, { children: c.title })
2694
2698
  }
2695
2699
  ),
2696
- Et(c)
2700
+ qt(c)
2697
2701
  ] })
2698
2702
  ] }),
2699
- /* @__PURE__ */ e.jsxs(Vt, { className: "flex grow flex-col", children: [
2700
- t.type === "custom" && b(t),
2703
+ /* @__PURE__ */ e.jsxs(Rt, { className: "flex grow flex-col", children: [
2704
+ t.type === "custom" && y(t),
2701
2705
  !["table", "custom"].includes(t.type) && m && // <ChartJsVisual key={visualKey} cfg={cfg} />
2702
2706
  /* @__PURE__ */ e.jsx(
2703
- qt,
2707
+ _t,
2704
2708
  {
2705
2709
  cfg: m
2706
2710
  },
2707
2711
  JSON.stringify(m) + JSON.stringify(t.preferences) + ((h = t == null ? void 0 : t.preferences) == null ? void 0 : h.customVisualCode)
2708
2712
  ),
2709
2713
  t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2710
- /* @__PURE__ */ e.jsx(Rt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(_t, { card: t, data: t == null ? void 0 : t.data }) })
2714
+ /* @__PURE__ */ e.jsx(Ht, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx($t, { card: t, data: t == null ? void 0 : t.data }) })
2711
2715
  ] })
2712
2716
  ]
2713
2717
  }
2714
2718
  );
2715
2719
  }
2716
- function vl() {
2717
- const [s, n] = E(!1), [a, t] = E(""), [l, i] = E(""), [r, d] = E(""), [c, u] = E(""), m = o((y) => y.card), b = o(
2718
- (y) => y.card.customCfg
2719
- ), { setCardCustomCfg: g, setCustomVisualCode: h } = be();
2720
- function x(y) {
2720
+ function Nl() {
2721
+ const [s, n] = E(!1), [a, t] = E(""), [l, i] = E(""), [r, d] = E(""), [c, u] = E(""), m = o((v) => v.card), y = o(
2722
+ (v) => v.card.customCfg
2723
+ ), { setCardCustomCfg: j, setCustomVisualCode: h } = be();
2724
+ function x(v) {
2721
2725
  var p, w;
2722
- const M = {
2723
- ...y,
2726
+ const L = {
2727
+ ...v,
2724
2728
  data: {
2725
- ...y == null ? void 0 : y.data,
2726
- datasets: (w = (p = y == null ? void 0 : y.data) == null ? void 0 : p.datasets) == null ? void 0 : w.map((j) => ({
2727
- ...j,
2729
+ ...v == null ? void 0 : v.data,
2730
+ datasets: (w = (p = v == null ? void 0 : v.data) == null ? void 0 : p.datasets) == null ? void 0 : w.map((b) => ({
2731
+ ...b,
2728
2732
  data: []
2729
2733
  }))
2730
2734
  }
2731
2735
  };
2732
- return JSON.stringify(M, null, 1);
2736
+ return JSON.stringify(L, null, 1);
2733
2737
  }
2734
2738
  function C() {
2735
- var M, L;
2739
+ var L, D;
2736
2740
  if (!m.data || m.data.length === 0)
2737
2741
  return;
2738
- const y = ba({
2742
+ const v = ba({
2739
2743
  data: m.data,
2740
2744
  cardType: m.type,
2741
2745
  cfg: m.cfg,
2742
2746
  preferences: m.preferences
2743
2747
  });
2744
- y && (t(JSON.stringify(y, null, 1)), (M = m == null ? void 0 : m.preferences) != null && M.customVisualCode && d((L = m == null ? void 0 : m.preferences) == null ? void 0 : L.customVisualCode), b && i(JSON.stringify(b, null, 1)));
2748
+ v && (t(JSON.stringify(v, null, 1)), (L = m == null ? void 0 : m.preferences) != null && L.customVisualCode && d((D = m == null ? void 0 : m.preferences) == null ? void 0 : D.customVisualCode), y && i(JSON.stringify(y, null, 1)));
2745
2749
  }
2746
2750
  function I() {
2747
2751
  if (r && h(r), !!l)
2748
2752
  try {
2749
- const y = JSON.parse(l);
2750
- return y ? (g(y), u(""), i(""), y) : void 0;
2751
- } catch (y) {
2752
- console.log(y), u("Invalid JSON");
2753
+ const v = JSON.parse(l);
2754
+ return v ? (j(v), u(""), i(""), v) : void 0;
2755
+ } catch (v) {
2756
+ console.log(v), u("Invalid JSON");
2753
2757
  }
2754
2758
  }
2755
2759
  function S() {
2756
- i(""), g(null);
2760
+ i(""), j(null);
2757
2761
  }
2758
2762
  function O() {
2759
- let y;
2760
- if (b) {
2761
- const M = Ys.cloneDeep(m.cfg), L = Ys.merge(M, b);
2762
- return y = x(L), y;
2763
+ let v;
2764
+ if (y) {
2765
+ const L = Ys.cloneDeep(m.cfg), D = Ys.merge(L, y);
2766
+ return v = x(D), v;
2763
2767
  }
2764
- return a ? (y = x(JSON.parse(a)), y) : "";
2768
+ return a ? (v = x(JSON.parse(a)), v) : "";
2765
2769
  }
2766
2770
  return /* @__PURE__ */ e.jsxs(ws, { open: s, onOpenChange: n, children: [
2767
2771
  /* @__PURE__ */ e.jsx(ks, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2768
2772
  F,
2769
2773
  {
2770
2774
  onClick: C,
2771
- className: ` ${b && "border-foreground/50 dark:border-foreground/70"}`,
2775
+ className: ` ${y && "border-foreground/50 dark:border-foreground/70"}`,
2772
2776
  size: "sm",
2773
2777
  variant: "outline",
2774
- children: /* @__PURE__ */ e.jsx(Ht, { className: "h-4 w-4" })
2778
+ children: /* @__PURE__ */ e.jsx(Pt, { className: "h-4 w-4" })
2775
2779
  }
2776
2780
  ) }),
2777
2781
  /* @__PURE__ */ e.jsxs(
@@ -2812,15 +2816,15 @@ function vl() {
2812
2816
  /* @__PURE__ */ e.jsx(Ra, { className: "w-1/2 rounded shadow-none" }),
2813
2817
  /* @__PURE__ */ e.jsxs(ya, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2814
2818
  /* @__PURE__ */ e.jsxs(va, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2815
- /* @__PURE__ */ e.jsxs(ns, { value: "custom-config", children: [
2816
- b && /* @__PURE__ */ e.jsx(Ca, { className: "mr-1 h-5 w-5 text-green-600" }),
2817
- b ? "Custom Config" : "Default Config"
2819
+ /* @__PURE__ */ e.jsxs(ls, { value: "custom-config", children: [
2820
+ y && /* @__PURE__ */ e.jsx(Ca, { className: "mr-1 h-5 w-5 text-green-600" }),
2821
+ y ? "Custom Config" : "Default Config"
2818
2822
  ] }),
2819
- /* @__PURE__ */ e.jsx(ns, { className: "", value: "output", children: "Output" }),
2820
- /* @__PURE__ */ e.jsx(ns, { className: "", value: "custom-code", children: "Custom Code" })
2823
+ /* @__PURE__ */ e.jsx(ls, { className: "", value: "output", children: "Output" }),
2824
+ /* @__PURE__ */ e.jsx(ls, { className: "", value: "custom-code", children: "Custom Code" })
2821
2825
  ] }),
2822
2826
  /* @__PURE__ */ e.jsx(
2823
- ls,
2827
+ rs,
2824
2828
  {
2825
2829
  className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
2826
2830
  value: "output",
@@ -2835,12 +2839,12 @@ function vl() {
2835
2839
  }
2836
2840
  ),
2837
2841
  /* @__PURE__ */ e.jsx(
2838
- ls,
2842
+ rs,
2839
2843
  {
2840
2844
  className: "mt-0 grow rounded-b border border-t-0",
2841
2845
  value: "custom-config",
2842
2846
  children: /* @__PURE__ */ e.jsx(
2843
- Pe,
2847
+ Be,
2844
2848
  {
2845
2849
  className: "h-full w-full overflow-hidden",
2846
2850
  theme: "default",
@@ -2858,18 +2862,18 @@ function vl() {
2858
2862
  },
2859
2863
  defaultLanguage: "json",
2860
2864
  value: O(),
2861
- onChange: (y) => i(y)
2865
+ onChange: (v) => i(v)
2862
2866
  }
2863
2867
  )
2864
2868
  }
2865
2869
  ),
2866
2870
  /* @__PURE__ */ e.jsx(
2867
- ls,
2871
+ rs,
2868
2872
  {
2869
2873
  className: "mt-0 grow rounded-b border border-t-0",
2870
2874
  value: "custom-code",
2871
2875
  children: /* @__PURE__ */ e.jsx(
2872
- Pe,
2876
+ Be,
2873
2877
  {
2874
2878
  className: "h-full w-full overflow-hidden",
2875
2879
  theme: "default",
@@ -2887,7 +2891,7 @@ function vl() {
2887
2891
  },
2888
2892
  defaultLanguage: "javascript",
2889
2893
  value: r,
2890
- onChange: (y) => d(y || "")
2894
+ onChange: (v) => d(v || "")
2891
2895
  }
2892
2896
  )
2893
2897
  }
@@ -2899,7 +2903,7 @@ function vl() {
2899
2903
  /* @__PURE__ */ e.jsx(
2900
2904
  F,
2901
2905
  {
2902
- disabled: !b,
2906
+ disabled: !y,
2903
2907
  onClick: S,
2904
2908
  variant: "outline",
2905
2909
  children: "Reset"
@@ -2939,33 +2943,33 @@ function Ka(s) {
2939
2943
  }
2940
2944
  function Qa(s) {
2941
2945
  const [n, a] = E(null);
2942
- return X(() => {
2946
+ return Y(() => {
2943
2947
  s && (async () => {
2944
- const i = (await import("./lucide-react-te4lV1WE.js"))[s];
2948
+ const i = (await import("./lucide-react-OlWvERU9.js"))[s];
2945
2949
  a(i);
2946
2950
  })();
2947
2951
  }, [s]), n;
2948
2952
  }
2949
2953
  function Wa() {
2950
- const { authToken: s } = je(), { data: n, isLoading: a, isFetching: t, isError: l } = ie({
2954
+ const { authToken: s } = je(), { data: n, isLoading: a, isFetching: t, isError: l } = ce({
2951
2955
  queryKey: ["plugins", s == null ? void 0 : s.accessToken],
2952
- queryFn: () => $t(s == null ? void 0 : s.accessToken)
2956
+ queryFn: () => Bt(s == null ? void 0 : s.accessToken)
2953
2957
  // staleTime: Infinity,
2954
2958
  });
2955
2959
  return { data: n, isLoading: a, isFetching: t, isError: l };
2956
2960
  }
2957
- function Cl({
2961
+ function Sl({
2958
2962
  onChartTypeChange: s
2959
2963
  }) {
2960
2964
  const [n, a] = E([]), { data: t } = Wa();
2961
- return X(() => {
2965
+ return Y(() => {
2962
2966
  (async () => {
2963
2967
  var i;
2964
2968
  if (t) {
2965
2969
  const d = (await Promise.all(
2966
- (i = t == null ? void 0 : t.plugins) == null ? void 0 : i.map(async (c) => (await Pt(c.value)).visuals.map((b) => ({
2967
- name: b.name,
2968
- icon: b.icon,
2970
+ (i = t == null ? void 0 : t.plugins) == null ? void 0 : i.map(async (c) => (await Ut(c.value)).visuals.map((y) => ({
2971
+ name: y.name,
2972
+ icon: y.icon,
2969
2973
  url: c.value
2970
2974
  })))
2971
2975
  )).flat();
@@ -2973,9 +2977,9 @@ function Cl({
2973
2977
  }
2974
2978
  })();
2975
2979
  }, [t]), n.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2976
- /* @__PURE__ */ e.jsx(Ie, { className: "my-2" }),
2980
+ /* @__PURE__ */ e.jsx(Te, { className: "my-2" }),
2977
2981
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: n.map((l, i) => /* @__PURE__ */ e.jsx(
2978
- Nl,
2982
+ wl,
2979
2983
  {
2980
2984
  text: l.name,
2981
2985
  onClick: () => s("custom", l),
@@ -2985,7 +2989,7 @@ function Cl({
2985
2989
  )) })
2986
2990
  ] });
2987
2991
  }
2988
- const Nl = ({
2992
+ const wl = ({
2989
2993
  text: s,
2990
2994
  icon: n,
2991
2995
  onClick: a
@@ -2993,11 +2997,11 @@ const Nl = ({
2993
2997
  const t = Qa(n || ""), l = s.charAt(0).toUpperCase();
2994
2998
  return /* @__PURE__ */ e.jsx(F, { onClick: a, title: s, variant: "ghost", children: t ? /* @__PURE__ */ e.jsx(t, { className: "h-4 w-4" }) : l });
2995
2999
  };
2996
- function Sl() {
2997
- var m, b;
2998
- const [s, n] = E(!1), a = o((g) => g.card), t = a.type, { setCardType: l, setCardPreferences: i, setChartOrientation: r } = o((g) => g.actions), { setCardCustomCfg: d, setCustomCardPreferences: c } = be();
2999
- function u(g, h) {
3000
- d(null), i({}), l(g), h && c({
3000
+ function kl() {
3001
+ var m, y;
3002
+ const [s, n] = E(!1), a = o((j) => j.card), t = a.type, { setCardType: l, setCardPreferences: i, setChartOrientation: r } = o((j) => j.actions), { setCardCustomCfg: d, setCustomCardPreferences: c } = be();
3003
+ function u(j, h) {
3004
+ d(null), i({}), l(j), h && c({
3001
3005
  type: "component",
3002
3006
  visualType: "single",
3003
3007
  url: h.url,
@@ -3007,12 +3011,12 @@ function Sl() {
3007
3011
  }
3008
3012
  return /* @__PURE__ */ e.jsxs(us, { open: s, onOpenChange: n, children: [
3009
3013
  /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3010
- wl,
3014
+ zl,
3011
3015
  {
3012
3016
  className: "h-4 w-4",
3013
3017
  chartType: t,
3014
3018
  customIcon: (m = a.customCardPreferences) == null ? void 0 : m.icon,
3015
- componentName: (b = a.customCardPreferences) == null ? void 0 : b.componentName
3019
+ componentName: (y = a.customCardPreferences) == null ? void 0 : y.componentName
3016
3020
  }
3017
3021
  ) }) }),
3018
3022
  /* @__PURE__ */ e.jsxs(ms, { className: "w-50", children: [
@@ -3153,11 +3157,11 @@ function Sl() {
3153
3157
  }
3154
3158
  )
3155
3159
  ] }),
3156
- /* @__PURE__ */ e.jsx(Cl, { onChartTypeChange: u })
3160
+ /* @__PURE__ */ e.jsx(Sl, { onChartTypeChange: u })
3157
3161
  ] })
3158
3162
  ] });
3159
3163
  }
3160
- function wl({
3164
+ function zl({
3161
3165
  chartType: s,
3162
3166
  className: n,
3163
3167
  customIcon: a,
@@ -3199,7 +3203,7 @@ function wl({
3199
3203
  return /* @__PURE__ */ e.jsx(Os, { className: n });
3200
3204
  }
3201
3205
  }
3202
- function kl() {
3206
+ function Fl() {
3203
3207
  var l;
3204
3208
  const s = o((i) => i.card), n = ((l = s.customCardPreferences) == null ? void 0 : l.showCardHeader) ?? !0, { setCustomCardPreferences: a } = be(), t = (i) => {
3205
3209
  s.customCardPreferences && a({
@@ -3211,7 +3215,7 @@ function kl() {
3211
3215
  /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3212
3216
  /* @__PURE__ */ e.jsxs(oa, { align: "start", className: "w-40 text-muted-foreground", children: [
3213
3217
  /* @__PURE__ */ e.jsx(
3214
- Bt,
3218
+ Gt,
3215
3219
  {
3216
3220
  checked: n,
3217
3221
  onCheckedChange: t,
@@ -3219,10 +3223,10 @@ function kl() {
3219
3223
  }
3220
3224
  ),
3221
3225
  /* @__PURE__ */ e.jsxs(
3222
- Ut,
3226
+ Kt,
3223
3227
  {
3224
3228
  onClick: () => {
3225
- navigator.clipboard.writeText(s.id), Ge.success("Card ID copied to clipboard");
3229
+ navigator.clipboard.writeText(s.id), Ke.success("Card ID copied to clipboard");
3226
3230
  },
3227
3231
  className: "cursor-pointer space-x-2",
3228
3232
  children: [
@@ -3240,9 +3244,9 @@ function aa() {
3240
3244
  const { setFrame: c, setCard: u, updateCardInFrame: m } = be();
3241
3245
  if (!n)
3242
3246
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3243
- function b() {
3247
+ function y() {
3244
3248
  const p = {
3245
- id: Ue(),
3249
+ id: Ge(),
3246
3250
  title: "Title",
3247
3251
  description: "Description",
3248
3252
  preferences: {
@@ -3257,9 +3261,9 @@ function aa() {
3257
3261
  sql: "",
3258
3262
  data: []
3259
3263
  };
3260
- g(p);
3264
+ j(p);
3261
3265
  }
3262
- function g(p) {
3266
+ function j(p) {
3263
3267
  const w = {
3264
3268
  ...s,
3265
3269
  cards: [...s.cards, p],
@@ -3270,58 +3274,58 @@ function aa() {
3270
3274
  function h() {
3271
3275
  const p = {
3272
3276
  ...n,
3273
- id: Ue(),
3277
+ id: Ge(),
3274
3278
  title: `${n.title} Copy`,
3275
3279
  tabTitle: `${n.tabTitle} Copy`
3276
3280
  };
3277
- g(p);
3281
+ j(p);
3278
3282
  }
3279
3283
  function x(p) {
3280
- const w = s.cards.filter((V) => V.id !== p), j = w[0], f = {
3284
+ const w = s.cards.filter((V) => V.id !== p), b = w[0], g = {
3281
3285
  ...s,
3282
3286
  cards: w,
3283
3287
  // update the active card to the first card in the frame
3284
- activeCardId: j.id
3288
+ activeCardId: b.id
3285
3289
  };
3286
- c(f), u(j);
3290
+ c(g), u(b);
3287
3291
  }
3288
3292
  function C(p) {
3289
3293
  const w = {
3290
3294
  ...s,
3291
- cards: s.cards.map((f) => f.id === n.id ? n : f),
3295
+ cards: s.cards.map((g) => g.id === n.id ? n : g),
3292
3296
  activeCardId: p
3293
3297
  };
3294
3298
  c(w);
3295
- const j = w.cards.find((f) => f.id === p);
3296
- u(j), j.sql && j.data && j.data.length === 0 && d(!0);
3299
+ const b = w.cards.find((g) => g.id === p);
3300
+ u(b), b.sql && b.data && b.data.length === 0 && d(!0);
3297
3301
  }
3298
3302
  const I = (p, w) => {
3299
3303
  console.log("handleDragStart", w), p.dataTransfer.setData("tabIndex", w.toString());
3300
3304
  }, S = (p) => {
3301
3305
  p.preventDefault();
3302
3306
  }, O = (p, w) => {
3303
- const j = p.dataTransfer.getData("tabIndex");
3304
- if (j === w.toString())
3307
+ const b = p.dataTransfer.getData("tabIndex");
3308
+ if (b === w.toString())
3305
3309
  return;
3306
- const f = Array.from(s.cards), [V] = f.splice(parseInt(j), 1);
3307
- f.splice(w, 0, V), c({ ...s, cards: f });
3310
+ const g = Array.from(s.cards), [V] = g.splice(parseInt(b), 1);
3311
+ g.splice(w, 0, V), c({ ...s, cards: g });
3308
3312
  };
3309
- function y(p, w) {
3313
+ function v(p, w) {
3310
3314
  return p.cards.length === 1 && (w.displayTab === !0 || w.displayTab === void 0) || p.activeCardId !== w.id && (w.displayTab === !0 || w.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3311
3315
  "div",
3312
3316
  {
3313
3317
  onClick: () => {
3314
- const j = w.displayTab === void 0 ? !1 : !w.displayTab;
3315
- u({ ...w, displayTab: j }), m({
3318
+ const b = w.displayTab === void 0 ? !1 : !w.displayTab;
3319
+ u({ ...w, displayTab: b }), m({
3316
3320
  ...w,
3317
- displayTab: j
3321
+ displayTab: b
3318
3322
  });
3319
3323
  },
3320
- children: w.displayTab === !0 || w.displayTab === void 0 ? /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Fn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3324
+ children: w.displayTab === !0 || w.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Tn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3321
3325
  }
3322
3326
  );
3323
3327
  }
3324
- function M() {
3328
+ function L() {
3325
3329
  return /* @__PURE__ */ e.jsxs(
3326
3330
  ya,
3327
3331
  {
@@ -3329,26 +3333,26 @@ function aa() {
3329
3333
  value: s.activeCardId,
3330
3334
  className: "flex grow flex-col",
3331
3335
  children: [
3332
- s.cards.map((p) => /* @__PURE__ */ e.jsx(ls, { className: "mt-0 grow", value: p.id, children: L() }, p.id)),
3336
+ s.cards.map((p) => /* @__PURE__ */ e.jsx(rs, { className: "mt-0 grow", value: p.id, children: D() }, p.id)),
3333
3337
  /* @__PURE__ */ e.jsx(va, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3334
3338
  s.cards.map((p, w) => /* @__PURE__ */ e.jsx(
3335
- ts,
3339
+ ns,
3336
3340
  {
3337
3341
  text: p.tabTitle || p.title,
3338
- onSave: (j) => {
3339
- u({ ...n, tabTitle: j }), m({ ...n, tabTitle: j });
3342
+ onSave: (b) => {
3343
+ u({ ...n, tabTitle: b }), m({ ...n, tabTitle: b });
3340
3344
  },
3341
3345
  children: /* @__PURE__ */ e.jsxs(
3342
- ns,
3346
+ ls,
3343
3347
  {
3344
3348
  draggable: !0,
3345
- onDragStart: (j) => I(j, w),
3349
+ onDragStart: (b) => I(b, w),
3346
3350
  onDragOver: S,
3347
- onDrop: (j) => O(j, w),
3351
+ onDrop: (b) => O(b, w),
3348
3352
  className: "",
3349
3353
  value: p.id,
3350
3354
  children: [
3351
- y(s, p),
3355
+ v(s, p),
3352
3356
  p.tabTitle || p.title,
3353
3357
  s.activeCardId === p.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3354
3358
  Na,
@@ -3368,7 +3372,7 @@ function aa() {
3368
3372
  {
3369
3373
  className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
3370
3374
  variant: "outline",
3371
- onClick: b,
3375
+ onClick: y,
3372
3376
  children: /* @__PURE__ */ e.jsx(zs, { className: "h-4 w-4" })
3373
3377
  }
3374
3378
  ),
@@ -3378,7 +3382,7 @@ function aa() {
3378
3382
  className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
3379
3383
  variant: "outline",
3380
3384
  onClick: h,
3381
- children: /* @__PURE__ */ e.jsx(wn, { className: "h-4 w-4" })
3385
+ children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4" })
3382
3386
  }
3383
3387
  )
3384
3388
  ] }) })
@@ -3386,27 +3390,27 @@ function aa() {
3386
3390
  }
3387
3391
  );
3388
3392
  }
3389
- function L() {
3390
- 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(Gt, { isLoading: l, card: n }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Kt, { isLoading: l, card: n }) }) }) : /* @__PURE__ */ e.jsx(Ra, { className: "grow border-none shadow-none" });
3393
+ function D() {
3394
+ 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, { isLoading: l, card: n }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Wt, { isLoading: l, card: n }) }) }) : /* @__PURE__ */ e.jsx(Ra, { className: "grow border-none shadow-none" });
3391
3395
  }
3392
3396
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
3393
- l && /* @__PURE__ */ e.jsx(Qe, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3397
+ l && /* @__PURE__ */ e.jsx(We, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3394
3398
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3395
3399
  t && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3396
- /* @__PURE__ */ e.jsx(Sl, {}),
3397
- !["table", "custom"].includes(n.type) && /* @__PURE__ */ e.jsx(vl, {}),
3398
- /* @__PURE__ */ e.jsx(kl, {})
3400
+ /* @__PURE__ */ e.jsx(kl, {}),
3401
+ !["table", "custom"].includes(n.type) && /* @__PURE__ */ e.jsx(Nl, {}),
3402
+ /* @__PURE__ */ e.jsx(Fl, {})
3399
3403
  ] }),
3400
- /* @__PURE__ */ e.jsx(Fl, {})
3404
+ /* @__PURE__ */ e.jsx(Tl, {})
3401
3405
  ] }),
3402
- t ? M() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
3403
- r && /* @__PURE__ */ e.jsx(zl, {}),
3404
- n.data && n.data.length > 0 && /* @__PURE__ */ e.jsx(bl, { data: a || [] }),
3406
+ t ? L() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
3407
+ r && /* @__PURE__ */ e.jsx(Il, {}),
3408
+ n.data && n.data.length > 0 && /* @__PURE__ */ e.jsx(vl, { data: a || [] }),
3405
3409
  i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
3406
3410
  ] })
3407
3411
  ] });
3408
3412
  }
3409
- function zl() {
3413
+ function Il() {
3410
3414
  const s = o((a) => a.pythonStdOut);
3411
3415
  if (!s)
3412
3416
  return null;
@@ -3420,17 +3424,17 @@ function zl() {
3420
3424
  className: "bg-muted p-2 font-mono text-sm"
3421
3425
  }
3422
3426
  ),
3423
- /* @__PURE__ */ e.jsx(Ie, { className: "mb-2" })
3427
+ /* @__PURE__ */ e.jsx(Te, { className: "mb-2" })
3424
3428
  ] });
3425
3429
  }
3426
- function Fl() {
3430
+ function Tl() {
3427
3431
  const s = o((a) => a.isShowingVisual), n = o(
3428
3432
  (a) => a.actions.setIsShowingVisual
3429
3433
  );
3430
3434
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3431
3435
  /* @__PURE__ */ e.jsx(_, { htmlFor: "visualize", children: "Chart" }),
3432
3436
  /* @__PURE__ */ e.jsx(
3433
- Qt,
3437
+ Jt,
3434
3438
  {
3435
3439
  checked: s,
3436
3440
  onCheckedChange: () => n(!s),
@@ -3440,7 +3444,7 @@ function Fl() {
3440
3444
  )
3441
3445
  ] });
3442
3446
  }
3443
- function Il({
3447
+ function Dl({
3444
3448
  options: s,
3445
3449
  value: n,
3446
3450
  onValueChange: a
@@ -3453,13 +3457,13 @@ function Il({
3453
3457
  className: "flex gap-4",
3454
3458
  defaultValue: s[0].value,
3455
3459
  children: s.map((t) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3456
- /* @__PURE__ */ e.jsx(Te, { value: t.value, id: t.value }),
3460
+ /* @__PURE__ */ e.jsx(De, { value: t.value, id: t.value }),
3457
3461
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: t.value, children: t.label })
3458
3462
  ] }, t.value))
3459
3463
  }
3460
3464
  );
3461
3465
  }
3462
- function $e({
3466
+ function Pe({
3463
3467
  label: s,
3464
3468
  options: n,
3465
3469
  value: a,
@@ -3470,13 +3474,13 @@ function $e({
3470
3474
  /* @__PURE__ */ e.jsx(
3471
3475
  me,
3472
3476
  {
3473
- className: Z("w-full focus:ring-0 focus:ring-offset-0", l),
3477
+ className: X("w-full focus:ring-0 focus:ring-offset-0", l),
3474
3478
  children: /* @__PURE__ */ e.jsx(xe, { placeholder: s })
3475
3479
  }
3476
3480
  ),
3477
3481
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(we, { children: [
3478
3482
  /* @__PURE__ */ e.jsx(fe, { children: s }),
3479
- n.map((i) => /* @__PURE__ */ e.jsx(J, { value: i.value, children: i.label }, i.value))
3483
+ n.map((i) => /* @__PURE__ */ e.jsx(W, { value: i.value, children: i.label }, i.value))
3480
3484
  ] }) })
3481
3485
  ] });
3482
3486
  }
@@ -3491,14 +3495,14 @@ function ta({
3491
3495
  children: [
3492
3496
  /* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
3493
3497
  /* @__PURE__ */ e.jsx(_, { children: n }),
3494
- /* @__PURE__ */ e.jsx(Wt, { className: "h-4 w-4" })
3498
+ /* @__PURE__ */ e.jsx(Yt, { className: "h-4 w-4" })
3495
3499
  ] }),
3496
3500
  /* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
3497
3501
  ]
3498
3502
  }
3499
3503
  );
3500
3504
  }
3501
- function Tl() {
3505
+ function Ll() {
3502
3506
  var C, I;
3503
3507
  const s = o(
3504
3508
  (S) => S.card.customCardPreferences
@@ -3510,7 +3514,7 @@ function Tl() {
3510
3514
  function m(S, O) {
3511
3515
  if (!s)
3512
3516
  return;
3513
- const M = {
3517
+ const L = {
3514
3518
  ...(s == null ? void 0 : s.dataInputCardIds) || {},
3515
3519
  [S]: {
3516
3520
  cardId: O,
@@ -3519,34 +3523,34 @@ function Tl() {
3519
3523
  };
3520
3524
  r({
3521
3525
  ...s,
3522
- dataInputCardIds: M
3526
+ dataInputCardIds: L
3523
3527
  });
3524
3528
  }
3525
- function b(S) {
3526
- var y, M;
3527
- const O = (y = l == null ? void 0 : l.cards) == null ? void 0 : y.filter((L) => {
3529
+ function y(S) {
3530
+ var v, L;
3531
+ const O = (v = l == null ? void 0 : l.cards) == null ? void 0 : v.filter((D) => {
3528
3532
  var p;
3529
- return ((p = L == null ? void 0 : L.customCardPreferences) == null ? void 0 : p.visualType) !== "multiple";
3530
- }).map((L) => ({
3531
- value: L.id,
3532
- label: L.tabTitle || L.title
3533
+ return ((p = D == null ? void 0 : D.customCardPreferences) == null ? void 0 : p.visualType) !== "multiple";
3534
+ }).map((D) => ({
3535
+ value: D.id,
3536
+ label: D.tabTitle || D.title
3533
3537
  }));
3534
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (M = S == null ? void 0 : S.dataInputs) == null ? void 0 : M.map((L, p) => {
3535
- var w, j;
3538
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (L = S == null ? void 0 : S.dataInputs) == null ? void 0 : L.map((D, p) => {
3539
+ var w, b;
3536
3540
  return /* @__PURE__ */ e.jsxs(
3537
3541
  "div",
3538
3542
  {
3539
3543
  className: "grid grid-cols-10 gap-2",
3540
3544
  children: [
3541
- /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: L }),
3545
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: D }),
3542
3546
  /* @__PURE__ */ e.jsx(
3543
- $e,
3547
+ Pe,
3544
3548
  {
3545
3549
  className: "col-span-6 h-8 w-full justify-between",
3546
3550
  label: "",
3547
3551
  options: O || [],
3548
- value: ((j = (w = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : w[p]) == null ? void 0 : j.cardId) || "",
3549
- onValueChange: (f) => m(p, f)
3552
+ value: ((b = (w = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : w[p]) == null ? void 0 : b.cardId) || "",
3553
+ onValueChange: (g) => m(p, g)
3550
3554
  }
3551
3555
  )
3552
3556
  ]
@@ -3555,13 +3559,13 @@ function Tl() {
3555
3559
  );
3556
3560
  }) });
3557
3561
  }
3558
- function g(S, O, y = []) {
3559
- var M, L;
3562
+ function j(S, O, v = []) {
3563
+ var L, D;
3560
3564
  return s ? S === "input" ? /* @__PURE__ */ e.jsx(
3561
3565
  Se,
3562
3566
  {
3563
- className: `h-8 w-full ${Jt}`,
3564
- value: ((M = s == null ? void 0 : s.settings) == null ? void 0 : M[O]) || "",
3567
+ className: `h-8 w-full ${Xt}`,
3568
+ value: ((L = s == null ? void 0 : s.settings) == null ? void 0 : L[O]) || "",
3565
3569
  onChange: (p) => {
3566
3570
  r({
3567
3571
  ...s,
@@ -3574,12 +3578,12 @@ function Tl() {
3574
3578
  },
3575
3579
  O
3576
3580
  ) : S === "select" ? /* @__PURE__ */ e.jsx(
3577
- $e,
3581
+ Pe,
3578
3582
  {
3579
3583
  className: "h-8 w-full",
3580
3584
  label: "",
3581
- options: y,
3582
- value: ((L = s == null ? void 0 : s.settings) == null ? void 0 : L[O]) || "",
3585
+ options: v,
3586
+ value: ((D = s == null ? void 0 : s.settings) == null ? void 0 : D[O]) || "",
3583
3587
  onValueChange: (p) => {
3584
3588
  r({
3585
3589
  ...s,
@@ -3591,14 +3595,14 @@ function Tl() {
3591
3595
  }
3592
3596
  function h(S) {
3593
3597
  const O = Object.entries((S == null ? void 0 : S.settings) || {});
3594
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: O.map(([y, M]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3595
- /* @__PURE__ */ e.jsx(_, { children: M.title }),
3596
- g(
3597
- M.ui,
3598
- y,
3599
- M.options
3598
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: O.map(([v, L]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3599
+ /* @__PURE__ */ e.jsx(_, { children: L.title }),
3600
+ j(
3601
+ L.ui,
3602
+ v,
3603
+ L.options
3600
3604
  )
3601
- ] }, y)) });
3605
+ ] }, v)) });
3602
3606
  }
3603
3607
  function x(S) {
3604
3608
  s && r({
@@ -3614,7 +3618,7 @@ function Tl() {
3614
3618
  children: [
3615
3619
  /* @__PURE__ */ e.jsx(ta, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
3616
3620
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
3617
- $e,
3621
+ Pe,
3618
3622
  {
3619
3623
  className: "h-8 w-full",
3620
3624
  label: "",
@@ -3630,7 +3634,7 @@ function Tl() {
3630
3634
  }
3631
3635
  ) }) }),
3632
3636
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
3633
- Il,
3637
+ Dl,
3634
3638
  {
3635
3639
  options: [
3636
3640
  { value: "single", label: "Single Visual" },
@@ -3643,7 +3647,7 @@ function Tl() {
3643
3647
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3644
3648
  /* @__PURE__ */ e.jsx(_, { children: "Component" }),
3645
3649
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: d && /* @__PURE__ */ e.jsx(
3646
- $e,
3650
+ Pe,
3647
3651
  {
3648
3652
  className: "h-8 w-full",
3649
3653
  label: "",
@@ -3664,11 +3668,11 @@ function Tl() {
3664
3668
  ) })
3665
3669
  ] }) })
3666
3670
  ] }) }) }),
3667
- /* @__PURE__ */ e.jsx(Ie, { className: "my-4" }),
3671
+ /* @__PURE__ */ e.jsx(Te, { className: "my-4" }),
3668
3672
  ((I = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : I.componentName) && /* @__PURE__ */ e.jsxs(ta, { summary: "Component Settings", children: [
3669
3673
  u && u.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3670
3674
  /* @__PURE__ */ e.jsx(_, { children: "Input Mapping" }),
3671
- /* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(u) })
3675
+ /* @__PURE__ */ e.jsx("div", { className: "px-2", children: y(u) })
3672
3676
  ] }),
3673
3677
  u && u.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: h(u) }) })
3674
3678
  ] })
@@ -3676,7 +3680,7 @@ function Tl() {
3676
3680
  }
3677
3681
  );
3678
3682
  }
3679
- function Ve() {
3683
+ function qe() {
3680
3684
  const [s, n] = E([]);
3681
3685
  o(
3682
3686
  (m) => m.card.cfg
@@ -3686,15 +3690,15 @@ function Ve() {
3686
3690
  );
3687
3691
  o(
3688
3692
  (m) => {
3689
- var b;
3690
- return (b = m.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
3693
+ var y;
3694
+ return (y = m.card.preferences) == null ? void 0 : y.filterOnClickColumnIndex;
3691
3695
  }
3692
- ), X(() => {
3696
+ ), Y(() => {
3693
3697
  r && n(new Array(r.length).fill(!1));
3694
3698
  }, [r]);
3695
- function d(m, b) {
3696
- var g, h;
3697
- b ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? i({
3699
+ function d(m, y) {
3700
+ var j, h;
3701
+ y ? a != null && a.onClickFilter && ((j = a == null ? void 0 : a.onClickFilter) == null ? void 0 : j.length) > 0 ? i({
3698
3702
  ...a,
3699
3703
  onClickFilter: [
3700
3704
  ...a.onClickFilter,
@@ -3721,20 +3725,20 @@ function Ve() {
3721
3725
  return C[m] = !1, C;
3722
3726
  }));
3723
3727
  }
3724
- function c(m, b) {
3728
+ function c(m, y) {
3725
3729
  var h;
3726
- const g = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
3730
+ const j = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
3727
3731
  ...x,
3728
- expression: b.target.value
3732
+ expression: y.target.value
3729
3733
  } : x);
3730
3734
  i({
3731
3735
  ...a,
3732
- onClickFilter: g
3736
+ onClickFilter: j
3733
3737
  });
3734
3738
  }
3735
3739
  function u(m) {
3736
- var b, g, h, x;
3737
- if (s != null && s[m] || (g = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((C) => C.columnIndex === m)) != null && g.expression)
3740
+ var y, j, h, x;
3741
+ if (s != null && s[m] || (j = (y = a == null ? void 0 : a.onClickFilter) == null ? void 0 : y.find((C) => C.columnIndex === m)) != null && j.expression)
3738
3742
  return /* @__PURE__ */ e.jsx(
3739
3743
  Se,
3740
3744
  {
@@ -3748,8 +3752,8 @@ function Ve() {
3748
3752
  }
3749
3753
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3750
3754
  /* @__PURE__ */ e.jsx(_, { children: "On Click" }),
3751
- r == null ? void 0 : r.map((m, b) => {
3752
- var g, h;
3755
+ r == null ? void 0 : r.map((m, y) => {
3756
+ var j, h;
3753
3757
  return /* @__PURE__ */ e.jsx(
3754
3758
  "div",
3755
3759
  {
@@ -3759,10 +3763,10 @@ function Ve() {
3759
3763
  /* @__PURE__ */ e.jsx(
3760
3764
  ds,
3761
3765
  {
3762
- checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
3763
- (x) => x.columnIndex === b
3766
+ checked: !!((j = a == null ? void 0 : a.onClickFilter) != null && j.find(
3767
+ (x) => x.columnIndex === y
3764
3768
  )),
3765
- onCheckedChange: (x) => d(b, x)
3769
+ onCheckedChange: (x) => d(y, x)
3766
3770
  }
3767
3771
  ),
3768
3772
  /* @__PURE__ */ e.jsx(
@@ -3773,21 +3777,21 @@ function Ve() {
3773
3777
  }
3774
3778
  ),
3775
3779
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
3776
- (x) => x.columnIndex === b
3780
+ (x) => x.columnIndex === y
3777
3781
  )) && /* @__PURE__ */ e.jsx(
3778
3782
  La,
3779
3783
  {
3780
3784
  onClick: () => {
3781
3785
  n((x) => {
3782
3786
  const C = [...x];
3783
- return C[b] = !x[b], C;
3787
+ return C[y] = !x[y], C;
3784
3788
  });
3785
3789
  },
3786
3790
  className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
3787
3791
  }
3788
3792
  ) })
3789
3793
  ] }),
3790
- u(b)
3794
+ u(y)
3791
3795
  ] })
3792
3796
  },
3793
3797
  m
@@ -3813,57 +3817,57 @@ function ps() {
3813
3817
  defaultValue: "x",
3814
3818
  children: [
3815
3819
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3816
- /* @__PURE__ */ e.jsx(Te, { value: "x", id: "r1" }),
3820
+ /* @__PURE__ */ e.jsx(De, { value: "x", id: "r1" }),
3817
3821
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
3818
3822
  ] }),
3819
3823
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3820
- /* @__PURE__ */ e.jsx(Te, { value: "y", id: "r2" }),
3824
+ /* @__PURE__ */ e.jsx(De, { value: "y", id: "r2" }),
3821
3825
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
3822
3826
  ] })
3823
3827
  ]
3824
3828
  }
3825
3829
  );
3826
3830
  }
3827
- const ss = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
3831
+ const as = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
3828
3832
  function na(s, n) {
3829
3833
  var t, l, i;
3830
3834
  const a = Sa(s, n);
3831
3835
  return ((i = (l = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : l[a]) == null ? void 0 : i.type) || "linear";
3832
3836
  }
3833
3837
  function Ja() {
3834
- var le, P, re, k, R, W;
3835
- const [s, n] = E(!1), a = o((D) => {
3838
+ var te, B, ie, k, R, Q;
3839
+ const [s, n] = E(!1), a = o((M) => {
3836
3840
  var T;
3837
- return (T = D.card) == null ? void 0 : T.preferences;
3838
- }), t = o((D) => {
3841
+ return (T = M.card) == null ? void 0 : T.preferences;
3842
+ }), t = o((M) => {
3839
3843
  var T;
3840
- return (T = D.card) == null ? void 0 : T.cfg;
3844
+ return (T = M.card) == null ? void 0 : T.cfg;
3841
3845
  }), l = Sa(a, t), [i, r] = E(
3842
3846
  na(a)
3843
3847
  ), [d, c] = E(
3844
- ((re = (P = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : P[l]) == null ? void 0 : re.min) || ""
3848
+ ((ie = (B = (te = a == null ? void 0 : a.chartOptions) == null ? void 0 : te.scales) == null ? void 0 : B[l]) == null ? void 0 : ie.min) || ""
3845
3849
  ), [u, m] = E(
3846
- ((W = (R = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : R[l]) == null ? void 0 : W.max) || ""
3847
- ), [b, g] = E(d || u ? "custom" : "auto"), [h, x] = E(""), [C, I] = E(0), [S, O] = E(""), [y, M] = E(""), [L, p] = E(""), w = o(
3848
- (D) => D.actions.setCardPreferences
3849
- ), { updateCardInFrame: j } = be(), f = o((D) => D.card), V = o((D) => {
3850
+ ((Q = (R = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : R[l]) == null ? void 0 : Q.max) || ""
3851
+ ), [y, j] = E(d || u ? "custom" : "auto"), [h, x] = E(""), [C, I] = E(0), [S, O] = E(""), [v, L] = E(""), [D, p] = E(""), w = o(
3852
+ (M) => M.actions.setCardPreferences
3853
+ ), { updateCardInFrame: b } = be(), g = o((M) => M.card), V = o((M) => {
3850
3854
  var T;
3851
- return (T = D.card) == null ? void 0 : T.type;
3855
+ return (T = M.card) == null ? void 0 : T.type;
3852
3856
  }), $ = ["pie", "doughnut", "polarArea"].includes(V);
3853
- X(() => {
3854
- var D, T, te, H, ee, se, Le, ke, ve, Ce, ae, oe, ce, ze;
3857
+ Y(() => {
3858
+ var M, T, ae, H, ee, ne, ve, oe, ke, ze, Fe, Ce, se, de;
3855
3859
  r(na(a)), c(
3856
- ((te = (T = (D = a == null ? void 0 : a.chartOptions) == null ? void 0 : D.scales) == null ? void 0 : T[l]) == null ? void 0 : te.min) === 0 ? 0 : ""
3857
- ), m(((se = (ee = (H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales) == null ? void 0 : ee[l]) == null ? void 0 : se.max) || ""), x(
3858
- ((Ce = (ve = (ke = (Le = a == null ? void 0 : a.chartOptions) == null ? void 0 : Le.scales) == null ? void 0 : ke[l]) == null ? void 0 : ve.ticks) == null ? void 0 : Ce.stepSize) || ""
3859
- ), I(((ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ae.decimalPlaces) || 0), O(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), M(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), p(((ze = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ze.locale) || "");
3860
+ ((ae = (T = (M = a == null ? void 0 : a.chartOptions) == null ? void 0 : M.scales) == null ? void 0 : T[l]) == null ? void 0 : ae.min) === 0 ? 0 : ""
3861
+ ), m(((ne = (ee = (H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales) == null ? void 0 : ee[l]) == null ? void 0 : ne.max) || ""), x(
3862
+ ((ze = (ke = (oe = (ve = a == null ? void 0 : a.chartOptions) == null ? void 0 : ve.scales) == null ? void 0 : oe[l]) == null ? void 0 : ke.ticks) == null ? void 0 : ze.stepSize) || ""
3863
+ ), I(((Fe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Fe.decimalPlaces) || 0), O(((Ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ce.suffix) || ""), L(((se = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : se.currency) || ""), p(((de = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : de.locale) || "");
3860
3864
  }, [s, a, l]);
3861
- function q(D, T) {
3862
- return T === "" || /^[0-9\b]+$/.test(T) ? Number(T) : Number(D);
3865
+ function q(M, T) {
3866
+ return T === "" || /^[0-9\b]+$/.test(T) ? Number(T) : Number(M);
3863
3867
  }
3864
- function K() {
3865
- const D = [
3866
- ...new Set(rs.map((T) => T.currency))
3868
+ function P() {
3869
+ const M = [
3870
+ ...new Set(is.map((T) => T.currency))
3867
3871
  ];
3868
3872
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3869
3873
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
@@ -3885,19 +3889,19 @@ function Ja() {
3885
3889
  /* @__PURE__ */ e.jsxs(
3886
3890
  he,
3887
3891
  {
3888
- value: y || "none",
3889
- onValueChange: (T) => M(T === "none" ? "" : T),
3892
+ value: v || "none",
3893
+ onValueChange: (T) => L(T === "none" ? "" : T),
3890
3894
  children: [
3891
3895
  /* @__PURE__ */ e.jsx(me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
3892
3896
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(we, { children: [
3893
3897
  /* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
3894
- /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }),
3895
- D.map((T) => /* @__PURE__ */ e.jsx(J, { value: T, children: T }, T))
3898
+ /* @__PURE__ */ e.jsx(W, { value: "none", children: "None" }),
3899
+ M.map((T) => /* @__PURE__ */ e.jsx(W, { value: T, children: T }, T))
3896
3900
  ] }) })
3897
3901
  ]
3898
3902
  }
3899
3903
  ),
3900
- /* @__PURE__ */ e.jsxs(he, { value: L, onValueChange: (T) => p(T), children: [
3904
+ /* @__PURE__ */ e.jsxs(he, { value: D, onValueChange: (T) => p(T), children: [
3901
3905
  /* @__PURE__ */ e.jsx(
3902
3906
  me,
3903
3907
  {
@@ -3907,7 +3911,7 @@ function Ja() {
3907
3911
  ),
3908
3912
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(we, { children: [
3909
3913
  /* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
3910
- rs.map((T) => /* @__PURE__ */ e.jsx(J, { value: T.locale, children: T.locale }, T.locale))
3914
+ is.map((T) => /* @__PURE__ */ e.jsx(W, { value: T.locale, children: T.locale }, T.locale))
3911
3915
  ] }) })
3912
3916
  ] })
3913
3917
  ] }),
@@ -3919,13 +3923,13 @@ function Ja() {
3919
3923
  value: C,
3920
3924
  onChange: (T) => I(Number(T.target.value)),
3921
3925
  id: "format",
3922
- className: `col-span-6 h-8 w-full tracking-wide ${ss}`
3926
+ className: `col-span-6 h-8 w-full tracking-wide ${as}`
3923
3927
  }
3924
3928
  )
3925
3929
  ] })
3926
3930
  ] });
3927
3931
  }
3928
- function Y() {
3932
+ function Z() {
3929
3933
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3930
3934
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3931
3935
  /* @__PURE__ */ e.jsx(_, { htmlFor: "range", children: "Range" }),
@@ -3934,17 +3938,17 @@ function Ja() {
3934
3938
  {
3935
3939
  id: "min",
3936
3940
  value: d,
3937
- onChange: (D) => c((T) => q(T, D.target.value)),
3938
- className: `col-span-1 h-8 w-full ${ss}`
3941
+ onChange: (M) => c((T) => q(T, M.target.value)),
3942
+ className: `col-span-1 h-8 w-full ${as}`
3939
3943
  }
3940
3944
  ),
3941
3945
  /* @__PURE__ */ e.jsx(
3942
3946
  Se,
3943
3947
  {
3944
3948
  value: u,
3945
- onChange: (D) => m((T) => q(T, D.target.value)),
3949
+ onChange: (M) => m((T) => q(T, M.target.value)),
3946
3950
  id: "max",
3947
- className: `col-span-1 h-8 w-full ${ss}`
3951
+ className: `col-span-1 h-8 w-full ${as}`
3948
3952
  }
3949
3953
  )
3950
3954
  ] }),
@@ -3954,18 +3958,18 @@ function Ja() {
3954
3958
  Se,
3955
3959
  {
3956
3960
  value: h,
3957
- onChange: (D) => x((T) => q(T, D.target.value)),
3961
+ onChange: (M) => x((T) => q(T, M.target.value)),
3958
3962
  id: "step-size",
3959
- className: `col-span-1 h-8 w-full ${ss}`
3963
+ className: `col-span-1 h-8 w-full ${as}`
3960
3964
  }
3961
3965
  )
3962
3966
  ] })
3963
3967
  ] });
3964
3968
  }
3965
- function Q() {
3969
+ function J() {
3966
3970
  var H;
3967
- let D = {};
3968
- b === "custom" && (D = {
3971
+ let M = {};
3972
+ y === "custom" && (M = {
3969
3973
  min: d,
3970
3974
  max: u,
3971
3975
  ticks: {
@@ -3981,26 +3985,26 @@ function Ja() {
3981
3985
  [l]: {
3982
3986
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3983
3987
  type: i,
3984
- ...i === "linear" ? D : {}
3988
+ ...i === "linear" ? M : {}
3985
3989
  }
3986
3990
  }
3987
3991
  },
3988
3992
  numberAxisFormat: {
3989
3993
  decimalPlaces: C,
3990
3994
  suffix: S,
3991
- currency: y,
3992
- locale: L
3995
+ currency: v,
3996
+ locale: D
3993
3997
  }
3994
3998
  };
3995
3999
  console.log(T), w(T);
3996
- const te = {
3997
- ...f,
4000
+ const ae = {
4001
+ ...g,
3998
4002
  preferences: T
3999
4003
  };
4000
- j(te);
4004
+ b(ae);
4001
4005
  }
4002
- return /* @__PURE__ */ e.jsxs(us, { onOpenChange: (D) => n(D), children: [
4003
- /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Yt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4006
+ return /* @__PURE__ */ e.jsxs(us, { onOpenChange: (M) => n(M), children: [
4007
+ /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Zt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4004
4008
  /* @__PURE__ */ e.jsx(ms, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
4005
4009
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4006
4010
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
@@ -4014,13 +4018,13 @@ function Ja() {
4014
4018
  {
4015
4019
  disabled: $,
4016
4020
  value: i,
4017
- onValueChange: (D) => r(D),
4021
+ onValueChange: (M) => r(M),
4018
4022
  children: [
4019
4023
  /* @__PURE__ */ e.jsx(me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4020
4024
  /* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(we, { children: [
4021
4025
  /* @__PURE__ */ e.jsx(fe, { children: "Option" }),
4022
- /* @__PURE__ */ e.jsx(J, { value: "linear", children: "Linear" }),
4023
- /* @__PURE__ */ e.jsx(J, { value: "logarithmic", children: "Logarithmic" })
4026
+ /* @__PURE__ */ e.jsx(W, { value: "linear", children: "Linear" }),
4027
+ /* @__PURE__ */ e.jsx(W, { value: "logarithmic", children: "Logarithmic" })
4024
4028
  ] }) })
4025
4029
  ]
4026
4030
  }
@@ -4033,30 +4037,30 @@ function Ja() {
4033
4037
  {
4034
4038
  disabled: $,
4035
4039
  id: "scale-option",
4036
- value: b,
4037
- onValueChange: (D) => g(D),
4040
+ value: y,
4041
+ onValueChange: (M) => j(M),
4038
4042
  className: "col-span-2 flex gap-3",
4039
4043
  defaultValue: "x",
4040
4044
  children: [
4041
4045
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4042
- /* @__PURE__ */ e.jsx(Te, { value: "auto", id: "r1" }),
4046
+ /* @__PURE__ */ e.jsx(De, { value: "auto", id: "r1" }),
4043
4047
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
4044
4048
  ] }),
4045
4049
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4046
- /* @__PURE__ */ e.jsx(Te, { value: "custom", id: "r2" }),
4050
+ /* @__PURE__ */ e.jsx(De, { value: "custom", id: "r2" }),
4047
4051
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
4048
4052
  ] })
4049
4053
  ]
4050
4054
  }
4051
4055
  )
4052
4056
  ] }),
4053
- b === "custom" && i == "linear" && Y(),
4054
- K(),
4055
- /* @__PURE__ */ e.jsx(Xt, {}),
4057
+ y === "custom" && i == "linear" && Z(),
4058
+ P(),
4059
+ /* @__PURE__ */ e.jsx(en, {}),
4056
4060
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
4057
4061
  F,
4058
4062
  {
4059
- onClick: Q,
4063
+ onClick: J,
4060
4064
  variant: "secondary",
4061
4065
  className: "col-span-1 col-start-3 h-8 w-full",
4062
4066
  children: "Apply"
@@ -4066,7 +4070,7 @@ function Ja() {
4066
4070
  ] }) })
4067
4071
  ] });
4068
4072
  }
4069
- function Dl({ idx: s }) {
4073
+ function Ml({ idx: s }) {
4070
4074
  var d;
4071
4075
  const n = o((c) => {
4072
4076
  var u;
@@ -4080,7 +4084,7 @@ function Dl({ idx: s }) {
4080
4084
  (c) => c.actions.setCardPreferences
4081
4085
  ), l = (d = n == null ? void 0 : n.chartOptions) == null ? void 0 : d.indexAxis, i = a == null ? void 0 : a.find((c) => c.idx === s);
4082
4086
  function r(c, u) {
4083
- (c === "end" || c === "start") && Zt(en());
4087
+ (c === "end" || c === "start") && sn(an());
4084
4088
  const m = {
4085
4089
  display: c !== "none",
4086
4090
  align: c,
@@ -4099,19 +4103,19 @@ function Dl({ idx: s }) {
4099
4103
  ]
4100
4104
  });
4101
4105
  else {
4102
- const b = { ...i };
4103
- b.datalabels = m;
4104
- const g = a == null ? void 0 : a.map(
4105
- (h) => h.idx === u ? b : h
4106
+ const y = { ...i };
4107
+ y.datalabels = m;
4108
+ const j = a == null ? void 0 : a.map(
4109
+ (h) => h.idx === u ? y : h
4106
4110
  );
4107
4111
  t({
4108
4112
  ...n,
4109
- datasetOptions: g
4113
+ datasetOptions: j
4110
4114
  });
4111
4115
  }
4112
4116
  }
4113
4117
  return /* @__PURE__ */ e.jsxs(us, { children: [
4114
- /* @__PURE__ */ e.jsx(hs, { children: /* @__PURE__ */ e.jsx(Un, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4118
+ /* @__PURE__ */ e.jsx(hs, { children: /* @__PURE__ */ e.jsx(Kn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4115
4119
  /* @__PURE__ */ e.jsx(ms, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4116
4120
  /* @__PURE__ */ e.jsx(
4117
4121
  F,
@@ -4131,9 +4135,9 @@ function Dl({ idx: s }) {
4131
4135
  variant: "secondary",
4132
4136
  className: "h-7 p-1 text-xs font-normal",
4133
4137
  children: /* @__PURE__ */ e.jsx(
4134
- On,
4138
+ En,
4135
4139
  {
4136
- className: Z("h-4 w-4", {
4140
+ className: X("h-4 w-4", {
4137
4141
  "rotate-90": l === "y"
4138
4142
  })
4139
4143
  }
@@ -4148,9 +4152,9 @@ function Dl({ idx: s }) {
4148
4152
  variant: "secondary",
4149
4153
  className: "h-7 p-1 text-xs font-normal",
4150
4154
  children: /* @__PURE__ */ e.jsx(
4151
- En,
4155
+ qn,
4152
4156
  {
4153
- className: Z("h-4 w-4", {
4157
+ className: X("h-4 w-4", {
4154
4158
  "rotate-90": l === "y"
4155
4159
  })
4156
4160
  }
@@ -4165,9 +4169,9 @@ function Dl({ idx: s }) {
4165
4169
  variant: "secondary",
4166
4170
  className: "h-7 p-1 text-xs font-normal",
4167
4171
  children: /* @__PURE__ */ e.jsx(
4168
- An,
4172
+ Vn,
4169
4173
  {
4170
- className: Z("h-4 w-4", {
4174
+ className: X("h-4 w-4", {
4171
4175
  "rotate-90": l === "y"
4172
4176
  })
4173
4177
  }
@@ -4180,22 +4184,22 @@ function Dl({ idx: s }) {
4180
4184
  function Ya() {
4181
4185
  const s = o((c) => c.card), n = o(
4182
4186
  (c) => {
4183
- var u, m, b;
4184
- return (b = (m = (u = c == null ? void 0 : c.card) == null ? void 0 : u.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : b.indexAxis;
4187
+ var u, m, y;
4188
+ return (y = (m = (u = c == null ? void 0 : c.card) == null ? void 0 : u.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : y.indexAxis;
4185
4189
  }
4186
4190
  ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
4187
4191
  keys: l,
4188
4192
  metricKeys: i,
4189
4193
  dimensionKeys: r
4190
- } = ys(s.data || []);
4194
+ } = bs(s.data || []);
4191
4195
  let d = i;
4192
4196
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4193
- const c = sn({
4197
+ const c = tn({
4194
4198
  dataArray: s.data || [],
4195
4199
  groupKey: r[0],
4196
4200
  pivotKey: r[1],
4197
4201
  valueKey: d[0]
4198
- }), { metricKeys: u } = ys(c);
4202
+ }), { metricKeys: u } = bs(c);
4199
4203
  d = u;
4200
4204
  }
4201
4205
  return l.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
@@ -4208,11 +4212,11 @@ function Ya() {
4208
4212
  /* @__PURE__ */ e.jsx(_, { children: t }),
4209
4213
  /* @__PURE__ */ e.jsx(Ja, {})
4210
4214
  ] }),
4211
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((c, u) => /* @__PURE__ */ e.jsx(Ll, { col: c, idx: u }, c)) })
4215
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((c, u) => /* @__PURE__ */ e.jsx(Ol, { col: c, idx: u }, c)) })
4212
4216
  ] })
4213
4217
  ] });
4214
4218
  }
4215
- function Ll({ col: s, idx: n }) {
4219
+ function Ol({ col: s, idx: n }) {
4216
4220
  const a = o((d) => {
4217
4221
  var c;
4218
4222
  return (c = d.card) == null ? void 0 : c.preferences;
@@ -4265,59 +4269,59 @@ function Ll({ col: s, idx: n }) {
4265
4269
  }
4266
4270
  ),
4267
4271
  /* @__PURE__ */ e.jsx(
4268
- Nn,
4272
+ wn,
4269
4273
  {
4270
4274
  onClick: () => r("area"),
4271
4275
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4272
4276
  }
4273
4277
  ),
4274
4278
  /* @__PURE__ */ e.jsx(
4275
- Ie,
4279
+ Te,
4276
4280
  {
4277
4281
  orientation: "vertical",
4278
4282
  className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
4279
4283
  }
4280
4284
  ),
4281
- /* @__PURE__ */ e.jsx(Dl, { idx: n })
4285
+ /* @__PURE__ */ e.jsx(Ml, { idx: n })
4282
4286
  ] })
4283
4287
  ] });
4284
4288
  }
4285
4289
  function Xa() {
4286
- const s = o((g) => g.selectedConnectionId), n = o((g) => g.selectedDatamodelId), a = o((g) => g.selectedDatabaseName), t = o((g) => g.selectedSchemaName), l = o((g) => g.selectedTableName), i = z((g) => g.dashboard.filters) || [], r = z((g) => g.actions.addFilter), d = z((g) => g.actions.removeFilter), c = z(
4287
- (g) => g.actions.removeFilterValue
4288
- ), { modelItems: u, tableName: m } = Ee();
4289
- function b(g, h = "dashboard") {
4290
+ const s = o((j) => j.selectedConnectionId), n = o((j) => j.selectedDatamodelId), a = o((j) => j.selectedDatabaseName), t = o((j) => j.selectedSchemaName), l = o((j) => j.selectedTableName), i = z((j) => j.dashboard.filters) || [], r = z((j) => j.actions.addFilter), d = z((j) => j.actions.removeFilter), c = z(
4291
+ (j) => j.actions.removeFilterValue
4292
+ ), { modelItems: u, tableName: m } = Ve();
4293
+ function y(j, h = "dashboard") {
4290
4294
  var p;
4291
- const x = ue(g.column_name), C = ue(a || ""), I = ue(t || ""), S = ue(m);
4295
+ const x = ue(j.column_name), C = ue(a || ""), I = ue(t || ""), S = ue(m);
4292
4296
  let O = pa(
4293
4297
  I,
4294
4298
  S
4295
- ), y = `${O}.${x}`;
4296
- const M = (p = u == null ? void 0 : u.find(
4299
+ ), v = `${O}.${x}`;
4300
+ const L = (p = u == null ? void 0 : u.find(
4297
4301
  (w) => w.id === n
4298
4302
  )) == null ? void 0 : p.name;
4299
- n && n !== "none" && (y = `${bs}.${M}.${x}`, O = `${bs}.${M}`);
4300
- const L = i == null ? void 0 : i.find(
4301
- (w) => w.column === y && w.table === S && (w.database === C || w.database === a)
4303
+ n && n !== "none" && (v = `${js}.${L}.${x}`, O = `${js}.${L}`);
4304
+ const D = i == null ? void 0 : i.find(
4305
+ (w) => w.column === v && w.table === S && (w.database === C || w.database === a)
4302
4306
  );
4303
- if (L)
4304
- c(L.id), d(L.id);
4307
+ if (D)
4308
+ c(D.id), d(D.id);
4305
4309
  else {
4306
- const w = Ue();
4310
+ const w = Ge();
4307
4311
  return m === "api" && s ? (r({
4308
4312
  location: h,
4309
4313
  id: w,
4310
4314
  //uuidv4(),
4311
- column: y,
4312
- title: g.column_name,
4313
- dataType: g.data_type,
4315
+ column: v,
4316
+ title: j.column_name,
4317
+ dataType: j.data_type,
4314
4318
  table: "api",
4315
4319
  database: "",
4316
4320
  // database: 'NA',
4317
4321
  connectionId: s,
4318
4322
  operation: "in",
4319
4323
  sql: Xs(
4320
- g.data_type,
4324
+ j.data_type,
4321
4325
  O,
4322
4326
  x
4323
4327
  )
@@ -4326,16 +4330,16 @@ function Xa() {
4326
4330
  id: w,
4327
4331
  //uuidv4(),
4328
4332
  location: h,
4329
- column: y,
4333
+ column: v,
4330
4334
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
4331
- title: g.column_name,
4332
- dataType: g.data_type,
4335
+ title: j.column_name,
4336
+ dataType: j.data_type,
4333
4337
  table: l || "",
4334
4338
  database: a || "",
4335
4339
  connectionId: s || "",
4336
4340
  operation: "in",
4337
4341
  sql: Xs(
4338
- g.data_type,
4342
+ j.data_type,
4339
4343
  O,
4340
4344
  x
4341
4345
  )
@@ -4343,12 +4347,12 @@ function Xa() {
4343
4347
  }), w);
4344
4348
  }
4345
4349
  }
4346
- return { assignFilter: b };
4350
+ return { assignFilter: y };
4347
4351
  }
4348
- function qe() {
4352
+ function Re() {
4349
4353
  const s = z(
4350
4354
  (d) => d.dashboard.filters
4351
- ), n = o((d) => d.frame), { setFrame: a } = be(), { columns: t } = Ee(), { assignFilter: l } = Xa();
4355
+ ), n = o((d) => d.frame), { setFrame: a } = be(), { columns: t } = Ve(), { assignFilter: l } = Xa();
4352
4356
  function i(d) {
4353
4357
  const c = l(d, "frame");
4354
4358
  a({ ...n, filterId: c });
@@ -4356,11 +4360,11 @@ function qe() {
4356
4360
  const r = s == null ? void 0 : s.find((d) => d.id === n.filterId);
4357
4361
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4358
4362
  /* @__PURE__ */ e.jsx(_, { children: "Card Filter" }),
4359
- /* @__PURE__ */ e.jsx(Ml, { onSelect: i, columns: t }),
4360
- r && /* @__PURE__ */ e.jsx(an, { filter: r })
4363
+ /* @__PURE__ */ e.jsx(Al, { onSelect: i, columns: t }),
4364
+ r && /* @__PURE__ */ e.jsx(nn, { filter: r })
4361
4365
  ] });
4362
4366
  }
4363
- function Ml({
4367
+ function Al({
4364
4368
  columns: s,
4365
4369
  onSelect: n
4366
4370
  }) {
@@ -4377,16 +4381,16 @@ function Ml({
4377
4381
  className: "w-full justify-between font-normal",
4378
4382
  children: [
4379
4383
  l ? (r = s.find((d) => d.column_name === l)) == null ? void 0 : r.column_name : "Select Column...",
4380
- /* @__PURE__ */ e.jsx(tn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4384
+ /* @__PURE__ */ e.jsx(ln, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4381
4385
  ]
4382
4386
  }
4383
4387
  ) }),
4384
- /* @__PURE__ */ e.jsx(ms, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(nn, { children: [
4385
- /* @__PURE__ */ e.jsx(ln, { placeholder: "Search column", className: "h-9" }),
4386
- /* @__PURE__ */ e.jsxs(rn, { children: [
4387
- /* @__PURE__ */ e.jsx(on, { children: "No framework found." }),
4388
- /* @__PURE__ */ e.jsx(cn, { children: s.map((d) => /* @__PURE__ */ e.jsxs(
4389
- dn,
4388
+ /* @__PURE__ */ e.jsx(ms, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(rn, { children: [
4389
+ /* @__PURE__ */ e.jsx(on, { placeholder: "Search column", className: "h-9" }),
4390
+ /* @__PURE__ */ e.jsxs(cn, { children: [
4391
+ /* @__PURE__ */ e.jsx(dn, { children: "No framework found." }),
4392
+ /* @__PURE__ */ e.jsx(un, { children: s.map((d) => /* @__PURE__ */ e.jsxs(
4393
+ hn,
4390
4394
  {
4391
4395
  value: d.column_name,
4392
4396
  onSelect: (c) => {
@@ -4398,7 +4402,7 @@ function Ml({
4398
4402
  /* @__PURE__ */ e.jsx(
4399
4403
  Ca,
4400
4404
  {
4401
- className: Z(
4405
+ className: X(
4402
4406
  "ml-auto h-4 w-4",
4403
4407
  l === d.column_name ? "opacity-100" : "opacity-0"
4404
4408
  )
@@ -4412,13 +4416,13 @@ function Ml({
4412
4416
  ] }) })
4413
4417
  ] });
4414
4418
  }
4415
- function Ol({
4419
+ function El({
4416
4420
  cardType: s
4417
4421
  }) {
4418
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
4419
- /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4420
- /* @__PURE__ */ e.jsx(U, { children: `${Rs(s)} Chart` }),
4421
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 font-mono text-xs", children: [
4422
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
4423
+ /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4424
+ /* @__PURE__ */ e.jsx(G, { children: `${Rs(s)} Chart` }),
4425
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 font-mono text-xs", children: [
4422
4426
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
4423
4427
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
4424
4428
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -4441,18 +4445,18 @@ function Ol({
4441
4445
  ] })
4442
4446
  ] })
4443
4447
  ] }),
4444
- /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
4445
- /* @__PURE__ */ e.jsx(U, { children: "Settings" }),
4446
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4448
+ /* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
4449
+ /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
4450
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4447
4451
  /* @__PURE__ */ e.jsx(ps, {}),
4448
4452
  /* @__PURE__ */ e.jsx(Ya, {})
4449
4453
  ] })
4450
4454
  ] }),
4451
- /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4452
- /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
4453
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4454
- /* @__PURE__ */ e.jsx(Ve, {}),
4455
- /* @__PURE__ */ e.jsx(qe, {})
4455
+ /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
4456
+ /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
4457
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4458
+ /* @__PURE__ */ e.jsx(qe, {}),
4459
+ /* @__PURE__ */ e.jsx(Re, {})
4456
4460
  ] })
4457
4461
  ] })
4458
4462
  ] }) });
@@ -4498,17 +4502,17 @@ function Ps() {
4498
4502
  /* @__PURE__ */ e.jsx(me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, { placeholder: "Select position" }) }),
4499
4503
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(we, { children: [
4500
4504
  /* @__PURE__ */ e.jsx(fe, { children: "Data Labels" }),
4501
- /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }),
4502
- a !== "pyramid" && /* @__PURE__ */ e.jsx(J, { value: "start", children: "Start" }),
4503
- /* @__PURE__ */ e.jsx(J, { value: "center", children: "Center" }),
4504
- a !== "pyramid" && /* @__PURE__ */ e.jsx(J, { value: "end", children: "End" })
4505
+ /* @__PURE__ */ e.jsx(W, { value: "none", children: "None" }),
4506
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(W, { value: "start", children: "Start" }),
4507
+ /* @__PURE__ */ e.jsx(W, { value: "center", children: "Center" }),
4508
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(W, { value: "end", children: "End" })
4505
4509
  ] }) })
4506
4510
  ]
4507
4511
  }
4508
4512
  )
4509
4513
  ] });
4510
4514
  }
4511
- function Al({
4515
+ function Vl({
4512
4516
  cardType: s
4513
4517
  }) {
4514
4518
  function n(a) {
@@ -4538,25 +4542,25 @@ function Al({
4538
4542
  ] })
4539
4543
  ] });
4540
4544
  }
4541
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
4542
- /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4543
- /* @__PURE__ */ e.jsx(U, { children: `${Rs(s)} Chart` }),
4544
- /* @__PURE__ */ e.jsx(G, { className: "space-y-4 font-mono text-xs", children: n(s) })
4545
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
4546
+ /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4547
+ /* @__PURE__ */ e.jsx(G, { children: `${Rs(s)} Chart` }),
4548
+ /* @__PURE__ */ e.jsx(K, { className: "space-y-4 font-mono text-xs", children: n(s) })
4545
4549
  ] }),
4546
- /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
4547
- /* @__PURE__ */ e.jsx(U, { children: "Settings" }),
4548
- /* @__PURE__ */ e.jsx(G, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ps, {}) })
4550
+ /* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
4551
+ /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
4552
+ /* @__PURE__ */ e.jsx(K, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ps, {}) })
4549
4553
  ] }),
4550
- /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4551
- /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
4552
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4553
- /* @__PURE__ */ e.jsx(Ve, {}),
4554
- /* @__PURE__ */ e.jsx(qe, {})
4554
+ /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
4555
+ /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
4556
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4557
+ /* @__PURE__ */ e.jsx(qe, {}),
4558
+ /* @__PURE__ */ e.jsx(Re, {})
4555
4559
  ] })
4556
4560
  ] })
4557
4561
  ] }) });
4558
4562
  }
4559
- const El = {
4563
+ const ql = {
4560
4564
  datasets: [
4561
4565
  {
4562
4566
  type: "line",
@@ -4569,7 +4573,7 @@ const El = {
4569
4573
  data: []
4570
4574
  }
4571
4575
  ]
4572
- }, Vl = {
4576
+ }, Rl = {
4573
4577
  datasets: [
4574
4578
  {
4575
4579
  fill: "origin",
@@ -4579,32 +4583,32 @@ const El = {
4579
4583
  }
4580
4584
  ]
4581
4585
  };
4582
- function ql() {
4586
+ function _l() {
4583
4587
  const s = o((n) => n.card.type);
4584
4588
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4585
4589
  /* @__PURE__ */ e.jsx(
4586
- De,
4590
+ Le,
4587
4591
  {
4588
4592
  className: " ",
4589
4593
  type: "single",
4590
4594
  collapsible: !0,
4591
- children: Rl(s)
4595
+ children: Hl(s)
4592
4596
  }
4593
4597
  ),
4594
4598
  /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(ps, {}) }),
4595
4599
  !["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4596
4600
  /* @__PURE__ */ e.jsx(Ps, {}),
4597
- /* @__PURE__ */ e.jsx(Ve, {}),
4598
- /* @__PURE__ */ e.jsx(qe, {})
4601
+ /* @__PURE__ */ e.jsx(qe, {}),
4602
+ /* @__PURE__ */ e.jsx(Re, {})
4599
4603
  ] })
4600
4604
  ] });
4601
4605
  }
4602
- function Rl(s) {
4606
+ function Hl(s) {
4603
4607
  if (["line", "bar"].includes(s))
4604
4608
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4605
- /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4606
- /* @__PURE__ */ e.jsx(U, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
4607
- /* @__PURE__ */ e.jsxs(G, { className: " ", children: [
4609
+ /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4610
+ /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
4611
+ /* @__PURE__ */ e.jsxs(K, { className: " ", children: [
4608
4612
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
4609
4613
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
4610
4614
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
@@ -4612,20 +4616,20 @@ function Rl(s) {
4612
4616
  ] })
4613
4617
  ] })
4614
4618
  ] }),
4615
- /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
4616
- /* @__PURE__ */ e.jsx(U, { className: "font-normal", children: "Mixed Chart" }),
4617
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-2 text-xs", children: [
4619
+ /* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
4620
+ /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: "Mixed Chart" }),
4621
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-2 text-xs", children: [
4618
4622
  /* @__PURE__ */ e.jsxs("p", { children: [
4619
4623
  "Click ",
4620
4624
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
4621
4625
  " and change the `type` property in the dataset."
4622
4626
  ] }),
4623
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(El, null, 2) })
4627
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(ql, null, 2) })
4624
4628
  ] })
4625
4629
  ] }),
4626
- /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4627
- /* @__PURE__ */ e.jsx(U, { className: "font-normal", children: "Area Chart" }),
4628
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-2 text-xs", children: [
4630
+ /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
4631
+ /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: "Area Chart" }),
4632
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-2 text-xs", children: [
4629
4633
  /* @__PURE__ */ e.jsxs("p", { children: [
4630
4634
  "Click ",
4631
4635
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
@@ -4641,18 +4645,18 @@ function Rl(s) {
4641
4645
  ),
4642
4646
  "for more options."
4643
4647
  ] }),
4644
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Vl, null, 2) })
4648
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Rl, null, 2) })
4645
4649
  ] })
4646
4650
  ] })
4647
4651
  ] });
4648
4652
  if (s === "bubble")
4649
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4650
- /* @__PURE__ */ e.jsx(U, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4653
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4654
+ /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4651
4655
  "How to create a ",
4652
4656
  /* @__PURE__ */ e.jsx("span", { children: s }),
4653
4657
  " chart query?"
4654
4658
  ] }) }),
4655
- /* @__PURE__ */ e.jsxs(G, { className: " ", children: [
4659
+ /* @__PURE__ */ e.jsxs(K, { className: " ", children: [
4656
4660
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
4657
4661
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
4658
4662
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -4664,13 +4668,13 @@ function Rl(s) {
4664
4668
  ] })
4665
4669
  ] }) });
4666
4670
  if (s === "scatter")
4667
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4668
- /* @__PURE__ */ e.jsx(U, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4671
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4672
+ /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4669
4673
  "How to create a ",
4670
4674
  /* @__PURE__ */ e.jsx("span", { children: s }),
4671
4675
  " chart query?"
4672
4676
  ] }) }),
4673
- /* @__PURE__ */ e.jsxs(G, { className: " ", children: [
4677
+ /* @__PURE__ */ e.jsxs(K, { className: " ", children: [
4674
4678
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis FROM table" }),
4675
4679
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
4676
4680
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -4681,13 +4685,13 @@ function Rl(s) {
4681
4685
  ] })
4682
4686
  ] }) });
4683
4687
  if (["pie", "doughnut", "polarArea"].includes(s))
4684
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4685
- /* @__PURE__ */ e.jsx(U, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4688
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4689
+ /* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4686
4690
  /* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
4687
4691
  " ",
4688
4692
  "chart query"
4689
4693
  ] }) }),
4690
- /* @__PURE__ */ e.jsxs(G, { className: " ", children: [
4694
+ /* @__PURE__ */ e.jsxs(K, { className: " ", children: [
4691
4695
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
4692
4696
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
4693
4697
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -4696,8 +4700,8 @@ function Rl(s) {
4696
4700
  ] })
4697
4701
  ] }) });
4698
4702
  }
4699
- function _l() {
4700
- var c, u, m, b, g;
4703
+ function $l() {
4704
+ var c, u, m, y, j;
4701
4705
  const s = o((h) => h.card.preferences), n = o(
4702
4706
  (h) => h.actions.setCardPreferences
4703
4707
  ), a = o(
@@ -4730,7 +4734,7 @@ function _l() {
4730
4734
  }
4731
4735
  ) || [], r = o(
4732
4736
  (h) => h.actions.setColorRanges
4733
- ), d = [...new Set(rs.map((h) => h.currency))];
4737
+ ), d = [...new Set(is.map((h) => h.currency))];
4734
4738
  return /* @__PURE__ */ e.jsxs("div", { children: [
4735
4739
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
4736
4740
  /* @__PURE__ */ e.jsx(
@@ -4772,7 +4776,7 @@ function _l() {
4772
4776
  /* @__PURE__ */ e.jsx(me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4773
4777
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(we, { children: [
4774
4778
  /* @__PURE__ */ e.jsx(fe, { children: "Format" }),
4775
- rs.map((h) => /* @__PURE__ */ e.jsx(J, { value: h.locale, children: h.locale }, h.locale))
4779
+ is.map((h) => /* @__PURE__ */ e.jsx(W, { value: h.locale, children: h.locale }, h.locale))
4776
4780
  ] }) })
4777
4781
  ]
4778
4782
  }
@@ -4797,8 +4801,8 @@ function _l() {
4797
4801
  /* @__PURE__ */ e.jsx(me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4798
4802
  /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(we, { children: [
4799
4803
  /* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
4800
- /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }, "none"),
4801
- d.map((h) => /* @__PURE__ */ e.jsx(J, { value: h, children: h }, h))
4804
+ /* @__PURE__ */ e.jsx(W, { value: "none", children: "None" }, "none"),
4805
+ d.map((h) => /* @__PURE__ */ e.jsx(W, { value: h, children: h }, h))
4802
4806
  ] }) })
4803
4807
  ]
4804
4808
  }
@@ -4811,7 +4815,7 @@ function _l() {
4811
4815
  /* @__PURE__ */ e.jsxs(
4812
4816
  he,
4813
4817
  {
4814
- value: ((b = (m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : b.toString()) || "0",
4818
+ value: ((y = (m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : y.toString()) || "0",
4815
4819
  onValueChange: (h) => {
4816
4820
  var x, C, I;
4817
4821
  return a(
@@ -4823,7 +4827,7 @@ function _l() {
4823
4827
  },
4824
4828
  children: [
4825
4829
  /* @__PURE__ */ e.jsx(me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4826
- /* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(J, { value: h, children: h }, h)) })
4830
+ /* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(W, { value: h, children: h }, h)) })
4827
4831
  ]
4828
4832
  }
4829
4833
  )
@@ -4833,7 +4837,7 @@ function _l() {
4833
4837
  /* @__PURE__ */ e.jsx(
4834
4838
  Se,
4835
4839
  {
4836
- value: ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || "",
4840
+ value: ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || "",
4837
4841
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
4838
4842
  placeholder: "K, M, B, %",
4839
4843
  onChange: (h) => {
@@ -4850,9 +4854,9 @@ function _l() {
4850
4854
  ] })
4851
4855
  ] })
4852
4856
  ] }) }),
4853
- /* @__PURE__ */ e.jsx(Ie, { className: "my-3" }),
4857
+ /* @__PURE__ */ e.jsx(Te, { className: "my-3" }),
4854
4858
  /* @__PURE__ */ e.jsx(
4855
- un,
4859
+ mn,
4856
4860
  {
4857
4861
  colorRanges: i,
4858
4862
  setColorRanges: r
@@ -4861,11 +4865,11 @@ function _l() {
4861
4865
  ] })
4862
4866
  ] });
4863
4867
  }
4864
- function Hl() {
4868
+ function Pl() {
4865
4869
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4866
- /* @__PURE__ */ e.jsx(De, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4867
- /* @__PURE__ */ e.jsx(U, { className: "", children: "KPI Query" }),
4868
- /* @__PURE__ */ e.jsxs(G, { className: "font-mono", children: [
4870
+ /* @__PURE__ */ e.jsx(Le, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4871
+ /* @__PURE__ */ e.jsx(G, { className: "", children: "KPI Query" }),
4872
+ /* @__PURE__ */ e.jsxs(K, { className: "font-mono", children: [
4869
4873
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
4870
4874
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
4871
4875
  /* @__PURE__ */ e.jsx("li", { children: "current - number" }),
@@ -4887,12 +4891,12 @@ function Hl() {
4887
4891
  ] })
4888
4892
  ] })
4889
4893
  ] }) }),
4890
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(_l, {}) }),
4894
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx($l, {}) }),
4891
4895
  /* @__PURE__ */ e.jsx("div", {}),
4892
4896
  /* @__PURE__ */ e.jsx("div", {})
4893
4897
  ] });
4894
4898
  }
4895
- function $l() {
4899
+ function Bl() {
4896
4900
  var t;
4897
4901
  const s = o((l) => l.card.preferences), { setCardPreferences: n } = o((l) => l.actions);
4898
4902
  function a(l) {
@@ -4913,26 +4917,26 @@ function $l() {
4913
4917
  defaultValue: "x",
4914
4918
  children: [
4915
4919
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4916
- /* @__PURE__ */ e.jsx(Te, { value: "static", id: "r1" }),
4920
+ /* @__PURE__ */ e.jsx(De, { value: "static", id: "r1" }),
4917
4921
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
4918
4922
  ] }),
4919
4923
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4920
- /* @__PURE__ */ e.jsx(Te, { value: "dynamic", id: "r2" }),
4924
+ /* @__PURE__ */ e.jsx(De, { value: "dynamic", id: "r2" }),
4921
4925
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
4922
4926
  ] })
4923
4927
  ]
4924
4928
  }
4925
4929
  );
4926
4930
  }
4927
- function as({
4931
+ function ts({
4928
4932
  cardType: s,
4929
4933
  docContent: n,
4930
4934
  suffix: a = "Chart"
4931
4935
  }) {
4932
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
4933
- /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4934
- /* @__PURE__ */ e.jsx(U, { children: `${Rs(s)} ${a}` }),
4935
- /* @__PURE__ */ e.jsx(G, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4936
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
4937
+ /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
4938
+ /* @__PURE__ */ e.jsx(G, { children: `${Rs(s)} ${a}` }),
4939
+ /* @__PURE__ */ e.jsx(K, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4936
4940
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
4937
4941
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
4938
4942
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
@@ -4954,24 +4958,24 @@ function as({
4954
4958
  ] })
4955
4959
  ] }) })
4956
4960
  ] }),
4957
- /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
4958
- /* @__PURE__ */ e.jsx(U, { children: "Settings" }),
4959
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4961
+ /* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
4962
+ /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
4963
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4960
4964
  s === "range" && /* @__PURE__ */ e.jsx(ps, {}),
4961
4965
  s !== "text" && /* @__PURE__ */ e.jsx(Ps, {}),
4962
- s === "text" && /* @__PURE__ */ e.jsx($l, {})
4966
+ s === "text" && /* @__PURE__ */ e.jsx(Bl, {})
4963
4967
  ] })
4964
4968
  ] }),
4965
- !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4966
- /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
4967
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4968
- /* @__PURE__ */ e.jsx(Ve, {}),
4969
- /* @__PURE__ */ e.jsx(qe, {})
4969
+ !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
4970
+ /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
4971
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
4972
+ /* @__PURE__ */ e.jsx(qe, {}),
4973
+ /* @__PURE__ */ e.jsx(Re, {})
4970
4974
  ] })
4971
4975
  ] })
4972
4976
  ] }) });
4973
4977
  }
4974
- function Pl() {
4978
+ function Ul() {
4975
4979
  const s = o(
4976
4980
  (t) => {
4977
4981
  var l, i;
@@ -4982,7 +4986,7 @@ function Pl() {
4982
4986
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4983
4987
  /* @__PURE__ */ e.jsx(_, { children: "Sort" }),
4984
4988
  /* @__PURE__ */ e.jsx(
4985
- $e,
4989
+ Pe,
4986
4990
  {
4987
4991
  className: "h-8",
4988
4992
  label: "Sort Chart",
@@ -5008,10 +5012,10 @@ function Pl() {
5008
5012
  )
5009
5013
  ] });
5010
5014
  }
5011
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
5012
- /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
5013
- /* @__PURE__ */ e.jsx(U, { children: "Stacked Chart" }),
5014
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 font-mono text-xs", children: [
5015
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
5016
+ /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
5017
+ /* @__PURE__ */ e.jsx(G, { children: "Stacked Chart" }),
5018
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 font-mono text-xs", children: [
5015
5019
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
5016
5020
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
5017
5021
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -5034,24 +5038,24 @@ function Pl() {
5034
5038
  ] })
5035
5039
  ] })
5036
5040
  ] }),
5037
- /* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
5038
- /* @__PURE__ */ e.jsx(U, { children: "Settings" }),
5039
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5041
+ /* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
5042
+ /* @__PURE__ */ e.jsx(G, { children: "Settings" }),
5043
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
5040
5044
  /* @__PURE__ */ e.jsx(ps, {}),
5041
5045
  a(),
5042
5046
  /* @__PURE__ */ e.jsx(Ya, {})
5043
5047
  ] })
5044
5048
  ] }),
5045
- /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
5046
- /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
5047
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5048
- /* @__PURE__ */ e.jsx(Ve, {}),
5049
- /* @__PURE__ */ e.jsx(qe, {})
5049
+ /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
5050
+ /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
5051
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
5052
+ /* @__PURE__ */ e.jsx(qe, {}),
5053
+ /* @__PURE__ */ e.jsx(Re, {})
5050
5054
  ] })
5051
5055
  ] })
5052
5056
  ] }) });
5053
5057
  }
5054
- function Bl({}) {
5058
+ function Gl({}) {
5055
5059
  const s = o((t) => {
5056
5060
  var l;
5057
5061
  return (l = t.card) == null ? void 0 : l.preferences;
@@ -5064,11 +5068,11 @@ function Bl({}) {
5064
5068
  });
5065
5069
  };
5066
5070
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
5067
- /* @__PURE__ */ e.jsx(De, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
5068
- /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
5069
- /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5070
- /* @__PURE__ */ e.jsx(Ve, {}),
5071
- /* @__PURE__ */ e.jsx(qe, {})
5071
+ /* @__PURE__ */ e.jsx(Le, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
5072
+ /* @__PURE__ */ e.jsx(G, { children: "Filters" }),
5073
+ /* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
5074
+ /* @__PURE__ */ e.jsx(qe, {}),
5075
+ /* @__PURE__ */ e.jsx(Re, {})
5072
5076
  ] })
5073
5077
  ] }) }),
5074
5078
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
@@ -5084,7 +5088,7 @@ function Bl({}) {
5084
5088
  ] })
5085
5089
  ] });
5086
5090
  }
5087
- const Ul = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5091
+ const Kl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5088
5092
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
5089
5093
  /* @__PURE__ */ e.jsxs("div", { children: [
5090
5094
  "See ",
@@ -5100,7 +5104,7 @@ const Ul = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5100
5104
  ),
5101
5105
  " in the docs."
5102
5106
  ] })
5103
- ] }), Gl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5107
+ ] }), Ql = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5104
5108
  /* @__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" }),
5105
5109
  /* @__PURE__ */ e.jsxs("div", { children: [
5106
5110
  "See ",
@@ -5116,7 +5120,7 @@ const Ul = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5116
5120
  ),
5117
5121
  " in the docs."
5118
5122
  ] })
5119
- ] }), Kl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5123
+ ] }), Wl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5120
5124
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
5121
5125
  /* @__PURE__ */ e.jsxs("div", { children: [
5122
5126
  "See ",
@@ -5133,88 +5137,88 @@ const Ul = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5133
5137
  " in the docs."
5134
5138
  ] })
5135
5139
  ] });
5136
- function Ql() {
5140
+ function Jl() {
5137
5141
  const s = o((a) => a.card.type);
5138
5142
  function n(a) {
5139
5143
  switch (a) {
5140
5144
  case "stackedBar":
5141
5145
  case "stackedLine":
5142
- return /* @__PURE__ */ e.jsx(Pl, {});
5146
+ return /* @__PURE__ */ e.jsx(Ul, {});
5143
5147
  case "pyramid":
5144
- return /* @__PURE__ */ e.jsx(as, { docContent: Ul, cardType: a });
5148
+ return /* @__PURE__ */ e.jsx(ts, { docContent: Kl, cardType: a });
5145
5149
  case "kpi":
5146
- return /* @__PURE__ */ e.jsx(Hl, {});
5150
+ return /* @__PURE__ */ e.jsx(Pl, {});
5147
5151
  case "line":
5148
5152
  case "bar":
5149
- return /* @__PURE__ */ e.jsx(Ol, { cardType: a });
5153
+ return /* @__PURE__ */ e.jsx(El, { cardType: a });
5150
5154
  case "range":
5151
- return /* @__PURE__ */ e.jsx(as, { docContent: Gl, cardType: a });
5155
+ return /* @__PURE__ */ e.jsx(ts, { docContent: Ql, cardType: a });
5152
5156
  case "pie":
5153
5157
  case "doughnut":
5154
5158
  case "polarArea":
5155
5159
  case "radar":
5156
- return /* @__PURE__ */ e.jsx(as, { cardType: a });
5160
+ return /* @__PURE__ */ e.jsx(ts, { cardType: a });
5157
5161
  case "bubble":
5158
5162
  case "scatter":
5159
- return /* @__PURE__ */ e.jsx(Al, { cardType: a });
5163
+ return /* @__PURE__ */ e.jsx(Vl, { cardType: a });
5160
5164
  case "table":
5161
- return /* @__PURE__ */ e.jsx(Bl, { cardType: a });
5165
+ return /* @__PURE__ */ e.jsx(Gl, { cardType: a });
5162
5166
  case "text":
5163
5167
  return /* @__PURE__ */ e.jsx(
5164
- as,
5168
+ ts,
5165
5169
  {
5166
- docContent: Kl,
5170
+ docContent: Wl,
5167
5171
  cardType: a,
5168
5172
  suffix: "Visual"
5169
5173
  }
5170
5174
  );
5171
5175
  case "custom":
5172
- return /* @__PURE__ */ e.jsx(Tl, {});
5176
+ return /* @__PURE__ */ e.jsx(Ll, {});
5173
5177
  default:
5174
- return /* @__PURE__ */ e.jsx(ql, {});
5178
+ return /* @__PURE__ */ e.jsx(_l, {});
5175
5179
  }
5176
5180
  }
5177
5181
  return /* @__PURE__ */ e.jsx(qs, { className: "h-full w-full text-sm", children: n(s) });
5178
5182
  }
5179
- function Wl() {
5183
+ function Yl() {
5180
5184
  const s = o((n) => n.isShowingVisual);
5181
5185
  return /* @__PURE__ */ e.jsxs(
5182
- vs,
5186
+ ys,
5183
5187
  {
5184
5188
  direction: "vertical",
5185
5189
  className: "min-h-[250px] min-w-full max-w-lg",
5186
5190
  children: [
5187
5191
  /* @__PURE__ */ e.jsx(
5188
- Ae,
5192
+ Ee,
5189
5193
  {
5190
5194
  role: "query-section",
5191
5195
  className: "flex",
5192
5196
  minSize: 20,
5193
5197
  defaultSize: 40,
5194
- children: /* @__PURE__ */ e.jsx(jl, {})
5198
+ children: /* @__PURE__ */ e.jsx(yl, {})
5195
5199
  }
5196
5200
  ),
5197
- /* @__PURE__ */ e.jsx(Cs, { withHandle: !0, className: "border" }),
5201
+ /* @__PURE__ */ e.jsx(vs, { withHandle: !0, className: "border" }),
5198
5202
  /* @__PURE__ */ e.jsx(
5199
- Ae,
5203
+ Ee,
5200
5204
  {
5201
5205
  className: "pb-1",
5202
5206
  role: "visual-section",
5203
5207
  minSize: 0,
5204
5208
  defaultSize: 60,
5205
- children: s ? /* @__PURE__ */ e.jsxs(vs, { direction: "horizontal", children: [
5209
+ children: s ? /* @__PURE__ */ e.jsxs(ys, { direction: "horizontal", children: [
5206
5210
  /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
5207
- Ae,
5211
+ Ee,
5208
5212
  {
5209
5213
  className: "flex min-w-[275px]",
5210
5214
  minSize: 20,
5211
5215
  defaultSize: 25,
5212
5216
  maxSize: 30,
5213
- children: /* @__PURE__ */ e.jsx(Ql, {})
5217
+ children: /* @__PURE__ */ e.jsx(Jl, {})
5214
5218
  }
5215
5219
  ) }),
5216
- /* @__PURE__ */ e.jsx(Cs, { className: "border" }),
5217
- /* @__PURE__ */ e.jsx(Ae, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(aa, {}) })
5220
+ /* @__PURE__ */ e.jsx(vs, { className: "border" }),
5221
+ /* @__PURE__ */ e.jsx(Ee, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(aa, {}) })
5218
5222
  ] }) : /* @__PURE__ */ e.jsx(aa, {})
5219
5223
  }
5220
5224
  )
@@ -5222,15 +5226,15 @@ function Wl() {
5222
5226
  }
5223
5227
  );
5224
5228
  }
5225
- function Jl({ authToken: s, onSave: n, onClose: a }) {
5229
+ function Xl({ authToken: s, onSave: n, onClose: a }) {
5226
5230
  z((r) => r.themeStyle);
5227
5231
  const t = o((r) => r.actions.setOnSave), l = o((r) => r.actions.setOnClose), i = z((r) => r.actions.setAuthToken);
5228
- return X(() => {
5232
+ return Y(() => {
5229
5233
  n && t(n), a && l(a);
5230
- }, [n, t, a, l]), X(() => {
5234
+ }, [n, t, a, l]), Y(() => {
5231
5235
  s && s.accessToken && i(s);
5232
5236
  }, [s, i]), /* @__PURE__ */ e.jsx(wa, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(
5233
- hn,
5237
+ xn,
5234
5238
  {
5235
5239
  style: {
5236
5240
  // borderRadius: currentStyle?.chart?.options?.borderRadius,
@@ -5239,13 +5243,13 @@ function Jl({ authToken: s, onSave: n, onClose: a }) {
5239
5243
  className: "rounded-none",
5240
5244
  role: "editor-panel",
5241
5245
  children: [
5242
- /* @__PURE__ */ e.jsx(mn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Ea, {}) }),
5243
- /* @__PURE__ */ e.jsx(xn, { children: /* @__PURE__ */ e.jsx(Wl, {}) })
5246
+ /* @__PURE__ */ e.jsx(pn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Ea, {}) }),
5247
+ /* @__PURE__ */ e.jsx(fn, { children: /* @__PURE__ */ e.jsx(Yl, {}) })
5244
5248
  ]
5245
5249
  }
5246
5250
  ) });
5247
5251
  }
5248
- function Yl() {
5252
+ function Zl() {
5249
5253
  z((r) => r.selectedCardId);
5250
5254
  const s = z((r) => r.selectedSheetId), { setIsVisualEditing: n } = z((r) => r.actions), a = z((r) => r.isVisualEditing), t = z((r) => r.actions.updateFrame);
5251
5255
  function l(r) {
@@ -5258,15 +5262,15 @@ function Yl() {
5258
5262
  "div",
5259
5263
  {
5260
5264
  role: "editor-container",
5261
- className: Z("flex grow", {
5265
+ className: X("flex grow", {
5262
5266
  block: a,
5263
5267
  hidden: !a
5264
5268
  }),
5265
- children: /* @__PURE__ */ e.jsx(Jl, { onSave: l, onClose: i })
5269
+ children: /* @__PURE__ */ e.jsx(Xl, { onSave: l, onClose: i })
5266
5270
  }
5267
5271
  );
5268
5272
  }
5269
- function Xl() {
5273
+ function er() {
5270
5274
  o((r) => r.selectedConnectionId), o((r) => r.selectedDatamodelId);
5271
5275
  const s = o((r) => r.selectedDatabaseName);
5272
5276
  o((r) => r.selectedSchemaName);
@@ -5274,7 +5278,7 @@ function Xl() {
5274
5278
  z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
5275
5279
  (r) => r.actions.removeFilterValue
5276
5280
  );
5277
- const { modelItems: t, columns: l } = Ee(), { assignFilter: i } = Xa();
5281
+ const { modelItems: t, columns: l } = Ve(), { assignFilter: i } = Xa();
5278
5282
  return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((r) => {
5279
5283
  const d = a == null ? void 0 : a.find(
5280
5284
  (c) => c.column === ue(r.column_name) && c.table === n && c.database === s
@@ -5283,7 +5287,7 @@ function Xl() {
5283
5287
  "div",
5284
5288
  {
5285
5289
  onClick: () => i(r),
5286
- className: Z(
5290
+ className: X(
5287
5291
  "group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
5288
5292
  {
5289
5293
  "bg-muted": d
@@ -5298,7 +5302,7 @@ function Xl() {
5298
5302
  );
5299
5303
  }) });
5300
5304
  }
5301
- function Zl() {
5305
+ function sr() {
5302
5306
  z((n) => n.showFilters);
5303
5307
  const s = z(
5304
5308
  (n) => n.actions.setShowFilters
@@ -5312,7 +5316,7 @@ function Zl() {
5312
5316
  onClick: () => s(!1),
5313
5317
  className: "h-7 w-7 p-0",
5314
5318
  variant: "ghost",
5315
- children: /* @__PURE__ */ e.jsx(Be, {})
5319
+ children: /* @__PURE__ */ e.jsx(Ue, {})
5316
5320
  }
5317
5321
  )
5318
5322
  ] }),
@@ -5322,7 +5326,7 @@ function Zl() {
5322
5326
  ColumnsComponent: () => (
5323
5327
  // schemaName, tableName, columns
5324
5328
  /* @__PURE__ */ e.jsx(
5325
- Xl,
5329
+ er,
5326
5330
  {}
5327
5331
  )
5328
5332
  )
@@ -5330,24 +5334,24 @@ function Zl() {
5330
5334
  ) })
5331
5335
  ] });
5332
5336
  }
5333
- function er() {
5337
+ function ar() {
5334
5338
  const s = z((a) => a.showFilters), n = z((a) => a.isVisualEditing);
5335
5339
  return /* @__PURE__ */ e.jsxs(
5336
5340
  "div",
5337
5341
  {
5338
5342
  role: "dashboard-plus-main",
5339
- className: Z("grow", {
5343
+ className: X("grow", {
5340
5344
  hidden: n,
5341
5345
  flex: !n
5342
5346
  }),
5343
5347
  children: [
5344
- /* @__PURE__ */ e.jsx(pn, {}),
5345
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(Zl, {}) })
5348
+ /* @__PURE__ */ e.jsx(gn, {}),
5349
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(sr, {}) })
5346
5350
  ]
5347
5351
  }
5348
5352
  );
5349
5353
  }
5350
- function sr() {
5354
+ function tr() {
5351
5355
  const s = z((t) => t.dashboard), n = z((t) => t.actions.setDashboard), a = z(
5352
5356
  (t) => t.showDashboardJSON
5353
5357
  );
@@ -5356,11 +5360,11 @@ function sr() {
5356
5360
  ), /* @__PURE__ */ e.jsx(
5357
5361
  "div",
5358
5362
  {
5359
- className: Z(" p-2", {
5363
+ className: X(" p-2", {
5360
5364
  hidden: !a
5361
5365
  }),
5362
5366
  children: /* @__PURE__ */ e.jsx(
5363
- fn,
5367
+ jn,
5364
5368
  {
5365
5369
  onChange: (t) => {
5366
5370
  if (t)
@@ -5391,64 +5395,64 @@ function sr() {
5391
5395
  }
5392
5396
  );
5393
5397
  }
5394
- function lr({
5398
+ function ir({
5395
5399
  showControls: s = !1,
5396
5400
  showFooter: n = !0,
5397
5401
  ...a
5398
5402
  }) {
5399
- return /* @__PURE__ */ e.jsx(wa, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(gn, { dashboardProps: a, children: [
5400
- /* @__PURE__ */ e.jsx(jn, {}),
5401
- /* @__PURE__ */ e.jsxs(bn, { children: [
5402
- /* @__PURE__ */ e.jsx(sr, {}),
5403
- /* @__PURE__ */ e.jsxs(yn, { ...a, children: [
5404
- s && /* @__PURE__ */ e.jsx(el, {}),
5405
- /* @__PURE__ */ e.jsx(Yl, {}),
5406
- /* @__PURE__ */ e.jsx(er, {})
5403
+ return /* @__PURE__ */ e.jsx(wa, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(bn, { dashboardProps: a, children: [
5404
+ /* @__PURE__ */ e.jsx(yn, {}),
5405
+ /* @__PURE__ */ e.jsxs(vn, { children: [
5406
+ /* @__PURE__ */ e.jsx(tr, {}),
5407
+ /* @__PURE__ */ e.jsxs(Cn, { ...a, children: [
5408
+ s && /* @__PURE__ */ e.jsx(al, {}),
5409
+ /* @__PURE__ */ e.jsx(Zl, {}),
5410
+ /* @__PURE__ */ e.jsx(ar, {})
5407
5411
  ] })
5408
5412
  ] })
5409
5413
  ] }) });
5410
5414
  }
5411
5415
  export {
5412
- Gn as A,
5413
- Cn as B,
5414
- Nn as C,
5415
- lr as D,
5416
+ Qn as A,
5417
+ Sn as B,
5418
+ wn as C,
5419
+ ir as D,
5416
5420
  Ta as E,
5417
5421
  $s as F,
5418
- Tn as G,
5419
- Dn as H,
5422
+ Ln as G,
5423
+ Mn as H,
5420
5424
  Da as K,
5421
- Qe as L,
5422
- Vn as M,
5423
- qn as N,
5425
+ We as L,
5426
+ Rn as M,
5427
+ _n as N,
5424
5428
  La as P,
5425
- He as S,
5426
- Un as T,
5427
- Kn as U,
5429
+ $e as S,
5430
+ Kn as T,
5431
+ Wn as U,
5428
5432
  _s as a,
5429
5433
  Hs as b,
5430
- Qn as c,
5434
+ Jn as c,
5431
5435
  za as d,
5432
5436
  Fa as e,
5433
5437
  Ia as f,
5434
5438
  Oa as g,
5435
- Sn as h,
5436
- wn as i,
5437
- kn as j,
5438
- zn as k,
5439
- In as l,
5440
- Fn as m,
5441
- Ln as n,
5442
- Mn as o,
5443
- On as p,
5444
- An as q,
5445
- En as r,
5446
- Rn as s,
5447
- _n as t,
5448
- Ee as u,
5449
- Hn as v,
5439
+ kn as h,
5440
+ zn as i,
5441
+ Fn as j,
5442
+ In as k,
5443
+ Dn as l,
5444
+ Tn as m,
5445
+ On as n,
5446
+ An as o,
5447
+ En as p,
5448
+ Vn as q,
5449
+ qn as r,
5450
+ Hn as s,
5451
+ $n as t,
5452
+ Ve as u,
5453
+ Pn as v,
5450
5454
  Ma as w,
5451
- $n as x,
5452
- Pn as y,
5453
- Bn as z
5455
+ Bn as x,
5456
+ Un as y,
5457
+ Gn as z
5454
5458
  };