react-semaphor 0.1.210 → 0.1.212
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-BcpwRqRu.js +47 -0
- package/dist/chunks/{dashboard-controls-C08300Wi.js → dashboard-controls-DG0FT__o.js} +561 -540
- package/dist/chunks/{dashboard-json-GjDBGO26.js → dashboard-json-C1b81ShY.js} +1 -1
- package/dist/chunks/{dashboard-json-DlEE5-WA.js → dashboard-json-F8qwUIWM.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-QUuhhXU9.js → dashboard-summary-settings-dialog-CsjLFOn-.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-THx-gjnG.js → dashboard-summary-settings-dialog-yytNDqsJ.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-PfWJXb2-.js → edit-dashboard-visual-B-qAacmt.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-Bsmow1Pa.js → edit-dashboard-visual-C-Y0fhBE.js} +483 -484
- package/dist/chunks/{editor-action-buttons-DNbp_ZWy.js → editor-action-buttons-BddCK22U.js} +27 -27
- package/dist/chunks/{editor-action-buttons-FPyaC09X.js → editor-action-buttons-Dr9s7Z0u.js} +1 -1
- package/dist/chunks/index-irqsC0zR.js +1109 -0
- package/dist/chunks/{index-CAVrkf9d.js → index-tdtX3LgC.js} +27718 -27508
- package/dist/chunks/notification-bell-CRzJdHm5.js +6 -0
- package/dist/chunks/{notification-bell-C3a7wC1u.js → notification-bell-Ci1RHooZ.js} +308 -340
- package/dist/chunks/{resource-management-panel-BVTgbma8.js → resource-management-panel-CaKSsCiq.js} +73 -73
- package/dist/chunks/{resource-management-panel-C5NjrVsA.js → resource-management-panel-cwMyqyn1.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-DxCPoCgr.js → use-role-aware-display-preferences-CImfZXy5.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-l7NFLYnn.js → use-role-aware-display-preferences-D5eZpiQS.js} +1 -1
- package/dist/chunks/{use-visual-utils-D9IJz9R0.js → use-visual-utils-0xqPjTL6.js} +23 -23
- package/dist/chunks/{use-visual-utils-B82Q-Ytl.js → use-visual-utils-BAVRApHw.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +251 -216
- 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 +52 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-BAOrAMV9.js +0 -42
- package/dist/chunks/index-CXKjmjfB.js +0 -1104
- package/dist/chunks/notification-bell-BqvKQSw9.js +0 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as t, jsxs as
|
|
4
|
-
import { V as
|
|
5
|
-
import { a as
|
|
6
|
-
import { c as
|
|
1
|
+
import K, { useState as D, useRef as M, useCallback as k, useEffect as L, useContext as ee } from "react";
|
|
2
|
+
import { bS as te, l as z, bM as T, b6 as B, aT as Q, aS as $, bL as Y, aU as ae, m as se, n as re, o as oe, p as ne, q as ie, L as j, cB as le, cH as ce, G as de, B as I, H as _, a1 as P, V as ue, u as V, W as me, Z, cI as he, cJ as H, I as R, bO as pe, c as U, c8 as fe, c9 as ge, ab as ve, cb as be, cc as F, E as xe, cg as we, c7 as ye, Y as Ce, cK as Ne, cL as Ae, cM as De, cp as Ee, cq as Se, cr as Le, cN as Ie, cs as Te, ct as Ue, cu as ke, cv as Ve, cw as Fe, ay as Me, aI as Pe, X as Re, cO as Oe, cP as ze, cQ as Be, ax as q, ad as $e, bN as _e, P as je, s as He, cR as qe, t as Ge } from "./index-tdtX3LgC.js";
|
|
3
|
+
import { jsx as t, jsxs as o, Fragment as O } from "react/jsx-runtime";
|
|
4
|
+
import { V as Xe, E as We, a as Qe, b as Ye, L as Ze, c as Je, d as Ke, C as et } from "./editor-action-buttons-BddCK22U.js";
|
|
5
|
+
import { a as J } from "./use-visual-utils-0xqPjTL6.js";
|
|
6
|
+
import { c as G } from "./date-formatter-Y8Za1ib3.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
@@ -15,15 +15,15 @@ const X = te("FileDown", [
|
|
|
15
15
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
16
16
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
17
17
|
["path", { d: "m9 15 3 3 3-3", key: "1npd3o" }]
|
|
18
|
-
]),
|
|
19
|
-
function
|
|
18
|
+
]), tt = 1e4, at = 15e3, st = 3e4, rt = 3e4, ot = 12e4, W = 2 * 60 * 60 * 1e3;
|
|
19
|
+
function nt(e) {
|
|
20
20
|
const a = Date.now() - e.getTime();
|
|
21
|
-
return a <
|
|
21
|
+
return a < rt ? tt : a < ot ? at : st;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const { authToken: e, tokenProps: a } = z(), m = T((h) => h.activeExports), [
|
|
23
|
+
function bt() {
|
|
24
|
+
const { authToken: e, tokenProps: a } = z(), m = T((h) => h.activeExports), [c, d] = D(
|
|
25
25
|
typeof document < "u" ? !document.hidden : !0
|
|
26
|
-
),
|
|
26
|
+
), u = M(null), n = M(!1), l = M(void 0), f = a == null ? void 0 : a.apiServiceUrl, i = e == null ? void 0 : e.accessToken, g = k(() => {
|
|
27
27
|
const h = T.getState().activeExports;
|
|
28
28
|
return Array.from(h.values()).filter(
|
|
29
29
|
(b) => B(b.status)
|
|
@@ -32,186 +32,186 @@ function yt() {
|
|
|
32
32
|
L(() => {
|
|
33
33
|
if (typeof document > "u") return;
|
|
34
34
|
const h = () => {
|
|
35
|
-
|
|
35
|
+
d(!document.hidden);
|
|
36
36
|
};
|
|
37
37
|
return document.addEventListener("visibilitychange", h), () => {
|
|
38
38
|
document.removeEventListener("visibilitychange", h);
|
|
39
39
|
};
|
|
40
40
|
}, []);
|
|
41
|
-
const x =
|
|
42
|
-
if (!f || !
|
|
43
|
-
|
|
41
|
+
const x = k(async () => {
|
|
42
|
+
if (!f || !i) {
|
|
43
|
+
n.current = !1;
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
const h = g();
|
|
47
47
|
if (h.length === 0) {
|
|
48
|
-
|
|
48
|
+
n.current = !1;
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
const b = Date.now(), N = h.filter(
|
|
52
|
-
(
|
|
52
|
+
(s) => b - s.startedAt.getTime() > W
|
|
53
53
|
);
|
|
54
54
|
if (N.length > 0) {
|
|
55
|
-
const { updateExport:
|
|
56
|
-
for (const
|
|
57
|
-
r
|
|
55
|
+
const { updateExport: s } = T.getState().actions;
|
|
56
|
+
for (const r of N)
|
|
57
|
+
s(r.id, {
|
|
58
58
|
status: "failed",
|
|
59
59
|
error: "Export timed out. Please try again or contact support.",
|
|
60
60
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
const p = h.filter(
|
|
64
|
-
(
|
|
64
|
+
(s) => b - s.startedAt.getTime() <= W
|
|
65
65
|
);
|
|
66
66
|
if (p.length === 0) {
|
|
67
|
-
|
|
67
|
+
n.current = !1;
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
const y = await Promise.allSettled(
|
|
71
|
-
p.map(async (
|
|
71
|
+
p.map(async (s) => {
|
|
72
72
|
try {
|
|
73
|
-
const
|
|
73
|
+
const r = await Q(f, i, s.id);
|
|
74
74
|
let v;
|
|
75
|
-
if (
|
|
75
|
+
if (r.status === "completed")
|
|
76
76
|
try {
|
|
77
|
-
v = await $(f,
|
|
77
|
+
v = await $(f, i, s.id);
|
|
78
78
|
} catch (E) {
|
|
79
79
|
console.error(
|
|
80
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
80
|
+
`[useExportPolling] Failed to get download URL for ${s.id}:`,
|
|
81
81
|
E
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
return {
|
|
85
|
-
id:
|
|
86
|
-
status:
|
|
87
|
-
progress:
|
|
88
|
-
completedChunks:
|
|
89
|
-
completedAt:
|
|
85
|
+
id: s.id,
|
|
86
|
+
status: r.status,
|
|
87
|
+
progress: r.progress,
|
|
88
|
+
completedChunks: r.completedChunks,
|
|
89
|
+
completedAt: r.completedAt ? new Date(r.completedAt) : void 0,
|
|
90
90
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
91
|
-
fileSize:
|
|
92
|
-
error:
|
|
91
|
+
fileSize: r.fileSize,
|
|
92
|
+
error: r.error,
|
|
93
93
|
downloadUrl: v
|
|
94
94
|
};
|
|
95
|
-
} catch (
|
|
95
|
+
} catch (r) {
|
|
96
96
|
return console.error(
|
|
97
|
-
`[useExportPolling] Failed to poll export ${
|
|
98
|
-
|
|
97
|
+
`[useExportPolling] Failed to poll export ${s.id}:`,
|
|
98
|
+
r
|
|
99
99
|
), null;
|
|
100
100
|
}
|
|
101
101
|
})
|
|
102
102
|
), { updateExport: A } = T.getState().actions;
|
|
103
|
-
for (const
|
|
104
|
-
|
|
103
|
+
for (const s of y)
|
|
104
|
+
s.status === "fulfilled" && s.value && A(s.value.id, s.value);
|
|
105
105
|
const w = g();
|
|
106
106
|
if (w.length > 0 && !document.hidden) {
|
|
107
|
-
const
|
|
107
|
+
const s = w.reduce(
|
|
108
108
|
(v, E) => E.startedAt < v ? E.startedAt : v,
|
|
109
109
|
w[0].startedAt
|
|
110
|
-
),
|
|
111
|
-
|
|
110
|
+
), r = nt(s);
|
|
111
|
+
u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
112
112
|
var v;
|
|
113
|
-
(v =
|
|
114
|
-
},
|
|
113
|
+
(v = l.current) == null || v.call(l);
|
|
114
|
+
}, r);
|
|
115
115
|
} else
|
|
116
|
-
|
|
117
|
-
}, [f,
|
|
116
|
+
n.current = !1;
|
|
117
|
+
}, [f, i, g]);
|
|
118
118
|
return L(() => {
|
|
119
|
-
|
|
119
|
+
l.current = x;
|
|
120
120
|
}, [x]), L(() => {
|
|
121
121
|
var b;
|
|
122
|
-
g().length > 0 &&
|
|
123
|
-
}, [m,
|
|
122
|
+
g().length > 0 && c && !n.current && (n.current = !0, (b = l.current) == null || b.call(l));
|
|
123
|
+
}, [m, c, g]), L(() => {
|
|
124
124
|
var b;
|
|
125
125
|
const h = g();
|
|
126
|
-
|
|
127
|
-
}, [
|
|
128
|
-
!
|
|
129
|
-
}, [
|
|
130
|
-
|
|
126
|
+
c && h.length > 0 && !n.current && (n.current = !0, (b = l.current) == null || b.call(l));
|
|
127
|
+
}, [c, g]), L(() => {
|
|
128
|
+
!c && u.current && (clearTimeout(u.current), u.current = null, n.current = !1);
|
|
129
|
+
}, [c]), L(() => () => {
|
|
130
|
+
u.current && (clearTimeout(u.current), u.current = null);
|
|
131
131
|
}, []), {
|
|
132
|
-
isPolling:
|
|
133
|
-
isTabVisible:
|
|
132
|
+
isPolling: n.current,
|
|
133
|
+
isTabVisible: c,
|
|
134
134
|
inProgressCount: g().length
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
const { authToken: e, tokenProps: a } = z(), m = T((
|
|
137
|
+
function xt() {
|
|
138
|
+
const { authToken: e, tokenProps: a } = z(), m = T((l) => l.activeExports), { addExport: c } = Y(), d = M(!1), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken;
|
|
139
139
|
L(() => {
|
|
140
|
-
if (
|
|
140
|
+
if (d.current || !u || !n) return;
|
|
141
141
|
(async () => {
|
|
142
142
|
try {
|
|
143
|
-
const { exports: f } = await ae(
|
|
143
|
+
const { exports: f } = await ae(u, n, {
|
|
144
144
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
145
145
|
limit: 20
|
|
146
146
|
// Limit to recent exports
|
|
147
147
|
});
|
|
148
|
-
for (const
|
|
149
|
-
if (m.has(
|
|
150
|
-
const g =
|
|
148
|
+
for (const i of f) {
|
|
149
|
+
if (m.has(i.id)) continue;
|
|
150
|
+
const g = i.totalChunks ? Math.round(i.completedChunks / i.totalChunks * 100) : 0;
|
|
151
151
|
let x;
|
|
152
|
-
if (
|
|
152
|
+
if (i.status === "completed")
|
|
153
153
|
try {
|
|
154
|
-
x = await $(
|
|
154
|
+
x = await $(u, n, i.id);
|
|
155
155
|
} catch (b) {
|
|
156
156
|
console.error(
|
|
157
|
-
`[useExportRecovery] Failed to get download URL for ${
|
|
157
|
+
`[useExportRecovery] Failed to get download URL for ${i.id}:`,
|
|
158
158
|
b
|
|
159
159
|
);
|
|
160
160
|
}
|
|
161
161
|
const h = {
|
|
162
|
-
id:
|
|
163
|
-
status:
|
|
162
|
+
id: i.id,
|
|
163
|
+
status: i.status,
|
|
164
164
|
progress: g,
|
|
165
|
-
title:
|
|
166
|
-
totalRows:
|
|
167
|
-
totalChunks:
|
|
168
|
-
completedChunks:
|
|
169
|
-
startedAt: new Date(
|
|
165
|
+
title: it(i),
|
|
166
|
+
totalRows: i.totalRows,
|
|
167
|
+
totalChunks: i.totalChunks,
|
|
168
|
+
completedChunks: i.completedChunks,
|
|
169
|
+
startedAt: new Date(i.createdAt),
|
|
170
170
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
171
|
-
completedAt:
|
|
172
|
-
fileSize:
|
|
173
|
-
error:
|
|
174
|
-
expiresAt: new Date(
|
|
171
|
+
completedAt: i.completedAt ? new Date(i.completedAt) : void 0,
|
|
172
|
+
fileSize: i.fileSize,
|
|
173
|
+
error: i.error,
|
|
174
|
+
expiresAt: new Date(i.expiresAt),
|
|
175
175
|
downloadUrl: x
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
c(h);
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
d.current = !0;
|
|
180
180
|
} catch (f) {
|
|
181
|
-
console.error("[useExportRecovery] Failed to recover exports:", f),
|
|
181
|
+
console.error("[useExportRecovery] Failed to recover exports:", f), d.current = !0;
|
|
182
182
|
}
|
|
183
183
|
})();
|
|
184
|
-
}, [
|
|
184
|
+
}, [u, n, c, m]);
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function it(e) {
|
|
187
187
|
return e.title ? e.title : B(
|
|
188
188
|
e.status
|
|
189
189
|
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function lt({
|
|
192
192
|
open: e,
|
|
193
193
|
onOpenChange: a,
|
|
194
194
|
isLibraryVisual: m,
|
|
195
|
-
currentVisualName:
|
|
196
|
-
isSaving:
|
|
197
|
-
destinationMode:
|
|
198
|
-
onConfirm:
|
|
195
|
+
currentVisualName: c,
|
|
196
|
+
isSaving: d = !1,
|
|
197
|
+
destinationMode: u = "both",
|
|
198
|
+
onConfirm: n
|
|
199
199
|
}) {
|
|
200
|
-
const [
|
|
201
|
-
m &&
|
|
202
|
-
), [
|
|
203
|
-
|
|
200
|
+
const [l, f] = D(
|
|
201
|
+
m && c ? `Copy of ${c}` : c || ""
|
|
202
|
+
), [i, g] = D("");
|
|
203
|
+
K.useEffect(() => {
|
|
204
204
|
e && (f(
|
|
205
|
-
m &&
|
|
205
|
+
m && c ? `Copy of ${c}` : c || ""
|
|
206
206
|
), g(""));
|
|
207
|
-
}, [e, m,
|
|
208
|
-
const x = !!
|
|
207
|
+
}, [e, m, c]);
|
|
208
|
+
const x = !!l.trim(), h = u === "local" ? {
|
|
209
209
|
saveToLibrary: !1,
|
|
210
210
|
saveToCurrentDashboard: !0,
|
|
211
211
|
badgeType: "local",
|
|
212
212
|
description: "Creates a local copy on the current dashboard.",
|
|
213
213
|
actionLabel: "Add to Dashboard (Local)"
|
|
214
|
-
} :
|
|
214
|
+
} : u === "library" ? {
|
|
215
215
|
saveToLibrary: !0,
|
|
216
216
|
saveToCurrentDashboard: !1,
|
|
217
217
|
badgeType: "library",
|
|
@@ -224,19 +224,19 @@ function ut({
|
|
|
224
224
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
225
225
|
actionLabel: "Save Copy as Linked Visual"
|
|
226
226
|
}, b = () => {
|
|
227
|
-
!x ||
|
|
228
|
-
name:
|
|
229
|
-
description:
|
|
227
|
+
!x || d || n({
|
|
228
|
+
name: l.trim(),
|
|
229
|
+
description: i.trim() || void 0,
|
|
230
230
|
saveToLibrary: h.saveToLibrary,
|
|
231
231
|
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
232
232
|
});
|
|
233
233
|
};
|
|
234
|
-
return /* @__PURE__ */ t(se, { open: e, onOpenChange: a, children: /* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ t(se, { open: e, onOpenChange: a, children: /* @__PURE__ */ o(re, { className: "sm:max-w-[500px]", children: [
|
|
235
|
+
/* @__PURE__ */ o(oe, { children: [
|
|
236
|
+
/* @__PURE__ */ o(ne, { className: "flex items-center gap-2", children: [
|
|
237
237
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
238
238
|
h.badgeType !== "local" && /* @__PURE__ */ t(
|
|
239
|
-
|
|
239
|
+
Xe,
|
|
240
240
|
{
|
|
241
241
|
type: h.badgeType,
|
|
242
242
|
showLabel: !0,
|
|
@@ -246,68 +246,68 @@ function ut({
|
|
|
246
246
|
] }),
|
|
247
247
|
/* @__PURE__ */ t(ie, { children: h.description })
|
|
248
248
|
] }),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
/* @__PURE__ */ t(
|
|
249
|
+
/* @__PURE__ */ o("div", { className: "grid gap-4 py-4", children: [
|
|
250
|
+
/* @__PURE__ */ o("div", { className: "grid gap-2", children: [
|
|
251
|
+
/* @__PURE__ */ t(j, { htmlFor: "name", children: "Name" }),
|
|
252
252
|
/* @__PURE__ */ t(
|
|
253
253
|
le,
|
|
254
254
|
{
|
|
255
255
|
id: "name",
|
|
256
|
-
value:
|
|
256
|
+
value: l,
|
|
257
257
|
onChange: (N) => f(N.target.value),
|
|
258
258
|
placeholder: "Enter visual name",
|
|
259
|
-
disabled:
|
|
259
|
+
disabled: d
|
|
260
260
|
}
|
|
261
261
|
)
|
|
262
262
|
] }),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
/* @__PURE__ */ t(
|
|
263
|
+
/* @__PURE__ */ o("div", { className: "grid gap-2", children: [
|
|
264
|
+
/* @__PURE__ */ t(j, { htmlFor: "description", children: "Description (optional)" }),
|
|
265
265
|
/* @__PURE__ */ t(
|
|
266
266
|
ce,
|
|
267
267
|
{
|
|
268
268
|
id: "description",
|
|
269
|
-
value:
|
|
269
|
+
value: i,
|
|
270
270
|
onChange: (N) => g(N.target.value),
|
|
271
271
|
placeholder: "Enter visual description",
|
|
272
272
|
rows: 3,
|
|
273
|
-
disabled:
|
|
273
|
+
disabled: d
|
|
274
274
|
}
|
|
275
275
|
)
|
|
276
276
|
] })
|
|
277
277
|
] }),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ o(de, { children: [
|
|
279
279
|
/* @__PURE__ */ t(
|
|
280
280
|
I,
|
|
281
281
|
{
|
|
282
282
|
variant: "outline",
|
|
283
283
|
onClick: () => a(!1),
|
|
284
|
-
disabled:
|
|
284
|
+
disabled: d,
|
|
285
285
|
children: "Cancel"
|
|
286
286
|
}
|
|
287
287
|
),
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
|
|
288
|
+
/* @__PURE__ */ o(I, { onClick: b, disabled: !x || d, children: [
|
|
289
|
+
d && /* @__PURE__ */ t(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
290
290
|
h.actionLabel
|
|
291
291
|
] })
|
|
292
292
|
] })
|
|
293
293
|
] }) });
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
const [e, a] = D(!1), [m,
|
|
297
|
-
(
|
|
298
|
-
), { getUpdatedFrame: x } =
|
|
299
|
-
var
|
|
300
|
-
return ((
|
|
301
|
-
})(), w = he((
|
|
302
|
-
if (
|
|
303
|
-
if (h(
|
|
295
|
+
function ct() {
|
|
296
|
+
const [e, a] = D(!1), [m, c] = D(!1), [d, u] = D(null), n = P((r) => r.frame), l = P((r) => r.card), f = ue(), i = V((r) => r.selectedSheetId), g = V(
|
|
297
|
+
(r) => r.actions.setIsDashboardPanelOpen
|
|
298
|
+
), { getUpdatedFrame: x } = J(), { selectVisual: h } = me(), { addFrame: b, setSelectedFrameId: N, setIsVisualEditing: p } = Z(), y = !!(n != null && n.visualId), A = (() => {
|
|
299
|
+
var r, v;
|
|
300
|
+
return ((r = n == null ? void 0 : n.cards) == null ? void 0 : r.length) === 1 && ((v = n.cards[0]) != null && v.title) ? n.cards[0].title : f != null && f.title ? f.title : (l == null ? void 0 : l.title) || "Untitled Visual";
|
|
301
|
+
})(), w = he((r) => {
|
|
302
|
+
if (r != null && r.id) {
|
|
303
|
+
if (h(r), m && d && i) {
|
|
304
304
|
const v = {
|
|
305
|
-
...
|
|
306
|
-
id:
|
|
307
|
-
visualId:
|
|
305
|
+
...d,
|
|
306
|
+
id: H(),
|
|
307
|
+
visualId: r.id
|
|
308
308
|
// Link to the newly created library visual
|
|
309
309
|
};
|
|
310
|
-
b(
|
|
310
|
+
b(i, v, "end"), N(v.id), c(!1), u(null), p(!1);
|
|
311
311
|
}
|
|
312
312
|
g(!0), a(!1);
|
|
313
313
|
}
|
|
@@ -315,8 +315,8 @@ function mt() {
|
|
|
315
315
|
return {
|
|
316
316
|
saveAsDialogOpen: e,
|
|
317
317
|
setSaveAsDialogOpen: a,
|
|
318
|
-
handleSaveAs: async (
|
|
319
|
-
if (!
|
|
318
|
+
handleSaveAs: async (r) => {
|
|
319
|
+
if (!i) {
|
|
320
320
|
R.error("No sheet selected");
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
@@ -324,29 +324,29 @@ function mt() {
|
|
|
324
324
|
...v,
|
|
325
325
|
cards: v.cards.map((S) => ({
|
|
326
326
|
...S,
|
|
327
|
-
title:
|
|
327
|
+
title: r.name
|
|
328
328
|
// Use visual name as card title
|
|
329
329
|
}))
|
|
330
330
|
} : v;
|
|
331
|
-
if (
|
|
332
|
-
|
|
331
|
+
if (r.saveToLibrary) {
|
|
332
|
+
c(r.saveToCurrentDashboard), u(C);
|
|
333
333
|
const S = {
|
|
334
|
-
title:
|
|
335
|
-
description:
|
|
334
|
+
title: r.name,
|
|
335
|
+
description: r.description,
|
|
336
336
|
frameObject: C,
|
|
337
337
|
// Card title synced for single-card frames
|
|
338
338
|
isPrivate: !1
|
|
339
339
|
};
|
|
340
340
|
w.mutate(S);
|
|
341
|
-
} else if (
|
|
341
|
+
} else if (r.saveToCurrentDashboard) {
|
|
342
342
|
const S = {
|
|
343
343
|
...C,
|
|
344
344
|
// Card title already synced
|
|
345
|
-
id:
|
|
345
|
+
id: H(),
|
|
346
346
|
visualId: void 0
|
|
347
347
|
// Explicitly no visualId for local visuals
|
|
348
348
|
};
|
|
349
|
-
b(
|
|
349
|
+
b(i, S, "end"), N(S.id), R.success("Visual saved to dashboard"), a(!1), p(!1);
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
isLibraryVisual: y,
|
|
@@ -354,114 +354,114 @@ function mt() {
|
|
|
354
354
|
isSaving: w.isPending
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function wt({
|
|
358
358
|
className: e
|
|
359
359
|
}) {
|
|
360
|
-
const a =
|
|
360
|
+
const a = P((C) => C.frame), m = pe((C) => C.selectedVisual), c = V((C) => C.selectedFrameId), d = V((C) => C.selectedSheetId), { setIsVisualEditing: u, updateFrame: n } = Z(), [l, f] = D(!1), [i, g] = D("both"), x = !!(a != null && a.visualId || m != null && m.id), h = !!(a != null && a.visualId && c), b = x && !h, {
|
|
361
361
|
saveAsDialogOpen: N,
|
|
362
362
|
setSaveAsDialogOpen: p,
|
|
363
363
|
handleSaveAs: y,
|
|
364
364
|
isLibraryVisual: A,
|
|
365
365
|
currentVisualName: w,
|
|
366
|
-
isSaving:
|
|
367
|
-
} =
|
|
368
|
-
if (!
|
|
366
|
+
isSaving: s
|
|
367
|
+
} = ct(), { getUpdatedFrame: r } = J(), v = () => {
|
|
368
|
+
if (!d) {
|
|
369
369
|
R.error("No sheet selected");
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
|
-
if (
|
|
372
|
+
if (l) return;
|
|
373
373
|
f(!0);
|
|
374
374
|
const S = {
|
|
375
|
-
...
|
|
375
|
+
...r(),
|
|
376
376
|
visualId: void 0
|
|
377
377
|
};
|
|
378
|
-
|
|
379
|
-
f(!1), R.success("Changes applied. Visual is now local to this dashboard"),
|
|
378
|
+
n(d, S), setTimeout(() => {
|
|
379
|
+
f(!1), R.success("Changes applied. Visual is now local to this dashboard"), u(!1);
|
|
380
380
|
}, 300);
|
|
381
381
|
}, E = (C) => {
|
|
382
382
|
g(C), p(!0);
|
|
383
383
|
};
|
|
384
|
-
return /* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ o(O, { children: [
|
|
385
|
+
/* @__PURE__ */ o("div", { className: "inline-flex items-center overflow-hidden rounded-md border border-input", children: [
|
|
386
386
|
!x && /* @__PURE__ */ t(
|
|
387
|
-
|
|
387
|
+
We,
|
|
388
388
|
{
|
|
389
|
-
className:
|
|
389
|
+
className: U(e, "rounded-none border-0"),
|
|
390
390
|
variant: "default"
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
393
|
x && b && /* @__PURE__ */ t(
|
|
394
|
-
|
|
394
|
+
Qe,
|
|
395
395
|
{
|
|
396
|
-
className:
|
|
396
|
+
className: U(e, "rounded-none border-0"),
|
|
397
397
|
variant: "default"
|
|
398
398
|
}
|
|
399
399
|
),
|
|
400
400
|
x && h && /* @__PURE__ */ t(
|
|
401
|
-
|
|
401
|
+
Ye,
|
|
402
402
|
{
|
|
403
|
-
className:
|
|
403
|
+
className: U(e, "rounded-none border-0")
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ o(fe, { modal: !1, children: [
|
|
407
407
|
/* @__PURE__ */ t(ge, { className: "h-8", asChild: !0, children: /* @__PURE__ */ t(
|
|
408
408
|
I,
|
|
409
409
|
{
|
|
410
410
|
variant: "default",
|
|
411
411
|
size: "sm",
|
|
412
|
-
className:
|
|
412
|
+
className: U(
|
|
413
413
|
e,
|
|
414
414
|
"w-8 rounded-none border-0 border-l border-primary-foreground/30 px-2"
|
|
415
415
|
),
|
|
416
416
|
"aria-label": "Open visual save options",
|
|
417
|
-
disabled:
|
|
417
|
+
disabled: s || l,
|
|
418
418
|
children: /* @__PURE__ */ t(ve, { className: "h-4 w-4" })
|
|
419
419
|
}
|
|
420
420
|
) }),
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
h && /* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
|
|
421
|
+
/* @__PURE__ */ o(be, { align: "end", children: [
|
|
422
|
+
h && /* @__PURE__ */ o(O, { children: [
|
|
423
|
+
/* @__PURE__ */ o(
|
|
424
|
+
F,
|
|
425
425
|
{
|
|
426
426
|
onClick: v,
|
|
427
|
-
disabled:
|
|
427
|
+
disabled: l,
|
|
428
428
|
children: [
|
|
429
429
|
/* @__PURE__ */ t(xe, { className: "mr-2 h-4 w-4" }),
|
|
430
|
-
|
|
430
|
+
l ? "Applying..." : "Apply Locally"
|
|
431
431
|
]
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
434
|
/* @__PURE__ */ t(we, {})
|
|
435
435
|
] }),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
|
|
436
|
+
/* @__PURE__ */ o(
|
|
437
|
+
F,
|
|
438
438
|
{
|
|
439
439
|
onClick: () => E("local"),
|
|
440
|
-
disabled:
|
|
440
|
+
disabled: s,
|
|
441
441
|
children: [
|
|
442
442
|
/* @__PURE__ */ t(ye, { className: "mr-2 h-4 w-4" }),
|
|
443
443
|
"Add to Dashboard (Local)"
|
|
444
444
|
]
|
|
445
445
|
}
|
|
446
446
|
),
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
|
|
447
|
+
/* @__PURE__ */ o(
|
|
448
|
+
F,
|
|
449
449
|
{
|
|
450
450
|
onClick: () => E("library"),
|
|
451
|
-
disabled:
|
|
451
|
+
disabled: s,
|
|
452
452
|
children: [
|
|
453
|
-
/* @__PURE__ */ t(
|
|
453
|
+
/* @__PURE__ */ t(Ze, { className: "mr-2 h-4 w-4" }),
|
|
454
454
|
"Save as Library Visual"
|
|
455
455
|
]
|
|
456
456
|
}
|
|
457
457
|
),
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
|
|
458
|
+
/* @__PURE__ */ o(
|
|
459
|
+
F,
|
|
460
460
|
{
|
|
461
461
|
onClick: () => E("both"),
|
|
462
|
-
disabled:
|
|
462
|
+
disabled: s,
|
|
463
463
|
children: [
|
|
464
|
-
/* @__PURE__ */ t(
|
|
464
|
+
/* @__PURE__ */ t(Je, { className: "mr-2 h-4 w-4" }),
|
|
465
465
|
"Save Copy as Linked Visual"
|
|
466
466
|
]
|
|
467
467
|
}
|
|
@@ -469,36 +469,36 @@ function Nt({
|
|
|
469
469
|
] })
|
|
470
470
|
] })
|
|
471
471
|
] }),
|
|
472
|
-
/* @__PURE__ */ t(
|
|
472
|
+
/* @__PURE__ */ t(Ke, { className: e }),
|
|
473
473
|
/* @__PURE__ */ t(
|
|
474
|
-
|
|
474
|
+
lt,
|
|
475
475
|
{
|
|
476
476
|
open: N,
|
|
477
477
|
onOpenChange: (C) => {
|
|
478
|
-
|
|
478
|
+
s || p(C);
|
|
479
479
|
},
|
|
480
480
|
isLibraryVisual: A,
|
|
481
481
|
currentVisualName: w,
|
|
482
|
-
isSaving:
|
|
483
|
-
destinationMode:
|
|
482
|
+
isSaving: s,
|
|
483
|
+
destinationMode: i,
|
|
484
484
|
onConfirm: y
|
|
485
485
|
}
|
|
486
486
|
)
|
|
487
487
|
] });
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function yt({
|
|
490
490
|
className: e,
|
|
491
491
|
//labelClassName,
|
|
492
492
|
switchClassName: a
|
|
493
493
|
}) {
|
|
494
|
-
const m =
|
|
495
|
-
return !
|
|
494
|
+
const m = P((l) => l.isDevMode), c = V((l) => l.isVisualEditing), { setIsDevMode: d } = Ce(), { config: u } = ee(Ne).tokenProps, n = (u == null ? void 0 : u.showAdvancedMode) !== !1;
|
|
495
|
+
return !c || !n ? null : /* @__PURE__ */ o("div", { className: U("flex items-center space-x-2", e), children: [
|
|
496
496
|
/* @__PURE__ */ t(
|
|
497
497
|
Ae,
|
|
498
498
|
{
|
|
499
|
-
className:
|
|
499
|
+
className: U("", a),
|
|
500
500
|
checked: m,
|
|
501
|
-
onCheckedChange: () =>
|
|
501
|
+
onCheckedChange: () => d(!m),
|
|
502
502
|
id: "advanced-mode",
|
|
503
503
|
icon: /* @__PURE__ */ t(De, { className: "h-4 w-4" }),
|
|
504
504
|
tooltip: "Advanced Mode"
|
|
@@ -507,117 +507,84 @@ function At({
|
|
|
507
507
|
/* @__PURE__ */ t("label", { htmlFor: "advanced-mode", className: "sr-only", children: "Advanced Mode" })
|
|
508
508
|
] });
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Ct({
|
|
511
511
|
open: e,
|
|
512
512
|
onOpenChange: a,
|
|
513
513
|
onSave: m,
|
|
514
|
-
onDiscard:
|
|
515
|
-
isSaving:
|
|
516
|
-
title:
|
|
517
|
-
description:
|
|
518
|
-
cancelLabel:
|
|
514
|
+
onDiscard: c,
|
|
515
|
+
isSaving: d,
|
|
516
|
+
title: u = "Unsaved Changes",
|
|
517
|
+
description: n = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
518
|
+
cancelLabel: l = "Cancel",
|
|
519
519
|
discardLabel: f = "Discard",
|
|
520
|
-
saveLabel:
|
|
520
|
+
saveLabel: i = "Save & Close"
|
|
521
521
|
}) {
|
|
522
522
|
return /* @__PURE__ */ t(Ee, { open: e, onOpenChange: (x) => {
|
|
523
|
-
!x &&
|
|
524
|
-
}, children: /* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
523
|
+
!x && d || a(x);
|
|
524
|
+
}, children: /* @__PURE__ */ o(Se, { className: "max-w-[520px] border-border/70 p-6", children: [
|
|
525
|
+
/* @__PURE__ */ o(Le, { className: "space-y-3", children: [
|
|
526
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
|
|
527
527
|
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-full bg-amber-50 ring-1 ring-amber-200/70", children: /* @__PURE__ */ t(Ie, { className: "h-[18px] w-[18px] text-amber-600" }) }),
|
|
528
|
-
/* @__PURE__ */ t(Te, { className: "text-lg font-semibold tracking-tight", children:
|
|
528
|
+
/* @__PURE__ */ t(Te, { className: "text-lg font-semibold tracking-tight", children: u })
|
|
529
529
|
] }),
|
|
530
|
-
/* @__PURE__ */ t(
|
|
530
|
+
/* @__PURE__ */ t(Ue, { className: "text-sm leading-6 text-muted-foreground", children: n })
|
|
531
531
|
] }),
|
|
532
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ o(ke, { className: "mt-2 flex-col gap-1.5 sm:flex-row sm:justify-end", children: [
|
|
533
533
|
/* @__PURE__ */ t(
|
|
534
|
-
|
|
534
|
+
Ve,
|
|
535
535
|
{
|
|
536
|
-
disabled:
|
|
536
|
+
disabled: d,
|
|
537
537
|
className: "order-1 m-0 h-9 border-border/60 px-4 sm:order-1",
|
|
538
|
-
children:
|
|
538
|
+
children: l
|
|
539
539
|
}
|
|
540
540
|
),
|
|
541
541
|
/* @__PURE__ */ t(
|
|
542
542
|
"button",
|
|
543
543
|
{
|
|
544
|
-
onClick:
|
|
545
|
-
disabled:
|
|
544
|
+
onClick: c,
|
|
545
|
+
disabled: d,
|
|
546
546
|
className: "order-2 h-9 rounded-md border border-destructive/30 bg-destructive/10 px-4 text-sm font-medium text-destructive transition-colors hover:bg-destructive/20 disabled:pointer-events-none disabled:opacity-50 sm:order-2",
|
|
547
547
|
children: f
|
|
548
548
|
}
|
|
549
549
|
),
|
|
550
550
|
/* @__PURE__ */ t(
|
|
551
|
-
|
|
551
|
+
Fe,
|
|
552
552
|
{
|
|
553
553
|
onClick: m,
|
|
554
|
-
disabled:
|
|
554
|
+
disabled: d,
|
|
555
555
|
className: "order-3 m-0 h-9 px-4 sm:order-3",
|
|
556
|
-
children:
|
|
557
|
-
/* @__PURE__ */ t(
|
|
556
|
+
children: d ? /* @__PURE__ */ o(O, { children: [
|
|
557
|
+
/* @__PURE__ */ t(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
558
558
|
"Saving..."
|
|
559
|
-
] }) :
|
|
559
|
+
] }) : i
|
|
560
560
|
}
|
|
561
561
|
)
|
|
562
562
|
] })
|
|
563
563
|
] }) });
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function Nt(e, a, m, c) {
|
|
566
566
|
L(() => {
|
|
567
|
-
e && !m && a &&
|
|
568
|
-
}, [e, m, a,
|
|
569
|
-
}
|
|
570
|
-
function St({
|
|
571
|
-
triggerButtonClassName: e,
|
|
572
|
-
variant: a = "ghost"
|
|
573
|
-
}) {
|
|
574
|
-
const [m, l] = D(!1), u = U((i) => {
|
|
575
|
-
var s;
|
|
576
|
-
return (s = i.dashboard) == null ? void 0 : s.id;
|
|
577
|
-
}), c = U((i) => {
|
|
578
|
-
var s;
|
|
579
|
-
return (s = i.dashboard) == null ? void 0 : s.title;
|
|
580
|
-
});
|
|
581
|
-
return u ? /* @__PURE__ */ n(V, { children: [
|
|
582
|
-
/* @__PURE__ */ t(
|
|
583
|
-
Me,
|
|
584
|
-
{
|
|
585
|
-
tooltip: "Schedule Dashboard",
|
|
586
|
-
className: k("h-7 p-2", e),
|
|
587
|
-
buttonProps: { variant: a },
|
|
588
|
-
onClick: () => l(!0),
|
|
589
|
-
children: /* @__PURE__ */ t(Oe, { className: "size-4" })
|
|
590
|
-
}
|
|
591
|
-
),
|
|
592
|
-
/* @__PURE__ */ t(
|
|
593
|
-
Re,
|
|
594
|
-
{
|
|
595
|
-
open: m,
|
|
596
|
-
onOpenChange: l,
|
|
597
|
-
dashboardId: u,
|
|
598
|
-
dashboardName: c
|
|
599
|
-
}
|
|
600
|
-
)
|
|
601
|
-
] }) : null;
|
|
567
|
+
e && !m && a && c(Me(a));
|
|
568
|
+
}, [e, m, a, c]);
|
|
602
569
|
}
|
|
603
|
-
function
|
|
570
|
+
function dt({
|
|
604
571
|
export: e,
|
|
605
572
|
onRemove: a
|
|
606
573
|
}) {
|
|
607
574
|
const m = () => {
|
|
608
575
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
609
|
-
},
|
|
610
|
-
|
|
611
|
-
},
|
|
576
|
+
}, c = (l) => {
|
|
577
|
+
l.stopPropagation(), a == null || a(e.id);
|
|
578
|
+
}, d = () => {
|
|
612
579
|
switch (e.status) {
|
|
613
580
|
case "completed":
|
|
614
|
-
return /* @__PURE__ */ t(
|
|
581
|
+
return /* @__PURE__ */ t(Be, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
615
582
|
case "failed":
|
|
616
|
-
return /* @__PURE__ */ t(
|
|
583
|
+
return /* @__PURE__ */ t(et, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
617
584
|
default:
|
|
618
|
-
return /* @__PURE__ */ t(
|
|
585
|
+
return /* @__PURE__ */ t(_, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
619
586
|
}
|
|
620
|
-
},
|
|
587
|
+
}, u = B(e.status), n = (() => {
|
|
621
588
|
switch (e.status) {
|
|
622
589
|
case "pending":
|
|
623
590
|
return "Queued...";
|
|
@@ -631,23 +598,23 @@ function ht({
|
|
|
631
598
|
return "Processing...";
|
|
632
599
|
}
|
|
633
600
|
})();
|
|
634
|
-
return /* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
|
|
638
|
-
/* @__PURE__ */
|
|
601
|
+
return /* @__PURE__ */ o("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
602
|
+
/* @__PURE__ */ o("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
603
|
+
/* @__PURE__ */ o("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
604
|
+
d(),
|
|
605
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
639
606
|
/* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
|
|
640
|
-
e.status === "completed" && /* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */
|
|
607
|
+
e.status === "completed" && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
608
|
+
/* @__PURE__ */ o("span", { children: [
|
|
642
609
|
e.totalRows.toLocaleString(),
|
|
643
610
|
" rows"
|
|
644
611
|
] }),
|
|
645
|
-
e.fileSize && /* @__PURE__ */
|
|
612
|
+
e.fileSize && /* @__PURE__ */ o(O, { children: [
|
|
646
613
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
647
|
-
/* @__PURE__ */ t("span", { children:
|
|
614
|
+
/* @__PURE__ */ t("span", { children: Pe(e.fileSize) })
|
|
648
615
|
] })
|
|
649
616
|
] }),
|
|
650
|
-
|
|
617
|
+
u && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: n }),
|
|
651
618
|
e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
|
|
652
619
|
] })
|
|
653
620
|
] }),
|
|
@@ -657,16 +624,16 @@ function ht({
|
|
|
657
624
|
variant: "ghost",
|
|
658
625
|
size: "icon",
|
|
659
626
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
660
|
-
onClick:
|
|
627
|
+
onClick: c,
|
|
661
628
|
"aria-label": "Remove notification",
|
|
662
|
-
children: /* @__PURE__ */ t(
|
|
629
|
+
children: /* @__PURE__ */ t(Re, { className: "h-4 w-4" })
|
|
663
630
|
}
|
|
664
631
|
)
|
|
665
632
|
] }),
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
e.status === "completed" && /* @__PURE__ */
|
|
668
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
669
|
-
e.downloadUrl && /* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ o("div", { className: "ml-8", children: [
|
|
634
|
+
e.status === "completed" && /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
635
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: G(e.startedAt, { addSuffix: !0 }) }),
|
|
636
|
+
e.downloadUrl && /* @__PURE__ */ o(
|
|
670
637
|
I,
|
|
671
638
|
{
|
|
672
639
|
size: "sm",
|
|
@@ -674,42 +641,42 @@ function ht({
|
|
|
674
641
|
className: "h-8 bg-transparent",
|
|
675
642
|
onClick: m,
|
|
676
643
|
children: [
|
|
677
|
-
/* @__PURE__ */ t(
|
|
644
|
+
/* @__PURE__ */ t(Oe, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
678
645
|
"Download"
|
|
679
646
|
]
|
|
680
647
|
}
|
|
681
648
|
)
|
|
682
649
|
] }),
|
|
683
|
-
|
|
684
|
-
/* @__PURE__ */ t(
|
|
685
|
-
/* @__PURE__ */
|
|
650
|
+
u && /* @__PURE__ */ o("div", { children: [
|
|
651
|
+
/* @__PURE__ */ t(ze, { value: e.progress, className: "h-1.5" }),
|
|
652
|
+
/* @__PURE__ */ o("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
686
653
|
e.progress,
|
|
687
654
|
"% complete"
|
|
688
655
|
] })
|
|
689
656
|
] }),
|
|
690
|
-
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
657
|
+
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: G(e.startedAt, { addSuffix: !0 }) })
|
|
691
658
|
] })
|
|
692
659
|
] });
|
|
693
660
|
}
|
|
694
|
-
function
|
|
695
|
-
const { authToken: e, tokenProps: a } = z(), m = T((p) => p.activeExports), { clearCompleted:
|
|
661
|
+
function ut() {
|
|
662
|
+
const { authToken: e, tokenProps: a } = z(), m = T((p) => p.activeExports), { clearCompleted: c, removeExport: d, updateExport: u } = Y(), [n, l] = D(!1), [f, i] = D(!1), g = Array.from(m.values()).sort(
|
|
696
663
|
(p, y) => y.startedAt.getTime() - p.startedAt.getTime()
|
|
697
664
|
), x = g.some(
|
|
698
665
|
(p) => p.status === "completed" || p.status === "failed"
|
|
699
|
-
), h =
|
|
666
|
+
), h = k(async () => {
|
|
700
667
|
const p = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
701
668
|
if (!(!p || !y)) {
|
|
702
|
-
|
|
669
|
+
l(!0);
|
|
703
670
|
try {
|
|
704
671
|
const A = Array.from(m.values());
|
|
705
672
|
await Promise.all(
|
|
706
673
|
A.map(async (w) => {
|
|
707
674
|
try {
|
|
708
|
-
const
|
|
709
|
-
let
|
|
710
|
-
if (
|
|
675
|
+
const s = await Q(p, y, w.id);
|
|
676
|
+
let r;
|
|
677
|
+
if (s.status === "completed")
|
|
711
678
|
try {
|
|
712
|
-
|
|
679
|
+
r = await $(
|
|
713
680
|
p,
|
|
714
681
|
y,
|
|
715
682
|
w.id
|
|
@@ -717,79 +684,79 @@ function pt() {
|
|
|
717
684
|
} catch (v) {
|
|
718
685
|
console.error(`Failed to get download URL for ${w.id}:`, v);
|
|
719
686
|
}
|
|
720
|
-
|
|
721
|
-
status:
|
|
722
|
-
progress:
|
|
723
|
-
completedChunks:
|
|
724
|
-
completedAt:
|
|
687
|
+
u(w.id, {
|
|
688
|
+
status: s.status,
|
|
689
|
+
progress: s.progress,
|
|
690
|
+
completedChunks: s.completedChunks,
|
|
691
|
+
completedAt: s.completedAt ? new Date(s.completedAt) : void 0,
|
|
725
692
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
726
|
-
fileSize:
|
|
727
|
-
error:
|
|
728
|
-
downloadUrl:
|
|
693
|
+
fileSize: s.fileSize,
|
|
694
|
+
error: s.error,
|
|
695
|
+
downloadUrl: r
|
|
729
696
|
});
|
|
730
|
-
} catch (
|
|
731
|
-
console.error(`Failed to refresh export ${w.id}:`,
|
|
697
|
+
} catch (s) {
|
|
698
|
+
console.error(`Failed to refresh export ${w.id}:`, s);
|
|
732
699
|
}
|
|
733
700
|
})
|
|
734
701
|
);
|
|
735
702
|
} finally {
|
|
736
|
-
|
|
703
|
+
l(!1);
|
|
737
704
|
}
|
|
738
705
|
}
|
|
739
706
|
}, [
|
|
740
707
|
m,
|
|
741
708
|
e == null ? void 0 : e.accessToken,
|
|
742
709
|
a == null ? void 0 : a.apiServiceUrl,
|
|
743
|
-
|
|
744
|
-
]), b =
|
|
710
|
+
u
|
|
711
|
+
]), b = k(async () => {
|
|
745
712
|
const p = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
746
713
|
if (!p || !y) {
|
|
747
|
-
|
|
714
|
+
c();
|
|
748
715
|
return;
|
|
749
716
|
}
|
|
750
|
-
|
|
717
|
+
i(!0);
|
|
751
718
|
try {
|
|
752
719
|
const A = g.filter(
|
|
753
|
-
(
|
|
720
|
+
(s) => s.status === "completed" || s.status === "failed"
|
|
754
721
|
), w = await Promise.allSettled(
|
|
755
|
-
A.map(async (
|
|
722
|
+
A.map(async (s) => (await q(p, y, s.id), s.id))
|
|
756
723
|
);
|
|
757
|
-
for (const
|
|
758
|
-
|
|
724
|
+
for (const s of w)
|
|
725
|
+
s.status === "fulfilled" ? d(s.value) : console.error("Failed to delete export:", s.reason);
|
|
759
726
|
} finally {
|
|
760
|
-
|
|
727
|
+
i(!1);
|
|
761
728
|
}
|
|
762
729
|
}, [
|
|
763
730
|
g,
|
|
764
731
|
a == null ? void 0 : a.apiServiceUrl,
|
|
765
732
|
e == null ? void 0 : e.accessToken,
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
]), N =
|
|
733
|
+
c,
|
|
734
|
+
d
|
|
735
|
+
]), N = k(
|
|
769
736
|
async (p) => {
|
|
770
737
|
const y = a == null ? void 0 : a.apiServiceUrl, A = e == null ? void 0 : e.accessToken;
|
|
771
738
|
if (y && A)
|
|
772
739
|
try {
|
|
773
|
-
await
|
|
740
|
+
await q(y, A, p), d(p);
|
|
774
741
|
return;
|
|
775
742
|
} catch (w) {
|
|
776
743
|
console.error(`Failed to cancel export ${p}:`, w);
|
|
777
744
|
}
|
|
778
|
-
|
|
745
|
+
d(p);
|
|
779
746
|
},
|
|
780
|
-
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken,
|
|
747
|
+
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, d]
|
|
781
748
|
);
|
|
782
|
-
return g.length === 0 ? /* @__PURE__ */
|
|
749
|
+
return g.length === 0 ? /* @__PURE__ */ o("div", { className: "p-6 text-center", children: [
|
|
783
750
|
/* @__PURE__ */ t(X, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
784
751
|
/* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
785
752
|
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
786
|
-
] }) : /* @__PURE__ */
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
753
|
+
] }) : /* @__PURE__ */ o("div", { className: "flex flex-col", children: [
|
|
754
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
|
|
755
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
789
756
|
/* @__PURE__ */ t(X, { className: "h-5 w-5 text-muted-foreground" }),
|
|
790
757
|
/* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
|
|
791
758
|
] }),
|
|
792
|
-
/* @__PURE__ */
|
|
759
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
|
|
793
760
|
/* @__PURE__ */ t(
|
|
794
761
|
I,
|
|
795
762
|
{
|
|
@@ -797,12 +764,12 @@ function pt() {
|
|
|
797
764
|
size: "sm",
|
|
798
765
|
className: "h-7 w-7 p-0",
|
|
799
766
|
onClick: h,
|
|
800
|
-
disabled:
|
|
767
|
+
disabled: n,
|
|
801
768
|
title: "Refresh status",
|
|
802
769
|
children: /* @__PURE__ */ t(
|
|
803
|
-
|
|
770
|
+
$e,
|
|
804
771
|
{
|
|
805
|
-
className: `h-4 w-4 ${
|
|
772
|
+
className: `h-4 w-4 ${n ? "animate-spin" : ""}`
|
|
806
773
|
}
|
|
807
774
|
)
|
|
808
775
|
}
|
|
@@ -821,7 +788,7 @@ function pt() {
|
|
|
821
788
|
] })
|
|
822
789
|
] }),
|
|
823
790
|
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: g.map((p) => /* @__PURE__ */ t(
|
|
824
|
-
|
|
791
|
+
dt,
|
|
825
792
|
{
|
|
826
793
|
export: p,
|
|
827
794
|
onRemove: N
|
|
@@ -830,42 +797,43 @@ function pt() {
|
|
|
830
797
|
)) }) })
|
|
831
798
|
] });
|
|
832
799
|
}
|
|
833
|
-
function
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
),
|
|
837
|
-
|
|
838
|
-
|
|
800
|
+
function At({
|
|
801
|
+
variant: e
|
|
802
|
+
}) {
|
|
803
|
+
const a = T((f) => f.activeExports), m = _e(), c = a.size > 0, d = Array.from(a.values()).some(
|
|
804
|
+
(f) => f.status === "completed" || f.status === "failed"
|
|
805
|
+
), n = m > 0 ? m > 9 ? "9+" : String(m) : null;
|
|
806
|
+
return /* @__PURE__ */ o(je, { children: [
|
|
807
|
+
/* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ o(
|
|
839
808
|
I,
|
|
840
809
|
{
|
|
841
|
-
variant: "ghost",
|
|
810
|
+
variant: e ?? "ghost",
|
|
842
811
|
size: "icon",
|
|
843
812
|
className: "relative h-8 w-8",
|
|
844
813
|
"aria-label": "Export notifications",
|
|
845
814
|
children: [
|
|
846
|
-
/* @__PURE__ */ t(
|
|
847
|
-
|
|
815
|
+
/* @__PURE__ */ t(qe, { className: "h-4 w-4" }),
|
|
816
|
+
c && /* @__PURE__ */ t(
|
|
848
817
|
"span",
|
|
849
818
|
{
|
|
850
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
851
|
-
children:
|
|
819
|
+
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${n ? "-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"}`,
|
|
820
|
+
children: n
|
|
852
821
|
}
|
|
853
822
|
)
|
|
854
823
|
]
|
|
855
824
|
}
|
|
856
825
|
) }),
|
|
857
|
-
/* @__PURE__ */ t(
|
|
826
|
+
/* @__PURE__ */ t(Ge, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(ut, {}) })
|
|
858
827
|
] });
|
|
859
828
|
}
|
|
860
829
|
export {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
yt as u
|
|
830
|
+
yt as A,
|
|
831
|
+
dt as E,
|
|
832
|
+
At as N,
|
|
833
|
+
Ct as U,
|
|
834
|
+
wt as V,
|
|
835
|
+
ut as a,
|
|
836
|
+
xt as b,
|
|
837
|
+
Nt as c,
|
|
838
|
+
bt as u
|
|
871
839
|
};
|