semaphor 0.0.48 → 0.0.49
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.
- package/dist/chunks/dashboard-plus-4h_dG_jo.js +210 -0
- package/dist/chunks/{dashboard-plus-upSoeQoI.js → dashboard-plus-zWycIkYs.js} +1106 -1038
- package/dist/chunks/{index-O9LcZUoj.js → index-TDaW4qPC.js} +88 -88
- package/dist/chunks/{index-71zNxWPN.js → index-qjDx7Ig8.js} +8233 -8094
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +2 -1
- package/dist/types/main.d.ts +10 -1
- package/dist/types/surfboard.d.ts +2 -1
- package/dist/types/types.d.ts +2 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-CiMeIZCS.js +0 -205
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import me, { useState as
|
|
1
|
+
import { P as E, b as k, j as e, Q as xs, R as ps, U as z, V as Ps, W as fs, X as gs, Y as js, Z as bs, _ as B, $ as ae, a0 as Us, J as Gs, O as Ee, a1 as qa, a2 as Va, a3 as Ra, a4 as _a, a5 as Ha, a6 as Ba, a7 as As, a8 as _e, a9 as Ke, aa as We, T as ys, e as Js, g as vs, ab as Oe, ac as Me, f as Y, ad as Te, ae as Ae, af as He, ag as Le, ah as X, ai as Ns, G as r, aj as Pe, ak as Ue, al as $a, am as Ge, w as Qs, v as Ws, t as he, an as Ka, r as Pa, N as Ys, s as Ua, ao as Ga, B as Ja, ap as Xs, aq as Qa, L as Be, S as Cs, z as Wa, n as Es, ar as cs, A as ds, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Ya, aA as Xa, aB as na, aC as Za, aD as et, aE as st, aF as at, aG as tt, aH as hs, aI as nt, aJ as Re, aK as ms, aL as Fe, aM as us, aN as Ls, aO as lt, aP as rt, aQ as it, aR as ot, aS as ct, aT as ls, aU as dt, aV as Ds, aW as ht, aX as Is, aY as mt, aZ as ut, a_ as xt, a$ as la, l as pt, C as ft, E as qs, d as gt, h as jt, i as bt, o as yt, b0 as vt, m as Nt, H as Ct, b1 as St, b2 as kt, b3 as wt, b4 as rs, b5 as zt, b6 as is, b7 as Vs, K as Ft, b8 as Ss, b9 as Ot, ba as ra, bb as Ye, bc as ia, bd as Mt, be as Tt, bf as At, bg as Et, bh as Lt, bi as Dt, bj as Se, bk as V, bl as R, bm as ks, bn as _, bo as Rs, bp as It, bq as qt, br as Vt, bs as Rt, bt as _s, bu as _t, bv as Ht, bw as Bt, bx as $t, by as Kt, bz as Pt } from "./index-qjDx7Ig8.js";
|
|
2
|
+
import me, { useState as T, useEffect as K, useMemo as Ut, useRef as $e } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license lucide-react v0.379.0 - ISC
|
|
5
5
|
*
|
|
6
6
|
* This source code is licensed under the ISC license.
|
|
7
7
|
* See the LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const Gt = E("Activity", [
|
|
10
10
|
[
|
|
11
11
|
"path",
|
|
12
12
|
{
|
|
@@ -21,7 +21,7 @@ const Ut = T("Activity", [
|
|
|
21
21
|
* This source code is licensed under the ISC license.
|
|
22
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/
|
|
24
|
-
const Jt =
|
|
24
|
+
const Jt = E("AreaChart", [
|
|
25
25
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
26
26
|
["path", { d: "M7 12v5h12V8l-5 5-4-4Z", key: "zxz28u" }]
|
|
27
27
|
]);
|
|
@@ -31,7 +31,7 @@ const Jt = T("AreaChart", [
|
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
33
|
*/
|
|
34
|
-
const
|
|
34
|
+
const ws = E("BarChart4", [
|
|
35
35
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
36
36
|
["path", { d: "M13 17V9", key: "1fwyjl" }],
|
|
37
37
|
["path", { d: "M18 17V5", key: "sfb6ij" }],
|
|
@@ -43,7 +43,7 @@ const Ns = T("BarChart4", [
|
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
45
|
*/
|
|
46
|
-
const
|
|
46
|
+
const Qt = E("CircleX", [
|
|
47
47
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
48
48
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
49
49
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -54,7 +54,7 @@ const Pt = T("CircleX", [
|
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
56
|
*/
|
|
57
|
-
const
|
|
57
|
+
const Wt = E("Database", [
|
|
58
58
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
59
59
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
60
60
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -65,7 +65,7 @@ const Gt = T("Database", [
|
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
67
|
*/
|
|
68
|
-
const
|
|
68
|
+
const Yt = E("Eraser", [
|
|
69
69
|
[
|
|
70
70
|
"path",
|
|
71
71
|
{
|
|
@@ -82,7 +82,7 @@ const Qt = T("Eraser", [
|
|
|
82
82
|
* This source code is licensed under the ISC license.
|
|
83
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
84
|
*/
|
|
85
|
-
const oa =
|
|
85
|
+
const oa = E("Filter", [
|
|
86
86
|
["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
|
|
87
87
|
]);
|
|
88
88
|
/**
|
|
@@ -91,7 +91,18 @@ const oa = T("Filter", [
|
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
93
|
*/
|
|
94
|
-
const
|
|
94
|
+
const ca = E("GanttChart", [
|
|
95
|
+
["path", { d: "M8 6h10", key: "9lnwnk" }],
|
|
96
|
+
["path", { d: "M6 12h9", key: "1g9pqf" }],
|
|
97
|
+
["path", { d: "M11 18h7", key: "c8dzvl" }]
|
|
98
|
+
]);
|
|
99
|
+
/**
|
|
100
|
+
* @license lucide-react v0.379.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/
|
|
105
|
+
const Xt = E("Glasses", [
|
|
95
106
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
96
107
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
97
108
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -104,7 +115,7 @@ const Wt = T("Glasses", [
|
|
|
104
115
|
* This source code is licensed under the ISC license.
|
|
105
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
117
|
*/
|
|
107
|
-
const
|
|
118
|
+
const Zt = E("Hammer", [
|
|
108
119
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
109
120
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
110
121
|
[
|
|
@@ -121,7 +132,7 @@ const Yt = T("Hammer", [
|
|
|
121
132
|
* This source code is licensed under the ISC license.
|
|
122
133
|
* See the LICENSE file in the root directory of this source tree.
|
|
123
134
|
*/
|
|
124
|
-
const
|
|
135
|
+
const en = E("Hash", [
|
|
125
136
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
126
137
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
127
138
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -133,7 +144,7 @@ const Xt = T("Hash", [
|
|
|
133
144
|
* This source code is licensed under the ISC license.
|
|
134
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
135
146
|
*/
|
|
136
|
-
const
|
|
147
|
+
const sn = E("Key", [
|
|
137
148
|
["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
|
|
138
149
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
139
150
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
@@ -144,7 +155,7 @@ const Zt = T("Key", [
|
|
|
144
155
|
* This source code is licensed under the ISC license.
|
|
145
156
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
157
|
*/
|
|
147
|
-
const
|
|
158
|
+
const zs = E("LineChart", [
|
|
148
159
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
149
160
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
150
161
|
]);
|
|
@@ -154,7 +165,7 @@ const Cs = T("LineChart", [
|
|
|
154
165
|
* This source code is licensed under the ISC license.
|
|
155
166
|
* See the LICENSE file in the root directory of this source tree.
|
|
156
167
|
*/
|
|
157
|
-
const
|
|
168
|
+
const an = E("ListEnd", [
|
|
158
169
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
159
170
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
160
171
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -167,7 +178,7 @@ const en = T("ListEnd", [
|
|
|
167
178
|
* This source code is licensed under the ISC license.
|
|
168
179
|
* See the LICENSE file in the root directory of this source tree.
|
|
169
180
|
*/
|
|
170
|
-
const
|
|
181
|
+
const tn = E("ListStart", [
|
|
171
182
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
172
183
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
173
184
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -180,7 +191,7 @@ const sn = T("ListStart", [
|
|
|
180
191
|
* This source code is licensed under the ISC license.
|
|
181
192
|
* See the LICENSE file in the root directory of this source tree.
|
|
182
193
|
*/
|
|
183
|
-
const
|
|
194
|
+
const nn = E("ListX", [
|
|
184
195
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
185
196
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
186
197
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -193,7 +204,7 @@ const an = T("ListX", [
|
|
|
193
204
|
* This source code is licensed under the ISC license.
|
|
194
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
195
206
|
*/
|
|
196
|
-
const
|
|
207
|
+
const ln = E("MessageSquareMore", [
|
|
197
208
|
["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" }],
|
|
198
209
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
199
210
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -205,7 +216,7 @@ const tn = T("MessageSquareMore", [
|
|
|
205
216
|
* This source code is licensed under the ISC license.
|
|
206
217
|
* See the LICENSE file in the root directory of this source tree.
|
|
207
218
|
*/
|
|
208
|
-
const
|
|
219
|
+
const rn = E("Network", [
|
|
209
220
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
210
221
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
211
222
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -218,7 +229,7 @@ const nn = T("Network", [
|
|
|
218
229
|
* This source code is licensed under the ISC license.
|
|
219
230
|
* See the LICENSE file in the root directory of this source tree.
|
|
220
231
|
*/
|
|
221
|
-
const
|
|
232
|
+
const da = E("Pencil", [
|
|
222
233
|
["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
|
|
223
234
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
224
235
|
]);
|
|
@@ -228,7 +239,7 @@ const ca = T("Pencil", [
|
|
|
228
239
|
* This source code is licensed under the ISC license.
|
|
229
240
|
* See the LICENSE file in the root directory of this source tree.
|
|
230
241
|
*/
|
|
231
|
-
const
|
|
242
|
+
const ha = E("PieChart", [
|
|
232
243
|
["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
|
|
233
244
|
["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
|
|
234
245
|
]);
|
|
@@ -238,7 +249,7 @@ const da = T("PieChart", [
|
|
|
238
249
|
* This source code is licensed under the ISC license.
|
|
239
250
|
* See the LICENSE file in the root directory of this source tree.
|
|
240
251
|
*/
|
|
241
|
-
const
|
|
252
|
+
const on = E("Play", [
|
|
242
253
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
243
254
|
]);
|
|
244
255
|
/**
|
|
@@ -247,7 +258,7 @@ const ln = T("Play", [
|
|
|
247
258
|
* This source code is licensed under the ISC license.
|
|
248
259
|
* See the LICENSE file in the root directory of this source tree.
|
|
249
260
|
*/
|
|
250
|
-
const
|
|
261
|
+
const cn = E("Plug2", [
|
|
251
262
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
252
263
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
253
264
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -260,7 +271,7 @@ const rn = T("Plug2", [
|
|
|
260
271
|
* This source code is licensed under the ISC license.
|
|
261
272
|
* See the LICENSE file in the root directory of this source tree.
|
|
262
273
|
*/
|
|
263
|
-
const
|
|
274
|
+
const dn = E("Save", [
|
|
264
275
|
[
|
|
265
276
|
"path",
|
|
266
277
|
{
|
|
@@ -277,7 +288,7 @@ const on = T("Save", [
|
|
|
277
288
|
* This source code is licensed under the ISC license.
|
|
278
289
|
* See the LICENSE file in the root directory of this source tree.
|
|
279
290
|
*/
|
|
280
|
-
const
|
|
291
|
+
const ma = E("ScatterChart", [
|
|
281
292
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
|
|
282
293
|
["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
|
|
283
294
|
["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
|
|
@@ -291,7 +302,7 @@ const ha = T("ScatterChart", [
|
|
|
291
302
|
* This source code is licensed under the ISC license.
|
|
292
303
|
* See the LICENSE file in the root directory of this source tree.
|
|
293
304
|
*/
|
|
294
|
-
const
|
|
305
|
+
const hn = E("ShieldQuestion", [
|
|
295
306
|
[
|
|
296
307
|
"path",
|
|
297
308
|
{
|
|
@@ -308,7 +319,7 @@ const cn = T("ShieldQuestion", [
|
|
|
308
319
|
* This source code is licensed under the ISC license.
|
|
309
320
|
* See the LICENSE file in the root directory of this source tree.
|
|
310
321
|
*/
|
|
311
|
-
const
|
|
322
|
+
const mn = E("Sigma", [
|
|
312
323
|
["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
|
|
313
324
|
]);
|
|
314
325
|
/**
|
|
@@ -317,7 +328,7 @@ const dn = T("Sigma", [
|
|
|
317
328
|
* This source code is licensed under the ISC license.
|
|
318
329
|
* See the LICENSE file in the root directory of this source tree.
|
|
319
330
|
*/
|
|
320
|
-
const
|
|
331
|
+
const un = E("SwatchBook", [
|
|
321
332
|
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
322
333
|
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
323
334
|
["path", { d: "M 7 17h0.01", key: "10821z" }],
|
|
@@ -335,7 +346,7 @@ const hn = T("SwatchBook", [
|
|
|
335
346
|
* This source code is licensed under the ISC license.
|
|
336
347
|
* See the LICENSE file in the root directory of this source tree.
|
|
337
348
|
*/
|
|
338
|
-
const
|
|
349
|
+
const xn = E("Tag", [
|
|
339
350
|
[
|
|
340
351
|
"path",
|
|
341
352
|
{
|
|
@@ -351,7 +362,7 @@ const mn = T("Tag", [
|
|
|
351
362
|
* This source code is licensed under the ISC license.
|
|
352
363
|
* See the LICENSE file in the root directory of this source tree.
|
|
353
364
|
*/
|
|
354
|
-
const
|
|
365
|
+
const pn = E("ToggleLeft", [
|
|
355
366
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
356
367
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
357
368
|
]);
|
|
@@ -361,7 +372,7 @@ const un = T("ToggleLeft", [
|
|
|
361
372
|
* This source code is licensed under the ISC license.
|
|
362
373
|
* See the LICENSE file in the root directory of this source tree.
|
|
363
374
|
*/
|
|
364
|
-
const
|
|
375
|
+
const fn = E("Type", [
|
|
365
376
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
366
377
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
367
378
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -372,42 +383,42 @@ const xn = T("Type", [
|
|
|
372
383
|
* This source code is licensed under the ISC license.
|
|
373
384
|
* See the LICENSE file in the root directory of this source tree.
|
|
374
385
|
*/
|
|
375
|
-
const
|
|
386
|
+
const gn = E("User", [
|
|
376
387
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
377
388
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
378
389
|
]);
|
|
379
|
-
function
|
|
380
|
-
const [s, n] =
|
|
390
|
+
function jn() {
|
|
391
|
+
const [s, n] = T(""), [a, t] = T(!1), [i, o] = T(!1), l = k((h) => h.dashboard);
|
|
381
392
|
function c() {
|
|
382
|
-
const
|
|
393
|
+
const h = Gs(l), g = Ee(l.id), m = JSON.parse(localStorage.getItem(g) || "[]");
|
|
383
394
|
if (m.some(
|
|
384
|
-
(
|
|
395
|
+
(N) => N.name === s
|
|
385
396
|
)) {
|
|
386
397
|
t(!0);
|
|
387
398
|
return;
|
|
388
399
|
}
|
|
389
400
|
m.push({
|
|
390
401
|
name: s,
|
|
391
|
-
template:
|
|
392
|
-
}), localStorage.setItem(
|
|
402
|
+
template: h
|
|
403
|
+
}), localStorage.setItem(g, JSON.stringify(m)), o(!1);
|
|
393
404
|
}
|
|
394
|
-
return /* @__PURE__ */ e.jsxs(
|
|
395
|
-
/* @__PURE__ */ e.jsx(
|
|
396
|
-
|
|
405
|
+
return /* @__PURE__ */ e.jsxs(xs, { open: i, onOpenChange: o, children: [
|
|
406
|
+
/* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
407
|
+
z,
|
|
397
408
|
{
|
|
398
409
|
variant: "outline",
|
|
399
410
|
className: "h-7 p-2",
|
|
400
411
|
size: "sm",
|
|
401
412
|
children: [
|
|
402
|
-
/* @__PURE__ */ e.jsx(
|
|
413
|
+
/* @__PURE__ */ e.jsx(Ps, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
403
414
|
"Add Lens"
|
|
404
415
|
]
|
|
405
416
|
}
|
|
406
417
|
) }),
|
|
407
|
-
/* @__PURE__ */ e.jsxs(
|
|
408
|
-
/* @__PURE__ */ e.jsxs(
|
|
409
|
-
/* @__PURE__ */ e.jsx(
|
|
410
|
-
/* @__PURE__ */ e.jsx(
|
|
418
|
+
/* @__PURE__ */ e.jsxs(fs, { className: "sm:max-w-[425px]", children: [
|
|
419
|
+
/* @__PURE__ */ e.jsxs(gs, { children: [
|
|
420
|
+
/* @__PURE__ */ e.jsx(js, { children: "Add a Lens" }),
|
|
421
|
+
/* @__PURE__ */ e.jsx(bs, { children: "Lenses are private by default and are only visible to you." })
|
|
411
422
|
] }),
|
|
412
423
|
/* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
413
424
|
/* @__PURE__ */ e.jsx(B, { className: "text-right", children: "Name" }),
|
|
@@ -415,8 +426,8 @@ function fn() {
|
|
|
415
426
|
ae,
|
|
416
427
|
{
|
|
417
428
|
value: s,
|
|
418
|
-
onChange: (
|
|
419
|
-
a && t(!1), n(
|
|
429
|
+
onChange: (h) => {
|
|
430
|
+
a && t(!1), n(h.target.value);
|
|
420
431
|
},
|
|
421
432
|
id: "name",
|
|
422
433
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -424,8 +435,8 @@ function fn() {
|
|
|
424
435
|
)
|
|
425
436
|
] }) }),
|
|
426
437
|
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
|
|
427
|
-
/* @__PURE__ */ e.jsx(
|
|
428
|
-
|
|
438
|
+
/* @__PURE__ */ e.jsx(Us, { children: /* @__PURE__ */ e.jsx(
|
|
439
|
+
z,
|
|
429
440
|
{
|
|
430
441
|
variant: "outline",
|
|
431
442
|
type: "submit",
|
|
@@ -437,57 +448,57 @@ function fn() {
|
|
|
437
448
|
] })
|
|
438
449
|
] });
|
|
439
450
|
}
|
|
440
|
-
function
|
|
441
|
-
const [s, n] =
|
|
442
|
-
(
|
|
451
|
+
function bn() {
|
|
452
|
+
const [s, n] = T(!1), [a, t] = T(""), i = k((d) => d.dashboard), o = k((d) => d.bookmarkKey), [l, c] = T([]), h = k((d) => d.actions.setDashboard), g = k(
|
|
453
|
+
(d) => d.actions.setFilterValues
|
|
443
454
|
), m = k(
|
|
444
|
-
(
|
|
455
|
+
(d) => d.actions.setBookmarkKey
|
|
445
456
|
);
|
|
446
457
|
K(() => {
|
|
447
|
-
const
|
|
458
|
+
const d = Ee(i.id), x = JSON.parse(localStorage.getItem(d) || "[]");
|
|
448
459
|
c(x);
|
|
449
|
-
const
|
|
450
|
-
(
|
|
460
|
+
const f = x.find(
|
|
461
|
+
(w) => w.default
|
|
451
462
|
);
|
|
452
|
-
|
|
463
|
+
f && f.name === o && t(f.name);
|
|
453
464
|
}, [s, i, o]);
|
|
454
|
-
function u(
|
|
455
|
-
if (
|
|
465
|
+
function u(d) {
|
|
466
|
+
if (d === a)
|
|
456
467
|
return;
|
|
457
|
-
const x = l.find((
|
|
458
|
-
|
|
468
|
+
const x = l.find((w) => w.name === d), f = x == null ? void 0 : x.template;
|
|
469
|
+
f && (h(f), g(x.filterValues || []), m(d === "Original" ? "" : d)), t(d);
|
|
459
470
|
}
|
|
460
|
-
function
|
|
461
|
-
const x = Ee(i.id),
|
|
462
|
-
(b) => b.name !==
|
|
471
|
+
function N(d) {
|
|
472
|
+
const x = Ee(i.id), w = JSON.parse(localStorage.getItem(x) || "[]").filter(
|
|
473
|
+
(b) => b.name !== d
|
|
463
474
|
);
|
|
464
|
-
localStorage.setItem(x, JSON.stringify(
|
|
475
|
+
localStorage.setItem(x, JSON.stringify(w)), c(w);
|
|
465
476
|
}
|
|
466
|
-
return /* @__PURE__ */ e.jsxs(
|
|
467
|
-
/* @__PURE__ */ e.jsx(
|
|
468
|
-
/* @__PURE__ */ e.jsxs(
|
|
469
|
-
/* @__PURE__ */ e.jsx(
|
|
470
|
-
/* @__PURE__ */ e.jsx(
|
|
477
|
+
return /* @__PURE__ */ e.jsxs(qa, { open: s, onOpenChange: n, children: [
|
|
478
|
+
/* @__PURE__ */ e.jsx(Va, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
479
|
+
/* @__PURE__ */ e.jsxs(Ra, { className: "w-56", children: [
|
|
480
|
+
/* @__PURE__ */ e.jsx(_a, { children: "Lenses" }),
|
|
481
|
+
/* @__PURE__ */ e.jsx(Ha, {}),
|
|
471
482
|
/* @__PURE__ */ e.jsxs(
|
|
472
|
-
|
|
483
|
+
Ba,
|
|
473
484
|
{
|
|
474
485
|
value: a,
|
|
475
486
|
onValueChange: u,
|
|
476
487
|
children: [
|
|
477
|
-
/* @__PURE__ */ e.jsx(
|
|
478
|
-
l.filter((
|
|
479
|
-
|
|
488
|
+
/* @__PURE__ */ e.jsx(As, { value: "Original", children: "Original" }),
|
|
489
|
+
l.filter((d) => d.name != "Original").map((d, x) => /* @__PURE__ */ e.jsxs(
|
|
490
|
+
As,
|
|
480
491
|
{
|
|
481
492
|
className: "xbg-red-100 flex justify-between",
|
|
482
|
-
value:
|
|
483
|
-
defaultChecked:
|
|
493
|
+
value: d.name,
|
|
494
|
+
defaultChecked: d.name === o,
|
|
484
495
|
children: [
|
|
485
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
496
|
+
/* @__PURE__ */ e.jsx("p", { children: d.name }),
|
|
486
497
|
/* @__PURE__ */ e.jsx(
|
|
487
|
-
|
|
498
|
+
_e,
|
|
488
499
|
{
|
|
489
|
-
onClick: (
|
|
490
|
-
|
|
500
|
+
onClick: (f) => {
|
|
501
|
+
f.preventDefault(), N(d.name);
|
|
491
502
|
},
|
|
492
503
|
className: "h-3 w-3 hover:cursor-pointer",
|
|
493
504
|
strokeWidth: 1.5
|
|
@@ -503,8 +514,8 @@ function gn() {
|
|
|
503
514
|
] })
|
|
504
515
|
] });
|
|
505
516
|
}
|
|
506
|
-
function
|
|
507
|
-
const [s, n] =
|
|
517
|
+
function yn() {
|
|
518
|
+
const [s, n] = T(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
|
|
508
519
|
K(() => {
|
|
509
520
|
if (!t) {
|
|
510
521
|
n(!1);
|
|
@@ -513,21 +524,21 @@ function jn() {
|
|
|
513
524
|
const o = Ee(a.id), c = JSON.parse(
|
|
514
525
|
localStorage.getItem(o) || "[]"
|
|
515
526
|
).find(
|
|
516
|
-
(
|
|
527
|
+
(h) => h.name === t
|
|
517
528
|
);
|
|
518
529
|
n(c ? c.default : !1);
|
|
519
530
|
}, [t, a.id]);
|
|
520
531
|
function i(o) {
|
|
521
532
|
if (n(o), !t)
|
|
522
533
|
return;
|
|
523
|
-
const l = Ee(a.id),
|
|
534
|
+
const l = Ee(a.id), h = JSON.parse(
|
|
524
535
|
localStorage.getItem(l) || "[]"
|
|
525
|
-
).map((
|
|
526
|
-
console.log(
|
|
536
|
+
).map((g) => (g.name === t ? g.default = o : g.default = !1, g));
|
|
537
|
+
console.log(h), localStorage.setItem(l, JSON.stringify(h));
|
|
527
538
|
}
|
|
528
539
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
529
540
|
/* @__PURE__ */ e.jsx(
|
|
530
|
-
|
|
541
|
+
Ke,
|
|
531
542
|
{
|
|
532
543
|
checked: s,
|
|
533
544
|
onCheckedChange: i,
|
|
@@ -544,7 +555,7 @@ function jn() {
|
|
|
544
555
|
)
|
|
545
556
|
] });
|
|
546
557
|
}
|
|
547
|
-
function
|
|
558
|
+
function vn() {
|
|
548
559
|
const s = k((b) => b.bookmarkKey), n = k((b) => b.dashboard);
|
|
549
560
|
k((b) => b.selectedSheetId);
|
|
550
561
|
const a = k(
|
|
@@ -555,10 +566,10 @@ function bn() {
|
|
|
555
566
|
);
|
|
556
567
|
const l = k((b) => b.onSaveFunction), c = k(
|
|
557
568
|
(b) => b.actions.setShowFilters
|
|
558
|
-
), { addFrame:
|
|
569
|
+
), { addFrame: h, setSelectedFrameId: g } = k(
|
|
559
570
|
(b) => b.actions
|
|
560
|
-
), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON:
|
|
561
|
-
if (!a || !
|
|
571
|
+
), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: N } = k((b) => b.actions), d = m(), x = () => {
|
|
572
|
+
if (!a || !d)
|
|
562
573
|
return;
|
|
563
574
|
const b = {
|
|
564
575
|
id: We(),
|
|
@@ -580,26 +591,26 @@ function bn() {
|
|
|
580
591
|
cards: [b],
|
|
581
592
|
activeCardId: b.id
|
|
582
593
|
};
|
|
583
|
-
d
|
|
584
|
-
},
|
|
594
|
+
h(d.id, L), g(L.id);
|
|
595
|
+
}, f = () => {
|
|
585
596
|
u(!0);
|
|
586
597
|
};
|
|
587
|
-
function
|
|
598
|
+
function w() {
|
|
588
599
|
if (!s || s === "")
|
|
589
600
|
return;
|
|
590
|
-
const b =
|
|
591
|
-
(
|
|
601
|
+
const b = Gs(n), L = Ee(n.id), C = JSON.parse(localStorage.getItem(L) || "[]"), O = C.findIndex(
|
|
602
|
+
(j) => j.name === s
|
|
592
603
|
);
|
|
593
|
-
O !== -1 ?
|
|
604
|
+
O !== -1 ? C[O] = {
|
|
594
605
|
name: s,
|
|
595
606
|
template: b,
|
|
596
|
-
default:
|
|
607
|
+
default: C[O].default,
|
|
597
608
|
filterValues: t
|
|
598
|
-
} :
|
|
609
|
+
} : C.push({
|
|
599
610
|
name: s,
|
|
600
611
|
template: b,
|
|
601
612
|
filterValues: t
|
|
602
|
-
}), localStorage.setItem(L, JSON.stringify(
|
|
613
|
+
}), localStorage.setItem(L, JSON.stringify(C)), l == null || l(b);
|
|
603
614
|
}
|
|
604
615
|
return i ? null : /* @__PURE__ */ e.jsxs(
|
|
605
616
|
"div",
|
|
@@ -611,14 +622,14 @@ function bn() {
|
|
|
611
622
|
/* @__PURE__ */ e.jsx(B, { children: s }),
|
|
612
623
|
!!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
613
624
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
|
|
614
|
-
/* @__PURE__ */ e.jsx(
|
|
625
|
+
/* @__PURE__ */ e.jsx(yn, {})
|
|
615
626
|
] })
|
|
616
627
|
] }),
|
|
617
628
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
618
|
-
a && !i && /* @__PURE__ */ e.jsx(
|
|
619
|
-
!i && /* @__PURE__ */ e.jsx(
|
|
629
|
+
a && !i && /* @__PURE__ */ e.jsx(jn, {}),
|
|
630
|
+
!i && /* @__PURE__ */ e.jsx(bn, {}),
|
|
620
631
|
a && !i && /* @__PURE__ */ e.jsxs(
|
|
621
|
-
|
|
632
|
+
z,
|
|
622
633
|
{
|
|
623
634
|
variant: "outline",
|
|
624
635
|
className: "h-7 p-2",
|
|
@@ -626,46 +637,46 @@ function bn() {
|
|
|
626
637
|
disabled: !a,
|
|
627
638
|
onClick: x,
|
|
628
639
|
children: [
|
|
629
|
-
/* @__PURE__ */ e.jsx(
|
|
640
|
+
/* @__PURE__ */ e.jsx(Ps, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
630
641
|
"Add Frame"
|
|
631
642
|
]
|
|
632
643
|
}
|
|
633
644
|
),
|
|
634
645
|
!a && /* @__PURE__ */ e.jsx(
|
|
635
|
-
|
|
646
|
+
z,
|
|
636
647
|
{
|
|
637
648
|
variant: "outline",
|
|
638
649
|
className: "h-7 p-2",
|
|
639
|
-
onClick:
|
|
650
|
+
onClick: f,
|
|
640
651
|
size: "sm",
|
|
641
|
-
children: /* @__PURE__ */ e.jsx(
|
|
652
|
+
children: /* @__PURE__ */ e.jsx(da, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
642
653
|
}
|
|
643
654
|
),
|
|
644
655
|
a && !i && /* @__PURE__ */ e.jsx(
|
|
645
|
-
|
|
656
|
+
z,
|
|
646
657
|
{
|
|
647
658
|
variant: "outline",
|
|
648
659
|
role: "close",
|
|
649
660
|
className: "h-7 p-2",
|
|
650
661
|
onClick: () => {
|
|
651
|
-
u(!1),
|
|
662
|
+
u(!1), N(!1);
|
|
652
663
|
},
|
|
653
664
|
size: "sm",
|
|
654
|
-
children: /* @__PURE__ */ e.jsx(
|
|
665
|
+
children: /* @__PURE__ */ e.jsx(_e, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
655
666
|
}
|
|
656
667
|
),
|
|
657
668
|
a && !i && /* @__PURE__ */ e.jsx(
|
|
658
|
-
|
|
669
|
+
z,
|
|
659
670
|
{
|
|
660
671
|
className: "h-7 p-2",
|
|
661
672
|
variant: "outline",
|
|
662
|
-
onClick:
|
|
673
|
+
onClick: w,
|
|
663
674
|
size: "sm",
|
|
664
|
-
children: /* @__PURE__ */ e.jsx(
|
|
675
|
+
children: /* @__PURE__ */ e.jsx(dn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
665
676
|
}
|
|
666
677
|
),
|
|
667
678
|
!o && !i && a && /* @__PURE__ */ e.jsx(
|
|
668
|
-
|
|
679
|
+
z,
|
|
669
680
|
{
|
|
670
681
|
className: "h-7 p-2",
|
|
671
682
|
variant: "outline",
|
|
@@ -681,7 +692,7 @@ function bn() {
|
|
|
681
692
|
}
|
|
682
693
|
);
|
|
683
694
|
}
|
|
684
|
-
function
|
|
695
|
+
function Qe({
|
|
685
696
|
title: s,
|
|
686
697
|
items: n,
|
|
687
698
|
value: a,
|
|
@@ -690,30 +701,30 @@ function Ge({
|
|
|
690
701
|
connectionTooltip: o,
|
|
691
702
|
onChange: l,
|
|
692
703
|
className: c,
|
|
693
|
-
showIcon:
|
|
694
|
-
disabled:
|
|
704
|
+
showIcon: h = !0,
|
|
705
|
+
disabled: g = !1
|
|
695
706
|
}) {
|
|
696
707
|
const m = t ? "Loading..." : i ? "Error" : a;
|
|
697
708
|
function u() {
|
|
698
709
|
if (s === "Connection")
|
|
699
|
-
return /* @__PURE__ */ e.jsx(
|
|
710
|
+
return /* @__PURE__ */ e.jsx(cn, { className: "size-4 rotate-90" });
|
|
700
711
|
if (s === "Database")
|
|
701
|
-
return /* @__PURE__ */ e.jsx(
|
|
712
|
+
return /* @__PURE__ */ e.jsx(Wt, { className: "size-4" });
|
|
702
713
|
if (s === "Schema")
|
|
703
|
-
return /* @__PURE__ */ e.jsx(
|
|
714
|
+
return /* @__PURE__ */ e.jsx(rn, { className: "size-4" });
|
|
704
715
|
if (s === "Table")
|
|
705
|
-
return /* @__PURE__ */ e.jsx(
|
|
716
|
+
return /* @__PURE__ */ e.jsx(Ns, { className: "size-4" });
|
|
706
717
|
}
|
|
707
718
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
708
|
-
|
|
709
|
-
/* @__PURE__ */ e.jsx(
|
|
710
|
-
/* @__PURE__ */ e.jsx(
|
|
719
|
+
h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(ys, { children: [
|
|
720
|
+
/* @__PURE__ */ e.jsx(Js, { children: u() }),
|
|
721
|
+
/* @__PURE__ */ e.jsx(vs, { className: "text-xs", align: "start", children: o })
|
|
711
722
|
] }) : u() }),
|
|
712
|
-
/* @__PURE__ */ e.jsxs(Oe, { disabled:
|
|
723
|
+
/* @__PURE__ */ e.jsxs(Oe, { disabled: g, value: m, onValueChange: l, children: [
|
|
713
724
|
/* @__PURE__ */ e.jsx(
|
|
714
725
|
Me,
|
|
715
726
|
{
|
|
716
|
-
className:
|
|
727
|
+
className: Y(
|
|
717
728
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
718
729
|
c
|
|
719
730
|
),
|
|
@@ -725,32 +736,32 @@ function Ge({
|
|
|
725
736
|
)
|
|
726
737
|
}
|
|
727
738
|
),
|
|
728
|
-
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(
|
|
739
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
|
|
729
740
|
t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
|
|
730
|
-
/* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((
|
|
741
|
+
/* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((N, d) => /* @__PURE__ */ e.jsx(X, { value: N.id, children: N.name }, d)) }),
|
|
731
742
|
(t || i) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
|
|
732
743
|
] }) })
|
|
733
744
|
] })
|
|
734
745
|
] });
|
|
735
746
|
}
|
|
736
|
-
function
|
|
737
|
-
const [n, a] =
|
|
747
|
+
function Nn({ column: s }) {
|
|
748
|
+
const [n, a] = T(!1), t = r((m) => m.selectedTableName), i = r(
|
|
738
749
|
(m) => m.selectedSchemaName
|
|
739
|
-
), o = r((m) => m.sqlGen), l = r((m) => m.actions.setSqlGen), c = r((m) => m.actions.setCardSql),
|
|
740
|
-
function
|
|
741
|
-
const
|
|
742
|
-
l(
|
|
743
|
-
const
|
|
744
|
-
|
|
750
|
+
), o = r((m) => m.sqlGen), l = r((m) => m.actions.setSqlGen), c = r((m) => m.actions.setCardSql), h = r((m) => m.actions.setRunSql);
|
|
751
|
+
function g(m, u) {
|
|
752
|
+
const N = Qs(m, o, u);
|
|
753
|
+
l(N);
|
|
754
|
+
const d = Ws(
|
|
755
|
+
N,
|
|
745
756
|
he(i || ""),
|
|
746
757
|
he(t)
|
|
747
758
|
);
|
|
748
|
-
|
|
759
|
+
d && (c(d), h(!0)), a(!1);
|
|
749
760
|
}
|
|
750
|
-
return /* @__PURE__ */ e.jsxs(
|
|
751
|
-
/* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
761
|
+
return /* @__PURE__ */ e.jsxs(Pe, { open: n, onOpenChange: a, children: [
|
|
762
|
+
/* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx($a, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
|
|
752
763
|
/* @__PURE__ */ e.jsx(
|
|
753
|
-
|
|
764
|
+
Ge,
|
|
754
765
|
{
|
|
755
766
|
align: "center",
|
|
756
767
|
className: "w-18 rounded-md p-0 shadow-none",
|
|
@@ -758,7 +769,7 @@ function yn({ column: s }) {
|
|
|
758
769
|
/* @__PURE__ */ e.jsx(
|
|
759
770
|
"li",
|
|
760
771
|
{
|
|
761
|
-
onClick: () =>
|
|
772
|
+
onClick: () => g(s, "COUNT"),
|
|
762
773
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
763
774
|
children: "Count"
|
|
764
775
|
}
|
|
@@ -766,7 +777,7 @@ function yn({ column: s }) {
|
|
|
766
777
|
/* @__PURE__ */ e.jsx(
|
|
767
778
|
"li",
|
|
768
779
|
{
|
|
769
|
-
onClick: () =>
|
|
780
|
+
onClick: () => g(s, "AVG"),
|
|
770
781
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
771
782
|
children: "Avg"
|
|
772
783
|
}
|
|
@@ -774,7 +785,7 @@ function yn({ column: s }) {
|
|
|
774
785
|
/* @__PURE__ */ e.jsx(
|
|
775
786
|
"li",
|
|
776
787
|
{
|
|
777
|
-
onClick: () =>
|
|
788
|
+
onClick: () => g(s, "SUM"),
|
|
778
789
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
779
790
|
children: "Sum"
|
|
780
791
|
}
|
|
@@ -782,7 +793,7 @@ function yn({ column: s }) {
|
|
|
782
793
|
/* @__PURE__ */ e.jsx(
|
|
783
794
|
"li",
|
|
784
795
|
{
|
|
785
|
-
onClick: () =>
|
|
796
|
+
onClick: () => g(s, "MAX"),
|
|
786
797
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
787
798
|
children: "Max"
|
|
788
799
|
}
|
|
@@ -790,7 +801,7 @@ function yn({ column: s }) {
|
|
|
790
801
|
/* @__PURE__ */ e.jsx(
|
|
791
802
|
"li",
|
|
792
803
|
{
|
|
793
|
-
onClick: () =>
|
|
804
|
+
onClick: () => g(s, "MIN"),
|
|
794
805
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
795
806
|
children: "Min"
|
|
796
807
|
}
|
|
@@ -800,82 +811,84 @@ function yn({ column: s }) {
|
|
|
800
811
|
)
|
|
801
812
|
] });
|
|
802
813
|
}
|
|
803
|
-
function
|
|
804
|
-
return /* @__PURE__ */ e.jsxs(
|
|
805
|
-
/* @__PURE__ */ e.jsx(
|
|
814
|
+
function ua({ column: s }) {
|
|
815
|
+
return /* @__PURE__ */ e.jsxs(ys, { children: [
|
|
816
|
+
/* @__PURE__ */ e.jsx(Ka, { asChild: !0, children: Pa.includes(s.data_type.toLowerCase()) ? (
|
|
806
817
|
// <span className=" font-thin">T</span>
|
|
807
|
-
/* @__PURE__ */ e.jsx(
|
|
818
|
+
/* @__PURE__ */ e.jsx(fn, { className: "size-3" })
|
|
808
819
|
) : Ys.includes(s.data_type.toLowerCase()) ? (
|
|
809
820
|
//
|
|
810
|
-
/* @__PURE__ */ e.jsx(
|
|
811
|
-
) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(
|
|
812
|
-
/* @__PURE__ */ e.jsx(
|
|
821
|
+
/* @__PURE__ */ e.jsx(en, { className: "size-3" })
|
|
822
|
+
) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ga, { className: "size-3" }) : Ja.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(pn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(hn, { className: "size-3" }) }),
|
|
823
|
+
/* @__PURE__ */ e.jsx(vs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
813
824
|
] });
|
|
814
825
|
}
|
|
815
|
-
function
|
|
826
|
+
function Cn({
|
|
816
827
|
schemaName: s,
|
|
817
828
|
tableName: n,
|
|
818
829
|
columns: a,
|
|
819
830
|
status: t
|
|
820
831
|
}) {
|
|
821
|
-
const i = r((
|
|
822
|
-
(
|
|
832
|
+
const i = r((j) => j.sqlGen), o = r(
|
|
833
|
+
(j) => j.selectedConnectionId
|
|
823
834
|
), l = r(
|
|
824
|
-
(
|
|
835
|
+
(j) => j.selectedDatabaseName
|
|
825
836
|
), c = r(
|
|
826
|
-
(
|
|
827
|
-
),
|
|
828
|
-
(
|
|
829
|
-
), { setAIScopeTables: m } = k((
|
|
830
|
-
(
|
|
831
|
-
), x = r((
|
|
832
|
-
function j
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
+
(j) => j.selectedSchemaName
|
|
838
|
+
), h = r((j) => j.selectedTableName), g = k(
|
|
839
|
+
(j) => j.dashboard.aiScopeTables
|
|
840
|
+
), { setAIScopeTables: m } = k((j) => j.actions), u = r((j) => j.actions.setRunSql), N = r((j) => j.actions.setSqlGen), d = r(
|
|
841
|
+
(j) => j.actions.setIsShowingVisual
|
|
842
|
+
), x = r((j) => j.actions.setCardSql), { connectionType: f } = xa();
|
|
843
|
+
function w(j) {
|
|
844
|
+
const F = Qs(j, i);
|
|
845
|
+
N(F);
|
|
846
|
+
const A = Ws(F, he(s), he(n));
|
|
847
|
+
A && (x(A), u(!0));
|
|
837
848
|
}
|
|
838
849
|
function b() {
|
|
839
|
-
return (
|
|
840
|
-
(
|
|
850
|
+
return (g == null ? void 0 : g.find(
|
|
851
|
+
(j) => j.connectinonId === o && j.tableName === h
|
|
841
852
|
)) !== void 0;
|
|
842
853
|
}
|
|
843
|
-
function L(
|
|
844
|
-
if (
|
|
845
|
-
const
|
|
854
|
+
function L(j) {
|
|
855
|
+
if (j === !0 && h && o) {
|
|
856
|
+
const F = {
|
|
846
857
|
connectinonId: o,
|
|
847
|
-
connectionType:
|
|
858
|
+
connectionType: f,
|
|
848
859
|
databaseName: l,
|
|
849
860
|
schemaName: c,
|
|
850
|
-
tableName:
|
|
851
|
-
},
|
|
852
|
-
(
|
|
853
|
-
(D) => D.connectinonId ===
|
|
861
|
+
tableName: h
|
|
862
|
+
}, q = [...g || [], F].filter(
|
|
863
|
+
(P, $, G) => G.findIndex(
|
|
864
|
+
(D) => D.connectinonId === P.connectinonId && D.tableName === P.tableName
|
|
854
865
|
) === $
|
|
855
866
|
);
|
|
856
|
-
m(
|
|
867
|
+
m(q), cs.success(`Added '${h}' to AI Scope`, {
|
|
857
868
|
position: "top-right",
|
|
858
869
|
duration: 2500,
|
|
859
870
|
richColors: !0
|
|
860
871
|
});
|
|
861
872
|
} else {
|
|
862
|
-
const
|
|
863
|
-
(
|
|
873
|
+
const F = (g || []).filter(
|
|
874
|
+
(A) => A.connectinonId !== o && A.tableName !== h
|
|
864
875
|
);
|
|
865
|
-
m(
|
|
876
|
+
m(F), cs(`Removed '${h}' from AI Scope`, {
|
|
866
877
|
position: "top-right",
|
|
867
878
|
duration: 2e3,
|
|
868
879
|
richColors: !0
|
|
869
880
|
});
|
|
870
881
|
}
|
|
871
882
|
}
|
|
872
|
-
function
|
|
873
|
-
let
|
|
874
|
-
((
|
|
883
|
+
function C() {
|
|
884
|
+
let F = ds(s, n);
|
|
885
|
+
((P) => P.charAt(0) === P.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1);
|
|
886
|
+
const q = f === "MSSQL" ? `SELECT top 10 * FROM ${F}` : `SELECT * FROM ${F} LIMIT 10`;
|
|
887
|
+
x(q), u(!0);
|
|
875
888
|
}
|
|
876
889
|
function O() {
|
|
877
|
-
let
|
|
878
|
-
((
|
|
890
|
+
let F = ds(s, n);
|
|
891
|
+
((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT COUNT(*) as count FROM ${F}`), u(!0);
|
|
879
892
|
}
|
|
880
893
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
881
894
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
@@ -888,9 +901,9 @@ function vn({
|
|
|
888
901
|
variant: "outline",
|
|
889
902
|
className: "h-9 px-2",
|
|
890
903
|
children: /* @__PURE__ */ e.jsx(
|
|
891
|
-
|
|
904
|
+
Qa,
|
|
892
905
|
{
|
|
893
|
-
className:
|
|
906
|
+
className: Y("size-4", {
|
|
894
907
|
"text-primary": b(),
|
|
895
908
|
"text-muted-foreground": !b()
|
|
896
909
|
})
|
|
@@ -899,21 +912,21 @@ function vn({
|
|
|
899
912
|
}
|
|
900
913
|
),
|
|
901
914
|
/* @__PURE__ */ e.jsxs(
|
|
902
|
-
|
|
915
|
+
z,
|
|
903
916
|
{
|
|
904
917
|
disabled: t !== "Success",
|
|
905
|
-
onClick:
|
|
918
|
+
onClick: C,
|
|
906
919
|
size: "sm",
|
|
907
920
|
variant: "secondary",
|
|
908
921
|
className: "flex",
|
|
909
922
|
children: [
|
|
910
|
-
t !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
923
|
+
t !== "Success" ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(un, { className: "mr-2 size-4" }),
|
|
911
924
|
"Top 10"
|
|
912
925
|
]
|
|
913
926
|
}
|
|
914
927
|
),
|
|
915
928
|
/* @__PURE__ */ e.jsxs(
|
|
916
|
-
|
|
929
|
+
z,
|
|
917
930
|
{
|
|
918
931
|
disabled: t !== "Success",
|
|
919
932
|
onClick: O,
|
|
@@ -921,84 +934,84 @@ function vn({
|
|
|
921
934
|
variant: "secondary",
|
|
922
935
|
className: "flex",
|
|
923
936
|
children: [
|
|
924
|
-
t !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
937
|
+
t !== "Success" ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(mn, { className: "mr-2 size-4" }),
|
|
925
938
|
"Count"
|
|
926
939
|
]
|
|
927
940
|
}
|
|
928
941
|
)
|
|
929
942
|
] }),
|
|
930
943
|
/* @__PURE__ */ e.jsxs(
|
|
931
|
-
|
|
944
|
+
Cs,
|
|
932
945
|
{
|
|
933
946
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
934
947
|
children: [
|
|
935
|
-
a == null ? void 0 : a.map((
|
|
948
|
+
a == null ? void 0 : a.map((j) => /* @__PURE__ */ e.jsxs(
|
|
936
949
|
"div",
|
|
937
950
|
{
|
|
938
|
-
onClick: () => j
|
|
939
|
-
className:
|
|
951
|
+
onClick: () => w(j),
|
|
952
|
+
className: Y(
|
|
940
953
|
"mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
941
954
|
{
|
|
942
|
-
"bg-muted":
|
|
955
|
+
"bg-muted": Wa(j, i)
|
|
943
956
|
}
|
|
944
957
|
),
|
|
945
958
|
children: [
|
|
946
959
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
947
|
-
/* @__PURE__ */ e.jsx(
|
|
948
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
960
|
+
/* @__PURE__ */ e.jsx(ua, { column: j }),
|
|
961
|
+
/* @__PURE__ */ e.jsx("span", { children: j.column_name })
|
|
949
962
|
] }),
|
|
950
|
-
Ys.includes(
|
|
963
|
+
Ys.includes(j.data_type) && /* @__PURE__ */ e.jsx(
|
|
951
964
|
"div",
|
|
952
965
|
{
|
|
953
|
-
onClick: (
|
|
966
|
+
onClick: (F) => F.stopPropagation(),
|
|
954
967
|
className: "flex items-center justify-end",
|
|
955
|
-
children: /* @__PURE__ */ e.jsx(
|
|
968
|
+
children: /* @__PURE__ */ e.jsx(Nn, { column: j })
|
|
956
969
|
}
|
|
957
970
|
)
|
|
958
971
|
]
|
|
959
972
|
},
|
|
960
|
-
|
|
973
|
+
j.column_name
|
|
961
974
|
)),
|
|
962
|
-
/* @__PURE__ */ e.jsx(
|
|
963
|
-
/* @__PURE__ */ e.jsx(
|
|
975
|
+
/* @__PURE__ */ e.jsx(Es, { orientation: "vertical" }),
|
|
976
|
+
/* @__PURE__ */ e.jsx(Es, { orientation: "horizontal" })
|
|
964
977
|
]
|
|
965
978
|
}
|
|
966
979
|
)
|
|
967
980
|
] });
|
|
968
981
|
}
|
|
969
|
-
function
|
|
970
|
-
var ss, ve,
|
|
971
|
-
let a =
|
|
982
|
+
function xa(s, n) {
|
|
983
|
+
var ss, ve, Je, qe;
|
|
984
|
+
let a = Ut(() => [], []);
|
|
972
985
|
const t = es().authToken || s, i = r(
|
|
973
986
|
(S) => S.selectedConnectionId
|
|
974
987
|
), o = r(
|
|
975
988
|
(S) => S.selectedDatabaseName
|
|
976
989
|
), l = r(
|
|
977
990
|
(S) => S.selectedSchemaName
|
|
978
|
-
), c = r((S) => S.selectedTableName),
|
|
991
|
+
), c = r((S) => S.selectedTableName), h = r(
|
|
979
992
|
(S) => S.actions.setCurrentColumns
|
|
980
|
-
),
|
|
993
|
+
), g = r(
|
|
981
994
|
(S) => S.actions.setSelectedConnectionId
|
|
982
995
|
), m = r(
|
|
983
996
|
(S) => S.actions.setSelectedDatabaseName
|
|
984
997
|
), u = r(
|
|
985
998
|
(S) => S.actions.setSelectedSchemaName
|
|
986
|
-
),
|
|
999
|
+
), N = r(
|
|
987
1000
|
(S) => S.actions.setSelectedTableName
|
|
988
|
-
),
|
|
1001
|
+
), d = r((S) => S.actions.setCardSql);
|
|
989
1002
|
function x(S) {
|
|
990
1003
|
return i && o && l && o !== "NA" ? !0 : i && S === "API" ? !1 : !!(i && S === "S3");
|
|
991
1004
|
}
|
|
992
|
-
function
|
|
1005
|
+
function f(S) {
|
|
993
1006
|
return !!(i && o && o !== "NA" && l && c || i && (S === "S3" || S === "API"));
|
|
994
1007
|
}
|
|
995
|
-
function
|
|
1008
|
+
function w(S) {
|
|
996
1009
|
return i && S ? !(S === "API" || S === "S3") : !1;
|
|
997
1010
|
}
|
|
998
1011
|
const {
|
|
999
1012
|
data: b,
|
|
1000
1013
|
isLoading: L,
|
|
1001
|
-
isError:
|
|
1014
|
+
isError: C
|
|
1002
1015
|
} = Ce({
|
|
1003
1016
|
queryKey: ["connections"],
|
|
1004
1017
|
queryFn: () => ze(
|
|
@@ -1009,12 +1022,12 @@ function ua(s, n) {
|
|
|
1009
1022
|
// Only fetch if authToken is present
|
|
1010
1023
|
}), O = b == null ? void 0 : b.connections.find(
|
|
1011
1024
|
(S) => S.id === i
|
|
1012
|
-
),
|
|
1013
|
-
data:
|
|
1014
|
-
isLoading:
|
|
1015
|
-
isFetching:
|
|
1025
|
+
), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
|
|
1026
|
+
data: A,
|
|
1027
|
+
isLoading: q,
|
|
1028
|
+
isFetching: P,
|
|
1016
1029
|
isError: $,
|
|
1017
|
-
refetch:
|
|
1030
|
+
refetch: G
|
|
1018
1031
|
} = Ce({
|
|
1019
1032
|
queryKey: ["databases", i],
|
|
1020
1033
|
queryFn: () => ze(
|
|
@@ -1024,12 +1037,12 @@ function ua(s, n) {
|
|
|
1024
1037
|
connection_id: i
|
|
1025
1038
|
}
|
|
1026
1039
|
),
|
|
1027
|
-
enabled: j
|
|
1040
|
+
enabled: w(j)
|
|
1028
1041
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1029
1042
|
}), {
|
|
1030
1043
|
data: D,
|
|
1031
1044
|
isLoading: te,
|
|
1032
|
-
isFetching:
|
|
1045
|
+
isFetching: Q,
|
|
1033
1046
|
isError: ee,
|
|
1034
1047
|
refetch: Z
|
|
1035
1048
|
} = Ce({
|
|
@@ -1042,14 +1055,14 @@ function ua(s, n) {
|
|
|
1042
1055
|
database_name: o
|
|
1043
1056
|
}
|
|
1044
1057
|
),
|
|
1045
|
-
enabled: !!i && !!o && !
|
|
1058
|
+
enabled: !!i && !!o && !F && o !== "NA"
|
|
1046
1059
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1047
1060
|
}), {
|
|
1048
1061
|
data: J,
|
|
1049
1062
|
isLoading: I,
|
|
1050
|
-
isFetching:
|
|
1051
|
-
isError:
|
|
1052
|
-
refetch:
|
|
1063
|
+
isFetching: y,
|
|
1064
|
+
isError: v,
|
|
1065
|
+
refetch: M
|
|
1053
1066
|
} = Ce({
|
|
1054
1067
|
queryKey: [
|
|
1055
1068
|
"tables",
|
|
@@ -1066,7 +1079,7 @@ function ua(s, n) {
|
|
|
1066
1079
|
schema_name: l
|
|
1067
1080
|
}
|
|
1068
1081
|
),
|
|
1069
|
-
enabled: x(
|
|
1082
|
+
enabled: x(j)
|
|
1070
1083
|
}), {
|
|
1071
1084
|
data: H,
|
|
1072
1085
|
isLoading: ue,
|
|
@@ -1090,7 +1103,7 @@ function ua(s, n) {
|
|
|
1090
1103
|
table_name: c
|
|
1091
1104
|
}
|
|
1092
1105
|
),
|
|
1093
|
-
enabled:
|
|
1106
|
+
enabled: f(j)
|
|
1094
1107
|
// (!!selectedConnectionId &&
|
|
1095
1108
|
// !!selectedDatabaseName &&
|
|
1096
1109
|
// !!selectedSchemaName &&
|
|
@@ -1100,37 +1113,37 @@ function ua(s, n) {
|
|
|
1100
1113
|
// && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
|
|
1101
1114
|
});
|
|
1102
1115
|
K(() => {
|
|
1103
|
-
|
|
1104
|
-
}, [H,
|
|
1116
|
+
h(a);
|
|
1117
|
+
}, [H, h, a]), K(() => {
|
|
1105
1118
|
}, [
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1119
|
+
F,
|
|
1120
|
+
d,
|
|
1121
|
+
N,
|
|
1109
1122
|
u,
|
|
1110
1123
|
m,
|
|
1111
1124
|
O
|
|
1112
1125
|
]);
|
|
1113
|
-
const je = (O == null ? void 0 : O.type) === "API" ? (ss = O == null ? void 0 : O.type) == null ? void 0 : ss.toLowerCase() : c || "", be =
|
|
1126
|
+
const je = (O == null ? void 0 : O.type) === "API" ? (ss = O == null ? void 0 : O.type) == null ? void 0 : ss.toLowerCase() : c || "", be = F ? "" : l || "";
|
|
1114
1127
|
function xe(S) {
|
|
1115
|
-
u(S),
|
|
1128
|
+
u(S), N("");
|
|
1116
1129
|
}
|
|
1117
|
-
function
|
|
1118
|
-
m(S), u(""),
|
|
1130
|
+
function U(S) {
|
|
1131
|
+
m(S), u(""), N("");
|
|
1119
1132
|
}
|
|
1120
1133
|
function ne(S) {
|
|
1121
|
-
|
|
1134
|
+
g(S);
|
|
1122
1135
|
}
|
|
1123
|
-
|
|
1136
|
+
A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((S) => ({
|
|
1124
1137
|
...S,
|
|
1125
1138
|
data_type: S.data_type.toLowerCase()
|
|
1126
|
-
}))), $ && (a = []), (ge ||
|
|
1139
|
+
}))), $ && (a = []), (ge || C) && (a = []);
|
|
1127
1140
|
const le = b == null ? void 0 : b.connections.map(
|
|
1128
1141
|
(S) => ({
|
|
1129
1142
|
id: S.id,
|
|
1130
1143
|
name: S.name,
|
|
1131
1144
|
type: S.type
|
|
1132
1145
|
})
|
|
1133
|
-
), ye =
|
|
1146
|
+
), ye = A == null ? void 0 : A.databases.map((S) => ({
|
|
1134
1147
|
id: S.database_name,
|
|
1135
1148
|
name: S.database_name
|
|
1136
1149
|
})), re = D == null ? void 0 : D.schemas.map((S) => ({
|
|
@@ -1143,29 +1156,29 @@ function ua(s, n) {
|
|
|
1143
1156
|
return {
|
|
1144
1157
|
connectionItems: le,
|
|
1145
1158
|
isConnectionsLoading: L,
|
|
1146
|
-
isConnectionsError:
|
|
1159
|
+
isConnectionsError: C,
|
|
1147
1160
|
databaseItems: ye,
|
|
1148
|
-
isDatabasesLoadingOrFetching:
|
|
1161
|
+
isDatabasesLoadingOrFetching: q || P,
|
|
1149
1162
|
isDatabaseError: $,
|
|
1150
1163
|
schemaItems: re,
|
|
1151
|
-
isSchemaLoadingOrFetching: te ||
|
|
1164
|
+
isSchemaLoadingOrFetching: te || Q,
|
|
1152
1165
|
isSchemaError: ee,
|
|
1153
1166
|
tableItems: Ie,
|
|
1154
|
-
isTableLoadingOrFetching: I ||
|
|
1155
|
-
isTableError:
|
|
1167
|
+
isTableLoadingOrFetching: I || y,
|
|
1168
|
+
isTableError: v,
|
|
1156
1169
|
columns: a,
|
|
1157
1170
|
isColumnsLoadingOrFetching: ue || se,
|
|
1158
1171
|
isColumnsError: ge,
|
|
1159
|
-
isNonDbConnection:
|
|
1160
|
-
connectionType:
|
|
1172
|
+
isNonDbConnection: F,
|
|
1173
|
+
connectionType: j,
|
|
1161
1174
|
tableName: je,
|
|
1162
1175
|
schemaName: be,
|
|
1163
1176
|
handleConnectionChange: ne,
|
|
1164
|
-
handleDatabaseChange:
|
|
1177
|
+
handleDatabaseChange: U,
|
|
1165
1178
|
handleSchemaChange: xe
|
|
1166
1179
|
};
|
|
1167
1180
|
}
|
|
1168
|
-
function
|
|
1181
|
+
function pa({
|
|
1169
1182
|
ColumnsComponent: s
|
|
1170
1183
|
}) {
|
|
1171
1184
|
var J;
|
|
@@ -1180,32 +1193,32 @@ function xa({
|
|
|
1180
1193
|
), {
|
|
1181
1194
|
connectionItems: l,
|
|
1182
1195
|
schemaItems: c,
|
|
1183
|
-
databaseItems:
|
|
1184
|
-
tableItems:
|
|
1196
|
+
databaseItems: h,
|
|
1197
|
+
tableItems: g,
|
|
1185
1198
|
columns: m,
|
|
1186
1199
|
isConnectionsLoading: u,
|
|
1187
|
-
isConnectionsError:
|
|
1188
|
-
isDatabasesLoadingOrFetching:
|
|
1200
|
+
isConnectionsError: N,
|
|
1201
|
+
isDatabasesLoadingOrFetching: d,
|
|
1189
1202
|
isDatabaseError: x,
|
|
1190
|
-
isSchemaLoadingOrFetching:
|
|
1191
|
-
isSchemaError:
|
|
1203
|
+
isSchemaLoadingOrFetching: f,
|
|
1204
|
+
isSchemaError: w,
|
|
1192
1205
|
isColumnsError: b,
|
|
1193
1206
|
isColumnsLoadingOrFetching: L,
|
|
1194
|
-
isTableLoadingOrFetching:
|
|
1207
|
+
isTableLoadingOrFetching: C,
|
|
1195
1208
|
isTableError: O,
|
|
1196
|
-
connectionType:
|
|
1197
|
-
isNonDbConnection:
|
|
1198
|
-
handleConnectionChange:
|
|
1199
|
-
handleDatabaseChange:
|
|
1200
|
-
handleSchemaChange:
|
|
1209
|
+
connectionType: j,
|
|
1210
|
+
isNonDbConnection: F,
|
|
1211
|
+
handleConnectionChange: A,
|
|
1212
|
+
handleDatabaseChange: q,
|
|
1213
|
+
handleSchemaChange: P,
|
|
1201
1214
|
tableName: $,
|
|
1202
|
-
schemaName:
|
|
1203
|
-
} =
|
|
1215
|
+
schemaName: G
|
|
1216
|
+
} = xa();
|
|
1204
1217
|
function D() {
|
|
1205
|
-
return s ? s(
|
|
1206
|
-
|
|
1218
|
+
return s ? s(G, $, m) : /* @__PURE__ */ e.jsx(
|
|
1219
|
+
Cn,
|
|
1207
1220
|
{
|
|
1208
|
-
schemaName:
|
|
1221
|
+
schemaName: G,
|
|
1209
1222
|
tableName: $,
|
|
1210
1223
|
columns: m,
|
|
1211
1224
|
status: L ? "Loading..." : b ? "Error" : "Success"
|
|
@@ -1215,26 +1228,26 @@ function xa({
|
|
|
1215
1228
|
function te() {
|
|
1216
1229
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1217
1230
|
}
|
|
1218
|
-
function
|
|
1219
|
-
return
|
|
1220
|
-
|
|
1231
|
+
function Q() {
|
|
1232
|
+
return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1233
|
+
Qe,
|
|
1221
1234
|
{
|
|
1222
|
-
onChange:
|
|
1235
|
+
onChange: q,
|
|
1223
1236
|
isError: x,
|
|
1224
|
-
isLoading:
|
|
1225
|
-
items:
|
|
1237
|
+
isLoading: d,
|
|
1238
|
+
items: h,
|
|
1226
1239
|
value: a || "",
|
|
1227
1240
|
title: "Database"
|
|
1228
1241
|
}
|
|
1229
1242
|
);
|
|
1230
1243
|
}
|
|
1231
1244
|
function ee() {
|
|
1232
|
-
return
|
|
1233
|
-
|
|
1245
|
+
return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1246
|
+
Qe,
|
|
1234
1247
|
{
|
|
1235
|
-
onChange:
|
|
1236
|
-
isError:
|
|
1237
|
-
isLoading:
|
|
1248
|
+
onChange: P,
|
|
1249
|
+
isError: w,
|
|
1250
|
+
isLoading: f,
|
|
1238
1251
|
items: c,
|
|
1239
1252
|
value: t || "",
|
|
1240
1253
|
title: "Schema"
|
|
@@ -1242,13 +1255,13 @@ function xa({
|
|
|
1242
1255
|
);
|
|
1243
1256
|
}
|
|
1244
1257
|
function Z() {
|
|
1245
|
-
return
|
|
1246
|
-
|
|
1258
|
+
return j === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1259
|
+
Qe,
|
|
1247
1260
|
{
|
|
1248
1261
|
onChange: o,
|
|
1249
1262
|
isError: O,
|
|
1250
|
-
items:
|
|
1251
|
-
isLoading:
|
|
1263
|
+
items: g,
|
|
1264
|
+
isLoading: C,
|
|
1252
1265
|
value: i || "",
|
|
1253
1266
|
title: "Table"
|
|
1254
1267
|
}
|
|
@@ -1257,40 +1270,40 @@ function xa({
|
|
|
1257
1270
|
return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
|
|
1258
1271
|
/* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
|
|
1259
1272
|
/* @__PURE__ */ e.jsx(
|
|
1260
|
-
|
|
1273
|
+
Qe,
|
|
1261
1274
|
{
|
|
1262
1275
|
items: l,
|
|
1263
1276
|
title: "Connection",
|
|
1264
1277
|
value: n || "",
|
|
1265
|
-
onChange:
|
|
1278
|
+
onChange: A,
|
|
1266
1279
|
isLoading: u,
|
|
1267
|
-
isError:
|
|
1280
|
+
isError: N,
|
|
1268
1281
|
connectionTooltip: ((J = l == null ? void 0 : l.find(
|
|
1269
1282
|
(I) => I.id === n
|
|
1270
1283
|
)) == null ? void 0 : J.type) || ""
|
|
1271
1284
|
}
|
|
1272
1285
|
),
|
|
1273
|
-
|
|
1286
|
+
Q(),
|
|
1274
1287
|
ee(),
|
|
1275
1288
|
Z()
|
|
1276
1289
|
] }),
|
|
1277
1290
|
D(),
|
|
1278
1291
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1279
|
-
|
|
1292
|
+
z,
|
|
1280
1293
|
{
|
|
1281
1294
|
onClick: te,
|
|
1282
1295
|
size: "sm",
|
|
1283
1296
|
variant: "secondary",
|
|
1284
1297
|
className: "w-full",
|
|
1285
1298
|
children: [
|
|
1286
|
-
/* @__PURE__ */ e.jsx(
|
|
1299
|
+
/* @__PURE__ */ e.jsx(ln, { className: "mr-2 size-4" }),
|
|
1287
1300
|
"Help"
|
|
1288
1301
|
]
|
|
1289
1302
|
}
|
|
1290
1303
|
) })
|
|
1291
1304
|
] });
|
|
1292
1305
|
}
|
|
1293
|
-
function
|
|
1306
|
+
function Sn(s) {
|
|
1294
1307
|
const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
|
|
1295
1308
|
let o = s.length;
|
|
1296
1309
|
if (i !== -1 && (o = i), t !== -1 && t < o && (o = t), n !== -1) {
|
|
@@ -1306,17 +1319,17 @@ function Nn(s) {
|
|
|
1306
1319
|
return `${l} {{ filters | where }} ${c}`;
|
|
1307
1320
|
}
|
|
1308
1321
|
}
|
|
1309
|
-
function
|
|
1322
|
+
function kn({
|
|
1310
1323
|
error: s,
|
|
1311
1324
|
setShowAIDialog: n,
|
|
1312
1325
|
setUserInputforAI: a,
|
|
1313
1326
|
setTriggerAIRun: t
|
|
1314
1327
|
}) {
|
|
1315
1328
|
return /* @__PURE__ */ e.jsxs(Zs, { openDelay: 0, children: [
|
|
1316
|
-
/* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1329
|
+
/* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Qt, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1317
1330
|
/* @__PURE__ */ e.jsx(sa, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
|
|
1318
1331
|
/* @__PURE__ */ e.jsxs(
|
|
1319
|
-
|
|
1332
|
+
z,
|
|
1320
1333
|
{
|
|
1321
1334
|
onClick: () => {
|
|
1322
1335
|
n(!0), a(s), t(!0);
|
|
@@ -1324,27 +1337,27 @@ function Cn({
|
|
|
1324
1337
|
size: "sm",
|
|
1325
1338
|
variant: "outline",
|
|
1326
1339
|
children: [
|
|
1327
|
-
/* @__PURE__ */ e.jsx(
|
|
1340
|
+
/* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4 mr-2" }),
|
|
1328
1341
|
"Fix It"
|
|
1329
1342
|
]
|
|
1330
1343
|
}
|
|
1331
1344
|
),
|
|
1332
|
-
/* @__PURE__ */ e.jsx(
|
|
1345
|
+
/* @__PURE__ */ e.jsx(Cs, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
|
|
1333
1346
|
] }) }) })
|
|
1334
1347
|
] });
|
|
1335
1348
|
}
|
|
1336
|
-
function
|
|
1349
|
+
function wn({
|
|
1337
1350
|
text: s,
|
|
1338
1351
|
onCheckedChange: n,
|
|
1339
1352
|
checked: a
|
|
1340
1353
|
}) {
|
|
1341
1354
|
return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
|
|
1342
|
-
/* @__PURE__ */ e.jsx(
|
|
1355
|
+
/* @__PURE__ */ e.jsx(Ke, { checked: a, onCheckedChange: n }),
|
|
1343
1356
|
/* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
|
|
1344
1357
|
] });
|
|
1345
1358
|
}
|
|
1346
|
-
function
|
|
1347
|
-
const { authToken: s } = es(), n =
|
|
1359
|
+
function zn() {
|
|
1360
|
+
const { authToken: s } = es(), n = $e(null), a = r((c) => c.applyFilters), [t, i] = T(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
|
|
1348
1361
|
return /* @__PURE__ */ e.jsxs(
|
|
1349
1362
|
Zs,
|
|
1350
1363
|
{
|
|
@@ -1353,7 +1366,7 @@ function kn() {
|
|
|
1353
1366
|
if (!c)
|
|
1354
1367
|
return;
|
|
1355
1368
|
console.log("onOpenChange");
|
|
1356
|
-
const
|
|
1369
|
+
const h = await aa(
|
|
1357
1370
|
"https://semaphor.cloud/api/v1/filter-sql",
|
|
1358
1371
|
(s == null ? void 0 : s.accessToken) || "",
|
|
1359
1372
|
{
|
|
@@ -1361,7 +1374,7 @@ function kn() {
|
|
|
1361
1374
|
active_filters: o
|
|
1362
1375
|
}
|
|
1363
1376
|
);
|
|
1364
|
-
console.log(
|
|
1377
|
+
console.log(h), h.sql ? (console.log(h.records), i(h.sql)) : i("Error");
|
|
1365
1378
|
},
|
|
1366
1379
|
children: [
|
|
1367
1380
|
/* @__PURE__ */ e.jsx(ea, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "| Filter Query" }) }),
|
|
@@ -1371,13 +1384,13 @@ function kn() {
|
|
|
1371
1384
|
/* @__PURE__ */ e.jsx(
|
|
1372
1385
|
ta,
|
|
1373
1386
|
{
|
|
1374
|
-
onClick: () =>
|
|
1387
|
+
onClick: () => Ya(n),
|
|
1375
1388
|
className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
|
|
1376
1389
|
}
|
|
1377
1390
|
)
|
|
1378
1391
|
] }) }) }),
|
|
1379
1392
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
|
|
1380
|
-
/* @__PURE__ */ e.jsx(
|
|
1393
|
+
/* @__PURE__ */ e.jsx(Xa, { className: "h-4 w-4 opacity-70" }),
|
|
1381
1394
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
|
|
1382
1395
|
] })
|
|
1383
1396
|
] })
|
|
@@ -1385,7 +1398,7 @@ function kn() {
|
|
|
1385
1398
|
}
|
|
1386
1399
|
);
|
|
1387
1400
|
}
|
|
1388
|
-
const
|
|
1401
|
+
const Fn = `
|
|
1389
1402
|
|
|
1390
1403
|
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.
|
|
1391
1404
|
|
|
@@ -1432,7 +1445,7 @@ SELECT label, measure FROM table
|
|
|
1432
1445
|
- Label - Category
|
|
1433
1446
|
- Measure - Number
|
|
1434
1447
|
`;
|
|
1435
|
-
function
|
|
1448
|
+
function On({
|
|
1436
1449
|
open: s,
|
|
1437
1450
|
setOpen: n,
|
|
1438
1451
|
userInput: a,
|
|
@@ -1440,61 +1453,61 @@ function zn({
|
|
|
1440
1453
|
triggerAIRun: i,
|
|
1441
1454
|
setTriggerAIRun: o
|
|
1442
1455
|
}) {
|
|
1443
|
-
const l =
|
|
1456
|
+
const l = $e(null), c = $e(null), { authToken: h } = es(), [g, m] = T(!1), u = r((y) => y.actions.setCardSql), N = k((y) => y.dashboard.baseQueries), d = r((y) => y.actions.setRunSql), x = r((y) => y.actions.setCardType), [f, w] = T([]), b = r((y) => y.currentColumns), L = r((y) => y.card.sql), C = r((y) => y.selectedTableName), O = `
|
|
1444
1457
|
${a}
|
|
1445
1458
|
|
|
1446
|
-
Database Query Dialect: ${
|
|
1447
|
-
Table Name: ${
|
|
1448
|
-
Table Columns: ${b == null ? void 0 : b.map((
|
|
1459
|
+
Database Query Dialect: ${C === "api" || C === "s3" ? "DuckDb" : ""}
|
|
1460
|
+
Table Name: ${C}
|
|
1461
|
+
Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
|
|
1449
1462
|
User SQL: ${L}
|
|
1450
|
-
${
|
|
1451
|
-
Visual Query Syntax: ${
|
|
1463
|
+
${N && `Base Queries: ${JSON.stringify(N)} `}`, j = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1464
|
+
Visual Query Syntax: ${Fn}`, { data: F, isLoading: A, isFetching: q, isError: P, refetch: $ } = Ce({
|
|
1452
1465
|
queryKey: ["ai-query"],
|
|
1453
1466
|
queryFn: () => ze(
|
|
1454
1467
|
"https://semaphor.cloud/api/v1/ai",
|
|
1455
|
-
(
|
|
1468
|
+
(h == null ? void 0 : h.accessToken) || "",
|
|
1456
1469
|
{
|
|
1457
|
-
user_content: `userContent: ${O} ${
|
|
1470
|
+
user_content: `userContent: ${O} ${g ? j : ""}`
|
|
1458
1471
|
}
|
|
1459
1472
|
),
|
|
1460
1473
|
enabled: !1
|
|
1461
1474
|
// Do not run by default.
|
|
1462
1475
|
});
|
|
1463
|
-
function
|
|
1464
|
-
if (
|
|
1476
|
+
function G(y) {
|
|
1477
|
+
if (y.toLowerCase().includes("bar"))
|
|
1465
1478
|
x("bar");
|
|
1466
|
-
else if (
|
|
1479
|
+
else if (y.toLowerCase().includes("line"))
|
|
1467
1480
|
x("line");
|
|
1468
|
-
else if (
|
|
1481
|
+
else if (y.toLowerCase().includes("bubble"))
|
|
1469
1482
|
x("bubble");
|
|
1470
|
-
else if (
|
|
1483
|
+
else if (y.toLowerCase().includes("scatter"))
|
|
1471
1484
|
x("scatter");
|
|
1472
|
-
else if (
|
|
1485
|
+
else if (y.toLowerCase().includes("stacked"))
|
|
1473
1486
|
x("stackedBar");
|
|
1474
|
-
else if (
|
|
1487
|
+
else if (y.toLowerCase().includes("pie"))
|
|
1475
1488
|
x("pie");
|
|
1476
|
-
else if (
|
|
1489
|
+
else if (y.toLowerCase().includes("donut") || y.toLowerCase().includes("doughnut"))
|
|
1477
1490
|
x("doughnut");
|
|
1478
|
-
else if (
|
|
1491
|
+
else if (y.toLowerCase().includes("radar"))
|
|
1479
1492
|
x("radar");
|
|
1480
1493
|
else
|
|
1481
1494
|
return x("bar"), !1;
|
|
1482
1495
|
return !0;
|
|
1483
1496
|
}
|
|
1484
1497
|
K(() => {
|
|
1485
|
-
|
|
1486
|
-
}, [
|
|
1487
|
-
const
|
|
1488
|
-
var
|
|
1498
|
+
F && w((y) => [...y, { role: "ai", content: F.response }]);
|
|
1499
|
+
}, [F]), K(() => {
|
|
1500
|
+
const y = setTimeout(() => {
|
|
1501
|
+
var v;
|
|
1489
1502
|
c.current && (c.current.scroll({
|
|
1490
1503
|
top: c.current.scrollHeight,
|
|
1491
1504
|
behavior: "smooth"
|
|
1492
|
-
}), (
|
|
1505
|
+
}), (v = l.current) == null || v.focus());
|
|
1493
1506
|
}, 100);
|
|
1494
|
-
return () => clearTimeout(
|
|
1495
|
-
}, [
|
|
1507
|
+
return () => clearTimeout(y);
|
|
1508
|
+
}, [f]);
|
|
1496
1509
|
function D() {
|
|
1497
|
-
a && (
|
|
1510
|
+
a && (w((y) => [...y, { role: "user", content: a }]), G(a) && m(!0), t(""), $());
|
|
1498
1511
|
}
|
|
1499
1512
|
K(() => {
|
|
1500
1513
|
i && (D(), o(!1));
|
|
@@ -1507,7 +1520,7 @@ function zn({
|
|
|
1507
1520
|
fontSize: 15,
|
|
1508
1521
|
// padding: '5px',
|
|
1509
1522
|
width: "100%"
|
|
1510
|
-
},
|
|
1523
|
+
}, Q = {
|
|
1511
1524
|
// background: '#f6f8fa',
|
|
1512
1525
|
// color: '#000',
|
|
1513
1526
|
fontFamily: "monospace",
|
|
@@ -1526,60 +1539,60 @@ function zn({
|
|
|
1526
1539
|
listStyleType: "disc"
|
|
1527
1540
|
}, Z = {
|
|
1528
1541
|
// Override how paragraphs are rendered
|
|
1529
|
-
p: ({ node:
|
|
1530
|
-
code: ({ node:
|
|
1531
|
-
pre: ({ node:
|
|
1532
|
-
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children:
|
|
1542
|
+
p: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("p", { style: te, ...v }),
|
|
1543
|
+
code: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...v }),
|
|
1544
|
+
pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Q, children: [
|
|
1545
|
+
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
|
|
1533
1546
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1534
|
-
/* @__PURE__ */ e.jsx(
|
|
1547
|
+
/* @__PURE__ */ e.jsx(z, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
|
|
1535
1548
|
/* @__PURE__ */ e.jsx(
|
|
1536
|
-
|
|
1549
|
+
z,
|
|
1537
1550
|
{
|
|
1538
|
-
onClick: (
|
|
1539
|
-
const H = J(
|
|
1540
|
-
H && (n(!1), u(H),
|
|
1551
|
+
onClick: (M) => {
|
|
1552
|
+
const H = J(M);
|
|
1553
|
+
H && (n(!1), u(H), d(!0));
|
|
1541
1554
|
},
|
|
1542
1555
|
size: "sm",
|
|
1543
1556
|
variant: "outline",
|
|
1544
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1557
|
+
children: /* @__PURE__ */ e.jsx(st, {})
|
|
1545
1558
|
}
|
|
1546
1559
|
)
|
|
1547
1560
|
] })
|
|
1548
1561
|
] }),
|
|
1549
|
-
li: ({ node:
|
|
1562
|
+
li: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...v })
|
|
1550
1563
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1551
1564
|
};
|
|
1552
|
-
function J(
|
|
1553
|
-
const
|
|
1554
|
-
if (!
|
|
1565
|
+
function J(y) {
|
|
1566
|
+
const v = y.currentTarget.closest("pre");
|
|
1567
|
+
if (!v)
|
|
1555
1568
|
return;
|
|
1556
|
-
const
|
|
1557
|
-
return navigator.clipboard.writeText(
|
|
1569
|
+
const M = v.textContent || v.innerText;
|
|
1570
|
+
return navigator.clipboard.writeText(M).then(() => console.log("Text copied to clipboard")).catch((H) => console.error("Error in copying text: ", H)), M;
|
|
1558
1571
|
}
|
|
1559
1572
|
function I() {
|
|
1560
|
-
return
|
|
1573
|
+
return f == null ? void 0 : f.map((y, v) => y.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1561
1574
|
"div",
|
|
1562
1575
|
{
|
|
1563
1576
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
1564
1577
|
children: [
|
|
1565
|
-
/* @__PURE__ */ e.jsx(
|
|
1566
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
1578
|
+
/* @__PURE__ */ e.jsx(gn, { className: "mr-2 h-5 w-5" }),
|
|
1579
|
+
/* @__PURE__ */ e.jsx("div", { children: y.content })
|
|
1567
1580
|
]
|
|
1568
1581
|
},
|
|
1569
|
-
|
|
1570
|
-
) :
|
|
1571
|
-
|
|
1582
|
+
v
|
|
1583
|
+
) : y.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1584
|
+
et,
|
|
1572
1585
|
{
|
|
1573
1586
|
className: "w-full overflow-auto py-1",
|
|
1574
1587
|
components: Z,
|
|
1575
|
-
children:
|
|
1588
|
+
children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
|
|
1576
1589
|
},
|
|
1577
|
-
|
|
1578
|
-
) : /* @__PURE__ */ e.jsx("div", {},
|
|
1590
|
+
v
|
|
1591
|
+
) : /* @__PURE__ */ e.jsx("div", {}, v));
|
|
1579
1592
|
}
|
|
1580
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1581
|
-
/* @__PURE__ */ e.jsx(
|
|
1582
|
-
|
|
1593
|
+
return /* @__PURE__ */ e.jsxs(xs, { open: s, onOpenChange: n, children: [
|
|
1594
|
+
/* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1595
|
+
z,
|
|
1583
1596
|
{
|
|
1584
1597
|
size: "sm",
|
|
1585
1598
|
className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
@@ -1588,13 +1601,13 @@ function zn({
|
|
|
1588
1601
|
}
|
|
1589
1602
|
) }),
|
|
1590
1603
|
/* @__PURE__ */ e.jsxs(
|
|
1591
|
-
|
|
1604
|
+
fs,
|
|
1592
1605
|
{
|
|
1593
1606
|
className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
|
|
1594
1607
|
children: [
|
|
1595
|
-
/* @__PURE__ */ e.jsxs(
|
|
1596
|
-
/* @__PURE__ */ e.jsx(
|
|
1597
|
-
/* @__PURE__ */ e.jsx(
|
|
1608
|
+
/* @__PURE__ */ e.jsxs(gs, { children: [
|
|
1609
|
+
/* @__PURE__ */ e.jsx(js, { children: "Assistant" }),
|
|
1610
|
+
/* @__PURE__ */ e.jsx(bs, { children: "What can I help you with?" })
|
|
1598
1611
|
] }),
|
|
1599
1612
|
/* @__PURE__ */ e.jsx(
|
|
1600
1613
|
"div",
|
|
@@ -1613,31 +1626,31 @@ function zn({
|
|
|
1613
1626
|
{
|
|
1614
1627
|
autoFocus: !0,
|
|
1615
1628
|
ref: l,
|
|
1616
|
-
onKeyDown: (
|
|
1617
|
-
|
|
1629
|
+
onKeyDown: (y) => {
|
|
1630
|
+
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), t(""), D());
|
|
1618
1631
|
},
|
|
1619
1632
|
placeholder: "Type your question here...",
|
|
1620
|
-
onFocus: (
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1633
|
+
onFocus: (y) => {
|
|
1634
|
+
const v = y.target, M = v.value.length;
|
|
1635
|
+
v.setSelectionRange(M, M);
|
|
1623
1636
|
},
|
|
1624
|
-
className:
|
|
1637
|
+
className: Y(
|
|
1625
1638
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1626
1639
|
),
|
|
1627
|
-
disabled:
|
|
1640
|
+
disabled: A || q,
|
|
1628
1641
|
value: a,
|
|
1629
|
-
onChange: (
|
|
1642
|
+
onChange: (y) => t(y.target.value)
|
|
1630
1643
|
}
|
|
1631
1644
|
),
|
|
1632
1645
|
" ",
|
|
1633
1646
|
/* @__PURE__ */ e.jsx(
|
|
1634
|
-
|
|
1647
|
+
z,
|
|
1635
1648
|
{
|
|
1636
1649
|
className: "h-8",
|
|
1637
1650
|
size: "sm",
|
|
1638
1651
|
variant: "ghost",
|
|
1639
1652
|
onClick: D,
|
|
1640
|
-
children: !
|
|
1653
|
+
children: !A && !q ? /* @__PURE__ */ e.jsx(Za, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1641
1654
|
}
|
|
1642
1655
|
)
|
|
1643
1656
|
] })
|
|
@@ -1648,17 +1661,17 @@ function zn({
|
|
|
1648
1661
|
)
|
|
1649
1662
|
] });
|
|
1650
1663
|
}
|
|
1651
|
-
var
|
|
1664
|
+
var fa = {
|
|
1652
1665
|
color: void 0,
|
|
1653
1666
|
size: void 0,
|
|
1654
1667
|
className: void 0,
|
|
1655
1668
|
style: void 0,
|
|
1656
1669
|
attr: void 0
|
|
1657
|
-
},
|
|
1658
|
-
function
|
|
1670
|
+
}, Hs = me.createContext && /* @__PURE__ */ me.createContext(fa), Mn = ["attr", "size", "title"];
|
|
1671
|
+
function Tn(s, n) {
|
|
1659
1672
|
if (s == null)
|
|
1660
1673
|
return {};
|
|
1661
|
-
var a =
|
|
1674
|
+
var a = An(s, n), t, i;
|
|
1662
1675
|
if (Object.getOwnPropertySymbols) {
|
|
1663
1676
|
var o = Object.getOwnPropertySymbols(s);
|
|
1664
1677
|
for (i = 0; i < o.length; i++)
|
|
@@ -1666,7 +1679,7 @@ function On(s, n) {
|
|
|
1666
1679
|
}
|
|
1667
1680
|
return a;
|
|
1668
1681
|
}
|
|
1669
|
-
function
|
|
1682
|
+
function An(s, n) {
|
|
1670
1683
|
if (s == null)
|
|
1671
1684
|
return {};
|
|
1672
1685
|
var a = {}, t = Object.keys(s), i, o;
|
|
@@ -1684,7 +1697,7 @@ function Xe() {
|
|
|
1684
1697
|
return s;
|
|
1685
1698
|
}, Xe.apply(this, arguments);
|
|
1686
1699
|
}
|
|
1687
|
-
function
|
|
1700
|
+
function Bs(s, n) {
|
|
1688
1701
|
var a = Object.keys(s);
|
|
1689
1702
|
if (Object.getOwnPropertySymbols) {
|
|
1690
1703
|
var t = Object.getOwnPropertySymbols(s);
|
|
@@ -1697,22 +1710,22 @@ function Hs(s, n) {
|
|
|
1697
1710
|
function Ze(s) {
|
|
1698
1711
|
for (var n = 1; n < arguments.length; n++) {
|
|
1699
1712
|
var a = arguments[n] != null ? arguments[n] : {};
|
|
1700
|
-
n % 2 ?
|
|
1701
|
-
|
|
1702
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) :
|
|
1713
|
+
n % 2 ? Bs(Object(a), !0).forEach(function(t) {
|
|
1714
|
+
En(s, t, a[t]);
|
|
1715
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Bs(Object(a)).forEach(function(t) {
|
|
1703
1716
|
Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
|
|
1704
1717
|
});
|
|
1705
1718
|
}
|
|
1706
1719
|
return s;
|
|
1707
1720
|
}
|
|
1708
|
-
function
|
|
1709
|
-
return n =
|
|
1721
|
+
function En(s, n, a) {
|
|
1722
|
+
return n = Ln(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
|
|
1710
1723
|
}
|
|
1711
|
-
function
|
|
1712
|
-
var n =
|
|
1724
|
+
function Ln(s) {
|
|
1725
|
+
var n = Dn(s, "string");
|
|
1713
1726
|
return typeof n == "symbol" ? n : String(n);
|
|
1714
1727
|
}
|
|
1715
|
-
function
|
|
1728
|
+
function Dn(s, n) {
|
|
1716
1729
|
if (typeof s != "object" || s === null)
|
|
1717
1730
|
return s;
|
|
1718
1731
|
var a = s[Symbol.toPrimitive];
|
|
@@ -1724,29 +1737,29 @@ function En(s, n) {
|
|
|
1724
1737
|
}
|
|
1725
1738
|
return (n === "string" ? String : Number)(s);
|
|
1726
1739
|
}
|
|
1727
|
-
function
|
|
1740
|
+
function ga(s) {
|
|
1728
1741
|
return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, Ze({
|
|
1729
1742
|
key: a
|
|
1730
|
-
}, n.attr),
|
|
1743
|
+
}, n.attr), ga(n.child)));
|
|
1731
1744
|
}
|
|
1732
1745
|
function fe(s) {
|
|
1733
|
-
return (n) => /* @__PURE__ */ me.createElement(
|
|
1746
|
+
return (n) => /* @__PURE__ */ me.createElement(In, Xe({
|
|
1734
1747
|
attr: Ze({}, s.attr)
|
|
1735
|
-
}, n),
|
|
1748
|
+
}, n), ga(s.child));
|
|
1736
1749
|
}
|
|
1737
|
-
function
|
|
1750
|
+
function In(s) {
|
|
1738
1751
|
var n = (a) => {
|
|
1739
1752
|
var {
|
|
1740
1753
|
attr: t,
|
|
1741
1754
|
size: i,
|
|
1742
1755
|
title: o
|
|
1743
|
-
} = s, l =
|
|
1744
|
-
return a.className && (
|
|
1756
|
+
} = s, l = Tn(s, Mn), c = i || a.size || "1em", h;
|
|
1757
|
+
return a.className && (h = a.className), s.className && (h = (h ? h + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
|
|
1745
1758
|
stroke: "currentColor",
|
|
1746
1759
|
fill: "currentColor",
|
|
1747
1760
|
strokeWidth: "0"
|
|
1748
1761
|
}, a.attr, t, l, {
|
|
1749
|
-
className:
|
|
1762
|
+
className: h,
|
|
1750
1763
|
style: Ze(Ze({
|
|
1751
1764
|
color: s.color || a.color
|
|
1752
1765
|
}, a.style), s.style),
|
|
@@ -1755,17 +1768,17 @@ function Ln(s) {
|
|
|
1755
1768
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1756
1769
|
}), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
|
|
1757
1770
|
};
|
|
1758
|
-
return
|
|
1771
|
+
return Hs !== void 0 ? /* @__PURE__ */ me.createElement(Hs.Consumer, null, (a) => n(a)) : n(fa);
|
|
1759
1772
|
}
|
|
1760
|
-
function
|
|
1773
|
+
function qn(s) {
|
|
1761
1774
|
return fe({ 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);
|
|
1762
1775
|
}
|
|
1763
|
-
function
|
|
1764
|
-
const { theme: s } =
|
|
1776
|
+
function Vn() {
|
|
1777
|
+
const { theme: s } = at(), n = $e(), a = $e(), [t, i] = T(!1), [o, l] = T(!1), [c, h] = T(!1), [g, m] = T(""), [u, N] = T(!1), { authToken: d } = es();
|
|
1765
1778
|
k((p) => p.selectedSheetId);
|
|
1766
|
-
const x = k((p) => p.dashboard.baseQueries),
|
|
1779
|
+
const x = k((p) => p.dashboard.baseQueries), f = r((p) => p.card), w = k((p) => p.theme), b = r((p) => p.isShowingVisual), L = r(
|
|
1767
1780
|
(p) => p.selectedConnectionId
|
|
1768
|
-
),
|
|
1781
|
+
), C = r(
|
|
1769
1782
|
(p) => p.selectedDatabaseName
|
|
1770
1783
|
), O = r(
|
|
1771
1784
|
(p) => p.selectedSchemaName
|
|
@@ -1773,21 +1786,21 @@ function In() {
|
|
|
1773
1786
|
k(
|
|
1774
1787
|
(p) => p.actions.updateFrameCard
|
|
1775
1788
|
);
|
|
1776
|
-
const
|
|
1789
|
+
const j = r((p) => p.selectedTableName), F = r((p) => p.card.sql), A = r((p) => p.card.python), q = tt(F, x), P = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), G = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
|
|
1777
1790
|
setCardCustomCfg: te,
|
|
1778
|
-
setQueryResultColumns:
|
|
1791
|
+
setQueryResultColumns: Q,
|
|
1779
1792
|
setFilterValues: ee,
|
|
1780
1793
|
setCardSql: Z,
|
|
1781
1794
|
setCardPython: J,
|
|
1782
1795
|
setQueryError: I,
|
|
1783
|
-
setPythonStdOut:
|
|
1784
|
-
setCardPreferences:
|
|
1785
|
-
} = r((p) => p.actions),
|
|
1796
|
+
setPythonStdOut: y,
|
|
1797
|
+
setCardPreferences: v
|
|
1798
|
+
} = r((p) => p.actions), M = r((p) => p.onSave), H = r(
|
|
1786
1799
|
(p) => p.actions.setApplyFilters
|
|
1787
1800
|
), ue = r((p) => p.onClose), se = r((p) => p.actions.setCardData), ge = r((p) => p.actions.setSqlGen), je = r((p) => p.runSql), be = r((p) => p.actions.setRunSql), xe = r(
|
|
1788
1801
|
(p) => p.actions.setIsSqlRunning
|
|
1789
1802
|
), {
|
|
1790
|
-
data:
|
|
1803
|
+
data: U,
|
|
1791
1804
|
isLoading: ne,
|
|
1792
1805
|
isFetching: le,
|
|
1793
1806
|
isSuccess: ye,
|
|
@@ -1796,83 +1809,86 @@ function In() {
|
|
|
1796
1809
|
status: ss,
|
|
1797
1810
|
refetch: ve
|
|
1798
1811
|
} = Ce({
|
|
1799
|
-
queryKey: [
|
|
1812
|
+
queryKey: [q, A],
|
|
1800
1813
|
queryFn: () => aa(
|
|
1801
1814
|
"https://semaphor.cloud/api/v1/query",
|
|
1802
|
-
(
|
|
1815
|
+
(d == null ? void 0 : d.accessToken) || "",
|
|
1803
1816
|
{
|
|
1804
|
-
connection_id:
|
|
1805
|
-
sql:
|
|
1806
|
-
python:
|
|
1807
|
-
active_filters: D ?
|
|
1817
|
+
connection_id: P,
|
|
1818
|
+
sql: q,
|
|
1819
|
+
python: A === Ls ? "" : A,
|
|
1820
|
+
active_filters: D ? G : []
|
|
1808
1821
|
}
|
|
1809
1822
|
),
|
|
1810
1823
|
enabled: !1,
|
|
1811
1824
|
retry: !1
|
|
1812
1825
|
});
|
|
1813
1826
|
K(() => {
|
|
1814
|
-
if (
|
|
1815
|
-
|
|
1816
|
-
|
|
1827
|
+
if (U && (se(U.records), U.rowLimitExceeded && cs.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
1828
|
+
position: "top-center",
|
|
1829
|
+
richColors: !0
|
|
1830
|
+
}), y((U == null ? void 0 : U.output) || ""), U.records.length > 0)) {
|
|
1831
|
+
const { dimensionKeys: p } = hs(U.records);
|
|
1832
|
+
Q(p);
|
|
1817
1833
|
}
|
|
1818
|
-
}, [
|
|
1834
|
+
}, [U, se, Q, y]), K(() => {
|
|
1819
1835
|
je && (ve(), be(!1));
|
|
1820
1836
|
}, [je, ve, be]), K(() => {
|
|
1821
|
-
(ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]),
|
|
1837
|
+
(ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), Q([]), y("")) : I("");
|
|
1822
1838
|
}, [
|
|
1823
1839
|
ne,
|
|
1824
1840
|
le,
|
|
1825
|
-
|
|
1826
|
-
|
|
1841
|
+
U,
|
|
1842
|
+
y,
|
|
1827
1843
|
re,
|
|
1828
1844
|
ye,
|
|
1829
1845
|
xe,
|
|
1830
1846
|
se,
|
|
1831
|
-
|
|
1847
|
+
Q,
|
|
1832
1848
|
I,
|
|
1833
1849
|
Ie
|
|
1834
1850
|
]);
|
|
1835
|
-
function
|
|
1836
|
-
Z(""), se([]), ge({}), te(""),
|
|
1851
|
+
function Je() {
|
|
1852
|
+
Z(""), se([]), ge({}), te(""), v({});
|
|
1837
1853
|
}
|
|
1838
1854
|
const qe = (p) => {
|
|
1839
1855
|
a.current = p;
|
|
1840
1856
|
};
|
|
1841
1857
|
function S() {
|
|
1842
|
-
let p =
|
|
1843
|
-
|
|
1858
|
+
let p = F;
|
|
1859
|
+
F && !F.includes("{{") && (p = Sn(F), Z(p));
|
|
1844
1860
|
const ie = {
|
|
1845
|
-
...
|
|
1861
|
+
...f,
|
|
1846
1862
|
lastSelectedSchema: O,
|
|
1847
|
-
lastSelectedDatabase:
|
|
1848
|
-
lastSelectedTable:
|
|
1863
|
+
lastSelectedDatabase: C,
|
|
1864
|
+
lastSelectedTable: j,
|
|
1849
1865
|
connectionId: L,
|
|
1850
|
-
type: b ?
|
|
1866
|
+
type: b ? f.type : "table",
|
|
1851
1867
|
sql: p,
|
|
1852
|
-
customCfg: b ?
|
|
1868
|
+
customCfg: b ? f.customCfg : null
|
|
1853
1869
|
}, Ve = $.cards.map(
|
|
1854
|
-
(Ne) => Ne.id ===
|
|
1870
|
+
(Ne) => Ne.id === f.id ? ie : Ne
|
|
1855
1871
|
);
|
|
1856
|
-
|
|
1872
|
+
M == null || M({
|
|
1857
1873
|
...$,
|
|
1858
1874
|
cards: Ve
|
|
1859
1875
|
});
|
|
1860
1876
|
}
|
|
1861
|
-
function
|
|
1877
|
+
function Fa() {
|
|
1862
1878
|
ue == null || ue();
|
|
1863
1879
|
}
|
|
1864
|
-
function
|
|
1880
|
+
function Oa(p) {
|
|
1865
1881
|
const ie = getComputedStyle(
|
|
1866
1882
|
document.documentElement
|
|
1867
1883
|
).getPropertyValue(p);
|
|
1868
|
-
return
|
|
1884
|
+
return Ma(ie);
|
|
1869
1885
|
}
|
|
1870
|
-
function
|
|
1871
|
-
const [ie, Ve, Ne] = p.split(" "),
|
|
1886
|
+
function Ma(p) {
|
|
1887
|
+
const [ie, Ve, Ne] = p.split(" "), W = parseFloat(ie), Ea = parseFloat(Ve), La = parseFloat(Ne), Da = Ea / 100, Ts = La / 100, pe = (1 - Math.abs(2 * Ts - 1)) * Da, ke = pe * (1 - Math.abs(W / 60 % 2 - 1)), as = Ts - pe / 2;
|
|
1872
1888
|
let oe = 0, ce = 0, de = 0;
|
|
1873
|
-
0 <=
|
|
1874
|
-
const ts = (
|
|
1875
|
-
const ns =
|
|
1889
|
+
0 <= W && W < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= W && W < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= W && W < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= W && W < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= W && W < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= W && W < 360 && (oe = pe, ce = 0, de = ke), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
|
|
1890
|
+
const ts = (Ia) => {
|
|
1891
|
+
const ns = Ia.toString(16);
|
|
1876
1892
|
return ns.length == 1 ? "0" + ns : ns;
|
|
1877
1893
|
};
|
|
1878
1894
|
return `#${ts(oe)}${ts(ce)}${ts(de)}`;
|
|
@@ -1880,7 +1896,7 @@ function In() {
|
|
|
1880
1896
|
K(() => {
|
|
1881
1897
|
const p = n.current, ie = a.current;
|
|
1882
1898
|
if (p) {
|
|
1883
|
-
const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne =
|
|
1899
|
+
const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = w === "system" ? Ve : w;
|
|
1884
1900
|
p.editor.defineTheme("default", {
|
|
1885
1901
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
1886
1902
|
base: Ne === "light" ? "vs" : "vs-dark",
|
|
@@ -1888,7 +1904,7 @@ function In() {
|
|
|
1888
1904
|
rules: [],
|
|
1889
1905
|
colors: {
|
|
1890
1906
|
// 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
|
|
1891
|
-
"editor.background": Ne === "light" ? "#ffffff" :
|
|
1907
|
+
"editor.background": Ne === "light" ? "#ffffff" : Oa("--background")
|
|
1892
1908
|
}
|
|
1893
1909
|
}), p.editor.setTheme("default");
|
|
1894
1910
|
}
|
|
@@ -1899,11 +1915,11 @@ function In() {
|
|
|
1899
1915
|
}
|
|
1900
1916
|
), () => {
|
|
1901
1917
|
};
|
|
1902
|
-
}, [s,
|
|
1903
|
-
function
|
|
1918
|
+
}, [s, w, n.current]);
|
|
1919
|
+
function Ms(p) {
|
|
1904
1920
|
n.current = p;
|
|
1905
1921
|
}
|
|
1906
|
-
function
|
|
1922
|
+
function Ta() {
|
|
1907
1923
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1908
1924
|
o && /* @__PURE__ */ e.jsx(
|
|
1909
1925
|
"div",
|
|
@@ -1913,16 +1929,16 @@ function In() {
|
|
|
1913
1929
|
children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
|
|
1914
1930
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
|
|
1915
1931
|
/* @__PURE__ */ e.jsx(
|
|
1916
|
-
|
|
1932
|
+
wn,
|
|
1917
1933
|
{
|
|
1918
1934
|
checked: D,
|
|
1919
1935
|
onCheckedChange: () => H(!D),
|
|
1920
1936
|
text: "Apply Filters"
|
|
1921
1937
|
}
|
|
1922
1938
|
),
|
|
1923
|
-
/* @__PURE__ */ e.jsx(
|
|
1924
|
-
|
|
1925
|
-
|
|
1939
|
+
/* @__PURE__ */ e.jsx(zn, {}),
|
|
1940
|
+
G && o && /* @__PURE__ */ e.jsx(
|
|
1941
|
+
_e,
|
|
1926
1942
|
{
|
|
1927
1943
|
onClick: () => l(!1),
|
|
1928
1944
|
className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
|
|
@@ -1930,7 +1946,7 @@ function In() {
|
|
|
1930
1946
|
)
|
|
1931
1947
|
] }),
|
|
1932
1948
|
/* @__PURE__ */ e.jsx(
|
|
1933
|
-
|
|
1949
|
+
Re,
|
|
1934
1950
|
{
|
|
1935
1951
|
theme: "default",
|
|
1936
1952
|
onChange: (p) => {
|
|
@@ -1942,7 +1958,7 @@ function In() {
|
|
|
1942
1958
|
},
|
|
1943
1959
|
defaultLanguage: "json",
|
|
1944
1960
|
className: "mt-1 min-h-[220px]",
|
|
1945
|
-
value: JSON.stringify(
|
|
1961
|
+
value: JSON.stringify(G, null, 2),
|
|
1946
1962
|
options: {
|
|
1947
1963
|
readOnly: !0,
|
|
1948
1964
|
minimap: {
|
|
@@ -1963,11 +1979,11 @@ function In() {
|
|
|
1963
1979
|
] })
|
|
1964
1980
|
}
|
|
1965
1981
|
),
|
|
1966
|
-
|
|
1982
|
+
G && !o && /* @__PURE__ */ e.jsx(
|
|
1967
1983
|
oa,
|
|
1968
1984
|
{
|
|
1969
1985
|
onClick: () => l(!0),
|
|
1970
|
-
className:
|
|
1986
|
+
className: Y(
|
|
1971
1987
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
1972
1988
|
{
|
|
1973
1989
|
"font-bold text-red-800": D
|
|
@@ -1977,9 +1993,9 @@ function In() {
|
|
|
1977
1993
|
)
|
|
1978
1994
|
] });
|
|
1979
1995
|
}
|
|
1980
|
-
function
|
|
1996
|
+
function Aa() {
|
|
1981
1997
|
return /* @__PURE__ */ e.jsxs(
|
|
1982
|
-
|
|
1998
|
+
ms,
|
|
1983
1999
|
{
|
|
1984
2000
|
className: "flex grow pb-1",
|
|
1985
2001
|
direction: "vertical",
|
|
@@ -1999,14 +2015,14 @@ function In() {
|
|
|
1999
2015
|
role: "sql-container",
|
|
2000
2016
|
className: "relative flex w-[99%]",
|
|
2001
2017
|
children: /* @__PURE__ */ e.jsx(
|
|
2002
|
-
|
|
2018
|
+
Re,
|
|
2003
2019
|
{
|
|
2004
2020
|
theme: "default",
|
|
2005
2021
|
className: "pt-3",
|
|
2006
2022
|
onChange: (p) => {
|
|
2007
2023
|
Z(p);
|
|
2008
2024
|
},
|
|
2009
|
-
value:
|
|
2025
|
+
value: F,
|
|
2010
2026
|
options: {
|
|
2011
2027
|
minimap: {
|
|
2012
2028
|
enabled: !1
|
|
@@ -2021,7 +2037,7 @@ function In() {
|
|
|
2021
2037
|
},
|
|
2022
2038
|
defaultLanguage: "sql",
|
|
2023
2039
|
defaultValue: "SELECT * FROM table",
|
|
2024
|
-
beforeMount:
|
|
2040
|
+
beforeMount: Ms,
|
|
2025
2041
|
onMount: qe
|
|
2026
2042
|
}
|
|
2027
2043
|
)
|
|
@@ -2032,7 +2048,7 @@ function In() {
|
|
|
2032
2048
|
}
|
|
2033
2049
|
),
|
|
2034
2050
|
t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2035
|
-
/* @__PURE__ */ e.jsx(
|
|
2051
|
+
/* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border" }),
|
|
2036
2052
|
/* @__PURE__ */ e.jsxs(
|
|
2037
2053
|
Fe,
|
|
2038
2054
|
{
|
|
@@ -2047,14 +2063,14 @@ function In() {
|
|
|
2047
2063
|
role: "python-container",
|
|
2048
2064
|
className: "relative flex w-[99%] pt-0",
|
|
2049
2065
|
children: /* @__PURE__ */ e.jsx(
|
|
2050
|
-
|
|
2066
|
+
Re,
|
|
2051
2067
|
{
|
|
2052
2068
|
className: "pt-3",
|
|
2053
2069
|
theme: "default",
|
|
2054
2070
|
onChange: (p) => {
|
|
2055
2071
|
J(p && p.trim() || "");
|
|
2056
2072
|
},
|
|
2057
|
-
value:
|
|
2073
|
+
value: A || Ls,
|
|
2058
2074
|
options: {
|
|
2059
2075
|
minimap: {
|
|
2060
2076
|
enabled: !1
|
|
@@ -2068,7 +2084,7 @@ function In() {
|
|
|
2068
2084
|
renderLineHighlight: "none"
|
|
2069
2085
|
},
|
|
2070
2086
|
defaultLanguage: "python",
|
|
2071
|
-
beforeMount:
|
|
2087
|
+
beforeMount: Ms,
|
|
2072
2088
|
onMount: qe
|
|
2073
2089
|
}
|
|
2074
2090
|
)
|
|
@@ -2097,8 +2113,8 @@ function In() {
|
|
|
2097
2113
|
role: "sql-editor",
|
|
2098
2114
|
className: "relative flex grow justify-between overflow-y-scroll",
|
|
2099
2115
|
children: [
|
|
2100
|
-
|
|
2101
|
-
|
|
2116
|
+
Aa(),
|
|
2117
|
+
Ta()
|
|
2102
2118
|
]
|
|
2103
2119
|
}
|
|
2104
2120
|
),
|
|
@@ -2110,7 +2126,7 @@ function In() {
|
|
|
2110
2126
|
children: [
|
|
2111
2127
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2112
2128
|
/* @__PURE__ */ e.jsxs(
|
|
2113
|
-
|
|
2129
|
+
z,
|
|
2114
2130
|
{
|
|
2115
2131
|
title: "Shift + Enter",
|
|
2116
2132
|
disabled: ne || le,
|
|
@@ -2121,29 +2137,29 @@ function In() {
|
|
|
2121
2137
|
size: "sm",
|
|
2122
2138
|
variant: "outline",
|
|
2123
2139
|
children: [
|
|
2124
|
-
ne || le ? /* @__PURE__ */ e.jsx(
|
|
2140
|
+
ne || le ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(on, { className: "mr-2 h-4 w-4" }),
|
|
2125
2141
|
"Run"
|
|
2126
2142
|
]
|
|
2127
2143
|
}
|
|
2128
2144
|
),
|
|
2129
2145
|
re && /* @__PURE__ */ e.jsx(
|
|
2130
|
-
|
|
2146
|
+
kn,
|
|
2131
2147
|
{
|
|
2132
2148
|
error: Ie.message,
|
|
2133
|
-
setShowAIDialog:
|
|
2134
|
-
setTriggerAIRun:
|
|
2149
|
+
setShowAIDialog: h,
|
|
2150
|
+
setTriggerAIRun: N,
|
|
2135
2151
|
setUserInputforAI: m
|
|
2136
2152
|
}
|
|
2137
2153
|
),
|
|
2138
2154
|
/* @__PURE__ */ e.jsxs(
|
|
2139
|
-
|
|
2155
|
+
z,
|
|
2140
2156
|
{
|
|
2141
|
-
onClick:
|
|
2157
|
+
onClick: Je,
|
|
2142
2158
|
className: "",
|
|
2143
2159
|
size: "sm",
|
|
2144
2160
|
variant: "outline",
|
|
2145
2161
|
children: [
|
|
2146
|
-
/* @__PURE__ */ e.jsx(
|
|
2162
|
+
/* @__PURE__ */ e.jsx(Yt, { className: "mr-2 size-4" }),
|
|
2147
2163
|
"Clear"
|
|
2148
2164
|
]
|
|
2149
2165
|
}
|
|
@@ -2156,43 +2172,43 @@ function In() {
|
|
|
2156
2172
|
className: "",
|
|
2157
2173
|
size: "sm",
|
|
2158
2174
|
variant: "outline",
|
|
2159
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2175
|
+
children: /* @__PURE__ */ e.jsx(qn, { className: "size-4 text-foreground/70" })
|
|
2160
2176
|
}
|
|
2161
2177
|
),
|
|
2162
2178
|
/* @__PURE__ */ e.jsx(
|
|
2163
|
-
|
|
2179
|
+
On,
|
|
2164
2180
|
{
|
|
2165
2181
|
open: c,
|
|
2166
|
-
setOpen:
|
|
2167
|
-
userInput:
|
|
2182
|
+
setOpen: h,
|
|
2183
|
+
userInput: g,
|
|
2168
2184
|
triggerAIRun: u,
|
|
2169
|
-
setTriggerAIRun:
|
|
2185
|
+
setTriggerAIRun: N,
|
|
2170
2186
|
setUserInput: (p) => m(p)
|
|
2171
2187
|
}
|
|
2172
2188
|
)
|
|
2173
2189
|
] }),
|
|
2174
2190
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
2175
2191
|
/* @__PURE__ */ e.jsxs(
|
|
2176
|
-
|
|
2192
|
+
z,
|
|
2177
2193
|
{
|
|
2178
2194
|
onClick: S,
|
|
2179
2195
|
size: "sm",
|
|
2180
2196
|
variant: "outline",
|
|
2181
2197
|
children: [
|
|
2182
|
-
/* @__PURE__ */ e.jsx(
|
|
2198
|
+
/* @__PURE__ */ e.jsx(nt, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2183
2199
|
"Accept"
|
|
2184
2200
|
]
|
|
2185
2201
|
}
|
|
2186
2202
|
),
|
|
2187
2203
|
/* @__PURE__ */ e.jsxs(
|
|
2188
|
-
|
|
2204
|
+
z,
|
|
2189
2205
|
{
|
|
2190
|
-
onClick:
|
|
2206
|
+
onClick: Fa,
|
|
2191
2207
|
className: "w-full",
|
|
2192
2208
|
size: "sm",
|
|
2193
2209
|
variant: "outline",
|
|
2194
2210
|
children: [
|
|
2195
|
-
/* @__PURE__ */ e.jsx(
|
|
2211
|
+
/* @__PURE__ */ e.jsx(_e, { className: "mr-2 size-4" }),
|
|
2196
2212
|
"Close"
|
|
2197
2213
|
]
|
|
2198
2214
|
}
|
|
@@ -2206,60 +2222,61 @@ function In() {
|
|
|
2206
2222
|
)
|
|
2207
2223
|
);
|
|
2208
2224
|
}
|
|
2209
|
-
function
|
|
2225
|
+
function Rn({ data: s }) {
|
|
2210
2226
|
var l;
|
|
2211
2227
|
const [n, a] = me.useState([]), i = Object.keys(s[0]).map((c) => ({
|
|
2212
2228
|
// header: key,
|
|
2213
2229
|
accessorKey: c,
|
|
2214
|
-
header: ({ column:
|
|
2215
|
-
const
|
|
2230
|
+
header: ({ column: h }) => {
|
|
2231
|
+
const g = h.getIsSorted();
|
|
2216
2232
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
2217
2233
|
"div",
|
|
2218
2234
|
{
|
|
2219
2235
|
className: "flex cursor-pointer items-center",
|
|
2220
|
-
onClick: () =>
|
|
2236
|
+
onClick: () => h.toggleSorting(h.getIsSorted() === "asc"),
|
|
2221
2237
|
children: [
|
|
2222
2238
|
c,
|
|
2223
|
-
|
|
2239
|
+
g === "asc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : g === "desc" ? /* @__PURE__ */ e.jsx(rt, { className: "ml-2 h-5 w-5" }) : null
|
|
2224
2240
|
]
|
|
2225
2241
|
}
|
|
2226
2242
|
) });
|
|
2227
2243
|
}
|
|
2228
|
-
})), o =
|
|
2244
|
+
})), o = it({
|
|
2229
2245
|
data: s,
|
|
2230
2246
|
columns: i,
|
|
2231
|
-
getCoreRowModel:
|
|
2232
|
-
getPaginationRowModel:
|
|
2247
|
+
getCoreRowModel: mt(),
|
|
2248
|
+
getPaginationRowModel: ut(),
|
|
2233
2249
|
onSortingChange: a,
|
|
2234
|
-
getSortedRowModel:
|
|
2250
|
+
getSortedRowModel: xt(),
|
|
2235
2251
|
manualPagination: !0,
|
|
2236
2252
|
state: {
|
|
2237
2253
|
sorting: n
|
|
2238
2254
|
}
|
|
2239
2255
|
});
|
|
2240
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2241
|
-
/* @__PURE__ */ e.jsx(
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
) },
|
|
2245
|
-
/* @__PURE__ */ e.jsx(
|
|
2256
|
+
return /* @__PURE__ */ e.jsxs(ot, { children: [
|
|
2257
|
+
/* @__PURE__ */ e.jsx(ct, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((h) => /* @__PURE__ */ e.jsx(dt, { className: "sticky top-0 bg-muted", children: h.isPlaceholder ? null : Ds(
|
|
2258
|
+
h.column.columnDef.header,
|
|
2259
|
+
h.getContext()
|
|
2260
|
+
) }, h.id)) }, c.id)) }),
|
|
2261
|
+
/* @__PURE__ */ e.jsx(ht, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
|
|
2246
2262
|
ls,
|
|
2247
2263
|
{
|
|
2248
2264
|
className: "whitespace-nowrap py-2",
|
|
2249
2265
|
"data-state": c.getIsSelected() && "selected",
|
|
2250
|
-
children: c.getVisibleCells().map((
|
|
2266
|
+
children: c.getVisibleCells().map((h) => /* @__PURE__ */ e.jsx(Is, { children: Ds(h.column.columnDef.cell, h.getContext()) }, h.id))
|
|
2251
2267
|
},
|
|
2252
2268
|
c.id
|
|
2253
|
-
)) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(
|
|
2269
|
+
)) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Is, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2254
2270
|
] });
|
|
2255
2271
|
}
|
|
2256
|
-
function
|
|
2272
|
+
function ja({
|
|
2257
2273
|
// card,
|
|
2258
2274
|
className: s,
|
|
2259
2275
|
...n
|
|
2260
2276
|
}) {
|
|
2277
|
+
var l;
|
|
2261
2278
|
me.useState(0);
|
|
2262
|
-
const a = k((
|
|
2279
|
+
const a = k((c) => c.themeStyle), t = r((c) => c.card), i = r((c) => c.actions.setCard);
|
|
2263
2280
|
if (K(() => {
|
|
2264
2281
|
}, [
|
|
2265
2282
|
t.data,
|
|
@@ -2278,28 +2295,28 @@ function ga({
|
|
|
2278
2295
|
customCfg: t.customCfg,
|
|
2279
2296
|
preferences: t.preferences
|
|
2280
2297
|
})), /* @__PURE__ */ e.jsxs(
|
|
2281
|
-
|
|
2298
|
+
pt,
|
|
2282
2299
|
{
|
|
2283
2300
|
role: "editor-visual-card",
|
|
2284
|
-
className:
|
|
2301
|
+
className: Y("relative flex h-full flex-col rounded-none", s),
|
|
2285
2302
|
...n,
|
|
2286
2303
|
children: [
|
|
2287
|
-
/* @__PURE__ */ e.jsxs(
|
|
2304
|
+
/* @__PURE__ */ e.jsxs(ft, { className: "py-4", children: [
|
|
2288
2305
|
/* @__PURE__ */ e.jsx(
|
|
2289
|
-
|
|
2306
|
+
qs,
|
|
2290
2307
|
{
|
|
2291
2308
|
text: t.title,
|
|
2292
|
-
onSave: (
|
|
2293
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2309
|
+
onSave: (c) => i({ ...t, title: c }),
|
|
2310
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(gt, { className: "text-base", children: t.title }) })
|
|
2294
2311
|
},
|
|
2295
2312
|
t.title
|
|
2296
2313
|
),
|
|
2297
2314
|
/* @__PURE__ */ e.jsx(
|
|
2298
|
-
|
|
2315
|
+
qs,
|
|
2299
2316
|
{
|
|
2300
2317
|
text: t.description || "",
|
|
2301
|
-
onSave: (
|
|
2302
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2318
|
+
onSave: (c) => i({ ...t, description: c }),
|
|
2319
|
+
children: /* @__PURE__ */ e.jsxs(jt, { children: [
|
|
2303
2320
|
" ",
|
|
2304
2321
|
t.description
|
|
2305
2322
|
] })
|
|
@@ -2307,106 +2324,105 @@ function ga({
|
|
|
2307
2324
|
t.description
|
|
2308
2325
|
)
|
|
2309
2326
|
] }),
|
|
2310
|
-
/* @__PURE__ */ e.jsxs(
|
|
2327
|
+
/* @__PURE__ */ e.jsxs(bt, { className: "flex grow flex-col pb-3", children: [
|
|
2311
2328
|
t.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2312
2329
|
/* @__PURE__ */ e.jsx(
|
|
2313
|
-
|
|
2330
|
+
yt,
|
|
2314
2331
|
{
|
|
2315
2332
|
cfg: o
|
|
2316
2333
|
},
|
|
2317
|
-
JSON.stringify(o) + JSON.stringify(t.preferences)
|
|
2334
|
+
JSON.stringify(o) + JSON.stringify(t.preferences) + ((l = t == null ? void 0 : t.preferences) == null ? void 0 : l.customVisualCode)
|
|
2318
2335
|
),
|
|
2319
2336
|
t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2320
|
-
/* @__PURE__ */ e.jsx(
|
|
2337
|
+
/* @__PURE__ */ e.jsx(vt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Nt, { card: t, data: t == null ? void 0 : t.data }) })
|
|
2321
2338
|
] })
|
|
2322
2339
|
]
|
|
2323
2340
|
}
|
|
2324
2341
|
);
|
|
2325
2342
|
}
|
|
2326
|
-
function
|
|
2327
|
-
const [s, n] =
|
|
2328
|
-
(
|
|
2329
|
-
),
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
const b = {
|
|
2335
|
-
...j,
|
|
2343
|
+
function _n() {
|
|
2344
|
+
const [s, n] = T(!1), [a, t] = T(""), [i, o] = T(""), [l, c] = T(""), [h, g] = T(""), m = r((C) => C.card), u = r(
|
|
2345
|
+
(C) => C.card.customCfg
|
|
2346
|
+
), { setCardCustomCfg: N, setCustomVisualCode: d } = Ct();
|
|
2347
|
+
function x(C) {
|
|
2348
|
+
var F, A;
|
|
2349
|
+
const O = {
|
|
2350
|
+
...C,
|
|
2336
2351
|
data: {
|
|
2337
|
-
...
|
|
2338
|
-
datasets: (
|
|
2339
|
-
...
|
|
2352
|
+
...C == null ? void 0 : C.data,
|
|
2353
|
+
datasets: (A = (F = C == null ? void 0 : C.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((q) => ({
|
|
2354
|
+
...q,
|
|
2340
2355
|
data: []
|
|
2341
2356
|
}))
|
|
2342
2357
|
}
|
|
2343
2358
|
};
|
|
2344
|
-
return JSON.stringify(
|
|
2359
|
+
return JSON.stringify(O, null, 1);
|
|
2345
2360
|
}
|
|
2346
|
-
function
|
|
2347
|
-
|
|
2361
|
+
function f() {
|
|
2362
|
+
var O, j;
|
|
2363
|
+
if (!m.data || m.data.length === 0)
|
|
2348
2364
|
return;
|
|
2349
|
-
const
|
|
2350
|
-
data:
|
|
2351
|
-
cardType:
|
|
2352
|
-
cfg:
|
|
2353
|
-
preferences:
|
|
2365
|
+
const C = la({
|
|
2366
|
+
data: m.data,
|
|
2367
|
+
cardType: m.type,
|
|
2368
|
+
cfg: m.cfg,
|
|
2369
|
+
preferences: m.preferences
|
|
2354
2370
|
});
|
|
2355
|
-
|
|
2371
|
+
C && (t(JSON.stringify(C, null, 1)), (O = m == null ? void 0 : m.preferences) != null && O.customVisualCode && c((j = m == null ? void 0 : m.preferences) == null ? void 0 : j.customVisualCode), u && o(JSON.stringify(u, null, 1)));
|
|
2356
2372
|
}
|
|
2357
|
-
function
|
|
2358
|
-
if (i)
|
|
2373
|
+
function w() {
|
|
2374
|
+
if (l && d(l), !!i)
|
|
2359
2375
|
try {
|
|
2360
|
-
const
|
|
2361
|
-
return
|
|
2362
|
-
} catch (
|
|
2363
|
-
console.log(
|
|
2376
|
+
const C = JSON.parse(i);
|
|
2377
|
+
return C ? (N(C), g(""), o(""), C) : void 0;
|
|
2378
|
+
} catch (C) {
|
|
2379
|
+
console.log(C), g("Invalid JSON");
|
|
2364
2380
|
}
|
|
2365
2381
|
}
|
|
2366
|
-
function
|
|
2367
|
-
o(""),
|
|
2382
|
+
function b() {
|
|
2383
|
+
o(""), N(null);
|
|
2368
2384
|
}
|
|
2369
|
-
function
|
|
2370
|
-
let
|
|
2371
|
-
if (
|
|
2372
|
-
const
|
|
2373
|
-
return
|
|
2385
|
+
function L() {
|
|
2386
|
+
let C;
|
|
2387
|
+
if (u) {
|
|
2388
|
+
const O = Vs.cloneDeep(m.cfg), j = Vs.merge(O, u);
|
|
2389
|
+
return C = x(j), C;
|
|
2374
2390
|
}
|
|
2375
|
-
return a ? (
|
|
2391
|
+
return a ? (C = x(JSON.parse(a)), C) : "";
|
|
2376
2392
|
}
|
|
2377
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2378
|
-
/* @__PURE__ */ e.jsx(
|
|
2379
|
-
|
|
2393
|
+
return /* @__PURE__ */ e.jsxs(xs, { open: s, onOpenChange: n, children: [
|
|
2394
|
+
/* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2395
|
+
z,
|
|
2380
2396
|
{
|
|
2381
|
-
onClick:
|
|
2382
|
-
className: ` ${
|
|
2397
|
+
onClick: f,
|
|
2398
|
+
className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2383
2399
|
size: "sm",
|
|
2384
2400
|
variant: "outline",
|
|
2385
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2401
|
+
children: /* @__PURE__ */ e.jsx(St, { className: "h-4 w-4" })
|
|
2386
2402
|
}
|
|
2387
2403
|
) }),
|
|
2388
2404
|
/* @__PURE__ */ e.jsxs(
|
|
2389
|
-
|
|
2405
|
+
fs,
|
|
2390
2406
|
{
|
|
2391
|
-
className: "max-h-[70vh] min-h-[70vh] min-w-[900px]
|
|
2407
|
+
className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
|
|
2392
2408
|
children: [
|
|
2393
|
-
/* @__PURE__ */ e.jsxs(
|
|
2409
|
+
/* @__PURE__ */ e.jsxs(gs, { className: "", children: [
|
|
2394
2410
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2395
|
-
/* @__PURE__ */ e.jsx(
|
|
2396
|
-
/* @__PURE__ */ e.jsxs(
|
|
2397
|
-
/* @__PURE__ */ e.jsx(
|
|
2398
|
-
|
|
2411
|
+
/* @__PURE__ */ e.jsx(js, { children: "Customize Card" }),
|
|
2412
|
+
/* @__PURE__ */ e.jsxs(ys, { children: [
|
|
2413
|
+
/* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
|
|
2414
|
+
sn,
|
|
2399
2415
|
{
|
|
2400
2416
|
onClick: () => {
|
|
2401
|
-
navigator.clipboard.writeText(
|
|
2417
|
+
navigator.clipboard.writeText(m.id);
|
|
2402
2418
|
},
|
|
2403
2419
|
className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
|
|
2404
2420
|
}
|
|
2405
2421
|
) }),
|
|
2406
|
-
/* @__PURE__ */ e.jsx(
|
|
2422
|
+
/* @__PURE__ */ e.jsx(vs, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
|
|
2407
2423
|
] })
|
|
2408
2424
|
] }),
|
|
2409
|
-
/* @__PURE__ */ e.jsxs(
|
|
2425
|
+
/* @__PURE__ */ e.jsxs(bs, { children: [
|
|
2410
2426
|
"See the configuration options and documentation",
|
|
2411
2427
|
/* @__PURE__ */ e.jsx(
|
|
2412
2428
|
"a",
|
|
@@ -2420,17 +2436,18 @@ function Vn() {
|
|
|
2420
2436
|
] })
|
|
2421
2437
|
] }),
|
|
2422
2438
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2423
|
-
/* @__PURE__ */ e.jsx(
|
|
2424
|
-
/* @__PURE__ */ e.jsxs(
|
|
2425
|
-
/* @__PURE__ */ e.jsxs(
|
|
2426
|
-
/* @__PURE__ */ e.jsxs(
|
|
2427
|
-
|
|
2428
|
-
|
|
2439
|
+
/* @__PURE__ */ e.jsx(ja, { className: "w-1/2 rounded shadow-none" }),
|
|
2440
|
+
/* @__PURE__ */ e.jsxs(kt, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2441
|
+
/* @__PURE__ */ e.jsxs(wt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2442
|
+
/* @__PURE__ */ e.jsxs(rs, { value: "custom-config", children: [
|
|
2443
|
+
u && /* @__PURE__ */ e.jsx(zt, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2444
|
+
u ? "Custom Config" : "Default Config"
|
|
2429
2445
|
] }),
|
|
2430
|
-
/* @__PURE__ */ e.jsx(
|
|
2446
|
+
/* @__PURE__ */ e.jsx(rs, { className: "", value: "output", children: "Output" }),
|
|
2447
|
+
/* @__PURE__ */ e.jsx(rs, { className: "", value: "custom-code", children: "Custom Code" })
|
|
2431
2448
|
] }),
|
|
2432
2449
|
/* @__PURE__ */ e.jsx(
|
|
2433
|
-
|
|
2450
|
+
is,
|
|
2434
2451
|
{
|
|
2435
2452
|
className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
|
|
2436
2453
|
value: "output",
|
|
@@ -2445,12 +2462,12 @@ function Vn() {
|
|
|
2445
2462
|
}
|
|
2446
2463
|
),
|
|
2447
2464
|
/* @__PURE__ */ e.jsx(
|
|
2448
|
-
|
|
2465
|
+
is,
|
|
2449
2466
|
{
|
|
2450
2467
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2451
2468
|
value: "custom-config",
|
|
2452
2469
|
children: /* @__PURE__ */ e.jsx(
|
|
2453
|
-
|
|
2470
|
+
Re,
|
|
2454
2471
|
{
|
|
2455
2472
|
className: "h-full w-full overflow-hidden",
|
|
2456
2473
|
theme: "default",
|
|
@@ -2467,56 +2484,85 @@ function Vn() {
|
|
|
2467
2484
|
renderLineHighlight: "none"
|
|
2468
2485
|
},
|
|
2469
2486
|
defaultLanguage: "json",
|
|
2470
|
-
value:
|
|
2471
|
-
onChange: (
|
|
2487
|
+
value: L(),
|
|
2488
|
+
onChange: (C) => o(C)
|
|
2489
|
+
}
|
|
2490
|
+
)
|
|
2491
|
+
}
|
|
2492
|
+
),
|
|
2493
|
+
/* @__PURE__ */ e.jsx(
|
|
2494
|
+
is,
|
|
2495
|
+
{
|
|
2496
|
+
className: "mt-0 grow rounded-b border border-t-0",
|
|
2497
|
+
value: "custom-code",
|
|
2498
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2499
|
+
Re,
|
|
2500
|
+
{
|
|
2501
|
+
className: "h-full w-full overflow-hidden",
|
|
2502
|
+
theme: "default",
|
|
2503
|
+
options: {
|
|
2504
|
+
minimap: {
|
|
2505
|
+
enabled: !1
|
|
2506
|
+
},
|
|
2507
|
+
wordWrap: "on",
|
|
2508
|
+
scrollbar: {
|
|
2509
|
+
verticalScrollbarSize: 0,
|
|
2510
|
+
horizontalScrollbarSize: 0
|
|
2511
|
+
},
|
|
2512
|
+
fontSize: 14,
|
|
2513
|
+
renderLineHighlight: "none"
|
|
2514
|
+
},
|
|
2515
|
+
defaultLanguage: "javascript",
|
|
2516
|
+
value: l,
|
|
2517
|
+
onChange: (C) => c(C || "")
|
|
2472
2518
|
}
|
|
2473
2519
|
)
|
|
2474
2520
|
}
|
|
2475
2521
|
)
|
|
2476
2522
|
] })
|
|
2477
2523
|
] }),
|
|
2478
|
-
/* @__PURE__ */ e.jsxs(
|
|
2479
|
-
/* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children:
|
|
2524
|
+
/* @__PURE__ */ e.jsxs(Us, { className: "flex items-center", children: [
|
|
2525
|
+
/* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: h }),
|
|
2480
2526
|
/* @__PURE__ */ e.jsx(
|
|
2481
|
-
|
|
2527
|
+
z,
|
|
2482
2528
|
{
|
|
2483
|
-
disabled: !
|
|
2484
|
-
onClick:
|
|
2529
|
+
disabled: !u,
|
|
2530
|
+
onClick: b,
|
|
2485
2531
|
variant: "outline",
|
|
2486
2532
|
children: "Reset"
|
|
2487
2533
|
}
|
|
2488
2534
|
),
|
|
2489
|
-
/* @__PURE__ */ e.jsx(
|
|
2490
|
-
/* @__PURE__ */ e.jsx(
|
|
2535
|
+
/* @__PURE__ */ e.jsx(z, { onClick: w, variant: "outline", children: "Apply" }),
|
|
2536
|
+
/* @__PURE__ */ e.jsx(z, { onClick: () => n(!1), variant: "outline", children: "Close" })
|
|
2491
2537
|
] })
|
|
2492
2538
|
]
|
|
2493
2539
|
}
|
|
2494
2540
|
)
|
|
2495
2541
|
] });
|
|
2496
2542
|
}
|
|
2497
|
-
function
|
|
2543
|
+
function ba(s) {
|
|
2498
2544
|
return fe({ 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);
|
|
2499
2545
|
}
|
|
2500
|
-
function
|
|
2546
|
+
function ya(s) {
|
|
2501
2547
|
return fe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
|
|
2502
2548
|
}
|
|
2503
|
-
function
|
|
2549
|
+
function va(s) {
|
|
2504
2550
|
return fe({ 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);
|
|
2505
2551
|
}
|
|
2506
|
-
function
|
|
2552
|
+
function Na(s) {
|
|
2507
2553
|
return fe({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
|
|
2508
2554
|
}
|
|
2509
|
-
function
|
|
2555
|
+
function Ca(s) {
|
|
2510
2556
|
return fe({ 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);
|
|
2511
2557
|
}
|
|
2512
|
-
function
|
|
2558
|
+
function Sa(s) {
|
|
2513
2559
|
return fe({ 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);
|
|
2514
2560
|
}
|
|
2515
|
-
function
|
|
2561
|
+
function ka(s) {
|
|
2516
2562
|
return fe({ 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);
|
|
2517
2563
|
}
|
|
2518
|
-
function
|
|
2519
|
-
const [s, n] =
|
|
2564
|
+
function Hn() {
|
|
2565
|
+
const [s, n] = T(!1), a = r((c) => c.card.type), { setCardType: t, setCardPreferences: i } = r(
|
|
2520
2566
|
(c) => c.actions
|
|
2521
2567
|
), o = r(
|
|
2522
2568
|
(c) => c.actions.setCardCustomCfg
|
|
@@ -2524,73 +2570,73 @@ function Rn() {
|
|
|
2524
2570
|
function l(c) {
|
|
2525
2571
|
t(c), o(null), i({}), n(!1);
|
|
2526
2572
|
}
|
|
2527
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2528
|
-
/* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2529
|
-
/* @__PURE__ */ e.jsx(
|
|
2573
|
+
return /* @__PURE__ */ e.jsxs(Pe, { open: s, onOpenChange: n, children: [
|
|
2574
|
+
/* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", chartType: a }) }) }),
|
|
2575
|
+
/* @__PURE__ */ e.jsx(Ge, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
|
|
2530
2576
|
/* @__PURE__ */ e.jsx(
|
|
2531
|
-
|
|
2577
|
+
z,
|
|
2532
2578
|
{
|
|
2533
2579
|
onClick: () => l("bar"),
|
|
2534
2580
|
className: "font-normal",
|
|
2535
2581
|
variant: "ghost",
|
|
2536
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2582
|
+
children: /* @__PURE__ */ e.jsx(ws, { className: "size-5" })
|
|
2537
2583
|
}
|
|
2538
2584
|
),
|
|
2539
2585
|
/* @__PURE__ */ e.jsx(
|
|
2540
|
-
|
|
2586
|
+
z,
|
|
2541
2587
|
{
|
|
2542
2588
|
onClick: () => l("line"),
|
|
2543
2589
|
variant: "ghost",
|
|
2544
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2590
|
+
children: /* @__PURE__ */ e.jsx(zs, { className: "size-5" })
|
|
2545
2591
|
}
|
|
2546
2592
|
),
|
|
2547
2593
|
/* @__PURE__ */ e.jsx(
|
|
2548
|
-
|
|
2594
|
+
z,
|
|
2549
2595
|
{
|
|
2550
2596
|
onClick: () => l("stackedBar"),
|
|
2551
2597
|
variant: "ghost",
|
|
2552
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2598
|
+
children: /* @__PURE__ */ e.jsx(Ca, { className: "size-5", strokeWidth: 0 })
|
|
2553
2599
|
}
|
|
2554
2600
|
),
|
|
2555
2601
|
/* @__PURE__ */ e.jsx(
|
|
2556
|
-
|
|
2602
|
+
z,
|
|
2557
2603
|
{
|
|
2558
2604
|
onClick: () => l("scatter"),
|
|
2559
2605
|
variant: "ghost",
|
|
2560
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2606
|
+
children: /* @__PURE__ */ e.jsx(ma, { className: "size-5" })
|
|
2561
2607
|
}
|
|
2562
2608
|
),
|
|
2563
2609
|
/* @__PURE__ */ e.jsx(
|
|
2564
|
-
|
|
2610
|
+
z,
|
|
2565
2611
|
{
|
|
2566
2612
|
onClick: () => l("bubble"),
|
|
2567
2613
|
variant: "ghost",
|
|
2568
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2614
|
+
children: /* @__PURE__ */ e.jsx(Na, { className: "size-4" })
|
|
2569
2615
|
}
|
|
2570
2616
|
),
|
|
2571
2617
|
/* @__PURE__ */ e.jsx(
|
|
2572
|
-
|
|
2618
|
+
z,
|
|
2573
2619
|
{
|
|
2574
2620
|
onClick: () => l("pie"),
|
|
2575
2621
|
variant: "ghost",
|
|
2576
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2622
|
+
children: /* @__PURE__ */ e.jsx(ha, { className: "size-5" })
|
|
2577
2623
|
}
|
|
2578
2624
|
),
|
|
2579
2625
|
/* @__PURE__ */ e.jsx(
|
|
2580
|
-
|
|
2626
|
+
z,
|
|
2581
2627
|
{
|
|
2582
2628
|
onClick: () => l("doughnut"),
|
|
2583
2629
|
variant: "ghost",
|
|
2584
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2630
|
+
children: /* @__PURE__ */ e.jsx(ya, { className: "size-5", strokeWidth: 1 })
|
|
2585
2631
|
}
|
|
2586
2632
|
),
|
|
2587
2633
|
/* @__PURE__ */ e.jsx(
|
|
2588
|
-
|
|
2634
|
+
z,
|
|
2589
2635
|
{
|
|
2590
2636
|
onClick: () => l("radar"),
|
|
2591
2637
|
variant: "ghost",
|
|
2592
2638
|
children: /* @__PURE__ */ e.jsx(
|
|
2593
|
-
|
|
2639
|
+
ba,
|
|
2594
2640
|
{
|
|
2595
2641
|
className: "size-5 font-extralight",
|
|
2596
2642
|
strokeWidth: 0.5
|
|
@@ -2599,77 +2645,87 @@ function Rn() {
|
|
|
2599
2645
|
}
|
|
2600
2646
|
),
|
|
2601
2647
|
/* @__PURE__ */ e.jsx(
|
|
2602
|
-
|
|
2648
|
+
z,
|
|
2603
2649
|
{
|
|
2604
2650
|
onClick: () => l("polarArea"),
|
|
2605
2651
|
variant: "ghost",
|
|
2606
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2652
|
+
children: /* @__PURE__ */ e.jsx(va, { className: "size-5" })
|
|
2607
2653
|
}
|
|
2608
2654
|
),
|
|
2609
2655
|
/* @__PURE__ */ e.jsx(
|
|
2610
|
-
|
|
2656
|
+
z,
|
|
2611
2657
|
{
|
|
2612
2658
|
onClick: () => l("pyramid"),
|
|
2613
2659
|
variant: "ghost",
|
|
2614
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2660
|
+
children: /* @__PURE__ */ e.jsx(ka, { className: "size-5" })
|
|
2615
2661
|
}
|
|
2616
2662
|
),
|
|
2617
2663
|
/* @__PURE__ */ e.jsx(
|
|
2618
|
-
|
|
2664
|
+
z,
|
|
2665
|
+
{
|
|
2666
|
+
onClick: () => l("range"),
|
|
2667
|
+
variant: "ghost",
|
|
2668
|
+
children: /* @__PURE__ */ e.jsx(ca, { className: "size-5" })
|
|
2669
|
+
}
|
|
2670
|
+
),
|
|
2671
|
+
/* @__PURE__ */ e.jsx(
|
|
2672
|
+
z,
|
|
2619
2673
|
{
|
|
2620
2674
|
onClick: () => l("table"),
|
|
2621
2675
|
variant: "ghost",
|
|
2622
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2676
|
+
children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
|
|
2623
2677
|
}
|
|
2624
2678
|
),
|
|
2625
2679
|
/* @__PURE__ */ e.jsx(
|
|
2626
|
-
|
|
2680
|
+
z,
|
|
2627
2681
|
{
|
|
2628
2682
|
onClick: () => l("kpi"),
|
|
2629
2683
|
variant: "ghost",
|
|
2630
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2684
|
+
children: /* @__PURE__ */ e.jsx(Sa, { className: "size-6" })
|
|
2631
2685
|
}
|
|
2632
2686
|
)
|
|
2633
2687
|
] }) })
|
|
2634
2688
|
] });
|
|
2635
2689
|
}
|
|
2636
|
-
function
|
|
2690
|
+
function Bn({ chartType: s, className: n }) {
|
|
2637
2691
|
switch (s) {
|
|
2638
2692
|
case "bar":
|
|
2639
|
-
return /* @__PURE__ */ e.jsx(
|
|
2693
|
+
return /* @__PURE__ */ e.jsx(ws, { className: n });
|
|
2640
2694
|
case "line":
|
|
2641
|
-
return /* @__PURE__ */ e.jsx(
|
|
2695
|
+
return /* @__PURE__ */ e.jsx(zs, { className: n });
|
|
2642
2696
|
case "pie":
|
|
2643
|
-
return /* @__PURE__ */ e.jsx(
|
|
2697
|
+
return /* @__PURE__ */ e.jsx(ha, { className: n });
|
|
2644
2698
|
case "radar":
|
|
2645
|
-
return /* @__PURE__ */ e.jsx(
|
|
2699
|
+
return /* @__PURE__ */ e.jsx(ba, { className: n });
|
|
2646
2700
|
case "scatter":
|
|
2647
|
-
return /* @__PURE__ */ e.jsx(
|
|
2701
|
+
return /* @__PURE__ */ e.jsx(ma, { className: n });
|
|
2648
2702
|
case "bubble":
|
|
2649
|
-
return /* @__PURE__ */ e.jsx(
|
|
2703
|
+
return /* @__PURE__ */ e.jsx(Na, { className: n });
|
|
2650
2704
|
case "doughnut":
|
|
2651
|
-
return /* @__PURE__ */ e.jsx(
|
|
2705
|
+
return /* @__PURE__ */ e.jsx(ya, { className: n });
|
|
2652
2706
|
case "stackedBar":
|
|
2653
|
-
return /* @__PURE__ */ e.jsx(
|
|
2707
|
+
return /* @__PURE__ */ e.jsx(Ca, { className: "size-4 text-foreground/70" });
|
|
2654
2708
|
case "polarArea":
|
|
2655
|
-
return /* @__PURE__ */ e.jsx(
|
|
2709
|
+
return /* @__PURE__ */ e.jsx(va, { className: n });
|
|
2656
2710
|
case "pyramid":
|
|
2657
|
-
return /* @__PURE__ */ e.jsx(
|
|
2711
|
+
return /* @__PURE__ */ e.jsx(ka, { className: n });
|
|
2712
|
+
case "range":
|
|
2713
|
+
return /* @__PURE__ */ e.jsx(ca, { className: n });
|
|
2658
2714
|
case "kpi":
|
|
2659
|
-
return /* @__PURE__ */ e.jsx(
|
|
2715
|
+
return /* @__PURE__ */ e.jsx(Sa, { className: n });
|
|
2660
2716
|
default:
|
|
2661
|
-
return /* @__PURE__ */ e.jsx(
|
|
2717
|
+
return /* @__PURE__ */ e.jsx(Ns, { className: n });
|
|
2662
2718
|
}
|
|
2663
2719
|
}
|
|
2664
|
-
function
|
|
2720
|
+
function $n() {
|
|
2665
2721
|
const s = r(
|
|
2666
2722
|
(a) => a.card.refreshInterval
|
|
2667
2723
|
), n = r(
|
|
2668
2724
|
(a) => a.actions.setCardRefreshInterval
|
|
2669
2725
|
);
|
|
2670
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2671
|
-
/* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2672
|
-
/* @__PURE__ */ e.jsx(
|
|
2726
|
+
return /* @__PURE__ */ e.jsxs(Pe, { children: [
|
|
2727
|
+
/* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Gt, { className: "w-4 h-4" }) }) }),
|
|
2728
|
+
/* @__PURE__ */ e.jsx(Ge, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
|
|
2673
2729
|
/* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
|
|
2674
2730
|
/* @__PURE__ */ e.jsx(
|
|
2675
2731
|
ae,
|
|
@@ -2684,27 +2740,27 @@ function Hn() {
|
|
|
2684
2740
|
] }) }) }) })
|
|
2685
2741
|
] });
|
|
2686
2742
|
}
|
|
2687
|
-
function
|
|
2743
|
+
function $s() {
|
|
2688
2744
|
r((l) => l.frame);
|
|
2689
2745
|
const s = r((l) => l.card), n = r((l) => l.card.data), a = r((l) => l.isShowingVisual), t = r((l) => l.isSqlRunning), i = r((l) => l.queryError), o = r((l) => l.pythonStdOut);
|
|
2690
2746
|
return r((l) => l.onSave), r((l) => l.onClose), r((l) => l.actions.setCardSql), r((l) => l.actions.setCardType), r((l) => l.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
|
|
2691
|
-
t && /* @__PURE__ */ e.jsx(
|
|
2747
|
+
t && /* @__PURE__ */ e.jsx(Be, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
2692
2748
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
2693
2749
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2694
|
-
/* @__PURE__ */ e.jsx(
|
|
2695
|
-
s.type !== "table" && /* @__PURE__ */ e.jsx(
|
|
2696
|
-
/* @__PURE__ */ e.jsx(
|
|
2750
|
+
/* @__PURE__ */ e.jsx(Hn, {}),
|
|
2751
|
+
s.type !== "table" && /* @__PURE__ */ e.jsx(_n, {}),
|
|
2752
|
+
/* @__PURE__ */ e.jsx($n, {})
|
|
2697
2753
|
] }),
|
|
2698
|
-
/* @__PURE__ */ e.jsx(
|
|
2754
|
+
/* @__PURE__ */ e.jsx(Pn, {})
|
|
2699
2755
|
] }),
|
|
2700
|
-
a ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(
|
|
2701
|
-
o && /* @__PURE__ */ e.jsx(
|
|
2702
|
-
s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(
|
|
2756
|
+
a ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Ft, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ja, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
2757
|
+
o && /* @__PURE__ */ e.jsx(Kn, {}),
|
|
2758
|
+
s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Rn, { data: n || [] }),
|
|
2703
2759
|
i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
|
|
2704
2760
|
] })
|
|
2705
2761
|
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
2706
2762
|
}
|
|
2707
|
-
function
|
|
2763
|
+
function Kn() {
|
|
2708
2764
|
const s = r((a) => a.pythonStdOut);
|
|
2709
2765
|
if (!s)
|
|
2710
2766
|
return null;
|
|
@@ -2718,17 +2774,17 @@ function Bn() {
|
|
|
2718
2774
|
className: "bg-muted p-2 font-mono text-sm"
|
|
2719
2775
|
}
|
|
2720
2776
|
),
|
|
2721
|
-
/* @__PURE__ */ e.jsx(
|
|
2777
|
+
/* @__PURE__ */ e.jsx(Ss, { className: "mb-2" })
|
|
2722
2778
|
] });
|
|
2723
2779
|
}
|
|
2724
|
-
function
|
|
2780
|
+
function Pn() {
|
|
2725
2781
|
const s = r((a) => a.isShowingVisual), n = r(
|
|
2726
2782
|
(a) => a.actions.setIsShowingVisual
|
|
2727
2783
|
);
|
|
2728
2784
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2729
2785
|
/* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
|
|
2730
2786
|
/* @__PURE__ */ e.jsx(
|
|
2731
|
-
|
|
2787
|
+
Ot,
|
|
2732
2788
|
{
|
|
2733
2789
|
checked: s,
|
|
2734
2790
|
onCheckedChange: () => n(!s),
|
|
@@ -2739,7 +2795,7 @@ function $n() {
|
|
|
2739
2795
|
] });
|
|
2740
2796
|
}
|
|
2741
2797
|
function De() {
|
|
2742
|
-
const [s, n] =
|
|
2798
|
+
const [s, n] = T([]);
|
|
2743
2799
|
r(
|
|
2744
2800
|
(m) => m.card.cfg
|
|
2745
2801
|
);
|
|
@@ -2755,8 +2811,8 @@ function De() {
|
|
|
2755
2811
|
l && n(new Array(l.length).fill(!1));
|
|
2756
2812
|
}, [l]);
|
|
2757
2813
|
function c(m, u) {
|
|
2758
|
-
var
|
|
2759
|
-
u ? a != null && a.onClickFilter && ((
|
|
2814
|
+
var N, d;
|
|
2815
|
+
u ? a != null && a.onClickFilter && ((N = a == null ? void 0 : a.onClickFilter) == null ? void 0 : N.length) > 0 ? o({
|
|
2760
2816
|
...a,
|
|
2761
2817
|
onClickFilter: [
|
|
2762
2818
|
...a.onClickFilter,
|
|
@@ -2775,33 +2831,33 @@ function De() {
|
|
|
2775
2831
|
]
|
|
2776
2832
|
}) : (o({
|
|
2777
2833
|
...a,
|
|
2778
|
-
onClickFilter: (
|
|
2834
|
+
onClickFilter: (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.filter(
|
|
2779
2835
|
(x) => x.columnIndex !== m
|
|
2780
2836
|
)
|
|
2781
2837
|
}), n((x) => {
|
|
2782
|
-
const
|
|
2783
|
-
return
|
|
2838
|
+
const f = [...x];
|
|
2839
|
+
return f[m] = !1, f;
|
|
2784
2840
|
}));
|
|
2785
2841
|
}
|
|
2786
|
-
function
|
|
2787
|
-
var
|
|
2788
|
-
const
|
|
2842
|
+
function h(m, u) {
|
|
2843
|
+
var d;
|
|
2844
|
+
const N = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((x) => x.columnIndex === m ? {
|
|
2789
2845
|
...x,
|
|
2790
2846
|
expression: u.target.value
|
|
2791
2847
|
} : x);
|
|
2792
2848
|
o({
|
|
2793
2849
|
...a,
|
|
2794
|
-
onClickFilter:
|
|
2850
|
+
onClickFilter: N
|
|
2795
2851
|
});
|
|
2796
2852
|
}
|
|
2797
|
-
function
|
|
2798
|
-
var u,
|
|
2799
|
-
if (s != null && s[m] || (
|
|
2853
|
+
function g(m) {
|
|
2854
|
+
var u, N, d, x;
|
|
2855
|
+
if (s != null && s[m] || (N = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((f) => f.columnIndex === m)) != null && N.expression)
|
|
2800
2856
|
return /* @__PURE__ */ e.jsx(
|
|
2801
2857
|
ae,
|
|
2802
2858
|
{
|
|
2803
|
-
value: (x = (
|
|
2804
|
-
onChange: (
|
|
2859
|
+
value: (x = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find((f) => f.columnIndex === m)) == null ? void 0 : x.expression,
|
|
2860
|
+
onChange: (f) => h(m, f),
|
|
2805
2861
|
type: "text",
|
|
2806
2862
|
className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
|
|
2807
2863
|
placeholder: "Expression"
|
|
@@ -2809,7 +2865,7 @@ function De() {
|
|
|
2809
2865
|
);
|
|
2810
2866
|
}
|
|
2811
2867
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: l == null ? void 0 : l.map((m, u) => {
|
|
2812
|
-
var
|
|
2868
|
+
var N, d;
|
|
2813
2869
|
return /* @__PURE__ */ e.jsx(
|
|
2814
2870
|
"div",
|
|
2815
2871
|
{
|
|
@@ -2817,9 +2873,9 @@ function De() {
|
|
|
2817
2873
|
children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
|
|
2818
2874
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
|
|
2819
2875
|
/* @__PURE__ */ e.jsx(
|
|
2820
|
-
|
|
2876
|
+
Ke,
|
|
2821
2877
|
{
|
|
2822
|
-
checked: !!((
|
|
2878
|
+
checked: !!((N = a == null ? void 0 : a.onClickFilter) != null && N.find(
|
|
2823
2879
|
(x) => x.columnIndex === u
|
|
2824
2880
|
)),
|
|
2825
2881
|
onCheckedChange: (x) => c(u, x)
|
|
@@ -2832,60 +2888,60 @@ function De() {
|
|
|
2832
2888
|
children: m
|
|
2833
2889
|
}
|
|
2834
2890
|
),
|
|
2835
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((
|
|
2891
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find(
|
|
2836
2892
|
(x) => x.columnIndex === u
|
|
2837
2893
|
)) && /* @__PURE__ */ e.jsx(
|
|
2838
|
-
|
|
2894
|
+
da,
|
|
2839
2895
|
{
|
|
2840
2896
|
onClick: () => {
|
|
2841
2897
|
n((x) => {
|
|
2842
|
-
const
|
|
2843
|
-
return
|
|
2898
|
+
const f = [...x];
|
|
2899
|
+
return f[u] = !x[u], f;
|
|
2844
2900
|
});
|
|
2845
2901
|
},
|
|
2846
2902
|
className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
|
|
2847
2903
|
}
|
|
2848
2904
|
) })
|
|
2849
2905
|
] }),
|
|
2850
|
-
|
|
2906
|
+
g(u)
|
|
2851
2907
|
] })
|
|
2852
2908
|
},
|
|
2853
2909
|
m
|
|
2854
2910
|
);
|
|
2855
2911
|
}) });
|
|
2856
2912
|
}
|
|
2857
|
-
function
|
|
2858
|
-
var o, l;
|
|
2859
|
-
const s = r((
|
|
2860
|
-
(
|
|
2913
|
+
function Fs() {
|
|
2914
|
+
var o, l, c;
|
|
2915
|
+
const s = r((h) => h.card.preferences), n = r(
|
|
2916
|
+
(h) => h.card.cfg
|
|
2861
2917
|
), { setCardCfg: a, setCardPreferences: t } = r(
|
|
2862
|
-
(
|
|
2918
|
+
(h) => h.actions
|
|
2863
2919
|
);
|
|
2864
2920
|
(o = n == null ? void 0 : n.options) != null && o.indexAxis;
|
|
2865
|
-
function i(
|
|
2866
|
-
var
|
|
2867
|
-
let
|
|
2868
|
-
(
|
|
2869
|
-
x: (
|
|
2870
|
-
y: (
|
|
2921
|
+
function i(h) {
|
|
2922
|
+
var u, N, d, x, f, w;
|
|
2923
|
+
let g = {};
|
|
2924
|
+
(u = s == null ? void 0 : s.chartOptions) != null && u.scales && (g = {
|
|
2925
|
+
x: (d = (N = s == null ? void 0 : s.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : d.y,
|
|
2926
|
+
y: (f = (x = s == null ? void 0 : s.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : f.x
|
|
2871
2927
|
});
|
|
2872
|
-
const
|
|
2928
|
+
const m = {
|
|
2873
2929
|
...s,
|
|
2874
2930
|
chartOptions: {
|
|
2875
2931
|
...s == null ? void 0 : s.chartOptions,
|
|
2876
2932
|
scales: {
|
|
2877
|
-
...(
|
|
2878
|
-
...
|
|
2933
|
+
...(w = s == null ? void 0 : s.chartOptions) == null ? void 0 : w.scales,
|
|
2934
|
+
...g
|
|
2879
2935
|
},
|
|
2880
|
-
indexAxis:
|
|
2936
|
+
indexAxis: h
|
|
2881
2937
|
}
|
|
2882
2938
|
};
|
|
2883
|
-
t(
|
|
2939
|
+
t(m);
|
|
2884
2940
|
}
|
|
2885
2941
|
return /* @__PURE__ */ e.jsxs(
|
|
2886
2942
|
ra,
|
|
2887
2943
|
{
|
|
2888
|
-
value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || "x",
|
|
2944
|
+
value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
|
|
2889
2945
|
onValueChange: i,
|
|
2890
2946
|
className: "flex gap-3",
|
|
2891
2947
|
defaultValue: "x",
|
|
@@ -2903,43 +2959,43 @@ function Ss() {
|
|
|
2903
2959
|
);
|
|
2904
2960
|
}
|
|
2905
2961
|
const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
2906
|
-
function
|
|
2962
|
+
function Ks(s, n) {
|
|
2907
2963
|
var t, i, o;
|
|
2908
2964
|
const a = ia(s, n);
|
|
2909
2965
|
return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
|
|
2910
2966
|
}
|
|
2911
|
-
function
|
|
2912
|
-
var
|
|
2913
|
-
const [s, n] =
|
|
2914
|
-
var
|
|
2915
|
-
return (
|
|
2916
|
-
}), t = r((
|
|
2917
|
-
var
|
|
2918
|
-
return (
|
|
2919
|
-
}), i = ia(a, t), [o, l] =
|
|
2920
|
-
|
|
2921
|
-
), [c,
|
|
2922
|
-
((Z = (ee = (
|
|
2923
|
-
), [
|
|
2924
|
-
((
|
|
2925
|
-
), [u,
|
|
2926
|
-
(
|
|
2927
|
-
),
|
|
2928
|
-
var
|
|
2929
|
-
return (
|
|
2930
|
-
}),
|
|
2967
|
+
function wa() {
|
|
2968
|
+
var Q, ee, Z, J, I, y;
|
|
2969
|
+
const [s, n] = T(!1), a = r((v) => {
|
|
2970
|
+
var M;
|
|
2971
|
+
return (M = v.card) == null ? void 0 : M.preferences;
|
|
2972
|
+
}), t = r((v) => {
|
|
2973
|
+
var M;
|
|
2974
|
+
return (M = v.card) == null ? void 0 : M.cfg;
|
|
2975
|
+
}), i = ia(a, t), [o, l] = T(
|
|
2976
|
+
Ks(a)
|
|
2977
|
+
), [c, h] = T(
|
|
2978
|
+
((Z = (ee = (Q = a == null ? void 0 : a.chartOptions) == null ? void 0 : Q.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
|
|
2979
|
+
), [g, m] = T(
|
|
2980
|
+
((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[i]) == null ? void 0 : y.max) || ""
|
|
2981
|
+
), [u, N] = T(c || g ? "custom" : "auto"), [d, x] = T(""), [f, w] = T(0), [b, L] = T(""), [C, O] = T(""), [j, F] = T(""), A = r(
|
|
2982
|
+
(v) => v.actions.setCardPreferences
|
|
2983
|
+
), q = r((v) => {
|
|
2984
|
+
var M;
|
|
2985
|
+
return (M = v.card) == null ? void 0 : M.type;
|
|
2986
|
+
}), P = ["pie", "doughnut", "polarArea"].includes(q);
|
|
2931
2987
|
K(() => {
|
|
2932
|
-
var
|
|
2933
|
-
l(
|
|
2934
|
-
((H = (
|
|
2988
|
+
var v, M, H, ue, se, ge, je, be, xe, U, ne, le, ye, re;
|
|
2989
|
+
l(Ks(a)), h(
|
|
2990
|
+
((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[i]) == null ? void 0 : H.min) === 0 ? 0 : ""
|
|
2935
2991
|
), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[i]) == null ? void 0 : ge.max) || ""), x(
|
|
2936
|
-
((
|
|
2937
|
-
),
|
|
2992
|
+
((U = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : U.stepSize) || ""
|
|
2993
|
+
), w(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
|
|
2938
2994
|
}, [s, a, i]);
|
|
2939
|
-
function $(
|
|
2940
|
-
return
|
|
2995
|
+
function $(v, M) {
|
|
2996
|
+
return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
|
|
2941
2997
|
}
|
|
2942
|
-
function
|
|
2998
|
+
function G() {
|
|
2943
2999
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2944
3000
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
2945
3001
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2960,9 +3016,9 @@ function ka() {
|
|
|
2960
3016
|
/* @__PURE__ */ e.jsx(
|
|
2961
3017
|
ae,
|
|
2962
3018
|
{
|
|
2963
|
-
value:
|
|
3019
|
+
value: C,
|
|
2964
3020
|
placeholder: "USD",
|
|
2965
|
-
onChange: (
|
|
3021
|
+
onChange: (v) => O(v.target.value),
|
|
2966
3022
|
id: "currency",
|
|
2967
3023
|
className: `col-span-2 h-8 w-full ${we}`
|
|
2968
3024
|
}
|
|
@@ -2970,9 +3026,9 @@ function ka() {
|
|
|
2970
3026
|
/* @__PURE__ */ e.jsx(
|
|
2971
3027
|
ae,
|
|
2972
3028
|
{
|
|
2973
|
-
value:
|
|
3029
|
+
value: j,
|
|
2974
3030
|
placeholder: "en-US",
|
|
2975
|
-
onChange: (
|
|
3031
|
+
onChange: (v) => F(v.target.value),
|
|
2976
3032
|
id: "locale",
|
|
2977
3033
|
className: `col-span-2 h-8 w-full ${we}`
|
|
2978
3034
|
}
|
|
@@ -2983,8 +3039,8 @@ function ka() {
|
|
|
2983
3039
|
/* @__PURE__ */ e.jsx(
|
|
2984
3040
|
ae,
|
|
2985
3041
|
{
|
|
2986
|
-
value:
|
|
2987
|
-
onChange: (
|
|
3042
|
+
value: f,
|
|
3043
|
+
onChange: (v) => w(Number(v.target.value)),
|
|
2988
3044
|
id: "format",
|
|
2989
3045
|
className: `col-span-6 h-8 w-full tracking-wide ${we}`
|
|
2990
3046
|
}
|
|
@@ -3001,15 +3057,15 @@ function ka() {
|
|
|
3001
3057
|
{
|
|
3002
3058
|
id: "min",
|
|
3003
3059
|
value: c,
|
|
3004
|
-
onChange: (
|
|
3060
|
+
onChange: (v) => h((M) => $(M, v.target.value)),
|
|
3005
3061
|
className: `col-span-1 h-8 w-full ${we}`
|
|
3006
3062
|
}
|
|
3007
3063
|
),
|
|
3008
3064
|
/* @__PURE__ */ e.jsx(
|
|
3009
3065
|
ae,
|
|
3010
3066
|
{
|
|
3011
|
-
value:
|
|
3012
|
-
onChange: (
|
|
3067
|
+
value: g,
|
|
3068
|
+
onChange: (v) => m((M) => $(M, v.target.value)),
|
|
3013
3069
|
id: "max",
|
|
3014
3070
|
className: `col-span-1 h-8 w-full ${we}`
|
|
3015
3071
|
}
|
|
@@ -3020,8 +3076,8 @@ function ka() {
|
|
|
3020
3076
|
/* @__PURE__ */ e.jsx(
|
|
3021
3077
|
ae,
|
|
3022
3078
|
{
|
|
3023
|
-
value:
|
|
3024
|
-
onChange: (
|
|
3079
|
+
value: d,
|
|
3080
|
+
onChange: (v) => x((M) => $(M, v.target.value)),
|
|
3025
3081
|
id: "step-size",
|
|
3026
3082
|
className: `col-span-1 h-8 w-full ${we}`
|
|
3027
3083
|
}
|
|
@@ -3031,15 +3087,15 @@ function ka() {
|
|
|
3031
3087
|
}
|
|
3032
3088
|
function te() {
|
|
3033
3089
|
var H;
|
|
3034
|
-
let
|
|
3035
|
-
u === "custom" && (
|
|
3090
|
+
let v = {};
|
|
3091
|
+
u === "custom" && (v = {
|
|
3036
3092
|
min: c,
|
|
3037
|
-
max:
|
|
3093
|
+
max: g,
|
|
3038
3094
|
ticks: {
|
|
3039
|
-
stepSize:
|
|
3095
|
+
stepSize: d
|
|
3040
3096
|
}
|
|
3041
3097
|
});
|
|
3042
|
-
const
|
|
3098
|
+
const M = {
|
|
3043
3099
|
...a || {},
|
|
3044
3100
|
chartOptions: {
|
|
3045
3101
|
...a == null ? void 0 : a.chartOptions,
|
|
@@ -3048,22 +3104,22 @@ function ka() {
|
|
|
3048
3104
|
[i]: {
|
|
3049
3105
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3050
3106
|
type: o,
|
|
3051
|
-
...o === "linear" ?
|
|
3107
|
+
...o === "linear" ? v : {}
|
|
3052
3108
|
}
|
|
3053
3109
|
}
|
|
3054
3110
|
},
|
|
3055
3111
|
numberAxisFormat: {
|
|
3056
|
-
decimalPlaces:
|
|
3112
|
+
decimalPlaces: f,
|
|
3057
3113
|
suffix: b,
|
|
3058
|
-
currency:
|
|
3059
|
-
locale:
|
|
3114
|
+
currency: C,
|
|
3115
|
+
locale: j
|
|
3060
3116
|
}
|
|
3061
3117
|
};
|
|
3062
|
-
|
|
3118
|
+
A(M);
|
|
3063
3119
|
}
|
|
3064
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3065
|
-
/* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
3066
|
-
/* @__PURE__ */ e.jsx(
|
|
3120
|
+
return /* @__PURE__ */ e.jsxs(Pe, { onOpenChange: (v) => n(v), children: [
|
|
3121
|
+
/* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3122
|
+
/* @__PURE__ */ e.jsx(Ge, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3067
3123
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3068
3124
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
3069
3125
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
@@ -3074,12 +3130,12 @@ function ka() {
|
|
|
3074
3130
|
/* @__PURE__ */ e.jsxs(
|
|
3075
3131
|
Oe,
|
|
3076
3132
|
{
|
|
3077
|
-
disabled:
|
|
3133
|
+
disabled: P,
|
|
3078
3134
|
value: o,
|
|
3079
|
-
onValueChange: (
|
|
3135
|
+
onValueChange: (v) => l(v),
|
|
3080
3136
|
children: [
|
|
3081
3137
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3082
|
-
/* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(
|
|
3138
|
+
/* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(He, { children: [
|
|
3083
3139
|
/* @__PURE__ */ e.jsx(Le, { children: "Option" }),
|
|
3084
3140
|
/* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
|
|
3085
3141
|
/* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
|
|
@@ -3093,10 +3149,10 @@ function ka() {
|
|
|
3093
3149
|
/* @__PURE__ */ e.jsxs(
|
|
3094
3150
|
ra,
|
|
3095
3151
|
{
|
|
3096
|
-
disabled:
|
|
3152
|
+
disabled: P,
|
|
3097
3153
|
id: "scale-option",
|
|
3098
3154
|
value: u,
|
|
3099
|
-
onValueChange: (
|
|
3155
|
+
onValueChange: (v) => N(v),
|
|
3100
3156
|
className: "col-span-2 flex gap-3",
|
|
3101
3157
|
defaultValue: "x",
|
|
3102
3158
|
children: [
|
|
@@ -3113,10 +3169,10 @@ function ka() {
|
|
|
3113
3169
|
)
|
|
3114
3170
|
] }),
|
|
3115
3171
|
u === "custom" && o == "linear" && D(),
|
|
3116
|
-
|
|
3117
|
-
/* @__PURE__ */ e.jsx(
|
|
3172
|
+
G(),
|
|
3173
|
+
/* @__PURE__ */ e.jsx(Tt, {}),
|
|
3118
3174
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3119
|
-
|
|
3175
|
+
z,
|
|
3120
3176
|
{
|
|
3121
3177
|
onClick: te,
|
|
3122
3178
|
variant: "secondary",
|
|
@@ -3128,25 +3184,25 @@ function ka() {
|
|
|
3128
3184
|
] }) })
|
|
3129
3185
|
] });
|
|
3130
3186
|
}
|
|
3131
|
-
function
|
|
3187
|
+
function Un({ idx: s }) {
|
|
3132
3188
|
var c;
|
|
3133
|
-
const n = r((
|
|
3134
|
-
var
|
|
3135
|
-
return (
|
|
3189
|
+
const n = r((h) => {
|
|
3190
|
+
var g;
|
|
3191
|
+
return (g = h.card) == null ? void 0 : g.preferences;
|
|
3136
3192
|
}), a = r(
|
|
3137
|
-
(
|
|
3138
|
-
var
|
|
3139
|
-
return (
|
|
3193
|
+
(h) => {
|
|
3194
|
+
var g;
|
|
3195
|
+
return (g = h.card.preferences) == null ? void 0 : g.datasetOptions;
|
|
3140
3196
|
}
|
|
3141
3197
|
), t = r(
|
|
3142
|
-
(
|
|
3143
|
-
), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((
|
|
3144
|
-
function l(
|
|
3145
|
-
(
|
|
3198
|
+
(h) => h.actions.setCardPreferences
|
|
3199
|
+
), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((h) => h.idx === s);
|
|
3200
|
+
function l(h, g) {
|
|
3201
|
+
(h === "end" || h === "start") && Et(Lt());
|
|
3146
3202
|
const m = {
|
|
3147
|
-
display:
|
|
3148
|
-
align:
|
|
3149
|
-
anchor:
|
|
3203
|
+
display: h !== "none",
|
|
3204
|
+
align: h,
|
|
3205
|
+
anchor: h,
|
|
3150
3206
|
clamp: !0
|
|
3151
3207
|
};
|
|
3152
3208
|
if (!o)
|
|
@@ -3155,7 +3211,7 @@ function Kn({ idx: s }) {
|
|
|
3155
3211
|
datasetOptions: [
|
|
3156
3212
|
...a || [],
|
|
3157
3213
|
{
|
|
3158
|
-
idx:
|
|
3214
|
+
idx: g,
|
|
3159
3215
|
datalabels: m
|
|
3160
3216
|
}
|
|
3161
3217
|
]
|
|
@@ -3163,39 +3219,39 @@ function Kn({ idx: s }) {
|
|
|
3163
3219
|
else {
|
|
3164
3220
|
const u = { ...o };
|
|
3165
3221
|
u.datalabels = m;
|
|
3166
|
-
const
|
|
3167
|
-
(
|
|
3222
|
+
const N = a == null ? void 0 : a.map(
|
|
3223
|
+
(d) => d.idx === g ? u : d
|
|
3168
3224
|
);
|
|
3169
3225
|
t({
|
|
3170
3226
|
...n,
|
|
3171
|
-
datasetOptions:
|
|
3227
|
+
datasetOptions: N
|
|
3172
3228
|
});
|
|
3173
3229
|
}
|
|
3174
3230
|
}
|
|
3175
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3176
|
-
/* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(
|
|
3177
|
-
/* @__PURE__ */ e.jsx(
|
|
3231
|
+
return /* @__PURE__ */ e.jsxs(Pe, { children: [
|
|
3232
|
+
/* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(xn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
3233
|
+
/* @__PURE__ */ e.jsx(Ge, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
3178
3234
|
/* @__PURE__ */ e.jsx(
|
|
3179
|
-
|
|
3235
|
+
z,
|
|
3180
3236
|
{
|
|
3181
3237
|
onClick: () => l("none", s),
|
|
3182
3238
|
size: "sm",
|
|
3183
3239
|
variant: "secondary",
|
|
3184
3240
|
className: "h-7 p-1 text-xs font-normal",
|
|
3185
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3241
|
+
children: /* @__PURE__ */ e.jsx(At, { className: "size-4" })
|
|
3186
3242
|
}
|
|
3187
3243
|
),
|
|
3188
3244
|
/* @__PURE__ */ e.jsx(
|
|
3189
|
-
|
|
3245
|
+
z,
|
|
3190
3246
|
{
|
|
3191
3247
|
onClick: () => l("start", s),
|
|
3192
3248
|
size: "sm",
|
|
3193
3249
|
variant: "secondary",
|
|
3194
3250
|
className: "h-7 p-1 text-xs font-normal",
|
|
3195
3251
|
children: /* @__PURE__ */ e.jsx(
|
|
3196
|
-
|
|
3252
|
+
an,
|
|
3197
3253
|
{
|
|
3198
|
-
className:
|
|
3254
|
+
className: Y("h-4 w-4", {
|
|
3199
3255
|
"rotate-90": i === "y"
|
|
3200
3256
|
})
|
|
3201
3257
|
}
|
|
@@ -3203,16 +3259,16 @@ function Kn({ idx: s }) {
|
|
|
3203
3259
|
}
|
|
3204
3260
|
),
|
|
3205
3261
|
/* @__PURE__ */ e.jsx(
|
|
3206
|
-
|
|
3262
|
+
z,
|
|
3207
3263
|
{
|
|
3208
3264
|
onClick: () => l("center", s),
|
|
3209
3265
|
size: "sm",
|
|
3210
3266
|
variant: "secondary",
|
|
3211
3267
|
className: "h-7 p-1 text-xs font-normal",
|
|
3212
3268
|
children: /* @__PURE__ */ e.jsx(
|
|
3213
|
-
|
|
3269
|
+
nn,
|
|
3214
3270
|
{
|
|
3215
|
-
className:
|
|
3271
|
+
className: Y("h-4 w-4", {
|
|
3216
3272
|
"rotate-90": i === "y"
|
|
3217
3273
|
})
|
|
3218
3274
|
}
|
|
@@ -3220,16 +3276,16 @@ function Kn({ idx: s }) {
|
|
|
3220
3276
|
}
|
|
3221
3277
|
),
|
|
3222
3278
|
/* @__PURE__ */ e.jsx(
|
|
3223
|
-
|
|
3279
|
+
z,
|
|
3224
3280
|
{
|
|
3225
3281
|
onClick: () => l("end", s),
|
|
3226
3282
|
size: "sm",
|
|
3227
3283
|
variant: "secondary",
|
|
3228
3284
|
className: "h-7 p-1 text-xs font-normal",
|
|
3229
3285
|
children: /* @__PURE__ */ e.jsx(
|
|
3230
|
-
|
|
3286
|
+
tn,
|
|
3231
3287
|
{
|
|
3232
|
-
className:
|
|
3288
|
+
className: Y("h-4 w-4", {
|
|
3233
3289
|
"rotate-90": i === "y"
|
|
3234
3290
|
})
|
|
3235
3291
|
}
|
|
@@ -3239,26 +3295,26 @@ function Kn({ idx: s }) {
|
|
|
3239
3295
|
] }) })
|
|
3240
3296
|
] });
|
|
3241
3297
|
}
|
|
3242
|
-
function
|
|
3243
|
-
const s = r((
|
|
3244
|
-
(
|
|
3245
|
-
var
|
|
3246
|
-
return (u = (m = (
|
|
3298
|
+
function za() {
|
|
3299
|
+
const s = r((h) => h.card), n = r(
|
|
3300
|
+
(h) => {
|
|
3301
|
+
var g, m, u;
|
|
3302
|
+
return (u = (m = (g = h == null ? void 0 : h.card) == null ? void 0 : g.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
|
|
3247
3303
|
}
|
|
3248
3304
|
), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
|
|
3249
3305
|
keys: i,
|
|
3250
3306
|
metricKeys: o,
|
|
3251
3307
|
dimensionKeys: l
|
|
3252
|
-
} =
|
|
3308
|
+
} = hs(s.data || []);
|
|
3253
3309
|
let c = o;
|
|
3254
3310
|
if (s.type === "stackedBar") {
|
|
3255
|
-
const
|
|
3311
|
+
const h = Dt({
|
|
3256
3312
|
dataArray: s.data || [],
|
|
3257
3313
|
groupKey: l[0],
|
|
3258
3314
|
pivotKey: l[1],
|
|
3259
3315
|
valueKey: c[0]
|
|
3260
|
-
}), { metricKeys:
|
|
3261
|
-
c =
|
|
3316
|
+
}), { metricKeys: g } = hs(h);
|
|
3317
|
+
c = g;
|
|
3262
3318
|
}
|
|
3263
3319
|
return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3264
3320
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -3268,20 +3324,20 @@ function wa() {
|
|
|
3268
3324
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3269
3325
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
3270
3326
|
/* @__PURE__ */ e.jsx(B, { children: t }),
|
|
3271
|
-
/* @__PURE__ */ e.jsx(
|
|
3327
|
+
/* @__PURE__ */ e.jsx(wa, {})
|
|
3272
3328
|
] }),
|
|
3273
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((
|
|
3329
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((h, g) => /* @__PURE__ */ e.jsx(Gn, { col: h, idx: g }, h)) })
|
|
3274
3330
|
] })
|
|
3275
3331
|
] });
|
|
3276
3332
|
}
|
|
3277
|
-
function
|
|
3333
|
+
function Gn({ col: s, idx: n }) {
|
|
3278
3334
|
const a = r((c) => {
|
|
3279
|
-
var
|
|
3280
|
-
return (
|
|
3335
|
+
var h;
|
|
3336
|
+
return (h = c.card) == null ? void 0 : h.preferences;
|
|
3281
3337
|
}), t = r(
|
|
3282
3338
|
(c) => {
|
|
3283
|
-
var
|
|
3284
|
-
return (
|
|
3339
|
+
var h;
|
|
3340
|
+
return (h = c.card.preferences) == null ? void 0 : h.datasetOptions;
|
|
3285
3341
|
}
|
|
3286
3342
|
), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
|
|
3287
3343
|
function l(c) {
|
|
@@ -3298,14 +3354,14 @@ function Un({ col: s, idx: n }) {
|
|
|
3298
3354
|
]
|
|
3299
3355
|
});
|
|
3300
3356
|
else {
|
|
3301
|
-
const
|
|
3302
|
-
|
|
3303
|
-
const
|
|
3304
|
-
(m) => m.idx === n ?
|
|
3357
|
+
const h = { ...i };
|
|
3358
|
+
h.type = c === "area" ? "line" : c, h.fill = c === "area" ? "origin" : "";
|
|
3359
|
+
const g = t == null ? void 0 : t.map(
|
|
3360
|
+
(m) => m.idx === n ? h : m
|
|
3305
3361
|
);
|
|
3306
3362
|
o({
|
|
3307
3363
|
...a,
|
|
3308
|
-
datasetOptions:
|
|
3364
|
+
datasetOptions: g
|
|
3309
3365
|
});
|
|
3310
3366
|
}
|
|
3311
3367
|
}
|
|
@@ -3313,14 +3369,14 @@ function Un({ col: s, idx: n }) {
|
|
|
3313
3369
|
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
3314
3370
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
3315
3371
|
/* @__PURE__ */ e.jsx(
|
|
3316
|
-
|
|
3372
|
+
ws,
|
|
3317
3373
|
{
|
|
3318
3374
|
onClick: () => l("bar"),
|
|
3319
3375
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3320
3376
|
}
|
|
3321
3377
|
),
|
|
3322
3378
|
/* @__PURE__ */ e.jsx(
|
|
3323
|
-
|
|
3379
|
+
zs,
|
|
3324
3380
|
{
|
|
3325
3381
|
onClick: () => l("line"),
|
|
3326
3382
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -3334,13 +3390,13 @@ function Un({ col: s, idx: n }) {
|
|
|
3334
3390
|
}
|
|
3335
3391
|
),
|
|
3336
3392
|
/* @__PURE__ */ e.jsx(
|
|
3337
|
-
|
|
3393
|
+
Ss,
|
|
3338
3394
|
{
|
|
3339
3395
|
orientation: "vertical",
|
|
3340
3396
|
className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3341
3397
|
}
|
|
3342
3398
|
),
|
|
3343
|
-
/* @__PURE__ */ e.jsx(
|
|
3399
|
+
/* @__PURE__ */ e.jsx(Un, { idx: n })
|
|
3344
3400
|
] })
|
|
3345
3401
|
] });
|
|
3346
3402
|
}
|
|
@@ -3348,9 +3404,9 @@ function Jn({
|
|
|
3348
3404
|
cardType: s
|
|
3349
3405
|
}) {
|
|
3350
3406
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3351
|
-
/* @__PURE__ */ e.jsxs(
|
|
3352
|
-
/* @__PURE__ */ e.jsx(
|
|
3353
|
-
/* @__PURE__ */ e.jsxs(
|
|
3407
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3408
|
+
/* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
|
|
3409
|
+
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
|
|
3354
3410
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
|
|
3355
3411
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3356
3412
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -3373,49 +3429,49 @@ function Jn({
|
|
|
3373
3429
|
] })
|
|
3374
3430
|
] })
|
|
3375
3431
|
] }),
|
|
3376
|
-
/* @__PURE__ */ e.jsxs(
|
|
3377
|
-
/* @__PURE__ */ e.jsx(
|
|
3378
|
-
/* @__PURE__ */ e.jsxs(
|
|
3379
|
-
/* @__PURE__ */ e.jsx(
|
|
3380
|
-
/* @__PURE__ */ e.jsx(
|
|
3432
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3433
|
+
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3434
|
+
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3435
|
+
/* @__PURE__ */ e.jsx(Fs, {}),
|
|
3436
|
+
/* @__PURE__ */ e.jsx(za, {})
|
|
3381
3437
|
] })
|
|
3382
3438
|
] }),
|
|
3383
|
-
/* @__PURE__ */ e.jsxs(
|
|
3384
|
-
/* @__PURE__ */ e.jsx(
|
|
3385
|
-
/* @__PURE__ */ e.jsx(
|
|
3439
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3440
|
+
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3441
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3386
3442
|
] })
|
|
3387
3443
|
] }) });
|
|
3388
3444
|
}
|
|
3389
|
-
function
|
|
3445
|
+
function Os() {
|
|
3390
3446
|
var i, o, l;
|
|
3391
3447
|
const s = r(
|
|
3392
3448
|
(c) => c.card.cfg
|
|
3393
3449
|
), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
|
|
3394
3450
|
function t(c) {
|
|
3395
3451
|
var m;
|
|
3396
|
-
const
|
|
3452
|
+
const h = {
|
|
3397
3453
|
datalabels: {
|
|
3398
3454
|
display: c !== "none",
|
|
3399
3455
|
align: c,
|
|
3400
3456
|
anchor: c,
|
|
3401
3457
|
clamp: !0
|
|
3402
3458
|
}
|
|
3403
|
-
},
|
|
3459
|
+
}, g = {
|
|
3404
3460
|
...s,
|
|
3405
3461
|
options: {
|
|
3406
3462
|
...s == null ? void 0 : s.options,
|
|
3407
3463
|
plugins: {
|
|
3408
3464
|
...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
|
|
3409
|
-
...
|
|
3465
|
+
...h
|
|
3410
3466
|
}
|
|
3411
3467
|
}
|
|
3412
3468
|
};
|
|
3413
|
-
n(
|
|
3469
|
+
n(g), console.log(c);
|
|
3414
3470
|
}
|
|
3415
3471
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3416
3472
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3417
3473
|
/* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
|
|
3418
|
-
|
|
3474
|
+
!["pyramid", "range"].includes(a) && /* @__PURE__ */ e.jsx(wa, {})
|
|
3419
3475
|
] }),
|
|
3420
3476
|
/* @__PURE__ */ e.jsxs(
|
|
3421
3477
|
Oe,
|
|
@@ -3425,7 +3481,7 @@ function ks() {
|
|
|
3425
3481
|
defaultValue: "none",
|
|
3426
3482
|
children: [
|
|
3427
3483
|
/* @__PURE__ */ e.jsx(Me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, { placeholder: "Select position" }) }),
|
|
3428
|
-
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(
|
|
3484
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
|
|
3429
3485
|
/* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
|
|
3430
3486
|
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
|
|
3431
3487
|
a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
|
|
@@ -3437,7 +3493,7 @@ function ks() {
|
|
|
3437
3493
|
)
|
|
3438
3494
|
] });
|
|
3439
3495
|
}
|
|
3440
|
-
function
|
|
3496
|
+
function Qn({
|
|
3441
3497
|
cardType: s
|
|
3442
3498
|
}) {
|
|
3443
3499
|
function n(a) {
|
|
@@ -3468,21 +3524,21 @@ function Pn({
|
|
|
3468
3524
|
] });
|
|
3469
3525
|
}
|
|
3470
3526
|
return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3471
|
-
/* @__PURE__ */ e.jsxs(
|
|
3472
|
-
/* @__PURE__ */ e.jsx(
|
|
3473
|
-
/* @__PURE__ */ e.jsx(
|
|
3527
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3528
|
+
/* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
|
|
3529
|
+
/* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
|
|
3474
3530
|
] }),
|
|
3475
|
-
/* @__PURE__ */ e.jsxs(
|
|
3476
|
-
/* @__PURE__ */ e.jsx(
|
|
3477
|
-
/* @__PURE__ */ e.jsx(
|
|
3531
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3532
|
+
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3533
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
|
|
3478
3534
|
] }),
|
|
3479
|
-
/* @__PURE__ */ e.jsxs(
|
|
3480
|
-
/* @__PURE__ */ e.jsx(
|
|
3481
|
-
/* @__PURE__ */ e.jsx(
|
|
3535
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3536
|
+
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3537
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3482
3538
|
] })
|
|
3483
3539
|
] }) });
|
|
3484
3540
|
}
|
|
3485
|
-
const
|
|
3541
|
+
const Wn = {
|
|
3486
3542
|
datasets: [
|
|
3487
3543
|
{
|
|
3488
3544
|
type: "line",
|
|
@@ -3495,7 +3551,7 @@ const Gn = {
|
|
|
3495
3551
|
data: []
|
|
3496
3552
|
}
|
|
3497
3553
|
]
|
|
3498
|
-
},
|
|
3554
|
+
}, Yn = {
|
|
3499
3555
|
datasets: [
|
|
3500
3556
|
{
|
|
3501
3557
|
fill: "origin",
|
|
@@ -3505,50 +3561,50 @@ const Gn = {
|
|
|
3505
3561
|
}
|
|
3506
3562
|
]
|
|
3507
3563
|
};
|
|
3508
|
-
function
|
|
3564
|
+
function Xn() {
|
|
3509
3565
|
const s = r((n) => n.card.type);
|
|
3510
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "
|
|
3566
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
3511
3567
|
/* @__PURE__ */ e.jsx(
|
|
3512
3568
|
Se,
|
|
3513
3569
|
{
|
|
3514
3570
|
className: " ",
|
|
3515
3571
|
type: "single",
|
|
3516
3572
|
collapsible: !0,
|
|
3517
|
-
children:
|
|
3573
|
+
children: Zn(s)
|
|
3518
3574
|
}
|
|
3519
3575
|
),
|
|
3520
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3521
|
-
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3576
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Fs, {}) }),
|
|
3577
|
+
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Os, {}) }),
|
|
3522
3578
|
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(De, {}) })
|
|
3523
3579
|
] });
|
|
3524
3580
|
}
|
|
3525
|
-
function
|
|
3581
|
+
function Zn(s) {
|
|
3526
3582
|
if (["line", "bar"].includes(s))
|
|
3527
3583
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3528
|
-
/* @__PURE__ */ e.jsxs(
|
|
3529
|
-
/* @__PURE__ */ e.jsx(
|
|
3530
|
-
/* @__PURE__ */ e.jsxs(
|
|
3531
|
-
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1
|
|
3532
|
-
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2
|
|
3584
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3585
|
+
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
|
|
3586
|
+
/* @__PURE__ */ e.jsxs(_, { className: " ", children: [
|
|
3587
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
|
|
3588
|
+
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
3533
3589
|
/* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
|
|
3534
3590
|
/* @__PURE__ */ e.jsx("li", { children: "Y-axis - Number (ex. population)" })
|
|
3535
3591
|
] })
|
|
3536
3592
|
] })
|
|
3537
3593
|
] }),
|
|
3538
|
-
/* @__PURE__ */ e.jsxs(
|
|
3539
|
-
/* @__PURE__ */ e.jsx(
|
|
3540
|
-
/* @__PURE__ */ e.jsxs(
|
|
3594
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3595
|
+
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
|
|
3596
|
+
/* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
|
|
3541
3597
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
3542
3598
|
"Click ",
|
|
3543
3599
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
3544
3600
|
" and change the `type` property in the dataset."
|
|
3545
3601
|
] }),
|
|
3546
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
3602
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Wn, null, 2) })
|
|
3547
3603
|
] })
|
|
3548
3604
|
] }),
|
|
3549
|
-
/* @__PURE__ */ e.jsxs(
|
|
3550
|
-
/* @__PURE__ */ e.jsx(
|
|
3551
|
-
/* @__PURE__ */ e.jsxs(
|
|
3605
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3606
|
+
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
|
|
3607
|
+
/* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
|
|
3552
3608
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
3553
3609
|
"Click ",
|
|
3554
3610
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
@@ -3556,7 +3612,7 @@ function Yn(s) {
|
|
|
3556
3612
|
/* @__PURE__ */ e.jsx(
|
|
3557
3613
|
"a",
|
|
3558
3614
|
{
|
|
3559
|
-
className: "text-blue-500 hover:underline
|
|
3615
|
+
className: "mx-1 text-blue-500 hover:underline",
|
|
3560
3616
|
href: "https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",
|
|
3561
3617
|
target: "_blank",
|
|
3562
3618
|
children: "docs"
|
|
@@ -3564,20 +3620,20 @@ function Yn(s) {
|
|
|
3564
3620
|
),
|
|
3565
3621
|
"for more options."
|
|
3566
3622
|
] }),
|
|
3567
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
3623
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Yn, null, 2) })
|
|
3568
3624
|
] })
|
|
3569
3625
|
] })
|
|
3570
3626
|
] });
|
|
3571
3627
|
if (s === "bubble")
|
|
3572
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3573
|
-
/* @__PURE__ */ e.jsx(
|
|
3628
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3629
|
+
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3574
3630
|
"How to create a ",
|
|
3575
3631
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
3576
3632
|
" chart query?"
|
|
3577
3633
|
] }) }),
|
|
3578
|
-
/* @__PURE__ */ e.jsxs(
|
|
3579
|
-
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1
|
|
3580
|
-
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2
|
|
3634
|
+
/* @__PURE__ */ e.jsxs(_, { className: " ", children: [
|
|
3635
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
|
|
3636
|
+
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
3581
3637
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
3582
3638
|
/* @__PURE__ */ e.jsx("li", { children: "Bubble Group (opt) - Category (ex. state)" }),
|
|
3583
3639
|
/* @__PURE__ */ e.jsx("li", { children: "X-axis - Number (ex. avg. age)" }),
|
|
@@ -3587,15 +3643,15 @@ function Yn(s) {
|
|
|
3587
3643
|
] })
|
|
3588
3644
|
] }) });
|
|
3589
3645
|
if (s === "scatter")
|
|
3590
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3591
|
-
/* @__PURE__ */ e.jsx(
|
|
3646
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3647
|
+
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3592
3648
|
"How to create a ",
|
|
3593
3649
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
3594
3650
|
" chart query?"
|
|
3595
3651
|
] }) }),
|
|
3596
|
-
/* @__PURE__ */ e.jsxs(
|
|
3597
|
-
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1
|
|
3598
|
-
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2
|
|
3652
|
+
/* @__PURE__ */ e.jsxs(_, { className: " ", children: [
|
|
3653
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis FROM table" }),
|
|
3654
|
+
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
3599
3655
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
3600
3656
|
/* @__PURE__ */ e.jsx("li", { children: "Group (opt) - Category (ex. state)" }),
|
|
3601
3657
|
/* @__PURE__ */ e.jsx("li", { children: "X-axis - Number (ex. avg. age)" }),
|
|
@@ -3604,68 +3660,68 @@ function Yn(s) {
|
|
|
3604
3660
|
] })
|
|
3605
3661
|
] }) });
|
|
3606
3662
|
if (["pie", "doughnut", "polarArea"].includes(s))
|
|
3607
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3608
|
-
/* @__PURE__ */ e.jsx(
|
|
3663
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3664
|
+
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3609
3665
|
/* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
|
|
3610
3666
|
" ",
|
|
3611
3667
|
"chart query"
|
|
3612
3668
|
] }) }),
|
|
3613
|
-
/* @__PURE__ */ e.jsxs(
|
|
3614
|
-
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1
|
|
3615
|
-
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2
|
|
3669
|
+
/* @__PURE__ */ e.jsxs(_, { className: " ", children: [
|
|
3670
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
|
|
3671
|
+
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
3616
3672
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
3617
3673
|
/* @__PURE__ */ e.jsx("li", { children: "Measure - Number (ex. population)" })
|
|
3618
3674
|
] })
|
|
3619
3675
|
] })
|
|
3620
3676
|
] }) });
|
|
3621
3677
|
}
|
|
3622
|
-
function
|
|
3623
|
-
var
|
|
3624
|
-
const s = r((
|
|
3625
|
-
(
|
|
3678
|
+
function el() {
|
|
3679
|
+
var h, g, m, u, N;
|
|
3680
|
+
const s = r((d) => d.card.preferences), n = r(
|
|
3681
|
+
(d) => d.actions.setCardPreferences
|
|
3626
3682
|
), a = r(
|
|
3627
|
-
(
|
|
3683
|
+
(d) => d.actions.setNumberFormat
|
|
3628
3684
|
);
|
|
3629
3685
|
r(
|
|
3630
|
-
(
|
|
3631
|
-
var x,
|
|
3632
|
-
return (
|
|
3686
|
+
(d) => {
|
|
3687
|
+
var x, f;
|
|
3688
|
+
return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.decimalPlaces;
|
|
3633
3689
|
}
|
|
3634
3690
|
);
|
|
3635
3691
|
const t = r(
|
|
3636
|
-
(
|
|
3637
|
-
var x,
|
|
3638
|
-
return (
|
|
3692
|
+
(d) => {
|
|
3693
|
+
var x, f;
|
|
3694
|
+
return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.locale;
|
|
3639
3695
|
}
|
|
3640
3696
|
), i = r(
|
|
3641
|
-
(
|
|
3642
|
-
var x,
|
|
3643
|
-
return (
|
|
3697
|
+
(d) => {
|
|
3698
|
+
var x, f;
|
|
3699
|
+
return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.currency;
|
|
3644
3700
|
}
|
|
3645
3701
|
);
|
|
3646
3702
|
r(
|
|
3647
|
-
(
|
|
3703
|
+
(d) => d.actions.setFilterOnClickField
|
|
3648
3704
|
);
|
|
3649
3705
|
const o = r(
|
|
3650
|
-
(
|
|
3651
|
-
var x,
|
|
3652
|
-
return (
|
|
3706
|
+
(d) => {
|
|
3707
|
+
var x, f;
|
|
3708
|
+
return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.colorRanges;
|
|
3653
3709
|
}
|
|
3654
3710
|
) || [], l = r(
|
|
3655
|
-
(
|
|
3656
|
-
), c = [...new Set(
|
|
3711
|
+
(d) => d.actions.setColorRanges
|
|
3712
|
+
), c = [...new Set(Rs.map((d) => d.currency))];
|
|
3657
3713
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
3658
3714
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
3659
3715
|
/* @__PURE__ */ e.jsx(
|
|
3660
|
-
|
|
3716
|
+
Ke,
|
|
3661
3717
|
{
|
|
3662
|
-
checked: !!((
|
|
3663
|
-
onCheckedChange: (
|
|
3718
|
+
checked: !!((h = s == null ? void 0 : s.formatNumber) != null && h.enabled),
|
|
3719
|
+
onCheckedChange: (d) => {
|
|
3664
3720
|
n({
|
|
3665
3721
|
...s,
|
|
3666
3722
|
formatNumber: {
|
|
3667
3723
|
...s == null ? void 0 : s.formatNumber,
|
|
3668
|
-
enabled:
|
|
3724
|
+
enabled: d
|
|
3669
3725
|
}
|
|
3670
3726
|
});
|
|
3671
3727
|
}
|
|
@@ -3673,7 +3729,7 @@ function Xn() {
|
|
|
3673
3729
|
),
|
|
3674
3730
|
/* @__PURE__ */ e.jsx(B, { children: "Format Number" })
|
|
3675
3731
|
] }),
|
|
3676
|
-
((
|
|
3732
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
3677
3733
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
|
|
3678
3734
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3679
3735
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
@@ -3682,20 +3738,20 @@ function Xn() {
|
|
|
3682
3738
|
Oe,
|
|
3683
3739
|
{
|
|
3684
3740
|
value: t || "en-US",
|
|
3685
|
-
onValueChange: (
|
|
3686
|
-
var x,
|
|
3741
|
+
onValueChange: (d) => {
|
|
3742
|
+
var x, f, w;
|
|
3687
3743
|
return a(
|
|
3688
3744
|
((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
|
|
3689
|
-
((
|
|
3690
|
-
|
|
3691
|
-
((
|
|
3745
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
|
|
3746
|
+
d || "en-US",
|
|
3747
|
+
((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
|
|
3692
3748
|
);
|
|
3693
3749
|
},
|
|
3694
3750
|
children: [
|
|
3695
3751
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3696
|
-
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(
|
|
3752
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
|
|
3697
3753
|
/* @__PURE__ */ e.jsx(Le, { children: "Format" }),
|
|
3698
|
-
|
|
3754
|
+
Rs.map((d) => /* @__PURE__ */ e.jsx(X, { value: d.locale, children: d.locale }, d.locale))
|
|
3699
3755
|
] }) })
|
|
3700
3756
|
]
|
|
3701
3757
|
}
|
|
@@ -3707,21 +3763,21 @@ function Xn() {
|
|
|
3707
3763
|
Oe,
|
|
3708
3764
|
{
|
|
3709
3765
|
value: i || "none",
|
|
3710
|
-
onValueChange: (
|
|
3711
|
-
var x,
|
|
3766
|
+
onValueChange: (d) => {
|
|
3767
|
+
var x, f, w;
|
|
3712
3768
|
return a(
|
|
3713
3769
|
((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
|
|
3714
|
-
|
|
3715
|
-
((
|
|
3716
|
-
((
|
|
3770
|
+
d === "none" ? "" : d,
|
|
3771
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
|
|
3772
|
+
((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
|
|
3717
3773
|
);
|
|
3718
3774
|
},
|
|
3719
3775
|
children: [
|
|
3720
3776
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3721
|
-
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(
|
|
3777
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
|
|
3722
3778
|
/* @__PURE__ */ e.jsx(Le, { children: "Currency" }),
|
|
3723
3779
|
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
|
|
3724
|
-
c.map((
|
|
3780
|
+
c.map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d))
|
|
3725
3781
|
] }) })
|
|
3726
3782
|
]
|
|
3727
3783
|
}
|
|
@@ -3735,18 +3791,18 @@ function Xn() {
|
|
|
3735
3791
|
Oe,
|
|
3736
3792
|
{
|
|
3737
3793
|
value: ((u = (m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : u.toString()) || "0",
|
|
3738
|
-
onValueChange: (
|
|
3739
|
-
var x,
|
|
3794
|
+
onValueChange: (d) => {
|
|
3795
|
+
var x, f, w;
|
|
3740
3796
|
return a(
|
|
3741
|
-
Number(
|
|
3797
|
+
Number(d),
|
|
3742
3798
|
((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.currency) || "",
|
|
3743
|
-
((
|
|
3744
|
-
((
|
|
3799
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
|
|
3800
|
+
((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
|
|
3745
3801
|
);
|
|
3746
3802
|
},
|
|
3747
3803
|
children: [
|
|
3748
3804
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3749
|
-
/* @__PURE__ */ e.jsx(Ae, { children: ["0", "1", "2", "3", "4"].map((
|
|
3805
|
+
/* @__PURE__ */ e.jsx(Ae, { children: ["0", "1", "2", "3", "4"].map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d)) })
|
|
3750
3806
|
]
|
|
3751
3807
|
}
|
|
3752
3808
|
)
|
|
@@ -3756,16 +3812,16 @@ function Xn() {
|
|
|
3756
3812
|
/* @__PURE__ */ e.jsx(
|
|
3757
3813
|
ae,
|
|
3758
3814
|
{
|
|
3759
|
-
value: ((
|
|
3815
|
+
value: ((N = s == null ? void 0 : s.formatNumber) == null ? void 0 : N.suffix) || "",
|
|
3760
3816
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3761
3817
|
placeholder: "K, M, B, %",
|
|
3762
|
-
onChange: (
|
|
3763
|
-
var x,
|
|
3818
|
+
onChange: (d) => {
|
|
3819
|
+
var x, f, w;
|
|
3764
3820
|
return a(
|
|
3765
3821
|
((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
|
|
3766
|
-
((
|
|
3767
|
-
((
|
|
3768
|
-
|
|
3822
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
|
|
3823
|
+
((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.locale) || "",
|
|
3824
|
+
d.target.value
|
|
3769
3825
|
);
|
|
3770
3826
|
}
|
|
3771
3827
|
}
|
|
@@ -3773,9 +3829,9 @@ function Xn() {
|
|
|
3773
3829
|
] })
|
|
3774
3830
|
] })
|
|
3775
3831
|
] }) }),
|
|
3776
|
-
/* @__PURE__ */ e.jsx(
|
|
3832
|
+
/* @__PURE__ */ e.jsx(Ss, { className: "my-3" }),
|
|
3777
3833
|
/* @__PURE__ */ e.jsx(
|
|
3778
|
-
|
|
3834
|
+
It,
|
|
3779
3835
|
{
|
|
3780
3836
|
colorRanges: o,
|
|
3781
3837
|
setColorRanges: l
|
|
@@ -3784,11 +3840,11 @@ function Xn() {
|
|
|
3784
3840
|
] })
|
|
3785
3841
|
] });
|
|
3786
3842
|
}
|
|
3787
|
-
function
|
|
3843
|
+
function sl() {
|
|
3788
3844
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3789
|
-
/* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(
|
|
3790
|
-
/* @__PURE__ */ e.jsx(
|
|
3791
|
-
/* @__PURE__ */ e.jsxs(
|
|
3845
|
+
/* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3846
|
+
/* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
|
|
3847
|
+
/* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
|
|
3792
3848
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
3793
3849
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3794
3850
|
/* @__PURE__ */ e.jsx("li", { children: "current - number" }),
|
|
@@ -3810,19 +3866,19 @@ function Zn() {
|
|
|
3810
3866
|
] })
|
|
3811
3867
|
] })
|
|
3812
3868
|
] }) }),
|
|
3813
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
3869
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(el, {}) }),
|
|
3814
3870
|
/* @__PURE__ */ e.jsx("div", {}),
|
|
3815
3871
|
/* @__PURE__ */ e.jsx("div", {})
|
|
3816
3872
|
] });
|
|
3817
3873
|
}
|
|
3818
|
-
function
|
|
3874
|
+
function os({
|
|
3819
3875
|
cardType: s,
|
|
3820
3876
|
docContent: n
|
|
3821
3877
|
}) {
|
|
3822
3878
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3823
|
-
/* @__PURE__ */ e.jsxs(
|
|
3824
|
-
/* @__PURE__ */ e.jsx(
|
|
3825
|
-
/* @__PURE__ */ e.jsx(
|
|
3879
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3880
|
+
/* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
|
|
3881
|
+
/* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3826
3882
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
3827
3883
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3828
3884
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
@@ -3844,21 +3900,21 @@ function Ks({
|
|
|
3844
3900
|
] })
|
|
3845
3901
|
] }) })
|
|
3846
3902
|
] }),
|
|
3847
|
-
/* @__PURE__ */ e.jsxs(
|
|
3848
|
-
/* @__PURE__ */ e.jsx(
|
|
3849
|
-
/* @__PURE__ */ e.jsx(
|
|
3903
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3904
|
+
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3905
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
|
|
3850
3906
|
] }),
|
|
3851
|
-
/* @__PURE__ */ e.jsxs(
|
|
3852
|
-
/* @__PURE__ */ e.jsx(
|
|
3853
|
-
/* @__PURE__ */ e.jsx(
|
|
3907
|
+
s !== "range" && /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3908
|
+
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3909
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3854
3910
|
] })
|
|
3855
3911
|
] }) });
|
|
3856
3912
|
}
|
|
3857
|
-
function
|
|
3913
|
+
function al() {
|
|
3858
3914
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3859
|
-
/* @__PURE__ */ e.jsxs(
|
|
3860
|
-
/* @__PURE__ */ e.jsx(
|
|
3861
|
-
/* @__PURE__ */ e.jsxs(
|
|
3915
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3916
|
+
/* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
|
|
3917
|
+
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
|
|
3862
3918
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
|
|
3863
3919
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3864
3920
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -3881,20 +3937,20 @@ function el() {
|
|
|
3881
3937
|
] })
|
|
3882
3938
|
] })
|
|
3883
3939
|
] }),
|
|
3884
|
-
/* @__PURE__ */ e.jsxs(
|
|
3885
|
-
/* @__PURE__ */ e.jsx(
|
|
3886
|
-
/* @__PURE__ */ e.jsxs(
|
|
3887
|
-
/* @__PURE__ */ e.jsx(
|
|
3888
|
-
/* @__PURE__ */ e.jsx(
|
|
3940
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3941
|
+
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3942
|
+
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3943
|
+
/* @__PURE__ */ e.jsx(Fs, {}),
|
|
3944
|
+
/* @__PURE__ */ e.jsx(za, {})
|
|
3889
3945
|
] })
|
|
3890
3946
|
] }),
|
|
3891
|
-
/* @__PURE__ */ e.jsxs(
|
|
3892
|
-
/* @__PURE__ */ e.jsx(
|
|
3893
|
-
/* @__PURE__ */ e.jsx(
|
|
3947
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3948
|
+
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3949
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3894
3950
|
] })
|
|
3895
3951
|
] }) });
|
|
3896
3952
|
}
|
|
3897
|
-
function
|
|
3953
|
+
function tl({}) {
|
|
3898
3954
|
const s = r((t) => {
|
|
3899
3955
|
var i;
|
|
3900
3956
|
return (i = t.card) == null ? void 0 : i.preferences;
|
|
@@ -3907,12 +3963,12 @@ function sl({}) {
|
|
|
3907
3963
|
});
|
|
3908
3964
|
};
|
|
3909
3965
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3910
|
-
/* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(
|
|
3911
|
-
/* @__PURE__ */ e.jsx(
|
|
3912
|
-
/* @__PURE__ */ e.jsx(
|
|
3966
|
+
/* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3967
|
+
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3968
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3913
3969
|
] }) }),
|
|
3914
3970
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3915
|
-
/* @__PURE__ */ e.jsx(
|
|
3971
|
+
/* @__PURE__ */ e.jsx(Ke, { onCheckedChange: a, id: "allow-download" }),
|
|
3916
3972
|
/* @__PURE__ */ e.jsx(
|
|
3917
3973
|
"label",
|
|
3918
3974
|
{
|
|
@@ -3924,7 +3980,7 @@ function sl({}) {
|
|
|
3924
3980
|
] })
|
|
3925
3981
|
] });
|
|
3926
3982
|
}
|
|
3927
|
-
const
|
|
3983
|
+
const nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3928
3984
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
|
|
3929
3985
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3930
3986
|
"See ",
|
|
@@ -3940,46 +3996,58 @@ const al = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
3940
3996
|
),
|
|
3941
3997
|
" in the docs."
|
|
3942
3998
|
] })
|
|
3999
|
+
] }), ll = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
4000
|
+
/* @__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" }),
|
|
4001
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
4002
|
+
"See ",
|
|
4003
|
+
/* @__PURE__ */ e.jsx(
|
|
4004
|
+
"a",
|
|
4005
|
+
{
|
|
4006
|
+
target: "_blank",
|
|
4007
|
+
onClick: (s) => s.stopPropagation(),
|
|
4008
|
+
className: "text-blue-700",
|
|
4009
|
+
href: "https://docs.semaphor.cloud/concepts/visuals#range-charts",
|
|
4010
|
+
children: "example"
|
|
4011
|
+
}
|
|
4012
|
+
),
|
|
4013
|
+
" in the docs."
|
|
4014
|
+
] })
|
|
3943
4015
|
] });
|
|
3944
|
-
function
|
|
4016
|
+
function rl() {
|
|
3945
4017
|
const s = r((a) => a.card.type);
|
|
3946
4018
|
function n(a) {
|
|
3947
4019
|
switch (a) {
|
|
3948
4020
|
case "stackedBar":
|
|
3949
|
-
return /* @__PURE__ */ e.jsx(
|
|
4021
|
+
return /* @__PURE__ */ e.jsx(al, {});
|
|
3950
4022
|
case "pyramid":
|
|
3951
|
-
return /* @__PURE__ */ e.jsx(
|
|
3952
|
-
Ks,
|
|
3953
|
-
{
|
|
3954
|
-
docContent: al,
|
|
3955
|
-
cardType: a
|
|
3956
|
-
}
|
|
3957
|
-
);
|
|
4023
|
+
return /* @__PURE__ */ e.jsx(os, { docContent: nl, cardType: a });
|
|
3958
4024
|
case "kpi":
|
|
3959
|
-
return /* @__PURE__ */ e.jsx(
|
|
4025
|
+
return /* @__PURE__ */ e.jsx(sl, {});
|
|
3960
4026
|
case "line":
|
|
3961
4027
|
case "bar":
|
|
3962
4028
|
return /* @__PURE__ */ e.jsx(Jn, { cardType: a });
|
|
4029
|
+
case "range":
|
|
4030
|
+
return /* @__PURE__ */ e.jsx(os, { docContent: ll, cardType: a });
|
|
3963
4031
|
case "pie":
|
|
3964
4032
|
case "doughnut":
|
|
3965
4033
|
case "polarArea":
|
|
3966
4034
|
case "radar":
|
|
3967
|
-
return /* @__PURE__ */ e.jsx(
|
|
4035
|
+
return /* @__PURE__ */ e.jsx(os, { cardType: a });
|
|
3968
4036
|
case "bubble":
|
|
3969
4037
|
case "scatter":
|
|
3970
|
-
return /* @__PURE__ */ e.jsx(
|
|
4038
|
+
return /* @__PURE__ */ e.jsx(Qn, { cardType: a });
|
|
3971
4039
|
case "table":
|
|
3972
|
-
return /* @__PURE__ */ e.jsx(
|
|
4040
|
+
return /* @__PURE__ */ e.jsx(tl, { cardType: a });
|
|
3973
4041
|
default:
|
|
3974
|
-
return /* @__PURE__ */ e.jsx(
|
|
4042
|
+
return /* @__PURE__ */ e.jsx(Xn, {});
|
|
3975
4043
|
}
|
|
3976
4044
|
}
|
|
3977
|
-
return /* @__PURE__ */ e.jsx(
|
|
4045
|
+
return /* @__PURE__ */ e.jsx(Cs, { className: "h-full w-full text-sm", children: n(s) });
|
|
3978
4046
|
}
|
|
3979
|
-
function
|
|
4047
|
+
function il() {
|
|
3980
4048
|
const s = r((n) => n.isShowingVisual);
|
|
3981
4049
|
return /* @__PURE__ */ e.jsxs(
|
|
3982
|
-
|
|
4050
|
+
ms,
|
|
3983
4051
|
{
|
|
3984
4052
|
direction: "vertical",
|
|
3985
4053
|
className: "min-w-full max-w-lg min-h-[250px]",
|
|
@@ -3991,10 +4059,10 @@ function nl() {
|
|
|
3991
4059
|
className: "flex",
|
|
3992
4060
|
minSize: 20,
|
|
3993
4061
|
defaultSize: 40,
|
|
3994
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4062
|
+
children: /* @__PURE__ */ e.jsx(Vn, {})
|
|
3995
4063
|
}
|
|
3996
4064
|
),
|
|
3997
|
-
/* @__PURE__ */ e.jsx(
|
|
4065
|
+
/* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border " }),
|
|
3998
4066
|
/* @__PURE__ */ e.jsx(
|
|
3999
4067
|
Fe,
|
|
4000
4068
|
{
|
|
@@ -4002,7 +4070,7 @@ function nl() {
|
|
|
4002
4070
|
role: "visual-section",
|
|
4003
4071
|
minSize: 0,
|
|
4004
4072
|
defaultSize: 60,
|
|
4005
|
-
children: s ? /* @__PURE__ */ e.jsxs(
|
|
4073
|
+
children: s ? /* @__PURE__ */ e.jsxs(ms, { direction: "horizontal", children: [
|
|
4006
4074
|
/* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
4007
4075
|
Fe,
|
|
4008
4076
|
{
|
|
@@ -4010,30 +4078,30 @@ function nl() {
|
|
|
4010
4078
|
minSize: 20,
|
|
4011
4079
|
defaultSize: 25,
|
|
4012
4080
|
maxSize: 30,
|
|
4013
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4081
|
+
children: /* @__PURE__ */ e.jsx(rl, {})
|
|
4014
4082
|
}
|
|
4015
4083
|
) }),
|
|
4016
|
-
/* @__PURE__ */ e.jsx(
|
|
4017
|
-
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(
|
|
4018
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
4084
|
+
/* @__PURE__ */ e.jsx(us, { className: "border " }),
|
|
4085
|
+
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx($s, {}) })
|
|
4086
|
+
] }) : /* @__PURE__ */ e.jsx($s, {})
|
|
4019
4087
|
}
|
|
4020
4088
|
)
|
|
4021
4089
|
]
|
|
4022
4090
|
}
|
|
4023
4091
|
);
|
|
4024
4092
|
}
|
|
4025
|
-
function
|
|
4093
|
+
function ol({ authToken: s, onSave: n, onClose: a }) {
|
|
4026
4094
|
const t = r((l) => l.actions.setOnSave), i = r((l) => l.actions.setOnClose), o = k((l) => l.actions.setAuthToken);
|
|
4027
4095
|
return K(() => {
|
|
4028
4096
|
n && t(n), a && i(a);
|
|
4029
4097
|
}, [n, t, a, i]), K(() => {
|
|
4030
4098
|
s && s.accessToken && o(s);
|
|
4031
|
-
}, [s, o]), /* @__PURE__ */ e.jsxs(
|
|
4032
|
-
/* @__PURE__ */ e.jsx(
|
|
4033
|
-
/* @__PURE__ */ e.jsx(
|
|
4099
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs(qt, { className: "rounded-none", role: "editor-panel", children: [
|
|
4100
|
+
/* @__PURE__ */ e.jsx(Vt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(pa, {}) }),
|
|
4101
|
+
/* @__PURE__ */ e.jsx(Rt, { children: /* @__PURE__ */ e.jsx(il, {}) })
|
|
4034
4102
|
] });
|
|
4035
4103
|
}
|
|
4036
|
-
function
|
|
4104
|
+
function cl() {
|
|
4037
4105
|
k((l) => l.selectedCardId);
|
|
4038
4106
|
const s = k((l) => l.selectedSheetId), { setIsVisualEditing: n } = k((l) => l.actions), a = k((l) => l.isVisualEditing), t = k((l) => l.actions.updateFrame);
|
|
4039
4107
|
function i(l) {
|
|
@@ -4046,37 +4114,37 @@ function rl() {
|
|
|
4046
4114
|
"div",
|
|
4047
4115
|
{
|
|
4048
4116
|
role: "editor-container",
|
|
4049
|
-
className:
|
|
4117
|
+
className: Y("flex grow", {
|
|
4050
4118
|
block: a,
|
|
4051
4119
|
hidden: !a
|
|
4052
4120
|
}),
|
|
4053
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4121
|
+
children: /* @__PURE__ */ e.jsx(ol, { onSave: i, onClose: o })
|
|
4054
4122
|
}
|
|
4055
4123
|
);
|
|
4056
4124
|
}
|
|
4057
|
-
function
|
|
4125
|
+
function dl({
|
|
4058
4126
|
columns: s,
|
|
4059
4127
|
tableName: n
|
|
4060
4128
|
}) {
|
|
4061
|
-
const a = r((u) => u.selectedConnectionId), t = r((u) => u.selectedDatabaseName), i = r((u) => u.selectedSchemaName), o = r((u) => u.selectedTableName), l = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter),
|
|
4129
|
+
const a = r((u) => u.selectedConnectionId), t = r((u) => u.selectedDatabaseName), i = r((u) => u.selectedSchemaName), o = r((u) => u.selectedTableName), l = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter), h = k((u) => u.actions.removeFilter), g = k(
|
|
4062
4130
|
(u) => u.actions.removeFilterValue
|
|
4063
4131
|
);
|
|
4064
4132
|
function m(u) {
|
|
4065
|
-
const
|
|
4133
|
+
const N = he(u.column_name), d = he(t || ""), x = he(i || ""), f = he(n), w = ds(
|
|
4066
4134
|
x,
|
|
4067
|
-
|
|
4068
|
-
), b = `${
|
|
4135
|
+
f
|
|
4136
|
+
), b = `${w}.${N}`;
|
|
4069
4137
|
console.log(
|
|
4070
4138
|
"find",
|
|
4071
4139
|
b,
|
|
4072
|
-
|
|
4073
|
-
|
|
4140
|
+
f,
|
|
4141
|
+
d
|
|
4074
4142
|
);
|
|
4075
4143
|
const L = l == null ? void 0 : l.find(
|
|
4076
|
-
(
|
|
4144
|
+
(C) => C.column === b && C.table === f && (C.database === d || C.database === t)
|
|
4077
4145
|
);
|
|
4078
4146
|
if (L)
|
|
4079
|
-
|
|
4147
|
+
g(L.id), h(L.id);
|
|
4080
4148
|
else {
|
|
4081
4149
|
if (n === "api" && a) {
|
|
4082
4150
|
c({
|
|
@@ -4089,10 +4157,10 @@ function il({
|
|
|
4089
4157
|
// database: 'NA',
|
|
4090
4158
|
connectionId: a,
|
|
4091
4159
|
operation: "in",
|
|
4092
|
-
sql:
|
|
4160
|
+
sql: _s(
|
|
4093
4161
|
u.data_type,
|
|
4094
|
-
|
|
4095
|
-
|
|
4162
|
+
w,
|
|
4163
|
+
N
|
|
4096
4164
|
)
|
|
4097
4165
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4098
4166
|
});
|
|
@@ -4100,38 +4168,38 @@ function il({
|
|
|
4100
4168
|
}
|
|
4101
4169
|
c({
|
|
4102
4170
|
id: We(),
|
|
4103
|
-
column: `${
|
|
4171
|
+
column: `${w}.${N}`,
|
|
4104
4172
|
title: u.column_name,
|
|
4105
4173
|
dataType: u.data_type,
|
|
4106
4174
|
table: o || "",
|
|
4107
4175
|
database: t || "",
|
|
4108
4176
|
connectionId: a || "",
|
|
4109
4177
|
operation: "in",
|
|
4110
|
-
sql:
|
|
4178
|
+
sql: _s(
|
|
4111
4179
|
u.data_type,
|
|
4112
|
-
|
|
4113
|
-
|
|
4180
|
+
w,
|
|
4181
|
+
N
|
|
4114
4182
|
)
|
|
4115
4183
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4116
4184
|
});
|
|
4117
4185
|
}
|
|
4118
4186
|
}
|
|
4119
4187
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: s == null ? void 0 : s.map((u) => {
|
|
4120
|
-
const
|
|
4121
|
-
(
|
|
4188
|
+
const N = l == null ? void 0 : l.find(
|
|
4189
|
+
(d) => d.column === he(u.column_name) && d.table === o && d.database === t
|
|
4122
4190
|
);
|
|
4123
4191
|
return /* @__PURE__ */ e.jsx(
|
|
4124
4192
|
"div",
|
|
4125
4193
|
{
|
|
4126
4194
|
onClick: () => m(u),
|
|
4127
|
-
className:
|
|
4195
|
+
className: Y(
|
|
4128
4196
|
"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",
|
|
4129
4197
|
{
|
|
4130
|
-
"bg-muted":
|
|
4198
|
+
"bg-muted": N
|
|
4131
4199
|
}
|
|
4132
4200
|
),
|
|
4133
4201
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4134
|
-
/* @__PURE__ */ e.jsx(
|
|
4202
|
+
/* @__PURE__ */ e.jsx(ua, { column: u }),
|
|
4135
4203
|
/* @__PURE__ */ e.jsx("span", { children: u.column_name })
|
|
4136
4204
|
] })
|
|
4137
4205
|
},
|
|
@@ -4139,7 +4207,7 @@ function il({
|
|
|
4139
4207
|
);
|
|
4140
4208
|
}) });
|
|
4141
4209
|
}
|
|
4142
|
-
function
|
|
4210
|
+
function hl() {
|
|
4143
4211
|
k((n) => n.showFilters);
|
|
4144
4212
|
const s = k(
|
|
4145
4213
|
(n) => n.actions.setShowFilters
|
|
@@ -4148,20 +4216,20 @@ function ol() {
|
|
|
4148
4216
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
4149
4217
|
/* @__PURE__ */ e.jsx(B, { className: "text-lg", children: "Filters" }),
|
|
4150
4218
|
/* @__PURE__ */ e.jsx(
|
|
4151
|
-
|
|
4219
|
+
z,
|
|
4152
4220
|
{
|
|
4153
4221
|
onClick: () => s(!1),
|
|
4154
4222
|
className: "h-7 w-7 p-0",
|
|
4155
4223
|
variant: "ghost",
|
|
4156
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4224
|
+
children: /* @__PURE__ */ e.jsx(_e, {})
|
|
4157
4225
|
}
|
|
4158
4226
|
)
|
|
4159
4227
|
] }),
|
|
4160
4228
|
/* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
|
|
4161
|
-
|
|
4229
|
+
pa,
|
|
4162
4230
|
{
|
|
4163
4231
|
ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
|
|
4164
|
-
|
|
4232
|
+
dl,
|
|
4165
4233
|
{
|
|
4166
4234
|
schemaName: n,
|
|
4167
4235
|
tableName: a,
|
|
@@ -4172,25 +4240,25 @@ function ol() {
|
|
|
4172
4240
|
) })
|
|
4173
4241
|
] });
|
|
4174
4242
|
}
|
|
4175
|
-
function
|
|
4243
|
+
function ml() {
|
|
4176
4244
|
k((a) => a.dashboard);
|
|
4177
4245
|
const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
|
|
4178
4246
|
return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
|
|
4179
4247
|
"div",
|
|
4180
4248
|
{
|
|
4181
4249
|
role: "dashboard-plus-main",
|
|
4182
|
-
className:
|
|
4250
|
+
className: Y("grow", {
|
|
4183
4251
|
hidden: n,
|
|
4184
4252
|
flex: !n
|
|
4185
4253
|
}),
|
|
4186
4254
|
children: [
|
|
4187
|
-
/* @__PURE__ */ e.jsx(
|
|
4188
|
-
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(
|
|
4255
|
+
/* @__PURE__ */ e.jsx(_t, {}),
|
|
4256
|
+
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hl, {}) })
|
|
4189
4257
|
]
|
|
4190
4258
|
}
|
|
4191
4259
|
);
|
|
4192
4260
|
}
|
|
4193
|
-
function
|
|
4261
|
+
function ul() {
|
|
4194
4262
|
const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
|
|
4195
4263
|
(t) => t.showDashboardJSON
|
|
4196
4264
|
);
|
|
@@ -4199,11 +4267,11 @@ function dl() {
|
|
|
4199
4267
|
), /* @__PURE__ */ e.jsx(
|
|
4200
4268
|
"div",
|
|
4201
4269
|
{
|
|
4202
|
-
className:
|
|
4270
|
+
className: Y(" p-2", {
|
|
4203
4271
|
hidden: !a
|
|
4204
4272
|
}),
|
|
4205
4273
|
children: /* @__PURE__ */ e.jsx(
|
|
4206
|
-
|
|
4274
|
+
Ht,
|
|
4207
4275
|
{
|
|
4208
4276
|
onChange: (t) => {
|
|
4209
4277
|
if (t)
|
|
@@ -4234,25 +4302,25 @@ function dl() {
|
|
|
4234
4302
|
}
|
|
4235
4303
|
);
|
|
4236
4304
|
}
|
|
4237
|
-
function
|
|
4305
|
+
function fl({
|
|
4238
4306
|
showControls: s = !1,
|
|
4239
4307
|
showFooter: n = !0,
|
|
4240
4308
|
...a
|
|
4241
4309
|
}) {
|
|
4242
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4243
|
-
/* @__PURE__ */ e.jsx(
|
|
4244
|
-
/* @__PURE__ */ e.jsxs(
|
|
4245
|
-
/* @__PURE__ */ e.jsx(
|
|
4246
|
-
/* @__PURE__ */ e.jsxs(
|
|
4247
|
-
s && /* @__PURE__ */ e.jsx(
|
|
4248
|
-
/* @__PURE__ */ e.jsx(
|
|
4249
|
-
/* @__PURE__ */ e.jsx(
|
|
4310
|
+
return /* @__PURE__ */ e.jsxs(Bt, { dashboardProps: a, children: [
|
|
4311
|
+
/* @__PURE__ */ e.jsx($t, {}),
|
|
4312
|
+
/* @__PURE__ */ e.jsxs(Kt, { children: [
|
|
4313
|
+
/* @__PURE__ */ e.jsx(ul, {}),
|
|
4314
|
+
/* @__PURE__ */ e.jsxs(Pt, { ...a, children: [
|
|
4315
|
+
s && /* @__PURE__ */ e.jsx(vn, {}),
|
|
4316
|
+
/* @__PURE__ */ e.jsx(cl, {}),
|
|
4317
|
+
/* @__PURE__ */ e.jsx(ml, {})
|
|
4250
4318
|
] })
|
|
4251
4319
|
] })
|
|
4252
4320
|
] });
|
|
4253
4321
|
}
|
|
4254
4322
|
export {
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4323
|
+
fl as D,
|
|
4324
|
+
Qe as S,
|
|
4325
|
+
xa as u
|
|
4258
4326
|
};
|