react-semaphor 0.1.203 → 0.1.205
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-controls-DekrQ0yg.js +42 -0
- package/dist/chunks/dashboard-controls-n5_oB_dp.js +1584 -0
- package/dist/chunks/{dashboard-json-Cwh8kbV9.js → dashboard-json-B5YyWsMv.js} +5 -5
- package/dist/chunks/{dashboard-json-Dh8csIFq.js → dashboard-json-VG8uFdaU.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-_3iUVFkC.js → dashboard-summary-settings-dialog-B7_fbNYb.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-BL4vn4lZ.js → dashboard-summary-settings-dialog-DnfxWTj2.js} +55 -55
- package/dist/chunks/{edit-dashboard-visual-RiCeBX0X.js → edit-dashboard-visual-BxDQKLvc.js} +9 -9
- package/dist/chunks/{edit-dashboard-visual-DEc3lB9j.js → edit-dashboard-visual-bl33bktZ.js} +928 -914
- package/dist/chunks/{editor-action-buttons-BfLWRprW.js → editor-action-buttons-BUAzU5tX.js} +1 -1
- package/dist/chunks/{editor-action-buttons-DovtyKKL.js → editor-action-buttons-DngVSXyw.js} +65 -65
- package/dist/chunks/index-CtLqMYAL.js +1109 -0
- package/dist/chunks/{index-DaQXz6Oi.js → index-em2ecoK3.js} +33535 -29709
- package/dist/chunks/notification-bell-BWh1ZNB4.js +11 -0
- package/dist/chunks/{notification-bell-Cn3-W-S3.js → notification-bell-Ck-SNMez.js} +232 -233
- package/dist/chunks/{resource-management-panel-qsbMXn91.js → resource-management-panel-BGJ4XMn5.js} +188 -188
- package/dist/chunks/{resource-management-panel-DBnpAHFb.js → resource-management-panel-Ji1DZtnk.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-B22nZN2c.js → use-role-aware-display-preferences-C0-SK5cT.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-CnipXO4k.js → use-role-aware-display-preferences-DEkMGyx9.js} +1 -1
- package/dist/chunks/{use-visual-utils-JlfPxiXq.js → use-visual-utils-BLdGPBdR.js} +1 -1
- package/dist/chunks/{use-visual-utils-B9X7-yfe.js → use-visual-utils-BYBat4tj.js} +28 -28
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +258 -173
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +813 -2
- package/dist/types/types.d.ts +222 -0
- package/package.json +2 -1
- package/dist/chunks/dashboard-controls-D5VrI40y.js +0 -42
- package/dist/chunks/dashboard-controls-p7I_UrIz.js +0 -1661
- package/dist/chunks/index-CpnMO9b6.js +0 -1087
- package/dist/chunks/notification-bell-DsJcuxld.js +0 -11
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import oe, { useState as A, useRef as L, useCallback as P, useEffect as D, useContext as ie } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { bI as te, l as R, bC as I, aW as B, aH as se, aG as $, bB as ae, aI as le, m as ce, n as de, o as ue, p as me, q as he, L as O, cA as pe, cF as fe, cG as _, G as ge, B as S, H, bA as M, bQ as ve, u as E, bU as xe, bs as re, cH as be, cI as j, I as U, bE as we, cJ as Ce, c as T, b$ as G, c0 as q, c1 as X, c2 as Q, c3 as W, by as Ne, cK as ye, cL as Ae, cM as Se, ch as Ee, ci as De, cj as Ie, cN as ke, ck as Ue, cl as Te, cm as Fe, cn as Pe, co as Me, am as Ve, a2 as Le, cO as ze, cP as Oe, aw as Re, X as Be, cQ as $e, cR as He, cS as _e, al as J, a3 as je, bD as Ge, P as qe, s as Xe, cT as Qe, t as We } from "./index-em2ecoK3.js";
|
|
3
3
|
import { jsx as t, jsxs as r, Fragment as V } from "react/jsx-runtime";
|
|
4
|
-
import { E as
|
|
5
|
-
import { a as ne } from "./use-visual-utils-
|
|
6
|
-
import { c as
|
|
4
|
+
import { E as Je, V as Ke, a as Ye, b as Ze, S as K, c as et, C as tt } from "./editor-action-buttons-DngVSXyw.js";
|
|
5
|
+
import { a as ne } from "./use-visual-utils-BYBat4tj.js";
|
|
6
|
+
import { c as Y } from "./date-formatter-Y8Za1ib3.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const st = te("CirclePlus", [
|
|
14
14
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
15
15
|
["path", { d: "M8 12h8", key: "1wcyev" }],
|
|
16
16
|
["path", { d: "M12 8v8", key: "napkw2" }]
|
|
@@ -26,15 +26,15 @@ const Z = te("FileDown", [
|
|
|
26
26
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
27
27
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
28
28
|
["path", { d: "m9 15 3 3 3-3", key: "1npd3o" }]
|
|
29
|
-
]),
|
|
29
|
+
]), at = 1e4, rt = 15e3, nt = 3e4, ot = 3e4, it = 12e4, ee = 2 * 60 * 60 * 1e3;
|
|
30
30
|
function lt(e) {
|
|
31
|
-
const
|
|
32
|
-
return
|
|
31
|
+
const s = Date.now() - e.getTime();
|
|
32
|
+
return s < ot ? at : s < it ? rt : nt;
|
|
33
33
|
}
|
|
34
34
|
function wt() {
|
|
35
|
-
const { authToken: e, tokenProps:
|
|
35
|
+
const { authToken: e, tokenProps: s } = R(), d = I((g) => g.activeExports), [n, u] = A(
|
|
36
36
|
typeof document < "u" ? !document.hidden : !0
|
|
37
|
-
), l = L(null), o = L(!1),
|
|
37
|
+
), l = L(null), o = L(!1), a = L(void 0), p = s == null ? void 0 : s.apiServiceUrl, m = e == null ? void 0 : e.accessToken, v = P(() => {
|
|
38
38
|
const g = I.getState().activeExports;
|
|
39
39
|
return Array.from(g.values()).filter(
|
|
40
40
|
(b) => B(b.status)
|
|
@@ -43,14 +43,14 @@ function wt() {
|
|
|
43
43
|
D(() => {
|
|
44
44
|
if (typeof document > "u") return;
|
|
45
45
|
const g = () => {
|
|
46
|
-
|
|
46
|
+
u(!document.hidden);
|
|
47
47
|
};
|
|
48
48
|
return document.addEventListener("visibilitychange", g), () => {
|
|
49
49
|
document.removeEventListener("visibilitychange", g);
|
|
50
50
|
};
|
|
51
51
|
}, []);
|
|
52
52
|
const C = P(async () => {
|
|
53
|
-
if (!
|
|
53
|
+
if (!p || !m) {
|
|
54
54
|
o.current = !1;
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -60,40 +60,40 @@ function wt() {
|
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
const b = Date.now(), y = g.filter(
|
|
63
|
-
(
|
|
63
|
+
(c) => b - c.startedAt.getTime() > ee
|
|
64
64
|
);
|
|
65
65
|
if (y.length > 0) {
|
|
66
|
-
const { updateExport:
|
|
66
|
+
const { updateExport: c } = I.getState().actions;
|
|
67
67
|
for (const i of y)
|
|
68
|
-
|
|
68
|
+
c(i.id, {
|
|
69
69
|
status: "failed",
|
|
70
70
|
error: "Export timed out. Please try again or contact support.",
|
|
71
71
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
const f = g.filter(
|
|
75
|
-
(
|
|
75
|
+
(c) => b - c.startedAt.getTime() <= ee
|
|
76
76
|
);
|
|
77
77
|
if (f.length === 0) {
|
|
78
78
|
o.current = !1;
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
const x = await Promise.allSettled(
|
|
82
|
-
f.map(async (
|
|
82
|
+
f.map(async (c) => {
|
|
83
83
|
try {
|
|
84
|
-
const i = await
|
|
84
|
+
const i = await se(p, m, c.id);
|
|
85
85
|
let w;
|
|
86
86
|
if (i.status === "completed")
|
|
87
87
|
try {
|
|
88
|
-
w = await $(
|
|
88
|
+
w = await $(p, m, c.id);
|
|
89
89
|
} catch (F) {
|
|
90
90
|
console.error(
|
|
91
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
91
|
+
`[useExportPolling] Failed to get download URL for ${c.id}:`,
|
|
92
92
|
F
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
return {
|
|
96
|
-
id:
|
|
96
|
+
id: c.id,
|
|
97
97
|
status: i.status,
|
|
98
98
|
progress: i.progress,
|
|
99
99
|
completedChunks: i.completedChunks,
|
|
@@ -105,36 +105,36 @@ function wt() {
|
|
|
105
105
|
};
|
|
106
106
|
} catch (i) {
|
|
107
107
|
return console.error(
|
|
108
|
-
`[useExportPolling] Failed to poll export ${
|
|
108
|
+
`[useExportPolling] Failed to poll export ${c.id}:`,
|
|
109
109
|
i
|
|
110
110
|
), null;
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
113
|
), { updateExport: N } = I.getState().actions;
|
|
114
|
-
for (const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
114
|
+
for (const c of x)
|
|
115
|
+
c.status === "fulfilled" && c.value && N(c.value.id, c.value);
|
|
116
|
+
const h = v();
|
|
117
|
+
if (h.length > 0 && !document.hidden) {
|
|
118
|
+
const c = h.reduce(
|
|
119
119
|
(w, F) => F.startedAt < w ? F.startedAt : w,
|
|
120
|
-
|
|
121
|
-
), i = lt(
|
|
120
|
+
h[0].startedAt
|
|
121
|
+
), i = lt(c);
|
|
122
122
|
l.current && clearTimeout(l.current), l.current = setTimeout(() => {
|
|
123
123
|
var w;
|
|
124
|
-
(w =
|
|
124
|
+
(w = a.current) == null || w.call(a);
|
|
125
125
|
}, i);
|
|
126
126
|
} else
|
|
127
127
|
o.current = !1;
|
|
128
|
-
}, [
|
|
128
|
+
}, [p, m, v]);
|
|
129
129
|
return D(() => {
|
|
130
|
-
|
|
130
|
+
a.current = C;
|
|
131
131
|
}, [C]), D(() => {
|
|
132
132
|
var b;
|
|
133
|
-
v().length > 0 && n && !o.current && (o.current = !0, (b =
|
|
134
|
-
}, [
|
|
133
|
+
v().length > 0 && n && !o.current && (o.current = !0, (b = a.current) == null || b.call(a));
|
|
134
|
+
}, [d, n, v]), D(() => {
|
|
135
135
|
var b;
|
|
136
136
|
const g = v();
|
|
137
|
-
n && g.length > 0 && !o.current && (o.current = !0, (b =
|
|
137
|
+
n && g.length > 0 && !o.current && (o.current = !0, (b = a.current) == null || b.call(a));
|
|
138
138
|
}, [n, v]), D(() => {
|
|
139
139
|
!n && l.current && (clearTimeout(l.current), l.current = null, o.current = !1);
|
|
140
140
|
}, [n]), D(() => () => {
|
|
@@ -146,53 +146,53 @@ function wt() {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
function Ct() {
|
|
149
|
-
const { authToken: e, tokenProps:
|
|
149
|
+
const { authToken: e, tokenProps: s } = R(), d = I((a) => a.activeExports), { addExport: n } = ae(), u = L(!1), l = s == null ? void 0 : s.apiServiceUrl, o = e == null ? void 0 : e.accessToken;
|
|
150
150
|
D(() => {
|
|
151
|
-
if (
|
|
151
|
+
if (u.current || !l || !o) return;
|
|
152
152
|
(async () => {
|
|
153
153
|
try {
|
|
154
|
-
const { exports:
|
|
154
|
+
const { exports: p } = await le(l, o, {
|
|
155
155
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
156
156
|
limit: 20
|
|
157
157
|
// Limit to recent exports
|
|
158
158
|
});
|
|
159
|
-
for (const
|
|
160
|
-
if (
|
|
161
|
-
const v =
|
|
159
|
+
for (const m of p) {
|
|
160
|
+
if (d.has(m.id)) continue;
|
|
161
|
+
const v = m.totalChunks ? Math.round(m.completedChunks / m.totalChunks * 100) : 0;
|
|
162
162
|
let C;
|
|
163
|
-
if (
|
|
163
|
+
if (m.status === "completed")
|
|
164
164
|
try {
|
|
165
|
-
C = await $(l, o,
|
|
165
|
+
C = await $(l, o, m.id);
|
|
166
166
|
} catch (b) {
|
|
167
167
|
console.error(
|
|
168
|
-
`[useExportRecovery] Failed to get download URL for ${
|
|
168
|
+
`[useExportRecovery] Failed to get download URL for ${m.id}:`,
|
|
169
169
|
b
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
172
|
const g = {
|
|
173
|
-
id:
|
|
174
|
-
status:
|
|
173
|
+
id: m.id,
|
|
174
|
+
status: m.status,
|
|
175
175
|
progress: v,
|
|
176
|
-
title: ct(
|
|
177
|
-
totalRows:
|
|
178
|
-
totalChunks:
|
|
179
|
-
completedChunks:
|
|
180
|
-
startedAt: new Date(
|
|
176
|
+
title: ct(m),
|
|
177
|
+
totalRows: m.totalRows,
|
|
178
|
+
totalChunks: m.totalChunks,
|
|
179
|
+
completedChunks: m.completedChunks,
|
|
180
|
+
startedAt: new Date(m.createdAt),
|
|
181
181
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
182
|
-
completedAt:
|
|
183
|
-
fileSize:
|
|
184
|
-
error:
|
|
185
|
-
expiresAt: new Date(
|
|
182
|
+
completedAt: m.completedAt ? new Date(m.completedAt) : void 0,
|
|
183
|
+
fileSize: m.fileSize,
|
|
184
|
+
error: m.error,
|
|
185
|
+
expiresAt: new Date(m.expiresAt),
|
|
186
186
|
downloadUrl: C
|
|
187
187
|
};
|
|
188
188
|
n(g);
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
} catch (
|
|
192
|
-
console.error("[useExportRecovery] Failed to recover exports:",
|
|
190
|
+
u.current = !0;
|
|
191
|
+
} catch (p) {
|
|
192
|
+
console.error("[useExportRecovery] Failed to recover exports:", p), u.current = !0;
|
|
193
193
|
}
|
|
194
194
|
})();
|
|
195
|
-
}, [l, o, n,
|
|
195
|
+
}, [l, o, n, d]);
|
|
196
196
|
}
|
|
197
197
|
function ct(e) {
|
|
198
198
|
return e.title ? e.title : B(
|
|
@@ -201,32 +201,32 @@ function ct(e) {
|
|
|
201
201
|
}
|
|
202
202
|
function dt({
|
|
203
203
|
open: e,
|
|
204
|
-
onOpenChange:
|
|
205
|
-
isLibraryVisual:
|
|
204
|
+
onOpenChange: s,
|
|
205
|
+
isLibraryVisual: d,
|
|
206
206
|
currentVisualName: n,
|
|
207
|
-
isSaving:
|
|
207
|
+
isSaving: u = !1,
|
|
208
208
|
onConfirm: l
|
|
209
209
|
}) {
|
|
210
|
-
const [o,
|
|
211
|
-
|
|
212
|
-
), [
|
|
210
|
+
const [o, a] = A(
|
|
211
|
+
d && n ? `Copy of ${n}` : n || ""
|
|
212
|
+
), [p, m] = A(""), [v, C] = A(!d), [g, b] = A(!0);
|
|
213
213
|
oe.useEffect(() => {
|
|
214
|
-
e && (
|
|
215
|
-
|
|
216
|
-
),
|
|
217
|
-
}, [e,
|
|
214
|
+
e && (a(
|
|
215
|
+
d && n ? `Copy of ${n}` : n || ""
|
|
216
|
+
), m(""), C(!d), b(!0));
|
|
217
|
+
}, [e, d, n]);
|
|
218
218
|
const y = () => {
|
|
219
219
|
o.trim() && (!v && !g || l({
|
|
220
220
|
name: o.trim(),
|
|
221
|
-
description:
|
|
221
|
+
description: p.trim() || void 0,
|
|
222
222
|
saveToLibrary: v,
|
|
223
223
|
saveToCurrentDashboard: g
|
|
224
224
|
}));
|
|
225
225
|
}, f = o.trim() && (v || g);
|
|
226
|
-
return /* @__PURE__ */ t(ce, { open: e, onOpenChange:
|
|
226
|
+
return /* @__PURE__ */ t(ce, { open: e, onOpenChange: s, children: /* @__PURE__ */ r(de, { className: "sm:max-w-[425px]", children: [
|
|
227
227
|
/* @__PURE__ */ r(ue, { children: [
|
|
228
228
|
/* @__PURE__ */ t(me, { children: "Save Visual As" }),
|
|
229
|
-
/* @__PURE__ */ t(he, { children:
|
|
229
|
+
/* @__PURE__ */ t(he, { children: d ? "Create a copy of this visual with a new name" : "Save this visual to make it reusable" })
|
|
230
230
|
] }),
|
|
231
231
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
232
232
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
@@ -236,9 +236,9 @@ function dt({
|
|
|
236
236
|
{
|
|
237
237
|
id: "name",
|
|
238
238
|
value: o,
|
|
239
|
-
onChange: (x) =>
|
|
239
|
+
onChange: (x) => a(x.target.value),
|
|
240
240
|
placeholder: "Enter visual name",
|
|
241
|
-
disabled:
|
|
241
|
+
disabled: u
|
|
242
242
|
}
|
|
243
243
|
)
|
|
244
244
|
] }),
|
|
@@ -248,11 +248,11 @@ function dt({
|
|
|
248
248
|
fe,
|
|
249
249
|
{
|
|
250
250
|
id: "description",
|
|
251
|
-
value:
|
|
252
|
-
onChange: (x) =>
|
|
251
|
+
value: p,
|
|
252
|
+
onChange: (x) => m(x.target.value),
|
|
253
253
|
placeholder: "Enter visual description",
|
|
254
254
|
rows: 3,
|
|
255
|
-
disabled:
|
|
255
|
+
disabled: u
|
|
256
256
|
}
|
|
257
257
|
)
|
|
258
258
|
] }),
|
|
@@ -261,12 +261,12 @@ function dt({
|
|
|
261
261
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
262
262
|
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
263
263
|
/* @__PURE__ */ t(
|
|
264
|
-
|
|
264
|
+
_,
|
|
265
265
|
{
|
|
266
266
|
id: "save-to-dashboard",
|
|
267
267
|
checked: g,
|
|
268
268
|
onCheckedChange: (x) => b(!!x),
|
|
269
|
-
disabled:
|
|
269
|
+
disabled: u
|
|
270
270
|
}
|
|
271
271
|
),
|
|
272
272
|
/* @__PURE__ */ r(
|
|
@@ -276,19 +276,19 @@ function dt({
|
|
|
276
276
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
277
277
|
children: [
|
|
278
278
|
"Current Dashboard",
|
|
279
|
-
/* @__PURE__ */ t("span", { className: "ml-2 text-xs text-muted-foreground", children:
|
|
279
|
+
/* @__PURE__ */ t("span", { className: "ml-2 text-xs text-muted-foreground", children: d ? "(add copy to this dashboard)" : "(keep as local visual)" })
|
|
280
280
|
]
|
|
281
281
|
}
|
|
282
282
|
)
|
|
283
283
|
] }),
|
|
284
284
|
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
285
285
|
/* @__PURE__ */ t(
|
|
286
|
-
|
|
286
|
+
_,
|
|
287
287
|
{
|
|
288
288
|
id: "save-to-library",
|
|
289
289
|
checked: v,
|
|
290
290
|
onCheckedChange: (x) => C(!!x),
|
|
291
|
-
disabled:
|
|
291
|
+
disabled: u
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
294
|
/* @__PURE__ */ r(
|
|
@@ -298,7 +298,7 @@ function dt({
|
|
|
298
298
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
299
299
|
children: [
|
|
300
300
|
"Visual Library",
|
|
301
|
-
/* @__PURE__ */ t("span", { className: "ml-2 text-xs text-muted-foreground", children:
|
|
301
|
+
/* @__PURE__ */ t("span", { className: "ml-2 text-xs text-muted-foreground", children: d ? "(save as new reusable visual)" : "(make available to all dashboards)" })
|
|
302
302
|
]
|
|
303
303
|
}
|
|
304
304
|
)
|
|
@@ -309,46 +309,46 @@ function dt({
|
|
|
309
309
|
] }),
|
|
310
310
|
/* @__PURE__ */ r(ge, { children: [
|
|
311
311
|
/* @__PURE__ */ t(
|
|
312
|
-
|
|
312
|
+
S,
|
|
313
313
|
{
|
|
314
314
|
variant: "outline",
|
|
315
|
-
onClick: () =>
|
|
316
|
-
disabled:
|
|
315
|
+
onClick: () => s(!1),
|
|
316
|
+
disabled: u,
|
|
317
317
|
children: "Cancel"
|
|
318
318
|
}
|
|
319
319
|
),
|
|
320
|
-
/* @__PURE__ */ r(
|
|
321
|
-
|
|
322
|
-
|
|
320
|
+
/* @__PURE__ */ r(S, { onClick: y, disabled: !f || u, children: [
|
|
321
|
+
u && /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
322
|
+
u ? "Saving..." : "Save"
|
|
323
323
|
] })
|
|
324
324
|
] })
|
|
325
325
|
] }) });
|
|
326
326
|
}
|
|
327
327
|
function ut() {
|
|
328
|
-
const [e,
|
|
328
|
+
const [e, s] = A(!1), [d, n] = A(!1), [u, l] = A(null), o = M((i) => i.frame), a = M((i) => i.card), p = ve(), m = E((i) => i.selectedSheetId), v = E(
|
|
329
329
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
330
330
|
), { getUpdatedFrame: C } = ne(), { selectVisual: g } = xe(), { addFrame: b, setSelectedFrameId: y, setIsVisualEditing: f } = re(), x = !!(o != null && o.visualId), N = (() => {
|
|
331
331
|
var i, w;
|
|
332
|
-
return ((i = o == null ? void 0 : o.cards) == null ? void 0 : i.length) === 1 && ((w = o.cards[0]) != null && w.title) ? o.cards[0].title :
|
|
333
|
-
})(),
|
|
332
|
+
return ((i = o == null ? void 0 : o.cards) == null ? void 0 : i.length) === 1 && ((w = o.cards[0]) != null && w.title) ? o.cards[0].title : p != null && p.title ? p.title : (a == null ? void 0 : a.title) || "Untitled Visual";
|
|
333
|
+
})(), h = be((i) => {
|
|
334
334
|
if (i != null && i.id) {
|
|
335
|
-
if (g(i),
|
|
335
|
+
if (g(i), d && u && m) {
|
|
336
336
|
const w = {
|
|
337
|
-
...
|
|
337
|
+
...u,
|
|
338
338
|
id: j(),
|
|
339
339
|
visualId: i.id
|
|
340
340
|
// Link to the newly created library visual
|
|
341
341
|
};
|
|
342
|
-
b(
|
|
342
|
+
b(m, w, "end"), y(w.id), n(!1), l(null), f(!1);
|
|
343
343
|
}
|
|
344
|
-
v(!0),
|
|
344
|
+
v(!0), s(!1);
|
|
345
345
|
}
|
|
346
346
|
});
|
|
347
347
|
return {
|
|
348
348
|
saveAsDialogOpen: e,
|
|
349
|
-
setSaveAsDialogOpen:
|
|
349
|
+
setSaveAsDialogOpen: s,
|
|
350
350
|
handleSaveAs: async (i) => {
|
|
351
|
-
if (!
|
|
351
|
+
if (!m) {
|
|
352
352
|
U.error("No sheet selected");
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
@@ -369,7 +369,7 @@ function ut() {
|
|
|
369
369
|
// Card title synced for single-card frames
|
|
370
370
|
isPrivate: !1
|
|
371
371
|
};
|
|
372
|
-
|
|
372
|
+
h.mutate(k);
|
|
373
373
|
} else if (i.saveToCurrentDashboard) {
|
|
374
374
|
const k = {
|
|
375
375
|
...z,
|
|
@@ -378,18 +378,18 @@ function ut() {
|
|
|
378
378
|
visualId: void 0
|
|
379
379
|
// Explicitly no visualId for local visuals
|
|
380
380
|
};
|
|
381
|
-
b(
|
|
381
|
+
b(m, k, "end"), y(k.id), U.success("Visual saved to dashboard"), s(!1), f(!1);
|
|
382
382
|
}
|
|
383
383
|
},
|
|
384
384
|
isLibraryVisual: x,
|
|
385
385
|
currentVisualName: N,
|
|
386
|
-
isSaving:
|
|
386
|
+
isSaving: h.isPending
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
function Nt({
|
|
390
390
|
className: e
|
|
391
391
|
}) {
|
|
392
|
-
const
|
|
392
|
+
const s = M((h) => h.frame), d = M((h) => h.card), n = we((h) => h.selectedVisual), u = E((h) => h.selectedFrameId), l = E((h) => h.selectedSheetId), { setIsVisualEditing: o } = re(), a = !!(s != null && s.visualId || n != null && n.id), p = !!(s != null && s.visualId && u), m = a && !p, {
|
|
393
393
|
saveAsDialogOpen: v,
|
|
394
394
|
setSaveAsDialogOpen: C,
|
|
395
395
|
handleSaveAs: g,
|
|
@@ -405,64 +405,64 @@ function Nt({
|
|
|
405
405
|
U.error("No visual selected");
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
|
|
408
|
+
const h = await x(n);
|
|
409
|
+
h.success ? (U.success("Visual added to dashboard"), o(!1)) : U.error(h.error || "Failed to add visual to dashboard");
|
|
410
410
|
};
|
|
411
411
|
return /* @__PURE__ */ r(V, { children: [
|
|
412
|
-
!
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
412
|
+
!a && /* @__PURE__ */ t(Je, { className: e, variant: "default" }),
|
|
413
|
+
a && /* @__PURE__ */ r(V, { children: [
|
|
414
|
+
p && /* @__PURE__ */ t(Ke, { className: e }),
|
|
415
|
+
m && l && d && (d.sql || Ce(d.config)) && /* @__PURE__ */ r(
|
|
416
|
+
S,
|
|
417
417
|
{
|
|
418
418
|
onClick: N,
|
|
419
419
|
className: T(e),
|
|
420
420
|
size: "sm",
|
|
421
421
|
variant: "outline",
|
|
422
422
|
children: [
|
|
423
|
-
/* @__PURE__ */ t(
|
|
423
|
+
/* @__PURE__ */ t(st, { className: "mr-2 size-4 font-bold" }),
|
|
424
424
|
"Add to Dashboard"
|
|
425
425
|
]
|
|
426
426
|
}
|
|
427
427
|
),
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
/* @__PURE__ */ r(
|
|
428
|
+
m && /* @__PURE__ */ t(Ye, { className: e, variant: "default" }),
|
|
429
|
+
p && /* @__PURE__ */ t(Ze, { className: e }),
|
|
430
|
+
/* @__PURE__ */ r(G, { modal: !1, children: [
|
|
431
431
|
/* @__PURE__ */ t(q, { asChild: !0, children: /* @__PURE__ */ t(
|
|
432
|
-
|
|
432
|
+
S,
|
|
433
433
|
{
|
|
434
434
|
variant: "outline",
|
|
435
435
|
size: "sm",
|
|
436
436
|
className: T(e, "w-8 p-0"),
|
|
437
|
-
children: /* @__PURE__ */ t(
|
|
437
|
+
children: /* @__PURE__ */ t(X, { className: "h-4 w-4" })
|
|
438
438
|
}
|
|
439
439
|
) }),
|
|
440
|
-
/* @__PURE__ */ t(
|
|
441
|
-
|
|
440
|
+
/* @__PURE__ */ t(Q, { align: "end", children: /* @__PURE__ */ r(
|
|
441
|
+
W,
|
|
442
442
|
{
|
|
443
|
-
onClick: (
|
|
444
|
-
|
|
443
|
+
onClick: (h) => {
|
|
444
|
+
h.stopPropagation(), C(!0);
|
|
445
445
|
},
|
|
446
446
|
children: [
|
|
447
|
-
/* @__PURE__ */ t(
|
|
447
|
+
/* @__PURE__ */ t(K, { className: "mr-2 h-4 w-4" }),
|
|
448
448
|
"Save As..."
|
|
449
449
|
]
|
|
450
450
|
}
|
|
451
451
|
) })
|
|
452
452
|
] })
|
|
453
453
|
] }),
|
|
454
|
-
!
|
|
454
|
+
!a && /* @__PURE__ */ r(G, { modal: !1, children: [
|
|
455
455
|
/* @__PURE__ */ t(q, { asChild: !0, children: /* @__PURE__ */ t(
|
|
456
|
-
|
|
456
|
+
S,
|
|
457
457
|
{
|
|
458
458
|
variant: "outline",
|
|
459
459
|
size: "sm",
|
|
460
460
|
className: T(e, "w-8 p-0"),
|
|
461
|
-
children: /* @__PURE__ */ t(
|
|
461
|
+
children: /* @__PURE__ */ t(X, { className: "h-4 w-4" })
|
|
462
462
|
}
|
|
463
463
|
) }),
|
|
464
|
-
/* @__PURE__ */ t(
|
|
465
|
-
/* @__PURE__ */ t(
|
|
464
|
+
/* @__PURE__ */ t(Q, { align: "end", children: /* @__PURE__ */ r(W, { onClick: () => C(!0), children: [
|
|
465
|
+
/* @__PURE__ */ t(K, { className: "mr-2 h-4 w-4" }),
|
|
466
466
|
"Save As..."
|
|
467
467
|
] }) })
|
|
468
468
|
] }),
|
|
@@ -471,8 +471,8 @@ function Nt({
|
|
|
471
471
|
dt,
|
|
472
472
|
{
|
|
473
473
|
open: v,
|
|
474
|
-
onOpenChange: (
|
|
475
|
-
f || C(
|
|
474
|
+
onOpenChange: (h) => {
|
|
475
|
+
f || C(h);
|
|
476
476
|
},
|
|
477
477
|
isLibraryVisual: b,
|
|
478
478
|
currentVisualName: y,
|
|
@@ -485,18 +485,18 @@ function Nt({
|
|
|
485
485
|
function yt({
|
|
486
486
|
className: e,
|
|
487
487
|
//labelClassName,
|
|
488
|
-
switchClassName:
|
|
488
|
+
switchClassName: s
|
|
489
489
|
}) {
|
|
490
|
-
const
|
|
490
|
+
const d = M((a) => a.isDevMode), n = E((a) => a.isVisualEditing), { setIsDevMode: u } = Ne(), { config: l } = ie(ye).tokenProps, o = (l == null ? void 0 : l.showAdvancedMode) !== !1;
|
|
491
491
|
return !n || !o ? null : /* @__PURE__ */ r("div", { className: T("flex items-center space-x-2", e), children: [
|
|
492
492
|
/* @__PURE__ */ t(
|
|
493
493
|
Ae,
|
|
494
494
|
{
|
|
495
|
-
className: T("",
|
|
496
|
-
checked:
|
|
497
|
-
onCheckedChange: () =>
|
|
495
|
+
className: T("", s),
|
|
496
|
+
checked: d,
|
|
497
|
+
onCheckedChange: () => u(!d),
|
|
498
498
|
id: "advanced-mode",
|
|
499
|
-
icon: /* @__PURE__ */ t(
|
|
499
|
+
icon: /* @__PURE__ */ t(Se, { className: "h-4 w-4" }),
|
|
500
500
|
tooltip: "Advanced Mode"
|
|
501
501
|
}
|
|
502
502
|
),
|
|
@@ -505,13 +505,13 @@ function yt({
|
|
|
505
505
|
}
|
|
506
506
|
function At({
|
|
507
507
|
open: e,
|
|
508
|
-
onOpenChange:
|
|
509
|
-
onSave:
|
|
508
|
+
onOpenChange: s,
|
|
509
|
+
onSave: d,
|
|
510
510
|
onDiscard: n,
|
|
511
|
-
isSaving:
|
|
511
|
+
isSaving: u
|
|
512
512
|
}) {
|
|
513
|
-
return /* @__PURE__ */ t(
|
|
514
|
-
!o &&
|
|
513
|
+
return /* @__PURE__ */ t(Ee, { open: e, onOpenChange: (o) => {
|
|
514
|
+
!o && u || s(o);
|
|
515
515
|
}, children: /* @__PURE__ */ r(De, { className: "max-w-md", children: [
|
|
516
516
|
/* @__PURE__ */ r(Ie, { children: [
|
|
517
517
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
@@ -524,7 +524,7 @@ function At({
|
|
|
524
524
|
/* @__PURE__ */ t(
|
|
525
525
|
Pe,
|
|
526
526
|
{
|
|
527
|
-
disabled:
|
|
527
|
+
disabled: u,
|
|
528
528
|
className: "order-1 m-0 border-border/50 sm:order-1",
|
|
529
529
|
children: "Cancel"
|
|
530
530
|
}
|
|
@@ -533,7 +533,7 @@ function At({
|
|
|
533
533
|
"button",
|
|
534
534
|
{
|
|
535
535
|
onClick: n,
|
|
536
|
-
disabled:
|
|
536
|
+
disabled: u,
|
|
537
537
|
className: "order-2 rounded-md border border-destructive/20 bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive transition-colors hover:bg-destructive/20 disabled:pointer-events-none disabled:opacity-50 sm:order-2",
|
|
538
538
|
children: "Discard"
|
|
539
539
|
}
|
|
@@ -541,11 +541,11 @@ function At({
|
|
|
541
541
|
/* @__PURE__ */ t(
|
|
542
542
|
Me,
|
|
543
543
|
{
|
|
544
|
-
onClick:
|
|
545
|
-
disabled:
|
|
544
|
+
onClick: d,
|
|
545
|
+
disabled: u,
|
|
546
546
|
className: "order-3 m-0 bg-primary text-primary-foreground hover:bg-primary/90 sm:order-3",
|
|
547
|
-
children:
|
|
548
|
-
/* @__PURE__ */ t(
|
|
547
|
+
children: u ? /* @__PURE__ */ r(V, { children: [
|
|
548
|
+
/* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
549
549
|
"Saving..."
|
|
550
550
|
] }) : "Save & Close"
|
|
551
551
|
}
|
|
@@ -553,61 +553,61 @@ function At({
|
|
|
553
553
|
] })
|
|
554
554
|
] }) });
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function St(e, s, d, n) {
|
|
557
557
|
D(() => {
|
|
558
|
-
e && !
|
|
559
|
-
}, [e,
|
|
558
|
+
e && !d && s && n(Ve(s));
|
|
559
|
+
}, [e, d, s, n]);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Et({
|
|
562
562
|
triggerButtonClassName: e
|
|
563
563
|
}) {
|
|
564
|
-
const [
|
|
565
|
-
var
|
|
566
|
-
return (
|
|
567
|
-
}),
|
|
568
|
-
var
|
|
569
|
-
return (
|
|
570
|
-
}), l =
|
|
571
|
-
var
|
|
572
|
-
return (
|
|
573
|
-
}), o =
|
|
574
|
-
return l == null || l.find((
|
|
564
|
+
const [s, d] = A(!1), n = E((a) => {
|
|
565
|
+
var p;
|
|
566
|
+
return (p = a.dashboard) == null ? void 0 : p.id;
|
|
567
|
+
}), u = E((a) => {
|
|
568
|
+
var p;
|
|
569
|
+
return (p = a.dashboard) == null ? void 0 : p.title;
|
|
570
|
+
}), l = E((a) => {
|
|
571
|
+
var p;
|
|
572
|
+
return (p = a.dashboard) == null ? void 0 : p.sheets;
|
|
573
|
+
}), o = E((a) => a.selectedSheetId);
|
|
574
|
+
return l == null || l.find((a) => a.id === o), n ? /* @__PURE__ */ r(V, { children: [
|
|
575
575
|
/* @__PURE__ */ t(
|
|
576
576
|
Le,
|
|
577
577
|
{
|
|
578
578
|
tooltip: "Schedule Dashboard",
|
|
579
579
|
className: T("h-7 p-2", e),
|
|
580
|
-
onClick: () =>
|
|
580
|
+
onClick: () => d(!0),
|
|
581
581
|
children: /* @__PURE__ */ t(ze, { className: "size-4" })
|
|
582
582
|
}
|
|
583
583
|
),
|
|
584
584
|
/* @__PURE__ */ t(
|
|
585
585
|
Oe,
|
|
586
586
|
{
|
|
587
|
-
open:
|
|
588
|
-
onOpenChange:
|
|
587
|
+
open: s,
|
|
588
|
+
onOpenChange: d,
|
|
589
589
|
dashboardId: n,
|
|
590
|
-
dashboardName:
|
|
590
|
+
dashboardName: u
|
|
591
591
|
}
|
|
592
592
|
)
|
|
593
593
|
] }) : null;
|
|
594
594
|
}
|
|
595
595
|
function mt({
|
|
596
596
|
export: e,
|
|
597
|
-
onRemove:
|
|
597
|
+
onRemove: s
|
|
598
598
|
}) {
|
|
599
|
-
const
|
|
599
|
+
const d = () => {
|
|
600
600
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
601
|
-
}, n = (
|
|
602
|
-
|
|
603
|
-
},
|
|
601
|
+
}, n = (a) => {
|
|
602
|
+
a.stopPropagation(), s == null || s(e.id);
|
|
603
|
+
}, u = () => {
|
|
604
604
|
switch (e.status) {
|
|
605
605
|
case "completed":
|
|
606
|
-
return /* @__PURE__ */ t(
|
|
606
|
+
return /* @__PURE__ */ t(_e, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
607
607
|
case "failed":
|
|
608
608
|
return /* @__PURE__ */ t(tt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
609
609
|
default:
|
|
610
|
-
return /* @__PURE__ */ t(
|
|
610
|
+
return /* @__PURE__ */ t(H, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
611
611
|
}
|
|
612
612
|
}, l = B(e.status), o = (() => {
|
|
613
613
|
switch (e.status) {
|
|
@@ -626,7 +626,7 @@ function mt({
|
|
|
626
626
|
return /* @__PURE__ */ r("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
627
627
|
/* @__PURE__ */ r("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
628
628
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
629
|
-
|
|
629
|
+
u(),
|
|
630
630
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
631
631
|
/* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
|
|
632
632
|
e.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
@@ -644,7 +644,7 @@ function mt({
|
|
|
644
644
|
] })
|
|
645
645
|
] }),
|
|
646
646
|
/* @__PURE__ */ t(
|
|
647
|
-
|
|
647
|
+
S,
|
|
648
648
|
{
|
|
649
649
|
variant: "ghost",
|
|
650
650
|
size: "icon",
|
|
@@ -657,14 +657,14 @@ function mt({
|
|
|
657
657
|
] }),
|
|
658
658
|
/* @__PURE__ */ r("div", { className: "ml-8", children: [
|
|
659
659
|
e.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
660
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
660
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Y(e.startedAt, { addSuffix: !0 }) }),
|
|
661
661
|
e.downloadUrl && /* @__PURE__ */ r(
|
|
662
|
-
|
|
662
|
+
S,
|
|
663
663
|
{
|
|
664
664
|
size: "sm",
|
|
665
665
|
variant: "outline",
|
|
666
666
|
className: "h-8 bg-transparent",
|
|
667
|
-
onClick:
|
|
667
|
+
onClick: d,
|
|
668
668
|
children: [
|
|
669
669
|
/* @__PURE__ */ t($e, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
670
670
|
"Download"
|
|
@@ -673,104 +673,103 @@ function mt({
|
|
|
673
673
|
)
|
|
674
674
|
] }),
|
|
675
675
|
l && /* @__PURE__ */ r("div", { children: [
|
|
676
|
-
/* @__PURE__ */ t(
|
|
676
|
+
/* @__PURE__ */ t(He, { value: e.progress, className: "h-1.5" }),
|
|
677
677
|
/* @__PURE__ */ r("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
678
678
|
e.progress,
|
|
679
679
|
"% complete"
|
|
680
680
|
] })
|
|
681
681
|
] }),
|
|
682
|
-
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
682
|
+
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Y(e.startedAt, { addSuffix: !0 }) })
|
|
683
683
|
] })
|
|
684
684
|
] });
|
|
685
685
|
}
|
|
686
686
|
function ht() {
|
|
687
|
-
const { authToken: e, tokenProps:
|
|
687
|
+
const { authToken: e, tokenProps: s } = R(), d = I((f) => f.activeExports), { clearCompleted: n, removeExport: u, updateExport: l } = ae(), [o, a] = A(!1), [p, m] = A(!1), v = Array.from(d.values()).sort(
|
|
688
688
|
(f, x) => x.startedAt.getTime() - f.startedAt.getTime()
|
|
689
689
|
), C = v.some(
|
|
690
690
|
(f) => f.status === "completed" || f.status === "failed"
|
|
691
691
|
), g = P(async () => {
|
|
692
|
-
const f =
|
|
692
|
+
const f = s == null ? void 0 : s.apiServiceUrl, x = e == null ? void 0 : e.accessToken;
|
|
693
693
|
if (!(!f || !x)) {
|
|
694
|
-
|
|
694
|
+
a(!0);
|
|
695
695
|
try {
|
|
696
|
-
const N = Array.from(
|
|
696
|
+
const N = Array.from(d.values());
|
|
697
697
|
await Promise.all(
|
|
698
|
-
N.map(async (
|
|
698
|
+
N.map(async (h) => {
|
|
699
699
|
try {
|
|
700
|
-
const
|
|
700
|
+
const c = await se(f, x, h.id);
|
|
701
701
|
let i;
|
|
702
|
-
if (
|
|
702
|
+
if (c.status === "completed")
|
|
703
703
|
try {
|
|
704
704
|
i = await $(
|
|
705
705
|
f,
|
|
706
706
|
x,
|
|
707
|
-
|
|
707
|
+
h.id
|
|
708
708
|
);
|
|
709
709
|
} catch (w) {
|
|
710
|
-
console.error(`Failed to get download URL for ${
|
|
710
|
+
console.error(`Failed to get download URL for ${h.id}:`, w);
|
|
711
711
|
}
|
|
712
|
-
l(
|
|
713
|
-
status:
|
|
714
|
-
progress:
|
|
715
|
-
completedChunks:
|
|
716
|
-
completedAt:
|
|
712
|
+
l(h.id, {
|
|
713
|
+
status: c.status,
|
|
714
|
+
progress: c.progress,
|
|
715
|
+
completedChunks: c.completedChunks,
|
|
716
|
+
completedAt: c.completedAt ? new Date(c.completedAt) : void 0,
|
|
717
717
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
718
|
-
fileSize:
|
|
719
|
-
error:
|
|
718
|
+
fileSize: c.fileSize,
|
|
719
|
+
error: c.error,
|
|
720
720
|
downloadUrl: i
|
|
721
721
|
});
|
|
722
|
-
} catch (
|
|
723
|
-
console.error(`Failed to refresh export ${
|
|
722
|
+
} catch (c) {
|
|
723
|
+
console.error(`Failed to refresh export ${h.id}:`, c);
|
|
724
724
|
}
|
|
725
725
|
})
|
|
726
726
|
);
|
|
727
727
|
} finally {
|
|
728
|
-
|
|
728
|
+
a(!1);
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
}, [
|
|
732
|
-
|
|
732
|
+
d,
|
|
733
733
|
e == null ? void 0 : e.accessToken,
|
|
734
|
-
|
|
734
|
+
s == null ? void 0 : s.apiServiceUrl,
|
|
735
735
|
l
|
|
736
736
|
]), b = P(async () => {
|
|
737
|
-
const f =
|
|
737
|
+
const f = s == null ? void 0 : s.apiServiceUrl, x = e == null ? void 0 : e.accessToken;
|
|
738
738
|
if (!f || !x) {
|
|
739
739
|
n();
|
|
740
740
|
return;
|
|
741
741
|
}
|
|
742
|
-
|
|
742
|
+
m(!0);
|
|
743
743
|
try {
|
|
744
744
|
const N = v.filter(
|
|
745
|
-
(
|
|
745
|
+
(c) => c.status === "completed" || c.status === "failed"
|
|
746
|
+
), h = await Promise.allSettled(
|
|
747
|
+
N.map(async (c) => (await J(f, x, c.id), c.id))
|
|
746
748
|
);
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
(u) => K(f, x, u.id).catch(
|
|
750
|
-
(p) => console.error(`Failed to delete export ${u.id}:`, p)
|
|
751
|
-
)
|
|
752
|
-
)
|
|
753
|
-
), n();
|
|
749
|
+
for (const c of h)
|
|
750
|
+
c.status === "fulfilled" ? u(c.value) : console.error("Failed to delete export:", c.reason);
|
|
754
751
|
} finally {
|
|
755
|
-
|
|
752
|
+
m(!1);
|
|
756
753
|
}
|
|
757
754
|
}, [
|
|
758
755
|
v,
|
|
759
|
-
|
|
756
|
+
s == null ? void 0 : s.apiServiceUrl,
|
|
760
757
|
e == null ? void 0 : e.accessToken,
|
|
761
|
-
n
|
|
758
|
+
n,
|
|
759
|
+
u
|
|
762
760
|
]), y = P(
|
|
763
761
|
async (f) => {
|
|
764
|
-
const x =
|
|
762
|
+
const x = s == null ? void 0 : s.apiServiceUrl, N = e == null ? void 0 : e.accessToken;
|
|
765
763
|
if (x && N)
|
|
766
764
|
try {
|
|
767
|
-
await
|
|
768
|
-
|
|
769
|
-
|
|
765
|
+
await J(x, N, f), u(f);
|
|
766
|
+
return;
|
|
767
|
+
} catch (h) {
|
|
768
|
+
console.error(`Failed to cancel export ${f}:`, h);
|
|
770
769
|
}
|
|
771
|
-
|
|
770
|
+
u(f);
|
|
772
771
|
},
|
|
773
|
-
[
|
|
772
|
+
[s == null ? void 0 : s.apiServiceUrl, e == null ? void 0 : e.accessToken, u]
|
|
774
773
|
);
|
|
775
774
|
return v.length === 0 ? /* @__PURE__ */ r("div", { className: "p-6 text-center", children: [
|
|
776
775
|
/* @__PURE__ */ t(Z, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
@@ -784,7 +783,7 @@ function ht() {
|
|
|
784
783
|
] }),
|
|
785
784
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
786
785
|
/* @__PURE__ */ t(
|
|
787
|
-
|
|
786
|
+
S,
|
|
788
787
|
{
|
|
789
788
|
variant: "ghost",
|
|
790
789
|
size: "sm",
|
|
@@ -801,14 +800,14 @@ function ht() {
|
|
|
801
800
|
}
|
|
802
801
|
),
|
|
803
802
|
C && /* @__PURE__ */ t(
|
|
804
|
-
|
|
803
|
+
S,
|
|
805
804
|
{
|
|
806
805
|
variant: "ghost",
|
|
807
806
|
size: "sm",
|
|
808
807
|
className: "h-7 px-2 text-sm",
|
|
809
808
|
onClick: b,
|
|
810
|
-
disabled:
|
|
811
|
-
children:
|
|
809
|
+
disabled: p,
|
|
810
|
+
children: p ? "Clearing..." : "Clear all"
|
|
812
811
|
}
|
|
813
812
|
)
|
|
814
813
|
] })
|
|
@@ -824,20 +823,20 @@ function ht() {
|
|
|
824
823
|
] });
|
|
825
824
|
}
|
|
826
825
|
function Dt() {
|
|
827
|
-
const e = I((
|
|
828
|
-
(
|
|
829
|
-
), l =
|
|
826
|
+
const e = I((a) => a.activeExports), s = Ge(), d = e.size > 0, n = Array.from(e.values()).some(
|
|
827
|
+
(a) => a.status === "completed" || a.status === "failed"
|
|
828
|
+
), l = s > 0 ? s > 9 ? "9+" : String(s) : null;
|
|
830
829
|
return /* @__PURE__ */ r(qe, { children: [
|
|
831
|
-
/* @__PURE__ */ t(
|
|
832
|
-
|
|
830
|
+
/* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ r(
|
|
831
|
+
S,
|
|
833
832
|
{
|
|
834
833
|
variant: "ghost",
|
|
835
834
|
size: "icon",
|
|
836
835
|
className: "relative h-8 w-8",
|
|
837
836
|
"aria-label": "Export notifications",
|
|
838
837
|
children: [
|
|
839
|
-
/* @__PURE__ */ t(
|
|
840
|
-
|
|
838
|
+
/* @__PURE__ */ t(Qe, { className: "h-4 w-4" }),
|
|
839
|
+
d && /* @__PURE__ */ t(
|
|
841
840
|
"span",
|
|
842
841
|
{
|
|
843
842
|
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${l ? "-right-0.5 -top-0.5 h-4 min-w-4 px-0.5 text-[10px] font-semibold" : "right-0.5 top-0.5 h-2 w-2"}`,
|
|
@@ -847,18 +846,18 @@ function Dt() {
|
|
|
847
846
|
]
|
|
848
847
|
}
|
|
849
848
|
) }),
|
|
850
|
-
/* @__PURE__ */ t(
|
|
849
|
+
/* @__PURE__ */ t(We, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(ht, {}) })
|
|
851
850
|
] });
|
|
852
851
|
}
|
|
853
852
|
export {
|
|
854
853
|
yt as A,
|
|
855
|
-
|
|
854
|
+
mt as E,
|
|
856
855
|
Dt as N,
|
|
857
|
-
|
|
856
|
+
Et as S,
|
|
858
857
|
At as U,
|
|
859
858
|
Nt as V,
|
|
860
|
-
|
|
859
|
+
ht as a,
|
|
861
860
|
Ct as b,
|
|
862
|
-
|
|
861
|
+
St as c,
|
|
863
862
|
wt as u
|
|
864
863
|
};
|