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