react-semaphor 0.0.332 → 0.0.334
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/index-B4Wv7Ers.js +402 -0
- package/dist/chunks/{index-HSAFthpc.js → index-BbJlIYmF.js} +16383 -18522
- package/dist/chunks/{index-BGmqxQsB.js → index-CUL2cB6L.js} +940 -963
- package/dist/chunks/index-CW8qF0bl.js +235 -0
- package/dist/chunks/{lucide-react-Dwcz19Mq.js → lucide-react-BHyS8rYq.js} +924 -929
- package/dist/chunks/{lucide-react-DWPc-x9m.js → lucide-react-DN-djCId.js} +2586 -2596
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +25 -22
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +38 -2
- package/package.json +1 -1
- package/dist/chunks/B4MFY5CR-D6VLDens.js +0 -1200
- package/dist/chunks/B4MFY5CR-DSyPShbg.js +0 -9104
- package/dist/chunks/HO4MOOFI-PCPf0V7Q.js +0 -33
- package/dist/chunks/HO4MOOFI-XrF2yHxb.js +0 -1
- package/dist/chunks/HUY7CZI3-BZLAkw5U.js +0 -1
- package/dist/chunks/HUY7CZI3-DT2fc5Um.js +0 -42
- package/dist/chunks/index-B0j1CW59.js +0 -392
- package/dist/chunks/index-BrrtYt6g.js +0 -240
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as R, t as Is, u as I, v as xs, w as Oe, x as e, y as Ds, z as Fs, A as z, n as Ts, E as Ls, H as Ms, J as Es, K as As, M as _, N as re, O as la, Q as ra, R as ia, V as oa, W as st, Y as at, Z as tt, _ as Ks, $ as K, a0 as Je, i as nt, a1 as m, a2 as lt, P as ca, F as da, a3 as Ke, a4 as We, a5 as ua, a6 as rt, a7 as ma, a8 as me, a9 as he, aa as xe, ab as pe, ac as Se, ad as fe, ae as Y, T as Vs, af as qs, ag as Rs, ah as _s, ai as ha, aj as xa, ak as de, al as it, am as ot, an as pa, ao as ct, C as dt, ap as ut, aq as fa, B as mt, ar as ze, as as ht, at as Ye, au as ga, av as Ss, aw as Ce, ax as Fe, ay as we, az as ja, aA as xt, aB as pt, aC as ft, aD as gt, k as jt, aE as bt, aF as yt, aG as vt, aH as Re, aI as ws, aJ as Ct, a as Nt, aK as Ge, aL as cs, aM as Ne, aN as ds, aO as St, aP as wt, aQ as kt, aR as zt, aS as Ot, aT as Ns, aU as It, aV as Ws, aW as Dt, aX as Ys, aY as Ft, aZ as Tt, a_ as Lt, a$ as Mt, b0 as ba, b1 as ie, b2 as Et, b3 as Hs, b4 as ya, b5 as At, b6 as Vt, b7 as rs, b8 as qt, b9 as Rt, ba as _t, bb as Ht, r as $t, bc as Pt, bd as Bt, q as Ut, be as ps, bf as va, bg as Ca, bh as Na, bi as is, bj as Sa, bk as os, bl as Xs, bm as Gt, bn as Qt, bo as fs, bp as gs, bq as js, br as Jt, I as Kt, X as wa, bs as Wt, bt as Yt, bu as Xt, bv as bs, bw as Te, f as Zt, bx as Ue, by as $s, bz as ka, bA as en, bB as sn, bC as us, bD as an, bE as tn, bF as nn, bG as Zs, bH as ln, bI as rn, bJ as on, bK as cn, bL as dn, bM as un, bN as mn, bO as hn, bP as Le, bQ as G, bR as Q, bS as Ps, bT as J, bU as xn, bV as za, bW as pn, bX as fn, bY as gn, bZ as jn, b_ as bn, b$ as yn, c0 as vn, c1 as Cn, c2 as Nn } from "./index-BbJlIYmF.js";
|
|
2
2
|
import * as ea from "react";
|
|
3
|
-
import ke, { useState as V, useMemo as
|
|
3
|
+
import ke, { useState as V, useMemo as ks, useEffect as se, useRef as zs, useCallback as Sn, Suspense as wn } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -8,7 +8,7 @@ import "react-dom";
|
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const kn = R("Box", [
|
|
12
12
|
[
|
|
13
13
|
"path",
|
|
14
14
|
{
|
|
@@ -25,7 +25,7 @@ const wn = q("Box", [
|
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const zn = R("ChartArea", [
|
|
29
29
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
30
30
|
[
|
|
31
31
|
"path",
|
|
@@ -41,7 +41,7 @@ const kn = q("ChartArea", [
|
|
|
41
41
|
* This source code is licensed under the ISC license.
|
|
42
42
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
const Bs =
|
|
44
|
+
const Bs = R("ChartColumnIncreasing", [
|
|
45
45
|
["path", { d: "M13 17V9", key: "1fwyjl" }],
|
|
46
46
|
["path", { d: "M18 17V5", key: "sfb6ij" }],
|
|
47
47
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
@@ -53,7 +53,7 @@ const Bs = q("ChartColumnIncreasing", [
|
|
|
53
53
|
* This source code is licensed under the ISC license.
|
|
54
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
55
|
*/
|
|
56
|
-
const Us =
|
|
56
|
+
const Us = R("ChartLine", [
|
|
57
57
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
58
58
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
59
59
|
]);
|
|
@@ -63,7 +63,7 @@ const Us = q("ChartLine", [
|
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
64
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
65
|
*/
|
|
66
|
-
const Oa =
|
|
66
|
+
const Oa = R("ChartNoAxesGantt", [
|
|
67
67
|
["path", { d: "M8 6h10", key: "9lnwnk" }],
|
|
68
68
|
["path", { d: "M6 12h9", key: "1g9pqf" }],
|
|
69
69
|
["path", { d: "M11 18h7", key: "c8dzvl" }]
|
|
@@ -74,7 +74,7 @@ const Oa = q("ChartNoAxesGantt", [
|
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
76
|
*/
|
|
77
|
-
const Ia =
|
|
77
|
+
const Ia = R("ChartPie", [
|
|
78
78
|
[
|
|
79
79
|
"path",
|
|
80
80
|
{
|
|
@@ -90,7 +90,7 @@ const Ia = q("ChartPie", [
|
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
92
|
*/
|
|
93
|
-
const
|
|
93
|
+
const Da = R("ChartScatter", [
|
|
94
94
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
|
|
95
95
|
["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
|
|
96
96
|
["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
|
|
@@ -104,7 +104,7 @@ const Fa = q("ChartScatter", [
|
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
106
|
*/
|
|
107
|
-
const
|
|
107
|
+
const On = R("CircleX", [
|
|
108
108
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
109
109
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
110
110
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -115,7 +115,7 @@ const zn = q("CircleX", [
|
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
const
|
|
118
|
+
const In = R("CopyPlus", [
|
|
119
119
|
["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
|
|
120
120
|
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
|
|
121
121
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
@@ -127,7 +127,7 @@ const On = q("CopyPlus", [
|
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
129
|
*/
|
|
130
|
-
const
|
|
130
|
+
const Dn = R("Database", [
|
|
131
131
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
132
132
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
133
133
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -138,7 +138,7 @@ const In = q("Database", [
|
|
|
138
138
|
* This source code is licensed under the ISC license.
|
|
139
139
|
* See the LICENSE file in the root directory of this source tree.
|
|
140
140
|
*/
|
|
141
|
-
const
|
|
141
|
+
const Fa = R("EllipsisVertical", [
|
|
142
142
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
143
143
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
144
144
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
@@ -149,7 +149,7 @@ const Da = q("EllipsisVertical", [
|
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
151
|
*/
|
|
152
|
-
const Fn =
|
|
152
|
+
const Fn = R("Eraser", [
|
|
153
153
|
[
|
|
154
154
|
"path",
|
|
155
155
|
{
|
|
@@ -166,7 +166,7 @@ const Fn = q("Eraser", [
|
|
|
166
166
|
* This source code is licensed under the ISC license.
|
|
167
167
|
* See the LICENSE file in the root directory of this source tree.
|
|
168
168
|
*/
|
|
169
|
-
const
|
|
169
|
+
const Tn = R("EyeClosed", [
|
|
170
170
|
["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
|
|
171
171
|
["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
|
|
172
172
|
["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
|
|
@@ -179,7 +179,7 @@ const Dn = q("EyeClosed", [
|
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
181
|
*/
|
|
182
|
-
const Ln =
|
|
182
|
+
const Ln = R("Eye", [
|
|
183
183
|
[
|
|
184
184
|
"path",
|
|
185
185
|
{
|
|
@@ -195,7 +195,7 @@ const Ln = q("Eye", [
|
|
|
195
195
|
* This source code is licensed under the ISC license.
|
|
196
196
|
* See the LICENSE file in the root directory of this source tree.
|
|
197
197
|
*/
|
|
198
|
-
const Mn =
|
|
198
|
+
const Mn = R("Glasses", [
|
|
199
199
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
200
200
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
201
201
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -208,7 +208,7 @@ const Mn = q("Glasses", [
|
|
|
208
208
|
* This source code is licensed under the ISC license.
|
|
209
209
|
* See the LICENSE file in the root directory of this source tree.
|
|
210
210
|
*/
|
|
211
|
-
const
|
|
211
|
+
const En = R("Hammer", [
|
|
212
212
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
213
213
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
214
214
|
[
|
|
@@ -225,7 +225,7 @@ const Tn = q("Hammer", [
|
|
|
225
225
|
* This source code is licensed under the ISC license.
|
|
226
226
|
* See the LICENSE file in the root directory of this source tree.
|
|
227
227
|
*/
|
|
228
|
-
const
|
|
228
|
+
const An = R("Hash", [
|
|
229
229
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
230
230
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
231
231
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -237,7 +237,7 @@ const En = q("Hash", [
|
|
|
237
237
|
* This source code is licensed under the ISC license.
|
|
238
238
|
* See the LICENSE file in the root directory of this source tree.
|
|
239
239
|
*/
|
|
240
|
-
const
|
|
240
|
+
const Vn = R("House", [
|
|
241
241
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
242
242
|
[
|
|
243
243
|
"path",
|
|
@@ -253,20 +253,7 @@ const An = q("House", [
|
|
|
253
253
|
* This source code is licensed under the ISC license.
|
|
254
254
|
* See the LICENSE file in the root directory of this source tree.
|
|
255
255
|
*/
|
|
256
|
-
const
|
|
257
|
-
["path", { d: "M16 10h2", key: "8sgtl7" }],
|
|
258
|
-
["path", { d: "M16 14h2", key: "epxaof" }],
|
|
259
|
-
["path", { d: "M6.17 15a3 3 0 0 1 5.66 0", key: "n6f512" }],
|
|
260
|
-
["circle", { cx: "9", cy: "11", r: "2", key: "yxgjnd" }],
|
|
261
|
-
["rect", { x: "2", y: "5", width: "20", height: "14", rx: "2", key: "qneu4z" }]
|
|
262
|
-
]);
|
|
263
|
-
/**
|
|
264
|
-
* @license lucide-react v0.453.0 - ISC
|
|
265
|
-
*
|
|
266
|
-
* This source code is licensed under the ISC license.
|
|
267
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
-
*/
|
|
269
|
-
const qn = q("ListEnd", [
|
|
256
|
+
const qn = R("ListEnd", [
|
|
270
257
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
271
258
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
272
259
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -279,7 +266,7 @@ const qn = q("ListEnd", [
|
|
|
279
266
|
* This source code is licensed under the ISC license.
|
|
280
267
|
* See the LICENSE file in the root directory of this source tree.
|
|
281
268
|
*/
|
|
282
|
-
const Rn =
|
|
269
|
+
const Rn = R("ListStart", [
|
|
283
270
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
284
271
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
285
272
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -292,7 +279,7 @@ const Rn = q("ListStart", [
|
|
|
292
279
|
* This source code is licensed under the ISC license.
|
|
293
280
|
* See the LICENSE file in the root directory of this source tree.
|
|
294
281
|
*/
|
|
295
|
-
const _n =
|
|
282
|
+
const _n = R("ListX", [
|
|
296
283
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
297
284
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
298
285
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -305,7 +292,7 @@ const _n = q("ListX", [
|
|
|
305
292
|
* This source code is licensed under the ISC license.
|
|
306
293
|
* See the LICENSE file in the root directory of this source tree.
|
|
307
294
|
*/
|
|
308
|
-
const qe =
|
|
295
|
+
const qe = R("LoaderCircle", [
|
|
309
296
|
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
310
297
|
]);
|
|
311
298
|
/**
|
|
@@ -314,7 +301,7 @@ const qe = q("LoaderCircle", [
|
|
|
314
301
|
* This source code is licensed under the ISC license.
|
|
315
302
|
* See the LICENSE file in the root directory of this source tree.
|
|
316
303
|
*/
|
|
317
|
-
const
|
|
304
|
+
const Ta = R("Map", [
|
|
318
305
|
[
|
|
319
306
|
"path",
|
|
320
307
|
{
|
|
@@ -331,7 +318,7 @@ const La = q("Map", [
|
|
|
331
318
|
* This source code is licensed under the ISC license.
|
|
332
319
|
* See the LICENSE file in the root directory of this source tree.
|
|
333
320
|
*/
|
|
334
|
-
const Hn =
|
|
321
|
+
const Hn = R("MessageSquareMore", [
|
|
335
322
|
["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }],
|
|
336
323
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
337
324
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -343,7 +330,7 @@ const Hn = q("MessageSquareMore", [
|
|
|
343
330
|
* This source code is licensed under the ISC license.
|
|
344
331
|
* See the LICENSE file in the root directory of this source tree.
|
|
345
332
|
*/
|
|
346
|
-
const $n =
|
|
333
|
+
const $n = R("Network", [
|
|
347
334
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
348
335
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
349
336
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -356,7 +343,7 @@ const $n = q("Network", [
|
|
|
356
343
|
* This source code is licensed under the ISC license.
|
|
357
344
|
* See the LICENSE file in the root directory of this source tree.
|
|
358
345
|
*/
|
|
359
|
-
const Pn =
|
|
346
|
+
const Pn = R("Play", [
|
|
360
347
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
361
348
|
]);
|
|
362
349
|
/**
|
|
@@ -365,7 +352,7 @@ const Pn = q("Play", [
|
|
|
365
352
|
* This source code is licensed under the ISC license.
|
|
366
353
|
* See the LICENSE file in the root directory of this source tree.
|
|
367
354
|
*/
|
|
368
|
-
const Bn =
|
|
355
|
+
const Bn = R("Plug2", [
|
|
369
356
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
370
357
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
371
358
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -378,7 +365,7 @@ const Bn = q("Plug2", [
|
|
|
378
365
|
* This source code is licensed under the ISC license.
|
|
379
366
|
* See the LICENSE file in the root directory of this source tree.
|
|
380
367
|
*/
|
|
381
|
-
const Un =
|
|
368
|
+
const Un = R("Save", [
|
|
382
369
|
[
|
|
383
370
|
"path",
|
|
384
371
|
{
|
|
@@ -395,7 +382,7 @@ const Un = q("Save", [
|
|
|
395
382
|
* This source code is licensed under the ISC license.
|
|
396
383
|
* See the LICENSE file in the root directory of this source tree.
|
|
397
384
|
*/
|
|
398
|
-
const
|
|
385
|
+
const La = R("Shapes", [
|
|
399
386
|
[
|
|
400
387
|
"path",
|
|
401
388
|
{
|
|
@@ -412,7 +399,7 @@ const Ma = q("Shapes", [
|
|
|
412
399
|
* This source code is licensed under the ISC license.
|
|
413
400
|
* See the LICENSE file in the root directory of this source tree.
|
|
414
401
|
*/
|
|
415
|
-
const Gn =
|
|
402
|
+
const Gn = R("ShieldQuestion", [
|
|
416
403
|
[
|
|
417
404
|
"path",
|
|
418
405
|
{
|
|
@@ -429,7 +416,7 @@ const Gn = q("ShieldQuestion", [
|
|
|
429
416
|
* This source code is licensed under the ISC license.
|
|
430
417
|
* See the LICENSE file in the root directory of this source tree.
|
|
431
418
|
*/
|
|
432
|
-
const Qn =
|
|
419
|
+
const Qn = R("Sigma", [
|
|
433
420
|
[
|
|
434
421
|
"path",
|
|
435
422
|
{
|
|
@@ -444,7 +431,7 @@ const Qn = q("Sigma", [
|
|
|
444
431
|
* This source code is licensed under the ISC license.
|
|
445
432
|
* See the LICENSE file in the root directory of this source tree.
|
|
446
433
|
*/
|
|
447
|
-
const Jn =
|
|
434
|
+
const Jn = R("SwatchBook", [
|
|
448
435
|
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
449
436
|
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
450
437
|
["path", { d: "M 7 17h.01", key: "1euzgo" }],
|
|
@@ -462,7 +449,7 @@ const Jn = q("SwatchBook", [
|
|
|
462
449
|
* This source code is licensed under the ISC license.
|
|
463
450
|
* See the LICENSE file in the root directory of this source tree.
|
|
464
451
|
*/
|
|
465
|
-
const Kn =
|
|
452
|
+
const Kn = R("Tag", [
|
|
466
453
|
[
|
|
467
454
|
"path",
|
|
468
455
|
{
|
|
@@ -478,7 +465,7 @@ const Kn = q("Tag", [
|
|
|
478
465
|
* This source code is licensed under the ISC license.
|
|
479
466
|
* See the LICENSE file in the root directory of this source tree.
|
|
480
467
|
*/
|
|
481
|
-
const Wn =
|
|
468
|
+
const Wn = R("ToggleLeft", [
|
|
482
469
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
483
470
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
484
471
|
]);
|
|
@@ -488,7 +475,7 @@ const Wn = q("ToggleLeft", [
|
|
|
488
475
|
* This source code is licensed under the ISC license.
|
|
489
476
|
* See the LICENSE file in the root directory of this source tree.
|
|
490
477
|
*/
|
|
491
|
-
const Gs =
|
|
478
|
+
const Gs = R("Type", [
|
|
492
479
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
493
480
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
494
481
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -499,11 +486,11 @@ const Gs = q("Type", [
|
|
|
499
486
|
* This source code is licensed under the ISC license.
|
|
500
487
|
* See the LICENSE file in the root directory of this source tree.
|
|
501
488
|
*/
|
|
502
|
-
const Yn =
|
|
489
|
+
const Yn = R("User", [
|
|
503
490
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
504
491
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
505
492
|
]);
|
|
506
|
-
function
|
|
493
|
+
function Ma(s) {
|
|
507
494
|
var t;
|
|
508
495
|
return {
|
|
509
496
|
...s,
|
|
@@ -512,10 +499,10 @@ function Ta(s) {
|
|
|
512
499
|
return {
|
|
513
500
|
...a,
|
|
514
501
|
frames: (n = a.frames) == null ? void 0 : n.map((l) => {
|
|
515
|
-
var
|
|
502
|
+
var r;
|
|
516
503
|
return {
|
|
517
504
|
...l,
|
|
518
|
-
cards: (
|
|
505
|
+
cards: (r = l.cards) == null ? void 0 : r.map((u) => Xn(u))
|
|
519
506
|
};
|
|
520
507
|
})
|
|
521
508
|
};
|
|
@@ -531,8 +518,8 @@ function Xn(s) {
|
|
|
531
518
|
data: {
|
|
532
519
|
...(t = s.cfg) == null ? void 0 : t.data,
|
|
533
520
|
labels: [],
|
|
534
|
-
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((
|
|
535
|
-
...
|
|
521
|
+
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((r) => ({
|
|
522
|
+
...r,
|
|
536
523
|
data: []
|
|
537
524
|
}))
|
|
538
525
|
}
|
|
@@ -560,61 +547,61 @@ async function el(s, t, a, n) {
|
|
|
560
547
|
if (!n)
|
|
561
548
|
return null;
|
|
562
549
|
const l = JSON.stringify(t);
|
|
563
|
-
return await
|
|
550
|
+
return await Is("https://semaphor.cloud/api/v1/lens", n, {
|
|
564
551
|
name: s,
|
|
565
552
|
template: l,
|
|
566
553
|
filterValues: a,
|
|
567
554
|
operation: "create"
|
|
568
555
|
});
|
|
569
556
|
}
|
|
570
|
-
async function
|
|
557
|
+
async function Os(s, t) {
|
|
571
558
|
if (!t)
|
|
572
559
|
return null;
|
|
573
|
-
const { id: a, template: n, filterValues: l, isDefault:
|
|
574
|
-
return await
|
|
560
|
+
const { id: a, template: n, filterValues: l, isDefault: r, shared: u } = s;
|
|
561
|
+
return await Is("https://semaphor.cloud/api/v1/lens", t, {
|
|
575
562
|
lensId: a,
|
|
576
563
|
template: n,
|
|
577
564
|
filterValues: l,
|
|
578
|
-
isDefault:
|
|
579
|
-
shared:
|
|
565
|
+
isDefault: r,
|
|
566
|
+
shared: u,
|
|
580
567
|
operation: "update"
|
|
581
568
|
});
|
|
582
569
|
}
|
|
583
570
|
async function sl(s, t) {
|
|
584
|
-
return t ? await
|
|
571
|
+
return t ? await Is("https://semaphor.cloud/api/v1/lens", t, {
|
|
585
572
|
operation: "delete",
|
|
586
573
|
lensId: s
|
|
587
574
|
}) : null;
|
|
588
575
|
}
|
|
589
576
|
function al() {
|
|
590
|
-
const [s, t] = V(""), [a, n] = V(!1), l =
|
|
591
|
-
async function
|
|
577
|
+
const [s, t] = V(""), [a, n] = V(!1), l = I((C) => C.lenses), { setLenses: r, setSelectedLensId: u } = xs(), [o, c] = V(!1), [p, d] = V(!1), b = I((C) => C.dashboard), j = I((C) => C.filterValues), { authToken: h } = Oe();
|
|
578
|
+
async function g() {
|
|
592
579
|
c(!0);
|
|
593
|
-
const C =
|
|
580
|
+
const C = Ma(
|
|
594
581
|
b
|
|
595
|
-
),
|
|
582
|
+
), O = await el(
|
|
596
583
|
s,
|
|
597
584
|
C,
|
|
598
|
-
|
|
585
|
+
j,
|
|
599
586
|
h == null ? void 0 : h.accessToken
|
|
600
587
|
);
|
|
601
|
-
|
|
588
|
+
O && (r([...l || [], O]), u(O.id), d(!1)), c(!1);
|
|
602
589
|
}
|
|
603
|
-
return /* @__PURE__ */ e.jsxs(
|
|
604
|
-
/* @__PURE__ */ e.jsx(
|
|
605
|
-
|
|
590
|
+
return /* @__PURE__ */ e.jsxs(Ds, { open: p, onOpenChange: d, children: [
|
|
591
|
+
/* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
592
|
+
z,
|
|
606
593
|
{
|
|
607
594
|
variant: "secondary",
|
|
608
595
|
className: "h-7 p-2",
|
|
609
596
|
size: "sm",
|
|
610
597
|
children: [
|
|
611
|
-
/* @__PURE__ */ e.jsx(
|
|
598
|
+
/* @__PURE__ */ e.jsx(Ts, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
612
599
|
"Lens"
|
|
613
600
|
]
|
|
614
601
|
}
|
|
615
602
|
) }),
|
|
616
|
-
/* @__PURE__ */ e.jsxs(
|
|
617
|
-
/* @__PURE__ */ e.jsxs(
|
|
603
|
+
/* @__PURE__ */ e.jsxs(Ls, { className: "sm:max-w-[425px]", children: [
|
|
604
|
+
/* @__PURE__ */ e.jsxs(Ms, { children: [
|
|
618
605
|
/* @__PURE__ */ e.jsx(Es, { children: "Create Lens" }),
|
|
619
606
|
/* @__PURE__ */ e.jsx(As, { children: "Lenses are private by default and are only visible to you." })
|
|
620
607
|
] }),
|
|
@@ -634,12 +621,12 @@ function al() {
|
|
|
634
621
|
] }) }),
|
|
635
622
|
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
636
623
|
/* @__PURE__ */ e.jsx(la, { children: /* @__PURE__ */ e.jsx(
|
|
637
|
-
|
|
624
|
+
z,
|
|
638
625
|
{
|
|
639
626
|
size: "sm",
|
|
640
627
|
variant: "outline",
|
|
641
628
|
type: "submit",
|
|
642
|
-
onClick:
|
|
629
|
+
onClick: g,
|
|
643
630
|
disabled: o,
|
|
644
631
|
children: o ? "Creating..." : "Add"
|
|
645
632
|
}
|
|
@@ -648,41 +635,41 @@ function al() {
|
|
|
648
635
|
] });
|
|
649
636
|
}
|
|
650
637
|
function tl() {
|
|
651
|
-
const [s, t] = V(!1), a =
|
|
652
|
-
async function o(
|
|
653
|
-
d
|
|
638
|
+
const [s, t] = V(!1), a = I((d) => d.lenses), n = I((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: r } = xs(), { authToken: u } = Oe();
|
|
639
|
+
async function o(d) {
|
|
640
|
+
r(d);
|
|
654
641
|
}
|
|
655
|
-
async function c(
|
|
656
|
-
if (await sl(
|
|
657
|
-
const
|
|
658
|
-
l(
|
|
642
|
+
async function c(d) {
|
|
643
|
+
if (await sl(d, u == null ? void 0 : u.accessToken)) {
|
|
644
|
+
const j = a == null ? void 0 : a.filter((h) => h.id !== d);
|
|
645
|
+
l(j || []), r("original");
|
|
659
646
|
}
|
|
660
647
|
}
|
|
661
|
-
async function p(
|
|
662
|
-
const b = a == null ? void 0 : a.map((
|
|
663
|
-
...
|
|
664
|
-
isDefault: !
|
|
648
|
+
async function p(d) {
|
|
649
|
+
const b = a == null ? void 0 : a.map((g) => g.id === d.id ? {
|
|
650
|
+
...g,
|
|
651
|
+
isDefault: !d.isDefault
|
|
665
652
|
} : {
|
|
666
|
-
...
|
|
653
|
+
...g,
|
|
667
654
|
isDefault: !1
|
|
668
655
|
});
|
|
669
656
|
l(b || []);
|
|
670
|
-
const
|
|
671
|
-
...
|
|
672
|
-
isDefault: !
|
|
657
|
+
const j = {
|
|
658
|
+
...d,
|
|
659
|
+
isDefault: !d.isDefault
|
|
673
660
|
};
|
|
674
|
-
await
|
|
675
|
-
const h = a == null ? void 0 : a.find((
|
|
676
|
-
if (h && h.id !==
|
|
677
|
-
const
|
|
661
|
+
await Os(j, u == null ? void 0 : u.accessToken);
|
|
662
|
+
const h = a == null ? void 0 : a.find((g) => g.isDefault);
|
|
663
|
+
if (h && h.id !== d.id) {
|
|
664
|
+
const g = {
|
|
678
665
|
...h,
|
|
679
666
|
isDefault: !1
|
|
680
667
|
};
|
|
681
|
-
await
|
|
668
|
+
await Os(g, u == null ? void 0 : u.accessToken);
|
|
682
669
|
}
|
|
683
670
|
}
|
|
684
671
|
return /* @__PURE__ */ e.jsxs(ra, { open: s, onOpenChange: t, children: [
|
|
685
|
-
/* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
672
|
+
/* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Mn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
686
673
|
/* @__PURE__ */ e.jsxs(oa, { align: "end", className: "w-60", children: [
|
|
687
674
|
/* @__PURE__ */ e.jsx(st, { className: "px-3", children: "Lenses" }),
|
|
688
675
|
/* @__PURE__ */ e.jsx(at, {}),
|
|
@@ -693,25 +680,25 @@ function tl() {
|
|
|
693
680
|
onValueChange: o,
|
|
694
681
|
children: [
|
|
695
682
|
/* @__PURE__ */ e.jsx(Ks, { value: "original", children: "Original" }),
|
|
696
|
-
a == null ? void 0 : a.map((
|
|
683
|
+
a == null ? void 0 : a.map((d) => /* @__PURE__ */ e.jsxs(
|
|
697
684
|
Ks,
|
|
698
685
|
{
|
|
699
686
|
className: "group flex justify-between gap-2",
|
|
700
|
-
value:
|
|
687
|
+
value: d.id,
|
|
701
688
|
children: [
|
|
702
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
689
|
+
/* @__PURE__ */ e.jsx("p", { children: d.name }),
|
|
703
690
|
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
|
|
704
691
|
/* @__PURE__ */ e.jsx(
|
|
705
|
-
|
|
692
|
+
Vn,
|
|
706
693
|
{
|
|
707
694
|
onClick: (b) => {
|
|
708
|
-
b.preventDefault(), p(
|
|
695
|
+
b.preventDefault(), p(d);
|
|
709
696
|
},
|
|
710
697
|
className: K(
|
|
711
698
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
712
699
|
{
|
|
713
|
-
invisible: !
|
|
714
|
-
"text-green-500":
|
|
700
|
+
invisible: !d.isDefault,
|
|
701
|
+
"text-green-500": d.isDefault
|
|
715
702
|
}
|
|
716
703
|
),
|
|
717
704
|
strokeWidth: 1.5
|
|
@@ -721,7 +708,7 @@ function tl() {
|
|
|
721
708
|
Je,
|
|
722
709
|
{
|
|
723
710
|
onClick: (b) => {
|
|
724
|
-
b.preventDefault(), c(
|
|
711
|
+
b.preventDefault(), c(d.id);
|
|
725
712
|
},
|
|
726
713
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
727
714
|
strokeWidth: 1.5
|
|
@@ -730,7 +717,7 @@ function tl() {
|
|
|
730
717
|
] })
|
|
731
718
|
]
|
|
732
719
|
},
|
|
733
|
-
|
|
720
|
+
d.id
|
|
734
721
|
))
|
|
735
722
|
]
|
|
736
723
|
}
|
|
@@ -741,28 +728,28 @@ function tl() {
|
|
|
741
728
|
function nl({
|
|
742
729
|
iconClassName: s
|
|
743
730
|
}) {
|
|
744
|
-
const [t, a] = V(!1), { authToken: n } = Oe(), l =
|
|
745
|
-
async function
|
|
731
|
+
const [t, a] = V(!1), { authToken: n } = Oe(), l = I((o) => o.theme), r = I((o) => o.filterValues);
|
|
732
|
+
async function u() {
|
|
746
733
|
{
|
|
747
734
|
a(!0);
|
|
748
735
|
const o = new URLSearchParams();
|
|
749
|
-
o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(
|
|
750
|
-
const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`,
|
|
736
|
+
o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(r));
|
|
737
|
+
const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, d = await (await fetch(c, {
|
|
751
738
|
method: "GET",
|
|
752
739
|
headers: {
|
|
753
740
|
Authorization: `Bearer ${n == null ? void 0 : n.accessToken}`
|
|
754
741
|
}
|
|
755
|
-
})).blob(), b = URL.createObjectURL(
|
|
742
|
+
})).blob(), b = URL.createObjectURL(d);
|
|
756
743
|
window.open(b, "_blank"), a(!1);
|
|
757
744
|
}
|
|
758
745
|
}
|
|
759
746
|
return /* @__PURE__ */ e.jsx(
|
|
760
|
-
|
|
747
|
+
z,
|
|
761
748
|
{
|
|
762
749
|
variant: "link",
|
|
763
750
|
className: "group h-7 p-2",
|
|
764
751
|
size: "sm",
|
|
765
|
-
onClick:
|
|
752
|
+
onClick: u,
|
|
766
753
|
children: t ? /* @__PURE__ */ e.jsx(qe, { className: K("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
|
|
767
754
|
nt,
|
|
768
755
|
{
|
|
@@ -776,28 +763,28 @@ function nl({
|
|
|
776
763
|
function ll() {
|
|
777
764
|
V(!1);
|
|
778
765
|
const { authToken: s } = Oe();
|
|
779
|
-
|
|
780
|
-
const t =
|
|
781
|
-
|
|
782
|
-
const
|
|
766
|
+
I((f) => f.theme);
|
|
767
|
+
const t = I((f) => f.lenses), a = I((f) => f.selectedLensId), n = t == null ? void 0 : t.find((f) => f.id === a), l = I((f) => f.dashboard);
|
|
768
|
+
I((f) => f.selectedSheetId);
|
|
769
|
+
const r = I(
|
|
783
770
|
(f) => f.isDashboardEditing
|
|
784
|
-
),
|
|
771
|
+
), u = m(
|
|
785
772
|
(f) => f.selectedConnectionId
|
|
786
|
-
), [o, c] = V(!1), p =
|
|
787
|
-
|
|
773
|
+
), [o, c] = V(!1), p = I((f) => f.filterValues), d = I((f) => f.isVisualEditing), b = I((f) => f.showFilters);
|
|
774
|
+
I(
|
|
788
775
|
(f) => f.showDashboardJSON
|
|
789
776
|
);
|
|
790
|
-
const
|
|
777
|
+
const j = I((f) => f.onSaveFunction), h = I(
|
|
791
778
|
(f) => f.actions.setShowFilters
|
|
792
|
-
), { addFrame:
|
|
779
|
+
), { addFrame: g, setSelectedFrameId: C } = I(
|
|
793
780
|
(f) => f.actions
|
|
794
|
-
), { getSelectedSheet:
|
|
781
|
+
), { getSelectedSheet: O, setIsDashboardEditing: y, setShowDashboardJSON: L } = I((f) => f.actions), D = O(), { tenantId: A, endUserId: N } = ks(
|
|
795
782
|
() => lt(s == null ? void 0 : s.accessToken),
|
|
796
783
|
[s == null ? void 0 : s.accessToken]
|
|
797
|
-
),
|
|
798
|
-
if (!
|
|
784
|
+
), F = ks(() => A || N, [A, N]), E = () => {
|
|
785
|
+
if (!r || !D) return;
|
|
799
786
|
const f = {
|
|
800
|
-
connectionId:
|
|
787
|
+
connectionId: u,
|
|
801
788
|
id: Ke(),
|
|
802
789
|
title: "Title",
|
|
803
790
|
description: "Description",
|
|
@@ -817,48 +804,48 @@ function ll() {
|
|
|
817
804
|
cards: [f],
|
|
818
805
|
activeCardId: f.id
|
|
819
806
|
};
|
|
820
|
-
|
|
807
|
+
g(D.id, k), C(k.id);
|
|
821
808
|
}, x = () => {
|
|
822
809
|
y(!0);
|
|
823
810
|
};
|
|
824
811
|
async function v() {
|
|
825
812
|
if (c(!0), !a || !n) return;
|
|
826
|
-
const f =
|
|
813
|
+
const f = Ma(
|
|
827
814
|
l
|
|
828
815
|
), k = JSON.stringify(f), S = {
|
|
829
816
|
...n,
|
|
830
817
|
template: k,
|
|
831
818
|
filterValues: p
|
|
832
819
|
};
|
|
833
|
-
await
|
|
820
|
+
await Os(S, s == null ? void 0 : s.accessToken), We.success("Lens saved"), j == null || j(f), c(!1);
|
|
834
821
|
}
|
|
835
|
-
return
|
|
822
|
+
return d ? null : /* @__PURE__ */ e.jsxs(
|
|
836
823
|
"div",
|
|
837
824
|
{
|
|
838
825
|
className: "flex items-center justify-between gap-2 border-b bg-muted/50 py-2 pl-3 pr-2",
|
|
839
826
|
role: "dashboard-controls",
|
|
840
827
|
children: [
|
|
841
|
-
!
|
|
828
|
+
!d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(_, { children: n == null ? void 0 : n.name }) }),
|
|
842
829
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
843
830
|
/* @__PURE__ */ e.jsx(nl, {}),
|
|
844
|
-
|
|
845
|
-
!
|
|
846
|
-
|
|
847
|
-
|
|
831
|
+
r && !d && F && /* @__PURE__ */ e.jsx(al, {}),
|
|
832
|
+
!d && F && /* @__PURE__ */ e.jsx(tl, {}),
|
|
833
|
+
r && !d && /* @__PURE__ */ e.jsxs(
|
|
834
|
+
z,
|
|
848
835
|
{
|
|
849
836
|
variant: "secondary",
|
|
850
837
|
className: "h-7 p-2",
|
|
851
838
|
size: "sm",
|
|
852
|
-
disabled: !
|
|
839
|
+
disabled: !r,
|
|
853
840
|
onClick: E,
|
|
854
841
|
children: [
|
|
855
|
-
/* @__PURE__ */ e.jsx(
|
|
842
|
+
/* @__PURE__ */ e.jsx(Ts, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
856
843
|
"Frame"
|
|
857
844
|
]
|
|
858
845
|
}
|
|
859
846
|
),
|
|
860
|
-
!
|
|
861
|
-
|
|
847
|
+
!r && /* @__PURE__ */ e.jsx(
|
|
848
|
+
z,
|
|
862
849
|
{
|
|
863
850
|
variant: "ghost",
|
|
864
851
|
className: "h-7 p-2",
|
|
@@ -867,21 +854,21 @@ function ll() {
|
|
|
867
854
|
children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
868
855
|
}
|
|
869
856
|
),
|
|
870
|
-
|
|
871
|
-
|
|
857
|
+
r && !d && /* @__PURE__ */ e.jsx(
|
|
858
|
+
z,
|
|
872
859
|
{
|
|
873
860
|
variant: "ghost",
|
|
874
861
|
role: "close",
|
|
875
862
|
className: "h-7 p-2",
|
|
876
863
|
onClick: () => {
|
|
877
|
-
y(!1),
|
|
864
|
+
y(!1), L(!1);
|
|
878
865
|
},
|
|
879
866
|
size: "sm",
|
|
880
867
|
children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
881
868
|
}
|
|
882
869
|
),
|
|
883
|
-
|
|
884
|
-
|
|
870
|
+
r && !d && F && /* @__PURE__ */ e.jsx(
|
|
871
|
+
z,
|
|
885
872
|
{
|
|
886
873
|
className: "h-7 p-2",
|
|
887
874
|
variant: "ghost",
|
|
@@ -891,8 +878,8 @@ function ll() {
|
|
|
891
878
|
children: /* @__PURE__ */ e.jsx(Un, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
892
879
|
}
|
|
893
880
|
),
|
|
894
|
-
!b && !
|
|
895
|
-
|
|
881
|
+
!b && !d && r && /* @__PURE__ */ e.jsx(
|
|
882
|
+
z,
|
|
896
883
|
{
|
|
897
884
|
className: "h-7 p-2",
|
|
898
885
|
variant: "ghost",
|
|
@@ -901,8 +888,8 @@ function ll() {
|
|
|
901
888
|
children: /* @__PURE__ */ e.jsx(da, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
902
889
|
}
|
|
903
890
|
),
|
|
904
|
-
!
|
|
905
|
-
!
|
|
891
|
+
!d && r && !1,
|
|
892
|
+
!d && !1
|
|
906
893
|
] })
|
|
907
894
|
]
|
|
908
895
|
}
|
|
@@ -914,32 +901,32 @@ function Be({
|
|
|
914
901
|
value: a,
|
|
915
902
|
isLoading: n,
|
|
916
903
|
isError: l,
|
|
917
|
-
connectionTooltip:
|
|
918
|
-
onChange:
|
|
904
|
+
connectionTooltip: r,
|
|
905
|
+
onChange: u,
|
|
919
906
|
showNone: o = !1,
|
|
920
907
|
className: c,
|
|
921
908
|
showIcon: p = !0,
|
|
922
|
-
disabled:
|
|
909
|
+
disabled: d = !1
|
|
923
910
|
}) {
|
|
924
911
|
const b = n ? "Loading..." : l ? "Error" : a;
|
|
925
|
-
function
|
|
912
|
+
function j() {
|
|
926
913
|
if (s === "Connection")
|
|
927
914
|
return /* @__PURE__ */ e.jsx(Bn, { className: "size-4 rotate-90" });
|
|
928
915
|
if (s === "Database")
|
|
929
|
-
return /* @__PURE__ */ e.jsx(
|
|
916
|
+
return /* @__PURE__ */ e.jsx(Dn, { className: "size-4" });
|
|
930
917
|
if (s === "Schema")
|
|
931
918
|
return /* @__PURE__ */ e.jsx($n, { className: "size-4" });
|
|
932
919
|
if (s === "Table")
|
|
933
920
|
return /* @__PURE__ */ e.jsx(Vs, { className: "size-4" });
|
|
934
921
|
if (s === "Model")
|
|
935
|
-
return /* @__PURE__ */ e.jsx(
|
|
922
|
+
return /* @__PURE__ */ e.jsx(kn, { className: "size-4" });
|
|
936
923
|
}
|
|
937
924
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
938
|
-
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children:
|
|
939
|
-
/* @__PURE__ */ e.jsx(rt, { children:
|
|
940
|
-
/* @__PURE__ */ e.jsx(ma, { className: "text-xs", align: "start", children:
|
|
941
|
-
] }) :
|
|
942
|
-
/* @__PURE__ */ e.jsxs(me, { disabled:
|
|
925
|
+
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(ua, { children: [
|
|
926
|
+
/* @__PURE__ */ e.jsx(rt, { children: j() }),
|
|
927
|
+
/* @__PURE__ */ e.jsx(ma, { className: "text-xs", align: "start", children: r })
|
|
928
|
+
] }) : j() }),
|
|
929
|
+
/* @__PURE__ */ e.jsxs(me, { disabled: d, value: b, onValueChange: u, children: [
|
|
943
930
|
/* @__PURE__ */ e.jsx(
|
|
944
931
|
he,
|
|
945
932
|
{
|
|
@@ -959,7 +946,7 @@ function Be({
|
|
|
959
946
|
n ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
960
947
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
961
948
|
o && /* @__PURE__ */ e.jsx(Y, { value: "none", children: "None" }, "none"),
|
|
962
|
-
t && t.map((h,
|
|
949
|
+
t && t.map((h, g) => /* @__PURE__ */ e.jsx(Y, { value: h.id, children: h.name }, g))
|
|
963
950
|
] }),
|
|
964
951
|
(n || l) && /* @__PURE__ */ e.jsx(Y, { value: b, children: b })
|
|
965
952
|
] }) })
|
|
@@ -969,24 +956,24 @@ function Be({
|
|
|
969
956
|
function rl({ column: s }) {
|
|
970
957
|
const [t, a] = V(!1), n = m((h) => h.selectedTableName), l = m(
|
|
971
958
|
(h) => h.selectedSchemaName
|
|
972
|
-
),
|
|
959
|
+
), r = m(
|
|
973
960
|
(h) => h.selectedDatamodelId
|
|
974
|
-
),
|
|
975
|
-
function b(h,
|
|
976
|
-
var
|
|
977
|
-
const C = ha(h,
|
|
978
|
-
(
|
|
979
|
-
)) == null ? void 0 :
|
|
961
|
+
), u = m((h) => h.sqlGen), { modelItems: o } = _e(), c = m((h) => h.actions.setSqlGen), p = m((h) => h.actions.setCardSql), d = m((h) => h.actions.setRunSql);
|
|
962
|
+
function b(h, g) {
|
|
963
|
+
var L;
|
|
964
|
+
const C = ha(h, u, g), O = (L = o == null ? void 0 : o.find(
|
|
965
|
+
(D) => D.id === r
|
|
966
|
+
)) == null ? void 0 : L.name;
|
|
980
967
|
c(C);
|
|
981
968
|
const y = xa(
|
|
982
969
|
C,
|
|
983
970
|
de(l || ""),
|
|
984
971
|
de(n),
|
|
985
|
-
|
|
972
|
+
O
|
|
986
973
|
);
|
|
987
|
-
y && (p(y),
|
|
974
|
+
y && (p(y), d(!0)), a(!1);
|
|
988
975
|
}
|
|
989
|
-
function
|
|
976
|
+
function j() {
|
|
990
977
|
return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
|
|
991
978
|
/* @__PURE__ */ e.jsx(
|
|
992
979
|
"li",
|
|
@@ -1031,13 +1018,13 @@ function rl({ column: s }) {
|
|
|
1031
1018
|
] });
|
|
1032
1019
|
}
|
|
1033
1020
|
return /* @__PURE__ */ e.jsxs(qs, { openDelay: 0, open: t, onOpenChange: a, children: [
|
|
1034
|
-
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1021
|
+
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
|
|
1035
1022
|
/* @__PURE__ */ e.jsx(
|
|
1036
1023
|
_s,
|
|
1037
1024
|
{
|
|
1038
1025
|
align: "center",
|
|
1039
1026
|
className: "w-20 rounded-md p-0 shadow-none",
|
|
1040
|
-
children:
|
|
1027
|
+
children: j()
|
|
1041
1028
|
}
|
|
1042
1029
|
)
|
|
1043
1030
|
] });
|
|
@@ -1049,7 +1036,7 @@ function Ea({ column: s }) {
|
|
|
1049
1036
|
/* @__PURE__ */ e.jsx(Gs, { className: "size-3" })
|
|
1050
1037
|
) : pa.includes(s.data_type.toLowerCase()) ? (
|
|
1051
1038
|
//
|
|
1052
|
-
/* @__PURE__ */ e.jsx(
|
|
1039
|
+
/* @__PURE__ */ e.jsx(An, { className: "size-3" })
|
|
1053
1040
|
) : ct.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(dt, { className: "size-3" }) : ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Wn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Gn, { className: "size-3" }) }),
|
|
1054
1041
|
/* @__PURE__ */ e.jsx(ma, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
1055
1042
|
] });
|
|
@@ -1060,45 +1047,45 @@ function il({
|
|
|
1060
1047
|
columns: a,
|
|
1061
1048
|
status: n
|
|
1062
1049
|
}) {
|
|
1063
|
-
const l = m((x) => x.sqlGen),
|
|
1050
|
+
const l = m((x) => x.sqlGen), r = m(
|
|
1064
1051
|
(x) => x.selectedConnectionId
|
|
1065
|
-
),
|
|
1052
|
+
), u = m(
|
|
1066
1053
|
(x) => x.selectedDatabaseName
|
|
1067
1054
|
), o = m(
|
|
1068
1055
|
(x) => x.selectedSchemaName
|
|
1069
1056
|
), c = m((x) => x.selectedTableName), p = m(
|
|
1070
1057
|
(x) => x.selectedDatamodelId
|
|
1071
|
-
),
|
|
1058
|
+
), d = I(
|
|
1072
1059
|
(x) => x.dashboard.aiScopeTables
|
|
1073
|
-
), { setAIScopeTables: b } =
|
|
1060
|
+
), { setAIScopeTables: b } = I((x) => x.actions), j = m((x) => x.actions.setRunSql), h = m((x) => x.actions.setSqlGen), g = m(
|
|
1074
1061
|
(x) => x.actions.setIsShowingVisual
|
|
1075
|
-
), C = m((x) => x.actions.setCardSql), { connectionType:
|
|
1076
|
-
function
|
|
1062
|
+
), C = m((x) => x.actions.setCardSql), { connectionType: O, modelItems: y } = _e();
|
|
1063
|
+
function L(x) {
|
|
1077
1064
|
var S;
|
|
1078
1065
|
const v = ha(x, l);
|
|
1079
1066
|
h(v);
|
|
1080
1067
|
const f = (S = y == null ? void 0 : y.find(
|
|
1081
|
-
(
|
|
1068
|
+
(q) => q.id === p
|
|
1082
1069
|
)) == null ? void 0 : S.name, k = xa(v, de(s), de(t), f);
|
|
1083
|
-
k && (C(k),
|
|
1070
|
+
k && (C(k), j(!0));
|
|
1084
1071
|
}
|
|
1085
|
-
function
|
|
1086
|
-
return (
|
|
1087
|
-
(x) => x.connectinonId ===
|
|
1072
|
+
function D() {
|
|
1073
|
+
return (d == null ? void 0 : d.find(
|
|
1074
|
+
(x) => x.connectinonId === r && x.tableName === c
|
|
1088
1075
|
)) !== void 0;
|
|
1089
1076
|
}
|
|
1090
1077
|
function A(x) {
|
|
1091
|
-
if (x === !0 && c &&
|
|
1078
|
+
if (x === !0 && c && r) {
|
|
1092
1079
|
const v = {
|
|
1093
|
-
connectinonId:
|
|
1094
|
-
connectionType:
|
|
1095
|
-
databaseName:
|
|
1080
|
+
connectinonId: r,
|
|
1081
|
+
connectionType: O,
|
|
1082
|
+
databaseName: u,
|
|
1096
1083
|
schemaName: o,
|
|
1097
1084
|
tableName: c
|
|
1098
|
-
}, k = [...
|
|
1099
|
-
(S,
|
|
1085
|
+
}, k = [...d || [], v].filter(
|
|
1086
|
+
(S, q, $) => $.findIndex(
|
|
1100
1087
|
(U) => U.connectinonId === S.connectinonId && U.tableName === S.tableName
|
|
1101
|
-
) ===
|
|
1088
|
+
) === q
|
|
1102
1089
|
);
|
|
1103
1090
|
b(k), We.success(`Added '${c}' to AI Scope`, {
|
|
1104
1091
|
position: "top-right",
|
|
@@ -1106,8 +1093,8 @@ function il({
|
|
|
1106
1093
|
richColors: !0
|
|
1107
1094
|
});
|
|
1108
1095
|
} else {
|
|
1109
|
-
const v = (
|
|
1110
|
-
(f) => f.connectinonId !==
|
|
1096
|
+
const v = (d || []).filter(
|
|
1097
|
+
(f) => f.connectinonId !== r && f.tableName !== c
|
|
1111
1098
|
);
|
|
1112
1099
|
b(v), We(`Removed '${c}' from AI Scope`, {
|
|
1113
1100
|
position: "top-right",
|
|
@@ -1120,29 +1107,29 @@ function il({
|
|
|
1120
1107
|
var S;
|
|
1121
1108
|
let x = ga(s, t);
|
|
1122
1109
|
const v = (S = y == null ? void 0 : y.find(
|
|
1123
|
-
(
|
|
1110
|
+
(q) => q.id === p
|
|
1124
1111
|
)) == null ? void 0 : S.name;
|
|
1125
|
-
p && p !== "none" && (x = `${
|
|
1112
|
+
p && p !== "none" && (x = `${Ss}.${v}`);
|
|
1126
1113
|
let f = x;
|
|
1127
|
-
return ((
|
|
1114
|
+
return ((q) => /[A-Z]/.test(q))(t) && (f = f.split(".").map(($) => `"${$}"`).join(".")), f;
|
|
1128
1115
|
}
|
|
1129
|
-
function
|
|
1116
|
+
function F() {
|
|
1130
1117
|
const x = N();
|
|
1131
|
-
|
|
1132
|
-
const v =
|
|
1133
|
-
C(v),
|
|
1118
|
+
g(!1);
|
|
1119
|
+
const v = O === "MSSQL" ? `SELECT top 10 * FROM ${x}` : `SELECT * FROM ${x} LIMIT 10`;
|
|
1120
|
+
C(v), j(!0);
|
|
1134
1121
|
}
|
|
1135
1122
|
function E() {
|
|
1136
1123
|
const x = N();
|
|
1137
|
-
C(`SELECT COUNT(*) as count FROM ${x}`),
|
|
1124
|
+
C(`SELECT COUNT(*) as count FROM ${x}`), j(!0);
|
|
1138
1125
|
}
|
|
1139
1126
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
1140
1127
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
1141
1128
|
/* @__PURE__ */ e.jsx(
|
|
1142
1129
|
fa,
|
|
1143
1130
|
{
|
|
1144
|
-
title: `${
|
|
1145
|
-
pressed:
|
|
1131
|
+
title: `${D() ? "Remove from" : "Add to"} AI Scope`,
|
|
1132
|
+
pressed: D(),
|
|
1146
1133
|
onPressedChange: A,
|
|
1147
1134
|
variant: "outline",
|
|
1148
1135
|
className: "h-9 px-2",
|
|
@@ -1150,18 +1137,18 @@ function il({
|
|
|
1150
1137
|
mt,
|
|
1151
1138
|
{
|
|
1152
1139
|
className: K("size-4", {
|
|
1153
|
-
"text-primary":
|
|
1154
|
-
"text-muted-foreground": !
|
|
1140
|
+
"text-primary": D(),
|
|
1141
|
+
"text-muted-foreground": !D()
|
|
1155
1142
|
})
|
|
1156
1143
|
}
|
|
1157
1144
|
)
|
|
1158
1145
|
}
|
|
1159
1146
|
),
|
|
1160
1147
|
/* @__PURE__ */ e.jsxs(
|
|
1161
|
-
|
|
1148
|
+
z,
|
|
1162
1149
|
{
|
|
1163
1150
|
disabled: n !== "Success",
|
|
1164
|
-
onClick:
|
|
1151
|
+
onClick: F,
|
|
1165
1152
|
size: "sm",
|
|
1166
1153
|
variant: "secondary",
|
|
1167
1154
|
className: "flex",
|
|
@@ -1172,7 +1159,7 @@ function il({
|
|
|
1172
1159
|
}
|
|
1173
1160
|
),
|
|
1174
1161
|
/* @__PURE__ */ e.jsxs(
|
|
1175
|
-
|
|
1162
|
+
z,
|
|
1176
1163
|
{
|
|
1177
1164
|
disabled: n !== "Success",
|
|
1178
1165
|
onClick: E,
|
|
@@ -1194,7 +1181,7 @@ function il({
|
|
|
1194
1181
|
a == null ? void 0 : a.map((x) => /* @__PURE__ */ e.jsxs(
|
|
1195
1182
|
"div",
|
|
1196
1183
|
{
|
|
1197
|
-
onClick: () =>
|
|
1184
|
+
onClick: () => L(x),
|
|
1198
1185
|
className: K(
|
|
1199
1186
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
1200
1187
|
{
|
|
@@ -1227,56 +1214,56 @@ function il({
|
|
|
1227
1214
|
}
|
|
1228
1215
|
function _e(s, t) {
|
|
1229
1216
|
var Ze, es, ss, as, ts;
|
|
1230
|
-
let a =
|
|
1217
|
+
let a = ks(() => [], []);
|
|
1231
1218
|
const n = Oe().authToken || s, l = m(
|
|
1232
|
-
(
|
|
1233
|
-
),
|
|
1234
|
-
(
|
|
1235
|
-
), i = m(
|
|
1236
|
-
(r) => r.selectedDatabaseName
|
|
1237
|
-
), o = m(
|
|
1238
|
-
(r) => r.selectedSchemaName
|
|
1239
|
-
), c = m((r) => r.selectedTableName), p = m(
|
|
1240
|
-
(r) => r.actions.setCurrentColumns
|
|
1219
|
+
(i) => i.selectedConnectionId
|
|
1220
|
+
), r = m(
|
|
1221
|
+
(i) => i.selectedDatamodelId
|
|
1241
1222
|
), u = m(
|
|
1242
|
-
(
|
|
1223
|
+
(i) => i.selectedDatabaseName
|
|
1224
|
+
), o = m(
|
|
1225
|
+
(i) => i.selectedSchemaName
|
|
1226
|
+
), c = m((i) => i.selectedTableName), p = m(
|
|
1227
|
+
(i) => i.actions.setCurrentColumns
|
|
1228
|
+
), d = m(
|
|
1229
|
+
(i) => i.actions.setSelectedConnectionId
|
|
1243
1230
|
), b = m(
|
|
1244
|
-
(
|
|
1245
|
-
), g = m(
|
|
1246
|
-
(r) => r.actions.setSelectedDatabaseName
|
|
1247
|
-
), h = m(
|
|
1248
|
-
(r) => r.actions.setSelectedSchemaName
|
|
1231
|
+
(i) => i.actions.setSelectedDatamodelId
|
|
1249
1232
|
), j = m(
|
|
1250
|
-
(
|
|
1251
|
-
),
|
|
1252
|
-
|
|
1253
|
-
|
|
1233
|
+
(i) => i.actions.setSelectedDatabaseName
|
|
1234
|
+
), h = m(
|
|
1235
|
+
(i) => i.actions.setSelectedSchemaName
|
|
1236
|
+
), g = m(
|
|
1237
|
+
(i) => i.actions.setSelectedTableName
|
|
1238
|
+
), C = m((i) => i.actions.setCardSql);
|
|
1239
|
+
function O(i) {
|
|
1240
|
+
return l && u && o && u !== "NA" ? !0 : l && i === "API" ? !1 : !!(l && i === "S3");
|
|
1254
1241
|
}
|
|
1255
|
-
function y(
|
|
1256
|
-
return !!(l &&
|
|
1242
|
+
function y(i) {
|
|
1243
|
+
return !!(l && u && u !== "NA" && o && c || l && (i === "S3" || i === "API") || r && r);
|
|
1257
1244
|
}
|
|
1258
|
-
function
|
|
1259
|
-
return l &&
|
|
1245
|
+
function L(i) {
|
|
1246
|
+
return l && i ? !(i === "API" || i === "S3") : !1;
|
|
1260
1247
|
}
|
|
1261
1248
|
const {
|
|
1262
|
-
data:
|
|
1249
|
+
data: D,
|
|
1263
1250
|
isLoading: A,
|
|
1264
1251
|
isError: N
|
|
1265
1252
|
} = Ce({
|
|
1266
1253
|
queryKey: ["connections"],
|
|
1267
|
-
queryFn: () =>
|
|
1254
|
+
queryFn: () => Fe(
|
|
1268
1255
|
"https://semaphor.cloud/api/v1/connections",
|
|
1269
1256
|
(n == null ? void 0 : n.accessToken) || ""
|
|
1270
1257
|
),
|
|
1271
1258
|
enabled: !!(n != null && n.accessToken)
|
|
1272
1259
|
// Only fetch if authToken is present
|
|
1273
1260
|
}), {
|
|
1274
|
-
data:
|
|
1261
|
+
data: F,
|
|
1275
1262
|
isLoading: E,
|
|
1276
1263
|
isError: x
|
|
1277
1264
|
} = Ce({
|
|
1278
1265
|
queryKey: ["models", l],
|
|
1279
|
-
queryFn: () =>
|
|
1266
|
+
queryFn: () => Fe(
|
|
1280
1267
|
"https://semaphor.cloud/api/v1/datamodels",
|
|
1281
1268
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1282
1269
|
{
|
|
@@ -1285,24 +1272,24 @@ function _e(s, t) {
|
|
|
1285
1272
|
),
|
|
1286
1273
|
enabled: !!(n != null && n.accessToken) && !!l
|
|
1287
1274
|
// Only fetch if authToken is present
|
|
1288
|
-
}), v =
|
|
1289
|
-
(
|
|
1275
|
+
}), v = D == null ? void 0 : D.connections.find(
|
|
1276
|
+
(i) => i.id === l
|
|
1290
1277
|
), f = v == null ? void 0 : v.type, k = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
|
|
1291
1278
|
data: S,
|
|
1292
|
-
isLoading:
|
|
1279
|
+
isLoading: q,
|
|
1293
1280
|
isFetching: $,
|
|
1294
1281
|
isError: U,
|
|
1295
1282
|
refetch: Z
|
|
1296
1283
|
} = Ce({
|
|
1297
1284
|
queryKey: ["databases", l],
|
|
1298
|
-
queryFn: () =>
|
|
1285
|
+
queryFn: () => Fe(
|
|
1299
1286
|
"https://semaphor.cloud/api/v1/databases",
|
|
1300
1287
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1301
1288
|
{
|
|
1302
1289
|
connection_id: l
|
|
1303
1290
|
}
|
|
1304
1291
|
),
|
|
1305
|
-
enabled:
|
|
1292
|
+
enabled: L(f)
|
|
1306
1293
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1307
1294
|
}), {
|
|
1308
1295
|
data: B,
|
|
@@ -1311,20 +1298,20 @@ function _e(s, t) {
|
|
|
1311
1298
|
isError: H,
|
|
1312
1299
|
refetch: ae
|
|
1313
1300
|
} = Ce({
|
|
1314
|
-
queryKey: ["schemas", l,
|
|
1315
|
-
queryFn: () =>
|
|
1301
|
+
queryKey: ["schemas", l, u],
|
|
1302
|
+
queryFn: () => Fe(
|
|
1316
1303
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1317
1304
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1318
1305
|
{
|
|
1319
1306
|
connection_id: l,
|
|
1320
|
-
database_name:
|
|
1307
|
+
database_name: u
|
|
1321
1308
|
}
|
|
1322
1309
|
),
|
|
1323
|
-
enabled: !!l && !!
|
|
1310
|
+
enabled: !!l && !!u && !k && u !== "NA"
|
|
1324
1311
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1325
1312
|
}), {
|
|
1326
|
-
data:
|
|
1327
|
-
isLoading:
|
|
1313
|
+
data: M,
|
|
1314
|
+
isLoading: T,
|
|
1328
1315
|
isFetching: te,
|
|
1329
1316
|
isError: P,
|
|
1330
1317
|
refetch: ee
|
|
@@ -1332,19 +1319,19 @@ function _e(s, t) {
|
|
|
1332
1319
|
queryKey: [
|
|
1333
1320
|
"tables",
|
|
1334
1321
|
l,
|
|
1335
|
-
|
|
1322
|
+
u,
|
|
1336
1323
|
o
|
|
1337
1324
|
],
|
|
1338
|
-
queryFn: () =>
|
|
1325
|
+
queryFn: () => Fe(
|
|
1339
1326
|
"https://semaphor.cloud/api/v1/tables",
|
|
1340
1327
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1341
1328
|
{
|
|
1342
1329
|
connection_id: l,
|
|
1343
|
-
database_name:
|
|
1330
|
+
database_name: u,
|
|
1344
1331
|
schema_name: o
|
|
1345
1332
|
}
|
|
1346
1333
|
),
|
|
1347
|
-
enabled:
|
|
1334
|
+
enabled: O(f)
|
|
1348
1335
|
}), {
|
|
1349
1336
|
data: ne,
|
|
1350
1337
|
isLoading: Ee,
|
|
@@ -1354,19 +1341,19 @@ function _e(s, t) {
|
|
|
1354
1341
|
queryKey: [
|
|
1355
1342
|
"columns",
|
|
1356
1343
|
l,
|
|
1357
|
-
|
|
1358
|
-
|
|
1344
|
+
u,
|
|
1345
|
+
r,
|
|
1359
1346
|
o,
|
|
1360
1347
|
c
|
|
1361
1348
|
],
|
|
1362
|
-
queryFn: () =>
|
|
1349
|
+
queryFn: () => Fe(
|
|
1363
1350
|
"https://semaphor.cloud/api/v1/columns",
|
|
1364
1351
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1365
1352
|
{
|
|
1366
1353
|
connection_id: l,
|
|
1367
|
-
datamodel_id:
|
|
1354
|
+
datamodel_id: r || "",
|
|
1368
1355
|
// don't pass undefined. Pass empty string
|
|
1369
|
-
database_name:
|
|
1356
|
+
database_name: u,
|
|
1370
1357
|
schema_name: o,
|
|
1371
1358
|
table_name: c
|
|
1372
1359
|
}
|
|
@@ -1386,46 +1373,46 @@ function _e(s, t) {
|
|
|
1386
1373
|
}, [
|
|
1387
1374
|
k,
|
|
1388
1375
|
C,
|
|
1389
|
-
j,
|
|
1390
|
-
h,
|
|
1391
1376
|
g,
|
|
1377
|
+
h,
|
|
1378
|
+
j,
|
|
1392
1379
|
v
|
|
1393
1380
|
]);
|
|
1394
1381
|
const be = (v == null ? void 0 : v.type) === "API" ? (Ze = v == null ? void 0 : v.type) == null ? void 0 : Ze.toLowerCase() : c || "", W = k ? "" : o || "";
|
|
1395
|
-
function oe(
|
|
1396
|
-
h(
|
|
1382
|
+
function oe(i) {
|
|
1383
|
+
h(i), g("");
|
|
1397
1384
|
}
|
|
1398
|
-
function ce(
|
|
1399
|
-
|
|
1385
|
+
function ce(i) {
|
|
1386
|
+
j(i === "none" ? "" : i), h(""), g(""), i !== "none" && i !== "" && b("");
|
|
1400
1387
|
}
|
|
1401
|
-
function
|
|
1402
|
-
|
|
1388
|
+
function De(i) {
|
|
1389
|
+
d(i);
|
|
1403
1390
|
}
|
|
1404
|
-
function Ae(
|
|
1405
|
-
b(
|
|
1391
|
+
function Ae(i) {
|
|
1392
|
+
b(i === "none" ? "" : i), i !== "none" && i !== "" && j("");
|
|
1406
1393
|
}
|
|
1407
|
-
S && ((es = S == null ? void 0 : S.databases) == null ? void 0 : es.length) > 0, B && ((ss = B == null ? void 0 : B.schemas) == null ? void 0 : ss.length) > 0, ne && ((as = ne == null ? void 0 : ne.columns) == null ? void 0 : as.length) > 0 && (a = ne.columns.map((
|
|
1408
|
-
...
|
|
1409
|
-
data_type:
|
|
1394
|
+
S && ((es = S == null ? void 0 : S.databases) == null ? void 0 : es.length) > 0, B && ((ss = B == null ? void 0 : B.schemas) == null ? void 0 : ss.length) > 0, ne && ((as = ne == null ? void 0 : ne.columns) == null ? void 0 : as.length) > 0 && (a = ne.columns.map((i) => ({
|
|
1395
|
+
...i,
|
|
1396
|
+
data_type: i.data_type.toLowerCase()
|
|
1410
1397
|
}))), U && (a = []), (je || N) && (a = []);
|
|
1411
|
-
const $e =
|
|
1412
|
-
(
|
|
1413
|
-
id:
|
|
1414
|
-
name:
|
|
1415
|
-
type:
|
|
1398
|
+
const $e = D == null ? void 0 : D.connections.map(
|
|
1399
|
+
(i) => ({
|
|
1400
|
+
id: i.id,
|
|
1401
|
+
name: i.name,
|
|
1402
|
+
type: i.type
|
|
1416
1403
|
})
|
|
1417
|
-
), Pe = (ts =
|
|
1418
|
-
id:
|
|
1419
|
-
name:
|
|
1420
|
-
})), Ve = S == null ? void 0 : S.databases.map((
|
|
1421
|
-
id:
|
|
1422
|
-
name:
|
|
1423
|
-
})),
|
|
1424
|
-
id:
|
|
1425
|
-
name:
|
|
1426
|
-
})), Xe =
|
|
1427
|
-
id:
|
|
1428
|
-
name:
|
|
1404
|
+
), Pe = (ts = F == null ? void 0 : F.datamodels) == null ? void 0 : ts.map((i) => ({
|
|
1405
|
+
id: i.id,
|
|
1406
|
+
name: i.name
|
|
1407
|
+
})), Ve = S == null ? void 0 : S.databases.map((i) => ({
|
|
1408
|
+
id: i.database_name,
|
|
1409
|
+
name: i.database_name
|
|
1410
|
+
})), vs = B == null ? void 0 : B.schemas.map((i) => ({
|
|
1411
|
+
id: i.schema_name,
|
|
1412
|
+
name: i.schema_name
|
|
1413
|
+
})), Xe = M == null ? void 0 : M.tables.map((i) => ({
|
|
1414
|
+
id: i.table_name,
|
|
1415
|
+
name: i.table_name
|
|
1429
1416
|
}));
|
|
1430
1417
|
return {
|
|
1431
1418
|
connectionItems: $e,
|
|
@@ -1435,13 +1422,13 @@ function _e(s, t) {
|
|
|
1435
1422
|
isModelsLoading: E,
|
|
1436
1423
|
isModelsError: x,
|
|
1437
1424
|
databaseItems: Ve,
|
|
1438
|
-
isDatabasesLoadingOrFetching:
|
|
1425
|
+
isDatabasesLoadingOrFetching: q || $,
|
|
1439
1426
|
isDatabaseError: U,
|
|
1440
|
-
schemaItems:
|
|
1427
|
+
schemaItems: vs,
|
|
1441
1428
|
isSchemaLoadingOrFetching: X || w,
|
|
1442
1429
|
isSchemaError: H,
|
|
1443
1430
|
tableItems: Xe,
|
|
1444
|
-
isTableLoadingOrFetching:
|
|
1431
|
+
isTableLoadingOrFetching: T || te,
|
|
1445
1432
|
isTableError: P,
|
|
1446
1433
|
columns: a,
|
|
1447
1434
|
isColumnsLoadingOrFetching: Ee || Ie,
|
|
@@ -1450,7 +1437,7 @@ function _e(s, t) {
|
|
|
1450
1437
|
connectionType: f,
|
|
1451
1438
|
tableName: be,
|
|
1452
1439
|
schemaName: W,
|
|
1453
|
-
handleConnectionChange:
|
|
1440
|
+
handleConnectionChange: De,
|
|
1454
1441
|
handleDatamodelChange: Ae,
|
|
1455
1442
|
handleDatabaseChange: ce,
|
|
1456
1443
|
handleSchemaChange: oe
|
|
@@ -1468,44 +1455,44 @@ function Aa({
|
|
|
1468
1455
|
(P) => P.selectedDatabaseName
|
|
1469
1456
|
), l = m(
|
|
1470
1457
|
(P) => P.selectedSchemaName
|
|
1471
|
-
),
|
|
1458
|
+
), r = m((P) => P.selectedTableName), u = m(
|
|
1472
1459
|
(P) => P.actions.setSelectedTableName
|
|
1473
1460
|
), {
|
|
1474
1461
|
connectionItems: o,
|
|
1475
1462
|
modelItems: c,
|
|
1476
1463
|
schemaItems: p,
|
|
1477
|
-
databaseItems:
|
|
1464
|
+
databaseItems: d,
|
|
1478
1465
|
tableItems: b,
|
|
1479
|
-
columns:
|
|
1466
|
+
columns: j,
|
|
1480
1467
|
isConnectionsLoading: h,
|
|
1481
|
-
isModelsLoading:
|
|
1468
|
+
isModelsLoading: g,
|
|
1482
1469
|
isConnectionsError: C,
|
|
1483
|
-
isModelsError:
|
|
1470
|
+
isModelsError: O,
|
|
1484
1471
|
isDatabasesLoadingOrFetching: y,
|
|
1485
|
-
isDatabaseError:
|
|
1486
|
-
isSchemaLoadingOrFetching:
|
|
1472
|
+
isDatabaseError: L,
|
|
1473
|
+
isSchemaLoadingOrFetching: D,
|
|
1487
1474
|
isSchemaError: A,
|
|
1488
1475
|
isColumnsError: N,
|
|
1489
|
-
isColumnsLoadingOrFetching:
|
|
1476
|
+
isColumnsLoadingOrFetching: F,
|
|
1490
1477
|
isTableLoadingOrFetching: E,
|
|
1491
1478
|
isTableError: x,
|
|
1492
1479
|
connectionType: v,
|
|
1493
1480
|
isNonDbConnection: f,
|
|
1494
1481
|
handleConnectionChange: k,
|
|
1495
1482
|
handleDatabaseChange: S,
|
|
1496
|
-
handleSchemaChange:
|
|
1483
|
+
handleSchemaChange: q,
|
|
1497
1484
|
handleDatamodelChange: $,
|
|
1498
1485
|
tableName: U,
|
|
1499
1486
|
schemaName: Z
|
|
1500
1487
|
} = _e();
|
|
1501
1488
|
function B() {
|
|
1502
|
-
return s ? s(Z, U,
|
|
1489
|
+
return s ? s(Z, U, j) : /* @__PURE__ */ e.jsx(
|
|
1503
1490
|
il,
|
|
1504
1491
|
{
|
|
1505
1492
|
schemaName: Z,
|
|
1506
1493
|
tableName: U,
|
|
1507
|
-
columns:
|
|
1508
|
-
status:
|
|
1494
|
+
columns: j,
|
|
1495
|
+
status: F ? "Loading..." : N ? "Error" : "Success"
|
|
1509
1496
|
}
|
|
1510
1497
|
);
|
|
1511
1498
|
}
|
|
@@ -1520,9 +1507,9 @@ function Aa({
|
|
|
1520
1507
|
{
|
|
1521
1508
|
showNone: !0,
|
|
1522
1509
|
onChange: S,
|
|
1523
|
-
isError:
|
|
1510
|
+
isError: L,
|
|
1524
1511
|
isLoading: y,
|
|
1525
|
-
items:
|
|
1512
|
+
items: d,
|
|
1526
1513
|
value: n || "",
|
|
1527
1514
|
title: "Database"
|
|
1528
1515
|
}
|
|
@@ -1544,28 +1531,28 @@ function Aa({
|
|
|
1544
1531
|
{
|
|
1545
1532
|
showNone: !0,
|
|
1546
1533
|
onChange: $,
|
|
1547
|
-
isError:
|
|
1548
|
-
isLoading:
|
|
1534
|
+
isError: O,
|
|
1535
|
+
isLoading: g,
|
|
1549
1536
|
items: c,
|
|
1550
1537
|
value: a || "",
|
|
1551
1538
|
title: "Model"
|
|
1552
1539
|
}
|
|
1553
1540
|
);
|
|
1554
1541
|
}
|
|
1555
|
-
function
|
|
1542
|
+
function M() {
|
|
1556
1543
|
return !t || v === "S3" || v === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1557
1544
|
Be,
|
|
1558
1545
|
{
|
|
1559
|
-
onChange:
|
|
1546
|
+
onChange: q,
|
|
1560
1547
|
isError: A,
|
|
1561
|
-
isLoading:
|
|
1548
|
+
isLoading: D,
|
|
1562
1549
|
items: p,
|
|
1563
1550
|
value: l || "",
|
|
1564
1551
|
title: "Schema"
|
|
1565
1552
|
}
|
|
1566
1553
|
);
|
|
1567
1554
|
}
|
|
1568
|
-
function
|
|
1555
|
+
function T() {
|
|
1569
1556
|
function P() {
|
|
1570
1557
|
let ee = !1;
|
|
1571
1558
|
return v === "API" ? (ee = !1, ee) : ((v === "S3" || t && n && n !== "none" && l) && (ee = !0), ee);
|
|
@@ -1573,11 +1560,11 @@ function Aa({
|
|
|
1573
1560
|
return P() ? /* @__PURE__ */ e.jsx(
|
|
1574
1561
|
Be,
|
|
1575
1562
|
{
|
|
1576
|
-
onChange:
|
|
1563
|
+
onChange: u,
|
|
1577
1564
|
isError: x,
|
|
1578
1565
|
items: b,
|
|
1579
1566
|
isLoading: E,
|
|
1580
|
-
value:
|
|
1567
|
+
value: r || "",
|
|
1581
1568
|
title: "Table"
|
|
1582
1569
|
}
|
|
1583
1570
|
) : null;
|
|
@@ -1601,12 +1588,12 @@ function Aa({
|
|
|
1601
1588
|
ae(),
|
|
1602
1589
|
H(),
|
|
1603
1590
|
w(),
|
|
1604
|
-
|
|
1605
|
-
|
|
1591
|
+
M(),
|
|
1592
|
+
T()
|
|
1606
1593
|
] }),
|
|
1607
1594
|
B(),
|
|
1608
1595
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1609
|
-
|
|
1596
|
+
z,
|
|
1610
1597
|
{
|
|
1611
1598
|
onClick: X,
|
|
1612
1599
|
size: "sm",
|
|
@@ -1622,18 +1609,18 @@ function Aa({
|
|
|
1622
1609
|
}
|
|
1623
1610
|
function ol(s) {
|
|
1624
1611
|
const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1625
|
-
let
|
|
1626
|
-
if (l !== -1 && (
|
|
1627
|
-
const
|
|
1628
|
-
return `${
|
|
1612
|
+
let r = s.length;
|
|
1613
|
+
if (l !== -1 && (r = l), n !== -1 && n < r && (r = n), t !== -1) {
|
|
1614
|
+
const u = s.substring(0, t), o = s.substring(t);
|
|
1615
|
+
return `${u} {{ filters | where }} AND ${o.substring(
|
|
1629
1616
|
6
|
|
1630
1617
|
)}`;
|
|
1631
1618
|
} else if (a !== -1) {
|
|
1632
|
-
const
|
|
1633
|
-
return `${
|
|
1619
|
+
const u = s.substring(0, a), o = s.substring(a);
|
|
1620
|
+
return `${u} {{ filters | where }} ${o}`;
|
|
1634
1621
|
} else {
|
|
1635
|
-
const
|
|
1636
|
-
return `${
|
|
1622
|
+
const u = s.substring(0, r), o = s.substring(r);
|
|
1623
|
+
return `${u} {{ filters | where }} ${o}`;
|
|
1637
1624
|
}
|
|
1638
1625
|
}
|
|
1639
1626
|
function cl({
|
|
@@ -1643,7 +1630,7 @@ function cl({
|
|
|
1643
1630
|
setTriggerAIRun: n
|
|
1644
1631
|
}) {
|
|
1645
1632
|
return /* @__PURE__ */ e.jsxs(qs, { openDelay: 0, children: [
|
|
1646
|
-
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1633
|
+
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(On, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1647
1634
|
/* @__PURE__ */ e.jsx(
|
|
1648
1635
|
_s,
|
|
1649
1636
|
{
|
|
@@ -1652,7 +1639,7 @@ function cl({
|
|
|
1652
1639
|
children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
|
|
1653
1640
|
/* @__PURE__ */ e.jsx(ze, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
|
|
1654
1641
|
/* @__PURE__ */ e.jsxs(
|
|
1655
|
-
|
|
1642
|
+
z,
|
|
1656
1643
|
{
|
|
1657
1644
|
onClick: () => {
|
|
1658
1645
|
t(!0), a(s), n(!0);
|
|
@@ -1660,7 +1647,7 @@ function cl({
|
|
|
1660
1647
|
size: "sm",
|
|
1661
1648
|
variant: "outline",
|
|
1662
1649
|
children: [
|
|
1663
|
-
/* @__PURE__ */ e.jsx(
|
|
1650
|
+
/* @__PURE__ */ e.jsx(En, { className: "mr-2 h-4 w-4" }),
|
|
1664
1651
|
"Debug with AI"
|
|
1665
1652
|
]
|
|
1666
1653
|
}
|
|
@@ -1723,19 +1710,19 @@ function ul({
|
|
|
1723
1710
|
userInput: a,
|
|
1724
1711
|
setUserInput: n,
|
|
1725
1712
|
triggerAIRun: l,
|
|
1726
|
-
setTriggerAIRun:
|
|
1713
|
+
setTriggerAIRun: r
|
|
1727
1714
|
}) {
|
|
1728
|
-
const
|
|
1715
|
+
const u = zs(null), o = zs(null), { authToken: c } = Oe(), [p, d] = V(!1), b = m((w) => w.actions.setCardSql), j = I((w) => w.dashboard.baseQueries), h = m((w) => w.actions.setRunSql), g = m((w) => w.actions.setCardType), [C, O] = V([]), y = m((w) => w.currentColumns), L = m((w) => w.card.sql), D = m((w) => w.selectedTableName), A = `
|
|
1729
1716
|
${a}
|
|
1730
1717
|
|
|
1731
|
-
Database Query Dialect: ${
|
|
1732
|
-
Table Name: ${
|
|
1718
|
+
Database Query Dialect: ${D === "api" || D === "s3" ? "DuckDb" : ""}
|
|
1719
|
+
Table Name: ${D}
|
|
1733
1720
|
Table Columns: ${y == null ? void 0 : y.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
|
|
1734
|
-
User SQL: ${
|
|
1735
|
-
${
|
|
1736
|
-
Visual Query Syntax: ${dl}`, { data:
|
|
1721
|
+
User SQL: ${L}
|
|
1722
|
+
${j && `Base Queries: ${JSON.stringify(j)} `}`, N = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1723
|
+
Visual Query Syntax: ${dl}`, { data: F, isLoading: E, isFetching: x, isError: v, refetch: f } = Ce({
|
|
1737
1724
|
queryKey: ["ai-query"],
|
|
1738
|
-
queryFn: () =>
|
|
1725
|
+
queryFn: () => Fe(
|
|
1739
1726
|
"https://semaphor.cloud/api/v1/ai",
|
|
1740
1727
|
(c == null ? void 0 : c.accessToken) || "",
|
|
1741
1728
|
{
|
|
@@ -1747,44 +1734,44 @@ function ul({
|
|
|
1747
1734
|
});
|
|
1748
1735
|
function k(w) {
|
|
1749
1736
|
if (w.toLowerCase().includes("bar"))
|
|
1750
|
-
|
|
1737
|
+
g("bar");
|
|
1751
1738
|
else if (w.toLowerCase().includes("line"))
|
|
1752
|
-
|
|
1739
|
+
g("line");
|
|
1753
1740
|
else if (w.toLowerCase().includes("bubble"))
|
|
1754
|
-
|
|
1741
|
+
g("bubble");
|
|
1755
1742
|
else if (w.toLowerCase().includes("scatter"))
|
|
1756
|
-
|
|
1743
|
+
g("scatter");
|
|
1757
1744
|
else if (w.toLowerCase().includes("stacked"))
|
|
1758
|
-
|
|
1745
|
+
g("stackedBar");
|
|
1759
1746
|
else if (w.toLowerCase().includes("pie"))
|
|
1760
|
-
|
|
1747
|
+
g("pie");
|
|
1761
1748
|
else if (w.toLowerCase().includes("donut") || w.toLowerCase().includes("doughnut"))
|
|
1762
|
-
|
|
1749
|
+
g("doughnut");
|
|
1763
1750
|
else if (w.toLowerCase().includes("radar"))
|
|
1764
|
-
|
|
1751
|
+
g("radar");
|
|
1765
1752
|
else
|
|
1766
|
-
return
|
|
1753
|
+
return g("bar"), !1;
|
|
1767
1754
|
return !0;
|
|
1768
1755
|
}
|
|
1769
1756
|
se(() => {
|
|
1770
|
-
|
|
1771
|
-
}, [
|
|
1757
|
+
F && O((w) => [...w, { role: "ai", content: F.response }]);
|
|
1758
|
+
}, [F]), se(() => {
|
|
1772
1759
|
const w = setTimeout(() => {
|
|
1773
1760
|
var H;
|
|
1774
1761
|
o.current && (o.current.scroll({
|
|
1775
1762
|
top: o.current.scrollHeight,
|
|
1776
1763
|
behavior: "smooth"
|
|
1777
|
-
}), (H =
|
|
1764
|
+
}), (H = u.current) == null || H.focus());
|
|
1778
1765
|
}, 100);
|
|
1779
1766
|
return () => clearTimeout(w);
|
|
1780
1767
|
}, [C]);
|
|
1781
1768
|
function S() {
|
|
1782
|
-
a && (
|
|
1769
|
+
a && (O((w) => [...w, { role: "user", content: a }]), k(a) && d(!0), n(""), f());
|
|
1783
1770
|
}
|
|
1784
1771
|
se(() => {
|
|
1785
|
-
l && (S(),
|
|
1786
|
-
}, [l,
|
|
1787
|
-
const
|
|
1772
|
+
l && (S(), r(!1));
|
|
1773
|
+
}, [l, r]);
|
|
1774
|
+
const q = {
|
|
1788
1775
|
//seleect a darker color
|
|
1789
1776
|
// color: '#000',
|
|
1790
1777
|
fontFamily: "Arial, sans-serif",
|
|
@@ -1811,18 +1798,18 @@ function ul({
|
|
|
1811
1798
|
listStyleType: "disc"
|
|
1812
1799
|
}, Z = {
|
|
1813
1800
|
// Override how paragraphs are rendered
|
|
1814
|
-
p: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("p", { style:
|
|
1801
|
+
p: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("p", { style: q, ...H }),
|
|
1815
1802
|
code: ({ node: w, ...H }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...H }),
|
|
1816
1803
|
pre: ({ node: w, ...H }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: $, children: [
|
|
1817
1804
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: H.children }),
|
|
1818
1805
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1819
|
-
/* @__PURE__ */ e.jsx(
|
|
1806
|
+
/* @__PURE__ */ e.jsx(z, { onClick: B, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ft, {}) }),
|
|
1820
1807
|
/* @__PURE__ */ e.jsx(
|
|
1821
|
-
|
|
1808
|
+
z,
|
|
1822
1809
|
{
|
|
1823
1810
|
onClick: (ae) => {
|
|
1824
|
-
const
|
|
1825
|
-
|
|
1811
|
+
const M = B(ae);
|
|
1812
|
+
M && (t(!1), b(M), h(!0));
|
|
1826
1813
|
},
|
|
1827
1814
|
size: "sm",
|
|
1828
1815
|
variant: "outline",
|
|
@@ -1838,7 +1825,7 @@ function ul({
|
|
|
1838
1825
|
const H = w.currentTarget.closest("pre");
|
|
1839
1826
|
if (!H) return;
|
|
1840
1827
|
const ae = H.textContent || H.innerText;
|
|
1841
|
-
return navigator.clipboard.writeText(ae).then(() => console.log("Text copied to clipboard")).catch((
|
|
1828
|
+
return navigator.clipboard.writeText(ae).then(() => console.log("Text copied to clipboard")).catch((M) => console.error("Error in copying text: ", M)), ae;
|
|
1842
1829
|
}
|
|
1843
1830
|
function X() {
|
|
1844
1831
|
return C == null ? void 0 : C.map((w, H) => w.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
@@ -1856,14 +1843,14 @@ function ul({
|
|
|
1856
1843
|
{
|
|
1857
1844
|
className: "w-full overflow-auto py-1",
|
|
1858
1845
|
components: Z,
|
|
1859
|
-
children:
|
|
1846
|
+
children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
|
|
1860
1847
|
},
|
|
1861
1848
|
H
|
|
1862
1849
|
) : /* @__PURE__ */ e.jsx("div", {}, H));
|
|
1863
1850
|
}
|
|
1864
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1865
|
-
/* @__PURE__ */ e.jsx(
|
|
1866
|
-
|
|
1851
|
+
return /* @__PURE__ */ e.jsxs(Ds, { open: s, onOpenChange: t, children: [
|
|
1852
|
+
/* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1853
|
+
z,
|
|
1867
1854
|
{
|
|
1868
1855
|
size: "sm",
|
|
1869
1856
|
className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
@@ -1872,11 +1859,11 @@ function ul({
|
|
|
1872
1859
|
}
|
|
1873
1860
|
) }),
|
|
1874
1861
|
/* @__PURE__ */ e.jsxs(
|
|
1875
|
-
|
|
1862
|
+
Ls,
|
|
1876
1863
|
{
|
|
1877
1864
|
className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
|
|
1878
1865
|
children: [
|
|
1879
|
-
/* @__PURE__ */ e.jsxs(
|
|
1866
|
+
/* @__PURE__ */ e.jsxs(Ms, { children: [
|
|
1880
1867
|
/* @__PURE__ */ e.jsx(Es, { children: "Assistant" }),
|
|
1881
1868
|
/* @__PURE__ */ e.jsx(As, { children: "What can I help you with?" })
|
|
1882
1869
|
] }),
|
|
@@ -1896,7 +1883,7 @@ function ul({
|
|
|
1896
1883
|
ja,
|
|
1897
1884
|
{
|
|
1898
1885
|
autoFocus: !0,
|
|
1899
|
-
ref:
|
|
1886
|
+
ref: u,
|
|
1900
1887
|
onKeyDown: (w) => {
|
|
1901
1888
|
w.key === "Enter" && !w.shiftKey && (w.preventDefault(), n(""), S());
|
|
1902
1889
|
},
|
|
@@ -1915,7 +1902,7 @@ function ul({
|
|
|
1915
1902
|
),
|
|
1916
1903
|
" ",
|
|
1917
1904
|
/* @__PURE__ */ e.jsx(
|
|
1918
|
-
|
|
1905
|
+
z,
|
|
1919
1906
|
{
|
|
1920
1907
|
className: "h-8",
|
|
1921
1908
|
size: "sm",
|
|
@@ -1943,9 +1930,9 @@ function hl(s, t) {
|
|
|
1943
1930
|
if (s == null) return {};
|
|
1944
1931
|
var a = xl(s, t), n, l;
|
|
1945
1932
|
if (Object.getOwnPropertySymbols) {
|
|
1946
|
-
var
|
|
1947
|
-
for (l = 0; l <
|
|
1948
|
-
n =
|
|
1933
|
+
var r = Object.getOwnPropertySymbols(s);
|
|
1934
|
+
for (l = 0; l < r.length; l++)
|
|
1935
|
+
n = r[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
|
|
1949
1936
|
}
|
|
1950
1937
|
return a;
|
|
1951
1938
|
}
|
|
@@ -2022,13 +2009,13 @@ function jl(s) {
|
|
|
2022
2009
|
var {
|
|
2023
2010
|
attr: n,
|
|
2024
2011
|
size: l,
|
|
2025
|
-
title:
|
|
2026
|
-
} = s,
|
|
2012
|
+
title: r
|
|
2013
|
+
} = s, u = hl(s, ml), o = l || a.size || "1em", c;
|
|
2027
2014
|
return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ ke.createElement("svg", ms({
|
|
2028
2015
|
stroke: "currentColor",
|
|
2029
2016
|
fill: "currentColor",
|
|
2030
2017
|
strokeWidth: "0"
|
|
2031
|
-
}, a.attr, n,
|
|
2018
|
+
}, a.attr, n, u, {
|
|
2032
2019
|
className: c,
|
|
2033
2020
|
style: hs(hs({
|
|
2034
2021
|
color: s.color || a.color
|
|
@@ -2036,7 +2023,7 @@ function jl(s) {
|
|
|
2036
2023
|
height: o,
|
|
2037
2024
|
width: o,
|
|
2038
2025
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2039
|
-
}),
|
|
2026
|
+
}), r && /* @__PURE__ */ ke.createElement("title", null, r), s.children);
|
|
2040
2027
|
};
|
|
2041
2028
|
return sa !== void 0 ? /* @__PURE__ */ ke.createElement(sa.Consumer, null, (a) => t(a)) : t(Va);
|
|
2042
2029
|
}
|
|
@@ -2045,7 +2032,7 @@ function bl(s) {
|
|
|
2045
2032
|
}
|
|
2046
2033
|
function yl({ sql: s }) {
|
|
2047
2034
|
return /* @__PURE__ */ e.jsxs(qs, { children: [
|
|
2048
|
-
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2035
|
+
/* @__PURE__ */ e.jsx(Rs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
2049
2036
|
/* @__PURE__ */ e.jsx(
|
|
2050
2037
|
_s,
|
|
2051
2038
|
{
|
|
@@ -2063,49 +2050,49 @@ function vl() {
|
|
|
2063
2050
|
const [s, t] = V({
|
|
2064
2051
|
queryKey: [],
|
|
2065
2052
|
queryData: null
|
|
2066
|
-
}), { theme: a } = bt(), n = yt(), l =
|
|
2067
|
-
|
|
2068
|
-
const y = m((
|
|
2069
|
-
|
|
2053
|
+
}), { theme: a } = bt(), n = yt(), l = zs(), r = vt(), [u, o] = V(!1), [c, p] = V(!1), [d, b] = V(!1), [j, h] = V(""), [g, C] = V(!1), O = I((i) => i.selectedSheetId);
|
|
2054
|
+
I((i) => i.dashboard.baseQueries);
|
|
2055
|
+
const y = m((i) => i.card), L = I((i) => i.theme), D = m((i) => i.isShowingVisual);
|
|
2056
|
+
I((i) => i.onAcceptChanges);
|
|
2070
2057
|
const A = m(
|
|
2071
|
-
(
|
|
2058
|
+
(i) => i.selectedConnectionId
|
|
2072
2059
|
), N = m(
|
|
2073
|
-
(
|
|
2074
|
-
),
|
|
2075
|
-
(
|
|
2060
|
+
(i) => i.selectedDatabaseName
|
|
2061
|
+
), F = m(
|
|
2062
|
+
(i) => i.selectedDatamodelId
|
|
2076
2063
|
), E = m(
|
|
2077
|
-
(
|
|
2064
|
+
(i) => i.selectedSchemaName
|
|
2078
2065
|
);
|
|
2079
|
-
|
|
2080
|
-
(
|
|
2066
|
+
I(
|
|
2067
|
+
(i) => i.actions.updateFrameCard
|
|
2081
2068
|
);
|
|
2082
|
-
const x = m((
|
|
2083
|
-
(
|
|
2084
|
-
), U =
|
|
2085
|
-
(
|
|
2086
|
-
), Z = m((
|
|
2069
|
+
const x = m((i) => i.selectedTableName), v = m((i) => i.card.sql), f = m((i) => i.card.python), k = m((i) => i.frame), S = I((i) => i.dashboard.filters), q = I((i) => i.filterValues), $ = S == null ? void 0 : S.filter(
|
|
2070
|
+
(i) => i.sheetId === O || !i.sheetId
|
|
2071
|
+
), U = q == null ? void 0 : q.filter(
|
|
2072
|
+
(i) => ($ == null ? void 0 : $.some((le) => le.id === i.filterId)) || i.filterId.endsWith(O)
|
|
2073
|
+
), Z = m((i) => i.applyFilters), {
|
|
2087
2074
|
setCardCustomCfg: B,
|
|
2088
2075
|
setQueryResultColumns: X,
|
|
2089
2076
|
setFilterValues: w,
|
|
2090
2077
|
setCardSql: H,
|
|
2091
2078
|
setCard: ae,
|
|
2092
|
-
setCardPython:
|
|
2093
|
-
setQueryError:
|
|
2079
|
+
setCardPython: M,
|
|
2080
|
+
setQueryError: T,
|
|
2094
2081
|
setPythonStdOut: te,
|
|
2095
2082
|
setCardPreferences: P
|
|
2096
|
-
} = m((
|
|
2083
|
+
} = m((i) => i.actions), ee = m((i) => i.onSave);
|
|
2097
2084
|
m(
|
|
2098
|
-
(
|
|
2085
|
+
(i) => i.actions.setApplyFilters
|
|
2099
2086
|
);
|
|
2100
|
-
const ne = m((
|
|
2101
|
-
m((
|
|
2087
|
+
const ne = m((i) => i.onClose), Ee = m((i) => i.actions.setSqlGen), Ie = m((i) => i.runSql), je = m((i) => i.actions.setRunSql);
|
|
2088
|
+
m((i) => i.actions.setCardCfg);
|
|
2102
2089
|
const be = m(
|
|
2103
|
-
(
|
|
2090
|
+
(i) => i.actions.setIsSqlRunning
|
|
2104
2091
|
), {
|
|
2105
2092
|
data: W,
|
|
2106
2093
|
isLoading: oe,
|
|
2107
2094
|
isFetching: ce,
|
|
2108
|
-
isSuccess:
|
|
2095
|
+
isSuccess: De,
|
|
2109
2096
|
isError: Ae,
|
|
2110
2097
|
error: $e,
|
|
2111
2098
|
queryKey: Pe,
|
|
@@ -2116,8 +2103,8 @@ function vl() {
|
|
|
2116
2103
|
position: "top-center",
|
|
2117
2104
|
richColors: !0
|
|
2118
2105
|
}), te((W == null ? void 0 : W.output) || ""), W.records.length > 0)) {
|
|
2119
|
-
const { dimensionKeys:
|
|
2120
|
-
X(
|
|
2106
|
+
const { dimensionKeys: i } = ws(W.records);
|
|
2107
|
+
X(i);
|
|
2121
2108
|
}
|
|
2122
2109
|
}, [
|
|
2123
2110
|
W,
|
|
@@ -2125,66 +2112,66 @@ function vl() {
|
|
|
2125
2112
|
X,
|
|
2126
2113
|
te
|
|
2127
2114
|
]), se(() => {
|
|
2128
|
-
(oe || ce) && be(!0), (Ae ||
|
|
2115
|
+
(oe || ce) && be(!0), (Ae || De) && be(!1), Ae ? (T($e.message), X([]), te("")) : T("");
|
|
2129
2116
|
}, [
|
|
2130
2117
|
oe,
|
|
2131
2118
|
ce,
|
|
2132
2119
|
W,
|
|
2133
2120
|
te,
|
|
2134
2121
|
Ae,
|
|
2135
|
-
|
|
2122
|
+
De,
|
|
2136
2123
|
be,
|
|
2137
2124
|
X,
|
|
2138
|
-
|
|
2125
|
+
T,
|
|
2139
2126
|
$e
|
|
2140
2127
|
]), se(() => {
|
|
2141
2128
|
Ie && (Ve(), je(!1));
|
|
2142
2129
|
}, [Ie, Ve, je]);
|
|
2143
|
-
function
|
|
2144
|
-
const
|
|
2130
|
+
function vs() {
|
|
2131
|
+
const i = n.getQueryData(Pe);
|
|
2145
2132
|
s.queryData || t({
|
|
2146
2133
|
queryKey: Pe,
|
|
2147
|
-
queryData:
|
|
2134
|
+
queryData: i
|
|
2148
2135
|
}), n.setQueryData(Pe, null), H(""), Ee({}), B(""), P({});
|
|
2149
2136
|
}
|
|
2150
|
-
const Xe = (
|
|
2151
|
-
l.current =
|
|
2137
|
+
const Xe = (i) => {
|
|
2138
|
+
l.current = i;
|
|
2152
2139
|
};
|
|
2153
|
-
function Ze(
|
|
2154
|
-
if (
|
|
2140
|
+
function Ze(i, le) {
|
|
2141
|
+
if (i.length === 0)
|
|
2155
2142
|
return "";
|
|
2156
2143
|
if (le) {
|
|
2157
|
-
const ye =
|
|
2144
|
+
const ye = i.find((ve) => ve.id === le);
|
|
2158
2145
|
if (ye) {
|
|
2159
2146
|
const ve = ye.tabTitle;
|
|
2160
2147
|
if (ve == "All__Header")
|
|
2161
|
-
return
|
|
2148
|
+
return i[0].id;
|
|
2162
2149
|
if (ve && ve.endsWith("__Header")) {
|
|
2163
|
-
const Za = ve.split("__")[0], Js =
|
|
2150
|
+
const Za = ve.split("__")[0], Js = i.find(
|
|
2164
2151
|
(et) => et.tabTitle === Za
|
|
2165
2152
|
);
|
|
2166
|
-
return Js ? Js.id :
|
|
2153
|
+
return Js ? Js.id : i[0].id;
|
|
2167
2154
|
}
|
|
2168
2155
|
return le;
|
|
2169
2156
|
}
|
|
2170
2157
|
}
|
|
2171
|
-
return
|
|
2158
|
+
return i[0].id;
|
|
2172
2159
|
}
|
|
2173
2160
|
function es() {
|
|
2174
|
-
let
|
|
2175
|
-
v && !v.includes("{{") && (
|
|
2161
|
+
let i = v;
|
|
2162
|
+
v && !v.includes("{{") && (i = ol(v), H(i));
|
|
2176
2163
|
const le = {
|
|
2177
2164
|
...y,
|
|
2178
2165
|
lastSelectedSchema: E,
|
|
2179
|
-
lastSelectedDatamodelId:
|
|
2166
|
+
lastSelectedDatamodelId: F,
|
|
2180
2167
|
lastSelectedDatabase: N,
|
|
2181
2168
|
lastSelectedTable: x,
|
|
2182
2169
|
connectionId: A,
|
|
2183
|
-
type:
|
|
2184
|
-
sql:
|
|
2185
|
-
customCfg:
|
|
2170
|
+
type: D ? y.type : "table",
|
|
2171
|
+
sql: i,
|
|
2172
|
+
customCfg: D ? y.customCfg : null
|
|
2186
2173
|
}, ye = k.cards.map(
|
|
2187
|
-
(
|
|
2174
|
+
(Cs) => Cs.id === y.id ? le : Cs
|
|
2188
2175
|
), ve = {
|
|
2189
2176
|
...k,
|
|
2190
2177
|
cards: ye,
|
|
@@ -2193,13 +2180,13 @@ function vl() {
|
|
|
2193
2180
|
ee == null || ee(ve);
|
|
2194
2181
|
}
|
|
2195
2182
|
function ss() {
|
|
2196
|
-
const { queryKey:
|
|
2197
|
-
|
|
2183
|
+
const { queryKey: i, queryData: le } = s;
|
|
2184
|
+
i && le && n.setQueryData(i, le), ne == null || ne();
|
|
2198
2185
|
}
|
|
2199
2186
|
se(() => {
|
|
2200
|
-
if (!
|
|
2201
|
-
const
|
|
2202
|
-
return
|
|
2187
|
+
if (!r) return;
|
|
2188
|
+
const i = l.current, le = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ye = L === "system" ? le : L;
|
|
2189
|
+
return r.editor.defineTheme("default", {
|
|
2203
2190
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2204
2191
|
base: ye === "light" ? "vs" : "vs-dark",
|
|
2205
2192
|
inherit: !0,
|
|
@@ -2211,14 +2198,14 @@ function vl() {
|
|
|
2211
2198
|
// ? '#ffffff'
|
|
2212
2199
|
// : getCssVariableValue('--semaphor-background'),
|
|
2213
2200
|
}
|
|
2214
|
-
}),
|
|
2215
|
-
|
|
2201
|
+
}), r.editor.setTheme("default"), i && r && i.addCommand(
|
|
2202
|
+
r.KeyMod.Shift | r.KeyCode.Enter,
|
|
2216
2203
|
function() {
|
|
2217
2204
|
return Ve(), !1;
|
|
2218
2205
|
}
|
|
2219
2206
|
), () => {
|
|
2220
2207
|
};
|
|
2221
|
-
}, [a,
|
|
2208
|
+
}, [a, L, r]);
|
|
2222
2209
|
function as() {
|
|
2223
2210
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2224
2211
|
c && /* @__PURE__ */ e.jsx(
|
|
@@ -2241,10 +2228,10 @@ function vl() {
|
|
|
2241
2228
|
Ge,
|
|
2242
2229
|
{
|
|
2243
2230
|
theme: "default",
|
|
2244
|
-
onChange: (
|
|
2245
|
-
if (
|
|
2231
|
+
onChange: (i) => {
|
|
2232
|
+
if (i)
|
|
2246
2233
|
try {
|
|
2247
|
-
JSON.parse(
|
|
2234
|
+
JSON.parse(i), w(JSON.parse(i));
|
|
2248
2235
|
} catch {
|
|
2249
2236
|
}
|
|
2250
2237
|
},
|
|
@@ -2267,7 +2254,7 @@ function vl() {
|
|
|
2267
2254
|
renderLineHighlight: "none"
|
|
2268
2255
|
}
|
|
2269
2256
|
},
|
|
2270
|
-
|
|
2257
|
+
L
|
|
2271
2258
|
)
|
|
2272
2259
|
] })
|
|
2273
2260
|
}
|
|
@@ -2299,7 +2286,7 @@ function vl() {
|
|
|
2299
2286
|
{
|
|
2300
2287
|
id: "1",
|
|
2301
2288
|
order: 1,
|
|
2302
|
-
defaultSize:
|
|
2289
|
+
defaultSize: u ? 20 : 100,
|
|
2303
2290
|
className: "relative flex grow",
|
|
2304
2291
|
children: [
|
|
2305
2292
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2312,8 +2299,8 @@ function vl() {
|
|
|
2312
2299
|
{
|
|
2313
2300
|
theme: "default",
|
|
2314
2301
|
className: "pt-3",
|
|
2315
|
-
onChange: (
|
|
2316
|
-
H(
|
|
2302
|
+
onChange: (i) => {
|
|
2303
|
+
H(i);
|
|
2317
2304
|
},
|
|
2318
2305
|
value: v,
|
|
2319
2306
|
options: {
|
|
@@ -2334,11 +2321,11 @@ function vl() {
|
|
|
2334
2321
|
)
|
|
2335
2322
|
}
|
|
2336
2323
|
),
|
|
2337
|
-
|
|
2324
|
+
u && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-sm text-muted-foreground/70", children: "sql" })
|
|
2338
2325
|
]
|
|
2339
2326
|
}
|
|
2340
2327
|
),
|
|
2341
|
-
|
|
2328
|
+
u && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2342
2329
|
/* @__PURE__ */ e.jsx(ds, { withHandle: !0, className: "border" }),
|
|
2343
2330
|
/* @__PURE__ */ e.jsxs(
|
|
2344
2331
|
Ne,
|
|
@@ -2358,8 +2345,8 @@ function vl() {
|
|
|
2358
2345
|
{
|
|
2359
2346
|
className: "pt-3",
|
|
2360
2347
|
theme: "default",
|
|
2361
|
-
onChange: (
|
|
2362
|
-
|
|
2348
|
+
onChange: (i) => {
|
|
2349
|
+
M(i && i.trim() || "");
|
|
2363
2350
|
},
|
|
2364
2351
|
value: f || St,
|
|
2365
2352
|
options: {
|
|
@@ -2416,7 +2403,7 @@ function vl() {
|
|
|
2416
2403
|
children: [
|
|
2417
2404
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2418
2405
|
/* @__PURE__ */ e.jsxs(
|
|
2419
|
-
|
|
2406
|
+
z,
|
|
2420
2407
|
{
|
|
2421
2408
|
title: "Shift + Enter",
|
|
2422
2409
|
disabled: oe || ce,
|
|
@@ -2442,9 +2429,9 @@ function vl() {
|
|
|
2442
2429
|
}
|
|
2443
2430
|
),
|
|
2444
2431
|
/* @__PURE__ */ e.jsxs(
|
|
2445
|
-
|
|
2432
|
+
z,
|
|
2446
2433
|
{
|
|
2447
|
-
onClick:
|
|
2434
|
+
onClick: vs,
|
|
2448
2435
|
className: "",
|
|
2449
2436
|
size: "sm",
|
|
2450
2437
|
variant: "outline",
|
|
@@ -2457,8 +2444,8 @@ function vl() {
|
|
|
2457
2444
|
/* @__PURE__ */ e.jsx(
|
|
2458
2445
|
fa,
|
|
2459
2446
|
{
|
|
2460
|
-
pressed:
|
|
2461
|
-
onPressedChange: (
|
|
2447
|
+
pressed: u,
|
|
2448
|
+
onPressedChange: (i) => o(i),
|
|
2462
2449
|
className: "",
|
|
2463
2450
|
size: "sm",
|
|
2464
2451
|
variant: "outline",
|
|
@@ -2468,19 +2455,19 @@ function vl() {
|
|
|
2468
2455
|
/* @__PURE__ */ e.jsx(
|
|
2469
2456
|
ul,
|
|
2470
2457
|
{
|
|
2471
|
-
open:
|
|
2458
|
+
open: d,
|
|
2472
2459
|
setOpen: b,
|
|
2473
|
-
userInput:
|
|
2474
|
-
triggerAIRun:
|
|
2460
|
+
userInput: j,
|
|
2461
|
+
triggerAIRun: g,
|
|
2475
2462
|
setTriggerAIRun: C,
|
|
2476
|
-
setUserInput: (
|
|
2463
|
+
setUserInput: (i) => h(i)
|
|
2477
2464
|
}
|
|
2478
2465
|
)
|
|
2479
2466
|
] }),
|
|
2480
2467
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2481
2468
|
(W == null ? void 0 : W.sql) && /* @__PURE__ */ e.jsx(yl, { sql: W.sql }),
|
|
2482
2469
|
/* @__PURE__ */ e.jsxs(
|
|
2483
|
-
|
|
2470
|
+
z,
|
|
2484
2471
|
{
|
|
2485
2472
|
onClick: ss,
|
|
2486
2473
|
className: "w-full",
|
|
@@ -2493,7 +2480,7 @@ function vl() {
|
|
|
2493
2480
|
}
|
|
2494
2481
|
),
|
|
2495
2482
|
/* @__PURE__ */ e.jsxs(
|
|
2496
|
-
|
|
2483
|
+
z,
|
|
2497
2484
|
{
|
|
2498
2485
|
onClick: es,
|
|
2499
2486
|
size: "sm",
|
|
@@ -2514,7 +2501,7 @@ function vl() {
|
|
|
2514
2501
|
);
|
|
2515
2502
|
}
|
|
2516
2503
|
function Cl({ data: s }) {
|
|
2517
|
-
var
|
|
2504
|
+
var u;
|
|
2518
2505
|
const [t, a] = ke.useState([]), l = Object.keys(s[0]).map((o) => ({
|
|
2519
2506
|
// header: key,
|
|
2520
2507
|
accessorKey: o,
|
|
@@ -2532,20 +2519,20 @@ function Cl({ data: s }) {
|
|
|
2532
2519
|
}
|
|
2533
2520
|
) });
|
|
2534
2521
|
}
|
|
2535
|
-
})),
|
|
2522
|
+
})), r = zt({
|
|
2536
2523
|
data: s,
|
|
2537
2524
|
columns: l,
|
|
2538
|
-
getCoreRowModel:
|
|
2539
|
-
getPaginationRowModel:
|
|
2525
|
+
getCoreRowModel: Ft(),
|
|
2526
|
+
getPaginationRowModel: Tt(),
|
|
2540
2527
|
onSortingChange: a,
|
|
2541
|
-
getSortedRowModel:
|
|
2528
|
+
getSortedRowModel: Lt(),
|
|
2542
2529
|
manualPagination: !0,
|
|
2543
2530
|
state: {
|
|
2544
2531
|
sorting: t
|
|
2545
2532
|
}
|
|
2546
2533
|
});
|
|
2547
2534
|
return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
|
|
2548
|
-
/* @__PURE__ */ e.jsx(Ot, { children:
|
|
2535
|
+
/* @__PURE__ */ e.jsx(Ot, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(Ns, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
|
|
2549
2536
|
It,
|
|
2550
2537
|
{
|
|
2551
2538
|
className: "sticky top-0 h-11 bg-muted font-semibold",
|
|
@@ -2556,70 +2543,70 @@ function Cl({ data: s }) {
|
|
|
2556
2543
|
},
|
|
2557
2544
|
c.id
|
|
2558
2545
|
)) }, o.id)) }),
|
|
2559
|
-
/* @__PURE__ */ e.jsx(
|
|
2560
|
-
|
|
2546
|
+
/* @__PURE__ */ e.jsx(Dt, { children: (u = r.getRowModel().rows) != null && u.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
|
|
2547
|
+
Ns,
|
|
2561
2548
|
{
|
|
2562
2549
|
className: "whitespace-nowrap py-2",
|
|
2563
2550
|
"data-state": o.getIsSelected() && "selected",
|
|
2564
2551
|
children: o.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Ys, { className: "py-3", children: Ws(c.column.columnDef.cell, c.getContext()) }, c.id))
|
|
2565
2552
|
},
|
|
2566
2553
|
o.id
|
|
2567
|
-
)) : /* @__PURE__ */ e.jsx(
|
|
2554
|
+
)) : /* @__PURE__ */ e.jsx(Ns, { children: /* @__PURE__ */ e.jsx(Ys, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2568
2555
|
] }) });
|
|
2569
2556
|
}
|
|
2570
2557
|
function Nl({ card: s }) {
|
|
2571
|
-
var y,
|
|
2558
|
+
var y, L, D, A, N, F, E, x, v, f, k;
|
|
2572
2559
|
const [t, a] = V(!1), [n, l] = V(
|
|
2573
2560
|
[]
|
|
2574
|
-
), { authToken:
|
|
2575
|
-
colors: ((
|
|
2561
|
+
), { authToken: r } = Oe(), u = Mt(r == null ? void 0 : r.accessToken), o = I((S) => S.themeStyle), c = {
|
|
2562
|
+
colors: ((L = (y = o == null ? void 0 : o.chart) == null ? void 0 : y.dataset) == null ? void 0 : L.backgroundColor) || []
|
|
2576
2563
|
};
|
|
2577
|
-
(
|
|
2578
|
-
const { getCard: p } = ba(((A = s.customCardPreferences) == null ? void 0 : A.url) || ""),
|
|
2564
|
+
(D = s.customCardPreferences) != null && D.inputData;
|
|
2565
|
+
const { getCard: p } = ba(((A = s.customCardPreferences) == null ? void 0 : A.url) || ""), d = ((N = s.customCardPreferences) == null ? void 0 : N.visualType) || "single", b = m((S) => S.frame);
|
|
2579
2566
|
ie();
|
|
2580
|
-
const { data:
|
|
2567
|
+
const { data: j } = Re(s), h = Sn((S, q) => {
|
|
2581
2568
|
l(($) => ({
|
|
2582
2569
|
...$,
|
|
2583
|
-
[S]:
|
|
2570
|
+
[S]: q
|
|
2584
2571
|
}));
|
|
2585
2572
|
}, []);
|
|
2586
|
-
if (!((
|
|
2573
|
+
if (!((F = s.customCardPreferences) != null && F.componentName))
|
|
2587
2574
|
return null;
|
|
2588
|
-
const
|
|
2575
|
+
const g = p(
|
|
2589
2576
|
(E = s.customCardPreferences) == null ? void 0 : E.componentName
|
|
2590
2577
|
);
|
|
2591
2578
|
function C(S) {
|
|
2592
2579
|
a(S);
|
|
2593
2580
|
}
|
|
2594
|
-
const
|
|
2581
|
+
const O = Object.keys(
|
|
2595
2582
|
((x = s.customCardPreferences) == null ? void 0 : x.dataInputCardIds) || {}
|
|
2596
2583
|
).map((S) => {
|
|
2597
2584
|
var U, Z, B;
|
|
2598
|
-
const
|
|
2585
|
+
const q = (Z = (U = s.customCardPreferences) == null ? void 0 : U.dataInputCardIds) == null ? void 0 : Z[S].cardId, $ = (B = b == null ? void 0 : b.cards) == null ? void 0 : B.find((X) => X.id === q);
|
|
2599
2586
|
return $ || null;
|
|
2600
2587
|
});
|
|
2601
2588
|
return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
|
|
2602
|
-
|
|
2589
|
+
wn,
|
|
2603
2590
|
{
|
|
2604
2591
|
fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
|
|
2605
2592
|
children: [
|
|
2606
|
-
|
|
2607
|
-
|
|
2593
|
+
g && d === "single" && /* @__PURE__ */ e.jsx(
|
|
2594
|
+
g,
|
|
2608
2595
|
{
|
|
2609
|
-
params:
|
|
2596
|
+
params: u,
|
|
2610
2597
|
theme: c,
|
|
2611
2598
|
settings: (v = s.customCardPreferences) == null ? void 0 : v.settings,
|
|
2612
2599
|
onDataChange: h,
|
|
2613
|
-
data: (
|
|
2600
|
+
data: (j == null ? void 0 : j.records) || []
|
|
2614
2601
|
}
|
|
2615
2602
|
),
|
|
2616
|
-
|
|
2603
|
+
g && d === "multiple" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2617
2604
|
Object.keys(
|
|
2618
2605
|
((f = s.customCardPreferences) == null ? void 0 : f.dataInputCardIds) || {}
|
|
2619
2606
|
).map((S) => {
|
|
2620
2607
|
var U, Z, B;
|
|
2621
|
-
const
|
|
2622
|
-
(X) => X.id ===
|
|
2608
|
+
const q = (Z = (U = s.customCardPreferences) == null ? void 0 : U.dataInputCardIds) == null ? void 0 : Z[S].cardId, $ = (B = b == null ? void 0 : b.cards) == null ? void 0 : B.find(
|
|
2609
|
+
(X) => X.id === q
|
|
2623
2610
|
);
|
|
2624
2611
|
if ($)
|
|
2625
2612
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -2634,17 +2621,17 @@ function Nl({ card: s }) {
|
|
|
2634
2621
|
);
|
|
2635
2622
|
}),
|
|
2636
2623
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2637
|
-
|
|
2624
|
+
g,
|
|
2638
2625
|
{
|
|
2639
2626
|
theme: c,
|
|
2640
2627
|
onDataChange: h,
|
|
2641
|
-
settings:
|
|
2628
|
+
settings: O.map(
|
|
2642
2629
|
(S) => {
|
|
2643
|
-
var
|
|
2644
|
-
return (
|
|
2630
|
+
var q;
|
|
2631
|
+
return (q = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : q.settings;
|
|
2645
2632
|
}
|
|
2646
2633
|
),
|
|
2647
|
-
data:
|
|
2634
|
+
data: O.map((S) => S != null && S.id ? n == null ? void 0 : n[S.id] : [])
|
|
2648
2635
|
}
|
|
2649
2636
|
) })
|
|
2650
2637
|
] })
|
|
@@ -2659,10 +2646,10 @@ function Ra({
|
|
|
2659
2646
|
className: s,
|
|
2660
2647
|
...t
|
|
2661
2648
|
}) {
|
|
2662
|
-
var
|
|
2663
|
-
const a = m((y) => y.card), n = ((
|
|
2649
|
+
var O;
|
|
2650
|
+
const a = m((y) => y.card), n = ((O = a.customCardPreferences) == null ? void 0 : O.showCardHeader) ?? !0, l = m((y) => y.frame), r = I((y) => y.dashboard.filters);
|
|
2664
2651
|
m((y) => y.actions.setRunSql);
|
|
2665
|
-
const { updateFilter:
|
|
2652
|
+
const { updateFilter: u } = xs(), o = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: c, isLoading: p, isFetching: d } = Re(a), { setCard: b } = ie(), { data: j } = Hs(a);
|
|
2666
2653
|
if (!a.id) return null;
|
|
2667
2654
|
let h;
|
|
2668
2655
|
c != null && c.records && (c == null ? void 0 : c.records.length) > 0 && (h = ya({
|
|
@@ -2671,20 +2658,20 @@ function Ra({
|
|
|
2671
2658
|
cfg: a.cfg,
|
|
2672
2659
|
customCfg: a.customCfg,
|
|
2673
2660
|
preferences: a.preferences,
|
|
2674
|
-
topoJson:
|
|
2661
|
+
topoJson: j
|
|
2675
2662
|
}));
|
|
2676
|
-
function
|
|
2663
|
+
function g(y) {
|
|
2677
2664
|
return /* @__PURE__ */ e.jsx(Nl, { card: y });
|
|
2678
2665
|
}
|
|
2679
2666
|
function C() {
|
|
2680
2667
|
var y;
|
|
2681
|
-
if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !p && !
|
|
2668
|
+
if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !p && !d)
|
|
2682
2669
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
|
|
2683
2670
|
/* @__PURE__ */ e.jsx($t, { className: "size-8 text-muted-foreground" }),
|
|
2684
2671
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
|
|
2685
2672
|
] });
|
|
2686
2673
|
if (a.type === "custom")
|
|
2687
|
-
return
|
|
2674
|
+
return g(a);
|
|
2688
2675
|
if (!["table", "custom"].includes(a.type) && h)
|
|
2689
2676
|
return /* @__PURE__ */ e.jsx(
|
|
2690
2677
|
Pt,
|
|
@@ -2733,7 +2720,7 @@ function Ra({
|
|
|
2733
2720
|
{
|
|
2734
2721
|
className: "my-1",
|
|
2735
2722
|
text: o.title || o.column,
|
|
2736
|
-
onSave: (y) =>
|
|
2723
|
+
onSave: (y) => u({ ...o, title: y }),
|
|
2737
2724
|
children: /* @__PURE__ */ e.jsx(_, { children: o.title })
|
|
2738
2725
|
}
|
|
2739
2726
|
),
|
|
@@ -2746,12 +2733,12 @@ function Ra({
|
|
|
2746
2733
|
);
|
|
2747
2734
|
}
|
|
2748
2735
|
function Sl() {
|
|
2749
|
-
const [s, t] = V(!1), [a, n] = V(""), [l,
|
|
2736
|
+
const [s, t] = V(!1), [a, n] = V(""), [l, r] = V(""), [u, o] = V(""), [c, p] = V(""), d = m((N) => N.card), b = m(
|
|
2750
2737
|
(N) => N.card.customCfg
|
|
2751
|
-
), { data:
|
|
2752
|
-
function
|
|
2738
|
+
), { data: j } = Re(d), { data: h } = Hs(d), { setCardCustomCfg: g, setCustomVisualCode: C } = ie();
|
|
2739
|
+
function O(N) {
|
|
2753
2740
|
var x, v;
|
|
2754
|
-
const
|
|
2741
|
+
const F = {
|
|
2755
2742
|
...N,
|
|
2756
2743
|
data: {
|
|
2757
2744
|
...N == null ? void 0 : N.data,
|
|
@@ -2761,43 +2748,43 @@ function Sl() {
|
|
|
2761
2748
|
}))
|
|
2762
2749
|
}
|
|
2763
2750
|
};
|
|
2764
|
-
return JSON.stringify(
|
|
2751
|
+
return JSON.stringify(F, null, 1);
|
|
2765
2752
|
}
|
|
2766
2753
|
function y() {
|
|
2767
|
-
var
|
|
2768
|
-
if (!(
|
|
2754
|
+
var F, E;
|
|
2755
|
+
if (!(j != null && j.records) || (j == null ? void 0 : j.records.length) === 0) return;
|
|
2769
2756
|
const N = ya({
|
|
2770
|
-
data:
|
|
2771
|
-
cardType:
|
|
2772
|
-
cfg:
|
|
2773
|
-
preferences:
|
|
2757
|
+
data: j == null ? void 0 : j.records,
|
|
2758
|
+
cardType: d.type,
|
|
2759
|
+
cfg: d.cfg,
|
|
2760
|
+
preferences: d.preferences,
|
|
2774
2761
|
topoJson: h
|
|
2775
2762
|
});
|
|
2776
|
-
N && (n(JSON.stringify(N, null, 1)), (
|
|
2763
|
+
N && (n(JSON.stringify(N, null, 1)), (F = d == null ? void 0 : d.preferences) != null && F.customVisualCode && o((E = d == null ? void 0 : d.preferences) == null ? void 0 : E.customVisualCode), b && r(JSON.stringify(b, null, 1)));
|
|
2777
2764
|
}
|
|
2778
|
-
function
|
|
2779
|
-
if (
|
|
2765
|
+
function L() {
|
|
2766
|
+
if (u && C(u), !!l)
|
|
2780
2767
|
try {
|
|
2781
2768
|
const N = JSON.parse(l);
|
|
2782
|
-
return N ? (
|
|
2769
|
+
return N ? (g(N), p(""), r(""), N) : void 0;
|
|
2783
2770
|
} catch (N) {
|
|
2784
2771
|
console.log(N), p("Invalid JSON");
|
|
2785
2772
|
}
|
|
2786
2773
|
}
|
|
2787
|
-
function
|
|
2788
|
-
|
|
2774
|
+
function D() {
|
|
2775
|
+
r(""), g(null);
|
|
2789
2776
|
}
|
|
2790
2777
|
function A() {
|
|
2791
2778
|
let N;
|
|
2792
2779
|
if (b) {
|
|
2793
|
-
const
|
|
2794
|
-
return N =
|
|
2780
|
+
const F = Xs.cloneDeep(d.cfg), E = Xs.merge(F, b);
|
|
2781
|
+
return N = O(E), N;
|
|
2795
2782
|
}
|
|
2796
|
-
return a ? (N =
|
|
2783
|
+
return a ? (N = O(JSON.parse(a)), N) : "";
|
|
2797
2784
|
}
|
|
2798
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2799
|
-
/* @__PURE__ */ e.jsx(
|
|
2800
|
-
|
|
2785
|
+
return /* @__PURE__ */ e.jsxs(Ds, { open: s, onOpenChange: t, children: [
|
|
2786
|
+
/* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2787
|
+
z,
|
|
2801
2788
|
{
|
|
2802
2789
|
onClick: y,
|
|
2803
2790
|
className: ` ${b && "border-foreground/50 dark:border-foreground/70"}`,
|
|
@@ -2807,11 +2794,11 @@ function Sl() {
|
|
|
2807
2794
|
}
|
|
2808
2795
|
) }),
|
|
2809
2796
|
/* @__PURE__ */ e.jsxs(
|
|
2810
|
-
|
|
2797
|
+
Ls,
|
|
2811
2798
|
{
|
|
2812
2799
|
className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
|
|
2813
2800
|
children: [
|
|
2814
|
-
/* @__PURE__ */ e.jsxs(
|
|
2801
|
+
/* @__PURE__ */ e.jsxs(Ms, { className: "", children: [
|
|
2815
2802
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Es, { children: "Customize Card" }) }),
|
|
2816
2803
|
/* @__PURE__ */ e.jsxs(As, { children: [
|
|
2817
2804
|
"See the configuration options and documentation",
|
|
@@ -2827,7 +2814,7 @@ function Sl() {
|
|
|
2827
2814
|
] })
|
|
2828
2815
|
] }),
|
|
2829
2816
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2830
|
-
/* @__PURE__ */ e.jsx(
|
|
2817
|
+
/* @__PURE__ */ e.jsx(ps, { FallbackComponent: va, children: /* @__PURE__ */ e.jsx(Ra, { className: "w-1/2 rounded shadow-none" }) }),
|
|
2831
2818
|
/* @__PURE__ */ e.jsxs(Ca, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2832
2819
|
/* @__PURE__ */ e.jsxs(Na, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2833
2820
|
/* @__PURE__ */ e.jsxs(is, { value: "custom-config", children: [
|
|
@@ -2876,7 +2863,7 @@ function Sl() {
|
|
|
2876
2863
|
},
|
|
2877
2864
|
defaultLanguage: "json",
|
|
2878
2865
|
value: A(),
|
|
2879
|
-
onChange: (N) =>
|
|
2866
|
+
onChange: (N) => r(N)
|
|
2880
2867
|
}
|
|
2881
2868
|
)
|
|
2882
2869
|
}
|
|
@@ -2904,7 +2891,7 @@ function Sl() {
|
|
|
2904
2891
|
renderLineHighlight: "none"
|
|
2905
2892
|
},
|
|
2906
2893
|
defaultLanguage: "javascript",
|
|
2907
|
-
value:
|
|
2894
|
+
value: u,
|
|
2908
2895
|
onChange: (N) => o(N || "")
|
|
2909
2896
|
}
|
|
2910
2897
|
)
|
|
@@ -2915,16 +2902,16 @@ function Sl() {
|
|
|
2915
2902
|
/* @__PURE__ */ e.jsxs(la, { className: "flex items-center", children: [
|
|
2916
2903
|
/* @__PURE__ */ e.jsx(_, { className: "mr-2 text-red-500", children: c }),
|
|
2917
2904
|
/* @__PURE__ */ e.jsx(
|
|
2918
|
-
|
|
2905
|
+
z,
|
|
2919
2906
|
{
|
|
2920
2907
|
disabled: !b,
|
|
2921
|
-
onClick:
|
|
2908
|
+
onClick: D,
|
|
2922
2909
|
variant: "outline",
|
|
2923
2910
|
children: "Reset"
|
|
2924
2911
|
}
|
|
2925
2912
|
),
|
|
2926
|
-
/* @__PURE__ */ e.jsx(
|
|
2927
|
-
/* @__PURE__ */ e.jsx(
|
|
2913
|
+
/* @__PURE__ */ e.jsx(z, { onClick: L, variant: "outline", children: "Apply" }),
|
|
2914
|
+
/* @__PURE__ */ e.jsx(z, { onClick: () => t(!1), variant: "outline", children: "Close" })
|
|
2928
2915
|
] })
|
|
2929
2916
|
]
|
|
2930
2917
|
}
|
|
@@ -2959,8 +2946,8 @@ function Ja(s) {
|
|
|
2959
2946
|
const [t, a] = V(null);
|
|
2960
2947
|
return se(() => {
|
|
2961
2948
|
s && (async () => {
|
|
2962
|
-
const
|
|
2963
|
-
a(
|
|
2949
|
+
const r = (await import("./lucide-react-DN-djCId.js"))[s];
|
|
2950
|
+
a(r);
|
|
2964
2951
|
})();
|
|
2965
2952
|
}, [s]), t;
|
|
2966
2953
|
}
|
|
@@ -2978,10 +2965,10 @@ function wl({
|
|
|
2978
2965
|
const [t, a] = V([]), { data: n } = Ka();
|
|
2979
2966
|
return se(() => {
|
|
2980
2967
|
(async () => {
|
|
2981
|
-
var
|
|
2968
|
+
var r;
|
|
2982
2969
|
if (n) {
|
|
2983
2970
|
const o = (await Promise.all(
|
|
2984
|
-
(
|
|
2971
|
+
(r = n == null ? void 0 : n.plugins) == null ? void 0 : r.map(async (c) => (await Qt(c.value)).visuals.map((b) => ({
|
|
2985
2972
|
name: b.name,
|
|
2986
2973
|
icon: b.icon,
|
|
2987
2974
|
url: c.value
|
|
@@ -2992,14 +2979,14 @@ function wl({
|
|
|
2992
2979
|
})();
|
|
2993
2980
|
}, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2994
2981
|
/* @__PURE__ */ e.jsx(we, { className: "my-2" }),
|
|
2995
|
-
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l,
|
|
2982
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, r) => /* @__PURE__ */ e.jsx(
|
|
2996
2983
|
kl,
|
|
2997
2984
|
{
|
|
2998
2985
|
text: l.name,
|
|
2999
2986
|
onClick: () => s("custom", l),
|
|
3000
2987
|
icon: l.icon
|
|
3001
2988
|
},
|
|
3002
|
-
l.url + l.name +
|
|
2989
|
+
l.url + l.name + r
|
|
3003
2990
|
)) })
|
|
3004
2991
|
] });
|
|
3005
2992
|
}
|
|
@@ -3009,13 +2996,13 @@ const kl = ({
|
|
|
3009
2996
|
onClick: a
|
|
3010
2997
|
}) => {
|
|
3011
2998
|
const n = Ja(t || ""), l = s.charAt(0).toUpperCase();
|
|
3012
|
-
return /* @__PURE__ */ e.jsx(
|
|
2999
|
+
return /* @__PURE__ */ e.jsx(z, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
|
|
3013
3000
|
};
|
|
3014
3001
|
function zl() {
|
|
3015
|
-
var
|
|
3016
|
-
const [s, t] = V(!1), a = m((
|
|
3017
|
-
function p(
|
|
3018
|
-
o(null),
|
|
3002
|
+
var d, b;
|
|
3003
|
+
const [s, t] = V(!1), a = m((j) => j.card), n = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: u } = m((j) => j.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = ie();
|
|
3004
|
+
function p(j, h) {
|
|
3005
|
+
o(null), r({}), l(j), h && c({
|
|
3019
3006
|
type: "component",
|
|
3020
3007
|
visualType: "single",
|
|
3021
3008
|
url: h.url,
|
|
@@ -3023,20 +3010,20 @@ function zl() {
|
|
|
3023
3010
|
icon: h.icon
|
|
3024
3011
|
}), t(!1);
|
|
3025
3012
|
}
|
|
3026
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3027
|
-
/* @__PURE__ */ e.jsx(
|
|
3013
|
+
return /* @__PURE__ */ e.jsxs(fs, { open: s, onOpenChange: t, children: [
|
|
3014
|
+
/* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
3028
3015
|
Ol,
|
|
3029
3016
|
{
|
|
3030
3017
|
className: "h-4 w-4",
|
|
3031
3018
|
chartType: n,
|
|
3032
|
-
customIcon: (
|
|
3019
|
+
customIcon: (d = a.customCardPreferences) == null ? void 0 : d.icon,
|
|
3033
3020
|
componentName: (b = a.customCardPreferences) == null ? void 0 : b.componentName
|
|
3034
3021
|
}
|
|
3035
3022
|
) }) }),
|
|
3036
|
-
/* @__PURE__ */ e.jsxs(
|
|
3023
|
+
/* @__PURE__ */ e.jsxs(js, { className: "w-50", children: [
|
|
3037
3024
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
|
|
3038
3025
|
/* @__PURE__ */ e.jsx(
|
|
3039
|
-
|
|
3026
|
+
z,
|
|
3040
3027
|
{
|
|
3041
3028
|
onClick: () => p("bar"),
|
|
3042
3029
|
className: "font-normal",
|
|
@@ -3045,7 +3032,7 @@ function zl() {
|
|
|
3045
3032
|
}
|
|
3046
3033
|
),
|
|
3047
3034
|
/* @__PURE__ */ e.jsx(
|
|
3048
|
-
|
|
3035
|
+
z,
|
|
3049
3036
|
{
|
|
3050
3037
|
onClick: () => p("line"),
|
|
3051
3038
|
variant: "ghost",
|
|
@@ -3053,7 +3040,7 @@ function zl() {
|
|
|
3053
3040
|
}
|
|
3054
3041
|
),
|
|
3055
3042
|
/* @__PURE__ */ e.jsx(
|
|
3056
|
-
|
|
3043
|
+
z,
|
|
3057
3044
|
{
|
|
3058
3045
|
onClick: () => p("stackedBar"),
|
|
3059
3046
|
variant: "ghost",
|
|
@@ -3061,7 +3048,7 @@ function zl() {
|
|
|
3061
3048
|
}
|
|
3062
3049
|
),
|
|
3063
3050
|
/* @__PURE__ */ e.jsx(
|
|
3064
|
-
|
|
3051
|
+
z,
|
|
3065
3052
|
{
|
|
3066
3053
|
onClick: () => p("stackedLine"),
|
|
3067
3054
|
variant: "ghost",
|
|
@@ -3069,15 +3056,15 @@ function zl() {
|
|
|
3069
3056
|
}
|
|
3070
3057
|
),
|
|
3071
3058
|
/* @__PURE__ */ e.jsx(
|
|
3072
|
-
|
|
3059
|
+
z,
|
|
3073
3060
|
{
|
|
3074
3061
|
onClick: () => p("scatter"),
|
|
3075
3062
|
variant: "ghost",
|
|
3076
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3063
|
+
children: /* @__PURE__ */ e.jsx(Da, { className: "size-5" })
|
|
3077
3064
|
}
|
|
3078
3065
|
),
|
|
3079
3066
|
/* @__PURE__ */ e.jsx(
|
|
3080
|
-
|
|
3067
|
+
z,
|
|
3081
3068
|
{
|
|
3082
3069
|
onClick: () => p("bubble"),
|
|
3083
3070
|
variant: "ghost",
|
|
@@ -3085,7 +3072,7 @@ function zl() {
|
|
|
3085
3072
|
}
|
|
3086
3073
|
),
|
|
3087
3074
|
/* @__PURE__ */ e.jsx(
|
|
3088
|
-
|
|
3075
|
+
z,
|
|
3089
3076
|
{
|
|
3090
3077
|
onClick: () => p("pie"),
|
|
3091
3078
|
variant: "ghost",
|
|
@@ -3093,7 +3080,7 @@ function zl() {
|
|
|
3093
3080
|
}
|
|
3094
3081
|
),
|
|
3095
3082
|
/* @__PURE__ */ e.jsx(
|
|
3096
|
-
|
|
3083
|
+
z,
|
|
3097
3084
|
{
|
|
3098
3085
|
onClick: () => p("doughnut"),
|
|
3099
3086
|
variant: "ghost",
|
|
@@ -3101,7 +3088,7 @@ function zl() {
|
|
|
3101
3088
|
}
|
|
3102
3089
|
),
|
|
3103
3090
|
/* @__PURE__ */ e.jsx(
|
|
3104
|
-
|
|
3091
|
+
z,
|
|
3105
3092
|
{
|
|
3106
3093
|
onClick: () => p("radar"),
|
|
3107
3094
|
variant: "ghost",
|
|
@@ -3115,7 +3102,7 @@ function zl() {
|
|
|
3115
3102
|
}
|
|
3116
3103
|
),
|
|
3117
3104
|
/* @__PURE__ */ e.jsx(
|
|
3118
|
-
|
|
3105
|
+
z,
|
|
3119
3106
|
{
|
|
3120
3107
|
onClick: () => p("polarArea"),
|
|
3121
3108
|
variant: "ghost",
|
|
@@ -3123,7 +3110,7 @@ function zl() {
|
|
|
3123
3110
|
}
|
|
3124
3111
|
),
|
|
3125
3112
|
/* @__PURE__ */ e.jsx(
|
|
3126
|
-
|
|
3113
|
+
z,
|
|
3127
3114
|
{
|
|
3128
3115
|
onClick: () => p("pyramid"),
|
|
3129
3116
|
variant: "ghost",
|
|
@@ -3131,7 +3118,7 @@ function zl() {
|
|
|
3131
3118
|
}
|
|
3132
3119
|
),
|
|
3133
3120
|
/* @__PURE__ */ e.jsx(
|
|
3134
|
-
|
|
3121
|
+
z,
|
|
3135
3122
|
{
|
|
3136
3123
|
onClick: () => p("range"),
|
|
3137
3124
|
variant: "ghost",
|
|
@@ -3139,7 +3126,7 @@ function zl() {
|
|
|
3139
3126
|
}
|
|
3140
3127
|
),
|
|
3141
3128
|
/* @__PURE__ */ e.jsx(
|
|
3142
|
-
|
|
3129
|
+
z,
|
|
3143
3130
|
{
|
|
3144
3131
|
onClick: () => p("table"),
|
|
3145
3132
|
variant: "ghost",
|
|
@@ -3147,7 +3134,7 @@ function zl() {
|
|
|
3147
3134
|
}
|
|
3148
3135
|
),
|
|
3149
3136
|
/* @__PURE__ */ e.jsx(
|
|
3150
|
-
|
|
3137
|
+
z,
|
|
3151
3138
|
{
|
|
3152
3139
|
onClick: () => p("kpi"),
|
|
3153
3140
|
variant: "ghost",
|
|
@@ -3155,7 +3142,7 @@ function zl() {
|
|
|
3155
3142
|
}
|
|
3156
3143
|
),
|
|
3157
3144
|
/* @__PURE__ */ e.jsx(
|
|
3158
|
-
|
|
3145
|
+
z,
|
|
3159
3146
|
{
|
|
3160
3147
|
onClick: () => p("text"),
|
|
3161
3148
|
variant: "ghost",
|
|
@@ -3163,19 +3150,19 @@ function zl() {
|
|
|
3163
3150
|
}
|
|
3164
3151
|
),
|
|
3165
3152
|
/* @__PURE__ */ e.jsx(
|
|
3166
|
-
|
|
3153
|
+
z,
|
|
3167
3154
|
{
|
|
3168
3155
|
onClick: () => p("map"),
|
|
3169
3156
|
variant: "ghost",
|
|
3170
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3157
|
+
children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4" })
|
|
3171
3158
|
}
|
|
3172
3159
|
),
|
|
3173
3160
|
/* @__PURE__ */ e.jsx(
|
|
3174
|
-
|
|
3161
|
+
z,
|
|
3175
3162
|
{
|
|
3176
3163
|
onClick: () => p("custom"),
|
|
3177
3164
|
variant: "ghost",
|
|
3178
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3165
|
+
children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
|
|
3179
3166
|
}
|
|
3180
3167
|
)
|
|
3181
3168
|
] }),
|
|
@@ -3200,7 +3187,7 @@ function Ol({
|
|
|
3200
3187
|
case "radar":
|
|
3201
3188
|
return /* @__PURE__ */ e.jsx(_a, { className: t });
|
|
3202
3189
|
case "scatter":
|
|
3203
|
-
return /* @__PURE__ */ e.jsx(
|
|
3190
|
+
return /* @__PURE__ */ e.jsx(Da, { className: t });
|
|
3204
3191
|
case "bubble":
|
|
3205
3192
|
return /* @__PURE__ */ e.jsx(Pa, { className: t });
|
|
3206
3193
|
case "doughnut":
|
|
@@ -3220,9 +3207,9 @@ function Ol({
|
|
|
3220
3207
|
case "text":
|
|
3221
3208
|
return /* @__PURE__ */ e.jsx(Gs, { className: t });
|
|
3222
3209
|
case "map":
|
|
3223
|
-
return /* @__PURE__ */ e.jsx(
|
|
3210
|
+
return /* @__PURE__ */ e.jsx(Ta, { className: t });
|
|
3224
3211
|
case "custom":
|
|
3225
|
-
return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(
|
|
3212
|
+
return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(La, { className: t });
|
|
3226
3213
|
default:
|
|
3227
3214
|
return /* @__PURE__ */ e.jsx(Vs, { className: t });
|
|
3228
3215
|
}
|
|
@@ -3231,7 +3218,7 @@ function Il() {
|
|
|
3231
3218
|
var t;
|
|
3232
3219
|
const s = m((a) => a.card);
|
|
3233
3220
|
return (t = s.customCardPreferences) == null || t.showCardHeader, ie(), /* @__PURE__ */ e.jsxs(ra, { children: [
|
|
3234
|
-
/* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
3221
|
+
/* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
|
|
3235
3222
|
/* @__PURE__ */ e.jsx(oa, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
|
|
3236
3223
|
Jt,
|
|
3237
3224
|
{
|
|
@@ -3240,7 +3227,7 @@ function Il() {
|
|
|
3240
3227
|
},
|
|
3241
3228
|
className: "cursor-pointer space-x-2",
|
|
3242
3229
|
children: [
|
|
3243
|
-
/* @__PURE__ */ e.jsx(
|
|
3230
|
+
/* @__PURE__ */ e.jsx(Kt, { className: "size-5" }),
|
|
3244
3231
|
/* @__PURE__ */ e.jsx("span", { children: "Copy Card ID" })
|
|
3245
3232
|
]
|
|
3246
3233
|
}
|
|
@@ -3248,9 +3235,9 @@ function Il() {
|
|
|
3248
3235
|
] });
|
|
3249
3236
|
}
|
|
3250
3237
|
function ta() {
|
|
3251
|
-
const s = m((x) => x.frame), t = m((x) => x.card), a = m((x) => x.isShowingVisual), n = m((x) => x.isSqlRunning), l = m((x) => x.queryError),
|
|
3238
|
+
const s = m((x) => x.frame), t = m((x) => x.card), a = m((x) => x.isShowingVisual), n = m((x) => x.isSqlRunning), l = m((x) => x.queryError), r = m((x) => x.pythonStdOut), u = m((x) => x.actions.setRunSql);
|
|
3252
3239
|
m((x) => x.onSave), m((x) => x.onClose), m((x) => x.actions.setCardSql), m((x) => x.actions.setCardType), m((x) => x.actions.setSqlGen);
|
|
3253
|
-
const { setFrame: o, setCard: c, updateCardInFrame: p } = ie(), { data:
|
|
3240
|
+
const { setFrame: o, setCard: c, updateCardInFrame: p } = ie(), { data: d, isLoading: b, isFetching: j } = Re(t);
|
|
3254
3241
|
if (!t) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3255
3242
|
function h() {
|
|
3256
3243
|
const x = {
|
|
@@ -3270,9 +3257,9 @@ function ta() {
|
|
|
3270
3257
|
sql: "",
|
|
3271
3258
|
data: []
|
|
3272
3259
|
};
|
|
3273
|
-
|
|
3260
|
+
g(x);
|
|
3274
3261
|
}
|
|
3275
|
-
function
|
|
3262
|
+
function g(x) {
|
|
3276
3263
|
const v = {
|
|
3277
3264
|
...s,
|
|
3278
3265
|
cards: [...s.cards, x],
|
|
@@ -3287,9 +3274,9 @@ function ta() {
|
|
|
3287
3274
|
title: `${t.title} Copy`,
|
|
3288
3275
|
tabTitle: `${t.tabTitle || t.title} Copy`
|
|
3289
3276
|
};
|
|
3290
|
-
|
|
3277
|
+
g(x);
|
|
3291
3278
|
}
|
|
3292
|
-
function
|
|
3279
|
+
function O(x) {
|
|
3293
3280
|
const v = s.cards.filter((S) => S.id !== x), f = v[0], k = {
|
|
3294
3281
|
...s,
|
|
3295
3282
|
cards: v,
|
|
@@ -3306,11 +3293,11 @@ function ta() {
|
|
|
3306
3293
|
};
|
|
3307
3294
|
o(v);
|
|
3308
3295
|
const f = v.cards.find((k) => k.id === x);
|
|
3309
|
-
f.sql &&
|
|
3296
|
+
f.sql && u(!0), c(f);
|
|
3310
3297
|
}
|
|
3311
|
-
const
|
|
3298
|
+
const L = (x, v) => {
|
|
3312
3299
|
console.log("handleDragStart", v), x.dataTransfer.setData("tabIndex", v.toString());
|
|
3313
|
-
},
|
|
3300
|
+
}, D = (x) => {
|
|
3314
3301
|
x.preventDefault();
|
|
3315
3302
|
}, A = (x, v) => {
|
|
3316
3303
|
const f = x.dataTransfer.getData("tabIndex");
|
|
@@ -3329,11 +3316,11 @@ function ta() {
|
|
|
3329
3316
|
displayTab: f
|
|
3330
3317
|
});
|
|
3331
3318
|
},
|
|
3332
|
-
children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Ln, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(
|
|
3319
|
+
children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Ln, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Tn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
|
|
3333
3320
|
}
|
|
3334
3321
|
);
|
|
3335
3322
|
}
|
|
3336
|
-
function
|
|
3323
|
+
function F() {
|
|
3337
3324
|
return /* @__PURE__ */ e.jsxs(
|
|
3338
3325
|
Ca,
|
|
3339
3326
|
{
|
|
@@ -3354,8 +3341,8 @@ function ta() {
|
|
|
3354
3341
|
is,
|
|
3355
3342
|
{
|
|
3356
3343
|
draggable: !0,
|
|
3357
|
-
onDragStart: (f) =>
|
|
3358
|
-
onDragOver:
|
|
3344
|
+
onDragStart: (f) => L(f, v),
|
|
3345
|
+
onDragOver: D,
|
|
3359
3346
|
onDrop: (f) => A(f, v),
|
|
3360
3347
|
className: "",
|
|
3361
3348
|
value: x.id,
|
|
@@ -3366,7 +3353,7 @@ function ta() {
|
|
|
3366
3353
|
wa,
|
|
3367
3354
|
{
|
|
3368
3355
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3369
|
-
onClick: () =>
|
|
3356
|
+
onClick: () => O(x.id)
|
|
3370
3357
|
}
|
|
3371
3358
|
)
|
|
3372
3359
|
]
|
|
@@ -3376,21 +3363,21 @@ function ta() {
|
|
|
3376
3363
|
x.id
|
|
3377
3364
|
)),
|
|
3378
3365
|
/* @__PURE__ */ e.jsx(
|
|
3379
|
-
|
|
3366
|
+
z,
|
|
3380
3367
|
{
|
|
3381
3368
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3382
3369
|
variant: "outline",
|
|
3383
3370
|
onClick: h,
|
|
3384
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3371
|
+
children: /* @__PURE__ */ e.jsx(Ts, { className: "h-4 w-4" })
|
|
3385
3372
|
}
|
|
3386
3373
|
),
|
|
3387
3374
|
/* @__PURE__ */ e.jsx(
|
|
3388
|
-
|
|
3375
|
+
z,
|
|
3389
3376
|
{
|
|
3390
3377
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3391
3378
|
variant: "outline",
|
|
3392
3379
|
onClick: C,
|
|
3393
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3380
|
+
children: /* @__PURE__ */ e.jsx(In, { className: "h-4 w-4" })
|
|
3394
3381
|
}
|
|
3395
3382
|
)
|
|
3396
3383
|
] }) })
|
|
@@ -3399,32 +3386,32 @@ function ta() {
|
|
|
3399
3386
|
);
|
|
3400
3387
|
}
|
|
3401
3388
|
function E() {
|
|
3402
|
-
return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(
|
|
3403
|
-
|
|
3389
|
+
return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Wt, { card: t, data: d == null ? void 0 : d.records }) }) }) : t.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(ze, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
|
|
3390
|
+
Yt,
|
|
3404
3391
|
{
|
|
3405
3392
|
isLoading: n,
|
|
3406
3393
|
card: t,
|
|
3407
|
-
data:
|
|
3394
|
+
data: d == null ? void 0 : d.records
|
|
3408
3395
|
}
|
|
3409
|
-
) }) }) }) : /* @__PURE__ */ e.jsx(
|
|
3396
|
+
) }) }) }) : /* @__PURE__ */ e.jsx(ps, { FallbackComponent: va, children: /* @__PURE__ */ e.jsx(Ra, { className: "grow border-none shadow-none" }) });
|
|
3410
3397
|
}
|
|
3411
3398
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3412
|
-
(b ||
|
|
3399
|
+
(b || j) && /* @__PURE__ */ e.jsx(qe, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
3413
3400
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3414
3401
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3415
3402
|
/* @__PURE__ */ e.jsx(zl, {}),
|
|
3416
3403
|
!["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(Sl, {}),
|
|
3417
3404
|
/* @__PURE__ */ e.jsx(Il, {})
|
|
3418
3405
|
] }),
|
|
3419
|
-
/* @__PURE__ */ e.jsx(
|
|
3406
|
+
/* @__PURE__ */ e.jsx(Fl, {})
|
|
3420
3407
|
] }),
|
|
3421
|
-
a ?
|
|
3408
|
+
a ? F() : /* @__PURE__ */ e.jsxs(
|
|
3422
3409
|
cs,
|
|
3423
3410
|
{
|
|
3424
3411
|
className: "px-6",
|
|
3425
3412
|
direction: "horizontal",
|
|
3426
3413
|
children: [
|
|
3427
|
-
|
|
3414
|
+
r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3428
3415
|
/* @__PURE__ */ e.jsx(
|
|
3429
3416
|
Ne,
|
|
3430
3417
|
{
|
|
@@ -3433,7 +3420,7 @@ function ta() {
|
|
|
3433
3420
|
defaultSize: 30,
|
|
3434
3421
|
minSize: 10,
|
|
3435
3422
|
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3436
|
-
children:
|
|
3423
|
+
children: r && /* @__PURE__ */ e.jsx(Dl, {})
|
|
3437
3424
|
}
|
|
3438
3425
|
),
|
|
3439
3426
|
/* @__PURE__ */ e.jsx(ds, {})
|
|
@@ -3446,7 +3433,7 @@ function ta() {
|
|
|
3446
3433
|
minSize: 10,
|
|
3447
3434
|
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3448
3435
|
children: /* @__PURE__ */ e.jsxs(ze, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
|
|
3449
|
-
(
|
|
3436
|
+
(d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && /* @__PURE__ */ e.jsx(Cl, { data: (d == null ? void 0 : d.records) || [] }),
|
|
3450
3437
|
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: l }),
|
|
3451
3438
|
/* @__PURE__ */ e.jsx(Ye, { orientation: "horizontal" })
|
|
3452
3439
|
] })
|
|
@@ -3457,7 +3444,7 @@ function ta() {
|
|
|
3457
3444
|
)
|
|
3458
3445
|
] });
|
|
3459
3446
|
}
|
|
3460
|
-
function
|
|
3447
|
+
function Dl() {
|
|
3461
3448
|
const s = m((a) => a.pythonStdOut);
|
|
3462
3449
|
if (!s) return null;
|
|
3463
3450
|
const t = s.replace(/\n/g, "<br>");
|
|
@@ -3469,14 +3456,14 @@ function Fl() {
|
|
|
3469
3456
|
] })
|
|
3470
3457
|
] });
|
|
3471
3458
|
}
|
|
3472
|
-
function
|
|
3459
|
+
function Fl() {
|
|
3473
3460
|
const s = m((a) => a.isShowingVisual), t = m(
|
|
3474
3461
|
(a) => a.actions.setIsShowingVisual
|
|
3475
3462
|
);
|
|
3476
3463
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3477
3464
|
/* @__PURE__ */ e.jsx(_, { htmlFor: "visualize", children: "Chart" }),
|
|
3478
3465
|
/* @__PURE__ */ e.jsx(
|
|
3479
|
-
|
|
3466
|
+
Xt,
|
|
3480
3467
|
{
|
|
3481
3468
|
checked: s,
|
|
3482
3469
|
onCheckedChange: () => t(!s),
|
|
@@ -3486,20 +3473,20 @@ function Dl() {
|
|
|
3486
3473
|
)
|
|
3487
3474
|
] });
|
|
3488
3475
|
}
|
|
3489
|
-
function
|
|
3476
|
+
function Tl({
|
|
3490
3477
|
options: s,
|
|
3491
3478
|
value: t,
|
|
3492
3479
|
onValueChange: a
|
|
3493
3480
|
}) {
|
|
3494
3481
|
return /* @__PURE__ */ e.jsx(
|
|
3495
|
-
|
|
3482
|
+
bs,
|
|
3496
3483
|
{
|
|
3497
3484
|
value: t,
|
|
3498
3485
|
onValueChange: a,
|
|
3499
3486
|
className: "flex gap-4",
|
|
3500
3487
|
defaultValue: s[0].value,
|
|
3501
3488
|
children: s.map((n) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3502
|
-
/* @__PURE__ */ e.jsx(
|
|
3489
|
+
/* @__PURE__ */ e.jsx(Te, { value: n.value, id: n.value }),
|
|
3503
3490
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: n.value, children: n.label })
|
|
3504
3491
|
] }, n.value))
|
|
3505
3492
|
}
|
|
@@ -3522,7 +3509,7 @@ function ue({
|
|
|
3522
3509
|
),
|
|
3523
3510
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3524
3511
|
/* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
3525
|
-
t.map((
|
|
3512
|
+
t.map((r) => /* @__PURE__ */ e.jsx(Y, { value: r.value, children: r.label }, r.value))
|
|
3526
3513
|
] }) })
|
|
3527
3514
|
] });
|
|
3528
3515
|
}
|
|
@@ -3540,46 +3527,46 @@ function Qe({
|
|
|
3540
3527
|
children: [
|
|
3541
3528
|
/* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
|
|
3542
3529
|
/* @__PURE__ */ e.jsx(_, { children: t }),
|
|
3543
|
-
/* @__PURE__ */ e.jsx(
|
|
3530
|
+
/* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4" })
|
|
3544
3531
|
] }),
|
|
3545
3532
|
/* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
|
|
3546
3533
|
]
|
|
3547
3534
|
}
|
|
3548
3535
|
);
|
|
3549
3536
|
}
|
|
3550
|
-
function
|
|
3551
|
-
var C,
|
|
3537
|
+
function Ll() {
|
|
3538
|
+
var C, O;
|
|
3552
3539
|
const s = m(
|
|
3553
3540
|
(y) => y.card.customCardPreferences
|
|
3554
|
-
), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((y) => y.card), l = m((y) => y.frame),
|
|
3541
|
+
), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((y) => y.card), l = m((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: u } = ie(), { components: o, manifest: c } = ba(
|
|
3555
3542
|
(s == null ? void 0 : s.url) || ""
|
|
3556
3543
|
), p = (C = c == null ? void 0 : c.visuals) == null ? void 0 : C.find(
|
|
3557
3544
|
(y) => y.name === (s == null ? void 0 : s.componentName)
|
|
3558
3545
|
);
|
|
3559
|
-
function
|
|
3546
|
+
function d(y, L) {
|
|
3560
3547
|
if (!s) return;
|
|
3561
3548
|
const A = {
|
|
3562
3549
|
...(s == null ? void 0 : s.dataInputCardIds) || {},
|
|
3563
3550
|
[y]: {
|
|
3564
|
-
cardId:
|
|
3551
|
+
cardId: L,
|
|
3565
3552
|
hookRef: null
|
|
3566
3553
|
}
|
|
3567
3554
|
};
|
|
3568
|
-
|
|
3555
|
+
u({
|
|
3569
3556
|
...s,
|
|
3570
3557
|
dataInputCardIds: A
|
|
3571
3558
|
});
|
|
3572
3559
|
}
|
|
3573
3560
|
function b(y) {
|
|
3574
|
-
var
|
|
3575
|
-
const
|
|
3576
|
-
var
|
|
3577
|
-
return ((
|
|
3561
|
+
var D, A;
|
|
3562
|
+
const L = (D = l == null ? void 0 : l.cards) == null ? void 0 : D.filter((N) => {
|
|
3563
|
+
var F;
|
|
3564
|
+
return ((F = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : F.visualType) !== "multiple";
|
|
3578
3565
|
}).map((N) => ({
|
|
3579
3566
|
value: N.id,
|
|
3580
3567
|
label: N.tabTitle || N.title
|
|
3581
3568
|
}));
|
|
3582
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = y == null ? void 0 : y.dataInputs) == null ? void 0 : A.map((N,
|
|
3569
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = y == null ? void 0 : y.dataInputs) == null ? void 0 : A.map((N, F) => {
|
|
3583
3570
|
var E, x;
|
|
3584
3571
|
return /* @__PURE__ */ e.jsxs(
|
|
3585
3572
|
"div",
|
|
@@ -3592,64 +3579,64 @@ function Ml() {
|
|
|
3592
3579
|
{
|
|
3593
3580
|
className: "col-span-6 h-8 w-full justify-between",
|
|
3594
3581
|
label: "",
|
|
3595
|
-
options:
|
|
3596
|
-
value: ((x = (E = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : E[
|
|
3597
|
-
onValueChange: (v) =>
|
|
3582
|
+
options: L || [],
|
|
3583
|
+
value: ((x = (E = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : E[F]) == null ? void 0 : x.cardId) || "",
|
|
3584
|
+
onValueChange: (v) => d(F, v)
|
|
3598
3585
|
}
|
|
3599
3586
|
)
|
|
3600
3587
|
]
|
|
3601
3588
|
},
|
|
3602
|
-
|
|
3589
|
+
F + Math.random()
|
|
3603
3590
|
);
|
|
3604
3591
|
}) });
|
|
3605
3592
|
}
|
|
3606
|
-
function
|
|
3593
|
+
function j(y, L, D = []) {
|
|
3607
3594
|
var A, N;
|
|
3608
3595
|
return s ? y === "input" ? /* @__PURE__ */ e.jsx(
|
|
3609
3596
|
re,
|
|
3610
3597
|
{
|
|
3611
3598
|
className: `h-8 w-full ${Ue}`,
|
|
3612
|
-
value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[
|
|
3613
|
-
onChange: (
|
|
3614
|
-
|
|
3599
|
+
value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[L]) || "",
|
|
3600
|
+
onChange: (F) => {
|
|
3601
|
+
u({
|
|
3615
3602
|
...s,
|
|
3616
3603
|
settings: {
|
|
3617
3604
|
...s == null ? void 0 : s.settings,
|
|
3618
|
-
[
|
|
3605
|
+
[L]: F.target.value
|
|
3619
3606
|
}
|
|
3620
3607
|
});
|
|
3621
3608
|
}
|
|
3622
3609
|
},
|
|
3623
|
-
|
|
3610
|
+
L
|
|
3624
3611
|
) : y === "select" ? /* @__PURE__ */ e.jsx(
|
|
3625
3612
|
ue,
|
|
3626
3613
|
{
|
|
3627
3614
|
className: "h-8 w-full",
|
|
3628
3615
|
label: "",
|
|
3629
|
-
options:
|
|
3630
|
-
value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[
|
|
3631
|
-
onValueChange: (
|
|
3632
|
-
|
|
3616
|
+
options: D,
|
|
3617
|
+
value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[L]) || "",
|
|
3618
|
+
onValueChange: (F) => {
|
|
3619
|
+
u({
|
|
3633
3620
|
...s,
|
|
3634
|
-
settings: { ...s == null ? void 0 : s.settings, [
|
|
3621
|
+
settings: { ...s == null ? void 0 : s.settings, [L]: F }
|
|
3635
3622
|
});
|
|
3636
3623
|
}
|
|
3637
3624
|
}
|
|
3638
3625
|
) : null : null;
|
|
3639
3626
|
}
|
|
3640
3627
|
function h(y) {
|
|
3641
|
-
const
|
|
3642
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children:
|
|
3628
|
+
const L = Object.entries((y == null ? void 0 : y.settings) || {});
|
|
3629
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: L.map(([D, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3643
3630
|
/* @__PURE__ */ e.jsx(_, { children: A.title }),
|
|
3644
|
-
|
|
3631
|
+
j(
|
|
3645
3632
|
A.ui,
|
|
3646
|
-
|
|
3633
|
+
D,
|
|
3647
3634
|
A.options
|
|
3648
3635
|
)
|
|
3649
|
-
] },
|
|
3636
|
+
] }, D)) });
|
|
3650
3637
|
}
|
|
3651
|
-
function
|
|
3652
|
-
s &&
|
|
3638
|
+
function g(y) {
|
|
3639
|
+
s && u({
|
|
3653
3640
|
...s,
|
|
3654
3641
|
visualType: y,
|
|
3655
3642
|
componentName: ""
|
|
@@ -3668,7 +3655,7 @@ function Ml() {
|
|
|
3668
3655
|
label: "",
|
|
3669
3656
|
options: a,
|
|
3670
3657
|
value: (s == null ? void 0 : s.url) || "",
|
|
3671
|
-
onValueChange: (y) =>
|
|
3658
|
+
onValueChange: (y) => u({
|
|
3672
3659
|
...s || {
|
|
3673
3660
|
url: "",
|
|
3674
3661
|
componentName: ""
|
|
@@ -3678,14 +3665,14 @@ function Ml() {
|
|
|
3678
3665
|
}
|
|
3679
3666
|
) }) }),
|
|
3680
3667
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
|
|
3681
|
-
|
|
3668
|
+
Tl,
|
|
3682
3669
|
{
|
|
3683
3670
|
options: [
|
|
3684
3671
|
{ value: "single", label: "Single Visual" },
|
|
3685
3672
|
{ value: "multiple", label: "Multi-Visual" }
|
|
3686
3673
|
],
|
|
3687
|
-
value:
|
|
3688
|
-
onValueChange:
|
|
3674
|
+
value: r,
|
|
3675
|
+
onValueChange: g
|
|
3689
3676
|
}
|
|
3690
3677
|
),
|
|
3691
3678
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -3696,14 +3683,14 @@ function Ml() {
|
|
|
3696
3683
|
className: "h-8 w-full",
|
|
3697
3684
|
label: "",
|
|
3698
3685
|
options: (o == null ? void 0 : o.filter(
|
|
3699
|
-
(y) => y.type ===
|
|
3686
|
+
(y) => y.type === r
|
|
3700
3687
|
).map((y) => ({
|
|
3701
3688
|
value: y.name,
|
|
3702
3689
|
label: y.name
|
|
3703
3690
|
}))) || [],
|
|
3704
3691
|
value: s.componentName,
|
|
3705
3692
|
onValueChange: (y) => {
|
|
3706
|
-
console.log("changing value", y),
|
|
3693
|
+
console.log("changing value", y), u({
|
|
3707
3694
|
...s,
|
|
3708
3695
|
componentName: y
|
|
3709
3696
|
});
|
|
@@ -3713,7 +3700,7 @@ function Ml() {
|
|
|
3713
3700
|
] }) })
|
|
3714
3701
|
] }) }) }),
|
|
3715
3702
|
/* @__PURE__ */ e.jsx(we, { className: "my-4" }),
|
|
3716
|
-
((
|
|
3703
|
+
((O = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : O.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
|
|
3717
3704
|
p && p.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3718
3705
|
/* @__PURE__ */ e.jsx(_, { children: "Input Mapping" }),
|
|
3719
3706
|
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(p) })
|
|
@@ -3724,70 +3711,70 @@ function Ml() {
|
|
|
3724
3711
|
}
|
|
3725
3712
|
);
|
|
3726
3713
|
}
|
|
3727
|
-
function
|
|
3714
|
+
function Me() {
|
|
3728
3715
|
const [s, t] = V([]);
|
|
3729
3716
|
m(
|
|
3730
|
-
(
|
|
3717
|
+
(d) => d.card.cfg
|
|
3731
3718
|
);
|
|
3732
|
-
const a = m((
|
|
3733
|
-
(
|
|
3719
|
+
const a = m((d) => d.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: r } = m((d) => d.actions), u = m(
|
|
3720
|
+
(d) => d.queryResultColumns
|
|
3734
3721
|
);
|
|
3735
3722
|
m(
|
|
3736
|
-
(
|
|
3723
|
+
(d) => {
|
|
3737
3724
|
var b;
|
|
3738
|
-
return (b =
|
|
3725
|
+
return (b = d.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
|
|
3739
3726
|
}
|
|
3740
3727
|
), se(() => {
|
|
3741
|
-
|
|
3742
|
-
}, [
|
|
3743
|
-
function o(
|
|
3744
|
-
var
|
|
3745
|
-
b ? a != null && a.onClickFilter && ((
|
|
3728
|
+
u && t(new Array(u.length).fill(!1));
|
|
3729
|
+
}, [u]);
|
|
3730
|
+
function o(d, b) {
|
|
3731
|
+
var j, h;
|
|
3732
|
+
b ? a != null && a.onClickFilter && ((j = a == null ? void 0 : a.onClickFilter) == null ? void 0 : j.length) > 0 ? r({
|
|
3746
3733
|
...a,
|
|
3747
3734
|
onClickFilter: [
|
|
3748
3735
|
...a.onClickFilter,
|
|
3749
3736
|
{
|
|
3750
|
-
columnIndex:
|
|
3737
|
+
columnIndex: d,
|
|
3751
3738
|
expression: ""
|
|
3752
3739
|
}
|
|
3753
3740
|
]
|
|
3754
|
-
}) :
|
|
3741
|
+
}) : r({
|
|
3755
3742
|
...a,
|
|
3756
3743
|
onClickFilter: [
|
|
3757
3744
|
{
|
|
3758
|
-
columnIndex:
|
|
3745
|
+
columnIndex: d,
|
|
3759
3746
|
expression: ""
|
|
3760
3747
|
}
|
|
3761
3748
|
]
|
|
3762
|
-
}) : (
|
|
3749
|
+
}) : (r({
|
|
3763
3750
|
...a,
|
|
3764
3751
|
onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
|
|
3765
|
-
(
|
|
3752
|
+
(g) => g.columnIndex !== d
|
|
3766
3753
|
)
|
|
3767
|
-
}), t((
|
|
3768
|
-
const C = [...
|
|
3769
|
-
return C[
|
|
3754
|
+
}), t((g) => {
|
|
3755
|
+
const C = [...g];
|
|
3756
|
+
return C[d] = !1, C;
|
|
3770
3757
|
}));
|
|
3771
3758
|
}
|
|
3772
|
-
function c(
|
|
3759
|
+
function c(d, b) {
|
|
3773
3760
|
var h;
|
|
3774
|
-
const
|
|
3775
|
-
...
|
|
3761
|
+
const j = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((g) => g.columnIndex === d ? {
|
|
3762
|
+
...g,
|
|
3776
3763
|
expression: b.target.value
|
|
3777
|
-
} :
|
|
3778
|
-
|
|
3764
|
+
} : g);
|
|
3765
|
+
r({
|
|
3779
3766
|
...a,
|
|
3780
|
-
onClickFilter:
|
|
3767
|
+
onClickFilter: j
|
|
3781
3768
|
});
|
|
3782
3769
|
}
|
|
3783
|
-
function p(
|
|
3784
|
-
var b,
|
|
3785
|
-
if (s != null && s[
|
|
3770
|
+
function p(d) {
|
|
3771
|
+
var b, j, h, g;
|
|
3772
|
+
if (s != null && s[d] || (j = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((C) => C.columnIndex === d)) != null && j.expression)
|
|
3786
3773
|
return /* @__PURE__ */ e.jsx(
|
|
3787
3774
|
re,
|
|
3788
3775
|
{
|
|
3789
|
-
value: (
|
|
3790
|
-
onChange: (C) => c(
|
|
3776
|
+
value: (g = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((C) => C.columnIndex === d)) == null ? void 0 : g.expression,
|
|
3777
|
+
onChange: (C) => c(d, C),
|
|
3791
3778
|
type: "text",
|
|
3792
3779
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3793
3780
|
placeholder: "Expression"
|
|
@@ -3796,8 +3783,8 @@ function Te() {
|
|
|
3796
3783
|
}
|
|
3797
3784
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3798
3785
|
/* @__PURE__ */ e.jsx(_, { children: "On Click" }),
|
|
3799
|
-
|
|
3800
|
-
var
|
|
3786
|
+
u == null ? void 0 : u.map((d, b) => {
|
|
3787
|
+
var j, h;
|
|
3801
3788
|
return /* @__PURE__ */ e.jsx(
|
|
3802
3789
|
"div",
|
|
3803
3790
|
{
|
|
@@ -3807,28 +3794,28 @@ function Te() {
|
|
|
3807
3794
|
/* @__PURE__ */ e.jsx(
|
|
3808
3795
|
$s,
|
|
3809
3796
|
{
|
|
3810
|
-
checked: !!((
|
|
3811
|
-
(
|
|
3797
|
+
checked: !!((j = a == null ? void 0 : a.onClickFilter) != null && j.find(
|
|
3798
|
+
(g) => g.columnIndex === b
|
|
3812
3799
|
)),
|
|
3813
|
-
onCheckedChange: (
|
|
3800
|
+
onCheckedChange: (g) => o(b, g)
|
|
3814
3801
|
}
|
|
3815
3802
|
),
|
|
3816
3803
|
/* @__PURE__ */ e.jsx(
|
|
3817
3804
|
"label",
|
|
3818
3805
|
{
|
|
3819
3806
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
3820
|
-
children:
|
|
3807
|
+
children: d
|
|
3821
3808
|
}
|
|
3822
3809
|
),
|
|
3823
3810
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
|
|
3824
|
-
(
|
|
3811
|
+
(g) => g.columnIndex === b
|
|
3825
3812
|
)) && /* @__PURE__ */ e.jsx(
|
|
3826
3813
|
ca,
|
|
3827
3814
|
{
|
|
3828
3815
|
onClick: () => {
|
|
3829
|
-
t((
|
|
3830
|
-
const C = [...
|
|
3831
|
-
return C[b] = !
|
|
3816
|
+
t((g) => {
|
|
3817
|
+
const C = [...g];
|
|
3818
|
+
return C[b] = !g[b], C;
|
|
3832
3819
|
});
|
|
3833
3820
|
},
|
|
3834
3821
|
className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
|
|
@@ -3838,34 +3825,34 @@ function Te() {
|
|
|
3838
3825
|
p(b)
|
|
3839
3826
|
] })
|
|
3840
3827
|
},
|
|
3841
|
-
|
|
3828
|
+
d
|
|
3842
3829
|
);
|
|
3843
3830
|
})
|
|
3844
3831
|
] });
|
|
3845
3832
|
}
|
|
3846
|
-
function
|
|
3847
|
-
var
|
|
3833
|
+
function ys() {
|
|
3834
|
+
var u, o, c;
|
|
3848
3835
|
const s = m((p) => p.card.preferences), t = m(
|
|
3849
3836
|
(p) => p.card.cfg
|
|
3850
3837
|
), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = m((p) => p.actions);
|
|
3851
|
-
(
|
|
3852
|
-
function
|
|
3838
|
+
(u = t == null ? void 0 : t.options) != null && u.indexAxis;
|
|
3839
|
+
function r(p) {
|
|
3853
3840
|
l(p);
|
|
3854
3841
|
}
|
|
3855
3842
|
return /* @__PURE__ */ e.jsxs(
|
|
3856
|
-
|
|
3843
|
+
bs,
|
|
3857
3844
|
{
|
|
3858
3845
|
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((c = t == null ? void 0 : t.options) == null ? void 0 : c.indexAxis) || "x",
|
|
3859
|
-
onValueChange:
|
|
3846
|
+
onValueChange: r,
|
|
3860
3847
|
className: "flex gap-3",
|
|
3861
3848
|
defaultValue: "x",
|
|
3862
3849
|
children: [
|
|
3863
3850
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3864
|
-
/* @__PURE__ */ e.jsx(
|
|
3851
|
+
/* @__PURE__ */ e.jsx(Te, { value: "x", id: "r1" }),
|
|
3865
3852
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
|
|
3866
3853
|
] }),
|
|
3867
3854
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3868
|
-
/* @__PURE__ */ e.jsx(
|
|
3855
|
+
/* @__PURE__ */ e.jsx(Te, { value: "y", id: "r2" }),
|
|
3869
3856
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
|
|
3870
3857
|
] })
|
|
3871
3858
|
]
|
|
@@ -3874,44 +3861,44 @@ function bs() {
|
|
|
3874
3861
|
}
|
|
3875
3862
|
const ns = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3876
3863
|
function na(s, t) {
|
|
3877
|
-
var n, l,
|
|
3864
|
+
var n, l, r;
|
|
3878
3865
|
const a = ka(s, t);
|
|
3879
|
-
return ((
|
|
3866
|
+
return ((r = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : r.type) || "linear";
|
|
3880
3867
|
}
|
|
3881
3868
|
function Wa() {
|
|
3882
3869
|
var Z, B, X, w, H, ae;
|
|
3883
|
-
const [s, t] = V(!1), a = m((
|
|
3884
|
-
var
|
|
3885
|
-
return (
|
|
3886
|
-
}), n = m((
|
|
3887
|
-
var
|
|
3888
|
-
return (
|
|
3889
|
-
}), l = ka(a, n), [
|
|
3870
|
+
const [s, t] = V(!1), a = m((M) => {
|
|
3871
|
+
var T;
|
|
3872
|
+
return (T = M.card) == null ? void 0 : T.preferences;
|
|
3873
|
+
}), n = m((M) => {
|
|
3874
|
+
var T;
|
|
3875
|
+
return (T = M.card) == null ? void 0 : T.cfg;
|
|
3876
|
+
}), l = ka(a, n), [r, u] = V(
|
|
3890
3877
|
na(a)
|
|
3891
3878
|
), [o, c] = V(
|
|
3892
3879
|
((X = (B = (Z = a == null ? void 0 : a.chartOptions) == null ? void 0 : Z.scales) == null ? void 0 : B[l]) == null ? void 0 : X.min) || ""
|
|
3893
|
-
), [p,
|
|
3880
|
+
), [p, d] = V(
|
|
3894
3881
|
((ae = (H = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : H[l]) == null ? void 0 : ae.max) || ""
|
|
3895
|
-
), [b,
|
|
3896
|
-
(
|
|
3897
|
-
), { updateCardInFrame: x } = ie(), v = m((
|
|
3898
|
-
var
|
|
3899
|
-
return (
|
|
3882
|
+
), [b, j] = V(o || p ? "custom" : "auto"), [h, g] = V(""), [C, O] = V(0), [y, L] = V(""), [D, A] = V(""), [N, F] = V(""), E = m(
|
|
3883
|
+
(M) => M.actions.setCardPreferences
|
|
3884
|
+
), { updateCardInFrame: x } = ie(), v = m((M) => M.card), f = m((M) => {
|
|
3885
|
+
var T;
|
|
3886
|
+
return (T = M.card) == null ? void 0 : T.type;
|
|
3900
3887
|
}), k = ["pie", "doughnut", "polarArea"].includes(f);
|
|
3901
3888
|
se(() => {
|
|
3902
|
-
var
|
|
3903
|
-
|
|
3904
|
-
((te = (
|
|
3905
|
-
),
|
|
3889
|
+
var M, T, te, P, ee, ne, Ee, Ie, je, be, W, oe, ce, De;
|
|
3890
|
+
u(na(a)), c(
|
|
3891
|
+
((te = (T = (M = a == null ? void 0 : a.chartOptions) == null ? void 0 : M.scales) == null ? void 0 : T[l]) == null ? void 0 : te.min) === 0 ? 0 : ""
|
|
3892
|
+
), d(((ne = (ee = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : ee[l]) == null ? void 0 : ne.max) || ""), g(
|
|
3906
3893
|
((be = (je = (Ie = (Ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ee.scales) == null ? void 0 : Ie[l]) == null ? void 0 : je.ticks) == null ? void 0 : be.stepSize) || ""
|
|
3907
|
-
),
|
|
3894
|
+
), O(((W = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : W.decimalPlaces) || 0), L(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), F(((De = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : De.locale) || "");
|
|
3908
3895
|
}, [s, a, l]);
|
|
3909
|
-
function S(
|
|
3910
|
-
return
|
|
3896
|
+
function S(M, T) {
|
|
3897
|
+
return T === "" || /^[0-9\b]+$/.test(T) ? Number(T) : Number(M);
|
|
3911
3898
|
}
|
|
3912
|
-
function
|
|
3913
|
-
const
|
|
3914
|
-
...new Set(us.map((
|
|
3899
|
+
function q() {
|
|
3900
|
+
const M = [
|
|
3901
|
+
...new Set(us.map((T) => T.currency))
|
|
3915
3902
|
];
|
|
3916
3903
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3917
3904
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
@@ -3933,19 +3920,19 @@ function Wa() {
|
|
|
3933
3920
|
/* @__PURE__ */ e.jsxs(
|
|
3934
3921
|
me,
|
|
3935
3922
|
{
|
|
3936
|
-
value:
|
|
3937
|
-
onValueChange: (
|
|
3923
|
+
value: D || "none",
|
|
3924
|
+
onValueChange: (T) => A(T === "none" ? "" : T),
|
|
3938
3925
|
children: [
|
|
3939
3926
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
3940
3927
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3941
3928
|
/* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
|
|
3942
3929
|
/* @__PURE__ */ e.jsx(Y, { value: "none", children: "None" }),
|
|
3943
|
-
|
|
3930
|
+
M.map((T) => /* @__PURE__ */ e.jsx(Y, { value: T, children: T }, T))
|
|
3944
3931
|
] }) })
|
|
3945
3932
|
]
|
|
3946
3933
|
}
|
|
3947
3934
|
),
|
|
3948
|
-
/* @__PURE__ */ e.jsxs(me, { value: N, onValueChange: (
|
|
3935
|
+
/* @__PURE__ */ e.jsxs(me, { value: N, onValueChange: (T) => F(T), children: [
|
|
3949
3936
|
/* @__PURE__ */ e.jsx(
|
|
3950
3937
|
he,
|
|
3951
3938
|
{
|
|
@@ -3955,7 +3942,7 @@ function Wa() {
|
|
|
3955
3942
|
),
|
|
3956
3943
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3957
3944
|
/* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
|
|
3958
|
-
us.map((
|
|
3945
|
+
us.map((T) => /* @__PURE__ */ e.jsx(Y, { value: T.locale, children: T.locale }, T.locale))
|
|
3959
3946
|
] }) })
|
|
3960
3947
|
] })
|
|
3961
3948
|
] }),
|
|
@@ -3965,7 +3952,7 @@ function Wa() {
|
|
|
3965
3952
|
re,
|
|
3966
3953
|
{
|
|
3967
3954
|
value: C,
|
|
3968
|
-
onChange: (
|
|
3955
|
+
onChange: (T) => O(Number(T.target.value)),
|
|
3969
3956
|
id: "format",
|
|
3970
3957
|
className: `col-span-6 h-8 w-full tracking-wide ${ns}`
|
|
3971
3958
|
}
|
|
@@ -3982,7 +3969,7 @@ function Wa() {
|
|
|
3982
3969
|
{
|
|
3983
3970
|
id: "min",
|
|
3984
3971
|
value: o,
|
|
3985
|
-
onChange: (
|
|
3972
|
+
onChange: (M) => c((T) => S(T, M.target.value)),
|
|
3986
3973
|
className: `col-span-1 h-8 w-full ${ns}`
|
|
3987
3974
|
}
|
|
3988
3975
|
),
|
|
@@ -3990,7 +3977,7 @@ function Wa() {
|
|
|
3990
3977
|
re,
|
|
3991
3978
|
{
|
|
3992
3979
|
value: p,
|
|
3993
|
-
onChange: (
|
|
3980
|
+
onChange: (M) => d((T) => S(T, M.target.value)),
|
|
3994
3981
|
id: "max",
|
|
3995
3982
|
className: `col-span-1 h-8 w-full ${ns}`
|
|
3996
3983
|
}
|
|
@@ -4002,7 +3989,7 @@ function Wa() {
|
|
|
4002
3989
|
re,
|
|
4003
3990
|
{
|
|
4004
3991
|
value: h,
|
|
4005
|
-
onChange: (
|
|
3992
|
+
onChange: (M) => g((T) => S(T, M.target.value)),
|
|
4006
3993
|
id: "step-size",
|
|
4007
3994
|
className: `col-span-1 h-8 w-full ${ns}`
|
|
4008
3995
|
}
|
|
@@ -4012,15 +3999,15 @@ function Wa() {
|
|
|
4012
3999
|
}
|
|
4013
4000
|
function U() {
|
|
4014
4001
|
var P;
|
|
4015
|
-
let
|
|
4016
|
-
b === "custom" && (
|
|
4002
|
+
let M = {};
|
|
4003
|
+
b === "custom" && (M = {
|
|
4017
4004
|
min: o,
|
|
4018
4005
|
max: p,
|
|
4019
4006
|
ticks: {
|
|
4020
4007
|
stepSize: h
|
|
4021
4008
|
}
|
|
4022
4009
|
});
|
|
4023
|
-
const
|
|
4010
|
+
const T = {
|
|
4024
4011
|
...a || {},
|
|
4025
4012
|
chartOptions: {
|
|
4026
4013
|
...a == null ? void 0 : a.chartOptions,
|
|
@@ -4028,28 +4015,28 @@ function Wa() {
|
|
|
4028
4015
|
...(P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales,
|
|
4029
4016
|
[l]: {
|
|
4030
4017
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
4031
|
-
type:
|
|
4032
|
-
...
|
|
4018
|
+
type: r,
|
|
4019
|
+
...r === "linear" ? M : {}
|
|
4033
4020
|
}
|
|
4034
4021
|
}
|
|
4035
4022
|
},
|
|
4036
4023
|
numberAxisFormat: {
|
|
4037
4024
|
decimalPlaces: C,
|
|
4038
4025
|
suffix: y,
|
|
4039
|
-
currency:
|
|
4026
|
+
currency: D,
|
|
4040
4027
|
locale: N
|
|
4041
4028
|
}
|
|
4042
4029
|
};
|
|
4043
|
-
console.log(
|
|
4030
|
+
console.log(T), E(T);
|
|
4044
4031
|
const te = {
|
|
4045
4032
|
...v,
|
|
4046
|
-
preferences:
|
|
4033
|
+
preferences: T
|
|
4047
4034
|
};
|
|
4048
4035
|
x(te);
|
|
4049
4036
|
}
|
|
4050
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4051
|
-
/* @__PURE__ */ e.jsx(
|
|
4052
|
-
/* @__PURE__ */ e.jsx(
|
|
4037
|
+
return /* @__PURE__ */ e.jsxs(fs, { onOpenChange: (M) => t(M), children: [
|
|
4038
|
+
/* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsx(en, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
4039
|
+
/* @__PURE__ */ e.jsx(js, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
4053
4040
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4054
4041
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
4055
4042
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
@@ -4061,8 +4048,8 @@ function Wa() {
|
|
|
4061
4048
|
me,
|
|
4062
4049
|
{
|
|
4063
4050
|
disabled: k,
|
|
4064
|
-
value:
|
|
4065
|
-
onValueChange: (
|
|
4051
|
+
value: r,
|
|
4052
|
+
onValueChange: (M) => u(M),
|
|
4066
4053
|
children: [
|
|
4067
4054
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4068
4055
|
/* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
@@ -4074,35 +4061,35 @@ function Wa() {
|
|
|
4074
4061
|
}
|
|
4075
4062
|
)
|
|
4076
4063
|
] }),
|
|
4077
|
-
|
|
4064
|
+
r == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
4078
4065
|
/* @__PURE__ */ e.jsx(_, { htmlFor: "scale-option", children: "Setup" }),
|
|
4079
4066
|
/* @__PURE__ */ e.jsxs(
|
|
4080
|
-
|
|
4067
|
+
bs,
|
|
4081
4068
|
{
|
|
4082
4069
|
disabled: k,
|
|
4083
4070
|
id: "scale-option",
|
|
4084
4071
|
value: b,
|
|
4085
|
-
onValueChange: (
|
|
4072
|
+
onValueChange: (M) => j(M),
|
|
4086
4073
|
className: "col-span-2 flex gap-3",
|
|
4087
4074
|
defaultValue: "x",
|
|
4088
4075
|
children: [
|
|
4089
4076
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
4090
|
-
/* @__PURE__ */ e.jsx(
|
|
4077
|
+
/* @__PURE__ */ e.jsx(Te, { value: "auto", id: "r1" }),
|
|
4091
4078
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
|
|
4092
4079
|
] }),
|
|
4093
4080
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
4094
|
-
/* @__PURE__ */ e.jsx(
|
|
4081
|
+
/* @__PURE__ */ e.jsx(Te, { value: "custom", id: "r2" }),
|
|
4095
4082
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
|
|
4096
4083
|
] })
|
|
4097
4084
|
]
|
|
4098
4085
|
}
|
|
4099
4086
|
)
|
|
4100
4087
|
] }),
|
|
4101
|
-
b === "custom" &&
|
|
4102
|
-
|
|
4103
|
-
/* @__PURE__ */ e.jsx(
|
|
4088
|
+
b === "custom" && r == "linear" && $(),
|
|
4089
|
+
q(),
|
|
4090
|
+
/* @__PURE__ */ e.jsx(sn, {}),
|
|
4104
4091
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
4105
|
-
|
|
4092
|
+
z,
|
|
4106
4093
|
{
|
|
4107
4094
|
onClick: U,
|
|
4108
4095
|
variant: "secondary",
|
|
@@ -4114,7 +4101,7 @@ function Wa() {
|
|
|
4114
4101
|
] }) })
|
|
4115
4102
|
] });
|
|
4116
4103
|
}
|
|
4117
|
-
function
|
|
4104
|
+
function Ml({ idx: s }) {
|
|
4118
4105
|
var o;
|
|
4119
4106
|
const t = m((c) => {
|
|
4120
4107
|
var p;
|
|
@@ -4126,45 +4113,45 @@ function Tl({ idx: s }) {
|
|
|
4126
4113
|
}
|
|
4127
4114
|
), n = m(
|
|
4128
4115
|
(c) => c.actions.setCardPreferences
|
|
4129
|
-
), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis,
|
|
4130
|
-
function
|
|
4131
|
-
(c === "end" || c === "start") &&
|
|
4132
|
-
const
|
|
4116
|
+
), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, r = a == null ? void 0 : a.find((c) => c.idx === s);
|
|
4117
|
+
function u(c, p) {
|
|
4118
|
+
(c === "end" || c === "start") && an(tn());
|
|
4119
|
+
const d = {
|
|
4133
4120
|
display: c !== "none",
|
|
4134
4121
|
align: c,
|
|
4135
4122
|
anchor: c,
|
|
4136
4123
|
clamp: !0
|
|
4137
4124
|
};
|
|
4138
|
-
if (!
|
|
4125
|
+
if (!r)
|
|
4139
4126
|
n({
|
|
4140
4127
|
...t,
|
|
4141
4128
|
datasetOptions: [
|
|
4142
4129
|
...a || [],
|
|
4143
4130
|
{
|
|
4144
4131
|
idx: p,
|
|
4145
|
-
datalabels:
|
|
4132
|
+
datalabels: d
|
|
4146
4133
|
}
|
|
4147
4134
|
]
|
|
4148
4135
|
});
|
|
4149
4136
|
else {
|
|
4150
|
-
const b = { ...
|
|
4151
|
-
b.datalabels =
|
|
4152
|
-
const
|
|
4137
|
+
const b = { ...r };
|
|
4138
|
+
b.datalabels = d;
|
|
4139
|
+
const j = a == null ? void 0 : a.map(
|
|
4153
4140
|
(h) => h.idx === p ? b : h
|
|
4154
4141
|
);
|
|
4155
4142
|
n({
|
|
4156
4143
|
...t,
|
|
4157
|
-
datasetOptions:
|
|
4144
|
+
datasetOptions: j
|
|
4158
4145
|
});
|
|
4159
4146
|
}
|
|
4160
4147
|
}
|
|
4161
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4162
|
-
/* @__PURE__ */ e.jsx(
|
|
4163
|
-
/* @__PURE__ */ e.jsx(
|
|
4148
|
+
return /* @__PURE__ */ e.jsxs(fs, { children: [
|
|
4149
|
+
/* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsx(Kn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
4150
|
+
/* @__PURE__ */ e.jsx(js, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
4164
4151
|
/* @__PURE__ */ e.jsx(
|
|
4165
|
-
|
|
4152
|
+
z,
|
|
4166
4153
|
{
|
|
4167
|
-
onClick: () =>
|
|
4154
|
+
onClick: () => u("none", s),
|
|
4168
4155
|
size: "sm",
|
|
4169
4156
|
variant: "secondary",
|
|
4170
4157
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4172,9 +4159,9 @@ function Tl({ idx: s }) {
|
|
|
4172
4159
|
}
|
|
4173
4160
|
),
|
|
4174
4161
|
/* @__PURE__ */ e.jsx(
|
|
4175
|
-
|
|
4162
|
+
z,
|
|
4176
4163
|
{
|
|
4177
|
-
onClick: () =>
|
|
4164
|
+
onClick: () => u("start", s),
|
|
4178
4165
|
size: "sm",
|
|
4179
4166
|
variant: "secondary",
|
|
4180
4167
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4189,9 +4176,9 @@ function Tl({ idx: s }) {
|
|
|
4189
4176
|
}
|
|
4190
4177
|
),
|
|
4191
4178
|
/* @__PURE__ */ e.jsx(
|
|
4192
|
-
|
|
4179
|
+
z,
|
|
4193
4180
|
{
|
|
4194
|
-
onClick: () =>
|
|
4181
|
+
onClick: () => u("center", s),
|
|
4195
4182
|
size: "sm",
|
|
4196
4183
|
variant: "secondary",
|
|
4197
4184
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4206,9 +4193,9 @@ function Tl({ idx: s }) {
|
|
|
4206
4193
|
}
|
|
4207
4194
|
),
|
|
4208
4195
|
/* @__PURE__ */ e.jsx(
|
|
4209
|
-
|
|
4196
|
+
z,
|
|
4210
4197
|
{
|
|
4211
|
-
onClick: () =>
|
|
4198
|
+
onClick: () => u("end", s),
|
|
4212
4199
|
size: "sm",
|
|
4213
4200
|
variant: "secondary",
|
|
4214
4201
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4228,25 +4215,25 @@ function Tl({ idx: s }) {
|
|
|
4228
4215
|
function Ya() {
|
|
4229
4216
|
const s = m((p) => p.card), t = m(
|
|
4230
4217
|
(p) => {
|
|
4231
|
-
var
|
|
4232
|
-
return (
|
|
4218
|
+
var d, b, j;
|
|
4219
|
+
return (j = (b = (d = p == null ? void 0 : p.card) == null ? void 0 : d.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : j.indexAxis;
|
|
4233
4220
|
}
|
|
4234
4221
|
), { data: a } = Re(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
|
|
4235
|
-
keys:
|
|
4236
|
-
metricKeys:
|
|
4222
|
+
keys: r,
|
|
4223
|
+
metricKeys: u,
|
|
4237
4224
|
dimensionKeys: o
|
|
4238
|
-
} =
|
|
4239
|
-
let c =
|
|
4225
|
+
} = ws((a == null ? void 0 : a.records) || []);
|
|
4226
|
+
let c = u;
|
|
4240
4227
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4241
|
-
const p =
|
|
4228
|
+
const p = nn({
|
|
4242
4229
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4243
4230
|
groupKey: o[0],
|
|
4244
4231
|
pivotKey: o[1],
|
|
4245
4232
|
valueKey: c[0]
|
|
4246
|
-
}), { metricKeys:
|
|
4247
|
-
c =
|
|
4233
|
+
}), { metricKeys: d } = ws(p);
|
|
4234
|
+
c = d;
|
|
4248
4235
|
}
|
|
4249
|
-
return
|
|
4236
|
+
return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4250
4237
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4251
4238
|
/* @__PURE__ */ e.jsx(_, { children: n }),
|
|
4252
4239
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: o[0] }) }) })
|
|
@@ -4256,7 +4243,7 @@ function Ya() {
|
|
|
4256
4243
|
/* @__PURE__ */ e.jsx(_, { children: l }),
|
|
4257
4244
|
/* @__PURE__ */ e.jsx(Wa, {})
|
|
4258
4245
|
] }),
|
|
4259
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((p,
|
|
4246
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((p, d) => /* @__PURE__ */ e.jsx(El, { col: p, idx: d }, p)) })
|
|
4260
4247
|
] })
|
|
4261
4248
|
] });
|
|
4262
4249
|
}
|
|
@@ -4269,10 +4256,10 @@ function El({ col: s, idx: t }) {
|
|
|
4269
4256
|
var c;
|
|
4270
4257
|
return (c = o.card.preferences) == null ? void 0 : c.datasetOptions;
|
|
4271
4258
|
}
|
|
4272
|
-
), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences:
|
|
4273
|
-
function
|
|
4259
|
+
), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: r } = m((o) => o.actions);
|
|
4260
|
+
function u(o) {
|
|
4274
4261
|
if (!l)
|
|
4275
|
-
|
|
4262
|
+
r({
|
|
4276
4263
|
...a,
|
|
4277
4264
|
datasetOptions: [
|
|
4278
4265
|
...n || [],
|
|
@@ -4287,9 +4274,9 @@ function El({ col: s, idx: t }) {
|
|
|
4287
4274
|
const c = { ...l };
|
|
4288
4275
|
c.type = o === "area" ? "line" : o, c.fill = o === "area" ? "origin" : "";
|
|
4289
4276
|
const p = n == null ? void 0 : n.map(
|
|
4290
|
-
(
|
|
4277
|
+
(d) => d.idx === t ? c : d
|
|
4291
4278
|
);
|
|
4292
|
-
|
|
4279
|
+
r({
|
|
4293
4280
|
...a,
|
|
4294
4281
|
datasetOptions: p
|
|
4295
4282
|
});
|
|
@@ -4301,84 +4288,82 @@ function El({ col: s, idx: t }) {
|
|
|
4301
4288
|
/* @__PURE__ */ e.jsx(
|
|
4302
4289
|
Bs,
|
|
4303
4290
|
{
|
|
4304
|
-
onClick: () =>
|
|
4291
|
+
onClick: () => u("bar"),
|
|
4305
4292
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4306
4293
|
}
|
|
4307
4294
|
),
|
|
4308
4295
|
/* @__PURE__ */ e.jsx(
|
|
4309
4296
|
Us,
|
|
4310
4297
|
{
|
|
4311
|
-
onClick: () =>
|
|
4298
|
+
onClick: () => u("line"),
|
|
4312
4299
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4313
4300
|
}
|
|
4314
4301
|
),
|
|
4315
4302
|
/* @__PURE__ */ e.jsx(
|
|
4316
|
-
|
|
4303
|
+
zn,
|
|
4317
4304
|
{
|
|
4318
|
-
onClick: () =>
|
|
4305
|
+
onClick: () => u("area"),
|
|
4319
4306
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4320
4307
|
}
|
|
4321
4308
|
),
|
|
4322
|
-
/* @__PURE__ */ e.jsx(
|
|
4309
|
+
/* @__PURE__ */ e.jsx(Ml, { idx: t })
|
|
4323
4310
|
] })
|
|
4324
4311
|
] });
|
|
4325
4312
|
}
|
|
4326
4313
|
function Xa() {
|
|
4327
|
-
const s = m((
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
let M = ga(
|
|
4334
|
-
I,
|
|
4314
|
+
const s = m((j) => j.selectedConnectionId), t = m((j) => j.selectedDatamodelId), a = m((j) => j.selectedDatabaseName), n = m((j) => j.selectedSchemaName), l = m((j) => j.selectedTableName), r = I((j) => j.dashboard.filters) || [], u = I((j) => j.actions.addFilter), o = I((j) => j.actions.removeFilter), { removeFilterValues: c } = xs(), { modelItems: p, tableName: d } = _e();
|
|
4315
|
+
function b(j, h = "dashboard") {
|
|
4316
|
+
var F;
|
|
4317
|
+
const g = de(j.column_name), C = de(a || ""), O = de(n || ""), y = de(d);
|
|
4318
|
+
let L = ga(
|
|
4319
|
+
O,
|
|
4335
4320
|
y
|
|
4336
|
-
),
|
|
4337
|
-
const A = (
|
|
4321
|
+
), D = `${L}.${g}`;
|
|
4322
|
+
const A = (F = p == null ? void 0 : p.find(
|
|
4338
4323
|
(E) => E.id === t
|
|
4339
|
-
)) == null ? void 0 :
|
|
4340
|
-
t && t !== "none" && (
|
|
4341
|
-
const N =
|
|
4342
|
-
(E) => E.column ===
|
|
4324
|
+
)) == null ? void 0 : F.name;
|
|
4325
|
+
t && t !== "none" && (D = `${Ss}.${A}.${g}`, L = `${Ss}.${A}`);
|
|
4326
|
+
const N = r == null ? void 0 : r.find(
|
|
4327
|
+
(E) => E.column === D && E.table === y && (E.database === C || E.database === a)
|
|
4343
4328
|
);
|
|
4344
4329
|
if (N)
|
|
4345
4330
|
c(N.id), o(N.id);
|
|
4346
4331
|
else {
|
|
4347
4332
|
const E = Ke();
|
|
4348
|
-
return
|
|
4333
|
+
return d === "api" && s ? (u({
|
|
4349
4334
|
location: h,
|
|
4350
4335
|
id: E,
|
|
4351
4336
|
//uuidv4(),
|
|
4352
|
-
column:
|
|
4353
|
-
title:
|
|
4354
|
-
dataType:
|
|
4337
|
+
column: D,
|
|
4338
|
+
title: j.column_name,
|
|
4339
|
+
dataType: j.data_type,
|
|
4355
4340
|
table: "api",
|
|
4356
4341
|
database: "",
|
|
4357
4342
|
// database: 'NA',
|
|
4358
4343
|
connectionId: s,
|
|
4359
4344
|
operation: "in",
|
|
4360
4345
|
sql: Zs(
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4346
|
+
j.data_type,
|
|
4347
|
+
L,
|
|
4348
|
+
g
|
|
4364
4349
|
)
|
|
4365
4350
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4366
|
-
}), E) : (
|
|
4351
|
+
}), E) : (u({
|
|
4367
4352
|
id: E,
|
|
4368
4353
|
//uuidv4(),
|
|
4369
4354
|
location: h,
|
|
4370
|
-
column:
|
|
4355
|
+
column: D,
|
|
4371
4356
|
//columnName, //`${qualifiedTableName}.${formattedColumnName}`,
|
|
4372
|
-
title:
|
|
4373
|
-
dataType:
|
|
4357
|
+
title: j.column_name,
|
|
4358
|
+
dataType: j.data_type,
|
|
4374
4359
|
table: l || "",
|
|
4375
4360
|
database: a || "",
|
|
4376
4361
|
connectionId: s || "",
|
|
4377
4362
|
operation: "in",
|
|
4378
4363
|
sql: Zs(
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4364
|
+
j.data_type,
|
|
4365
|
+
L,
|
|
4366
|
+
g
|
|
4382
4367
|
)
|
|
4383
4368
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4384
4369
|
}), E);
|
|
@@ -4387,29 +4372,29 @@ function Xa() {
|
|
|
4387
4372
|
return { assignFilter: b };
|
|
4388
4373
|
}
|
|
4389
4374
|
function He() {
|
|
4390
|
-
const s =
|
|
4375
|
+
const s = I(
|
|
4391
4376
|
(o) => o.dashboard.filters
|
|
4392
4377
|
), t = m((o) => o.frame), { setFrame: a } = ie(), { columns: n } = _e(), { assignFilter: l } = Xa();
|
|
4393
|
-
function
|
|
4378
|
+
function r(o) {
|
|
4394
4379
|
const c = l(o, "frame");
|
|
4395
4380
|
a({ ...t, filterId: c });
|
|
4396
4381
|
}
|
|
4397
|
-
const
|
|
4382
|
+
const u = s == null ? void 0 : s.find((o) => o.id === t.filterId);
|
|
4398
4383
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4399
4384
|
/* @__PURE__ */ e.jsx(_, { children: "Card Filter" }),
|
|
4400
|
-
/* @__PURE__ */ e.jsx(Al, { onSelect:
|
|
4401
|
-
|
|
4385
|
+
/* @__PURE__ */ e.jsx(Al, { onSelect: r, columns: n }),
|
|
4386
|
+
u && /* @__PURE__ */ e.jsx(ln, { filter: u })
|
|
4402
4387
|
] });
|
|
4403
4388
|
}
|
|
4404
4389
|
function Al({
|
|
4405
4390
|
columns: s,
|
|
4406
4391
|
onSelect: t
|
|
4407
4392
|
}) {
|
|
4408
|
-
var
|
|
4409
|
-
const [a, n] = ea.useState(!1), [l,
|
|
4410
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4411
|
-
/* @__PURE__ */ e.jsx(
|
|
4412
|
-
|
|
4393
|
+
var u;
|
|
4394
|
+
const [a, n] = ea.useState(!1), [l, r] = ea.useState("");
|
|
4395
|
+
return /* @__PURE__ */ e.jsxs(fs, { open: a, onOpenChange: n, children: [
|
|
4396
|
+
/* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4397
|
+
z,
|
|
4413
4398
|
{
|
|
4414
4399
|
size: "sm",
|
|
4415
4400
|
variant: "outline",
|
|
@@ -4417,22 +4402,22 @@ function Al({
|
|
|
4417
4402
|
"aria-expanded": a,
|
|
4418
4403
|
className: "w-full justify-between font-normal",
|
|
4419
4404
|
children: [
|
|
4420
|
-
l ? (
|
|
4421
|
-
/* @__PURE__ */ e.jsx(
|
|
4405
|
+
l ? (u = s.find((o) => o.column_name === l)) == null ? void 0 : u.column_name : "Select Column...",
|
|
4406
|
+
/* @__PURE__ */ e.jsx(rn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4422
4407
|
]
|
|
4423
4408
|
}
|
|
4424
4409
|
) }),
|
|
4425
|
-
/* @__PURE__ */ e.jsx(
|
|
4426
|
-
/* @__PURE__ */ e.jsx(
|
|
4427
|
-
/* @__PURE__ */ e.jsxs(
|
|
4428
|
-
/* @__PURE__ */ e.jsx(
|
|
4429
|
-
/* @__PURE__ */ e.jsx(
|
|
4430
|
-
|
|
4410
|
+
/* @__PURE__ */ e.jsx(js, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(on, { children: [
|
|
4411
|
+
/* @__PURE__ */ e.jsx(cn, { placeholder: "Search column", className: "h-9" }),
|
|
4412
|
+
/* @__PURE__ */ e.jsxs(dn, { children: [
|
|
4413
|
+
/* @__PURE__ */ e.jsx(un, { children: "No framework found." }),
|
|
4414
|
+
/* @__PURE__ */ e.jsx(mn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
|
|
4415
|
+
hn,
|
|
4431
4416
|
{
|
|
4432
4417
|
value: o.column_name,
|
|
4433
4418
|
onSelect: (c) => {
|
|
4434
4419
|
const p = c === l ? "" : c;
|
|
4435
|
-
|
|
4420
|
+
r(p), n(!1), p && t(o);
|
|
4436
4421
|
},
|
|
4437
4422
|
children: [
|
|
4438
4423
|
o.column_name,
|
|
@@ -4456,7 +4441,7 @@ function Al({
|
|
|
4456
4441
|
function Vl({
|
|
4457
4442
|
cardType: s
|
|
4458
4443
|
}) {
|
|
4459
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
4444
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4460
4445
|
/* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
|
|
4461
4446
|
/* @__PURE__ */ e.jsx(Q, { children: `${Ps(s)} Chart` }),
|
|
4462
4447
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -4485,26 +4470,26 @@ function Vl({
|
|
|
4485
4470
|
/* @__PURE__ */ e.jsxs(G, { value: "item-2", children: [
|
|
4486
4471
|
/* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
|
|
4487
4472
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
|
|
4488
|
-
/* @__PURE__ */ e.jsx(
|
|
4473
|
+
/* @__PURE__ */ e.jsx(ys, {}),
|
|
4489
4474
|
/* @__PURE__ */ e.jsx(Ya, {})
|
|
4490
4475
|
] })
|
|
4491
4476
|
] }),
|
|
4492
4477
|
/* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
|
|
4493
4478
|
/* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
|
|
4494
4479
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
|
|
4495
|
-
/* @__PURE__ */ e.jsx(
|
|
4480
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
4496
4481
|
/* @__PURE__ */ e.jsx(He, {})
|
|
4497
4482
|
] })
|
|
4498
4483
|
] })
|
|
4499
4484
|
] }) });
|
|
4500
4485
|
}
|
|
4501
4486
|
function Qs() {
|
|
4502
|
-
var l,
|
|
4487
|
+
var l, r, u;
|
|
4503
4488
|
const s = m(
|
|
4504
4489
|
(o) => o.card.cfg
|
|
4505
4490
|
), t = m((o) => o.actions.setCardCfg), a = m((o) => o.card.type);
|
|
4506
4491
|
function n(o) {
|
|
4507
|
-
var
|
|
4492
|
+
var d;
|
|
4508
4493
|
const c = {
|
|
4509
4494
|
datalabels: {
|
|
4510
4495
|
display: o !== "none",
|
|
@@ -4517,7 +4502,7 @@ function Qs() {
|
|
|
4517
4502
|
options: {
|
|
4518
4503
|
...s == null ? void 0 : s.options,
|
|
4519
4504
|
plugins: {
|
|
4520
|
-
...(
|
|
4505
|
+
...(d = s == null ? void 0 : s.options) == null ? void 0 : d.plugins,
|
|
4521
4506
|
...c
|
|
4522
4507
|
}
|
|
4523
4508
|
}
|
|
@@ -4532,7 +4517,7 @@ function Qs() {
|
|
|
4532
4517
|
/* @__PURE__ */ e.jsxs(
|
|
4533
4518
|
me,
|
|
4534
4519
|
{
|
|
4535
|
-
value: (
|
|
4520
|
+
value: (u = (r = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : u.anchor,
|
|
4536
4521
|
onValueChange: n,
|
|
4537
4522
|
defaultValue: "none",
|
|
4538
4523
|
children: [
|
|
@@ -4568,7 +4553,7 @@ function ql({
|
|
|
4568
4553
|
"a",
|
|
4569
4554
|
{
|
|
4570
4555
|
target: "_blank",
|
|
4571
|
-
onClick: (
|
|
4556
|
+
onClick: (r) => r.stopPropagation(),
|
|
4572
4557
|
className: "text-blue-700",
|
|
4573
4558
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
4574
4559
|
children: "example"
|
|
@@ -4578,7 +4563,7 @@ function ql({
|
|
|
4578
4563
|
] })
|
|
4579
4564
|
] });
|
|
4580
4565
|
}
|
|
4581
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
4566
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4582
4567
|
/* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
|
|
4583
4568
|
/* @__PURE__ */ e.jsx(Q, { children: `${Ps(s)} Chart` }),
|
|
4584
4569
|
/* @__PURE__ */ e.jsx(J, { className: "space-y-4 font-mono text-xs", children: t(s) })
|
|
@@ -4590,7 +4575,7 @@ function ql({
|
|
|
4590
4575
|
/* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
|
|
4591
4576
|
/* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
|
|
4592
4577
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
|
|
4593
|
-
/* @__PURE__ */ e.jsx(
|
|
4578
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
4594
4579
|
/* @__PURE__ */ e.jsx(He, {})
|
|
4595
4580
|
] })
|
|
4596
4581
|
] })
|
|
@@ -4623,7 +4608,7 @@ function Hl() {
|
|
|
4623
4608
|
const s = m((t) => t.card.type);
|
|
4624
4609
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
4625
4610
|
/* @__PURE__ */ e.jsx(
|
|
4626
|
-
|
|
4611
|
+
Le,
|
|
4627
4612
|
{
|
|
4628
4613
|
className: " ",
|
|
4629
4614
|
type: "single",
|
|
@@ -4631,10 +4616,10 @@ function Hl() {
|
|
|
4631
4616
|
children: $l(s)
|
|
4632
4617
|
}
|
|
4633
4618
|
),
|
|
4634
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
4619
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(ys, {}) }),
|
|
4635
4620
|
!["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4636
4621
|
/* @__PURE__ */ e.jsx(Qs, {}),
|
|
4637
|
-
/* @__PURE__ */ e.jsx(
|
|
4622
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
4638
4623
|
/* @__PURE__ */ e.jsx(He, {})
|
|
4639
4624
|
] })
|
|
4640
4625
|
] });
|
|
@@ -4737,7 +4722,7 @@ function $l(s) {
|
|
|
4737
4722
|
] }) });
|
|
4738
4723
|
}
|
|
4739
4724
|
function Pl() {
|
|
4740
|
-
var c, p,
|
|
4725
|
+
var c, p, d, b, j;
|
|
4741
4726
|
const s = m((h) => h.card.preferences), t = m(
|
|
4742
4727
|
(h) => h.actions.setCardPreferences
|
|
4743
4728
|
), a = m(
|
|
@@ -4745,30 +4730,30 @@ function Pl() {
|
|
|
4745
4730
|
);
|
|
4746
4731
|
m(
|
|
4747
4732
|
(h) => {
|
|
4748
|
-
var
|
|
4749
|
-
return (C = (
|
|
4733
|
+
var g, C;
|
|
4734
|
+
return (C = (g = h.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : C.decimalPlaces;
|
|
4750
4735
|
}
|
|
4751
4736
|
);
|
|
4752
4737
|
const n = m(
|
|
4753
4738
|
(h) => {
|
|
4754
|
-
var
|
|
4755
|
-
return (C = (
|
|
4739
|
+
var g, C;
|
|
4740
|
+
return (C = (g = h.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : C.locale;
|
|
4756
4741
|
}
|
|
4757
4742
|
), l = m(
|
|
4758
4743
|
(h) => {
|
|
4759
|
-
var
|
|
4760
|
-
return (C = (
|
|
4744
|
+
var g, C;
|
|
4745
|
+
return (C = (g = h.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : C.currency;
|
|
4761
4746
|
}
|
|
4762
4747
|
);
|
|
4763
4748
|
m(
|
|
4764
4749
|
(h) => h.actions.setFilterOnClickField
|
|
4765
4750
|
);
|
|
4766
|
-
const
|
|
4751
|
+
const r = m(
|
|
4767
4752
|
(h) => {
|
|
4768
|
-
var
|
|
4769
|
-
return (C = (
|
|
4753
|
+
var g, C;
|
|
4754
|
+
return (C = (g = h.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : C.colorRanges;
|
|
4770
4755
|
}
|
|
4771
|
-
) || [],
|
|
4756
|
+
) || [], u = m(
|
|
4772
4757
|
(h) => h.actions.setColorRanges
|
|
4773
4758
|
), o = [...new Set(us.map((h) => h.currency))];
|
|
4774
4759
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
@@ -4800,12 +4785,12 @@ function Pl() {
|
|
|
4800
4785
|
{
|
|
4801
4786
|
value: n || "none",
|
|
4802
4787
|
onValueChange: (h) => {
|
|
4803
|
-
var
|
|
4788
|
+
var g, C, O;
|
|
4804
4789
|
return a(
|
|
4805
|
-
((
|
|
4790
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
|
|
4806
4791
|
((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.currency) || "",
|
|
4807
4792
|
h,
|
|
4808
|
-
((
|
|
4793
|
+
((O = s == null ? void 0 : s.formatNumber) == null ? void 0 : O.suffix) || ""
|
|
4809
4794
|
);
|
|
4810
4795
|
},
|
|
4811
4796
|
children: [
|
|
@@ -4826,12 +4811,12 @@ function Pl() {
|
|
|
4826
4811
|
{
|
|
4827
4812
|
value: l || "none",
|
|
4828
4813
|
onValueChange: (h) => {
|
|
4829
|
-
var
|
|
4814
|
+
var g, C, O;
|
|
4830
4815
|
console.log("currency", h), a(
|
|
4831
|
-
((
|
|
4816
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
|
|
4832
4817
|
h === "none" ? "" : h,
|
|
4833
4818
|
((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.locale) || "",
|
|
4834
|
-
((
|
|
4819
|
+
((O = s == null ? void 0 : s.formatNumber) == null ? void 0 : O.suffix) || ""
|
|
4835
4820
|
);
|
|
4836
4821
|
},
|
|
4837
4822
|
children: [
|
|
@@ -4852,14 +4837,14 @@ function Pl() {
|
|
|
4852
4837
|
/* @__PURE__ */ e.jsxs(
|
|
4853
4838
|
me,
|
|
4854
4839
|
{
|
|
4855
|
-
value: ((b = (
|
|
4840
|
+
value: ((b = (d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.decimalPlaces) == null ? void 0 : b.toString()) || "0",
|
|
4856
4841
|
onValueChange: (h) => {
|
|
4857
|
-
var
|
|
4842
|
+
var g, C, O;
|
|
4858
4843
|
return a(
|
|
4859
4844
|
Number(h),
|
|
4860
|
-
((
|
|
4845
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
|
|
4861
4846
|
((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.locale) || "",
|
|
4862
|
-
((
|
|
4847
|
+
((O = s == null ? void 0 : s.formatNumber) == null ? void 0 : O.suffix) || ""
|
|
4863
4848
|
);
|
|
4864
4849
|
},
|
|
4865
4850
|
children: [
|
|
@@ -4874,15 +4859,15 @@ function Pl() {
|
|
|
4874
4859
|
/* @__PURE__ */ e.jsx(
|
|
4875
4860
|
re,
|
|
4876
4861
|
{
|
|
4877
|
-
value: ((
|
|
4862
|
+
value: ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || "",
|
|
4878
4863
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
4879
4864
|
placeholder: "K, M, B, %",
|
|
4880
4865
|
onChange: (h) => {
|
|
4881
|
-
var
|
|
4866
|
+
var g, C, O;
|
|
4882
4867
|
return a(
|
|
4883
|
-
((
|
|
4868
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
|
|
4884
4869
|
((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.currency) || "",
|
|
4885
|
-
((
|
|
4870
|
+
((O = s == null ? void 0 : s.formatNumber) == null ? void 0 : O.locale) || "",
|
|
4886
4871
|
h.target.value
|
|
4887
4872
|
);
|
|
4888
4873
|
}
|
|
@@ -4893,10 +4878,10 @@ function Pl() {
|
|
|
4893
4878
|
] }) }),
|
|
4894
4879
|
/* @__PURE__ */ e.jsx(we, { className: "my-3" }),
|
|
4895
4880
|
/* @__PURE__ */ e.jsx(
|
|
4896
|
-
|
|
4881
|
+
xn,
|
|
4897
4882
|
{
|
|
4898
|
-
colorRanges:
|
|
4899
|
-
setColorRanges:
|
|
4883
|
+
colorRanges: r,
|
|
4884
|
+
setColorRanges: u
|
|
4900
4885
|
}
|
|
4901
4886
|
)
|
|
4902
4887
|
] })
|
|
@@ -4904,7 +4889,7 @@ function Pl() {
|
|
|
4904
4889
|
}
|
|
4905
4890
|
function Bl() {
|
|
4906
4891
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4907
|
-
/* @__PURE__ */ e.jsx(
|
|
4892
|
+
/* @__PURE__ */ e.jsx(Le, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
|
|
4908
4893
|
/* @__PURE__ */ e.jsx(Q, { className: "", children: "KPI Query" }),
|
|
4909
4894
|
/* @__PURE__ */ e.jsxs(J, { className: "font-mono", children: [
|
|
4910
4895
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
@@ -5034,10 +5019,10 @@ const Ul = [
|
|
|
5034
5019
|
value: s
|
|
5035
5020
|
}));
|
|
5036
5021
|
function Jl() {
|
|
5037
|
-
var c, p,
|
|
5022
|
+
var c, p, d, b, j, h, g, C, O, y, L, D, A, N, F, E, x, v;
|
|
5038
5023
|
const s = m((f) => f.card), t = (p = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, n] = V(
|
|
5039
|
-
((b = (
|
|
5040
|
-
), { setCardPreferences: l } = ie(), { data:
|
|
5024
|
+
((b = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
|
|
5025
|
+
), { setCardPreferences: l } = ie(), { data: r } = Hs(s), u = Object.keys((r == null ? void 0 : r.objects) || {}).map((f) => ({
|
|
5041
5026
|
label: f,
|
|
5042
5027
|
value: f
|
|
5043
5028
|
})) || [], o = [
|
|
@@ -5097,15 +5082,15 @@ function Jl() {
|
|
|
5097
5082
|
placeholder: "Custom URL"
|
|
5098
5083
|
}
|
|
5099
5084
|
),
|
|
5100
|
-
|
|
5085
|
+
r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
5101
5086
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
5102
5087
|
/* @__PURE__ */ e.jsx(_, { children: "Map Object" }),
|
|
5103
5088
|
/* @__PURE__ */ e.jsx(
|
|
5104
5089
|
ue,
|
|
5105
5090
|
{
|
|
5106
5091
|
className: "h-9",
|
|
5107
|
-
options:
|
|
5108
|
-
value: ((h = (
|
|
5092
|
+
options: u,
|
|
5093
|
+
value: ((h = (j = s.preferences) == null ? void 0 : j.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
|
|
5109
5094
|
label: "Map Object",
|
|
5110
5095
|
onValueChange: (f) => {
|
|
5111
5096
|
var k;
|
|
@@ -5127,7 +5112,7 @@ function Jl() {
|
|
|
5127
5112
|
{
|
|
5128
5113
|
className: "h-9",
|
|
5129
5114
|
options: Ul,
|
|
5130
|
-
value: ((C = (
|
|
5115
|
+
value: ((C = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : C.projection) || "",
|
|
5131
5116
|
label: "Projection",
|
|
5132
5117
|
onValueChange: (f) => {
|
|
5133
5118
|
var k;
|
|
@@ -5149,7 +5134,7 @@ function Jl() {
|
|
|
5149
5134
|
{
|
|
5150
5135
|
className: "h-9",
|
|
5151
5136
|
options: Ql,
|
|
5152
|
-
value: ((y = (
|
|
5137
|
+
value: ((y = (O = s.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : y.colorScale) || "",
|
|
5153
5138
|
label: "Select Color Scale",
|
|
5154
5139
|
onValueChange: (f) => {
|
|
5155
5140
|
var k;
|
|
@@ -5174,7 +5159,7 @@ function Jl() {
|
|
|
5174
5159
|
className: `h-9 w-full ${Ue}`,
|
|
5175
5160
|
type: "number",
|
|
5176
5161
|
step: 0.1,
|
|
5177
|
-
value: ((
|
|
5162
|
+
value: ((D = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : D.projectionScale) || 1,
|
|
5178
5163
|
onChange: (f) => {
|
|
5179
5164
|
var k;
|
|
5180
5165
|
l({
|
|
@@ -5194,16 +5179,16 @@ function Jl() {
|
|
|
5194
5179
|
className: `h-9 w-full ${Ue}`,
|
|
5195
5180
|
type: "number",
|
|
5196
5181
|
step: 10,
|
|
5197
|
-
value: ((
|
|
5182
|
+
value: ((F = (N = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : F[0]) || 0,
|
|
5198
5183
|
onChange: (f) => {
|
|
5199
|
-
var k, S,
|
|
5184
|
+
var k, S, q, $;
|
|
5200
5185
|
l({
|
|
5201
5186
|
...s.preferences,
|
|
5202
5187
|
mapVisualOptions: {
|
|
5203
5188
|
...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
|
|
5204
5189
|
projectionOffset: [
|
|
5205
5190
|
Number(f.target.value),
|
|
5206
|
-
(($ = (
|
|
5191
|
+
(($ = (q = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : q.projectionOffset) == null ? void 0 : $[1]) || 0
|
|
5207
5192
|
]
|
|
5208
5193
|
}
|
|
5209
5194
|
});
|
|
@@ -5219,13 +5204,13 @@ function Jl() {
|
|
|
5219
5204
|
step: 10,
|
|
5220
5205
|
value: ((v = (x = (E = s.preferences) == null ? void 0 : E.mapVisualOptions) == null ? void 0 : x.projectionOffset) == null ? void 0 : v[1]) || 0,
|
|
5221
5206
|
onChange: (f) => {
|
|
5222
|
-
var k, S,
|
|
5207
|
+
var k, S, q, $;
|
|
5223
5208
|
l({
|
|
5224
5209
|
...s.preferences,
|
|
5225
5210
|
mapVisualOptions: {
|
|
5226
5211
|
...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
|
|
5227
5212
|
projectionOffset: [
|
|
5228
|
-
(($ = (
|
|
5213
|
+
(($ = (q = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : q.projectionOffset) == null ? void 0 : $[0]) || 0,
|
|
5229
5214
|
Number(f.target.value)
|
|
5230
5215
|
]
|
|
5231
5216
|
}
|
|
@@ -5235,7 +5220,7 @@ function Jl() {
|
|
|
5235
5220
|
)
|
|
5236
5221
|
] }) }),
|
|
5237
5222
|
/* @__PURE__ */ e.jsx(we, { className: "my-4" }),
|
|
5238
|
-
/* @__PURE__ */ e.jsx(
|
|
5223
|
+
/* @__PURE__ */ e.jsx(Me, {})
|
|
5239
5224
|
] });
|
|
5240
5225
|
}
|
|
5241
5226
|
function Kl() {
|
|
@@ -5251,7 +5236,7 @@ function Kl() {
|
|
|
5251
5236
|
});
|
|
5252
5237
|
}
|
|
5253
5238
|
return /* @__PURE__ */ e.jsxs(
|
|
5254
|
-
|
|
5239
|
+
bs,
|
|
5255
5240
|
{
|
|
5256
5241
|
value: (n = s == null ? void 0 : s.textVisualOptions) != null && n.isDynamicText ? "dynamic" : "static",
|
|
5257
5242
|
onValueChange: a,
|
|
@@ -5259,11 +5244,11 @@ function Kl() {
|
|
|
5259
5244
|
defaultValue: "x",
|
|
5260
5245
|
children: [
|
|
5261
5246
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5262
|
-
/* @__PURE__ */ e.jsx(
|
|
5247
|
+
/* @__PURE__ */ e.jsx(Te, { value: "static", id: "r1" }),
|
|
5263
5248
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
|
|
5264
5249
|
] }),
|
|
5265
5250
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5266
|
-
/* @__PURE__ */ e.jsx(
|
|
5251
|
+
/* @__PURE__ */ e.jsx(Te, { value: "dynamic", id: "r2" }),
|
|
5267
5252
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
|
|
5268
5253
|
] })
|
|
5269
5254
|
]
|
|
@@ -5276,7 +5261,7 @@ function ls({
|
|
|
5276
5261
|
suffix: a = "Chart"
|
|
5277
5262
|
}) {
|
|
5278
5263
|
let n = "pie-chart";
|
|
5279
|
-
return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
5264
|
+
return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
5280
5265
|
/* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
|
|
5281
5266
|
/* @__PURE__ */ e.jsx(Q, { children: `${Ps(s)} ${a}` }),
|
|
5282
5267
|
/* @__PURE__ */ e.jsx(J, { children: t || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -5304,7 +5289,7 @@ function ls({
|
|
|
5304
5289
|
/* @__PURE__ */ e.jsxs(G, { value: "item-2", children: [
|
|
5305
5290
|
/* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
|
|
5306
5291
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
|
|
5307
|
-
s === "range" && /* @__PURE__ */ e.jsx(
|
|
5292
|
+
s === "range" && /* @__PURE__ */ e.jsx(ys, {}),
|
|
5308
5293
|
s !== "text" && /* @__PURE__ */ e.jsx(Qs, {}),
|
|
5309
5294
|
s === "text" && /* @__PURE__ */ e.jsx(Kl, {})
|
|
5310
5295
|
] })
|
|
@@ -5312,7 +5297,7 @@ function ls({
|
|
|
5312
5297
|
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
|
|
5313
5298
|
/* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
|
|
5314
5299
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
|
|
5315
|
-
/* @__PURE__ */ e.jsx(
|
|
5300
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
5316
5301
|
/* @__PURE__ */ e.jsx(He, {})
|
|
5317
5302
|
] })
|
|
5318
5303
|
] })
|
|
@@ -5321,8 +5306,8 @@ function ls({
|
|
|
5321
5306
|
function Wl() {
|
|
5322
5307
|
const s = m(
|
|
5323
5308
|
(n) => {
|
|
5324
|
-
var l,
|
|
5325
|
-
return (
|
|
5309
|
+
var l, r;
|
|
5310
|
+
return (r = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : r.sortChart;
|
|
5326
5311
|
}
|
|
5327
5312
|
), { setSortChart: t } = ie();
|
|
5328
5313
|
function a() {
|
|
@@ -5355,7 +5340,7 @@ function Wl() {
|
|
|
5355
5340
|
)
|
|
5356
5341
|
] });
|
|
5357
5342
|
}
|
|
5358
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
5343
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
5359
5344
|
/* @__PURE__ */ e.jsxs(G, { value: "item-1", children: [
|
|
5360
5345
|
/* @__PURE__ */ e.jsx(Q, { children: "Stacked Chart" }),
|
|
5361
5346
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -5384,7 +5369,7 @@ function Wl() {
|
|
|
5384
5369
|
/* @__PURE__ */ e.jsxs(G, { value: "item-2", children: [
|
|
5385
5370
|
/* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
|
|
5386
5371
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
|
|
5387
|
-
/* @__PURE__ */ e.jsx(
|
|
5372
|
+
/* @__PURE__ */ e.jsx(ys, {}),
|
|
5388
5373
|
a(),
|
|
5389
5374
|
/* @__PURE__ */ e.jsx(Ya, {})
|
|
5390
5375
|
] })
|
|
@@ -5392,7 +5377,7 @@ function Wl() {
|
|
|
5392
5377
|
/* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
|
|
5393
5378
|
/* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
|
|
5394
5379
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
|
|
5395
|
-
/* @__PURE__ */ e.jsx(
|
|
5380
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
5396
5381
|
/* @__PURE__ */ e.jsx(He, {})
|
|
5397
5382
|
] })
|
|
5398
5383
|
] })
|
|
@@ -5411,10 +5396,10 @@ function Yl({}) {
|
|
|
5411
5396
|
});
|
|
5412
5397
|
};
|
|
5413
5398
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
5414
|
-
/* @__PURE__ */ e.jsx(
|
|
5399
|
+
/* @__PURE__ */ e.jsx(Le, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(G, { value: "item-3", children: [
|
|
5415
5400
|
/* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
|
|
5416
5401
|
/* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
|
|
5417
|
-
/* @__PURE__ */ e.jsx(
|
|
5402
|
+
/* @__PURE__ */ e.jsx(Me, {}),
|
|
5418
5403
|
/* @__PURE__ */ e.jsx(He, {})
|
|
5419
5404
|
] })
|
|
5420
5405
|
] }) }),
|
|
@@ -5518,7 +5503,7 @@ function sr() {
|
|
|
5518
5503
|
case "map":
|
|
5519
5504
|
return /* @__PURE__ */ e.jsx(Jl, {});
|
|
5520
5505
|
case "custom":
|
|
5521
|
-
return /* @__PURE__ */ e.jsx(
|
|
5506
|
+
return /* @__PURE__ */ e.jsx(Ll, {});
|
|
5522
5507
|
default:
|
|
5523
5508
|
return /* @__PURE__ */ e.jsx(Hl, {});
|
|
5524
5509
|
}
|
|
@@ -5572,14 +5557,14 @@ function ar() {
|
|
|
5572
5557
|
);
|
|
5573
5558
|
}
|
|
5574
5559
|
function tr({ authToken: s, onSave: t, onClose: a }) {
|
|
5575
|
-
|
|
5576
|
-
const n = m((
|
|
5560
|
+
I((u) => u.themeStyle);
|
|
5561
|
+
const n = m((u) => u.actions.setOnSave), l = m((u) => u.actions.setOnClose), r = I((u) => u.actions.setAuthToken);
|
|
5577
5562
|
return se(() => {
|
|
5578
5563
|
t && n(t), a && l(a);
|
|
5579
5564
|
}, [t, n, a, l]), se(() => {
|
|
5580
|
-
s && s.accessToken &&
|
|
5581
|
-
}, [s,
|
|
5582
|
-
|
|
5565
|
+
s && s.accessToken && r(s);
|
|
5566
|
+
}, [s, r]), /* @__PURE__ */ e.jsx(ps, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(
|
|
5567
|
+
pn,
|
|
5583
5568
|
{
|
|
5584
5569
|
style: {
|
|
5585
5570
|
// borderRadius: currentStyle?.chart?.options?.borderRadius,
|
|
@@ -5588,19 +5573,19 @@ function tr({ authToken: s, onSave: t, onClose: a }) {
|
|
|
5588
5573
|
className: "rounded-none",
|
|
5589
5574
|
role: "editor-panel",
|
|
5590
5575
|
children: [
|
|
5591
|
-
/* @__PURE__ */ e.jsx(
|
|
5592
|
-
/* @__PURE__ */ e.jsx(
|
|
5576
|
+
/* @__PURE__ */ e.jsx(fn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
|
|
5577
|
+
/* @__PURE__ */ e.jsx(gn, { children: /* @__PURE__ */ e.jsx(ar, {}) })
|
|
5593
5578
|
]
|
|
5594
5579
|
}
|
|
5595
5580
|
) });
|
|
5596
5581
|
}
|
|
5597
5582
|
function nr() {
|
|
5598
|
-
|
|
5599
|
-
const s =
|
|
5600
|
-
function l(
|
|
5601
|
-
s && (n(s,
|
|
5583
|
+
I((u) => u.selectedCardId);
|
|
5584
|
+
const s = I((u) => u.selectedSheetId), { setIsVisualEditing: t } = I((u) => u.actions), a = I((u) => u.isVisualEditing), n = I((u) => u.actions.updateFrame);
|
|
5585
|
+
function l(u) {
|
|
5586
|
+
s && (n(s, u), t(!1));
|
|
5602
5587
|
}
|
|
5603
|
-
function
|
|
5588
|
+
function r() {
|
|
5604
5589
|
t(!1);
|
|
5605
5590
|
}
|
|
5606
5591
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -5610,52 +5595,45 @@ function nr() {
|
|
|
5610
5595
|
className: K("flex grow", {
|
|
5611
5596
|
"max-h-0 overflow-hidden": !a
|
|
5612
5597
|
}),
|
|
5613
|
-
children: /* @__PURE__ */ e.jsx(tr, { onSave: l, onClose:
|
|
5598
|
+
children: /* @__PURE__ */ e.jsx(tr, { onSave: l, onClose: r })
|
|
5614
5599
|
}
|
|
5615
5600
|
);
|
|
5616
5601
|
}
|
|
5617
5602
|
function lr() {
|
|
5618
|
-
m((
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
z((i) => i.actions.addFilter), z((i) => i.actions.removeFilter), z(
|
|
5623
|
-
(i) => i.actions.removeFilterValue
|
|
5624
|
-
);
|
|
5625
|
-
const { modelItems: n, columns: l } = _e(), { assignFilter: d } = Xa();
|
|
5626
|
-
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((i) => {
|
|
5627
|
-
const o = a == null ? void 0 : a.find(
|
|
5628
|
-
(c) => c.column === de(i.column_name) && c.table === t && c.database === s
|
|
5603
|
+
const s = m((r) => r.selectedDatabaseName), t = m((r) => r.selectedTableName), a = I((r) => r.dashboard.filters) || [], { columns: n } = _e(), { assignFilter: l } = Xa();
|
|
5604
|
+
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: n == null ? void 0 : n.map((r) => {
|
|
5605
|
+
const u = a == null ? void 0 : a.find(
|
|
5606
|
+
(o) => o.column === de(r.column_name) && o.table === t && o.database === s
|
|
5629
5607
|
);
|
|
5630
5608
|
return /* @__PURE__ */ e.jsx(
|
|
5631
5609
|
"div",
|
|
5632
5610
|
{
|
|
5633
|
-
onClick: () =>
|
|
5611
|
+
onClick: () => l(r),
|
|
5634
5612
|
className: K(
|
|
5635
5613
|
"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",
|
|
5636
5614
|
{
|
|
5637
|
-
"bg-muted":
|
|
5615
|
+
"bg-muted": u
|
|
5638
5616
|
}
|
|
5639
5617
|
),
|
|
5640
5618
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5641
|
-
/* @__PURE__ */ e.jsx(Ea, { column:
|
|
5642
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
5619
|
+
/* @__PURE__ */ e.jsx(Ea, { column: r }),
|
|
5620
|
+
/* @__PURE__ */ e.jsx("span", { children: r.column_name })
|
|
5643
5621
|
] })
|
|
5644
5622
|
},
|
|
5645
|
-
|
|
5623
|
+
r.column_name
|
|
5646
5624
|
);
|
|
5647
5625
|
}) });
|
|
5648
5626
|
}
|
|
5649
5627
|
function rr() {
|
|
5650
|
-
|
|
5651
|
-
const s =
|
|
5628
|
+
I((t) => t.showFilters);
|
|
5629
|
+
const s = I(
|
|
5652
5630
|
(t) => t.actions.setShowFilters
|
|
5653
5631
|
);
|
|
5654
5632
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
5655
5633
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
5656
5634
|
/* @__PURE__ */ e.jsx(_, { className: "text-lg", children: "Filters" }),
|
|
5657
5635
|
/* @__PURE__ */ e.jsx(
|
|
5658
|
-
|
|
5636
|
+
z,
|
|
5659
5637
|
{
|
|
5660
5638
|
onClick: () => s(!1),
|
|
5661
5639
|
className: "h-7 w-7 p-0",
|
|
@@ -5679,7 +5657,7 @@ function rr() {
|
|
|
5679
5657
|
] });
|
|
5680
5658
|
}
|
|
5681
5659
|
function ir() {
|
|
5682
|
-
const s =
|
|
5660
|
+
const s = I((a) => a.showFilters), t = I((a) => a.isVisualEditing);
|
|
5683
5661
|
return /* @__PURE__ */ e.jsxs(
|
|
5684
5662
|
"div",
|
|
5685
5663
|
{
|
|
@@ -5689,17 +5667,17 @@ function ir() {
|
|
|
5689
5667
|
"flex grow": !t
|
|
5690
5668
|
}),
|
|
5691
5669
|
children: [
|
|
5692
|
-
/* @__PURE__ */ e.jsx(
|
|
5670
|
+
/* @__PURE__ */ e.jsx(jn, {}),
|
|
5693
5671
|
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(rr, {}) })
|
|
5694
5672
|
]
|
|
5695
5673
|
}
|
|
5696
5674
|
);
|
|
5697
5675
|
}
|
|
5698
5676
|
function or() {
|
|
5699
|
-
const s =
|
|
5677
|
+
const s = I((n) => n.dashboard), t = I((n) => n.actions.setDashboard), a = I(
|
|
5700
5678
|
(n) => n.showDashboardJSON
|
|
5701
5679
|
);
|
|
5702
|
-
return
|
|
5680
|
+
return I(
|
|
5703
5681
|
(n) => n.actions.setShowDashboardJSON
|
|
5704
5682
|
), /* @__PURE__ */ e.jsx(
|
|
5705
5683
|
"div",
|
|
@@ -5708,7 +5686,7 @@ function or() {
|
|
|
5708
5686
|
hidden: !a
|
|
5709
5687
|
}),
|
|
5710
5688
|
children: /* @__PURE__ */ e.jsx(
|
|
5711
|
-
|
|
5689
|
+
bn,
|
|
5712
5690
|
{
|
|
5713
5691
|
onChange: (n) => {
|
|
5714
5692
|
if (n)
|
|
@@ -5744,11 +5722,11 @@ function mr({
|
|
|
5744
5722
|
showFooter: t = !0,
|
|
5745
5723
|
...a
|
|
5746
5724
|
}) {
|
|
5747
|
-
return /* @__PURE__ */ e.jsx(
|
|
5748
|
-
/* @__PURE__ */ e.jsx(
|
|
5749
|
-
/* @__PURE__ */ e.jsxs(
|
|
5725
|
+
return /* @__PURE__ */ e.jsx(ps, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(yn, { dashboardProps: a, children: [
|
|
5726
|
+
/* @__PURE__ */ e.jsx(vn, {}),
|
|
5727
|
+
/* @__PURE__ */ e.jsxs(Cn, { children: [
|
|
5750
5728
|
/* @__PURE__ */ e.jsx(or, {}),
|
|
5751
|
-
/* @__PURE__ */ e.jsxs(
|
|
5729
|
+
/* @__PURE__ */ e.jsxs(Nn, { ...a, children: [
|
|
5752
5730
|
s && /* @__PURE__ */ e.jsx(ll, {}),
|
|
5753
5731
|
/* @__PURE__ */ e.jsx(nr, {}),
|
|
5754
5732
|
/* @__PURE__ */ e.jsx(ir, {})
|
|
@@ -5757,17 +5735,16 @@ function mr({
|
|
|
5757
5735
|
] }) });
|
|
5758
5736
|
}
|
|
5759
5737
|
export {
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5738
|
+
Ma as A,
|
|
5739
|
+
kn as B,
|
|
5740
|
+
zn as C,
|
|
5763
5741
|
mr as D,
|
|
5764
|
-
|
|
5742
|
+
Fa as E,
|
|
5765
5743
|
Xn as F,
|
|
5766
5744
|
Mn as G,
|
|
5767
|
-
|
|
5768
|
-
Vn as I,
|
|
5745
|
+
En as H,
|
|
5769
5746
|
qn as L,
|
|
5770
|
-
|
|
5747
|
+
Ta as M,
|
|
5771
5748
|
$n as N,
|
|
5772
5749
|
Pn as P,
|
|
5773
5750
|
Un as S,
|
|
@@ -5777,21 +5754,21 @@ export {
|
|
|
5777
5754
|
Us as b,
|
|
5778
5755
|
Oa as c,
|
|
5779
5756
|
Ia as d,
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5757
|
+
Da as e,
|
|
5758
|
+
On as f,
|
|
5759
|
+
In as g,
|
|
5760
|
+
Dn as h,
|
|
5784
5761
|
Fn as i,
|
|
5785
5762
|
Ln as j,
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5763
|
+
Tn as k,
|
|
5764
|
+
An as l,
|
|
5765
|
+
Vn as m,
|
|
5789
5766
|
Rn as n,
|
|
5790
5767
|
_n as o,
|
|
5791
5768
|
qe as p,
|
|
5792
5769
|
Hn as q,
|
|
5793
5770
|
Bn as r,
|
|
5794
|
-
|
|
5771
|
+
La as s,
|
|
5795
5772
|
Gn as t,
|
|
5796
5773
|
Qn as u,
|
|
5797
5774
|
Jn as v,
|