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