react-semaphor 0.0.187 → 0.0.188
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/dashboard-plus-4h_dG_jo.js +210 -0
- package/dist/chunks/{dashboard-plus-oU5pW6Vn.js → dashboard-plus-zWycIkYs.js} +201 -196
- package/dist/chunks/{index-WpPvkxrt.js → index-TDaW4qPC.js} +1 -1
- package/dist/chunks/{index-W8jYjb9k.js → index-qjDx7Ig8.js} +2 -2
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-bTqRuJOc.js +0 -210
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as E, b as k, j as e, Q as
|
|
1
|
+
import { P as E, b as k, j as e, Q as xs, R as ps, U as z, V as Ps, W as fs, X as gs, Y as js, Z as bs, _ as B, $ as ae, a0 as Us, J as Gs, O as Ee, a1 as qa, a2 as Va, a3 as Ra, a4 as _a, a5 as Ha, a6 as Ba, a7 as As, a8 as _e, a9 as Ke, aa as We, T as ys, e as Js, g as vs, ab as Oe, ac as Me, f as Y, ad as Te, ae as Ae, af as He, ag as Le, ah as X, ai as Ns, G as r, aj as Pe, ak as Ue, al as $a, am as Ge, w as Qs, v as Ws, t as he, an as Ka, r as Pa, N as Ys, s as Ua, ao as Ga, B as Ja, ap as Xs, aq as Qa, L as Be, S as Cs, z as Wa, n as Es, ar as cs, A as ds, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Ya, aA as Xa, aB as na, aC as Za, aD as et, aE as st, aF as at, aG as tt, aH as hs, aI as nt, aJ as Re, aK as ms, aL as Fe, aM as us, aN as Ls, aO as lt, aP as rt, aQ as it, aR as ot, aS as ct, aT as ls, aU as dt, aV as Ds, aW as ht, aX as Is, aY as mt, aZ as ut, a_ as xt, a$ as la, l as pt, C as ft, E as qs, d as gt, h as jt, i as bt, o as yt, b0 as vt, m as Nt, H as Ct, b1 as St, b2 as kt, b3 as wt, b4 as rs, b5 as zt, b6 as is, b7 as Vs, K as Ft, b8 as Ss, b9 as Ot, ba as ra, bb as Ye, bc as ia, bd as Mt, be as Tt, bf as At, bg as Et, bh as Lt, bi as Dt, bj as Se, bk as V, bl as R, bm as ks, bn as _, bo as Rs, bp as It, bq as qt, br as Vt, bs as Rt, bt as _s, bu as _t, bv as Ht, bw as Bt, bx as $t, by as Kt, bz as Pt } from "./index-qjDx7Ig8.js";
|
|
2
2
|
import me, { useState as T, useEffect as K, useMemo as Ut, useRef as $e } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license lucide-react v0.379.0 - ISC
|
|
@@ -31,7 +31,7 @@ const Jt = E("AreaChart", [
|
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
33
|
*/
|
|
34
|
-
const
|
|
34
|
+
const ws = E("BarChart4", [
|
|
35
35
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
36
36
|
["path", { d: "M13 17V9", key: "1fwyjl" }],
|
|
37
37
|
["path", { d: "M18 17V5", key: "sfb6ij" }],
|
|
@@ -155,7 +155,7 @@ const sn = E("Key", [
|
|
|
155
155
|
* This source code is licensed under the ISC license.
|
|
156
156
|
* See the LICENSE file in the root directory of this source tree.
|
|
157
157
|
*/
|
|
158
|
-
const
|
|
158
|
+
const zs = E("LineChart", [
|
|
159
159
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
160
160
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
161
161
|
]);
|
|
@@ -402,8 +402,8 @@ function jn() {
|
|
|
402
402
|
template: h
|
|
403
403
|
}), localStorage.setItem(g, JSON.stringify(m)), o(!1);
|
|
404
404
|
}
|
|
405
|
-
return /* @__PURE__ */ e.jsxs(
|
|
406
|
-
/* @__PURE__ */ e.jsx(
|
|
405
|
+
return /* @__PURE__ */ e.jsxs(xs, { open: i, onOpenChange: o, children: [
|
|
406
|
+
/* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
407
407
|
z,
|
|
408
408
|
{
|
|
409
409
|
variant: "outline",
|
|
@@ -415,10 +415,10 @@ function jn() {
|
|
|
415
415
|
]
|
|
416
416
|
}
|
|
417
417
|
) }),
|
|
418
|
-
/* @__PURE__ */ e.jsxs(
|
|
419
|
-
/* @__PURE__ */ e.jsxs(
|
|
420
|
-
/* @__PURE__ */ e.jsx(
|
|
421
|
-
/* @__PURE__ */ e.jsx(
|
|
418
|
+
/* @__PURE__ */ e.jsxs(fs, { className: "sm:max-w-[425px]", children: [
|
|
419
|
+
/* @__PURE__ */ e.jsxs(gs, { children: [
|
|
420
|
+
/* @__PURE__ */ e.jsx(js, { children: "Add a Lens" }),
|
|
421
|
+
/* @__PURE__ */ e.jsx(bs, { children: "Lenses are private by default and are only visible to you." })
|
|
422
422
|
] }),
|
|
423
423
|
/* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
424
424
|
/* @__PURE__ */ e.jsx(B, { className: "text-right", children: "Name" }),
|
|
@@ -474,8 +474,8 @@ function bn() {
|
|
|
474
474
|
);
|
|
475
475
|
localStorage.setItem(x, JSON.stringify(w)), c(w);
|
|
476
476
|
}
|
|
477
|
-
return /* @__PURE__ */ e.jsxs(
|
|
478
|
-
/* @__PURE__ */ e.jsx(
|
|
477
|
+
return /* @__PURE__ */ e.jsxs(qa, { open: s, onOpenChange: n, children: [
|
|
478
|
+
/* @__PURE__ */ e.jsx(Va, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
479
479
|
/* @__PURE__ */ e.jsxs(Ra, { className: "w-56", children: [
|
|
480
480
|
/* @__PURE__ */ e.jsx(_a, { children: "Lenses" }),
|
|
481
481
|
/* @__PURE__ */ e.jsx(Ha, {}),
|
|
@@ -485,9 +485,9 @@ function bn() {
|
|
|
485
485
|
value: a,
|
|
486
486
|
onValueChange: u,
|
|
487
487
|
children: [
|
|
488
|
-
/* @__PURE__ */ e.jsx(
|
|
488
|
+
/* @__PURE__ */ e.jsx(As, { value: "Original", children: "Original" }),
|
|
489
489
|
l.filter((d) => d.name != "Original").map((d, x) => /* @__PURE__ */ e.jsxs(
|
|
490
|
-
|
|
490
|
+
As,
|
|
491
491
|
{
|
|
492
492
|
className: "xbg-red-100 flex justify-between",
|
|
493
493
|
value: d.name,
|
|
@@ -713,18 +713,18 @@ function Qe({
|
|
|
713
713
|
if (s === "Schema")
|
|
714
714
|
return /* @__PURE__ */ e.jsx(rn, { className: "size-4" });
|
|
715
715
|
if (s === "Table")
|
|
716
|
-
return /* @__PURE__ */ e.jsx(
|
|
716
|
+
return /* @__PURE__ */ e.jsx(Ns, { className: "size-4" });
|
|
717
717
|
}
|
|
718
718
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
719
|
-
h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(
|
|
719
|
+
h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(ys, { children: [
|
|
720
720
|
/* @__PURE__ */ e.jsx(Js, { children: u() }),
|
|
721
|
-
/* @__PURE__ */ e.jsx(
|
|
721
|
+
/* @__PURE__ */ e.jsx(vs, { className: "text-xs", align: "start", children: o })
|
|
722
722
|
] }) : u() }),
|
|
723
723
|
/* @__PURE__ */ e.jsxs(Oe, { disabled: g, value: m, onValueChange: l, children: [
|
|
724
724
|
/* @__PURE__ */ e.jsx(
|
|
725
725
|
Me,
|
|
726
726
|
{
|
|
727
|
-
className:
|
|
727
|
+
className: Y(
|
|
728
728
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
729
729
|
c
|
|
730
730
|
),
|
|
@@ -812,7 +812,7 @@ function Nn({ column: s }) {
|
|
|
812
812
|
] });
|
|
813
813
|
}
|
|
814
814
|
function ua({ column: s }) {
|
|
815
|
-
return /* @__PURE__ */ e.jsxs(
|
|
815
|
+
return /* @__PURE__ */ e.jsxs(ys, { children: [
|
|
816
816
|
/* @__PURE__ */ e.jsx(Ka, { asChild: !0, children: Pa.includes(s.data_type.toLowerCase()) ? (
|
|
817
817
|
// <span className=" font-thin">T</span>
|
|
818
818
|
/* @__PURE__ */ e.jsx(fn, { className: "size-3" })
|
|
@@ -820,7 +820,7 @@ function ua({ column: s }) {
|
|
|
820
820
|
//
|
|
821
821
|
/* @__PURE__ */ e.jsx(en, { className: "size-3" })
|
|
822
822
|
) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ga, { className: "size-3" }) : Ja.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(pn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(hn, { className: "size-3" }) }),
|
|
823
|
-
/* @__PURE__ */ e.jsx(
|
|
823
|
+
/* @__PURE__ */ e.jsx(vs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
824
824
|
] });
|
|
825
825
|
}
|
|
826
826
|
function Cn({
|
|
@@ -859,12 +859,12 @@ function Cn({
|
|
|
859
859
|
databaseName: l,
|
|
860
860
|
schemaName: c,
|
|
861
861
|
tableName: h
|
|
862
|
-
},
|
|
863
|
-
(
|
|
864
|
-
(D) => D.connectinonId ===
|
|
862
|
+
}, q = [...g || [], F].filter(
|
|
863
|
+
(P, $, G) => G.findIndex(
|
|
864
|
+
(D) => D.connectinonId === P.connectinonId && D.tableName === P.tableName
|
|
865
865
|
) === $
|
|
866
866
|
);
|
|
867
|
-
m(
|
|
867
|
+
m(q), cs.success(`Added '${h}' to AI Scope`, {
|
|
868
868
|
position: "top-right",
|
|
869
869
|
duration: 2500,
|
|
870
870
|
richColors: !0
|
|
@@ -873,7 +873,7 @@ function Cn({
|
|
|
873
873
|
const F = (g || []).filter(
|
|
874
874
|
(A) => A.connectinonId !== o && A.tableName !== h
|
|
875
875
|
);
|
|
876
|
-
m(F),
|
|
876
|
+
m(F), cs(`Removed '${h}' from AI Scope`, {
|
|
877
877
|
position: "top-right",
|
|
878
878
|
duration: 2e3,
|
|
879
879
|
richColors: !0
|
|
@@ -881,12 +881,14 @@ function Cn({
|
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
function C() {
|
|
884
|
-
let F =
|
|
885
|
-
((
|
|
884
|
+
let F = ds(s, n);
|
|
885
|
+
((P) => P.charAt(0) === P.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1);
|
|
886
|
+
const q = f === "MSSQL" ? `SELECT top 10 * FROM ${F}` : `SELECT * FROM ${F} LIMIT 10`;
|
|
887
|
+
x(q), u(!0);
|
|
886
888
|
}
|
|
887
889
|
function O() {
|
|
888
|
-
let F =
|
|
889
|
-
((
|
|
890
|
+
let F = ds(s, n);
|
|
891
|
+
((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT COUNT(*) as count FROM ${F}`), u(!0);
|
|
890
892
|
}
|
|
891
893
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
892
894
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
@@ -901,7 +903,7 @@ function Cn({
|
|
|
901
903
|
children: /* @__PURE__ */ e.jsx(
|
|
902
904
|
Qa,
|
|
903
905
|
{
|
|
904
|
-
className:
|
|
906
|
+
className: Y("size-4", {
|
|
905
907
|
"text-primary": b(),
|
|
906
908
|
"text-muted-foreground": !b()
|
|
907
909
|
})
|
|
@@ -939,7 +941,7 @@ function Cn({
|
|
|
939
941
|
)
|
|
940
942
|
] }),
|
|
941
943
|
/* @__PURE__ */ e.jsxs(
|
|
942
|
-
|
|
944
|
+
Cs,
|
|
943
945
|
{
|
|
944
946
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
945
947
|
children: [
|
|
@@ -947,7 +949,7 @@ function Cn({
|
|
|
947
949
|
"div",
|
|
948
950
|
{
|
|
949
951
|
onClick: () => w(j),
|
|
950
|
-
className:
|
|
952
|
+
className: Y(
|
|
951
953
|
"mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
952
954
|
{
|
|
953
955
|
"bg-muted": Wa(j, i)
|
|
@@ -970,15 +972,15 @@ function Cn({
|
|
|
970
972
|
},
|
|
971
973
|
j.column_name
|
|
972
974
|
)),
|
|
973
|
-
/* @__PURE__ */ e.jsx(
|
|
974
|
-
/* @__PURE__ */ e.jsx(
|
|
975
|
+
/* @__PURE__ */ e.jsx(Es, { orientation: "vertical" }),
|
|
976
|
+
/* @__PURE__ */ e.jsx(Es, { orientation: "horizontal" })
|
|
975
977
|
]
|
|
976
978
|
}
|
|
977
979
|
)
|
|
978
980
|
] });
|
|
979
981
|
}
|
|
980
982
|
function xa(s, n) {
|
|
981
|
-
var ss, ve, Je,
|
|
983
|
+
var ss, ve, Je, qe;
|
|
982
984
|
let a = Ut(() => [], []);
|
|
983
985
|
const t = es().authToken || s, i = r(
|
|
984
986
|
(S) => S.selectedConnectionId
|
|
@@ -1022,10 +1024,10 @@ function xa(s, n) {
|
|
|
1022
1024
|
(S) => S.id === i
|
|
1023
1025
|
), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
|
|
1024
1026
|
data: A,
|
|
1025
|
-
isLoading:
|
|
1026
|
-
isFetching:
|
|
1027
|
+
isLoading: q,
|
|
1028
|
+
isFetching: P,
|
|
1027
1029
|
isError: $,
|
|
1028
|
-
refetch:
|
|
1030
|
+
refetch: G
|
|
1029
1031
|
} = Ce({
|
|
1030
1032
|
queryKey: ["databases", i],
|
|
1031
1033
|
queryFn: () => ze(
|
|
@@ -1040,7 +1042,7 @@ function xa(s, n) {
|
|
|
1040
1042
|
}), {
|
|
1041
1043
|
data: D,
|
|
1042
1044
|
isLoading: te,
|
|
1043
|
-
isFetching:
|
|
1045
|
+
isFetching: Q,
|
|
1044
1046
|
isError: ee,
|
|
1045
1047
|
refetch: Z
|
|
1046
1048
|
} = Ce({
|
|
@@ -1056,7 +1058,7 @@ function xa(s, n) {
|
|
|
1056
1058
|
enabled: !!i && !!o && !F && o !== "NA"
|
|
1057
1059
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1058
1060
|
}), {
|
|
1059
|
-
data:
|
|
1061
|
+
data: J,
|
|
1060
1062
|
isLoading: I,
|
|
1061
1063
|
isFetching: y,
|
|
1062
1064
|
isError: v,
|
|
@@ -1125,13 +1127,13 @@ function xa(s, n) {
|
|
|
1125
1127
|
function xe(S) {
|
|
1126
1128
|
u(S), N("");
|
|
1127
1129
|
}
|
|
1128
|
-
function
|
|
1130
|
+
function U(S) {
|
|
1129
1131
|
m(S), u(""), N("");
|
|
1130
1132
|
}
|
|
1131
1133
|
function ne(S) {
|
|
1132
1134
|
g(S);
|
|
1133
1135
|
}
|
|
1134
|
-
A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, H && ((
|
|
1136
|
+
A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((S) => ({
|
|
1135
1137
|
...S,
|
|
1136
1138
|
data_type: S.data_type.toLowerCase()
|
|
1137
1139
|
}))), $ && (a = []), (ge || C) && (a = []);
|
|
@@ -1147,7 +1149,7 @@ function xa(s, n) {
|
|
|
1147
1149
|
})), re = D == null ? void 0 : D.schemas.map((S) => ({
|
|
1148
1150
|
id: S.schema_name,
|
|
1149
1151
|
name: S.schema_name
|
|
1150
|
-
})), Ie =
|
|
1152
|
+
})), Ie = J == null ? void 0 : J.tables.map((S) => ({
|
|
1151
1153
|
id: S.table_name,
|
|
1152
1154
|
name: S.table_name
|
|
1153
1155
|
}));
|
|
@@ -1156,10 +1158,10 @@ function xa(s, n) {
|
|
|
1156
1158
|
isConnectionsLoading: L,
|
|
1157
1159
|
isConnectionsError: C,
|
|
1158
1160
|
databaseItems: ye,
|
|
1159
|
-
isDatabasesLoadingOrFetching:
|
|
1161
|
+
isDatabasesLoadingOrFetching: q || P,
|
|
1160
1162
|
isDatabaseError: $,
|
|
1161
1163
|
schemaItems: re,
|
|
1162
|
-
isSchemaLoadingOrFetching: te ||
|
|
1164
|
+
isSchemaLoadingOrFetching: te || Q,
|
|
1163
1165
|
isSchemaError: ee,
|
|
1164
1166
|
tableItems: Ie,
|
|
1165
1167
|
isTableLoadingOrFetching: I || y,
|
|
@@ -1172,14 +1174,14 @@ function xa(s, n) {
|
|
|
1172
1174
|
tableName: je,
|
|
1173
1175
|
schemaName: be,
|
|
1174
1176
|
handleConnectionChange: ne,
|
|
1175
|
-
handleDatabaseChange:
|
|
1177
|
+
handleDatabaseChange: U,
|
|
1176
1178
|
handleSchemaChange: xe
|
|
1177
1179
|
};
|
|
1178
1180
|
}
|
|
1179
1181
|
function pa({
|
|
1180
1182
|
ColumnsComponent: s
|
|
1181
1183
|
}) {
|
|
1182
|
-
var
|
|
1184
|
+
var J;
|
|
1183
1185
|
const n = r(
|
|
1184
1186
|
(I) => I.selectedConnectionId
|
|
1185
1187
|
), a = r(
|
|
@@ -1207,16 +1209,16 @@ function pa({
|
|
|
1207
1209
|
connectionType: j,
|
|
1208
1210
|
isNonDbConnection: F,
|
|
1209
1211
|
handleConnectionChange: A,
|
|
1210
|
-
handleDatabaseChange:
|
|
1211
|
-
handleSchemaChange:
|
|
1212
|
+
handleDatabaseChange: q,
|
|
1213
|
+
handleSchemaChange: P,
|
|
1212
1214
|
tableName: $,
|
|
1213
|
-
schemaName:
|
|
1215
|
+
schemaName: G
|
|
1214
1216
|
} = xa();
|
|
1215
1217
|
function D() {
|
|
1216
|
-
return s ? s(
|
|
1218
|
+
return s ? s(G, $, m) : /* @__PURE__ */ e.jsx(
|
|
1217
1219
|
Cn,
|
|
1218
1220
|
{
|
|
1219
|
-
schemaName:
|
|
1221
|
+
schemaName: G,
|
|
1220
1222
|
tableName: $,
|
|
1221
1223
|
columns: m,
|
|
1222
1224
|
status: L ? "Loading..." : b ? "Error" : "Success"
|
|
@@ -1226,11 +1228,11 @@ function pa({
|
|
|
1226
1228
|
function te() {
|
|
1227
1229
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1228
1230
|
}
|
|
1229
|
-
function
|
|
1231
|
+
function Q() {
|
|
1230
1232
|
return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1231
1233
|
Qe,
|
|
1232
1234
|
{
|
|
1233
|
-
onChange:
|
|
1235
|
+
onChange: q,
|
|
1234
1236
|
isError: x,
|
|
1235
1237
|
isLoading: d,
|
|
1236
1238
|
items: h,
|
|
@@ -1243,7 +1245,7 @@ function pa({
|
|
|
1243
1245
|
return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1244
1246
|
Qe,
|
|
1245
1247
|
{
|
|
1246
|
-
onChange:
|
|
1248
|
+
onChange: P,
|
|
1247
1249
|
isError: w,
|
|
1248
1250
|
isLoading: f,
|
|
1249
1251
|
items: c,
|
|
@@ -1276,12 +1278,12 @@ function pa({
|
|
|
1276
1278
|
onChange: A,
|
|
1277
1279
|
isLoading: u,
|
|
1278
1280
|
isError: N,
|
|
1279
|
-
connectionTooltip: ((
|
|
1281
|
+
connectionTooltip: ((J = l == null ? void 0 : l.find(
|
|
1280
1282
|
(I) => I.id === n
|
|
1281
|
-
)) == null ? void 0 :
|
|
1283
|
+
)) == null ? void 0 : J.type) || ""
|
|
1282
1284
|
}
|
|
1283
1285
|
),
|
|
1284
|
-
|
|
1286
|
+
Q(),
|
|
1285
1287
|
ee(),
|
|
1286
1288
|
Z()
|
|
1287
1289
|
] }),
|
|
@@ -1340,7 +1342,7 @@ function kn({
|
|
|
1340
1342
|
]
|
|
1341
1343
|
}
|
|
1342
1344
|
),
|
|
1343
|
-
/* @__PURE__ */ e.jsx(
|
|
1345
|
+
/* @__PURE__ */ e.jsx(Cs, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
|
|
1344
1346
|
] }) }) })
|
|
1345
1347
|
] });
|
|
1346
1348
|
}
|
|
@@ -1459,7 +1461,7 @@ function On({
|
|
|
1459
1461
|
Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
|
|
1460
1462
|
User SQL: ${L}
|
|
1461
1463
|
${N && `Base Queries: ${JSON.stringify(N)} `}`, j = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1462
|
-
Visual Query Syntax: ${Fn}`, { data: F, isLoading: A, isFetching:
|
|
1464
|
+
Visual Query Syntax: ${Fn}`, { data: F, isLoading: A, isFetching: q, isError: P, refetch: $ } = Ce({
|
|
1463
1465
|
queryKey: ["ai-query"],
|
|
1464
1466
|
queryFn: () => ze(
|
|
1465
1467
|
"https://semaphor.cloud/api/v1/ai",
|
|
@@ -1471,7 +1473,7 @@ function On({
|
|
|
1471
1473
|
enabled: !1
|
|
1472
1474
|
// Do not run by default.
|
|
1473
1475
|
});
|
|
1474
|
-
function
|
|
1476
|
+
function G(y) {
|
|
1475
1477
|
if (y.toLowerCase().includes("bar"))
|
|
1476
1478
|
x("bar");
|
|
1477
1479
|
else if (y.toLowerCase().includes("line"))
|
|
@@ -1505,7 +1507,7 @@ function On({
|
|
|
1505
1507
|
return () => clearTimeout(y);
|
|
1506
1508
|
}, [f]);
|
|
1507
1509
|
function D() {
|
|
1508
|
-
a && (w((y) => [...y, { role: "user", content: a }]),
|
|
1510
|
+
a && (w((y) => [...y, { role: "user", content: a }]), G(a) && m(!0), t(""), $());
|
|
1509
1511
|
}
|
|
1510
1512
|
K(() => {
|
|
1511
1513
|
i && (D(), o(!1));
|
|
@@ -1518,7 +1520,7 @@ function On({
|
|
|
1518
1520
|
fontSize: 15,
|
|
1519
1521
|
// padding: '5px',
|
|
1520
1522
|
width: "100%"
|
|
1521
|
-
},
|
|
1523
|
+
}, Q = {
|
|
1522
1524
|
// background: '#f6f8fa',
|
|
1523
1525
|
// color: '#000',
|
|
1524
1526
|
fontFamily: "monospace",
|
|
@@ -1539,15 +1541,15 @@ function On({
|
|
|
1539
1541
|
// Override how paragraphs are rendered
|
|
1540
1542
|
p: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("p", { style: te, ...v }),
|
|
1541
1543
|
code: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...v }),
|
|
1542
|
-
pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style:
|
|
1544
|
+
pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Q, children: [
|
|
1543
1545
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
|
|
1544
1546
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1545
|
-
/* @__PURE__ */ e.jsx(z, { onClick:
|
|
1547
|
+
/* @__PURE__ */ e.jsx(z, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
|
|
1546
1548
|
/* @__PURE__ */ e.jsx(
|
|
1547
1549
|
z,
|
|
1548
1550
|
{
|
|
1549
1551
|
onClick: (M) => {
|
|
1550
|
-
const H =
|
|
1552
|
+
const H = J(M);
|
|
1551
1553
|
H && (n(!1), u(H), d(!0));
|
|
1552
1554
|
},
|
|
1553
1555
|
size: "sm",
|
|
@@ -1560,7 +1562,7 @@ function On({
|
|
|
1560
1562
|
li: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...v })
|
|
1561
1563
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1562
1564
|
};
|
|
1563
|
-
function
|
|
1565
|
+
function J(y) {
|
|
1564
1566
|
const v = y.currentTarget.closest("pre");
|
|
1565
1567
|
if (!v)
|
|
1566
1568
|
return;
|
|
@@ -1588,8 +1590,8 @@ function On({
|
|
|
1588
1590
|
v
|
|
1589
1591
|
) : /* @__PURE__ */ e.jsx("div", {}, v));
|
|
1590
1592
|
}
|
|
1591
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1592
|
-
/* @__PURE__ */ e.jsx(
|
|
1593
|
+
return /* @__PURE__ */ e.jsxs(xs, { open: s, onOpenChange: n, children: [
|
|
1594
|
+
/* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1593
1595
|
z,
|
|
1594
1596
|
{
|
|
1595
1597
|
size: "sm",
|
|
@@ -1599,13 +1601,13 @@ function On({
|
|
|
1599
1601
|
}
|
|
1600
1602
|
) }),
|
|
1601
1603
|
/* @__PURE__ */ e.jsxs(
|
|
1602
|
-
|
|
1604
|
+
fs,
|
|
1603
1605
|
{
|
|
1604
1606
|
className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
|
|
1605
1607
|
children: [
|
|
1606
|
-
/* @__PURE__ */ e.jsxs(
|
|
1607
|
-
/* @__PURE__ */ e.jsx(
|
|
1608
|
-
/* @__PURE__ */ e.jsx(
|
|
1608
|
+
/* @__PURE__ */ e.jsxs(gs, { children: [
|
|
1609
|
+
/* @__PURE__ */ e.jsx(js, { children: "Assistant" }),
|
|
1610
|
+
/* @__PURE__ */ e.jsx(bs, { children: "What can I help you with?" })
|
|
1609
1611
|
] }),
|
|
1610
1612
|
/* @__PURE__ */ e.jsx(
|
|
1611
1613
|
"div",
|
|
@@ -1632,10 +1634,10 @@ function On({
|
|
|
1632
1634
|
const v = y.target, M = v.value.length;
|
|
1633
1635
|
v.setSelectionRange(M, M);
|
|
1634
1636
|
},
|
|
1635
|
-
className:
|
|
1637
|
+
className: Y(
|
|
1636
1638
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1637
1639
|
),
|
|
1638
|
-
disabled: A ||
|
|
1640
|
+
disabled: A || q,
|
|
1639
1641
|
value: a,
|
|
1640
1642
|
onChange: (y) => t(y.target.value)
|
|
1641
1643
|
}
|
|
@@ -1648,7 +1650,7 @@ function On({
|
|
|
1648
1650
|
size: "sm",
|
|
1649
1651
|
variant: "ghost",
|
|
1650
1652
|
onClick: D,
|
|
1651
|
-
children: !A && !
|
|
1653
|
+
children: !A && !q ? /* @__PURE__ */ e.jsx(Za, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1652
1654
|
}
|
|
1653
1655
|
)
|
|
1654
1656
|
] })
|
|
@@ -1768,10 +1770,10 @@ function In(s) {
|
|
|
1768
1770
|
};
|
|
1769
1771
|
return Hs !== void 0 ? /* @__PURE__ */ me.createElement(Hs.Consumer, null, (a) => n(a)) : n(fa);
|
|
1770
1772
|
}
|
|
1771
|
-
function
|
|
1773
|
+
function qn(s) {
|
|
1772
1774
|
return fe({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
|
|
1773
1775
|
}
|
|
1774
|
-
function
|
|
1776
|
+
function Vn() {
|
|
1775
1777
|
const { theme: s } = at(), n = $e(), a = $e(), [t, i] = T(!1), [o, l] = T(!1), [c, h] = T(!1), [g, m] = T(""), [u, N] = T(!1), { authToken: d } = es();
|
|
1776
1778
|
k((p) => p.selectedSheetId);
|
|
1777
1779
|
const x = k((p) => p.dashboard.baseQueries), f = r((p) => p.card), w = k((p) => p.theme), b = r((p) => p.isShowingVisual), L = r(
|
|
@@ -1784,12 +1786,12 @@ function qn() {
|
|
|
1784
1786
|
k(
|
|
1785
1787
|
(p) => p.actions.updateFrameCard
|
|
1786
1788
|
);
|
|
1787
|
-
const j = r((p) => p.selectedTableName), F = r((p) => p.card.sql), A = r((p) => p.card.python),
|
|
1789
|
+
const j = r((p) => p.selectedTableName), F = r((p) => p.card.sql), A = r((p) => p.card.python), q = tt(F, x), P = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), G = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
|
|
1788
1790
|
setCardCustomCfg: te,
|
|
1789
|
-
setQueryResultColumns:
|
|
1791
|
+
setQueryResultColumns: Q,
|
|
1790
1792
|
setFilterValues: ee,
|
|
1791
1793
|
setCardSql: Z,
|
|
1792
|
-
setCardPython:
|
|
1794
|
+
setCardPython: J,
|
|
1793
1795
|
setQueryError: I,
|
|
1794
1796
|
setPythonStdOut: y,
|
|
1795
1797
|
setCardPreferences: v
|
|
@@ -1798,7 +1800,7 @@ function qn() {
|
|
|
1798
1800
|
), ue = r((p) => p.onClose), se = r((p) => p.actions.setCardData), ge = r((p) => p.actions.setSqlGen), je = r((p) => p.runSql), be = r((p) => p.actions.setRunSql), xe = r(
|
|
1799
1801
|
(p) => p.actions.setIsSqlRunning
|
|
1800
1802
|
), {
|
|
1801
|
-
data:
|
|
1803
|
+
data: U,
|
|
1802
1804
|
isLoading: ne,
|
|
1803
1805
|
isFetching: le,
|
|
1804
1806
|
isSuccess: ye,
|
|
@@ -1807,46 +1809,49 @@ function qn() {
|
|
|
1807
1809
|
status: ss,
|
|
1808
1810
|
refetch: ve
|
|
1809
1811
|
} = Ce({
|
|
1810
|
-
queryKey: [
|
|
1812
|
+
queryKey: [q, A],
|
|
1811
1813
|
queryFn: () => aa(
|
|
1812
1814
|
"https://semaphor.cloud/api/v1/query",
|
|
1813
1815
|
(d == null ? void 0 : d.accessToken) || "",
|
|
1814
1816
|
{
|
|
1815
|
-
connection_id:
|
|
1816
|
-
sql:
|
|
1817
|
+
connection_id: P,
|
|
1818
|
+
sql: q,
|
|
1817
1819
|
python: A === Ls ? "" : A,
|
|
1818
|
-
active_filters: D ?
|
|
1820
|
+
active_filters: D ? G : []
|
|
1819
1821
|
}
|
|
1820
1822
|
),
|
|
1821
1823
|
enabled: !1,
|
|
1822
1824
|
retry: !1
|
|
1823
1825
|
});
|
|
1824
1826
|
K(() => {
|
|
1825
|
-
if (
|
|
1826
|
-
|
|
1827
|
-
|
|
1827
|
+
if (U && (se(U.records), U.rowLimitExceeded && cs.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
1828
|
+
position: "top-center",
|
|
1829
|
+
richColors: !0
|
|
1830
|
+
}), y((U == null ? void 0 : U.output) || ""), U.records.length > 0)) {
|
|
1831
|
+
const { dimensionKeys: p } = hs(U.records);
|
|
1832
|
+
Q(p);
|
|
1828
1833
|
}
|
|
1829
|
-
}, [
|
|
1834
|
+
}, [U, se, Q, y]), K(() => {
|
|
1830
1835
|
je && (ve(), be(!1));
|
|
1831
1836
|
}, [je, ve, be]), K(() => {
|
|
1832
|
-
(ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]),
|
|
1837
|
+
(ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), Q([]), y("")) : I("");
|
|
1833
1838
|
}, [
|
|
1834
1839
|
ne,
|
|
1835
1840
|
le,
|
|
1836
|
-
|
|
1841
|
+
U,
|
|
1837
1842
|
y,
|
|
1838
1843
|
re,
|
|
1839
1844
|
ye,
|
|
1840
1845
|
xe,
|
|
1841
1846
|
se,
|
|
1842
|
-
|
|
1847
|
+
Q,
|
|
1843
1848
|
I,
|
|
1844
1849
|
Ie
|
|
1845
1850
|
]);
|
|
1846
1851
|
function Je() {
|
|
1847
1852
|
Z(""), se([]), ge({}), te(""), v({});
|
|
1848
1853
|
}
|
|
1849
|
-
const
|
|
1854
|
+
const qe = (p) => {
|
|
1850
1855
|
a.current = p;
|
|
1851
1856
|
};
|
|
1852
1857
|
function S() {
|
|
@@ -1861,12 +1866,12 @@ function qn() {
|
|
|
1861
1866
|
type: b ? f.type : "table",
|
|
1862
1867
|
sql: p,
|
|
1863
1868
|
customCfg: b ? f.customCfg : null
|
|
1864
|
-
},
|
|
1869
|
+
}, Ve = $.cards.map(
|
|
1865
1870
|
(Ne) => Ne.id === f.id ? ie : Ne
|
|
1866
1871
|
);
|
|
1867
1872
|
M == null || M({
|
|
1868
1873
|
...$,
|
|
1869
|
-
cards:
|
|
1874
|
+
cards: Ve
|
|
1870
1875
|
});
|
|
1871
1876
|
}
|
|
1872
1877
|
function Fa() {
|
|
@@ -1879,9 +1884,9 @@ function qn() {
|
|
|
1879
1884
|
return Ma(ie);
|
|
1880
1885
|
}
|
|
1881
1886
|
function Ma(p) {
|
|
1882
|
-
const [ie,
|
|
1887
|
+
const [ie, Ve, Ne] = p.split(" "), W = parseFloat(ie), Ea = parseFloat(Ve), La = parseFloat(Ne), Da = Ea / 100, Ts = La / 100, pe = (1 - Math.abs(2 * Ts - 1)) * Da, ke = pe * (1 - Math.abs(W / 60 % 2 - 1)), as = Ts - pe / 2;
|
|
1883
1888
|
let oe = 0, ce = 0, de = 0;
|
|
1884
|
-
0 <=
|
|
1889
|
+
0 <= W && W < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= W && W < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= W && W < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= W && W < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= W && W < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= W && W < 360 && (oe = pe, ce = 0, de = ke), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
|
|
1885
1890
|
const ts = (Ia) => {
|
|
1886
1891
|
const ns = Ia.toString(16);
|
|
1887
1892
|
return ns.length == 1 ? "0" + ns : ns;
|
|
@@ -1891,7 +1896,7 @@ function qn() {
|
|
|
1891
1896
|
K(() => {
|
|
1892
1897
|
const p = n.current, ie = a.current;
|
|
1893
1898
|
if (p) {
|
|
1894
|
-
const
|
|
1899
|
+
const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = w === "system" ? Ve : w;
|
|
1895
1900
|
p.editor.defineTheme("default", {
|
|
1896
1901
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
1897
1902
|
base: Ne === "light" ? "vs" : "vs-dark",
|
|
@@ -1911,7 +1916,7 @@ function qn() {
|
|
|
1911
1916
|
), () => {
|
|
1912
1917
|
};
|
|
1913
1918
|
}, [s, w, n.current]);
|
|
1914
|
-
function
|
|
1919
|
+
function Ms(p) {
|
|
1915
1920
|
n.current = p;
|
|
1916
1921
|
}
|
|
1917
1922
|
function Ta() {
|
|
@@ -1932,7 +1937,7 @@ function qn() {
|
|
|
1932
1937
|
}
|
|
1933
1938
|
),
|
|
1934
1939
|
/* @__PURE__ */ e.jsx(zn, {}),
|
|
1935
|
-
|
|
1940
|
+
G && o && /* @__PURE__ */ e.jsx(
|
|
1936
1941
|
_e,
|
|
1937
1942
|
{
|
|
1938
1943
|
onClick: () => l(!1),
|
|
@@ -1953,7 +1958,7 @@ function qn() {
|
|
|
1953
1958
|
},
|
|
1954
1959
|
defaultLanguage: "json",
|
|
1955
1960
|
className: "mt-1 min-h-[220px]",
|
|
1956
|
-
value: JSON.stringify(
|
|
1961
|
+
value: JSON.stringify(G, null, 2),
|
|
1957
1962
|
options: {
|
|
1958
1963
|
readOnly: !0,
|
|
1959
1964
|
minimap: {
|
|
@@ -1974,11 +1979,11 @@ function qn() {
|
|
|
1974
1979
|
] })
|
|
1975
1980
|
}
|
|
1976
1981
|
),
|
|
1977
|
-
|
|
1982
|
+
G && !o && /* @__PURE__ */ e.jsx(
|
|
1978
1983
|
oa,
|
|
1979
1984
|
{
|
|
1980
1985
|
onClick: () => l(!0),
|
|
1981
|
-
className:
|
|
1986
|
+
className: Y(
|
|
1982
1987
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
1983
1988
|
{
|
|
1984
1989
|
"font-bold text-red-800": D
|
|
@@ -1990,7 +1995,7 @@ function qn() {
|
|
|
1990
1995
|
}
|
|
1991
1996
|
function Aa() {
|
|
1992
1997
|
return /* @__PURE__ */ e.jsxs(
|
|
1993
|
-
|
|
1998
|
+
ms,
|
|
1994
1999
|
{
|
|
1995
2000
|
className: "flex grow pb-1",
|
|
1996
2001
|
direction: "vertical",
|
|
@@ -2032,8 +2037,8 @@ function qn() {
|
|
|
2032
2037
|
},
|
|
2033
2038
|
defaultLanguage: "sql",
|
|
2034
2039
|
defaultValue: "SELECT * FROM table",
|
|
2035
|
-
beforeMount:
|
|
2036
|
-
onMount:
|
|
2040
|
+
beforeMount: Ms,
|
|
2041
|
+
onMount: qe
|
|
2037
2042
|
}
|
|
2038
2043
|
)
|
|
2039
2044
|
}
|
|
@@ -2043,7 +2048,7 @@ function qn() {
|
|
|
2043
2048
|
}
|
|
2044
2049
|
),
|
|
2045
2050
|
t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2046
|
-
/* @__PURE__ */ e.jsx(
|
|
2051
|
+
/* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border" }),
|
|
2047
2052
|
/* @__PURE__ */ e.jsxs(
|
|
2048
2053
|
Fe,
|
|
2049
2054
|
{
|
|
@@ -2063,7 +2068,7 @@ function qn() {
|
|
|
2063
2068
|
className: "pt-3",
|
|
2064
2069
|
theme: "default",
|
|
2065
2070
|
onChange: (p) => {
|
|
2066
|
-
|
|
2071
|
+
J(p && p.trim() || "");
|
|
2067
2072
|
},
|
|
2068
2073
|
value: A || Ls,
|
|
2069
2074
|
options: {
|
|
@@ -2079,8 +2084,8 @@ function qn() {
|
|
|
2079
2084
|
renderLineHighlight: "none"
|
|
2080
2085
|
},
|
|
2081
2086
|
defaultLanguage: "python",
|
|
2082
|
-
beforeMount:
|
|
2083
|
-
onMount:
|
|
2087
|
+
beforeMount: Ms,
|
|
2088
|
+
onMount: qe
|
|
2084
2089
|
}
|
|
2085
2090
|
)
|
|
2086
2091
|
}
|
|
@@ -2167,7 +2172,7 @@ function qn() {
|
|
|
2167
2172
|
className: "",
|
|
2168
2173
|
size: "sm",
|
|
2169
2174
|
variant: "outline",
|
|
2170
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2175
|
+
children: /* @__PURE__ */ e.jsx(qn, { className: "size-4 text-foreground/70" })
|
|
2171
2176
|
}
|
|
2172
2177
|
),
|
|
2173
2178
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2293,12 +2298,12 @@ function ja({
|
|
|
2293
2298
|
pt,
|
|
2294
2299
|
{
|
|
2295
2300
|
role: "editor-visual-card",
|
|
2296
|
-
className:
|
|
2301
|
+
className: Y("relative flex h-full flex-col rounded-none", s),
|
|
2297
2302
|
...n,
|
|
2298
2303
|
children: [
|
|
2299
2304
|
/* @__PURE__ */ e.jsxs(ft, { className: "py-4", children: [
|
|
2300
2305
|
/* @__PURE__ */ e.jsx(
|
|
2301
|
-
|
|
2306
|
+
qs,
|
|
2302
2307
|
{
|
|
2303
2308
|
text: t.title,
|
|
2304
2309
|
onSave: (c) => i({ ...t, title: c }),
|
|
@@ -2307,7 +2312,7 @@ function ja({
|
|
|
2307
2312
|
t.title
|
|
2308
2313
|
),
|
|
2309
2314
|
/* @__PURE__ */ e.jsx(
|
|
2310
|
-
|
|
2315
|
+
qs,
|
|
2311
2316
|
{
|
|
2312
2317
|
text: t.description || "",
|
|
2313
2318
|
onSave: (c) => i({ ...t, description: c }),
|
|
@@ -2345,8 +2350,8 @@ function _n() {
|
|
|
2345
2350
|
...C,
|
|
2346
2351
|
data: {
|
|
2347
2352
|
...C == null ? void 0 : C.data,
|
|
2348
|
-
datasets: (A = (F = C == null ? void 0 : C.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((
|
|
2349
|
-
...
|
|
2353
|
+
datasets: (A = (F = C == null ? void 0 : C.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((q) => ({
|
|
2354
|
+
...q,
|
|
2350
2355
|
data: []
|
|
2351
2356
|
}))
|
|
2352
2357
|
}
|
|
@@ -2380,13 +2385,13 @@ function _n() {
|
|
|
2380
2385
|
function L() {
|
|
2381
2386
|
let C;
|
|
2382
2387
|
if (u) {
|
|
2383
|
-
const O =
|
|
2388
|
+
const O = Vs.cloneDeep(m.cfg), j = Vs.merge(O, u);
|
|
2384
2389
|
return C = x(j), C;
|
|
2385
2390
|
}
|
|
2386
2391
|
return a ? (C = x(JSON.parse(a)), C) : "";
|
|
2387
2392
|
}
|
|
2388
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2389
|
-
/* @__PURE__ */ e.jsx(
|
|
2393
|
+
return /* @__PURE__ */ e.jsxs(xs, { open: s, onOpenChange: n, children: [
|
|
2394
|
+
/* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2390
2395
|
z,
|
|
2391
2396
|
{
|
|
2392
2397
|
onClick: f,
|
|
@@ -2397,14 +2402,14 @@ function _n() {
|
|
|
2397
2402
|
}
|
|
2398
2403
|
) }),
|
|
2399
2404
|
/* @__PURE__ */ e.jsxs(
|
|
2400
|
-
|
|
2405
|
+
fs,
|
|
2401
2406
|
{
|
|
2402
2407
|
className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
|
|
2403
2408
|
children: [
|
|
2404
|
-
/* @__PURE__ */ e.jsxs(
|
|
2409
|
+
/* @__PURE__ */ e.jsxs(gs, { className: "", children: [
|
|
2405
2410
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2406
|
-
/* @__PURE__ */ e.jsx(
|
|
2407
|
-
/* @__PURE__ */ e.jsxs(
|
|
2411
|
+
/* @__PURE__ */ e.jsx(js, { children: "Customize Card" }),
|
|
2412
|
+
/* @__PURE__ */ e.jsxs(ys, { children: [
|
|
2408
2413
|
/* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
|
|
2409
2414
|
sn,
|
|
2410
2415
|
{
|
|
@@ -2414,10 +2419,10 @@ function _n() {
|
|
|
2414
2419
|
className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
|
|
2415
2420
|
}
|
|
2416
2421
|
) }),
|
|
2417
|
-
/* @__PURE__ */ e.jsx(
|
|
2422
|
+
/* @__PURE__ */ e.jsx(vs, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
|
|
2418
2423
|
] })
|
|
2419
2424
|
] }),
|
|
2420
|
-
/* @__PURE__ */ e.jsxs(
|
|
2425
|
+
/* @__PURE__ */ e.jsxs(bs, { children: [
|
|
2421
2426
|
"See the configuration options and documentation",
|
|
2422
2427
|
/* @__PURE__ */ e.jsx(
|
|
2423
2428
|
"a",
|
|
@@ -2574,7 +2579,7 @@ function Hn() {
|
|
|
2574
2579
|
onClick: () => l("bar"),
|
|
2575
2580
|
className: "font-normal",
|
|
2576
2581
|
variant: "ghost",
|
|
2577
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2582
|
+
children: /* @__PURE__ */ e.jsx(ws, { className: "size-5" })
|
|
2578
2583
|
}
|
|
2579
2584
|
),
|
|
2580
2585
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2582,7 +2587,7 @@ function Hn() {
|
|
|
2582
2587
|
{
|
|
2583
2588
|
onClick: () => l("line"),
|
|
2584
2589
|
variant: "ghost",
|
|
2585
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2590
|
+
children: /* @__PURE__ */ e.jsx(zs, { className: "size-5" })
|
|
2586
2591
|
}
|
|
2587
2592
|
),
|
|
2588
2593
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2668,7 +2673,7 @@ function Hn() {
|
|
|
2668
2673
|
{
|
|
2669
2674
|
onClick: () => l("table"),
|
|
2670
2675
|
variant: "ghost",
|
|
2671
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2676
|
+
children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
|
|
2672
2677
|
}
|
|
2673
2678
|
),
|
|
2674
2679
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2685,9 +2690,9 @@ function Hn() {
|
|
|
2685
2690
|
function Bn({ chartType: s, className: n }) {
|
|
2686
2691
|
switch (s) {
|
|
2687
2692
|
case "bar":
|
|
2688
|
-
return /* @__PURE__ */ e.jsx(ks, { className: n });
|
|
2689
|
-
case "line":
|
|
2690
2693
|
return /* @__PURE__ */ e.jsx(ws, { className: n });
|
|
2694
|
+
case "line":
|
|
2695
|
+
return /* @__PURE__ */ e.jsx(zs, { className: n });
|
|
2691
2696
|
case "pie":
|
|
2692
2697
|
return /* @__PURE__ */ e.jsx(ha, { className: n });
|
|
2693
2698
|
case "radar":
|
|
@@ -2709,7 +2714,7 @@ function Bn({ chartType: s, className: n }) {
|
|
|
2709
2714
|
case "kpi":
|
|
2710
2715
|
return /* @__PURE__ */ e.jsx(Sa, { className: n });
|
|
2711
2716
|
default:
|
|
2712
|
-
return /* @__PURE__ */ e.jsx(
|
|
2717
|
+
return /* @__PURE__ */ e.jsx(Ns, { className: n });
|
|
2713
2718
|
}
|
|
2714
2719
|
}
|
|
2715
2720
|
function $n() {
|
|
@@ -2769,7 +2774,7 @@ function Kn() {
|
|
|
2769
2774
|
className: "bg-muted p-2 font-mono text-sm"
|
|
2770
2775
|
}
|
|
2771
2776
|
),
|
|
2772
|
-
/* @__PURE__ */ e.jsx(
|
|
2777
|
+
/* @__PURE__ */ e.jsx(Ss, { className: "mb-2" })
|
|
2773
2778
|
] });
|
|
2774
2779
|
}
|
|
2775
2780
|
function Pn() {
|
|
@@ -2905,7 +2910,7 @@ function De() {
|
|
|
2905
2910
|
);
|
|
2906
2911
|
}) });
|
|
2907
2912
|
}
|
|
2908
|
-
function
|
|
2913
|
+
function Fs() {
|
|
2909
2914
|
var o, l, c;
|
|
2910
2915
|
const s = r((h) => h.card.preferences), n = r(
|
|
2911
2916
|
(h) => h.card.cfg
|
|
@@ -2960,7 +2965,7 @@ function Ks(s, n) {
|
|
|
2960
2965
|
return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
|
|
2961
2966
|
}
|
|
2962
2967
|
function wa() {
|
|
2963
|
-
var
|
|
2968
|
+
var Q, ee, Z, J, I, y;
|
|
2964
2969
|
const [s, n] = T(!1), a = r((v) => {
|
|
2965
2970
|
var M;
|
|
2966
2971
|
return (M = v.card) == null ? void 0 : M.preferences;
|
|
@@ -2970,27 +2975,27 @@ function wa() {
|
|
|
2970
2975
|
}), i = ia(a, t), [o, l] = T(
|
|
2971
2976
|
Ks(a)
|
|
2972
2977
|
), [c, h] = T(
|
|
2973
|
-
((Z = (ee = (
|
|
2978
|
+
((Z = (ee = (Q = a == null ? void 0 : a.chartOptions) == null ? void 0 : Q.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
|
|
2974
2979
|
), [g, m] = T(
|
|
2975
|
-
((y = (I = (
|
|
2980
|
+
((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[i]) == null ? void 0 : y.max) || ""
|
|
2976
2981
|
), [u, N] = T(c || g ? "custom" : "auto"), [d, x] = T(""), [f, w] = T(0), [b, L] = T(""), [C, O] = T(""), [j, F] = T(""), A = r(
|
|
2977
2982
|
(v) => v.actions.setCardPreferences
|
|
2978
|
-
),
|
|
2983
|
+
), q = r((v) => {
|
|
2979
2984
|
var M;
|
|
2980
2985
|
return (M = v.card) == null ? void 0 : M.type;
|
|
2981
|
-
}),
|
|
2986
|
+
}), P = ["pie", "doughnut", "polarArea"].includes(q);
|
|
2982
2987
|
K(() => {
|
|
2983
|
-
var v, M, H, ue, se, ge, je, be, xe,
|
|
2988
|
+
var v, M, H, ue, se, ge, je, be, xe, U, ne, le, ye, re;
|
|
2984
2989
|
l(Ks(a)), h(
|
|
2985
2990
|
((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[i]) == null ? void 0 : H.min) === 0 ? 0 : ""
|
|
2986
2991
|
), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[i]) == null ? void 0 : ge.max) || ""), x(
|
|
2987
|
-
((
|
|
2992
|
+
((U = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : U.stepSize) || ""
|
|
2988
2993
|
), w(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
|
|
2989
2994
|
}, [s, a, i]);
|
|
2990
2995
|
function $(v, M) {
|
|
2991
2996
|
return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
|
|
2992
2997
|
}
|
|
2993
|
-
function
|
|
2998
|
+
function G() {
|
|
2994
2999
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2995
3000
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
2996
3001
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3125,7 +3130,7 @@ function wa() {
|
|
|
3125
3130
|
/* @__PURE__ */ e.jsxs(
|
|
3126
3131
|
Oe,
|
|
3127
3132
|
{
|
|
3128
|
-
disabled:
|
|
3133
|
+
disabled: P,
|
|
3129
3134
|
value: o,
|
|
3130
3135
|
onValueChange: (v) => l(v),
|
|
3131
3136
|
children: [
|
|
@@ -3144,7 +3149,7 @@ function wa() {
|
|
|
3144
3149
|
/* @__PURE__ */ e.jsxs(
|
|
3145
3150
|
ra,
|
|
3146
3151
|
{
|
|
3147
|
-
disabled:
|
|
3152
|
+
disabled: P,
|
|
3148
3153
|
id: "scale-option",
|
|
3149
3154
|
value: u,
|
|
3150
3155
|
onValueChange: (v) => N(v),
|
|
@@ -3164,7 +3169,7 @@ function wa() {
|
|
|
3164
3169
|
)
|
|
3165
3170
|
] }),
|
|
3166
3171
|
u === "custom" && o == "linear" && D(),
|
|
3167
|
-
|
|
3172
|
+
G(),
|
|
3168
3173
|
/* @__PURE__ */ e.jsx(Tt, {}),
|
|
3169
3174
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3170
3175
|
z,
|
|
@@ -3246,7 +3251,7 @@ function Un({ idx: s }) {
|
|
|
3246
3251
|
children: /* @__PURE__ */ e.jsx(
|
|
3247
3252
|
an,
|
|
3248
3253
|
{
|
|
3249
|
-
className:
|
|
3254
|
+
className: Y("h-4 w-4", {
|
|
3250
3255
|
"rotate-90": i === "y"
|
|
3251
3256
|
})
|
|
3252
3257
|
}
|
|
@@ -3263,7 +3268,7 @@ function Un({ idx: s }) {
|
|
|
3263
3268
|
children: /* @__PURE__ */ e.jsx(
|
|
3264
3269
|
nn,
|
|
3265
3270
|
{
|
|
3266
|
-
className:
|
|
3271
|
+
className: Y("h-4 w-4", {
|
|
3267
3272
|
"rotate-90": i === "y"
|
|
3268
3273
|
})
|
|
3269
3274
|
}
|
|
@@ -3280,7 +3285,7 @@ function Un({ idx: s }) {
|
|
|
3280
3285
|
children: /* @__PURE__ */ e.jsx(
|
|
3281
3286
|
tn,
|
|
3282
3287
|
{
|
|
3283
|
-
className:
|
|
3288
|
+
className: Y("h-4 w-4", {
|
|
3284
3289
|
"rotate-90": i === "y"
|
|
3285
3290
|
})
|
|
3286
3291
|
}
|
|
@@ -3300,7 +3305,7 @@ function za() {
|
|
|
3300
3305
|
keys: i,
|
|
3301
3306
|
metricKeys: o,
|
|
3302
3307
|
dimensionKeys: l
|
|
3303
|
-
} =
|
|
3308
|
+
} = hs(s.data || []);
|
|
3304
3309
|
let c = o;
|
|
3305
3310
|
if (s.type === "stackedBar") {
|
|
3306
3311
|
const h = Dt({
|
|
@@ -3308,7 +3313,7 @@ function za() {
|
|
|
3308
3313
|
groupKey: l[0],
|
|
3309
3314
|
pivotKey: l[1],
|
|
3310
3315
|
valueKey: c[0]
|
|
3311
|
-
}), { metricKeys: g } =
|
|
3316
|
+
}), { metricKeys: g } = hs(h);
|
|
3312
3317
|
c = g;
|
|
3313
3318
|
}
|
|
3314
3319
|
return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
@@ -3364,14 +3369,14 @@ function Gn({ col: s, idx: n }) {
|
|
|
3364
3369
|
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
3365
3370
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
3366
3371
|
/* @__PURE__ */ e.jsx(
|
|
3367
|
-
|
|
3372
|
+
ws,
|
|
3368
3373
|
{
|
|
3369
3374
|
onClick: () => l("bar"),
|
|
3370
3375
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3371
3376
|
}
|
|
3372
3377
|
),
|
|
3373
3378
|
/* @__PURE__ */ e.jsx(
|
|
3374
|
-
|
|
3379
|
+
zs,
|
|
3375
3380
|
{
|
|
3376
3381
|
onClick: () => l("line"),
|
|
3377
3382
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -3385,7 +3390,7 @@ function Gn({ col: s, idx: n }) {
|
|
|
3385
3390
|
}
|
|
3386
3391
|
),
|
|
3387
3392
|
/* @__PURE__ */ e.jsx(
|
|
3388
|
-
|
|
3393
|
+
Ss,
|
|
3389
3394
|
{
|
|
3390
3395
|
orientation: "vertical",
|
|
3391
3396
|
className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -3399,8 +3404,8 @@ function Jn({
|
|
|
3399
3404
|
cardType: s
|
|
3400
3405
|
}) {
|
|
3401
3406
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3402
|
-
/* @__PURE__ */ e.jsxs(
|
|
3403
|
-
/* @__PURE__ */ e.jsx(R, { children: `${
|
|
3407
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3408
|
+
/* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
|
|
3404
3409
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
|
|
3405
3410
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
|
|
3406
3411
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -3424,20 +3429,20 @@ function Jn({
|
|
|
3424
3429
|
] })
|
|
3425
3430
|
] })
|
|
3426
3431
|
] }),
|
|
3427
|
-
/* @__PURE__ */ e.jsxs(
|
|
3432
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3428
3433
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3429
3434
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3430
|
-
/* @__PURE__ */ e.jsx(
|
|
3435
|
+
/* @__PURE__ */ e.jsx(Fs, {}),
|
|
3431
3436
|
/* @__PURE__ */ e.jsx(za, {})
|
|
3432
3437
|
] })
|
|
3433
3438
|
] }),
|
|
3434
|
-
/* @__PURE__ */ e.jsxs(
|
|
3439
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3435
3440
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3436
3441
|
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3437
3442
|
] })
|
|
3438
3443
|
] }) });
|
|
3439
3444
|
}
|
|
3440
|
-
function
|
|
3445
|
+
function Os() {
|
|
3441
3446
|
var i, o, l;
|
|
3442
3447
|
const s = r(
|
|
3443
3448
|
(c) => c.card.cfg
|
|
@@ -3519,15 +3524,15 @@ function Qn({
|
|
|
3519
3524
|
] });
|
|
3520
3525
|
}
|
|
3521
3526
|
return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3522
|
-
/* @__PURE__ */ e.jsxs(
|
|
3523
|
-
/* @__PURE__ */ e.jsx(R, { children: `${
|
|
3527
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3528
|
+
/* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
|
|
3524
3529
|
/* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
|
|
3525
3530
|
] }),
|
|
3526
|
-
/* @__PURE__ */ e.jsxs(
|
|
3531
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3527
3532
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3528
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3533
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
|
|
3529
3534
|
] }),
|
|
3530
|
-
/* @__PURE__ */ e.jsxs(
|
|
3535
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3531
3536
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3532
3537
|
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3533
3538
|
] })
|
|
@@ -3568,15 +3573,15 @@ function Xn() {
|
|
|
3568
3573
|
children: Zn(s)
|
|
3569
3574
|
}
|
|
3570
3575
|
),
|
|
3571
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3572
|
-
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3576
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Fs, {}) }),
|
|
3577
|
+
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Os, {}) }),
|
|
3573
3578
|
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(De, {}) })
|
|
3574
3579
|
] });
|
|
3575
3580
|
}
|
|
3576
3581
|
function Zn(s) {
|
|
3577
3582
|
if (["line", "bar"].includes(s))
|
|
3578
3583
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3579
|
-
/* @__PURE__ */ e.jsxs(
|
|
3584
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3580
3585
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
|
|
3581
3586
|
/* @__PURE__ */ e.jsxs(_, { className: " ", children: [
|
|
3582
3587
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
|
|
@@ -3586,7 +3591,7 @@ function Zn(s) {
|
|
|
3586
3591
|
] })
|
|
3587
3592
|
] })
|
|
3588
3593
|
] }),
|
|
3589
|
-
/* @__PURE__ */ e.jsxs(
|
|
3594
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3590
3595
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
|
|
3591
3596
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
|
|
3592
3597
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
@@ -3597,7 +3602,7 @@ function Zn(s) {
|
|
|
3597
3602
|
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Wn, null, 2) })
|
|
3598
3603
|
] })
|
|
3599
3604
|
] }),
|
|
3600
|
-
/* @__PURE__ */ e.jsxs(
|
|
3605
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3601
3606
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
|
|
3602
3607
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
|
|
3603
3608
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
@@ -3620,7 +3625,7 @@ function Zn(s) {
|
|
|
3620
3625
|
] })
|
|
3621
3626
|
] });
|
|
3622
3627
|
if (s === "bubble")
|
|
3623
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3628
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3624
3629
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3625
3630
|
"How to create a ",
|
|
3626
3631
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
@@ -3638,7 +3643,7 @@ function Zn(s) {
|
|
|
3638
3643
|
] })
|
|
3639
3644
|
] }) });
|
|
3640
3645
|
if (s === "scatter")
|
|
3641
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3646
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3642
3647
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3643
3648
|
"How to create a ",
|
|
3644
3649
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
@@ -3655,7 +3660,7 @@ function Zn(s) {
|
|
|
3655
3660
|
] })
|
|
3656
3661
|
] }) });
|
|
3657
3662
|
if (["pie", "doughnut", "polarArea"].includes(s))
|
|
3658
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3663
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3659
3664
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3660
3665
|
/* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
|
|
3661
3666
|
" ",
|
|
@@ -3824,7 +3829,7 @@ function el() {
|
|
|
3824
3829
|
] })
|
|
3825
3830
|
] })
|
|
3826
3831
|
] }) }),
|
|
3827
|
-
/* @__PURE__ */ e.jsx(
|
|
3832
|
+
/* @__PURE__ */ e.jsx(Ss, { className: "my-3" }),
|
|
3828
3833
|
/* @__PURE__ */ e.jsx(
|
|
3829
3834
|
It,
|
|
3830
3835
|
{
|
|
@@ -3837,7 +3842,7 @@ function el() {
|
|
|
3837
3842
|
}
|
|
3838
3843
|
function sl() {
|
|
3839
3844
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3840
|
-
/* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(
|
|
3845
|
+
/* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3841
3846
|
/* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
|
|
3842
3847
|
/* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
|
|
3843
3848
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
@@ -3871,8 +3876,8 @@ function os({
|
|
|
3871
3876
|
docContent: n
|
|
3872
3877
|
}) {
|
|
3873
3878
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3874
|
-
/* @__PURE__ */ e.jsxs(
|
|
3875
|
-
/* @__PURE__ */ e.jsx(R, { children: `${
|
|
3879
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3880
|
+
/* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
|
|
3876
3881
|
/* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3877
3882
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
3878
3883
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -3895,11 +3900,11 @@ function os({
|
|
|
3895
3900
|
] })
|
|
3896
3901
|
] }) })
|
|
3897
3902
|
] }),
|
|
3898
|
-
/* @__PURE__ */ e.jsxs(
|
|
3903
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3899
3904
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3900
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3905
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
|
|
3901
3906
|
] }),
|
|
3902
|
-
s !== "range" && /* @__PURE__ */ e.jsxs(
|
|
3907
|
+
s !== "range" && /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3903
3908
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3904
3909
|
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3905
3910
|
] })
|
|
@@ -3907,7 +3912,7 @@ function os({
|
|
|
3907
3912
|
}
|
|
3908
3913
|
function al() {
|
|
3909
3914
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3910
|
-
/* @__PURE__ */ e.jsxs(
|
|
3915
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
|
|
3911
3916
|
/* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
|
|
3912
3917
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
|
|
3913
3918
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
|
|
@@ -3932,14 +3937,14 @@ function al() {
|
|
|
3932
3937
|
] })
|
|
3933
3938
|
] })
|
|
3934
3939
|
] }),
|
|
3935
|
-
/* @__PURE__ */ e.jsxs(
|
|
3940
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
|
|
3936
3941
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3937
3942
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3938
|
-
/* @__PURE__ */ e.jsx(
|
|
3943
|
+
/* @__PURE__ */ e.jsx(Fs, {}),
|
|
3939
3944
|
/* @__PURE__ */ e.jsx(za, {})
|
|
3940
3945
|
] })
|
|
3941
3946
|
] }),
|
|
3942
|
-
/* @__PURE__ */ e.jsxs(
|
|
3947
|
+
/* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3943
3948
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3944
3949
|
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3945
3950
|
] })
|
|
@@ -3958,7 +3963,7 @@ function tl({}) {
|
|
|
3958
3963
|
});
|
|
3959
3964
|
};
|
|
3960
3965
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3961
|
-
/* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(
|
|
3966
|
+
/* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
|
|
3962
3967
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3963
3968
|
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
|
|
3964
3969
|
] }) }),
|
|
@@ -4037,12 +4042,12 @@ function rl() {
|
|
|
4037
4042
|
return /* @__PURE__ */ e.jsx(Xn, {});
|
|
4038
4043
|
}
|
|
4039
4044
|
}
|
|
4040
|
-
return /* @__PURE__ */ e.jsx(
|
|
4045
|
+
return /* @__PURE__ */ e.jsx(Cs, { className: "h-full w-full text-sm", children: n(s) });
|
|
4041
4046
|
}
|
|
4042
4047
|
function il() {
|
|
4043
4048
|
const s = r((n) => n.isShowingVisual);
|
|
4044
4049
|
return /* @__PURE__ */ e.jsxs(
|
|
4045
|
-
|
|
4050
|
+
ms,
|
|
4046
4051
|
{
|
|
4047
4052
|
direction: "vertical",
|
|
4048
4053
|
className: "min-w-full max-w-lg min-h-[250px]",
|
|
@@ -4054,10 +4059,10 @@ function il() {
|
|
|
4054
4059
|
className: "flex",
|
|
4055
4060
|
minSize: 20,
|
|
4056
4061
|
defaultSize: 40,
|
|
4057
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4062
|
+
children: /* @__PURE__ */ e.jsx(Vn, {})
|
|
4058
4063
|
}
|
|
4059
4064
|
),
|
|
4060
|
-
/* @__PURE__ */ e.jsx(
|
|
4065
|
+
/* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border " }),
|
|
4061
4066
|
/* @__PURE__ */ e.jsx(
|
|
4062
4067
|
Fe,
|
|
4063
4068
|
{
|
|
@@ -4065,7 +4070,7 @@ function il() {
|
|
|
4065
4070
|
role: "visual-section",
|
|
4066
4071
|
minSize: 0,
|
|
4067
4072
|
defaultSize: 60,
|
|
4068
|
-
children: s ? /* @__PURE__ */ e.jsxs(
|
|
4073
|
+
children: s ? /* @__PURE__ */ e.jsxs(ms, { direction: "horizontal", children: [
|
|
4069
4074
|
/* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
4070
4075
|
Fe,
|
|
4071
4076
|
{
|
|
@@ -4076,7 +4081,7 @@ function il() {
|
|
|
4076
4081
|
children: /* @__PURE__ */ e.jsx(rl, {})
|
|
4077
4082
|
}
|
|
4078
4083
|
) }),
|
|
4079
|
-
/* @__PURE__ */ e.jsx(
|
|
4084
|
+
/* @__PURE__ */ e.jsx(us, { className: "border " }),
|
|
4080
4085
|
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx($s, {}) })
|
|
4081
4086
|
] }) : /* @__PURE__ */ e.jsx($s, {})
|
|
4082
4087
|
}
|
|
@@ -4091,8 +4096,8 @@ function ol({ authToken: s, onSave: n, onClose: a }) {
|
|
|
4091
4096
|
n && t(n), a && i(a);
|
|
4092
4097
|
}, [n, t, a, i]), K(() => {
|
|
4093
4098
|
s && s.accessToken && o(s);
|
|
4094
|
-
}, [s, o]), /* @__PURE__ */ e.jsxs(
|
|
4095
|
-
/* @__PURE__ */ e.jsx(
|
|
4099
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs(qt, { className: "rounded-none", role: "editor-panel", children: [
|
|
4100
|
+
/* @__PURE__ */ e.jsx(Vt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(pa, {}) }),
|
|
4096
4101
|
/* @__PURE__ */ e.jsx(Rt, { children: /* @__PURE__ */ e.jsx(il, {}) })
|
|
4097
4102
|
] });
|
|
4098
4103
|
}
|
|
@@ -4109,7 +4114,7 @@ function cl() {
|
|
|
4109
4114
|
"div",
|
|
4110
4115
|
{
|
|
4111
4116
|
role: "editor-container",
|
|
4112
|
-
className:
|
|
4117
|
+
className: Y("flex grow", {
|
|
4113
4118
|
block: a,
|
|
4114
4119
|
hidden: !a
|
|
4115
4120
|
}),
|
|
@@ -4125,7 +4130,7 @@ function dl({
|
|
|
4125
4130
|
(u) => u.actions.removeFilterValue
|
|
4126
4131
|
);
|
|
4127
4132
|
function m(u) {
|
|
4128
|
-
const N = he(u.column_name), d = he(t || ""), x = he(i || ""), f = he(n), w =
|
|
4133
|
+
const N = he(u.column_name), d = he(t || ""), x = he(i || ""), f = he(n), w = ds(
|
|
4129
4134
|
x,
|
|
4130
4135
|
f
|
|
4131
4136
|
), b = `${w}.${N}`;
|
|
@@ -4187,7 +4192,7 @@ function dl({
|
|
|
4187
4192
|
"div",
|
|
4188
4193
|
{
|
|
4189
4194
|
onClick: () => m(u),
|
|
4190
|
-
className:
|
|
4195
|
+
className: Y(
|
|
4191
4196
|
"group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
4192
4197
|
{
|
|
4193
4198
|
"bg-muted": N
|
|
@@ -4242,7 +4247,7 @@ function ml() {
|
|
|
4242
4247
|
"div",
|
|
4243
4248
|
{
|
|
4244
4249
|
role: "dashboard-plus-main",
|
|
4245
|
-
className:
|
|
4250
|
+
className: Y("grow", {
|
|
4246
4251
|
hidden: n,
|
|
4247
4252
|
flex: !n
|
|
4248
4253
|
}),
|
|
@@ -4262,7 +4267,7 @@ function ul() {
|
|
|
4262
4267
|
), /* @__PURE__ */ e.jsx(
|
|
4263
4268
|
"div",
|
|
4264
4269
|
{
|
|
4265
|
-
className:
|
|
4270
|
+
className: Y(" p-2", {
|
|
4266
4271
|
hidden: !a
|
|
4267
4272
|
}),
|
|
4268
4273
|
children: /* @__PURE__ */ e.jsx(
|