react-semaphor 0.0.325 → 0.0.327

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { c as V, p as zs, u as z, n as Os, o as ke, q as e, r as Fs, s as Is, t as O, j as Ds, v as Ts, w as Ls, x as Ms, y as Es, L as R, z as le, A as la, E as ra, H as ia, J as oa, K as st, M as at, N as tt, O as Js, Q, R as Qe, h as nt, V as m, W as lt, F as ca, Y as Je, Z as Ke, _ as da, $ as rt, a0 as ua, a1 as me, a2 as he, a3 as xe, a4 as pe, a5 as Se, a6 as fe, a7 as K, T as As, a8 as Vs, a9 as qs, aa as Rs, ab as ma, ac as ha, ad as de, ae as it, af as ot, ag as xa, ah as ct, C as dt, ai as ut, aj as pa, B as mt, ak as We, al as ht, am as Ks, an as fa, ao as ys, ap as Ne, aq as Fe, ar as ge, as as ga, at as xt, au as pt, av as ft, aw as gt, I as jt, ax as bt, ay as yt, az as vt, aA as qe, aB as vs, aC as Ct, a as Nt, aD as Ue, aE as Cs, aF as Ae, aG as Ns, aH as St, aI as wt, aJ as kt, aK as zt, aL as Ot, aM as Ft, aN as bs, aO as It, aP as Ws, aQ as Dt, aR as Ys, aS as Tt, aT as Lt, aU as Mt, aV as Et, aW as ja, aX as re, aY as _s, aZ as ba, a_ as At, a$ as Vt, b0 as ls, b1 as qt, b2 as Rt, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, l as Ut, b8 as us, b9 as ya, ba as va, bb as Ca, bc as rs, bd as Na, be as is, bf as Xs, bg as Gt, bh as Qt, bi as ms, bj as hs, bk as xs, bl as Jt, X as Sa, bm as Kt, bn as Wt, bo as Yt, bp as ps, bq as Ie, f as Xt, br as Be, bs as Hs, bt as wa, bu as Zt, bv as en, bw as os, bx as sn, by as an, bz as tn, bA as Zs, bB as nn, bC as ln, bD as rn, bE as on, bF as cn, bG as dn, bH as un, bI as mn, bJ as De, bK as B, bL as U, bM as $s, bN as G, bO as hn, bP as ka, bQ as xn, bR as pn, bS as fn, bT as gn, bU as jn, bV as bn, bW as yn, bX as vn, bY as Cn } from "./index-kzckqacZ.js";
1
+ import { c as V, q as zs, u as z, r as Os, s as ke, t as e, v as Fs, w as Is, x as O, k as Ds, y as Ts, z as Ls, A as Ms, E as Es, H as R, J as le, K as la, M as ra, N as ia, O as oa, Q as st, R as at, V as tt, W as Js, Y as Q, Z as Je, h as nt, _ as m, $ as lt, F as ca, a0 as Ke, a1 as We, a2 as da, a3 as rt, a4 as ua, a5 as me, a6 as he, a7 as xe, a8 as pe, a9 as Ne, aa as fe, ab as K, T as As, ac as Vs, ad as qs, ae as Rs, af as ma, ag as ha, ah as de, ai as it, aj as ot, ak as xa, al as ct, C as dt, am as ut, an as pa, B as mt, ao as qe, ap as ht, aq as Ks, ar as fa, as as ys, at as Ce, au as Fe, av as Se, aw as ga, ax as xt, ay as pt, az as ft, aA as gt, I as jt, aB as bt, aC as yt, aD as vt, aE as Re, aF as vs, aG as Ct, a as Nt, aH as Ge, aI as Cs, aJ as Ae, aK as Ns, aL as St, aM as wt, aN as kt, aO as zt, aP as Ot, aQ as Ft, aR as bs, aS as It, aT as Ws, aU as Dt, aV as Ys, aW as Tt, aX as Lt, aY as Mt, aZ as Et, a_ as ja, a$ as re, b0 as _s, b1 as ba, b2 as At, b3 as Vt, b4 as ls, b5 as qt, b6 as Rt, b7 as _t, b8 as Ht, o as $t, b9 as Pt, ba as Bt, bb as Ut, n as Gt, bc as us, bd as ya, be as va, bf as Ca, bg as rs, bh as Na, bi as is, bj as Xs, bk as Qt, bl as Jt, bm as ms, bn as hs, bo as xs, bp as Kt, X as Sa, bq as Wt, br as Yt, bs as Xt, bt as ps, bu as Ie, f as Zt, bv as Ue, bw as Hs, bx as wa, by as en, bz as sn, bA as os, bB as an, bC as tn, bD as nn, bE as Zs, bF as ln, bG as rn, bH as on, bI as cn, bJ as dn, bK as un, bL as mn, bM as hn, bN as De, bO as B, bP as U, bQ as $s, bR as G, bS as xn, bT as ka, bU as pn, bV as fn, bW as gn, bX as jn, bY as bn, bZ as yn, b_ as vn, b$ as Cn, c0 as Nn } from "./index-D9w7Qyp6.js";
2
2
  import * as ea from "react";
3
- import we, { useState as q, useMemo as Ss, useEffect as Z, useRef as ws, Suspense as Nn } from "react";
3
+ import we, { useState as q, useMemo as Ss, useEffect as Z, useRef as ws, Suspense as Sn } 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 Sn = V("Box", [
11
+ const wn = V("Box", [
12
12
  [
13
13
  "path",
14
14
  {
@@ -25,7 +25,7 @@ const Sn = V("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 wn = V("ChartArea", [
28
+ const kn = V("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 Fa = V("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 kn = V("CircleX", [
107
+ const zn = V("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 kn = V("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 zn = V("CopyPlus", [
118
+ const On = V("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 zn = V("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 On = V("Database", [
130
+ const Fn = V("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 Ia = V("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 Fn = V("Eraser", [
152
+ const In = V("Eraser", [
153
153
  [
154
154
  "path",
155
155
  {
@@ -166,7 +166,7 @@ const Fn = V("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 In = V("EyeClosed", [
169
+ const Dn = V("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 In = V("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 Dn = V("Eye", [
182
+ const Tn = V("Eye", [
183
183
  [
184
184
  "path",
185
185
  {
@@ -195,7 +195,7 @@ const Dn = V("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 = V("Glasses", [
198
+ const Ln = V("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 = V("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 Ln = V("Hammer", [
211
+ const Mn = V("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 Ln = V("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 Mn = V("Hash", [
228
+ const En = V("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 Mn = V("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 En = V("House", [
240
+ const An = V("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",
@@ -253,7 +253,7 @@ const En = V("House", [
253
253
  * This source code is licensed under the ISC license.
254
254
  * See the LICENSE file in the root directory of this source tree.
255
255
  */
256
- const An = V("IdCard", [
256
+ const Vn = V("IdCard", [
257
257
  ["path", { d: "M16 10h2", key: "8sgtl7" }],
258
258
  ["path", { d: "M16 14h2", key: "epxaof" }],
259
259
  ["path", { d: "M6.17 15a3 3 0 0 1 5.66 0", key: "n6f512" }],
@@ -266,7 +266,7 @@ const An = V("IdCard", [
266
266
  * This source code is licensed under the ISC license.
267
267
  * See the LICENSE file in the root directory of this source tree.
268
268
  */
269
- const Vn = V("ListEnd", [
269
+ const qn = V("ListEnd", [
270
270
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
271
271
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
272
272
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -279,7 +279,7 @@ const Vn = V("ListEnd", [
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
281
  */
282
- const qn = V("ListStart", [
282
+ const Rn = V("ListStart", [
283
283
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
284
284
  ["path", { d: "M16 18H3", key: "12xzn7" }],
285
285
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -292,7 +292,7 @@ const qn = V("ListStart", [
292
292
  * This source code is licensed under the ISC license.
293
293
  * See the LICENSE file in the root directory of this source tree.
294
294
  */
295
- const Rn = V("ListX", [
295
+ const _n = V("ListX", [
296
296
  ["path", { d: "M11 12H3", key: "51ecnj" }],
297
297
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
298
298
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -331,7 +331,7 @@ const Da = V("Map", [
331
331
  * This source code is licensed under the ISC license.
332
332
  * See the LICENSE file in the root directory of this source tree.
333
333
  */
334
- const _n = V("MessageSquareMore", [
334
+ const Hn = V("MessageSquareMore", [
335
335
  ["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" }],
336
336
  ["path", { d: "M8 10h.01", key: "19clt8" }],
337
337
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -343,7 +343,7 @@ const _n = V("MessageSquareMore", [
343
343
  * This source code is licensed under the ISC license.
344
344
  * See the LICENSE file in the root directory of this source tree.
345
345
  */
346
- const Hn = V("Network", [
346
+ const $n = V("Network", [
347
347
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
348
348
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
349
349
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -372,7 +372,7 @@ const Ta = V("Pencil", [
372
372
  * This source code is licensed under the ISC license.
373
373
  * See the LICENSE file in the root directory of this source tree.
374
374
  */
375
- const $n = V("Play", [
375
+ const Pn = V("Play", [
376
376
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
377
377
  ]);
378
378
  /**
@@ -381,7 +381,7 @@ const $n = V("Play", [
381
381
  * This source code is licensed under the ISC license.
382
382
  * See the LICENSE file in the root directory of this source tree.
383
383
  */
384
- const Pn = V("Plug2", [
384
+ const Bn = V("Plug2", [
385
385
  ["path", { d: "M9 2v6", key: "17ngun" }],
386
386
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
387
387
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -394,7 +394,7 @@ const Pn = V("Plug2", [
394
394
  * This source code is licensed under the ISC license.
395
395
  * See the LICENSE file in the root directory of this source tree.
396
396
  */
397
- const Bn = V("Save", [
397
+ const Un = V("Save", [
398
398
  [
399
399
  "path",
400
400
  {
@@ -428,7 +428,7 @@ const La = V("Shapes", [
428
428
  * This source code is licensed under the ISC license.
429
429
  * See the LICENSE file in the root directory of this source tree.
430
430
  */
431
- const Un = V("ShieldQuestion", [
431
+ const Gn = V("ShieldQuestion", [
432
432
  [
433
433
  "path",
434
434
  {
@@ -445,7 +445,7 @@ const Un = V("ShieldQuestion", [
445
445
  * This source code is licensed under the ISC license.
446
446
  * See the LICENSE file in the root directory of this source tree.
447
447
  */
448
- const Gn = V("Sigma", [
448
+ const Qn = V("Sigma", [
449
449
  [
450
450
  "path",
451
451
  {
@@ -460,7 +460,7 @@ const Gn = V("Sigma", [
460
460
  * This source code is licensed under the ISC license.
461
461
  * See the LICENSE file in the root directory of this source tree.
462
462
  */
463
- const Qn = V("SwatchBook", [
463
+ const Jn = V("SwatchBook", [
464
464
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
465
465
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
466
466
  ["path", { d: "M 7 17h.01", key: "1euzgo" }],
@@ -478,7 +478,7 @@ const Qn = V("SwatchBook", [
478
478
  * This source code is licensed under the ISC license.
479
479
  * See the LICENSE file in the root directory of this source tree.
480
480
  */
481
- const Jn = V("Tag", [
481
+ const Kn = V("Tag", [
482
482
  [
483
483
  "path",
484
484
  {
@@ -494,7 +494,7 @@ const Jn = V("Tag", [
494
494
  * This source code is licensed under the ISC license.
495
495
  * See the LICENSE file in the root directory of this source tree.
496
496
  */
497
- const Kn = V("ToggleLeft", [
497
+ const Wn = V("ToggleLeft", [
498
498
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
499
499
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
500
500
  ]);
@@ -515,7 +515,7 @@ const Us = V("Type", [
515
515
  * This source code is licensed under the ISC license.
516
516
  * See the LICENSE file in the root directory of this source tree.
517
517
  */
518
- const Wn = V("User", [
518
+ const Yn = V("User", [
519
519
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
520
520
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
521
521
  ]);
@@ -528,17 +528,17 @@ function Ma(s) {
528
528
  return {
529
529
  ...a,
530
530
  frames: (n = a.frames) == null ? void 0 : n.map((l) => {
531
- var c;
531
+ var d;
532
532
  return {
533
533
  ...l,
534
- cards: (c = l.cards) == null ? void 0 : c.map((r) => Yn(r))
534
+ cards: (d = l.cards) == null ? void 0 : d.map((r) => Xn(r))
535
535
  };
536
536
  })
537
537
  };
538
538
  })
539
539
  };
540
540
  }
541
- function Yn(s) {
541
+ function Xn(s) {
542
542
  var t, a, n, l;
543
543
  return {
544
544
  ...s,
@@ -547,18 +547,18 @@ function Yn(s) {
547
547
  data: {
548
548
  ...(t = s.cfg) == null ? void 0 : t.data,
549
549
  labels: [],
550
- datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((c) => ({
551
- ...c,
550
+ datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((d) => ({
551
+ ...d,
552
552
  data: []
553
553
  }))
554
554
  }
555
555
  },
556
- customCfg: Xn(s.customCfg),
556
+ customCfg: Zn(s.customCfg),
557
557
  // if customCfg is present, clean it, otherwise return null{
558
558
  data: []
559
559
  };
560
560
  }
561
- function Xn(s) {
561
+ function Zn(s) {
562
562
  var t, a;
563
563
  return s ? {
564
564
  ...s,
@@ -572,7 +572,7 @@ function Xn(s) {
572
572
  }
573
573
  } : null;
574
574
  }
575
- async function Zn(s, t, a, n) {
575
+ async function el(s, t, a, n) {
576
576
  if (!n)
577
577
  return null;
578
578
  const l = JSON.stringify(t);
@@ -586,35 +586,35 @@ async function Zn(s, t, a, n) {
586
586
  async function ks(s, t) {
587
587
  if (!t)
588
588
  return null;
589
- const { id: a, template: n, filterValues: l, isDefault: c, shared: r } = s;
589
+ const { id: a, template: n, filterValues: l, isDefault: d, shared: r } = s;
590
590
  return await zs("https://semaphor.cloud/api/v1/lens", t, {
591
591
  lensId: a,
592
592
  template: n,
593
593
  filterValues: l,
594
- isDefault: c,
594
+ isDefault: d,
595
595
  shared: r,
596
596
  operation: "update"
597
597
  });
598
598
  }
599
- async function el(s, t) {
599
+ async function sl(s, t) {
600
600
  return t ? await zs("https://semaphor.cloud/api/v1/lens", t, {
601
601
  operation: "delete",
602
602
  lensId: s
603
603
  }) : null;
604
604
  }
605
- function sl() {
606
- const [s, t] = q(""), [a, n] = q(!1), l = z((b) => b.lenses), { setLenses: c, setSelectedLensId: r } = Os(), [o, d] = q(!1), [p, u] = q(!1), y = z((b) => b.dashboard), g = z((b) => b.filterValues), { authToken: x } = ke();
605
+ function al() {
606
+ const [s, t] = q(""), [a, n] = q(!1), l = z((C) => C.lenses), { setLenses: d, setSelectedLensId: r } = Os(), [o, c] = q(!1), [p, u] = q(!1), b = z((C) => C.dashboard), g = z((C) => C.filterValues), { authToken: h } = ke();
607
607
  async function j() {
608
- d(!0);
609
- const b = Ma(
610
- y
611
- ), I = await Zn(
608
+ c(!0);
609
+ const C = Ma(
610
+ b
611
+ ), F = await el(
612
612
  s,
613
- b,
613
+ C,
614
614
  g,
615
- x == null ? void 0 : x.accessToken
615
+ h == null ? void 0 : h.accessToken
616
616
  );
617
- I && (c([...l || [], I]), r(I.id), u(!1)), d(!1);
617
+ F && (d([...l || [], F]), r(F.id), u(!1)), c(!1);
618
618
  }
619
619
  return /* @__PURE__ */ e.jsxs(Fs, { open: p, onOpenChange: u, children: [
620
620
  /* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
@@ -640,8 +640,8 @@ function sl() {
640
640
  le,
641
641
  {
642
642
  value: s,
643
- onChange: (b) => {
644
- t(b.target.value);
643
+ onChange: (C) => {
644
+ t(C.target.value);
645
645
  },
646
646
  id: "name",
647
647
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -663,42 +663,42 @@ function sl() {
663
663
  ] })
664
664
  ] });
665
665
  }
666
- function al() {
667
- const [s, t] = q(!1), a = z((u) => u.lenses), n = z((u) => u.selectedLensId), { setLenses: l, setSelectedLensId: c } = Os(), { authToken: r } = ke();
666
+ function tl() {
667
+ const [s, t] = q(!1), a = z((u) => u.lenses), n = z((u) => u.selectedLensId), { setLenses: l, setSelectedLensId: d } = Os(), { authToken: r } = ke();
668
668
  async function o(u) {
669
- c(u);
669
+ d(u);
670
670
  }
671
- async function d(u) {
672
- if (await el(u, r == null ? void 0 : r.accessToken)) {
673
- const g = a == null ? void 0 : a.filter((x) => x.id !== u);
674
- l(g || []), c("original");
671
+ async function c(u) {
672
+ if (await sl(u, r == null ? void 0 : r.accessToken)) {
673
+ const g = a == null ? void 0 : a.filter((h) => h.id !== u);
674
+ l(g || []), d("original");
675
675
  }
676
676
  }
677
677
  async function p(u) {
678
- const y = a == null ? void 0 : a.map((j) => j.id === u.id ? {
678
+ const b = a == null ? void 0 : a.map((j) => j.id === u.id ? {
679
679
  ...j,
680
680
  isDefault: !u.isDefault
681
681
  } : {
682
682
  ...j,
683
683
  isDefault: !1
684
684
  });
685
- l(y || []);
685
+ l(b || []);
686
686
  const g = {
687
687
  ...u,
688
688
  isDefault: !u.isDefault
689
689
  };
690
690
  await ks(g, r == null ? void 0 : r.accessToken);
691
- const x = a == null ? void 0 : a.find((j) => j.isDefault);
692
- if (x && x.id !== u.id) {
691
+ const h = a == null ? void 0 : a.find((j) => j.isDefault);
692
+ if (h && h.id !== u.id) {
693
693
  const j = {
694
- ...x,
694
+ ...h,
695
695
  isDefault: !1
696
696
  };
697
697
  await ks(j, r == null ? void 0 : r.accessToken);
698
698
  }
699
699
  }
700
700
  return /* @__PURE__ */ e.jsxs(ra, { open: s, onOpenChange: t, children: [
701
- /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
701
+ /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Ln, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
702
702
  /* @__PURE__ */ e.jsxs(oa, { align: "end", className: "w-60", children: [
703
703
  /* @__PURE__ */ e.jsx(st, { className: "px-3", children: "Lenses" }),
704
704
  /* @__PURE__ */ e.jsx(at, {}),
@@ -718,10 +718,10 @@ function al() {
718
718
  /* @__PURE__ */ e.jsx("p", { children: u.name }),
719
719
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
720
720
  /* @__PURE__ */ e.jsx(
721
- En,
721
+ An,
722
722
  {
723
- onClick: (y) => {
724
- y.preventDefault(), p(u);
723
+ onClick: (b) => {
724
+ b.preventDefault(), p(u);
725
725
  },
726
726
  className: Q(
727
727
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
@@ -734,10 +734,10 @@ function al() {
734
734
  }
735
735
  ),
736
736
  /* @__PURE__ */ e.jsx(
737
- Qe,
737
+ Je,
738
738
  {
739
- onClick: (y) => {
740
- y.preventDefault(), d(u.id);
739
+ onClick: (b) => {
740
+ b.preventDefault(), c(u.id);
741
741
  },
742
742
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
743
743
  strokeWidth: 1.5
@@ -754,22 +754,22 @@ function al() {
754
754
  ] })
755
755
  ] });
756
756
  }
757
- function tl({
757
+ function nl({
758
758
  iconClassName: s
759
759
  }) {
760
- const [t, a] = q(!1), { authToken: n } = ke(), l = z((o) => o.theme), c = z((o) => o.filterValues);
760
+ const [t, a] = q(!1), { authToken: n } = ke(), l = z((o) => o.theme), d = z((o) => o.filterValues);
761
761
  async function r() {
762
762
  {
763
763
  a(!0);
764
764
  const o = new URLSearchParams();
765
- o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(c));
766
- const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, u = await (await fetch(d, {
765
+ o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(d));
766
+ const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, u = await (await fetch(c, {
767
767
  method: "GET",
768
768
  headers: {
769
769
  Authorization: `Bearer ${n == null ? void 0 : n.accessToken}`
770
770
  }
771
- })).blob(), y = URL.createObjectURL(u);
772
- window.open(y, "_blank"), a(!1);
771
+ })).blob(), b = URL.createObjectURL(u);
772
+ window.open(b, "_blank"), a(!1);
773
773
  }
774
774
  }
775
775
  return /* @__PURE__ */ e.jsx(
@@ -789,32 +789,32 @@ function tl({
789
789
  }
790
790
  );
791
791
  }
792
- function nl() {
792
+ function ll() {
793
793
  q(!1);
794
794
  const { authToken: s } = ke();
795
795
  z((f) => f.theme);
796
796
  const t = z((f) => f.lenses), a = z((f) => f.selectedLensId), n = t == null ? void 0 : t.find((f) => f.id === a), l = z((f) => f.dashboard);
797
797
  z((f) => f.selectedSheetId);
798
- const c = z(
798
+ const d = z(
799
799
  (f) => f.isDashboardEditing
800
800
  ), r = m(
801
801
  (f) => f.selectedConnectionId
802
- ), [o, d] = q(!1), p = z((f) => f.filterValues), u = z((f) => f.isVisualEditing), y = z((f) => f.showFilters);
802
+ ), [o, c] = q(!1), p = z((f) => f.filterValues), u = z((f) => f.isVisualEditing), b = z((f) => f.showFilters);
803
803
  z(
804
804
  (f) => f.showDashboardJSON
805
805
  );
806
- const g = z((f) => f.onSaveFunction), x = z(
806
+ const g = z((f) => f.onSaveFunction), h = z(
807
807
  (f) => f.actions.setShowFilters
808
- ), { addFrame: j, setSelectedFrameId: b } = z(
808
+ ), { addFrame: j, setSelectedFrameId: C } = z(
809
809
  (f) => f.actions
810
- ), { getSelectedSheet: I, setIsDashboardEditing: C, setShowDashboardJSON: T } = z((f) => f.actions), F = I(), { tenantId: A, endUserId: N } = Ss(
810
+ ), { getSelectedSheet: F, setIsDashboardEditing: y, setShowDashboardJSON: T } = z((f) => f.actions), I = F(), { tenantId: A, endUserId: N } = Ss(
811
811
  () => lt(s == null ? void 0 : s.accessToken),
812
812
  [s == null ? void 0 : s.accessToken]
813
813
  ), S = Ss(() => A || N, [A, N]), L = () => {
814
- if (!c || !F) return;
814
+ if (!d || !I) return;
815
815
  const f = {
816
816
  connectionId: r,
817
- id: Je(),
817
+ id: Ke(),
818
818
  title: "Title",
819
819
  description: "Description",
820
820
  preferences: {
@@ -829,16 +829,16 @@ function nl() {
829
829
  sql: "select COUNT(*) from YOUR_TABLE",
830
830
  data: []
831
831
  }, k = {
832
- id: Je(),
832
+ id: Ke(),
833
833
  cards: [f],
834
834
  activeCardId: f.id
835
835
  };
836
- j(F.id, k), b(k.id);
837
- }, h = () => {
838
- C(!0);
836
+ j(I.id, k), C(k.id);
837
+ }, x = () => {
838
+ y(!0);
839
839
  };
840
840
  async function v() {
841
- if (d(!0), !a || !n) return;
841
+ if (c(!0), !a || !n) return;
842
842
  const f = Ma(
843
843
  l
844
844
  ), k = JSON.stringify(f), M = {
@@ -846,7 +846,7 @@ function nl() {
846
846
  template: k,
847
847
  filterValues: p
848
848
  };
849
- await ks(M, s == null ? void 0 : s.accessToken), Ke.success("Lens saved"), g == null || g(f), d(!1);
849
+ await ks(M, s == null ? void 0 : s.accessToken), We.success("Lens saved"), g == null || g(f), c(!1);
850
850
  }
851
851
  return u ? null : /* @__PURE__ */ e.jsxs(
852
852
  "div",
@@ -856,16 +856,16 @@ function nl() {
856
856
  children: [
857
857
  !u && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(R, { children: n == null ? void 0 : n.name }) }),
858
858
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
859
- /* @__PURE__ */ e.jsx(tl, {}),
860
- c && !u && S && /* @__PURE__ */ e.jsx(sl, {}),
861
- !u && S && /* @__PURE__ */ e.jsx(al, {}),
862
- c && !u && /* @__PURE__ */ e.jsxs(
859
+ /* @__PURE__ */ e.jsx(nl, {}),
860
+ d && !u && S && /* @__PURE__ */ e.jsx(al, {}),
861
+ !u && S && /* @__PURE__ */ e.jsx(tl, {}),
862
+ d && !u && /* @__PURE__ */ e.jsxs(
863
863
  O,
864
864
  {
865
865
  variant: "secondary",
866
866
  className: "h-7 p-2",
867
867
  size: "sm",
868
- disabled: !c,
868
+ disabled: !d,
869
869
  onClick: L,
870
870
  children: [
871
871
  /* @__PURE__ */ e.jsx(Ds, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
@@ -873,30 +873,30 @@ function nl() {
873
873
  ]
874
874
  }
875
875
  ),
876
- !c && /* @__PURE__ */ e.jsx(
876
+ !d && /* @__PURE__ */ e.jsx(
877
877
  O,
878
878
  {
879
879
  variant: "ghost",
880
880
  className: "h-7 p-2",
881
- onClick: h,
881
+ onClick: x,
882
882
  size: "sm",
883
883
  children: /* @__PURE__ */ e.jsx(Ta, { className: "h-4 w-4", strokeWidth: 1.5 })
884
884
  }
885
885
  ),
886
- c && !u && /* @__PURE__ */ e.jsx(
886
+ d && !u && /* @__PURE__ */ e.jsx(
887
887
  O,
888
888
  {
889
889
  variant: "ghost",
890
890
  role: "close",
891
891
  className: "h-7 p-2",
892
892
  onClick: () => {
893
- C(!1), T(!1);
893
+ y(!1), T(!1);
894
894
  },
895
895
  size: "sm",
896
- children: /* @__PURE__ */ e.jsx(Qe, { className: "h-4 w-4", strokeWidth: 1.5 })
896
+ children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
897
897
  }
898
898
  ),
899
- c && !u && S && /* @__PURE__ */ e.jsx(
899
+ d && !u && S && /* @__PURE__ */ e.jsx(
900
900
  O,
901
901
  {
902
902
  className: "h-7 p-2",
@@ -904,64 +904,64 @@ function nl() {
904
904
  disabled: o,
905
905
  onClick: v,
906
906
  size: "sm",
907
- children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", strokeWidth: 1.5 })
907
+ children: /* @__PURE__ */ e.jsx(Un, { className: "h-4 w-4", strokeWidth: 1.5 })
908
908
  }
909
909
  ),
910
- !y && !u && c && /* @__PURE__ */ e.jsx(
910
+ !b && !u && d && /* @__PURE__ */ e.jsx(
911
911
  O,
912
912
  {
913
913
  className: "h-7 p-2",
914
914
  variant: "ghost",
915
- onClick: () => x(!0),
915
+ onClick: () => h(!0),
916
916
  size: "sm",
917
917
  children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
918
918
  }
919
919
  ),
920
- !u && c && !1,
920
+ !u && d && !1,
921
921
  !u && !1
922
922
  ] })
923
923
  ]
924
924
  }
925
925
  );
926
926
  }
927
- function Pe({
927
+ function Be({
928
928
  title: s,
929
929
  items: t,
930
930
  value: a,
931
931
  isLoading: n,
932
932
  isError: l,
933
- connectionTooltip: c,
933
+ connectionTooltip: d,
934
934
  onChange: r,
935
935
  showNone: o = !1,
936
- className: d,
936
+ className: c,
937
937
  showIcon: p = !0,
938
938
  disabled: u = !1
939
939
  }) {
940
- const y = n ? "Loading..." : l ? "Error" : a;
940
+ const b = n ? "Loading..." : l ? "Error" : a;
941
941
  function g() {
942
942
  if (s === "Connection")
943
- return /* @__PURE__ */ e.jsx(Pn, { className: "size-4 rotate-90" });
943
+ return /* @__PURE__ */ e.jsx(Bn, { className: "size-4 rotate-90" });
944
944
  if (s === "Database")
945
- return /* @__PURE__ */ e.jsx(On, { className: "size-4" });
945
+ return /* @__PURE__ */ e.jsx(Fn, { className: "size-4" });
946
946
  if (s === "Schema")
947
- return /* @__PURE__ */ e.jsx(Hn, { className: "size-4" });
947
+ return /* @__PURE__ */ e.jsx($n, { className: "size-4" });
948
948
  if (s === "Table")
949
949
  return /* @__PURE__ */ e.jsx(As, { className: "size-4" });
950
950
  if (s === "Model")
951
- return /* @__PURE__ */ e.jsx(Sn, { className: "size-4" });
951
+ return /* @__PURE__ */ e.jsx(wn, { className: "size-4" });
952
952
  }
953
953
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
954
- p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: c ? /* @__PURE__ */ e.jsxs(da, { children: [
954
+ p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: d ? /* @__PURE__ */ e.jsxs(da, { children: [
955
955
  /* @__PURE__ */ e.jsx(rt, { children: g() }),
956
- /* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children: c })
956
+ /* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children: d })
957
957
  ] }) : g() }),
958
- /* @__PURE__ */ e.jsxs(me, { disabled: u, value: y, onValueChange: r, children: [
958
+ /* @__PURE__ */ e.jsxs(me, { disabled: u, value: b, onValueChange: r, children: [
959
959
  /* @__PURE__ */ e.jsx(
960
960
  he,
961
961
  {
962
962
  className: Q(
963
963
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
964
- d
964
+ c
965
965
  ),
966
966
  children: /* @__PURE__ */ e.jsx(
967
967
  xe,
@@ -971,43 +971,43 @@ function Pe({
971
971
  )
972
972
  }
973
973
  ),
974
- /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
974
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
975
975
  n ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
976
976
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
977
977
  o && /* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
978
- t && t.map((x, j) => /* @__PURE__ */ e.jsx(K, { value: x.id, children: x.name }, j))
978
+ t && t.map((h, j) => /* @__PURE__ */ e.jsx(K, { value: h.id, children: h.name }, j))
979
979
  ] }),
980
- (n || l) && /* @__PURE__ */ e.jsx(K, { value: y, children: y })
980
+ (n || l) && /* @__PURE__ */ e.jsx(K, { value: b, children: b })
981
981
  ] }) })
982
982
  ] })
983
983
  ] });
984
984
  }
985
- function ll({ column: s }) {
986
- const [t, a] = q(!1), n = m((x) => x.selectedTableName), l = m(
987
- (x) => x.selectedSchemaName
988
- ), c = m(
989
- (x) => x.selectedDatamodelId
990
- ), r = m((x) => x.sqlGen), { modelItems: o } = Re(), d = m((x) => x.actions.setSqlGen), p = m((x) => x.actions.setCardSql), u = m((x) => x.actions.setRunSql);
991
- function y(x, j) {
985
+ function rl({ column: s }) {
986
+ const [t, a] = q(!1), n = m((h) => h.selectedTableName), l = m(
987
+ (h) => h.selectedSchemaName
988
+ ), d = m(
989
+ (h) => h.selectedDatamodelId
990
+ ), r = m((h) => h.sqlGen), { modelItems: o } = _e(), c = m((h) => h.actions.setSqlGen), p = m((h) => h.actions.setCardSql), u = m((h) => h.actions.setRunSql);
991
+ function b(h, j) {
992
992
  var T;
993
- const b = ma(x, r, j), I = (T = o == null ? void 0 : o.find(
994
- (F) => F.id === c
993
+ const C = ma(h, r, j), F = (T = o == null ? void 0 : o.find(
994
+ (I) => I.id === d
995
995
  )) == null ? void 0 : T.name;
996
- d(b);
997
- const C = ha(
998
- b,
996
+ c(C);
997
+ const y = ha(
998
+ C,
999
999
  de(l || ""),
1000
1000
  de(n),
1001
- I
1001
+ F
1002
1002
  );
1003
- C && (p(C), u(!0)), a(!1);
1003
+ y && (p(y), u(!0)), a(!1);
1004
1004
  }
1005
1005
  function g() {
1006
1006
  return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
1007
1007
  /* @__PURE__ */ e.jsx(
1008
1008
  "li",
1009
1009
  {
1010
- onClick: () => y(s, "COUNT"),
1010
+ onClick: () => b(s, "COUNT"),
1011
1011
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1012
1012
  children: "Count"
1013
1013
  }
@@ -1015,7 +1015,7 @@ function ll({ column: s }) {
1015
1015
  /* @__PURE__ */ e.jsx(
1016
1016
  "li",
1017
1017
  {
1018
- onClick: () => y(s, "AVG"),
1018
+ onClick: () => b(s, "AVG"),
1019
1019
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1020
1020
  children: "Avg"
1021
1021
  }
@@ -1023,7 +1023,7 @@ function ll({ column: s }) {
1023
1023
  /* @__PURE__ */ e.jsx(
1024
1024
  "li",
1025
1025
  {
1026
- onClick: () => y(s, "SUM"),
1026
+ onClick: () => b(s, "SUM"),
1027
1027
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1028
1028
  children: "Sum"
1029
1029
  }
@@ -1031,7 +1031,7 @@ function ll({ column: s }) {
1031
1031
  /* @__PURE__ */ e.jsx(
1032
1032
  "li",
1033
1033
  {
1034
- onClick: () => y(s, "MAX"),
1034
+ onClick: () => b(s, "MAX"),
1035
1035
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1036
1036
  children: "Max"
1037
1037
  }
@@ -1039,7 +1039,7 @@ function ll({ column: s }) {
1039
1039
  /* @__PURE__ */ e.jsx(
1040
1040
  "li",
1041
1041
  {
1042
- onClick: () => y(s, "MIN"),
1042
+ onClick: () => b(s, "MIN"),
1043
1043
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1044
1044
  children: "Min"
1045
1045
  }
@@ -1065,67 +1065,67 @@ function Ea({ column: s }) {
1065
1065
  /* @__PURE__ */ e.jsx(Us, { className: "size-3" })
1066
1066
  ) : xa.includes(s.data_type.toLowerCase()) ? (
1067
1067
  //
1068
- /* @__PURE__ */ e.jsx(Mn, { className: "size-3" })
1069
- ) : ct.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(dt, { className: "size-3" }) : ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Kn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Un, { className: "size-3" }) }),
1068
+ /* @__PURE__ */ e.jsx(En, { className: "size-3" })
1069
+ ) : ct.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(dt, { className: "size-3" }) : ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Wn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Gn, { className: "size-3" }) }),
1070
1070
  /* @__PURE__ */ e.jsx(ua, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1071
1071
  ] });
1072
1072
  }
1073
- function rl({
1073
+ function il({
1074
1074
  schemaName: s,
1075
1075
  tableName: t,
1076
1076
  columns: a,
1077
1077
  status: n
1078
1078
  }) {
1079
- const l = m((h) => h.sqlGen), c = m(
1080
- (h) => h.selectedConnectionId
1079
+ const l = m((x) => x.sqlGen), d = m(
1080
+ (x) => x.selectedConnectionId
1081
1081
  ), r = m(
1082
- (h) => h.selectedDatabaseName
1082
+ (x) => x.selectedDatabaseName
1083
1083
  ), o = m(
1084
- (h) => h.selectedSchemaName
1085
- ), d = m((h) => h.selectedTableName), p = m(
1086
- (h) => h.selectedDatamodelId
1084
+ (x) => x.selectedSchemaName
1085
+ ), c = m((x) => x.selectedTableName), p = m(
1086
+ (x) => x.selectedDatamodelId
1087
1087
  ), u = z(
1088
- (h) => h.dashboard.aiScopeTables
1089
- ), { setAIScopeTables: y } = z((h) => h.actions), g = m((h) => h.actions.setRunSql), x = m((h) => h.actions.setSqlGen), j = m(
1090
- (h) => h.actions.setIsShowingVisual
1091
- ), b = m((h) => h.actions.setCardSql), { connectionType: I, modelItems: C } = Re();
1092
- function T(h) {
1088
+ (x) => x.dashboard.aiScopeTables
1089
+ ), { setAIScopeTables: b } = z((x) => x.actions), g = m((x) => x.actions.setRunSql), h = m((x) => x.actions.setSqlGen), j = m(
1090
+ (x) => x.actions.setIsShowingVisual
1091
+ ), C = m((x) => x.actions.setCardSql), { connectionType: F, modelItems: y } = _e();
1092
+ function T(x) {
1093
1093
  var M;
1094
- const v = ma(h, l);
1095
- x(v);
1096
- const f = (M = C == null ? void 0 : C.find(
1094
+ const v = ma(x, l);
1095
+ h(v);
1096
+ const f = (M = y == null ? void 0 : y.find(
1097
1097
  (H) => H.id === p
1098
1098
  )) == null ? void 0 : M.name, k = ha(v, de(s), de(t), f);
1099
- k && (b(k), g(!0));
1099
+ k && (C(k), g(!0));
1100
1100
  }
1101
- function F() {
1101
+ function I() {
1102
1102
  return (u == null ? void 0 : u.find(
1103
- (h) => h.connectinonId === c && h.tableName === d
1103
+ (x) => x.connectinonId === d && x.tableName === c
1104
1104
  )) !== void 0;
1105
1105
  }
1106
- function A(h) {
1107
- if (h === !0 && d && c) {
1106
+ function A(x) {
1107
+ if (x === !0 && c && d) {
1108
1108
  const v = {
1109
- connectinonId: c,
1110
- connectionType: I,
1109
+ connectinonId: d,
1110
+ connectionType: F,
1111
1111
  databaseName: r,
1112
1112
  schemaName: o,
1113
- tableName: d
1113
+ tableName: c
1114
1114
  }, k = [...u || [], v].filter(
1115
1115
  (M, H, P) => P.findIndex(
1116
1116
  (Y) => Y.connectinonId === M.connectinonId && Y.tableName === M.tableName
1117
1117
  ) === H
1118
1118
  );
1119
- y(k), Ke.success(`Added '${d}' to AI Scope`, {
1119
+ b(k), We.success(`Added '${c}' to AI Scope`, {
1120
1120
  position: "top-right",
1121
1121
  duration: 2500,
1122
1122
  richColors: !0
1123
1123
  });
1124
1124
  } else {
1125
1125
  const v = (u || []).filter(
1126
- (f) => f.connectinonId !== c && f.tableName !== d
1126
+ (f) => f.connectinonId !== d && f.tableName !== c
1127
1127
  );
1128
- y(v), Ke(`Removed '${d}' from AI Scope`, {
1128
+ b(v), We(`Removed '${c}' from AI Scope`, {
1129
1129
  position: "top-right",
1130
1130
  duration: 2e3,
1131
1131
  richColors: !0
@@ -1134,31 +1134,31 @@ function rl({
1134
1134
  }
1135
1135
  function N() {
1136
1136
  var M;
1137
- let h = fa(s, t);
1138
- const v = (M = C == null ? void 0 : C.find(
1137
+ let x = fa(s, t);
1138
+ const v = (M = y == null ? void 0 : y.find(
1139
1139
  (H) => H.id === p
1140
1140
  )) == null ? void 0 : M.name;
1141
- console.log("modelName", v), p && p !== "none" && (h = `${ys}.${v}`);
1142
- let f = h;
1141
+ console.log("modelName", v), p && p !== "none" && (x = `${ys}.${v}`);
1142
+ let f = x;
1143
1143
  return ((H) => /[A-Z]/.test(H))(t) && (f = f.split(".").map((P) => `"${P}"`).join(".")), f;
1144
1144
  }
1145
1145
  function S() {
1146
- const h = N();
1146
+ const x = N();
1147
1147
  j(!1);
1148
- const v = I === "MSSQL" ? `SELECT top 10 * FROM ${h}` : `SELECT * FROM ${h} LIMIT 10`;
1149
- b(v), g(!0);
1148
+ const v = F === "MSSQL" ? `SELECT top 10 * FROM ${x}` : `SELECT * FROM ${x} LIMIT 10`;
1149
+ C(v), g(!0);
1150
1150
  }
1151
1151
  function L() {
1152
- const h = N();
1153
- b(`SELECT COUNT(*) as count FROM ${h}`), g(!0);
1152
+ const x = N();
1153
+ C(`SELECT COUNT(*) as count FROM ${x}`), g(!0);
1154
1154
  }
1155
1155
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
1156
1156
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
1157
1157
  /* @__PURE__ */ e.jsx(
1158
1158
  pa,
1159
1159
  {
1160
- title: `${F() ? "Remove from" : "Add to"} AI Scope`,
1161
- pressed: F(),
1160
+ title: `${I() ? "Remove from" : "Add to"} AI Scope`,
1161
+ pressed: I(),
1162
1162
  onPressedChange: A,
1163
1163
  variant: "outline",
1164
1164
  className: "h-9 px-2",
@@ -1166,8 +1166,8 @@ function rl({
1166
1166
  mt,
1167
1167
  {
1168
1168
  className: Q("size-4", {
1169
- "text-primary": F(),
1170
- "text-muted-foreground": !F()
1169
+ "text-primary": I(),
1170
+ "text-muted-foreground": !I()
1171
1171
  })
1172
1172
  }
1173
1173
  )
@@ -1182,7 +1182,7 @@ function rl({
1182
1182
  variant: "secondary",
1183
1183
  className: "flex",
1184
1184
  children: [
1185
- n !== "Success" ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Qn, { className: "mr-2 size-4" }),
1185
+ n !== "Success" ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Jn, { className: "mr-2 size-4" }),
1186
1186
  "Top 10"
1187
1187
  ]
1188
1188
  }
@@ -1196,43 +1196,43 @@ function rl({
1196
1196
  variant: "secondary",
1197
1197
  className: "flex",
1198
1198
  children: [
1199
- n !== "Success" ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
1199
+ n !== "Success" ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Qn, { className: "mr-2 size-4" }),
1200
1200
  "Count"
1201
1201
  ]
1202
1202
  }
1203
1203
  )
1204
1204
  ] }),
1205
1205
  /* @__PURE__ */ e.jsxs(
1206
- We,
1206
+ qe,
1207
1207
  {
1208
1208
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
1209
1209
  children: [
1210
- a == null ? void 0 : a.map((h) => /* @__PURE__ */ e.jsxs(
1210
+ a == null ? void 0 : a.map((x) => /* @__PURE__ */ e.jsxs(
1211
1211
  "div",
1212
1212
  {
1213
- onClick: () => T(h),
1213
+ onClick: () => T(x),
1214
1214
  className: Q(
1215
1215
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
1216
1216
  {
1217
- "bg-muted": ht(h, l)
1217
+ "bg-muted": ht(x, l)
1218
1218
  }
1219
1219
  ),
1220
1220
  children: [
1221
1221
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1222
- /* @__PURE__ */ e.jsx(Ea, { column: h }),
1223
- /* @__PURE__ */ e.jsx("span", { children: h.column_name })
1222
+ /* @__PURE__ */ e.jsx(Ea, { column: x }),
1223
+ /* @__PURE__ */ e.jsx("span", { children: x.column_name })
1224
1224
  ] }),
1225
1225
  /* @__PURE__ */ e.jsx(
1226
1226
  "div",
1227
1227
  {
1228
1228
  onClick: (v) => v.stopPropagation(),
1229
1229
  className: "flex items-center justify-end",
1230
- children: xa.includes(h.data_type) && /* @__PURE__ */ e.jsx(ll, { column: h })
1230
+ children: xa.includes(x.data_type) && /* @__PURE__ */ e.jsx(rl, { column: x })
1231
1231
  }
1232
1232
  )
1233
1233
  ]
1234
1234
  },
1235
- h.column_name
1235
+ x.column_name
1236
1236
  )),
1237
1237
  /* @__PURE__ */ e.jsx(Ks, { orientation: "vertical" }),
1238
1238
  /* @__PURE__ */ e.jsx(Ks, { orientation: "horizontal" })
@@ -1241,44 +1241,44 @@ function rl({
1241
1241
  )
1242
1242
  ] });
1243
1243
  }
1244
- function Re(s, t) {
1244
+ function _e(s, t) {
1245
1245
  var Xe, Ze, es, ss, as;
1246
1246
  let a = Ss(() => [], []);
1247
1247
  const n = ke().authToken || s, l = m(
1248
1248
  (i) => i.selectedConnectionId
1249
- ), c = m(
1249
+ ), d = m(
1250
1250
  (i) => i.selectedDatamodelId
1251
1251
  ), r = m(
1252
1252
  (i) => i.selectedDatabaseName
1253
1253
  ), o = m(
1254
1254
  (i) => i.selectedSchemaName
1255
- ), d = m((i) => i.selectedTableName), p = m(
1255
+ ), c = m((i) => i.selectedTableName), p = m(
1256
1256
  (i) => i.actions.setCurrentColumns
1257
1257
  ), u = m(
1258
1258
  (i) => i.actions.setSelectedConnectionId
1259
- ), y = m(
1259
+ ), b = m(
1260
1260
  (i) => i.actions.setSelectedDatamodelId
1261
1261
  ), g = m(
1262
1262
  (i) => i.actions.setSelectedDatabaseName
1263
- ), x = m(
1263
+ ), h = m(
1264
1264
  (i) => i.actions.setSelectedSchemaName
1265
1265
  ), j = m(
1266
1266
  (i) => i.actions.setSelectedTableName
1267
- ), b = m((i) => i.actions.setCardSql);
1268
- function I(i) {
1267
+ ), C = m((i) => i.actions.setCardSql);
1268
+ function F(i) {
1269
1269
  return l && r && o && r !== "NA" ? !0 : l && i === "API" ? !1 : !!(l && i === "S3");
1270
1270
  }
1271
- function C(i) {
1272
- return !!(l && r && r !== "NA" && o && d || l && (i === "S3" || i === "API") || c && c);
1271
+ function y(i) {
1272
+ return !!(l && r && r !== "NA" && o && c || l && (i === "S3" || i === "API") || d && d);
1273
1273
  }
1274
1274
  function T(i) {
1275
1275
  return l && i ? !(i === "API" || i === "S3") : !1;
1276
1276
  }
1277
1277
  const {
1278
- data: F,
1278
+ data: I,
1279
1279
  isLoading: A,
1280
1280
  isError: N
1281
- } = Ne({
1281
+ } = Ce({
1282
1282
  queryKey: ["connections"],
1283
1283
  queryFn: () => Fe(
1284
1284
  "https://semaphor.cloud/api/v1/connections",
@@ -1289,8 +1289,8 @@ function Re(s, t) {
1289
1289
  }), {
1290
1290
  data: S,
1291
1291
  isLoading: L,
1292
- isError: h
1293
- } = Ne({
1292
+ isError: x
1293
+ } = Ce({
1294
1294
  queryKey: ["models", l],
1295
1295
  queryFn: () => Fe(
1296
1296
  "https://semaphor.cloud/api/v1/datamodels",
@@ -1301,7 +1301,7 @@ function Re(s, t) {
1301
1301
  ),
1302
1302
  enabled: !!(n != null && n.accessToken) && !!l
1303
1303
  // Only fetch if authToken is present
1304
- }), v = F == null ? void 0 : F.connections.find(
1304
+ }), v = I == null ? void 0 : I.connections.find(
1305
1305
  (i) => i.id === l
1306
1306
  ), f = v == null ? void 0 : v.type, k = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
1307
1307
  data: M,
@@ -1309,7 +1309,7 @@ function Re(s, t) {
1309
1309
  isFetching: P,
1310
1310
  isError: Y,
1311
1311
  refetch: ie
1312
- } = Ne({
1312
+ } = Ce({
1313
1313
  queryKey: ["databases", l],
1314
1314
  queryFn: () => Fe(
1315
1315
  "https://semaphor.cloud/api/v1/databases",
@@ -1326,7 +1326,7 @@ function Re(s, t) {
1326
1326
  isFetching: w,
1327
1327
  isError: _,
1328
1328
  refetch: ee
1329
- } = Ne({
1329
+ } = Ce({
1330
1330
  queryKey: ["schemas", l, r],
1331
1331
  queryFn: () => Fe(
1332
1332
  "https://semaphor.cloud/api/v1/schemas",
@@ -1344,7 +1344,7 @@ function Re(s, t) {
1344
1344
  isFetching: se,
1345
1345
  isError: $,
1346
1346
  refetch: X
1347
- } = Ne({
1347
+ } = Ce({
1348
1348
  queryKey: [
1349
1349
  "tables",
1350
1350
  l,
@@ -1360,34 +1360,34 @@ function Re(s, t) {
1360
1360
  schema_name: o
1361
1361
  }
1362
1362
  ),
1363
- enabled: I(f)
1363
+ enabled: F(f)
1364
1364
  }), {
1365
1365
  data: te,
1366
1366
  isLoading: Le,
1367
1367
  isFetching: ze,
1368
- isError: be
1369
- } = Ne({
1368
+ isError: je
1369
+ } = Ce({
1370
1370
  queryKey: [
1371
1371
  "columns",
1372
1372
  l,
1373
1373
  r,
1374
- c,
1374
+ d,
1375
1375
  o,
1376
- d
1376
+ c
1377
1377
  ],
1378
1378
  queryFn: () => Fe(
1379
1379
  "https://semaphor.cloud/api/v1/columns",
1380
1380
  (n == null ? void 0 : n.accessToken) || "",
1381
1381
  {
1382
1382
  connection_id: l,
1383
- datamodel_id: c || "",
1383
+ datamodel_id: d || "",
1384
1384
  // don't pass undefined. Pass empty string
1385
1385
  database_name: r,
1386
1386
  schema_name: o,
1387
- table_name: d
1387
+ table_name: c
1388
1388
  }
1389
1389
  ),
1390
- enabled: C(f)
1390
+ enabled: y(f)
1391
1391
  // (!!selectedConnectionId &&
1392
1392
  // !!selectedDatabaseName &&
1393
1393
  // !!selectedSchemaName &&
@@ -1401,36 +1401,36 @@ function Re(s, t) {
1401
1401
  }, [te, p, a]), Z(() => {
1402
1402
  }, [
1403
1403
  k,
1404
- b,
1404
+ C,
1405
1405
  j,
1406
- x,
1406
+ h,
1407
1407
  g,
1408
1408
  v
1409
1409
  ]);
1410
- const ye = (v == null ? void 0 : v.type) === "API" ? (Xe = v == null ? void 0 : v.type) == null ? void 0 : Xe.toLowerCase() : d || "", J = k ? "" : o || "";
1410
+ const be = (v == null ? void 0 : v.type) === "API" ? (Xe = v == null ? void 0 : v.type) == null ? void 0 : Xe.toLowerCase() : c || "", J = k ? "" : o || "";
1411
1411
  function oe(i) {
1412
- x(i), j("");
1412
+ h(i), j("");
1413
1413
  }
1414
1414
  function ce(i) {
1415
- g(i === "none" ? "" : i), x(""), j(""), i !== "none" && i !== "" && y("");
1415
+ g(i === "none" ? "" : i), h(""), j(""), i !== "none" && i !== "" && b("");
1416
1416
  }
1417
1417
  function Oe(i) {
1418
1418
  u(i);
1419
1419
  }
1420
1420
  function Me(i) {
1421
- y(i === "none" ? "" : i), i !== "none" && i !== "" && g("");
1421
+ b(i === "none" ? "" : i), i !== "none" && i !== "" && g("");
1422
1422
  }
1423
1423
  M && ((Ze = M == null ? void 0 : M.databases) == null ? void 0 : Ze.length) > 0, W && ((es = W == null ? void 0 : W.schemas) == null ? void 0 : es.length) > 0, te && ((ss = te == null ? void 0 : te.columns) == null ? void 0 : ss.length) > 0 && (a = te.columns.map((i) => ({
1424
1424
  ...i,
1425
1425
  data_type: i.data_type.toLowerCase()
1426
- }))), Y && (a = []), (be || N) && (a = []);
1427
- const He = F == null ? void 0 : F.connections.map(
1426
+ }))), Y && (a = []), (je || N) && (a = []);
1427
+ const $e = I == null ? void 0 : I.connections.map(
1428
1428
  (i) => ({
1429
1429
  id: i.id,
1430
1430
  name: i.name,
1431
1431
  type: i.type
1432
1432
  })
1433
- ), $e = (as = S == null ? void 0 : S.datamodels) == null ? void 0 : as.map((i) => ({
1433
+ ), Pe = (as = S == null ? void 0 : S.datamodels) == null ? void 0 : as.map((i) => ({
1434
1434
  id: i.id,
1435
1435
  name: i.name
1436
1436
  })), Ee = M == null ? void 0 : M.databases.map((i) => ({
@@ -1444,12 +1444,12 @@ function Re(s, t) {
1444
1444
  name: i.table_name
1445
1445
  }));
1446
1446
  return {
1447
- connectionItems: He,
1447
+ connectionItems: $e,
1448
1448
  isConnectionsLoading: A,
1449
1449
  isConnectionsError: N,
1450
- modelItems: $e,
1450
+ modelItems: Pe,
1451
1451
  isModelsLoading: L,
1452
- isModelsError: h,
1452
+ isModelsError: x,
1453
1453
  databaseItems: Ee,
1454
1454
  isDatabasesLoadingOrFetching: H || P,
1455
1455
  isDatabaseError: Y,
@@ -1461,10 +1461,10 @@ function Re(s, t) {
1461
1461
  isTableError: $,
1462
1462
  columns: a,
1463
1463
  isColumnsLoadingOrFetching: Le || ze,
1464
- isColumnsError: be,
1464
+ isColumnsError: je,
1465
1465
  isNonDbConnection: k,
1466
1466
  connectionType: f,
1467
- tableName: ye,
1467
+ tableName: be,
1468
1468
  schemaName: J,
1469
1469
  handleConnectionChange: Oe,
1470
1470
  handleDatamodelChange: Me,
@@ -1484,27 +1484,27 @@ function Aa({
1484
1484
  ($) => $.selectedDatabaseName
1485
1485
  ), l = m(
1486
1486
  ($) => $.selectedSchemaName
1487
- ), c = m(($) => $.selectedTableName), r = m(
1487
+ ), d = m(($) => $.selectedTableName), r = m(
1488
1488
  ($) => $.actions.setSelectedTableName
1489
1489
  ), {
1490
1490
  connectionItems: o,
1491
- modelItems: d,
1491
+ modelItems: c,
1492
1492
  schemaItems: p,
1493
1493
  databaseItems: u,
1494
- tableItems: y,
1494
+ tableItems: b,
1495
1495
  columns: g,
1496
- isConnectionsLoading: x,
1496
+ isConnectionsLoading: h,
1497
1497
  isModelsLoading: j,
1498
- isConnectionsError: b,
1499
- isModelsError: I,
1500
- isDatabasesLoadingOrFetching: C,
1498
+ isConnectionsError: C,
1499
+ isModelsError: F,
1500
+ isDatabasesLoadingOrFetching: y,
1501
1501
  isDatabaseError: T,
1502
- isSchemaLoadingOrFetching: F,
1502
+ isSchemaLoadingOrFetching: I,
1503
1503
  isSchemaError: A,
1504
1504
  isColumnsError: N,
1505
1505
  isColumnsLoadingOrFetching: S,
1506
1506
  isTableLoadingOrFetching: L,
1507
- isTableError: h,
1507
+ isTableError: x,
1508
1508
  connectionType: v,
1509
1509
  isNonDbConnection: f,
1510
1510
  handleConnectionChange: k,
@@ -1513,10 +1513,10 @@ function Aa({
1513
1513
  handleDatamodelChange: P,
1514
1514
  tableName: Y,
1515
1515
  schemaName: ie
1516
- } = Re();
1516
+ } = _e();
1517
1517
  function W() {
1518
1518
  return s ? s(ie, Y, g) : /* @__PURE__ */ e.jsx(
1519
- rl,
1519
+ il,
1520
1520
  {
1521
1521
  schemaName: ie,
1522
1522
  tableName: Y,
@@ -1532,12 +1532,12 @@ function Aa({
1532
1532
  if (!t || v === "S3" || v === "API") return null;
1533
1533
  if (!a || a === "none")
1534
1534
  return /* @__PURE__ */ e.jsx(
1535
- Pe,
1535
+ Be,
1536
1536
  {
1537
1537
  showNone: !0,
1538
1538
  onChange: M,
1539
1539
  isError: T,
1540
- isLoading: C,
1540
+ isLoading: y,
1541
1541
  items: u,
1542
1542
  value: n || "",
1543
1543
  title: "Database"
@@ -1547,22 +1547,22 @@ function Aa({
1547
1547
  function _() {
1548
1548
  if (t && !f && (!n || n === "none") && (!a || a === "none"))
1549
1549
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1550
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ge, {}) }),
1550
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Se, {}) }),
1551
1551
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(R, { children: "OR" }) }),
1552
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ge, {}) })
1552
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Se, {}) })
1553
1553
  ] });
1554
1554
  }
1555
1555
  function ee() {
1556
1556
  if (!t || v === "S3" || v === "API") return null;
1557
1557
  if (!n || n === "none")
1558
1558
  return /* @__PURE__ */ e.jsx(
1559
- Pe,
1559
+ Be,
1560
1560
  {
1561
1561
  showNone: !0,
1562
1562
  onChange: P,
1563
- isError: I,
1563
+ isError: F,
1564
1564
  isLoading: j,
1565
- items: d,
1565
+ items: c,
1566
1566
  value: a || "",
1567
1567
  title: "Model"
1568
1568
  }
@@ -1570,11 +1570,11 @@ function Aa({
1570
1570
  }
1571
1571
  function E() {
1572
1572
  return !t || v === "S3" || v === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
1573
- Pe,
1573
+ Be,
1574
1574
  {
1575
1575
  onChange: H,
1576
1576
  isError: A,
1577
- isLoading: F,
1577
+ isLoading: I,
1578
1578
  items: p,
1579
1579
  value: l || "",
1580
1580
  title: "Schema"
@@ -1587,13 +1587,13 @@ function Aa({
1587
1587
  return v === "API" ? (X = !1, X) : ((v === "S3" || t && n && n !== "none" && l) && (X = !0), X);
1588
1588
  }
1589
1589
  return $() ? /* @__PURE__ */ e.jsx(
1590
- Pe,
1590
+ Be,
1591
1591
  {
1592
1592
  onChange: r,
1593
- isError: h,
1594
- items: y,
1593
+ isError: x,
1594
+ items: b,
1595
1595
  isLoading: L,
1596
- value: c || "",
1596
+ value: d || "",
1597
1597
  title: "Table"
1598
1598
  }
1599
1599
  ) : null;
@@ -1601,14 +1601,14 @@ function Aa({
1601
1601
  return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
1602
1602
  /* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
1603
1603
  /* @__PURE__ */ e.jsx(
1604
- Pe,
1604
+ Be,
1605
1605
  {
1606
1606
  items: o,
1607
1607
  title: "Connection",
1608
1608
  value: t || "",
1609
1609
  onChange: k,
1610
- isLoading: x,
1611
- isError: b,
1610
+ isLoading: h,
1611
+ isError: C,
1612
1612
  connectionTooltip: ((se = o == null ? void 0 : o.find(
1613
1613
  ($) => $.id === t
1614
1614
  )) == null ? void 0 : se.type) || ""
@@ -1629,17 +1629,17 @@ function Aa({
1629
1629
  variant: "secondary",
1630
1630
  className: "w-full",
1631
1631
  children: [
1632
- /* @__PURE__ */ e.jsx(_n, { className: "mr-2 size-4" }),
1632
+ /* @__PURE__ */ e.jsx(Hn, { className: "mr-2 size-4" }),
1633
1633
  "Help"
1634
1634
  ]
1635
1635
  }
1636
1636
  ) })
1637
1637
  ] });
1638
1638
  }
1639
- function il(s) {
1639
+ function ol(s) {
1640
1640
  const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1641
- let c = s.length;
1642
- if (l !== -1 && (c = l), n !== -1 && n < c && (c = n), t !== -1) {
1641
+ let d = s.length;
1642
+ if (l !== -1 && (d = l), n !== -1 && n < d && (d = n), t !== -1) {
1643
1643
  const r = s.substring(0, t), o = s.substring(t);
1644
1644
  return `${r} {{ filters | where }} AND ${o.substring(
1645
1645
  6
@@ -1648,25 +1648,25 @@ function il(s) {
1648
1648
  const r = s.substring(0, a), o = s.substring(a);
1649
1649
  return `${r} {{ filters | where }} ${o}`;
1650
1650
  } else {
1651
- const r = s.substring(0, c), o = s.substring(c);
1651
+ const r = s.substring(0, d), o = s.substring(d);
1652
1652
  return `${r} {{ filters | where }} ${o}`;
1653
1653
  }
1654
1654
  }
1655
- function ol({
1655
+ function cl({
1656
1656
  error: s,
1657
1657
  setShowAIDialog: t,
1658
1658
  setUserInputforAI: a,
1659
1659
  setTriggerAIRun: n
1660
1660
  }) {
1661
1661
  return /* @__PURE__ */ e.jsxs(Vs, { openDelay: 0, children: [
1662
- /* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
1662
+ /* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4 text-red-500" }) }) }),
1663
1663
  /* @__PURE__ */ e.jsx(
1664
1664
  Rs,
1665
1665
  {
1666
1666
  align: "start",
1667
1667
  className: "w-full min-w-fit max-w-[700px]",
1668
1668
  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: [
1669
- /* @__PURE__ */ e.jsx(We, { 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 }) }),
1669
+ /* @__PURE__ */ e.jsx(qe, { 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 }) }),
1670
1670
  /* @__PURE__ */ e.jsxs(
1671
1671
  O,
1672
1672
  {
@@ -1676,7 +1676,7 @@ function ol({
1676
1676
  size: "sm",
1677
1677
  variant: "outline",
1678
1678
  children: [
1679
- /* @__PURE__ */ e.jsx(Ln, { className: "mr-2 h-4 w-4" }),
1679
+ /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 h-4 w-4" }),
1680
1680
  "Debug with AI"
1681
1681
  ]
1682
1682
  }
@@ -1686,7 +1686,7 @@ function ol({
1686
1686
  )
1687
1687
  ] });
1688
1688
  }
1689
- const cl = `
1689
+ const dl = `
1690
1690
 
1691
1691
  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.
1692
1692
 
@@ -1733,27 +1733,27 @@ SELECT label, measure FROM table
1733
1733
  - Label - Category
1734
1734
  - Measure - Number
1735
1735
  `;
1736
- function dl({
1736
+ function ul({
1737
1737
  open: s,
1738
1738
  setOpen: t,
1739
1739
  userInput: a,
1740
1740
  setUserInput: n,
1741
1741
  triggerAIRun: l,
1742
- setTriggerAIRun: c
1742
+ setTriggerAIRun: d
1743
1743
  }) {
1744
- const r = ws(null), o = ws(null), { authToken: d } = ke(), [p, u] = q(!1), y = m((w) => w.actions.setCardSql), g = z((w) => w.dashboard.baseQueries), x = m((w) => w.actions.setRunSql), j = m((w) => w.actions.setCardType), [b, I] = q([]), C = m((w) => w.currentColumns), T = m((w) => w.card.sql), F = m((w) => w.selectedTableName), A = `
1744
+ const r = ws(null), o = ws(null), { authToken: c } = ke(), [p, u] = q(!1), b = m((w) => w.actions.setCardSql), g = z((w) => w.dashboard.baseQueries), h = m((w) => w.actions.setRunSql), j = m((w) => w.actions.setCardType), [C, F] = q([]), y = m((w) => w.currentColumns), T = m((w) => w.card.sql), I = m((w) => w.selectedTableName), A = `
1745
1745
  ${a}
1746
1746
 
1747
- Database Query Dialect: ${F === "api" || F === "s3" ? "DuckDb" : ""}
1748
- Table Name: ${F}
1749
- Table Columns: ${C == null ? void 0 : C.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
1747
+ Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
1748
+ Table Name: ${I}
1749
+ Table Columns: ${y == null ? void 0 : y.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
1750
1750
  User SQL: ${T}
1751
1751
  ${g && `Base Queries: ${JSON.stringify(g)} `}`, N = ` 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.
1752
- Visual Query Syntax: ${cl}`, { data: S, isLoading: L, isFetching: h, isError: v, refetch: f } = Ne({
1752
+ Visual Query Syntax: ${dl}`, { data: S, isLoading: L, isFetching: x, isError: v, refetch: f } = Ce({
1753
1753
  queryKey: ["ai-query"],
1754
1754
  queryFn: () => Fe(
1755
1755
  "https://semaphor.cloud/api/v1/ai",
1756
- (d == null ? void 0 : d.accessToken) || "",
1756
+ (c == null ? void 0 : c.accessToken) || "",
1757
1757
  {
1758
1758
  user_content: `userContent: ${A} ${p ? N : ""}`
1759
1759
  }
@@ -1783,7 +1783,7 @@ function dl({
1783
1783
  return !0;
1784
1784
  }
1785
1785
  Z(() => {
1786
- S && I((w) => [...w, { role: "ai", content: S.response }]);
1786
+ S && F((w) => [...w, { role: "ai", content: S.response }]);
1787
1787
  }, [S]), Z(() => {
1788
1788
  const w = setTimeout(() => {
1789
1789
  var _;
@@ -1793,13 +1793,13 @@ function dl({
1793
1793
  }), (_ = r.current) == null || _.focus());
1794
1794
  }, 100);
1795
1795
  return () => clearTimeout(w);
1796
- }, [b]);
1796
+ }, [C]);
1797
1797
  function M() {
1798
- a && (I((w) => [...w, { role: "user", content: a }]), k(a) && u(!0), n(""), f());
1798
+ a && (F((w) => [...w, { role: "user", content: a }]), k(a) && u(!0), n(""), f());
1799
1799
  }
1800
1800
  Z(() => {
1801
- l && (M(), c(!1));
1802
- }, [l, c]);
1801
+ l && (M(), d(!1));
1802
+ }, [l, d]);
1803
1803
  const H = {
1804
1804
  //seleect a darker color
1805
1805
  // color: '#000',
@@ -1838,7 +1838,7 @@ function dl({
1838
1838
  {
1839
1839
  onClick: (ee) => {
1840
1840
  const E = W(ee);
1841
- E && (t(!1), y(E), x(!0));
1841
+ E && (t(!1), b(E), h(!0));
1842
1842
  },
1843
1843
  size: "sm",
1844
1844
  variant: "outline",
@@ -1857,12 +1857,12 @@ function dl({
1857
1857
  return navigator.clipboard.writeText(ee).then(() => console.log("Text copied to clipboard")).catch((E) => console.error("Error in copying text: ", E)), ee;
1858
1858
  }
1859
1859
  function ae() {
1860
- return b == null ? void 0 : b.map((w, _) => w.role === "user" ? /* @__PURE__ */ e.jsxs(
1860
+ return C == null ? void 0 : C.map((w, _) => w.role === "user" ? /* @__PURE__ */ e.jsxs(
1861
1861
  "div",
1862
1862
  {
1863
1863
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1864
1864
  children: [
1865
- /* @__PURE__ */ e.jsx(Wn, { className: "mr-2 h-5 w-5" }),
1865
+ /* @__PURE__ */ e.jsx(Yn, { className: "mr-2 h-5 w-5" }),
1866
1866
  /* @__PURE__ */ e.jsx("div", { children: w.content })
1867
1867
  ]
1868
1868
  },
@@ -1924,7 +1924,7 @@ function dl({
1924
1924
  className: Q(
1925
1925
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1926
1926
  ),
1927
- disabled: L || h,
1927
+ disabled: L || x,
1928
1928
  value: a,
1929
1929
  onChange: (w) => n(w.target.value)
1930
1930
  }
@@ -1937,7 +1937,7 @@ function dl({
1937
1937
  size: "sm",
1938
1938
  variant: "ghost",
1939
1939
  onClick: M,
1940
- children: !L && !h ? /* @__PURE__ */ e.jsx(xt, {}) : /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1940
+ children: !L && !x ? /* @__PURE__ */ e.jsx(xt, {}) : /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1941
1941
  }
1942
1942
  )
1943
1943
  ] })
@@ -1954,18 +1954,18 @@ var Va = {
1954
1954
  className: void 0,
1955
1955
  style: void 0,
1956
1956
  attr: void 0
1957
- }, sa = we.createContext && /* @__PURE__ */ we.createContext(Va), ul = ["attr", "size", "title"];
1958
- function ml(s, t) {
1957
+ }, sa = we.createContext && /* @__PURE__ */ we.createContext(Va), ml = ["attr", "size", "title"];
1958
+ function hl(s, t) {
1959
1959
  if (s == null) return {};
1960
- var a = hl(s, t), n, l;
1960
+ var a = xl(s, t), n, l;
1961
1961
  if (Object.getOwnPropertySymbols) {
1962
- var c = Object.getOwnPropertySymbols(s);
1963
- for (l = 0; l < c.length; l++)
1964
- n = c[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
1962
+ var d = Object.getOwnPropertySymbols(s);
1963
+ for (l = 0; l < d.length; l++)
1964
+ n = d[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
1965
1965
  }
1966
1966
  return a;
1967
1967
  }
1968
- function hl(s, t) {
1968
+ function xl(s, t) {
1969
1969
  if (s == null) return {};
1970
1970
  var a = {};
1971
1971
  for (var n in s)
@@ -1999,21 +1999,21 @@ function ds(s) {
1999
1999
  for (var t = 1; t < arguments.length; t++) {
2000
2000
  var a = arguments[t] != null ? arguments[t] : {};
2001
2001
  t % 2 ? aa(Object(a), !0).forEach(function(n) {
2002
- xl(s, n, a[n]);
2002
+ pl(s, n, a[n]);
2003
2003
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : aa(Object(a)).forEach(function(n) {
2004
2004
  Object.defineProperty(s, n, Object.getOwnPropertyDescriptor(a, n));
2005
2005
  });
2006
2006
  }
2007
2007
  return s;
2008
2008
  }
2009
- function xl(s, t, a) {
2010
- return t = pl(t), t in s ? Object.defineProperty(s, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[t] = a, s;
2009
+ function pl(s, t, a) {
2010
+ return t = fl(t), t in s ? Object.defineProperty(s, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[t] = a, s;
2011
2011
  }
2012
- function pl(s) {
2013
- var t = fl(s, "string");
2012
+ function fl(s) {
2013
+ var t = gl(s, "string");
2014
2014
  return typeof t == "symbol" ? t : t + "";
2015
2015
  }
2016
- function fl(s, t) {
2016
+ function gl(s, t) {
2017
2017
  if (typeof s != "object" || !s) return s;
2018
2018
  var a = s[Symbol.toPrimitive];
2019
2019
  if (a !== void 0) {
@@ -2028,38 +2028,38 @@ function qa(s) {
2028
2028
  key: a
2029
2029
  }, t.attr), qa(t.child)));
2030
2030
  }
2031
- function je(s) {
2032
- return (t) => /* @__PURE__ */ we.createElement(gl, cs({
2031
+ function ge(s) {
2032
+ return (t) => /* @__PURE__ */ we.createElement(jl, cs({
2033
2033
  attr: ds({}, s.attr)
2034
2034
  }, t), qa(s.child));
2035
2035
  }
2036
- function gl(s) {
2036
+ function jl(s) {
2037
2037
  var t = (a) => {
2038
2038
  var {
2039
2039
  attr: n,
2040
2040
  size: l,
2041
- title: c
2042
- } = s, r = ml(s, ul), o = l || a.size || "1em", d;
2043
- return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ we.createElement("svg", cs({
2041
+ title: d
2042
+ } = s, r = hl(s, ml), o = l || a.size || "1em", c;
2043
+ return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ we.createElement("svg", cs({
2044
2044
  stroke: "currentColor",
2045
2045
  fill: "currentColor",
2046
2046
  strokeWidth: "0"
2047
2047
  }, a.attr, n, r, {
2048
- className: d,
2048
+ className: c,
2049
2049
  style: ds(ds({
2050
2050
  color: s.color || a.color
2051
2051
  }, a.style), s.style),
2052
2052
  height: o,
2053
2053
  width: o,
2054
2054
  xmlns: "http://www.w3.org/2000/svg"
2055
- }), c && /* @__PURE__ */ we.createElement("title", null, c), s.children);
2055
+ }), d && /* @__PURE__ */ we.createElement("title", null, d), s.children);
2056
2056
  };
2057
2057
  return sa !== void 0 ? /* @__PURE__ */ we.createElement(sa.Consumer, null, (a) => t(a)) : t(Va);
2058
2058
  }
2059
- function jl(s) {
2060
- return je({ 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);
2059
+ function bl(s) {
2060
+ return ge({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
2061
2061
  }
2062
- function bl({ sql: s }) {
2062
+ function yl({ sql: s }) {
2063
2063
  return /* @__PURE__ */ e.jsxs(Vs, { children: [
2064
2064
  /* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2065
2065
  /* @__PURE__ */ e.jsx(
@@ -2069,19 +2069,19 @@ function bl({ sql: s }) {
2069
2069
  className: "w-full min-w-fit max-w-[700px] p-3 pt-2",
2070
2070
  children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2071
2071
  /* @__PURE__ */ e.jsx(R, { className: "text-xs font-semibold", children: "Resolved Query" }),
2072
- /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-col space-y-2", children: /* @__PURE__ */ e.jsx(We, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 font-mono text-xs leading-relaxed", children: s }) }) })
2072
+ /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-col space-y-2", children: /* @__PURE__ */ e.jsx(qe, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 font-mono text-xs leading-relaxed", children: s }) }) })
2073
2073
  ] })
2074
2074
  }
2075
2075
  )
2076
2076
  ] });
2077
2077
  }
2078
- function yl() {
2078
+ function vl() {
2079
2079
  const [s, t] = q({
2080
2080
  queryKey: [],
2081
2081
  queryData: null
2082
- }), { theme: a } = bt(), n = yt(), l = ws(), c = vt(), [r, o] = q(!1), [d, p] = q(!1), [u, y] = q(!1), [g, x] = q(""), [j, b] = q(!1), I = z((i) => i.selectedSheetId);
2082
+ }), { theme: a } = bt(), n = yt(), l = ws(), d = vt(), [r, o] = q(!1), [c, p] = q(!1), [u, b] = q(!1), [g, h] = q(""), [j, C] = q(!1), F = z((i) => i.selectedSheetId);
2083
2083
  z((i) => i.dashboard.baseQueries);
2084
- const C = m((i) => i.card), T = z((i) => i.theme), F = m((i) => i.isShowingVisual);
2084
+ const y = m((i) => i.card), T = z((i) => i.theme), I = m((i) => i.isShowingVisual);
2085
2085
  z((i) => i.onAcceptChanges);
2086
2086
  const A = m(
2087
2087
  (i) => i.selectedConnectionId
@@ -2095,10 +2095,10 @@ function yl() {
2095
2095
  z(
2096
2096
  (i) => i.actions.updateFrameCard
2097
2097
  );
2098
- const h = m((i) => i.selectedTableName), v = m((i) => i.card.sql), f = m((i) => i.card.python), k = m((i) => i.frame), M = z((i) => i.dashboard.filters), H = z((i) => i.filterValues), P = M == null ? void 0 : M.filter(
2099
- (i) => i.sheetId === I || !i.sheetId
2098
+ const x = m((i) => i.selectedTableName), v = m((i) => i.card.sql), f = m((i) => i.card.python), k = m((i) => i.frame), M = z((i) => i.dashboard.filters), H = z((i) => i.filterValues), P = M == null ? void 0 : M.filter(
2099
+ (i) => i.sheetId === F || !i.sheetId
2100
2100
  ), Y = H == null ? void 0 : H.filter(
2101
- (i) => (P == null ? void 0 : P.some((ne) => ne.id === i.filterId)) || i.filterId.endsWith(I)
2101
+ (i) => (P == null ? void 0 : P.some((ne) => ne.id === i.filterId)) || i.filterId.endsWith(F)
2102
2102
  ), ie = m((i) => i.applyFilters), {
2103
2103
  setCardCustomCfg: W,
2104
2104
  setQueryResultColumns: ae,
@@ -2113,9 +2113,9 @@ function yl() {
2113
2113
  m(
2114
2114
  (i) => i.actions.setApplyFilters
2115
2115
  );
2116
- const te = m((i) => i.onClose), Le = m((i) => i.actions.setSqlGen), ze = m((i) => i.runSql), be = m((i) => i.actions.setRunSql);
2116
+ const te = m((i) => i.onClose), Le = m((i) => i.actions.setSqlGen), ze = m((i) => i.runSql), je = m((i) => i.actions.setRunSql);
2117
2117
  m((i) => i.actions.setCardCfg);
2118
- const ye = m(
2118
+ const be = m(
2119
2119
  (i) => i.actions.setIsSqlRunning
2120
2120
  ), {
2121
2121
  data: J,
@@ -2123,12 +2123,12 @@ function yl() {
2123
2123
  isFetching: ce,
2124
2124
  isSuccess: Oe,
2125
2125
  isError: Me,
2126
- error: He,
2127
- queryKey: $e,
2126
+ error: $e,
2127
+ queryKey: Pe,
2128
2128
  refetch: Ee
2129
- } = qe(C);
2129
+ } = Re(y);
2130
2130
  Z(() => {
2131
- if (J && (J.rowLimitExceeded && Ke.error("Row limit (10,000) exceeded. Refine your query.", {
2131
+ if (J && (J.rowLimitExceeded && We.error("Row limit (10,000) exceeded. Refine your query.", {
2132
2132
  position: "top-center",
2133
2133
  richColors: !0
2134
2134
  }), se((J == null ? void 0 : J.output) || ""), J.records.length > 0)) {
@@ -2141,7 +2141,7 @@ function yl() {
2141
2141
  ae,
2142
2142
  se
2143
2143
  ]), Z(() => {
2144
- (oe || ce) && ye(!0), (Me || Oe) && ye(!1), Me ? (D(He.message), ae([]), se("")) : D("");
2144
+ (oe || ce) && be(!0), (Me || Oe) && be(!1), Me ? (D($e.message), ae([]), se("")) : D("");
2145
2145
  }, [
2146
2146
  oe,
2147
2147
  ce,
@@ -2149,19 +2149,19 @@ function yl() {
2149
2149
  se,
2150
2150
  Me,
2151
2151
  Oe,
2152
- ye,
2152
+ be,
2153
2153
  ae,
2154
2154
  D,
2155
- He
2155
+ $e
2156
2156
  ]), Z(() => {
2157
- ze && (Ee(), be(!1));
2158
- }, [ze, Ee, be]);
2157
+ ze && (Ee(), je(!1));
2158
+ }, [ze, Ee, je]);
2159
2159
  function gs() {
2160
- const i = n.getQueryData($e);
2160
+ const i = n.getQueryData(Pe);
2161
2161
  s.queryData || t({
2162
- queryKey: $e,
2162
+ queryKey: Pe,
2163
2163
  queryData: i
2164
- }), n.setQueryData($e, null), _(""), Le({}), W(""), $({});
2164
+ }), n.setQueryData(Pe, null), _(""), Le({}), W(""), $({});
2165
2165
  }
2166
2166
  const Ye = (i) => {
2167
2167
  l.current = i;
@@ -2170,13 +2170,13 @@ function yl() {
2170
2170
  if (i.length === 0)
2171
2171
  return "";
2172
2172
  if (ne) {
2173
- const ve = i.find((Ce) => Ce.id === ne);
2174
- if (ve) {
2175
- const Ce = ve.tabTitle;
2176
- if (Ce == "All__Header")
2173
+ const ye = i.find((ve) => ve.id === ne);
2174
+ if (ye) {
2175
+ const ve = ye.tabTitle;
2176
+ if (ve == "All__Header")
2177
2177
  return i[0].id;
2178
- if (Ce && Ce.endsWith("__Header")) {
2179
- const Za = Ce.split("__")[0], Qs = i.find(
2178
+ if (ve && ve.endsWith("__Header")) {
2179
+ const Za = ve.split("__")[0], Qs = i.find(
2180
2180
  (et) => et.tabTitle === Za
2181
2181
  );
2182
2182
  return Qs ? Qs.id : i[0].id;
@@ -2188,56 +2188,56 @@ function yl() {
2188
2188
  }
2189
2189
  function Ze() {
2190
2190
  let i = v;
2191
- v && !v.includes("{{") && (i = il(v), _(i));
2191
+ v && !v.includes("{{") && (i = ol(v), _(i));
2192
2192
  const ne = {
2193
- ...C,
2193
+ ...y,
2194
2194
  lastSelectedSchema: L,
2195
2195
  lastSelectedDatamodelId: S,
2196
2196
  lastSelectedDatabase: N,
2197
- lastSelectedTable: h,
2197
+ lastSelectedTable: x,
2198
2198
  connectionId: A,
2199
- type: F ? C.type : "table",
2199
+ type: I ? y.type : "table",
2200
2200
  sql: i,
2201
- customCfg: F ? C.customCfg : null
2202
- }, ve = k.cards.map(
2203
- (js) => js.id === C.id ? ne : js
2204
- ), Ce = {
2201
+ customCfg: I ? y.customCfg : null
2202
+ }, ye = k.cards.map(
2203
+ (js) => js.id === y.id ? ne : js
2204
+ ), ve = {
2205
2205
  ...k,
2206
- cards: ve,
2207
- activeCardId: Xe(ve, k.activeCardId)
2206
+ cards: ye,
2207
+ activeCardId: Xe(ye, k.activeCardId)
2208
2208
  };
2209
- X == null || X(Ce);
2209
+ X == null || X(ve);
2210
2210
  }
2211
2211
  function es() {
2212
2212
  const { queryKey: i, queryData: ne } = s;
2213
2213
  i && ne && n.setQueryData(i, ne), te == null || te();
2214
2214
  }
2215
2215
  Z(() => {
2216
- if (!c) return;
2217
- const i = l.current, ne = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ve = T === "system" ? ne : T;
2218
- return c.editor.defineTheme("default", {
2216
+ if (!d) return;
2217
+ const i = l.current, ne = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ye = T === "system" ? ne : T;
2218
+ return d.editor.defineTheme("default", {
2219
2219
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2220
- base: ve === "light" ? "vs" : "vs-dark",
2220
+ base: ye === "light" ? "vs" : "vs-dark",
2221
2221
  inherit: !0,
2222
2222
  rules: [],
2223
2223
  colors: {
2224
- "editor.background": ve === "light" ? "#ffffff" : Ct("240 10% 10%")
2224
+ "editor.background": ye === "light" ? "#ffffff" : Ct("240 10% 10%")
2225
2225
  // 'editor.background':
2226
2226
  // activeTheme === 'light'
2227
2227
  // ? '#ffffff'
2228
2228
  // : getCssVariableValue('--semaphor-background'),
2229
2229
  }
2230
- }), c.editor.setTheme("default"), i && c && i.addCommand(
2231
- c.KeyMod.Shift | c.KeyCode.Enter,
2230
+ }), d.editor.setTheme("default"), i && d && i.addCommand(
2231
+ d.KeyMod.Shift | d.KeyCode.Enter,
2232
2232
  function() {
2233
2233
  return Ee(), !1;
2234
2234
  }
2235
2235
  ), () => {
2236
2236
  };
2237
- }, [a, T, c]);
2237
+ }, [a, T, d]);
2238
2238
  function ss() {
2239
2239
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2240
- d && /* @__PURE__ */ e.jsx(
2240
+ c && /* @__PURE__ */ e.jsx(
2241
2241
  "div",
2242
2242
  {
2243
2243
  className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
@@ -2245,8 +2245,8 @@ function yl() {
2245
2245
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
2246
2246
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
2247
2247
  /* @__PURE__ */ e.jsx(R, { className: "ml-6 text-xs font-semibold", children: "Filters" }),
2248
- Y && d && /* @__PURE__ */ e.jsx(
2249
- Qe,
2248
+ Y && c && /* @__PURE__ */ e.jsx(
2249
+ Je,
2250
2250
  {
2251
2251
  onClick: () => p(!1),
2252
2252
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
@@ -2254,7 +2254,7 @@ function yl() {
2254
2254
  )
2255
2255
  ] }),
2256
2256
  /* @__PURE__ */ e.jsx(
2257
- Ue,
2257
+ Ge,
2258
2258
  {
2259
2259
  theme: "default",
2260
2260
  onChange: (i) => {
@@ -2288,7 +2288,7 @@ function yl() {
2288
2288
  ] })
2289
2289
  }
2290
2290
  ),
2291
- Y && !d && /* @__PURE__ */ e.jsx(
2291
+ Y && !c && /* @__PURE__ */ e.jsx(
2292
2292
  ca,
2293
2293
  {
2294
2294
  onClick: () => p(!0),
@@ -2324,7 +2324,7 @@ function yl() {
2324
2324
  role: "sql-container",
2325
2325
  className: "relative flex w-[99%]",
2326
2326
  children: /* @__PURE__ */ e.jsx(
2327
- Ue,
2327
+ Ge,
2328
2328
  {
2329
2329
  theme: "default",
2330
2330
  className: "pt-3",
@@ -2370,7 +2370,7 @@ function yl() {
2370
2370
  role: "python-container",
2371
2371
  className: "relative flex w-[99%] pt-0",
2372
2372
  children: /* @__PURE__ */ e.jsx(
2373
- Ue,
2373
+ Ge,
2374
2374
  {
2375
2375
  className: "pt-3",
2376
2376
  theme: "default",
@@ -2443,18 +2443,18 @@ function yl() {
2443
2443
  size: "sm",
2444
2444
  variant: "outline",
2445
2445
  children: [
2446
- oe || ce ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx($n, { className: "mr-2 h-4 w-4" }),
2446
+ oe || ce ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Pn, { className: "mr-2 h-4 w-4" }),
2447
2447
  "Run"
2448
2448
  ]
2449
2449
  }
2450
2450
  ),
2451
2451
  Me && /* @__PURE__ */ e.jsx(
2452
- ol,
2452
+ cl,
2453
2453
  {
2454
- error: He.message,
2455
- setShowAIDialog: y,
2456
- setTriggerAIRun: b,
2457
- setUserInputforAI: x
2454
+ error: $e.message,
2455
+ setShowAIDialog: b,
2456
+ setTriggerAIRun: C,
2457
+ setUserInputforAI: h
2458
2458
  }
2459
2459
  ),
2460
2460
  /* @__PURE__ */ e.jsxs(
@@ -2465,7 +2465,7 @@ function yl() {
2465
2465
  size: "sm",
2466
2466
  variant: "outline",
2467
2467
  children: [
2468
- /* @__PURE__ */ e.jsx(Fn, { className: "mr-2 size-4" }),
2468
+ /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-4" }),
2469
2469
  "Clear"
2470
2470
  ]
2471
2471
  }
@@ -2478,23 +2478,23 @@ function yl() {
2478
2478
  className: "",
2479
2479
  size: "sm",
2480
2480
  variant: "outline",
2481
- children: /* @__PURE__ */ e.jsx(jl, { className: "size-4 text-foreground/70" })
2481
+ children: /* @__PURE__ */ e.jsx(bl, { className: "size-4 text-foreground/70" })
2482
2482
  }
2483
2483
  ),
2484
2484
  /* @__PURE__ */ e.jsx(
2485
- dl,
2485
+ ul,
2486
2486
  {
2487
2487
  open: u,
2488
- setOpen: y,
2488
+ setOpen: b,
2489
2489
  userInput: g,
2490
2490
  triggerAIRun: j,
2491
- setTriggerAIRun: b,
2492
- setUserInput: (i) => x(i)
2491
+ setTriggerAIRun: C,
2492
+ setUserInput: (i) => h(i)
2493
2493
  }
2494
2494
  )
2495
2495
  ] }),
2496
2496
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2497
- (J == null ? void 0 : J.sql) && /* @__PURE__ */ e.jsx(bl, { sql: J.sql }),
2497
+ (J == null ? void 0 : J.sql) && /* @__PURE__ */ e.jsx(yl, { sql: J.sql }),
2498
2498
  /* @__PURE__ */ e.jsxs(
2499
2499
  O,
2500
2500
  {
@@ -2503,7 +2503,7 @@ function yl() {
2503
2503
  size: "sm",
2504
2504
  variant: "outline",
2505
2505
  children: [
2506
- /* @__PURE__ */ e.jsx(Qe, { className: "mr-2 size-4" }),
2506
+ /* @__PURE__ */ e.jsx(Je, { className: "mr-2 size-4" }),
2507
2507
  "Close"
2508
2508
  ]
2509
2509
  }
@@ -2529,18 +2529,18 @@ function yl() {
2529
2529
  )
2530
2530
  );
2531
2531
  }
2532
- function vl({ data: s }) {
2532
+ function Cl({ data: s }) {
2533
2533
  var r;
2534
2534
  const [t, a] = we.useState([]), l = Object.keys(s[0]).map((o) => ({
2535
2535
  // header: key,
2536
2536
  accessorKey: o,
2537
- header: ({ column: d }) => {
2538
- const p = d.getIsSorted();
2537
+ header: ({ column: c }) => {
2538
+ const p = c.getIsSorted();
2539
2539
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2540
2540
  "div",
2541
2541
  {
2542
2542
  className: "flex cursor-pointer items-center",
2543
- onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2543
+ onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
2544
2544
  children: [
2545
2545
  o,
2546
2546
  p === "asc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : p === "desc" ? /* @__PURE__ */ e.jsx(kt, { className: "ml-2 h-5 w-5" }) : null
@@ -2548,7 +2548,7 @@ function vl({ data: s }) {
2548
2548
  }
2549
2549
  ) });
2550
2550
  }
2551
- })), c = zt({
2551
+ })), d = zt({
2552
2552
  data: s,
2553
2553
  columns: l,
2554
2554
  getCoreRowModel: Tt(),
@@ -2560,46 +2560,53 @@ function vl({ data: s }) {
2560
2560
  sorting: t
2561
2561
  }
2562
2562
  });
2563
- return /* @__PURE__ */ e.jsxs(Ot, { children: [
2564
- /* @__PURE__ */ e.jsx(Ft, { children: c.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(bs, { children: o.headers.map((d) => /* @__PURE__ */ e.jsx(It, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Ws(
2565
- d.column.columnDef.header,
2566
- d.getContext()
2567
- ) }, d.id)) }, o.id)) }),
2568
- /* @__PURE__ */ e.jsx(Dt, { children: (r = c.getRowModel().rows) != null && r.length ? c.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2563
+ return /* @__PURE__ */ e.jsxs(Ot, { className: "font-mono text-xs text-foreground/95", children: [
2564
+ /* @__PURE__ */ e.jsx(Ft, { children: d.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(bs, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
2565
+ It,
2566
+ {
2567
+ className: "sticky top-0 h-11 bg-muted font-semibold",
2568
+ children: c.isPlaceholder ? null : Ws(
2569
+ c.column.columnDef.header,
2570
+ c.getContext()
2571
+ )
2572
+ },
2573
+ c.id
2574
+ )) }, o.id)) }),
2575
+ /* @__PURE__ */ e.jsx(Dt, { children: (r = d.getRowModel().rows) != null && r.length ? d.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2569
2576
  bs,
2570
2577
  {
2571
2578
  className: "whitespace-nowrap py-2",
2572
2579
  "data-state": o.getIsSelected() && "selected",
2573
- children: o.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Ys, { children: Ws(d.column.columnDef.cell, d.getContext()) }, d.id))
2580
+ children: o.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Ys, { className: "py-3", children: Ws(c.column.columnDef.cell, c.getContext()) }, c.id))
2574
2581
  },
2575
2582
  o.id
2576
2583
  )) : /* @__PURE__ */ e.jsx(bs, { children: /* @__PURE__ */ e.jsx(Ys, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2577
2584
  ] });
2578
2585
  }
2579
- function Cl({ card: s }) {
2580
- var g, x, j, b, I, C, T, F, A, N;
2586
+ function Nl({ card: s }) {
2587
+ var g, h, j, C, F, y, T, I, A, N;
2581
2588
  const { authToken: t } = ke(), a = Et(t == null ? void 0 : t.accessToken), n = z((S) => S.themeStyle), l = {
2582
- colors: ((x = (g = n == null ? void 0 : n.chart) == null ? void 0 : g.dataset) == null ? void 0 : x.backgroundColor) || []
2589
+ colors: ((h = (g = n == null ? void 0 : n.chart) == null ? void 0 : g.dataset) == null ? void 0 : h.backgroundColor) || []
2583
2590
  };
2584
2591
  (j = s.customCardPreferences) != null && j.inputData;
2585
- const { getCard: c } = ja(((b = s.customCardPreferences) == null ? void 0 : b.url) || ""), r = ((I = s.customCardPreferences) == null ? void 0 : I.visualType) || "single", o = m((S) => S.frame);
2592
+ const { getCard: d } = ja(((C = s.customCardPreferences) == null ? void 0 : C.url) || ""), r = ((F = s.customCardPreferences) == null ? void 0 : F.visualType) || "single", o = m((S) => S.frame);
2586
2593
  re();
2587
- const { data: d } = qe(s);
2588
- if (!((C = s.customCardPreferences) != null && C.componentName))
2594
+ const { data: c } = Re(s);
2595
+ if (!((y = s.customCardPreferences) != null && y.componentName))
2589
2596
  return null;
2590
- const p = c(
2597
+ const p = d(
2591
2598
  (T = s.customCardPreferences) == null ? void 0 : T.componentName
2592
2599
  ), u = (S) => {
2593
2600
  console.log("data", S), s.customCardPreferences;
2594
- }, y = Object.keys(
2595
- ((F = s.customCardPreferences) == null ? void 0 : F.dataInputCardIds) || {}
2601
+ }, b = Object.keys(
2602
+ ((I = s.customCardPreferences) == null ? void 0 : I.dataInputCardIds) || {}
2596
2603
  ).map((S) => {
2597
2604
  var v, f, k;
2598
- const L = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId, h = (k = o == null ? void 0 : o.cards) == null ? void 0 : k.find((M) => M.id === L);
2599
- return h || null;
2605
+ const L = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId, x = (k = o == null ? void 0 : o.cards) == null ? void 0 : k.find((M) => M.id === L);
2606
+ return x || null;
2600
2607
  });
2601
2608
  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(
2602
- Nn,
2609
+ Sn,
2603
2610
  {
2604
2611
  fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
2605
2612
  children: [
@@ -2610,7 +2617,7 @@ function Cl({ card: s }) {
2610
2617
  theme: l,
2611
2618
  settings: (A = s.customCardPreferences) == null ? void 0 : A.settings,
2612
2619
  onDataChange: u,
2613
- data: (d == null ? void 0 : d.records) || []
2620
+ data: (c == null ? void 0 : c.records) || []
2614
2621
  }
2615
2622
  ),
2616
2623
  p && r === "multiple" && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
@@ -2618,13 +2625,13 @@ function Cl({ card: s }) {
2618
2625
  {
2619
2626
  theme: l,
2620
2627
  onDataChange: u,
2621
- settings: y.map(
2628
+ settings: b.map(
2622
2629
  (S) => {
2623
2630
  var L;
2624
2631
  return (L = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : L.settings;
2625
2632
  }
2626
2633
  ),
2627
- data: y.map((S) => (S == null ? void 0 : S.data) || [])
2634
+ data: b.map((S) => (S == null ? void 0 : S.data) || [])
2628
2635
  }
2629
2636
  ) })
2630
2637
  ]
@@ -2638,22 +2645,42 @@ function Ra({
2638
2645
  className: s,
2639
2646
  ...t
2640
2647
  }) {
2641
- var x, j;
2642
- const a = m((b) => b.card), n = ((x = a.customCardPreferences) == null ? void 0 : x.showCardHeader) ?? !0, l = m((b) => b.frame), c = z((b) => b.dashboard.filters);
2643
- m((b) => b.actions.setRunSql);
2644
- const { updateFilter: r } = Os(), o = c == null ? void 0 : c.find((b) => b.id === l.filterId), { data: d } = qe(a), { setCard: p } = re(), { data: u } = _s(a);
2648
+ var F;
2649
+ const a = m((y) => y.card), n = ((F = a.customCardPreferences) == null ? void 0 : F.showCardHeader) ?? !0, l = m((y) => y.frame), d = z((y) => y.dashboard.filters);
2650
+ m((y) => y.actions.setRunSql);
2651
+ const { updateFilter: r } = Os(), o = d == null ? void 0 : d.find((y) => y.id === l.filterId), { data: c, isLoading: p, isFetching: u } = Re(a), { setCard: b } = re(), { data: g } = _s(a);
2645
2652
  if (!a.id) return null;
2646
- let y;
2647
- d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (y = ba({
2648
- data: d == null ? void 0 : d.records,
2653
+ let h;
2654
+ c != null && c.records && (c == null ? void 0 : c.records.length) > 0 && (h = ba({
2655
+ data: c == null ? void 0 : c.records,
2649
2656
  cardType: a.type,
2650
2657
  cfg: a.cfg,
2651
2658
  customCfg: a.customCfg,
2652
2659
  preferences: a.preferences,
2653
- topoJson: u
2660
+ topoJson: g
2654
2661
  }));
2655
- function g(b) {
2656
- return /* @__PURE__ */ e.jsx(Cl, { card: b });
2662
+ function j(y) {
2663
+ return /* @__PURE__ */ e.jsx(Nl, { card: y });
2664
+ }
2665
+ function C() {
2666
+ var y;
2667
+ if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !p && !u)
2668
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
2669
+ /* @__PURE__ */ e.jsx($t, { className: "size-8 text-muted-foreground" }),
2670
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
2671
+ ] });
2672
+ if (a.type === "custom")
2673
+ return j(a);
2674
+ if (!["table", "custom"].includes(a.type) && h)
2675
+ return /* @__PURE__ */ e.jsx(
2676
+ Pt,
2677
+ {
2678
+ cfg: h
2679
+ },
2680
+ JSON.stringify(h) + JSON.stringify(a.preferences) + ((y = a == null ? void 0 : a.preferences) == null ? void 0 : y.customVisualCode)
2681
+ );
2682
+ if (a.type === "table" && (c != null && c.records) && (c == null ? void 0 : c.records.length) > 0)
2683
+ return /* @__PURE__ */ e.jsx(Bt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Ut, { card: a, data: c == null ? void 0 : c.records }) });
2657
2684
  }
2658
2685
  return /* @__PURE__ */ e.jsxs(
2659
2686
  At,
@@ -2668,7 +2695,7 @@ function Ra({
2668
2695
  ls,
2669
2696
  {
2670
2697
  text: a.title,
2671
- onSave: (b) => p({ ...a, title: b }),
2698
+ onSave: (y) => b({ ...a, title: y }),
2672
2699
  children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(qt, { className: "text-base", children: a.title || "Edit title..." }) })
2673
2700
  },
2674
2701
  a.title
@@ -2677,7 +2704,7 @@ function Ra({
2677
2704
  ls,
2678
2705
  {
2679
2706
  text: a.description || "",
2680
- onSave: (b) => p({ ...a, description: b }),
2707
+ onSave: (y) => b({ ...a, description: y }),
2681
2708
  children: /* @__PURE__ */ e.jsx(Rt, { children: a.description || "Edit description..." })
2682
2709
  },
2683
2710
  a.description
@@ -2689,41 +2716,29 @@ function Ra({
2689
2716
  {
2690
2717
  className: "my-1",
2691
2718
  text: o.title || o.column,
2692
- onSave: (b) => r({ ...o, title: b }),
2719
+ onSave: (y) => r({ ...o, title: y }),
2693
2720
  children: /* @__PURE__ */ e.jsx(R, { children: o.title })
2694
2721
  }
2695
2722
  ),
2696
2723
  /* @__PURE__ */ e.jsx(_t, { filter: o })
2697
2724
  ] })
2698
2725
  ] }),
2699
- /* @__PURE__ */ e.jsxs(Ht, { className: "flex grow flex-col", children: [
2700
- a.type === "custom" && g(a),
2701
- !["table", "custom"].includes(a.type) && y && // <ChartJsVisual key={visualKey} cfg={cfg} />
2702
- /* @__PURE__ */ e.jsx(
2703
- $t,
2704
- {
2705
- cfg: y
2706
- },
2707
- JSON.stringify(y) + JSON.stringify(a.preferences) + ((j = a == null ? void 0 : a.preferences) == null ? void 0 : j.customVisualCode)
2708
- ),
2709
- a.type === "table" && (d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2710
- /* @__PURE__ */ e.jsx(Pt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Bt, { card: a, data: d == null ? void 0 : d.records }) })
2711
- ] })
2726
+ /* @__PURE__ */ e.jsx(Ht, { className: "flex grow flex-col", children: C() })
2712
2727
  ]
2713
2728
  }
2714
2729
  );
2715
2730
  }
2716
- function Nl() {
2717
- const [s, t] = q(!1), [a, n] = q(""), [l, c] = q(""), [r, o] = q(""), [d, p] = q(""), u = m((N) => N.card), y = m(
2731
+ function Sl() {
2732
+ const [s, t] = q(!1), [a, n] = q(""), [l, d] = q(""), [r, o] = q(""), [c, p] = q(""), u = m((N) => N.card), b = m(
2718
2733
  (N) => N.card.customCfg
2719
- ), { data: g } = qe(u), { data: x } = _s(u), { setCardCustomCfg: j, setCustomVisualCode: b } = re();
2720
- function I(N) {
2721
- var h, v;
2734
+ ), { data: g } = Re(u), { data: h } = _s(u), { setCardCustomCfg: j, setCustomVisualCode: C } = re();
2735
+ function F(N) {
2736
+ var x, v;
2722
2737
  const S = {
2723
2738
  ...N,
2724
2739
  data: {
2725
2740
  ...N == null ? void 0 : N.data,
2726
- datasets: (v = (h = N == null ? void 0 : N.data) == null ? void 0 : h.datasets) == null ? void 0 : v.map((f) => ({
2741
+ datasets: (v = (x = N == null ? void 0 : N.data) == null ? void 0 : x.datasets) == null ? void 0 : v.map((f) => ({
2727
2742
  ...f,
2728
2743
  data: []
2729
2744
  }))
@@ -2731,7 +2746,7 @@ function Nl() {
2731
2746
  };
2732
2747
  return JSON.stringify(S, null, 1);
2733
2748
  }
2734
- function C() {
2749
+ function y() {
2735
2750
  var S, L;
2736
2751
  if (!(g != null && g.records) || (g == null ? void 0 : g.records.length) === 0) return;
2737
2752
  const N = ba({
@@ -2739,39 +2754,39 @@ function Nl() {
2739
2754
  cardType: u.type,
2740
2755
  cfg: u.cfg,
2741
2756
  preferences: u.preferences,
2742
- topoJson: x
2757
+ topoJson: h
2743
2758
  });
2744
- N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode && o((L = u == null ? void 0 : u.preferences) == null ? void 0 : L.customVisualCode), y && c(JSON.stringify(y, null, 1)));
2759
+ N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode && o((L = u == null ? void 0 : u.preferences) == null ? void 0 : L.customVisualCode), b && d(JSON.stringify(b, null, 1)));
2745
2760
  }
2746
2761
  function T() {
2747
- if (r && b(r), !!l)
2762
+ if (r && C(r), !!l)
2748
2763
  try {
2749
2764
  const N = JSON.parse(l);
2750
- return N ? (j(N), p(""), c(""), N) : void 0;
2765
+ return N ? (j(N), p(""), d(""), N) : void 0;
2751
2766
  } catch (N) {
2752
2767
  console.log(N), p("Invalid JSON");
2753
2768
  }
2754
2769
  }
2755
- function F() {
2756
- c(""), j(null);
2770
+ function I() {
2771
+ d(""), j(null);
2757
2772
  }
2758
2773
  function A() {
2759
2774
  let N;
2760
- if (y) {
2761
- const S = Xs.cloneDeep(u.cfg), L = Xs.merge(S, y);
2762
- return N = I(L), N;
2775
+ if (b) {
2776
+ const S = Xs.cloneDeep(u.cfg), L = Xs.merge(S, b);
2777
+ return N = F(L), N;
2763
2778
  }
2764
- return a ? (N = I(JSON.parse(a)), N) : "";
2779
+ return a ? (N = F(JSON.parse(a)), N) : "";
2765
2780
  }
2766
2781
  return /* @__PURE__ */ e.jsxs(Fs, { open: s, onOpenChange: t, children: [
2767
2782
  /* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2768
2783
  O,
2769
2784
  {
2770
- onClick: C,
2771
- className: ` ${y && "border-foreground/50 dark:border-foreground/70"}`,
2785
+ onClick: y,
2786
+ className: ` ${b && "border-foreground/50 dark:border-foreground/70"}`,
2772
2787
  size: "sm",
2773
2788
  variant: "outline",
2774
- children: /* @__PURE__ */ e.jsx(Ut, { className: "h-4 w-4" })
2789
+ children: /* @__PURE__ */ e.jsx(Gt, { className: "h-4 w-4" })
2775
2790
  }
2776
2791
  ) }),
2777
2792
  /* @__PURE__ */ e.jsxs(
@@ -2799,8 +2814,8 @@ function Nl() {
2799
2814
  /* @__PURE__ */ e.jsxs(va, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2800
2815
  /* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2801
2816
  /* @__PURE__ */ e.jsxs(rs, { value: "custom-config", children: [
2802
- y && /* @__PURE__ */ e.jsx(Na, { className: "mr-1 h-5 w-5 text-green-600" }),
2803
- y ? "Custom Config" : "Default Config"
2817
+ b && /* @__PURE__ */ e.jsx(Na, { className: "mr-1 h-5 w-5 text-green-600" }),
2818
+ b ? "Custom Config" : "Default Config"
2804
2819
  ] }),
2805
2820
  /* @__PURE__ */ e.jsx(rs, { className: "", value: "output", children: "Output" }),
2806
2821
  /* @__PURE__ */ e.jsx(rs, { className: "", value: "custom-code", children: "Custom Code" })
@@ -2826,7 +2841,7 @@ function Nl() {
2826
2841
  className: "mt-0 grow rounded-b border border-t-0",
2827
2842
  value: "custom-config",
2828
2843
  children: /* @__PURE__ */ e.jsx(
2829
- Ue,
2844
+ Ge,
2830
2845
  {
2831
2846
  className: "h-full w-full overflow-hidden",
2832
2847
  theme: "default",
@@ -2844,7 +2859,7 @@ function Nl() {
2844
2859
  },
2845
2860
  defaultLanguage: "json",
2846
2861
  value: A(),
2847
- onChange: (N) => c(N)
2862
+ onChange: (N) => d(N)
2848
2863
  }
2849
2864
  )
2850
2865
  }
@@ -2855,7 +2870,7 @@ function Nl() {
2855
2870
  className: "mt-0 grow rounded-b border border-t-0",
2856
2871
  value: "custom-code",
2857
2872
  children: /* @__PURE__ */ e.jsx(
2858
- Ue,
2873
+ Ge,
2859
2874
  {
2860
2875
  className: "h-full w-full overflow-hidden",
2861
2876
  theme: "default",
@@ -2881,12 +2896,12 @@ function Nl() {
2881
2896
  ] })
2882
2897
  ] }),
2883
2898
  /* @__PURE__ */ e.jsxs(la, { className: "flex items-center", children: [
2884
- /* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children: d }),
2899
+ /* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children: c }),
2885
2900
  /* @__PURE__ */ e.jsx(
2886
2901
  O,
2887
2902
  {
2888
- disabled: !y,
2889
- onClick: F,
2903
+ disabled: !b,
2904
+ onClick: I,
2890
2905
  variant: "outline",
2891
2906
  children: "Reset"
2892
2907
  }
@@ -2900,78 +2915,78 @@ function Nl() {
2900
2915
  ] });
2901
2916
  }
2902
2917
  function _a(s) {
2903
- return je({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
2918
+ return ge({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
2904
2919
  }
2905
2920
  function Ha(s) {
2906
- return je({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z" }, child: [] }] })(s);
2921
+ return ge({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z" }, child: [] }] })(s);
2907
2922
  }
2908
2923
  function $a(s) {
2909
- return je({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
2924
+ return ge({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
2910
2925
  }
2911
2926
  function Pa(s) {
2912
- return je({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
2927
+ return ge({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
2913
2928
  }
2914
2929
  function Ba(s) {
2915
- return je({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
2930
+ return ge({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
2916
2931
  }
2917
2932
  function Ua(s) {
2918
- return je({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
2933
+ return ge({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
2919
2934
  }
2920
2935
  function Ga(s) {
2921
- return je({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
2936
+ return ge({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
2922
2937
  }
2923
2938
  function Qa(s) {
2924
- return je({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
2939
+ return ge({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
2925
2940
  }
2926
2941
  function Ja(s) {
2927
2942
  const [t, a] = q(null);
2928
2943
  return Z(() => {
2929
2944
  s && (async () => {
2930
- const c = (await import("./lucide-react-DyubCpoB.js"))[s];
2931
- a(c);
2945
+ const d = (await import("./lucide-react-B32xDJUJ.js"))[s];
2946
+ a(d);
2932
2947
  })();
2933
2948
  }, [s]), t;
2934
2949
  }
2935
2950
  function Ka() {
2936
- const { authToken: s } = ke(), { data: t, isLoading: a, isFetching: n, isError: l } = Ne({
2951
+ const { authToken: s } = ke(), { data: t, isLoading: a, isFetching: n, isError: l } = Ce({
2937
2952
  queryKey: ["plugins", s == null ? void 0 : s.accessToken],
2938
- queryFn: () => Gt(s == null ? void 0 : s.accessToken)
2953
+ queryFn: () => Qt(s == null ? void 0 : s.accessToken)
2939
2954
  // staleTime: Infinity,
2940
2955
  });
2941
2956
  return { data: t, isLoading: a, isFetching: n, isError: l };
2942
2957
  }
2943
- function Sl({
2958
+ function wl({
2944
2959
  onChartTypeChange: s
2945
2960
  }) {
2946
2961
  const [t, a] = q([]), { data: n } = Ka();
2947
2962
  return Z(() => {
2948
2963
  (async () => {
2949
- var c;
2964
+ var d;
2950
2965
  if (n) {
2951
2966
  const o = (await Promise.all(
2952
- (c = n == null ? void 0 : n.plugins) == null ? void 0 : c.map(async (d) => (await Qt(d.value)).visuals.map((y) => ({
2953
- name: y.name,
2954
- icon: y.icon,
2955
- url: d.value
2967
+ (d = n == null ? void 0 : n.plugins) == null ? void 0 : d.map(async (c) => (await Jt(c.value)).visuals.map((b) => ({
2968
+ name: b.name,
2969
+ icon: b.icon,
2970
+ url: c.value
2956
2971
  })))
2957
2972
  )).flat();
2958
2973
  a(o);
2959
2974
  }
2960
2975
  })();
2961
2976
  }, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2962
- /* @__PURE__ */ e.jsx(ge, { className: "my-2" }),
2963
- /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, c) => /* @__PURE__ */ e.jsx(
2964
- wl,
2977
+ /* @__PURE__ */ e.jsx(Se, { className: "my-2" }),
2978
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, d) => /* @__PURE__ */ e.jsx(
2979
+ kl,
2965
2980
  {
2966
2981
  text: l.name,
2967
2982
  onClick: () => s("custom", l),
2968
2983
  icon: l.icon
2969
2984
  },
2970
- l.url + l.name + c
2985
+ l.url + l.name + d
2971
2986
  )) })
2972
2987
  ] });
2973
2988
  }
2974
- const wl = ({
2989
+ const kl = ({
2975
2990
  text: s,
2976
2991
  icon: t,
2977
2992
  onClick: a
@@ -2979,26 +2994,26 @@ const wl = ({
2979
2994
  const n = Ja(t || ""), l = s.charAt(0).toUpperCase();
2980
2995
  return /* @__PURE__ */ e.jsx(O, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
2981
2996
  };
2982
- function kl() {
2983
- var u, y;
2984
- const [s, t] = q(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences: c, setChartOrientation: r } = m((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: d } = re();
2985
- function p(g, x) {
2986
- o(null), c({}), l(g), x && d({
2997
+ function zl() {
2998
+ var u, b;
2999
+ const [s, t] = q(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences: d, setChartOrientation: r } = m((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = re();
3000
+ function p(g, h) {
3001
+ o(null), d({}), l(g), h && c({
2987
3002
  type: "component",
2988
3003
  visualType: "single",
2989
- url: x.url,
2990
- componentName: x.name,
2991
- icon: x.icon
3004
+ url: h.url,
3005
+ componentName: h.name,
3006
+ icon: h.icon
2992
3007
  }), t(!1);
2993
3008
  }
2994
3009
  return /* @__PURE__ */ e.jsxs(ms, { open: s, onOpenChange: t, children: [
2995
3010
  /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
2996
- zl,
3011
+ Ol,
2997
3012
  {
2998
3013
  className: "h-4 w-4",
2999
3014
  chartType: n,
3000
3015
  customIcon: (u = a.customCardPreferences) == null ? void 0 : u.icon,
3001
- componentName: (y = a.customCardPreferences) == null ? void 0 : y.componentName
3016
+ componentName: (b = a.customCardPreferences) == null ? void 0 : b.componentName
3002
3017
  }
3003
3018
  ) }) }),
3004
3019
  /* @__PURE__ */ e.jsxs(xs, { className: "w-50", children: [
@@ -3147,11 +3162,11 @@ function kl() {
3147
3162
  }
3148
3163
  )
3149
3164
  ] }),
3150
- /* @__PURE__ */ e.jsx(Sl, { onChartTypeChange: p })
3165
+ /* @__PURE__ */ e.jsx(wl, { onChartTypeChange: p })
3151
3166
  ] })
3152
3167
  ] });
3153
3168
  }
3154
- function zl({
3169
+ function Ol({
3155
3170
  chartType: s,
3156
3171
  className: t,
3157
3172
  customIcon: a,
@@ -3195,20 +3210,20 @@ function zl({
3195
3210
  return /* @__PURE__ */ e.jsx(As, { className: t });
3196
3211
  }
3197
3212
  }
3198
- function Ol() {
3213
+ function Fl() {
3199
3214
  var t;
3200
3215
  const s = m((a) => a.card);
3201
3216
  return (t = s.customCardPreferences) == null || t.showCardHeader, re(), /* @__PURE__ */ e.jsxs(ra, { children: [
3202
3217
  /* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ia, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3203
3218
  /* @__PURE__ */ e.jsx(oa, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
3204
- Jt,
3219
+ Kt,
3205
3220
  {
3206
3221
  onClick: () => {
3207
- navigator.clipboard.writeText(s.id), Ke.success("Card ID copied to clipboard");
3222
+ navigator.clipboard.writeText(s.id), We.success("Card ID copied to clipboard");
3208
3223
  },
3209
3224
  className: "cursor-pointer space-x-2",
3210
3225
  children: [
3211
- /* @__PURE__ */ e.jsx(An, { className: "size-5" }),
3226
+ /* @__PURE__ */ e.jsx(Vn, { className: "size-5" }),
3212
3227
  /* @__PURE__ */ e.jsx("span", { children: "Copy Card ID" })
3213
3228
  ]
3214
3229
  }
@@ -3216,14 +3231,14 @@ function Ol() {
3216
3231
  ] });
3217
3232
  }
3218
3233
  function ta() {
3219
- const s = m((h) => h.frame), t = m((h) => h.card), a = m((h) => h.isShowingVisual), n = m((h) => h.isSqlRunning), l = m((h) => h.queryError), c = m((h) => h.pythonStdOut), r = m((h) => h.actions.setRunSql);
3220
- m((h) => h.onSave), m((h) => h.onClose), m((h) => h.actions.setCardSql), m((h) => h.actions.setCardType), m((h) => h.actions.setSqlGen);
3221
- const { setFrame: o, setCard: d, updateCardInFrame: p } = re(), { data: u, isLoading: y, isFetching: g } = qe(t);
3234
+ const s = m((x) => x.frame), t = m((x) => x.card), a = m((x) => x.isShowingVisual), n = m((x) => x.isSqlRunning), l = m((x) => x.queryError), d = m((x) => x.pythonStdOut), r = m((x) => x.actions.setRunSql);
3235
+ m((x) => x.onSave), m((x) => x.onClose), m((x) => x.actions.setCardSql), m((x) => x.actions.setCardType), m((x) => x.actions.setSqlGen);
3236
+ const { setFrame: o, setCard: c, updateCardInFrame: p } = re(), { data: u, isLoading: b, isFetching: g } = Re(t);
3222
3237
  if (!t) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3223
- function x() {
3224
- const h = {
3238
+ function h() {
3239
+ const x = {
3225
3240
  connectionId: t.connectionId,
3226
- id: Je(),
3241
+ id: Ke(),
3227
3242
  title: "Title",
3228
3243
  description: "Description",
3229
3244
  preferences: {
@@ -3238,66 +3253,66 @@ function ta() {
3238
3253
  sql: "",
3239
3254
  data: []
3240
3255
  };
3241
- j(h);
3256
+ j(x);
3242
3257
  }
3243
- function j(h) {
3258
+ function j(x) {
3244
3259
  const v = {
3245
3260
  ...s,
3246
- cards: [...s.cards, h],
3247
- activeCardId: h.id
3261
+ cards: [...s.cards, x],
3262
+ activeCardId: x.id
3248
3263
  };
3249
- o(v), d(h);
3264
+ o(v), c(x);
3250
3265
  }
3251
- function b() {
3252
- const h = {
3266
+ function C() {
3267
+ const x = {
3253
3268
  ...t,
3254
- id: Je(),
3269
+ id: Ke(),
3255
3270
  title: `${t.title} Copy`,
3256
- tabTitle: `${t.tabTitle} Copy`
3271
+ tabTitle: `${t.tabTitle || t.title} Copy`
3257
3272
  };
3258
- j(h);
3273
+ j(x);
3259
3274
  }
3260
- function I(h) {
3261
- const v = s.cards.filter((M) => M.id !== h), f = v[0], k = {
3275
+ function F(x) {
3276
+ const v = s.cards.filter((M) => M.id !== x), f = v[0], k = {
3262
3277
  ...s,
3263
3278
  cards: v,
3264
3279
  // update the active card to the first card in the frame
3265
3280
  activeCardId: f.id
3266
3281
  };
3267
- o(k), d(f);
3282
+ o(k), c(f);
3268
3283
  }
3269
- function C(h) {
3284
+ function y(x) {
3270
3285
  const v = {
3271
3286
  ...s,
3272
3287
  cards: s.cards.map((k) => k.id === t.id ? t : k),
3273
- activeCardId: h
3288
+ activeCardId: x
3274
3289
  };
3275
3290
  o(v);
3276
- const f = v.cards.find((k) => k.id === h);
3277
- f.sql && r(!0), d(f);
3291
+ const f = v.cards.find((k) => k.id === x);
3292
+ f.sql && r(!0), c(f);
3278
3293
  }
3279
- const T = (h, v) => {
3280
- console.log("handleDragStart", v), h.dataTransfer.setData("tabIndex", v.toString());
3281
- }, F = (h) => {
3282
- h.preventDefault();
3283
- }, A = (h, v) => {
3284
- const f = h.dataTransfer.getData("tabIndex");
3294
+ const T = (x, v) => {
3295
+ console.log("handleDragStart", v), x.dataTransfer.setData("tabIndex", v.toString());
3296
+ }, I = (x) => {
3297
+ x.preventDefault();
3298
+ }, A = (x, v) => {
3299
+ const f = x.dataTransfer.getData("tabIndex");
3285
3300
  if (f === v.toString()) return;
3286
3301
  const k = Array.from(s.cards), [M] = k.splice(parseInt(f), 1);
3287
3302
  k.splice(v, 0, M), o({ ...s, cards: k });
3288
3303
  };
3289
- function N(h, v) {
3290
- return h.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || h.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3304
+ function N(x, v) {
3305
+ return x.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || x.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3291
3306
  "div",
3292
3307
  {
3293
3308
  onClick: () => {
3294
3309
  const f = v.displayTab === void 0 ? !1 : !v.displayTab;
3295
- d({ ...v, displayTab: f }), p({
3310
+ c({ ...v, displayTab: f }), p({
3296
3311
  ...v,
3297
3312
  displayTab: f
3298
3313
  });
3299
3314
  },
3300
- children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3315
+ children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Tn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3301
3316
  }
3302
3317
  );
3303
3318
  }
@@ -3305,50 +3320,50 @@ function ta() {
3305
3320
  return /* @__PURE__ */ e.jsxs(
3306
3321
  va,
3307
3322
  {
3308
- onValueChange: C,
3323
+ onValueChange: y,
3309
3324
  value: s.activeCardId,
3310
3325
  className: "flex grow flex-col",
3311
3326
  children: [
3312
- s.cards.map((h) => /* @__PURE__ */ e.jsx(is, { className: "mt-0 grow", value: h.id, children: L() }, h.id)),
3327
+ s.cards.map((x) => /* @__PURE__ */ e.jsx(is, { className: "mt-0 grow", value: x.id, children: L() }, x.id)),
3313
3328
  /* @__PURE__ */ e.jsx(Ca, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3314
- s.cards.map((h, v) => /* @__PURE__ */ e.jsx(
3329
+ s.cards.map((x, v) => /* @__PURE__ */ e.jsx(
3315
3330
  ls,
3316
3331
  {
3317
- text: h.tabTitle || h.title,
3332
+ text: x.tabTitle || x.title,
3318
3333
  onSave: (f) => {
3319
- d({ ...t, tabTitle: f }), p({ ...t, tabTitle: f });
3334
+ c({ ...t, tabTitle: f }), p({ ...t, tabTitle: f });
3320
3335
  },
3321
3336
  children: /* @__PURE__ */ e.jsxs(
3322
3337
  rs,
3323
3338
  {
3324
3339
  draggable: !0,
3325
3340
  onDragStart: (f) => T(f, v),
3326
- onDragOver: F,
3341
+ onDragOver: I,
3327
3342
  onDrop: (f) => A(f, v),
3328
3343
  className: "",
3329
- value: h.id,
3344
+ value: x.id,
3330
3345
  children: [
3331
- N(s, h),
3332
- h.tabTitle || h.title,
3333
- s.activeCardId === h.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3346
+ N(s, x),
3347
+ x.tabTitle || x.title,
3348
+ s.activeCardId === x.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3334
3349
  Sa,
3335
3350
  {
3336
3351
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
3337
- onClick: () => I(h.id)
3352
+ onClick: () => F(x.id)
3338
3353
  }
3339
3354
  )
3340
3355
  ]
3341
3356
  }
3342
3357
  )
3343
3358
  },
3344
- h.id
3359
+ x.id
3345
3360
  )),
3346
3361
  /* @__PURE__ */ e.jsx(
3347
3362
  O,
3348
3363
  {
3349
3364
  className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
3350
3365
  variant: "outline",
3351
- onClick: x,
3366
+ onClick: h,
3352
3367
  children: /* @__PURE__ */ e.jsx(Ds, { className: "h-4 w-4" })
3353
3368
  }
3354
3369
  ),
@@ -3357,8 +3372,8 @@ function ta() {
3357
3372
  {
3358
3373
  className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
3359
3374
  variant: "outline",
3360
- onClick: b,
3361
- children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4" })
3375
+ onClick: C,
3376
+ children: /* @__PURE__ */ e.jsx(On, { className: "h-4 w-4" })
3362
3377
  }
3363
3378
  )
3364
3379
  ] }) })
@@ -3367,8 +3382,8 @@ function ta() {
3367
3382
  );
3368
3383
  }
3369
3384
  function L() {
3370
- return t.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(Kt, { card: t, data: u == null ? void 0 : u.records }) }) }) : t.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(We, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3371
- Wt,
3385
+ return t.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(Wt, { card: t, data: u == null ? void 0 : u.records }) }) }) : t.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(qe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3386
+ Yt,
3372
3387
  {
3373
3388
  isLoading: n,
3374
3389
  card: t,
@@ -3377,46 +3392,39 @@ function ta() {
3377
3392
  ) }) }) }) : /* @__PURE__ */ e.jsx(us, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ra, { className: "grow border-none shadow-none" }) });
3378
3393
  }
3379
3394
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
3380
- (y || g) && /* @__PURE__ */ e.jsx(Ve, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3395
+ (b || g) && /* @__PURE__ */ e.jsx(Ve, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
3381
3396
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3382
3397
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3383
- /* @__PURE__ */ e.jsx(kl, {}),
3384
- !["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(Nl, {}),
3385
- /* @__PURE__ */ e.jsx(Ol, {})
3398
+ /* @__PURE__ */ e.jsx(zl, {}),
3399
+ !["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(Sl, {}),
3400
+ /* @__PURE__ */ e.jsx(Fl, {})
3386
3401
  ] }),
3387
- /* @__PURE__ */ e.jsx(Il, {})
3402
+ /* @__PURE__ */ e.jsx(Dl, {})
3388
3403
  ] }),
3389
3404
  a ? S() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
3390
- c && /* @__PURE__ */ e.jsx(Fl, {}),
3391
- (u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(vl, { data: (u == null ? void 0 : u.records) || [] }),
3392
- l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
3405
+ d && /* @__PURE__ */ e.jsx(Il, {}),
3406
+ (u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(Cl, { data: (u == null ? void 0 : u.records) || [] }),
3407
+ l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: l })
3393
3408
  ] })
3394
3409
  ] });
3395
3410
  }
3396
- function Fl() {
3411
+ function Il() {
3397
3412
  const s = m((a) => a.pythonStdOut);
3398
3413
  if (!s) return null;
3399
3414
  const t = s.replace(/\n/g, "<br>");
3400
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3401
- /* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm", children: "Output:" }),
3402
- /* @__PURE__ */ e.jsx(
3403
- "div",
3404
- {
3405
- dangerouslySetInnerHTML: { __html: t },
3406
- className: "bg-muted p-2 font-mono text-sm"
3407
- }
3408
- ),
3409
- /* @__PURE__ */ e.jsx(ge, { className: "mb-2" })
3415
+ return /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col border-r", children: [
3416
+ /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center border-b bg-muted px-3 font-mono text-xs", children: "Python Output" }),
3417
+ /* @__PURE__ */ e.jsx(qe, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: /* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: t } }) })
3410
3418
  ] });
3411
3419
  }
3412
- function Il() {
3420
+ function Dl() {
3413
3421
  const s = m((a) => a.isShowingVisual), t = m(
3414
3422
  (a) => a.actions.setIsShowingVisual
3415
3423
  );
3416
3424
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3417
3425
  /* @__PURE__ */ e.jsx(R, { htmlFor: "visualize", children: "Chart" }),
3418
3426
  /* @__PURE__ */ e.jsx(
3419
- Yt,
3427
+ Xt,
3420
3428
  {
3421
3429
  checked: s,
3422
3430
  onCheckedChange: () => t(!s),
@@ -3426,7 +3434,7 @@ function Il() {
3426
3434
  )
3427
3435
  ] });
3428
3436
  }
3429
- function Dl({
3437
+ function Tl({
3430
3438
  options: s,
3431
3439
  value: t,
3432
3440
  onValueChange: a
@@ -3460,13 +3468,13 @@ function ue({
3460
3468
  children: /* @__PURE__ */ e.jsx(xe, { placeholder: s })
3461
3469
  }
3462
3470
  ),
3463
- /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3471
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
3464
3472
  /* @__PURE__ */ e.jsx(fe, { children: s }),
3465
- t.map((c) => /* @__PURE__ */ e.jsx(K, { value: c.value, children: c.label }, c.value))
3473
+ t.map((d) => /* @__PURE__ */ e.jsx(K, { value: d.value, children: d.label }, d.value))
3466
3474
  ] }) })
3467
3475
  ] });
3468
3476
  }
3469
- function Ge({
3477
+ function Qe({
3470
3478
  children: s,
3471
3479
  summary: t,
3472
3480
  open: a,
@@ -3480,27 +3488,27 @@ function Ge({
3480
3488
  children: [
3481
3489
  /* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
3482
3490
  /* @__PURE__ */ e.jsx(R, { children: t }),
3483
- /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4" })
3491
+ /* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4" })
3484
3492
  ] }),
3485
3493
  /* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
3486
3494
  ]
3487
3495
  }
3488
3496
  );
3489
3497
  }
3490
- function Tl() {
3491
- var b, I;
3498
+ function Ll() {
3499
+ var C, F;
3492
3500
  const s = m(
3493
- (C) => C.card.customCardPreferences
3494
- ), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((C) => C.card), l = m((C) => C.frame), c = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = re(), { components: o, manifest: d } = ja(
3501
+ (y) => y.card.customCardPreferences
3502
+ ), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((y) => y.card), l = m((y) => y.frame), d = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = re(), { components: o, manifest: c } = ja(
3495
3503
  (s == null ? void 0 : s.url) || ""
3496
- ), p = (b = d == null ? void 0 : d.visuals) == null ? void 0 : b.find(
3497
- (C) => C.name === (s == null ? void 0 : s.componentName)
3504
+ ), p = (C = c == null ? void 0 : c.visuals) == null ? void 0 : C.find(
3505
+ (y) => y.name === (s == null ? void 0 : s.componentName)
3498
3506
  );
3499
- function u(C, T) {
3507
+ function u(y, T) {
3500
3508
  if (!s) return;
3501
3509
  const A = {
3502
3510
  ...(s == null ? void 0 : s.dataInputCardIds) || {},
3503
- [C]: {
3511
+ [y]: {
3504
3512
  cardId: T,
3505
3513
  hookRef: null
3506
3514
  }
@@ -3510,17 +3518,17 @@ function Tl() {
3510
3518
  dataInputCardIds: A
3511
3519
  });
3512
3520
  }
3513
- function y(C) {
3514
- var F, A;
3515
- const T = (F = l == null ? void 0 : l.cards) == null ? void 0 : F.filter((N) => {
3521
+ function b(y) {
3522
+ var I, A;
3523
+ const T = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((N) => {
3516
3524
  var S;
3517
3525
  return ((S = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : S.visualType) !== "multiple";
3518
3526
  }).map((N) => ({
3519
3527
  value: N.id,
3520
3528
  label: N.tabTitle || N.title
3521
3529
  }));
3522
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = C == null ? void 0 : C.dataInputs) == null ? void 0 : A.map((N, S) => {
3523
- var L, h;
3530
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = y == null ? void 0 : y.dataInputs) == null ? void 0 : A.map((N, S) => {
3531
+ var L, x;
3524
3532
  return /* @__PURE__ */ e.jsxs(
3525
3533
  "div",
3526
3534
  {
@@ -3533,7 +3541,7 @@ function Tl() {
3533
3541
  className: "col-span-6 h-8 w-full justify-between",
3534
3542
  label: "",
3535
3543
  options: T || [],
3536
- value: ((h = (L = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : L[S]) == null ? void 0 : h.cardId) || "",
3544
+ value: ((x = (L = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : L[S]) == null ? void 0 : x.cardId) || "",
3537
3545
  onValueChange: (v) => u(S, v)
3538
3546
  }
3539
3547
  )
@@ -3543,12 +3551,12 @@ function Tl() {
3543
3551
  );
3544
3552
  }) });
3545
3553
  }
3546
- function g(C, T, F = []) {
3554
+ function g(y, T, I = []) {
3547
3555
  var A, N;
3548
- return s ? C === "input" ? /* @__PURE__ */ e.jsx(
3556
+ return s ? y === "input" ? /* @__PURE__ */ e.jsx(
3549
3557
  le,
3550
3558
  {
3551
- className: `h-8 w-full ${Be}`,
3559
+ className: `h-8 w-full ${Ue}`,
3552
3560
  value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[T]) || "",
3553
3561
  onChange: (S) => {
3554
3562
  r({
@@ -3561,12 +3569,12 @@ function Tl() {
3561
3569
  }
3562
3570
  },
3563
3571
  T
3564
- ) : C === "select" ? /* @__PURE__ */ e.jsx(
3572
+ ) : y === "select" ? /* @__PURE__ */ e.jsx(
3565
3573
  ue,
3566
3574
  {
3567
3575
  className: "h-8 w-full",
3568
3576
  label: "",
3569
- options: F,
3577
+ options: I,
3570
3578
  value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[T]) || "",
3571
3579
  onValueChange: (S) => {
3572
3580
  r({
@@ -3577,21 +3585,21 @@ function Tl() {
3577
3585
  }
3578
3586
  ) : null : null;
3579
3587
  }
3580
- function x(C) {
3581
- const T = Object.entries((C == null ? void 0 : C.settings) || {});
3582
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: T.map(([F, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3588
+ function h(y) {
3589
+ const T = Object.entries((y == null ? void 0 : y.settings) || {});
3590
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: T.map(([I, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3583
3591
  /* @__PURE__ */ e.jsx(R, { children: A.title }),
3584
3592
  g(
3585
3593
  A.ui,
3586
- F,
3594
+ I,
3587
3595
  A.options
3588
3596
  )
3589
- ] }, F)) });
3597
+ ] }, I)) });
3590
3598
  }
3591
- function j(C) {
3599
+ function j(y) {
3592
3600
  s && r({
3593
3601
  ...s,
3594
- visualType: C,
3602
+ visualType: y,
3595
3603
  componentName: ""
3596
3604
  });
3597
3605
  }
@@ -3600,7 +3608,7 @@ function Tl() {
3600
3608
  {
3601
3609
  className: "p-6",
3602
3610
  children: [
3603
- /* @__PURE__ */ e.jsx(Ge, { 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: [
3611
+ /* @__PURE__ */ e.jsx(Qe, { 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: [
3604
3612
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
3605
3613
  ue,
3606
3614
  {
@@ -3608,23 +3616,23 @@ function Tl() {
3608
3616
  label: "",
3609
3617
  options: a,
3610
3618
  value: (s == null ? void 0 : s.url) || "",
3611
- onValueChange: (C) => r({
3619
+ onValueChange: (y) => r({
3612
3620
  ...s || {
3613
3621
  url: "",
3614
3622
  componentName: ""
3615
3623
  },
3616
- url: C
3624
+ url: y
3617
3625
  })
3618
3626
  }
3619
3627
  ) }) }),
3620
3628
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
3621
- Dl,
3629
+ Tl,
3622
3630
  {
3623
3631
  options: [
3624
3632
  { value: "single", label: "Single Visual" },
3625
3633
  { value: "multiple", label: "Multi-Visual" }
3626
3634
  ],
3627
- value: c,
3635
+ value: d,
3628
3636
  onValueChange: j
3629
3637
  }
3630
3638
  ),
@@ -3636,29 +3644,29 @@ function Tl() {
3636
3644
  className: "h-8 w-full",
3637
3645
  label: "",
3638
3646
  options: (o == null ? void 0 : o.filter(
3639
- (C) => C.type === c
3640
- ).map((C) => ({
3641
- value: C.name,
3642
- label: C.name
3647
+ (y) => y.type === d
3648
+ ).map((y) => ({
3649
+ value: y.name,
3650
+ label: y.name
3643
3651
  }))) || [],
3644
3652
  value: s.componentName,
3645
- onValueChange: (C) => {
3646
- console.log("changing value", C), r({
3653
+ onValueChange: (y) => {
3654
+ console.log("changing value", y), r({
3647
3655
  ...s,
3648
- componentName: C
3656
+ componentName: y
3649
3657
  });
3650
3658
  }
3651
3659
  }
3652
3660
  ) })
3653
3661
  ] }) })
3654
3662
  ] }) }) }),
3655
- /* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
3656
- ((I = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : I.componentName) && /* @__PURE__ */ e.jsxs(Ge, { summary: "Component Settings", children: [
3663
+ /* @__PURE__ */ e.jsx(Se, { className: "my-4" }),
3664
+ ((F = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : F.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
3657
3665
  p && p.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3658
3666
  /* @__PURE__ */ e.jsx(R, { children: "Input Mapping" }),
3659
- /* @__PURE__ */ e.jsx("div", { className: "px-2", children: y(p) })
3667
+ /* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(p) })
3660
3668
  ] }),
3661
- p && p.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: x(p) }) })
3669
+ p && p.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: h(p) }) })
3662
3670
  ] })
3663
3671
  ]
3664
3672
  }
@@ -3669,20 +3677,20 @@ function Te() {
3669
3677
  m(
3670
3678
  (u) => u.card.cfg
3671
3679
  );
3672
- const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: c } = m((u) => u.actions), r = m(
3680
+ const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: d } = m((u) => u.actions), r = m(
3673
3681
  (u) => u.queryResultColumns
3674
3682
  );
3675
3683
  m(
3676
3684
  (u) => {
3677
- var y;
3678
- return (y = u.card.preferences) == null ? void 0 : y.filterOnClickColumnIndex;
3685
+ var b;
3686
+ return (b = u.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
3679
3687
  }
3680
3688
  ), Z(() => {
3681
3689
  r && t(new Array(r.length).fill(!1));
3682
3690
  }, [r]);
3683
- function o(u, y) {
3684
- var g, x;
3685
- y ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? c({
3691
+ function o(u, b) {
3692
+ var g, h;
3693
+ b ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? d({
3686
3694
  ...a,
3687
3695
  onClickFilter: [
3688
3696
  ...a.onClickFilter,
@@ -3691,7 +3699,7 @@ function Te() {
3691
3699
  expression: ""
3692
3700
  }
3693
3701
  ]
3694
- }) : c({
3702
+ }) : d({
3695
3703
  ...a,
3696
3704
  onClickFilter: [
3697
3705
  {
@@ -3699,35 +3707,35 @@ function Te() {
3699
3707
  expression: ""
3700
3708
  }
3701
3709
  ]
3702
- }) : (c({
3710
+ }) : (d({
3703
3711
  ...a,
3704
- onClickFilter: (x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.filter(
3712
+ onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
3705
3713
  (j) => j.columnIndex !== u
3706
3714
  )
3707
3715
  }), t((j) => {
3708
- const b = [...j];
3709
- return b[u] = !1, b;
3716
+ const C = [...j];
3717
+ return C[u] = !1, C;
3710
3718
  }));
3711
3719
  }
3712
- function d(u, y) {
3713
- var x;
3714
- const g = (x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.map((j) => j.columnIndex === u ? {
3720
+ function c(u, b) {
3721
+ var h;
3722
+ const g = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((j) => j.columnIndex === u ? {
3715
3723
  ...j,
3716
- expression: y.target.value
3724
+ expression: b.target.value
3717
3725
  } : j);
3718
- c({
3726
+ d({
3719
3727
  ...a,
3720
3728
  onClickFilter: g
3721
3729
  });
3722
3730
  }
3723
3731
  function p(u) {
3724
- var y, g, x, j;
3725
- if (s != null && s[u] || (g = (y = a == null ? void 0 : a.onClickFilter) == null ? void 0 : y.find((b) => b.columnIndex === u)) != null && g.expression)
3732
+ var b, g, h, j;
3733
+ if (s != null && s[u] || (g = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((C) => C.columnIndex === u)) != null && g.expression)
3726
3734
  return /* @__PURE__ */ e.jsx(
3727
3735
  le,
3728
3736
  {
3729
- value: (j = (x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.find((b) => b.columnIndex === u)) == null ? void 0 : j.expression,
3730
- onChange: (b) => d(u, b),
3737
+ value: (j = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((C) => C.columnIndex === u)) == null ? void 0 : j.expression,
3738
+ onChange: (C) => c(u, C),
3731
3739
  type: "text",
3732
3740
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3733
3741
  placeholder: "Expression"
@@ -3736,8 +3744,8 @@ function Te() {
3736
3744
  }
3737
3745
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3738
3746
  /* @__PURE__ */ e.jsx(R, { children: "On Click" }),
3739
- r == null ? void 0 : r.map((u, y) => {
3740
- var g, x;
3747
+ r == null ? void 0 : r.map((u, b) => {
3748
+ var g, h;
3741
3749
  return /* @__PURE__ */ e.jsx(
3742
3750
  "div",
3743
3751
  {
@@ -3748,9 +3756,9 @@ function Te() {
3748
3756
  Hs,
3749
3757
  {
3750
3758
  checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
3751
- (j) => j.columnIndex === y
3759
+ (j) => j.columnIndex === b
3752
3760
  )),
3753
- onCheckedChange: (j) => o(y, j)
3761
+ onCheckedChange: (j) => o(b, j)
3754
3762
  }
3755
3763
  ),
3756
3764
  /* @__PURE__ */ e.jsx(
@@ -3760,22 +3768,22 @@ function Te() {
3760
3768
  children: u
3761
3769
  }
3762
3770
  ),
3763
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.find(
3764
- (j) => j.columnIndex === y
3771
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
3772
+ (j) => j.columnIndex === b
3765
3773
  )) && /* @__PURE__ */ e.jsx(
3766
3774
  Ta,
3767
3775
  {
3768
3776
  onClick: () => {
3769
3777
  t((j) => {
3770
- const b = [...j];
3771
- return b[y] = !j[y], b;
3778
+ const C = [...j];
3779
+ return C[b] = !j[b], C;
3772
3780
  });
3773
3781
  },
3774
3782
  className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
3775
3783
  }
3776
3784
  ) })
3777
3785
  ] }),
3778
- p(y)
3786
+ p(b)
3779
3787
  ] })
3780
3788
  },
3781
3789
  u
@@ -3784,19 +3792,19 @@ function Te() {
3784
3792
  ] });
3785
3793
  }
3786
3794
  function fs() {
3787
- var r, o, d;
3795
+ var r, o, c;
3788
3796
  const s = m((p) => p.card.preferences), t = m(
3789
3797
  (p) => p.card.cfg
3790
3798
  ), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = m((p) => p.actions);
3791
3799
  (r = t == null ? void 0 : t.options) != null && r.indexAxis;
3792
- function c(p) {
3800
+ function d(p) {
3793
3801
  l(p);
3794
3802
  }
3795
3803
  return /* @__PURE__ */ e.jsxs(
3796
3804
  ps,
3797
3805
  {
3798
- value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((d = t == null ? void 0 : t.options) == null ? void 0 : d.indexAxis) || "x",
3799
- onValueChange: c,
3806
+ value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((c = t == null ? void 0 : t.options) == null ? void 0 : c.indexAxis) || "x",
3807
+ onValueChange: d,
3800
3808
  className: "flex gap-3",
3801
3809
  defaultValue: "x",
3802
3810
  children: [
@@ -3814,9 +3822,9 @@ function fs() {
3814
3822
  }
3815
3823
  const ts = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
3816
3824
  function na(s, t) {
3817
- var n, l, c;
3825
+ var n, l, d;
3818
3826
  const a = wa(s, t);
3819
- return ((c = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : c.type) || "linear";
3827
+ return ((d = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : d.type) || "linear";
3820
3828
  }
3821
3829
  function Wa() {
3822
3830
  var ie, W, ae, w, _, ee;
@@ -3826,25 +3834,25 @@ function Wa() {
3826
3834
  }), n = m((E) => {
3827
3835
  var D;
3828
3836
  return (D = E.card) == null ? void 0 : D.cfg;
3829
- }), l = wa(a, n), [c, r] = q(
3837
+ }), l = wa(a, n), [d, r] = q(
3830
3838
  na(a)
3831
- ), [o, d] = q(
3839
+ ), [o, c] = q(
3832
3840
  ((ae = (W = (ie = a == null ? void 0 : a.chartOptions) == null ? void 0 : ie.scales) == null ? void 0 : W[l]) == null ? void 0 : ae.min) || ""
3833
3841
  ), [p, u] = q(
3834
3842
  ((ee = (_ = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
3835
- ), [y, g] = q(o || p ? "custom" : "auto"), [x, j] = q(""), [b, I] = q(0), [C, T] = q(""), [F, A] = q(""), [N, S] = q(""), L = m(
3843
+ ), [b, g] = q(o || p ? "custom" : "auto"), [h, j] = q(""), [C, F] = q(0), [y, T] = q(""), [I, A] = q(""), [N, S] = q(""), L = m(
3836
3844
  (E) => E.actions.setCardPreferences
3837
- ), { updateCardInFrame: h } = re(), v = m((E) => E.card), f = m((E) => {
3845
+ ), { updateCardInFrame: x } = re(), v = m((E) => E.card), f = m((E) => {
3838
3846
  var D;
3839
3847
  return (D = E.card) == null ? void 0 : D.type;
3840
3848
  }), k = ["pie", "doughnut", "polarArea"].includes(f);
3841
3849
  Z(() => {
3842
- var E, D, se, $, X, te, Le, ze, be, ye, J, oe, ce, Oe;
3843
- r(na(a)), d(
3850
+ var E, D, se, $, X, te, Le, ze, je, be, J, oe, ce, Oe;
3851
+ r(na(a)), c(
3844
3852
  ((se = (D = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : D[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
3845
3853
  ), u(((te = (X = ($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales) == null ? void 0 : X[l]) == null ? void 0 : te.max) || ""), j(
3846
- ((ye = (be = (ze = (Le = a == null ? void 0 : a.chartOptions) == null ? void 0 : Le.scales) == null ? void 0 : ze[l]) == null ? void 0 : be.ticks) == null ? void 0 : ye.stepSize) || ""
3847
- ), I(((J = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : J.decimalPlaces) || 0), T(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), S(((Oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Oe.locale) || "");
3854
+ ((be = (je = (ze = (Le = a == null ? void 0 : a.chartOptions) == null ? void 0 : Le.scales) == null ? void 0 : ze[l]) == null ? void 0 : je.ticks) == null ? void 0 : be.stepSize) || ""
3855
+ ), F(((J = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : J.decimalPlaces) || 0), T(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), S(((Oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Oe.locale) || "");
3848
3856
  }, [s, a, l]);
3849
3857
  function M(E, D) {
3850
3858
  return D === "" || /^[0-9\b]+$/.test(D) ? Number(D) : Number(E);
@@ -3873,11 +3881,11 @@ function Wa() {
3873
3881
  /* @__PURE__ */ e.jsxs(
3874
3882
  me,
3875
3883
  {
3876
- value: F || "none",
3884
+ value: I || "none",
3877
3885
  onValueChange: (D) => A(D === "none" ? "" : D),
3878
3886
  children: [
3879
3887
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
3880
- /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3888
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
3881
3889
  /* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
3882
3890
  /* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }),
3883
3891
  E.map((D) => /* @__PURE__ */ e.jsx(K, { value: D, children: D }, D))
@@ -3893,7 +3901,7 @@ function Wa() {
3893
3901
  children: /* @__PURE__ */ e.jsx(xe, {})
3894
3902
  }
3895
3903
  ),
3896
- /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3904
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
3897
3905
  /* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
3898
3906
  os.map((D) => /* @__PURE__ */ e.jsx(K, { value: D.locale, children: D.locale }, D.locale))
3899
3907
  ] }) })
@@ -3904,8 +3912,8 @@ function Wa() {
3904
3912
  /* @__PURE__ */ e.jsx(
3905
3913
  le,
3906
3914
  {
3907
- value: b,
3908
- onChange: (D) => I(Number(D.target.value)),
3915
+ value: C,
3916
+ onChange: (D) => F(Number(D.target.value)),
3909
3917
  id: "format",
3910
3918
  className: `col-span-6 h-8 w-full tracking-wide ${ts}`
3911
3919
  }
@@ -3922,7 +3930,7 @@ function Wa() {
3922
3930
  {
3923
3931
  id: "min",
3924
3932
  value: o,
3925
- onChange: (E) => d((D) => M(D, E.target.value)),
3933
+ onChange: (E) => c((D) => M(D, E.target.value)),
3926
3934
  className: `col-span-1 h-8 w-full ${ts}`
3927
3935
  }
3928
3936
  ),
@@ -3941,7 +3949,7 @@ function Wa() {
3941
3949
  /* @__PURE__ */ e.jsx(
3942
3950
  le,
3943
3951
  {
3944
- value: x,
3952
+ value: h,
3945
3953
  onChange: (E) => j((D) => M(D, E.target.value)),
3946
3954
  id: "step-size",
3947
3955
  className: `col-span-1 h-8 w-full ${ts}`
@@ -3953,11 +3961,11 @@ function Wa() {
3953
3961
  function Y() {
3954
3962
  var $;
3955
3963
  let E = {};
3956
- y === "custom" && (E = {
3964
+ b === "custom" && (E = {
3957
3965
  min: o,
3958
3966
  max: p,
3959
3967
  ticks: {
3960
- stepSize: x
3968
+ stepSize: h
3961
3969
  }
3962
3970
  });
3963
3971
  const D = {
@@ -3968,15 +3976,15 @@ function Wa() {
3968
3976
  ...($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales,
3969
3977
  [l]: {
3970
3978
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3971
- type: c,
3972
- ...c === "linear" ? E : {}
3979
+ type: d,
3980
+ ...d === "linear" ? E : {}
3973
3981
  }
3974
3982
  }
3975
3983
  },
3976
3984
  numberAxisFormat: {
3977
- decimalPlaces: b,
3978
- suffix: C,
3979
- currency: F,
3985
+ decimalPlaces: C,
3986
+ suffix: y,
3987
+ currency: I,
3980
3988
  locale: N
3981
3989
  }
3982
3990
  };
@@ -3985,10 +3993,10 @@ function Wa() {
3985
3993
  ...v,
3986
3994
  preferences: D
3987
3995
  };
3988
- h(se);
3996
+ x(se);
3989
3997
  }
3990
3998
  return /* @__PURE__ */ e.jsxs(ms, { onOpenChange: (E) => t(E), children: [
3991
- /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Zt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3999
+ /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(en, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3992
4000
  /* @__PURE__ */ e.jsx(xs, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3993
4001
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3994
4002
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
@@ -4001,11 +4009,11 @@ function Wa() {
4001
4009
  me,
4002
4010
  {
4003
4011
  disabled: k,
4004
- value: c,
4012
+ value: d,
4005
4013
  onValueChange: (E) => r(E),
4006
4014
  children: [
4007
4015
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4008
- /* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(Se, { children: [
4016
+ /* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(Ne, { children: [
4009
4017
  /* @__PURE__ */ e.jsx(fe, { children: "Option" }),
4010
4018
  /* @__PURE__ */ e.jsx(K, { value: "linear", children: "Linear" }),
4011
4019
  /* @__PURE__ */ e.jsx(K, { value: "logarithmic", children: "Logarithmic" })
@@ -4014,14 +4022,14 @@ function Wa() {
4014
4022
  }
4015
4023
  )
4016
4024
  ] }),
4017
- c == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
4025
+ d == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
4018
4026
  /* @__PURE__ */ e.jsx(R, { htmlFor: "scale-option", children: "Setup" }),
4019
4027
  /* @__PURE__ */ e.jsxs(
4020
4028
  ps,
4021
4029
  {
4022
4030
  disabled: k,
4023
4031
  id: "scale-option",
4024
- value: y,
4032
+ value: b,
4025
4033
  onValueChange: (E) => g(E),
4026
4034
  className: "col-span-2 flex gap-3",
4027
4035
  defaultValue: "x",
@@ -4038,9 +4046,9 @@ function Wa() {
4038
4046
  }
4039
4047
  )
4040
4048
  ] }),
4041
- y === "custom" && c == "linear" && P(),
4049
+ b === "custom" && d == "linear" && P(),
4042
4050
  H(),
4043
- /* @__PURE__ */ e.jsx(en, {}),
4051
+ /* @__PURE__ */ e.jsx(sn, {}),
4044
4052
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
4045
4053
  O,
4046
4054
  {
@@ -4054,28 +4062,28 @@ function Wa() {
4054
4062
  ] }) })
4055
4063
  ] });
4056
4064
  }
4057
- function Ll({ idx: s }) {
4065
+ function Ml({ idx: s }) {
4058
4066
  var o;
4059
- const t = m((d) => {
4067
+ const t = m((c) => {
4060
4068
  var p;
4061
- return (p = d.card) == null ? void 0 : p.preferences;
4069
+ return (p = c.card) == null ? void 0 : p.preferences;
4062
4070
  }), a = m(
4063
- (d) => {
4071
+ (c) => {
4064
4072
  var p;
4065
- return (p = d.card.preferences) == null ? void 0 : p.datasetOptions;
4073
+ return (p = c.card.preferences) == null ? void 0 : p.datasetOptions;
4066
4074
  }
4067
4075
  ), n = m(
4068
- (d) => d.actions.setCardPreferences
4069
- ), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, c = a == null ? void 0 : a.find((d) => d.idx === s);
4070
- function r(d, p) {
4071
- (d === "end" || d === "start") && sn(an());
4076
+ (c) => c.actions.setCardPreferences
4077
+ ), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, d = a == null ? void 0 : a.find((c) => c.idx === s);
4078
+ function r(c, p) {
4079
+ (c === "end" || c === "start") && an(tn());
4072
4080
  const u = {
4073
- display: d !== "none",
4074
- align: d,
4075
- anchor: d,
4081
+ display: c !== "none",
4082
+ align: c,
4083
+ anchor: c,
4076
4084
  clamp: !0
4077
4085
  };
4078
- if (!c)
4086
+ if (!d)
4079
4087
  n({
4080
4088
  ...t,
4081
4089
  datasetOptions: [
@@ -4087,10 +4095,10 @@ function Ll({ idx: s }) {
4087
4095
  ]
4088
4096
  });
4089
4097
  else {
4090
- const y = { ...c };
4091
- y.datalabels = u;
4098
+ const b = { ...d };
4099
+ b.datalabels = u;
4092
4100
  const g = a == null ? void 0 : a.map(
4093
- (x) => x.idx === p ? y : x
4101
+ (h) => h.idx === p ? b : h
4094
4102
  );
4095
4103
  n({
4096
4104
  ...t,
@@ -4099,7 +4107,7 @@ function Ll({ idx: s }) {
4099
4107
  }
4100
4108
  }
4101
4109
  return /* @__PURE__ */ e.jsxs(ms, { children: [
4102
- /* @__PURE__ */ e.jsx(hs, { children: /* @__PURE__ */ e.jsx(Jn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4110
+ /* @__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" }) }),
4103
4111
  /* @__PURE__ */ e.jsx(xs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4104
4112
  /* @__PURE__ */ e.jsx(
4105
4113
  O,
@@ -4119,7 +4127,7 @@ function Ll({ idx: s }) {
4119
4127
  variant: "secondary",
4120
4128
  className: "h-7 p-1 text-xs font-normal",
4121
4129
  children: /* @__PURE__ */ e.jsx(
4122
- Vn,
4130
+ qn,
4123
4131
  {
4124
4132
  className: Q("h-4 w-4", {
4125
4133
  "rotate-90": l === "y"
@@ -4136,7 +4144,7 @@ function Ll({ idx: s }) {
4136
4144
  variant: "secondary",
4137
4145
  className: "h-7 p-1 text-xs font-normal",
4138
4146
  children: /* @__PURE__ */ e.jsx(
4139
- Rn,
4147
+ _n,
4140
4148
  {
4141
4149
  className: Q("h-4 w-4", {
4142
4150
  "rotate-90": l === "y"
@@ -4153,7 +4161,7 @@ function Ll({ idx: s }) {
4153
4161
  variant: "secondary",
4154
4162
  className: "h-7 p-1 text-xs font-normal",
4155
4163
  children: /* @__PURE__ */ e.jsx(
4156
- qn,
4164
+ Rn,
4157
4165
  {
4158
4166
  className: Q("h-4 w-4", {
4159
4167
  "rotate-90": l === "y"
@@ -4168,25 +4176,25 @@ function Ll({ idx: s }) {
4168
4176
  function Ya() {
4169
4177
  const s = m((p) => p.card), t = m(
4170
4178
  (p) => {
4171
- var u, y, g;
4172
- return (g = (y = (u = p == null ? void 0 : p.card) == null ? void 0 : u.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : g.indexAxis;
4179
+ var u, b, g;
4180
+ return (g = (b = (u = p == null ? void 0 : p.card) == null ? void 0 : u.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : g.indexAxis;
4173
4181
  }
4174
- ), { data: a } = qe(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
4175
- keys: c,
4182
+ ), { data: a } = Re(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
4183
+ keys: d,
4176
4184
  metricKeys: r,
4177
4185
  dimensionKeys: o
4178
4186
  } = vs((a == null ? void 0 : a.records) || []);
4179
- let d = r;
4187
+ let c = r;
4180
4188
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4181
- const p = tn({
4189
+ const p = nn({
4182
4190
  dataArray: (a == null ? void 0 : a.records) || [],
4183
4191
  groupKey: o[0],
4184
4192
  pivotKey: o[1],
4185
- valueKey: d[0]
4193
+ valueKey: c[0]
4186
4194
  }), { metricKeys: u } = vs(p);
4187
- d = u;
4195
+ c = u;
4188
4196
  }
4189
- return c.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4197
+ return d.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4190
4198
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4191
4199
  /* @__PURE__ */ e.jsx(R, { children: n }),
4192
4200
  /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: o[0] }) }) })
@@ -4196,23 +4204,23 @@ function Ya() {
4196
4204
  /* @__PURE__ */ e.jsx(R, { children: l }),
4197
4205
  /* @__PURE__ */ e.jsx(Wa, {})
4198
4206
  ] }),
4199
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((p, u) => /* @__PURE__ */ e.jsx(Ml, { col: p, idx: u }, p)) })
4207
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((p, u) => /* @__PURE__ */ e.jsx(El, { col: p, idx: u }, p)) })
4200
4208
  ] })
4201
4209
  ] });
4202
4210
  }
4203
- function Ml({ col: s, idx: t }) {
4211
+ function El({ col: s, idx: t }) {
4204
4212
  const a = m((o) => {
4205
- var d;
4206
- return (d = o.card) == null ? void 0 : d.preferences;
4213
+ var c;
4214
+ return (c = o.card) == null ? void 0 : c.preferences;
4207
4215
  }), n = m(
4208
4216
  (o) => {
4209
- var d;
4210
- return (d = o.card.preferences) == null ? void 0 : d.datasetOptions;
4217
+ var c;
4218
+ return (c = o.card.preferences) == null ? void 0 : c.datasetOptions;
4211
4219
  }
4212
- ), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: c } = m((o) => o.actions);
4220
+ ), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: d } = m((o) => o.actions);
4213
4221
  function r(o) {
4214
4222
  if (!l)
4215
- c({
4223
+ d({
4216
4224
  ...a,
4217
4225
  datasetOptions: [
4218
4226
  ...n || [],
@@ -4224,12 +4232,12 @@ function Ml({ col: s, idx: t }) {
4224
4232
  ]
4225
4233
  });
4226
4234
  else {
4227
- const d = { ...l };
4228
- d.type = o === "area" ? "line" : o, d.fill = o === "area" ? "origin" : "";
4235
+ const c = { ...l };
4236
+ c.type = o === "area" ? "line" : o, c.fill = o === "area" ? "origin" : "";
4229
4237
  const p = n == null ? void 0 : n.map(
4230
- (u) => u.idx === t ? d : u
4238
+ (u) => u.idx === t ? c : u
4231
4239
  );
4232
- c({
4240
+ d({
4233
4241
  ...a,
4234
4242
  datasetOptions: p
4235
4243
  });
@@ -4253,43 +4261,43 @@ function Ml({ col: s, idx: t }) {
4253
4261
  }
4254
4262
  ),
4255
4263
  /* @__PURE__ */ e.jsx(
4256
- wn,
4264
+ kn,
4257
4265
  {
4258
4266
  onClick: () => r("area"),
4259
4267
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4260
4268
  }
4261
4269
  ),
4262
- /* @__PURE__ */ e.jsx(Ll, { idx: t })
4270
+ /* @__PURE__ */ e.jsx(Ml, { idx: t })
4263
4271
  ] })
4264
4272
  ] });
4265
4273
  }
4266
4274
  function Xa() {
4267
- const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName), c = z((g) => g.dashboard.filters) || [], r = z((g) => g.actions.addFilter), o = z((g) => g.actions.removeFilter), d = z(
4275
+ const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName), d = z((g) => g.dashboard.filters) || [], r = z((g) => g.actions.addFilter), o = z((g) => g.actions.removeFilter), c = z(
4268
4276
  (g) => g.actions.removeFilterValue
4269
- ), { modelItems: p, tableName: u } = Re();
4270
- function y(g, x = "dashboard") {
4277
+ ), { modelItems: p, tableName: u } = _e();
4278
+ function b(g, h = "dashboard") {
4271
4279
  var S;
4272
- const j = de(g.column_name), b = de(a || ""), I = de(n || ""), C = de(u);
4280
+ const j = de(g.column_name), C = de(a || ""), F = de(n || ""), y = de(u);
4273
4281
  let T = fa(
4274
- I,
4275
- C
4276
- ), F = `${T}.${j}`;
4282
+ F,
4283
+ y
4284
+ ), I = `${T}.${j}`;
4277
4285
  const A = (S = p == null ? void 0 : p.find(
4278
4286
  (L) => L.id === t
4279
4287
  )) == null ? void 0 : S.name;
4280
- t && t !== "none" && (F = `${ys}.${A}.${j}`, T = `${ys}.${A}`);
4281
- const N = c == null ? void 0 : c.find(
4282
- (L) => L.column === F && L.table === C && (L.database === b || L.database === a)
4288
+ t && t !== "none" && (I = `${ys}.${A}.${j}`, T = `${ys}.${A}`);
4289
+ const N = d == null ? void 0 : d.find(
4290
+ (L) => L.column === I && L.table === y && (L.database === C || L.database === a)
4283
4291
  );
4284
4292
  if (N)
4285
- d(N.id), o(N.id);
4293
+ c(N.id), o(N.id);
4286
4294
  else {
4287
- const L = Je();
4295
+ const L = Ke();
4288
4296
  return u === "api" && s ? (r({
4289
- location: x,
4297
+ location: h,
4290
4298
  id: L,
4291
4299
  //uuidv4(),
4292
- column: F,
4300
+ column: I,
4293
4301
  title: g.column_name,
4294
4302
  dataType: g.data_type,
4295
4303
  table: "api",
@@ -4306,8 +4314,8 @@ function Xa() {
4306
4314
  }), L) : (r({
4307
4315
  id: L,
4308
4316
  //uuidv4(),
4309
- location: x,
4310
- column: F,
4317
+ location: h,
4318
+ column: I,
4311
4319
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
4312
4320
  title: g.column_name,
4313
4321
  dataType: g.data_type,
@@ -4324,29 +4332,29 @@ function Xa() {
4324
4332
  }), L);
4325
4333
  }
4326
4334
  }
4327
- return { assignFilter: y };
4335
+ return { assignFilter: b };
4328
4336
  }
4329
- function _e() {
4337
+ function He() {
4330
4338
  const s = z(
4331
4339
  (o) => o.dashboard.filters
4332
- ), t = m((o) => o.frame), { setFrame: a } = re(), { columns: n } = Re(), { assignFilter: l } = Xa();
4333
- function c(o) {
4334
- const d = l(o, "frame");
4335
- a({ ...t, filterId: d });
4340
+ ), t = m((o) => o.frame), { setFrame: a } = re(), { columns: n } = _e(), { assignFilter: l } = Xa();
4341
+ function d(o) {
4342
+ const c = l(o, "frame");
4343
+ a({ ...t, filterId: c });
4336
4344
  }
4337
4345
  const r = s == null ? void 0 : s.find((o) => o.id === t.filterId);
4338
4346
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4339
4347
  /* @__PURE__ */ e.jsx(R, { children: "Card Filter" }),
4340
- /* @__PURE__ */ e.jsx(El, { onSelect: c, columns: n }),
4341
- r && /* @__PURE__ */ e.jsx(nn, { filter: r })
4348
+ /* @__PURE__ */ e.jsx(Al, { onSelect: d, columns: n }),
4349
+ r && /* @__PURE__ */ e.jsx(ln, { filter: r })
4342
4350
  ] });
4343
4351
  }
4344
- function El({
4352
+ function Al({
4345
4353
  columns: s,
4346
4354
  onSelect: t
4347
4355
  }) {
4348
4356
  var r;
4349
- const [a, n] = ea.useState(!1), [l, c] = ea.useState("");
4357
+ const [a, n] = ea.useState(!1), [l, d] = ea.useState("");
4350
4358
  return /* @__PURE__ */ e.jsxs(ms, { open: a, onOpenChange: n, children: [
4351
4359
  /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
4352
4360
  O,
@@ -4358,21 +4366,21 @@ function El({
4358
4366
  className: "w-full justify-between font-normal",
4359
4367
  children: [
4360
4368
  l ? (r = s.find((o) => o.column_name === l)) == null ? void 0 : r.column_name : "Select Column...",
4361
- /* @__PURE__ */ e.jsx(ln, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4369
+ /* @__PURE__ */ e.jsx(rn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4362
4370
  ]
4363
4371
  }
4364
4372
  ) }),
4365
- /* @__PURE__ */ e.jsx(xs, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(rn, { children: [
4366
- /* @__PURE__ */ e.jsx(on, { placeholder: "Search column", className: "h-9" }),
4367
- /* @__PURE__ */ e.jsxs(cn, { children: [
4368
- /* @__PURE__ */ e.jsx(dn, { children: "No framework found." }),
4369
- /* @__PURE__ */ e.jsx(un, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
4370
- mn,
4373
+ /* @__PURE__ */ e.jsx(xs, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(on, { children: [
4374
+ /* @__PURE__ */ e.jsx(cn, { placeholder: "Search column", className: "h-9" }),
4375
+ /* @__PURE__ */ e.jsxs(dn, { children: [
4376
+ /* @__PURE__ */ e.jsx(un, { children: "No framework found." }),
4377
+ /* @__PURE__ */ e.jsx(mn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
4378
+ hn,
4371
4379
  {
4372
4380
  value: o.column_name,
4373
- onSelect: (d) => {
4374
- const p = d === l ? "" : d;
4375
- c(p), n(!1), p && t(o);
4381
+ onSelect: (c) => {
4382
+ const p = c === l ? "" : c;
4383
+ d(p), n(!1), p && t(o);
4376
4384
  },
4377
4385
  children: [
4378
4386
  o.column_name,
@@ -4393,7 +4401,7 @@ function El({
4393
4401
  ] }) })
4394
4402
  ] });
4395
4403
  }
4396
- function Al({
4404
+ function Vl({
4397
4405
  cardType: s
4398
4406
  }) {
4399
4407
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
@@ -4433,19 +4441,19 @@ function Al({
4433
4441
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
4434
4442
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4435
4443
  /* @__PURE__ */ e.jsx(Te, {}),
4436
- /* @__PURE__ */ e.jsx(_e, {})
4444
+ /* @__PURE__ */ e.jsx(He, {})
4437
4445
  ] })
4438
4446
  ] })
4439
4447
  ] }) });
4440
4448
  }
4441
4449
  function Gs() {
4442
- var l, c, r;
4450
+ var l, d, r;
4443
4451
  const s = m(
4444
4452
  (o) => o.card.cfg
4445
4453
  ), t = m((o) => o.actions.setCardCfg), a = m((o) => o.card.type);
4446
4454
  function n(o) {
4447
4455
  var u;
4448
- const d = {
4456
+ const c = {
4449
4457
  datalabels: {
4450
4458
  display: o !== "none",
4451
4459
  align: o,
@@ -4458,7 +4466,7 @@ function Gs() {
4458
4466
  ...s == null ? void 0 : s.options,
4459
4467
  plugins: {
4460
4468
  ...(u = s == null ? void 0 : s.options) == null ? void 0 : u.plugins,
4461
- ...d
4469
+ ...c
4462
4470
  }
4463
4471
  }
4464
4472
  };
@@ -4472,12 +4480,12 @@ function Gs() {
4472
4480
  /* @__PURE__ */ e.jsxs(
4473
4481
  me,
4474
4482
  {
4475
- value: (r = (c = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : c.datalabels) == null ? void 0 : r.anchor,
4483
+ value: (r = (d = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : d.datalabels) == null ? void 0 : r.anchor,
4476
4484
  onValueChange: n,
4477
4485
  defaultValue: "none",
4478
4486
  children: [
4479
4487
  /* @__PURE__ */ e.jsx(he, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, { placeholder: "Select position" }) }),
4480
- /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4488
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
4481
4489
  /* @__PURE__ */ e.jsx(fe, { children: "Data Labels" }),
4482
4490
  /* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }),
4483
4491
  a !== "pyramid" && /* @__PURE__ */ e.jsx(K, { value: "start", children: "Start" }),
@@ -4489,7 +4497,7 @@ function Gs() {
4489
4497
  )
4490
4498
  ] });
4491
4499
  }
4492
- function Vl({
4500
+ function ql({
4493
4501
  cardType: s
4494
4502
  }) {
4495
4503
  function t(a) {
@@ -4508,7 +4516,7 @@ function Vl({
4508
4516
  "a",
4509
4517
  {
4510
4518
  target: "_blank",
4511
- onClick: (c) => c.stopPropagation(),
4519
+ onClick: (d) => d.stopPropagation(),
4512
4520
  className: "text-blue-700",
4513
4521
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
4514
4522
  children: "example"
@@ -4531,12 +4539,12 @@ function Vl({
4531
4539
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
4532
4540
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4533
4541
  /* @__PURE__ */ e.jsx(Te, {}),
4534
- /* @__PURE__ */ e.jsx(_e, {})
4542
+ /* @__PURE__ */ e.jsx(He, {})
4535
4543
  ] })
4536
4544
  ] })
4537
4545
  ] }) });
4538
4546
  }
4539
- const ql = {
4547
+ const Rl = {
4540
4548
  datasets: [
4541
4549
  {
4542
4550
  type: "line",
@@ -4549,7 +4557,7 @@ const ql = {
4549
4557
  data: []
4550
4558
  }
4551
4559
  ]
4552
- }, Rl = {
4560
+ }, _l = {
4553
4561
  datasets: [
4554
4562
  {
4555
4563
  fill: "origin",
@@ -4559,7 +4567,7 @@ const ql = {
4559
4567
  }
4560
4568
  ]
4561
4569
  };
4562
- function _l() {
4570
+ function Hl() {
4563
4571
  const s = m((t) => t.card.type);
4564
4572
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4565
4573
  /* @__PURE__ */ e.jsx(
@@ -4568,18 +4576,18 @@ function _l() {
4568
4576
  className: " ",
4569
4577
  type: "single",
4570
4578
  collapsible: !0,
4571
- children: Hl(s)
4579
+ children: $l(s)
4572
4580
  }
4573
4581
  ),
4574
4582
  /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(fs, {}) }),
4575
4583
  !["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4576
4584
  /* @__PURE__ */ e.jsx(Gs, {}),
4577
4585
  /* @__PURE__ */ e.jsx(Te, {}),
4578
- /* @__PURE__ */ e.jsx(_e, {})
4586
+ /* @__PURE__ */ e.jsx(He, {})
4579
4587
  ] })
4580
4588
  ] });
4581
4589
  }
4582
- function Hl(s) {
4590
+ function $l(s) {
4583
4591
  if (["line", "bar"].includes(s))
4584
4592
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4585
4593
  /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
@@ -4600,7 +4608,7 @@ function Hl(s) {
4600
4608
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
4601
4609
  " and change the `type` property in the dataset."
4602
4610
  ] }),
4603
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(ql, null, 2) })
4611
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Rl, null, 2) })
4604
4612
  ] })
4605
4613
  ] }),
4606
4614
  /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
@@ -4621,7 +4629,7 @@ function Hl(s) {
4621
4629
  ),
4622
4630
  "for more options."
4623
4631
  ] }),
4624
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Rl, null, 2) })
4632
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(_l, null, 2) })
4625
4633
  ] })
4626
4634
  ] })
4627
4635
  ] });
@@ -4676,53 +4684,53 @@ function Hl(s) {
4676
4684
  ] })
4677
4685
  ] }) });
4678
4686
  }
4679
- function $l() {
4680
- var d, p, u, y, g;
4681
- const s = m((x) => x.card.preferences), t = m(
4682
- (x) => x.actions.setCardPreferences
4687
+ function Pl() {
4688
+ var c, p, u, b, g;
4689
+ const s = m((h) => h.card.preferences), t = m(
4690
+ (h) => h.actions.setCardPreferences
4683
4691
  ), a = m(
4684
- (x) => x.actions.setNumberFormat
4692
+ (h) => h.actions.setNumberFormat
4685
4693
  );
4686
4694
  m(
4687
- (x) => {
4688
- var j, b;
4689
- return (b = (j = x.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : b.decimalPlaces;
4695
+ (h) => {
4696
+ var j, C;
4697
+ return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.decimalPlaces;
4690
4698
  }
4691
4699
  );
4692
4700
  const n = m(
4693
- (x) => {
4694
- var j, b;
4695
- return (b = (j = x.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : b.locale;
4701
+ (h) => {
4702
+ var j, C;
4703
+ return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.locale;
4696
4704
  }
4697
4705
  ), l = m(
4698
- (x) => {
4699
- var j, b;
4700
- return (b = (j = x.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : b.currency;
4706
+ (h) => {
4707
+ var j, C;
4708
+ return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.currency;
4701
4709
  }
4702
4710
  );
4703
4711
  m(
4704
- (x) => x.actions.setFilterOnClickField
4712
+ (h) => h.actions.setFilterOnClickField
4705
4713
  );
4706
- const c = m(
4707
- (x) => {
4708
- var j, b;
4709
- return (b = (j = x.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : b.colorRanges;
4714
+ const d = m(
4715
+ (h) => {
4716
+ var j, C;
4717
+ return (C = (j = h.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : C.colorRanges;
4710
4718
  }
4711
4719
  ) || [], r = m(
4712
- (x) => x.actions.setColorRanges
4713
- ), o = [...new Set(os.map((x) => x.currency))];
4720
+ (h) => h.actions.setColorRanges
4721
+ ), o = [...new Set(os.map((h) => h.currency))];
4714
4722
  return /* @__PURE__ */ e.jsxs("div", { children: [
4715
4723
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
4716
4724
  /* @__PURE__ */ e.jsx(
4717
4725
  Hs,
4718
4726
  {
4719
- checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
4720
- onCheckedChange: (x) => {
4727
+ checked: !!((c = s == null ? void 0 : s.formatNumber) != null && c.enabled),
4728
+ onCheckedChange: (h) => {
4721
4729
  t({
4722
4730
  ...s,
4723
4731
  formatNumber: {
4724
4732
  ...s == null ? void 0 : s.formatNumber,
4725
- enabled: x
4733
+ enabled: h
4726
4734
  }
4727
4735
  });
4728
4736
  }
@@ -4739,21 +4747,21 @@ function $l() {
4739
4747
  me,
4740
4748
  {
4741
4749
  value: n || "none",
4742
- onValueChange: (x) => {
4743
- var j, b, I;
4750
+ onValueChange: (h) => {
4751
+ var j, C, F;
4744
4752
  return a(
4745
4753
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
4746
- ((b = s == null ? void 0 : s.formatNumber) == null ? void 0 : b.currency) || "",
4747
- x,
4748
- ((I = s == null ? void 0 : s.formatNumber) == null ? void 0 : I.suffix) || ""
4754
+ ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.currency) || "",
4755
+ h,
4756
+ ((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
4749
4757
  );
4750
4758
  },
4751
4759
  children: [
4752
4760
  /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4753
- /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4761
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
4754
4762
  /* @__PURE__ */ e.jsx(fe, { children: "Format" }),
4755
4763
  /* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
4756
- os.map((x) => /* @__PURE__ */ e.jsx(K, { value: x.locale, children: x.locale }, x.locale))
4764
+ os.map((h) => /* @__PURE__ */ e.jsx(K, { value: h.locale, children: h.locale }, h.locale))
4757
4765
  ] }) })
4758
4766
  ]
4759
4767
  }
@@ -4765,21 +4773,21 @@ function $l() {
4765
4773
  me,
4766
4774
  {
4767
4775
  value: l || "none",
4768
- onValueChange: (x) => {
4769
- var j, b, I;
4770
- console.log("currency", x), a(
4776
+ onValueChange: (h) => {
4777
+ var j, C, F;
4778
+ console.log("currency", h), a(
4771
4779
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
4772
- x === "none" ? "" : x,
4773
- ((b = s == null ? void 0 : s.formatNumber) == null ? void 0 : b.locale) || "",
4774
- ((I = s == null ? void 0 : s.formatNumber) == null ? void 0 : I.suffix) || ""
4780
+ h === "none" ? "" : h,
4781
+ ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.locale) || "",
4782
+ ((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
4775
4783
  );
4776
4784
  },
4777
4785
  children: [
4778
4786
  /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4779
- /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4787
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
4780
4788
  /* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
4781
4789
  /* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
4782
- o.map((x) => /* @__PURE__ */ e.jsx(K, { value: x, children: x }, x))
4790
+ o.map((h) => /* @__PURE__ */ e.jsx(K, { value: h, children: h }, h))
4783
4791
  ] }) })
4784
4792
  ]
4785
4793
  }
@@ -4792,19 +4800,19 @@ function $l() {
4792
4800
  /* @__PURE__ */ e.jsxs(
4793
4801
  me,
4794
4802
  {
4795
- value: ((y = (u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) == null ? void 0 : y.toString()) || "0",
4796
- onValueChange: (x) => {
4797
- var j, b, I;
4803
+ value: ((b = (u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) == null ? void 0 : b.toString()) || "0",
4804
+ onValueChange: (h) => {
4805
+ var j, C, F;
4798
4806
  return a(
4799
- Number(x),
4807
+ Number(h),
4800
4808
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
4801
- ((b = s == null ? void 0 : s.formatNumber) == null ? void 0 : b.locale) || "",
4802
- ((I = s == null ? void 0 : s.formatNumber) == null ? void 0 : I.suffix) || ""
4809
+ ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.locale) || "",
4810
+ ((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.suffix) || ""
4803
4811
  );
4804
4812
  },
4805
4813
  children: [
4806
4814
  /* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4807
- /* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((x) => /* @__PURE__ */ e.jsx(K, { value: x, children: x }, x)) })
4815
+ /* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(K, { value: h, children: h }, h)) })
4808
4816
  ]
4809
4817
  }
4810
4818
  )
@@ -4817,13 +4825,13 @@ function $l() {
4817
4825
  value: ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || "",
4818
4826
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
4819
4827
  placeholder: "K, M, B, %",
4820
- onChange: (x) => {
4821
- var j, b, I;
4828
+ onChange: (h) => {
4829
+ var j, C, F;
4822
4830
  return a(
4823
4831
  ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.decimalPlaces) || 0,
4824
- ((b = s == null ? void 0 : s.formatNumber) == null ? void 0 : b.currency) || "",
4825
- ((I = s == null ? void 0 : s.formatNumber) == null ? void 0 : I.locale) || "",
4826
- x.target.value
4832
+ ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.currency) || "",
4833
+ ((F = s == null ? void 0 : s.formatNumber) == null ? void 0 : F.locale) || "",
4834
+ h.target.value
4827
4835
  );
4828
4836
  }
4829
4837
  }
@@ -4831,18 +4839,18 @@ function $l() {
4831
4839
  ] })
4832
4840
  ] })
4833
4841
  ] }) }),
4834
- /* @__PURE__ */ e.jsx(ge, { className: "my-3" }),
4842
+ /* @__PURE__ */ e.jsx(Se, { className: "my-3" }),
4835
4843
  /* @__PURE__ */ e.jsx(
4836
- hn,
4844
+ xn,
4837
4845
  {
4838
- colorRanges: c,
4846
+ colorRanges: d,
4839
4847
  setColorRanges: r
4840
4848
  }
4841
4849
  )
4842
4850
  ] })
4843
4851
  ] });
4844
4852
  }
4845
- function Pl() {
4853
+ function Bl() {
4846
4854
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4847
4855
  /* @__PURE__ */ e.jsx(De, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
4848
4856
  /* @__PURE__ */ e.jsx(U, { className: "", children: "KPI Query" }),
@@ -4868,12 +4876,12 @@ function Pl() {
4868
4876
  ] })
4869
4877
  ] })
4870
4878
  ] }) }),
4871
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx($l, {}) }),
4879
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Pl, {}) }),
4872
4880
  /* @__PURE__ */ e.jsx("div", {}),
4873
4881
  /* @__PURE__ */ e.jsx("div", {})
4874
4882
  ] });
4875
4883
  }
4876
- const Bl = [
4884
+ const Ul = [
4877
4885
  {
4878
4886
  label: "Mercator",
4879
4887
  value: "mercator"
@@ -4930,7 +4938,7 @@ const Bl = [
4930
4938
  label: "Natural Earth 1",
4931
4939
  value: "naturalEarth1"
4932
4940
  }
4933
- ], Ul = [
4941
+ ], Gl = [
4934
4942
  "blues",
4935
4943
  "brBG",
4936
4944
  "buGn",
@@ -4969,15 +4977,15 @@ const Bl = [
4969
4977
  "ylGnBu",
4970
4978
  "ylOrBr",
4971
4979
  "ylOrRd"
4972
- ], Gl = Ul.map((s) => ({
4980
+ ], Ql = Gl.map((s) => ({
4973
4981
  label: s,
4974
4982
  value: s
4975
4983
  }));
4976
- function Ql() {
4977
- var d, p, u, y, g, x, j, b, I, C, T, F, A, N, S, L, h, v;
4978
- const s = m((f) => f.card), t = (p = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, n] = q(
4979
- ((y = (u = s == null ? void 0 : s.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
4980
- ), { setCardPreferences: l } = re(), { data: c } = _s(s), r = Object.keys((c == null ? void 0 : c.objects) || {}).map((f) => ({
4984
+ function Jl() {
4985
+ var c, p, u, b, g, h, j, C, F, y, T, I, A, N, S, L, x, v;
4986
+ const s = m((f) => f.card), t = (p = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, n] = q(
4987
+ ((b = (u = s == null ? void 0 : s.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
4988
+ ), { setCardPreferences: l } = re(), { data: d } = _s(s), r = Object.keys((d == null ? void 0 : d.objects) || {}).map((f) => ({
4981
4989
  label: f,
4982
4990
  value: f
4983
4991
  })) || [], o = [
@@ -4995,9 +5003,9 @@ function Ql() {
4995
5003
  }
4996
5004
  ];
4997
5005
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
4998
- /* @__PURE__ */ e.jsx(Ge, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
4999
- /* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
5000
- /* @__PURE__ */ e.jsx(Ge, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5006
+ /* @__PURE__ */ e.jsx(Qe, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
5007
+ /* @__PURE__ */ e.jsx(Se, { className: "my-4" }),
5008
+ /* @__PURE__ */ e.jsx(Qe, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5001
5009
  /* @__PURE__ */ e.jsx(
5002
5010
  ue,
5003
5011
  {
@@ -5033,11 +5041,11 @@ function Ql() {
5033
5041
  });
5034
5042
  },
5035
5043
  value: a,
5036
- className: `h-9 w-full ${Be}`,
5044
+ className: `h-9 w-full ${Ue}`,
5037
5045
  placeholder: "Custom URL"
5038
5046
  }
5039
5047
  ),
5040
- c && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
5048
+ d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
5041
5049
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
5042
5050
  /* @__PURE__ */ e.jsx(R, { children: "Map Object" }),
5043
5051
  /* @__PURE__ */ e.jsx(
@@ -5045,7 +5053,7 @@ function Ql() {
5045
5053
  {
5046
5054
  className: "h-9",
5047
5055
  options: r,
5048
- value: ((x = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : x.objectKey) || "",
5056
+ value: ((h = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
5049
5057
  label: "Map Object",
5050
5058
  onValueChange: (f) => {
5051
5059
  var k;
@@ -5066,8 +5074,8 @@ function Ql() {
5066
5074
  ue,
5067
5075
  {
5068
5076
  className: "h-9",
5069
- options: Bl,
5070
- value: ((b = (j = s.preferences) == null ? void 0 : j.mapVisualOptions) == null ? void 0 : b.projection) || "",
5077
+ options: Ul,
5078
+ value: ((C = (j = s.preferences) == null ? void 0 : j.mapVisualOptions) == null ? void 0 : C.projection) || "",
5071
5079
  label: "Projection",
5072
5080
  onValueChange: (f) => {
5073
5081
  var k;
@@ -5088,8 +5096,8 @@ function Ql() {
5088
5096
  ue,
5089
5097
  {
5090
5098
  className: "h-9",
5091
- options: Gl,
5092
- value: ((C = (I = s.preferences) == null ? void 0 : I.mapVisualOptions) == null ? void 0 : C.colorScale) || "",
5099
+ options: Ql,
5100
+ value: ((y = (F = s.preferences) == null ? void 0 : F.mapVisualOptions) == null ? void 0 : y.colorScale) || "",
5093
5101
  label: "Select Color Scale",
5094
5102
  onValueChange: (f) => {
5095
5103
  var k;
@@ -5106,15 +5114,15 @@ function Ql() {
5106
5114
  ] })
5107
5115
  ] })
5108
5116
  ] }) }),
5109
- /* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
5110
- /* @__PURE__ */ e.jsx(Ge, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5117
+ /* @__PURE__ */ e.jsx(Se, { className: "my-4" }),
5118
+ /* @__PURE__ */ e.jsx(Qe, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5111
5119
  /* @__PURE__ */ e.jsx(
5112
5120
  le,
5113
5121
  {
5114
- className: `h-9 w-full ${Be}`,
5122
+ className: `h-9 w-full ${Ue}`,
5115
5123
  type: "number",
5116
5124
  step: 0.1,
5117
- value: ((F = (T = s.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
5125
+ value: ((I = (T = s.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
5118
5126
  onChange: (f) => {
5119
5127
  var k;
5120
5128
  l({
@@ -5131,7 +5139,7 @@ function Ql() {
5131
5139
  /* @__PURE__ */ e.jsx(
5132
5140
  le,
5133
5141
  {
5134
- className: `h-9 w-full ${Be}`,
5142
+ className: `h-9 w-full ${Ue}`,
5135
5143
  type: "number",
5136
5144
  step: 10,
5137
5145
  value: ((S = (N = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : S[0]) || 0,
@@ -5154,10 +5162,10 @@ function Ql() {
5154
5162
  /* @__PURE__ */ e.jsx(
5155
5163
  le,
5156
5164
  {
5157
- className: `h-9 w-full ${Be}`,
5165
+ className: `h-9 w-full ${Ue}`,
5158
5166
  type: "number",
5159
5167
  step: 10,
5160
- value: ((v = (h = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : h.projectionOffset) == null ? void 0 : v[1]) || 0,
5168
+ value: ((v = (x = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : x.projectionOffset) == null ? void 0 : v[1]) || 0,
5161
5169
  onChange: (f) => {
5162
5170
  var k, M, H, P;
5163
5171
  l({
@@ -5174,11 +5182,11 @@ function Ql() {
5174
5182
  }
5175
5183
  )
5176
5184
  ] }) }),
5177
- /* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
5185
+ /* @__PURE__ */ e.jsx(Se, { className: "my-4" }),
5178
5186
  /* @__PURE__ */ e.jsx(Te, {})
5179
5187
  ] });
5180
5188
  }
5181
- function Jl() {
5189
+ function Kl() {
5182
5190
  var n;
5183
5191
  const s = m((l) => l.card.preferences), { setCardPreferences: t } = m((l) => l.actions);
5184
5192
  function a(l) {
@@ -5246,23 +5254,23 @@ function ns({
5246
5254
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5247
5255
  s === "range" && /* @__PURE__ */ e.jsx(fs, {}),
5248
5256
  s !== "text" && /* @__PURE__ */ e.jsx(Gs, {}),
5249
- s === "text" && /* @__PURE__ */ e.jsx(Jl, {})
5257
+ s === "text" && /* @__PURE__ */ e.jsx(Kl, {})
5250
5258
  ] })
5251
5259
  ] }),
5252
5260
  !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
5253
5261
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
5254
5262
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5255
5263
  /* @__PURE__ */ e.jsx(Te, {}),
5256
- /* @__PURE__ */ e.jsx(_e, {})
5264
+ /* @__PURE__ */ e.jsx(He, {})
5257
5265
  ] })
5258
5266
  ] })
5259
5267
  ] }) });
5260
5268
  }
5261
- function Kl() {
5269
+ function Wl() {
5262
5270
  const s = m(
5263
5271
  (n) => {
5264
- var l, c;
5265
- return (c = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : c.sortChart;
5272
+ var l, d;
5273
+ return (d = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : d.sortChart;
5266
5274
  }
5267
5275
  ), { setSortChart: t } = re();
5268
5276
  function a() {
@@ -5333,12 +5341,12 @@ function Kl() {
5333
5341
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
5334
5342
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5335
5343
  /* @__PURE__ */ e.jsx(Te, {}),
5336
- /* @__PURE__ */ e.jsx(_e, {})
5344
+ /* @__PURE__ */ e.jsx(He, {})
5337
5345
  ] })
5338
5346
  ] })
5339
5347
  ] }) });
5340
5348
  }
5341
- function Wl({}) {
5349
+ function Yl({}) {
5342
5350
  const s = m((n) => {
5343
5351
  var l;
5344
5352
  return (l = n.card) == null ? void 0 : l.preferences;
@@ -5355,7 +5363,7 @@ function Wl({}) {
5355
5363
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
5356
5364
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5357
5365
  /* @__PURE__ */ e.jsx(Te, {}),
5358
- /* @__PURE__ */ e.jsx(_e, {})
5366
+ /* @__PURE__ */ e.jsx(He, {})
5359
5367
  ] })
5360
5368
  ] }) }),
5361
5369
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
@@ -5371,7 +5379,7 @@ function Wl({}) {
5371
5379
  ] })
5372
5380
  ] });
5373
5381
  }
5374
- const Yl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5382
+ const Xl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5375
5383
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
5376
5384
  /* @__PURE__ */ e.jsxs("div", { children: [
5377
5385
  "See ",
@@ -5387,7 +5395,7 @@ const Yl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5387
5395
  ),
5388
5396
  " in the docs."
5389
5397
  ] })
5390
- ] }), Xl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5398
+ ] }), Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5391
5399
  /* @__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" }),
5392
5400
  /* @__PURE__ */ e.jsxs("div", { children: [
5393
5401
  "See ",
@@ -5403,7 +5411,7 @@ const Yl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5403
5411
  ),
5404
5412
  " in the docs."
5405
5413
  ] })
5406
- ] }), Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5414
+ ] }), er = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5407
5415
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
5408
5416
  /* @__PURE__ */ e.jsxs("div", { children: [
5409
5417
  "See ",
@@ -5420,22 +5428,22 @@ const Yl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5420
5428
  " in the docs."
5421
5429
  ] })
5422
5430
  ] });
5423
- function er() {
5431
+ function sr() {
5424
5432
  const s = m((a) => a.card.type);
5425
5433
  function t(a) {
5426
5434
  switch (a) {
5427
5435
  case "stackedBar":
5428
5436
  case "stackedLine":
5429
- return /* @__PURE__ */ e.jsx(Kl, {});
5437
+ return /* @__PURE__ */ e.jsx(Wl, {});
5430
5438
  case "pyramid":
5431
- return /* @__PURE__ */ e.jsx(ns, { docContent: Yl, cardType: a });
5439
+ return /* @__PURE__ */ e.jsx(ns, { docContent: Xl, cardType: a });
5432
5440
  case "kpi":
5433
- return /* @__PURE__ */ e.jsx(Pl, {});
5441
+ return /* @__PURE__ */ e.jsx(Bl, {});
5434
5442
  case "line":
5435
5443
  case "bar":
5436
- return /* @__PURE__ */ e.jsx(Al, { cardType: a });
5444
+ return /* @__PURE__ */ e.jsx(Vl, { cardType: a });
5437
5445
  case "range":
5438
- return /* @__PURE__ */ e.jsx(ns, { docContent: Xl, cardType: a });
5446
+ return /* @__PURE__ */ e.jsx(ns, { docContent: Zl, cardType: a });
5439
5447
  case "pie":
5440
5448
  case "doughnut":
5441
5449
  case "polarArea":
@@ -5443,29 +5451,29 @@ function er() {
5443
5451
  return /* @__PURE__ */ e.jsx(ns, { cardType: a });
5444
5452
  case "bubble":
5445
5453
  case "scatter":
5446
- return /* @__PURE__ */ e.jsx(Vl, { cardType: a });
5454
+ return /* @__PURE__ */ e.jsx(ql, { cardType: a });
5447
5455
  case "table":
5448
- return /* @__PURE__ */ e.jsx(Wl, { cardType: a });
5456
+ return /* @__PURE__ */ e.jsx(Yl, { cardType: a });
5449
5457
  case "text":
5450
5458
  return /* @__PURE__ */ e.jsx(
5451
5459
  ns,
5452
5460
  {
5453
- docContent: Zl,
5461
+ docContent: er,
5454
5462
  cardType: a,
5455
5463
  suffix: "Visual"
5456
5464
  }
5457
5465
  );
5458
5466
  case "map":
5459
- return /* @__PURE__ */ e.jsx(Ql, {});
5467
+ return /* @__PURE__ */ e.jsx(Jl, {});
5460
5468
  case "custom":
5461
- return /* @__PURE__ */ e.jsx(Tl, {});
5469
+ return /* @__PURE__ */ e.jsx(Ll, {});
5462
5470
  default:
5463
- return /* @__PURE__ */ e.jsx(_l, {});
5471
+ return /* @__PURE__ */ e.jsx(Hl, {});
5464
5472
  }
5465
5473
  }
5466
- return /* @__PURE__ */ e.jsx(We, { className: "h-full w-full text-sm", children: t(s) });
5474
+ return /* @__PURE__ */ e.jsx(qe, { className: "h-full w-full text-sm", children: t(s) });
5467
5475
  }
5468
- function sr() {
5476
+ function ar() {
5469
5477
  const s = m((t) => t.isShowingVisual);
5470
5478
  return /* @__PURE__ */ e.jsxs(
5471
5479
  Cs,
@@ -5480,7 +5488,7 @@ function sr() {
5480
5488
  className: "flex",
5481
5489
  minSize: 20,
5482
5490
  defaultSize: 40,
5483
- children: /* @__PURE__ */ e.jsx(yl, {})
5491
+ children: /* @__PURE__ */ e.jsx(vl, {})
5484
5492
  }
5485
5493
  ),
5486
5494
  /* @__PURE__ */ e.jsx(Ns, { withHandle: !0, className: "border" }),
@@ -5499,7 +5507,7 @@ function sr() {
5499
5507
  minSize: 20,
5500
5508
  defaultSize: 25,
5501
5509
  maxSize: 30,
5502
- children: /* @__PURE__ */ e.jsx(er, {})
5510
+ children: /* @__PURE__ */ e.jsx(sr, {})
5503
5511
  }
5504
5512
  ) }),
5505
5513
  /* @__PURE__ */ e.jsx(Ns, { className: "border" }),
@@ -5511,15 +5519,15 @@ function sr() {
5511
5519
  }
5512
5520
  );
5513
5521
  }
5514
- function ar({ authToken: s, onSave: t, onClose: a }) {
5522
+ function tr({ authToken: s, onSave: t, onClose: a }) {
5515
5523
  z((r) => r.themeStyle);
5516
- const n = m((r) => r.actions.setOnSave), l = m((r) => r.actions.setOnClose), c = z((r) => r.actions.setAuthToken);
5524
+ const n = m((r) => r.actions.setOnSave), l = m((r) => r.actions.setOnClose), d = z((r) => r.actions.setAuthToken);
5517
5525
  return Z(() => {
5518
5526
  t && n(t), a && l(a);
5519
5527
  }, [t, n, a, l]), Z(() => {
5520
- s && s.accessToken && c(s);
5521
- }, [s, c]), /* @__PURE__ */ e.jsx(us, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(
5522
- xn,
5528
+ s && s.accessToken && d(s);
5529
+ }, [s, d]), /* @__PURE__ */ e.jsx(us, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(
5530
+ pn,
5523
5531
  {
5524
5532
  style: {
5525
5533
  // borderRadius: currentStyle?.chart?.options?.borderRadius,
@@ -5528,19 +5536,19 @@ function ar({ authToken: s, onSave: t, onClose: a }) {
5528
5536
  className: "rounded-none",
5529
5537
  role: "editor-panel",
5530
5538
  children: [
5531
- /* @__PURE__ */ e.jsx(pn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
5532
- /* @__PURE__ */ e.jsx(fn, { children: /* @__PURE__ */ e.jsx(sr, {}) })
5539
+ /* @__PURE__ */ e.jsx(fn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
5540
+ /* @__PURE__ */ e.jsx(gn, { children: /* @__PURE__ */ e.jsx(ar, {}) })
5533
5541
  ]
5534
5542
  }
5535
5543
  ) });
5536
5544
  }
5537
- function tr() {
5545
+ function nr() {
5538
5546
  z((r) => r.selectedCardId);
5539
5547
  const s = z((r) => r.selectedSheetId), { setIsVisualEditing: t } = z((r) => r.actions), a = z((r) => r.isVisualEditing), n = z((r) => r.actions.updateFrame);
5540
5548
  function l(r) {
5541
5549
  s && (n(s, r), t(!1));
5542
5550
  }
5543
- function c() {
5551
+ function d() {
5544
5552
  t(!1);
5545
5553
  }
5546
5554
  return /* @__PURE__ */ e.jsx(
@@ -5550,11 +5558,11 @@ function tr() {
5550
5558
  className: Q("flex grow", {
5551
5559
  "max-h-0 overflow-hidden": !a
5552
5560
  }),
5553
- children: /* @__PURE__ */ e.jsx(ar, { onSave: l, onClose: c })
5561
+ children: /* @__PURE__ */ e.jsx(tr, { onSave: l, onClose: d })
5554
5562
  }
5555
5563
  );
5556
5564
  }
5557
- function nr() {
5565
+ function lr() {
5558
5566
  m((r) => r.selectedConnectionId), m((r) => r.selectedDatamodelId);
5559
5567
  const s = m((r) => r.selectedDatabaseName);
5560
5568
  m((r) => r.selectedSchemaName);
@@ -5562,15 +5570,15 @@ function nr() {
5562
5570
  z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
5563
5571
  (r) => r.actions.removeFilterValue
5564
5572
  );
5565
- const { modelItems: n, columns: l } = Re(), { assignFilter: c } = Xa();
5573
+ const { modelItems: n, columns: l } = _e(), { assignFilter: d } = Xa();
5566
5574
  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) => {
5567
5575
  const o = a == null ? void 0 : a.find(
5568
- (d) => d.column === de(r.column_name) && d.table === t && d.database === s
5576
+ (c) => c.column === de(r.column_name) && c.table === t && c.database === s
5569
5577
  );
5570
5578
  return /* @__PURE__ */ e.jsx(
5571
5579
  "div",
5572
5580
  {
5573
- onClick: () => c(r),
5581
+ onClick: () => d(r),
5574
5582
  className: Q(
5575
5583
  "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",
5576
5584
  {
@@ -5586,7 +5594,7 @@ function nr() {
5586
5594
  );
5587
5595
  }) });
5588
5596
  }
5589
- function lr() {
5597
+ function rr() {
5590
5598
  z((t) => t.showFilters);
5591
5599
  const s = z(
5592
5600
  (t) => t.actions.setShowFilters
@@ -5600,7 +5608,7 @@ function lr() {
5600
5608
  onClick: () => s(!1),
5601
5609
  className: "h-7 w-7 p-0",
5602
5610
  variant: "ghost",
5603
- children: /* @__PURE__ */ e.jsx(Qe, {})
5611
+ children: /* @__PURE__ */ e.jsx(Je, {})
5604
5612
  }
5605
5613
  )
5606
5614
  ] }),
@@ -5610,7 +5618,7 @@ function lr() {
5610
5618
  ColumnsComponent: () => (
5611
5619
  // schemaName, tableName, columns
5612
5620
  /* @__PURE__ */ e.jsx(
5613
- nr,
5621
+ lr,
5614
5622
  {}
5615
5623
  )
5616
5624
  )
@@ -5618,7 +5626,7 @@ function lr() {
5618
5626
  ) })
5619
5627
  ] });
5620
5628
  }
5621
- function rr() {
5629
+ function ir() {
5622
5630
  const s = z((a) => a.showFilters), t = z((a) => a.isVisualEditing);
5623
5631
  return /* @__PURE__ */ e.jsxs(
5624
5632
  "div",
@@ -5629,13 +5637,13 @@ function rr() {
5629
5637
  "flex grow": !t
5630
5638
  }),
5631
5639
  children: [
5632
- /* @__PURE__ */ e.jsx(gn, {}),
5633
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(lr, {}) })
5640
+ /* @__PURE__ */ e.jsx(jn, {}),
5641
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(rr, {}) })
5634
5642
  ]
5635
5643
  }
5636
5644
  );
5637
5645
  }
5638
- function ir() {
5646
+ function or() {
5639
5647
  const s = z((n) => n.dashboard), t = z((n) => n.actions.setDashboard), a = z(
5640
5648
  (n) => n.showDashboardJSON
5641
5649
  );
@@ -5648,7 +5656,7 @@ function ir() {
5648
5656
  hidden: !a
5649
5657
  }),
5650
5658
  children: /* @__PURE__ */ e.jsx(
5651
- jn,
5659
+ bn,
5652
5660
  {
5653
5661
  onChange: (n) => {
5654
5662
  if (n)
@@ -5679,65 +5687,65 @@ function ir() {
5679
5687
  }
5680
5688
  );
5681
5689
  }
5682
- function ur({
5690
+ function mr({
5683
5691
  showControls: s = !1,
5684
5692
  showFooter: t = !0,
5685
5693
  ...a
5686
5694
  }) {
5687
- return /* @__PURE__ */ e.jsx(us, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(bn, { dashboardProps: a, children: [
5688
- /* @__PURE__ */ e.jsx(yn, {}),
5689
- /* @__PURE__ */ e.jsxs(vn, { children: [
5690
- /* @__PURE__ */ e.jsx(ir, {}),
5691
- /* @__PURE__ */ e.jsxs(Cn, { ...a, children: [
5692
- s && /* @__PURE__ */ e.jsx(nl, {}),
5693
- /* @__PURE__ */ e.jsx(tr, {}),
5694
- /* @__PURE__ */ e.jsx(rr, {})
5695
+ return /* @__PURE__ */ e.jsx(us, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(yn, { dashboardProps: a, children: [
5696
+ /* @__PURE__ */ e.jsx(vn, {}),
5697
+ /* @__PURE__ */ e.jsxs(Cn, { children: [
5698
+ /* @__PURE__ */ e.jsx(or, {}),
5699
+ /* @__PURE__ */ e.jsxs(Nn, { ...a, children: [
5700
+ s && /* @__PURE__ */ e.jsx(ll, {}),
5701
+ /* @__PURE__ */ e.jsx(nr, {}),
5702
+ /* @__PURE__ */ e.jsx(ir, {})
5695
5703
  ] })
5696
5704
  ] })
5697
5705
  ] }) });
5698
5706
  }
5699
5707
  export {
5700
- Pe as A,
5701
- Sn as B,
5702
- wn as C,
5703
- ur as D,
5708
+ Be as A,
5709
+ wn as B,
5710
+ kn as C,
5711
+ mr as D,
5704
5712
  Ia as E,
5705
5713
  Ma as F,
5706
- Tn as G,
5707
- Ln as H,
5708
- An as I,
5709
- Yn as J,
5710
- Vn as L,
5714
+ Ln as G,
5715
+ Mn as H,
5716
+ Vn as I,
5717
+ Xn as J,
5718
+ qn as L,
5711
5719
  Da as M,
5712
- Hn as N,
5720
+ $n as N,
5713
5721
  Ta as P,
5714
- Bn as S,
5715
- Jn as T,
5716
- Wn as U,
5722
+ Un as S,
5723
+ Kn as T,
5724
+ Yn as U,
5717
5725
  Ps as a,
5718
5726
  Bs as b,
5719
5727
  za as c,
5720
5728
  Oa as d,
5721
5729
  Fa as e,
5722
- kn as f,
5723
- zn as g,
5724
- On as h,
5725
- Fn as i,
5726
- Dn as j,
5727
- In as k,
5728
- Mn as l,
5729
- En as m,
5730
- qn as n,
5731
- Rn as o,
5730
+ zn as f,
5731
+ On as g,
5732
+ Fn as h,
5733
+ In as i,
5734
+ Tn as j,
5735
+ Dn as k,
5736
+ En as l,
5737
+ An as m,
5738
+ Rn as n,
5739
+ _n as o,
5732
5740
  Ve as p,
5733
- _n as q,
5734
- $n as r,
5735
- Pn as s,
5741
+ Hn as q,
5742
+ Pn as r,
5743
+ Bn as s,
5736
5744
  La as t,
5737
- Un as u,
5738
- Gn as v,
5739
- Qn as w,
5740
- Kn as x,
5745
+ Gn as u,
5746
+ Qn as v,
5747
+ Jn as w,
5748
+ Wn as x,
5741
5749
  Us as y,
5742
- Re as z
5750
+ _e as z
5743
5751
  };