react-semaphor 0.1.285 → 0.1.287

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.
Files changed (31) hide show
  1. package/dist/chunks/{dashboard-controls-DSwmmI8w.js → dashboard-controls-B8xnCPTZ.js} +318 -341
  2. package/dist/chunks/{dashboard-controls-B8f_BKTb.js → dashboard-controls-C25JMBLV.js} +4 -4
  3. package/dist/chunks/dashboard-filter-controls-button-BOJUiKGk.js +11 -0
  4. package/dist/chunks/{dashboard-filter-controls-button-BqmNXVoa.js → dashboard-filter-controls-button-D-o6ofi2.js} +476 -442
  5. package/dist/chunks/{dashboard-json-D0H5w5WI.js → dashboard-json-BYCWtm_z.js} +1 -1
  6. package/dist/chunks/{dashboard-json-qT21EDMm.js → dashboard-json-DFuRB4cG.js} +1 -1
  7. package/dist/chunks/{dashboard-summary-settings-dialog-BRI5dAfz.js → dashboard-summary-settings-dialog-CFTJNcmp.js} +1 -1
  8. package/dist/chunks/{dashboard-summary-settings-dialog-Mq8T35Qv.js → dashboard-summary-settings-dialog-CsnHeIhi.js} +1 -1
  9. package/dist/chunks/{edit-dashboard-visual-DLpQykTX.js → edit-dashboard-visual-DU3NzdD5.js} +2 -2
  10. package/dist/chunks/{edit-dashboard-visual-gSIS7RGI.js → edit-dashboard-visual-YmESbDUP.js} +4 -4
  11. package/dist/chunks/{index-Celt_oJr.js → index-BDE8cMG8.js} +170 -170
  12. package/dist/chunks/{index-r_DA-pny.js → index-Bz0-3JKw.js} +10194 -10218
  13. package/dist/chunks/resource-management-panel-C6qnO0ID.js +6 -0
  14. package/dist/chunks/resource-management-panel-Lxjcn4i0.js +933 -0
  15. package/dist/chunks/use-create-flow-overlay-state-AXNDXDqV.js +21 -0
  16. package/dist/chunks/{use-create-flow-overlay-state-C1xhazfY.js → use-create-flow-overlay-state-CJiyn4FY.js} +142 -145
  17. package/dist/chunks/{use-visual-utils-CWcTBBvd.js → use-visual-utils-BygqTxyR.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-CqL5PNOR.js → use-visual-utils-CWVz-eYg.js} +1 -1
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +5 -5
  23. package/dist/style.css +1 -1
  24. package/dist/surfboard/index.cjs +1 -1
  25. package/dist/surfboard/index.js +2 -2
  26. package/dist/types/main.d.ts +18 -2
  27. package/package.json +1 -1
  28. package/dist/chunks/dashboard-filter-controls-button-DXKJ-0iV.js +0 -11
  29. package/dist/chunks/resource-management-panel-Brj3iNyX.js +0 -6
  30. package/dist/chunks/resource-management-panel-DXLca9OX.js +0 -920
  31. package/dist/chunks/use-create-flow-overlay-state-DVyd9L7O.js +0 -21
@@ -1,16 +1,16 @@
1
- import ge, { useState as F, useRef as z, useCallback as V, useEffect as T, useContext as be } from "react";
2
- import { bM as Z, b as $, aC as U, bJ as _, bF as ee, bG as j, aD as te, bE as Ce, d as ae, e as se, f as re, g as oe, h as ne, L as G, I as we, d8 as xe, v as ye, B as I, w as H, U as R, J as Ne, u as B, K as De, N as X, d9 as Ae, da as K, x as P, b_ as ie, af as Se, c as L, cC as le, cD as de, a6 as ce, cF as ue, cG as M, s as Ee, cK as Ie, ct as Le, M as Fe, db as Te, dc as ke, dd as Ue, cS as Me, cT as Ve, cU as Pe, cV as Be, cW as Oe, cX as ze, cY as Re, as as $e, bL as _e, X as je, de as He, df as Xe, cz as Ge, bH as W, a8 as Ke, aF as We, P as he, j as me, dg as qe, l as pe, dh as Je, di as Ye, dj as Qe, dk as Ze, dl as et, dm as fe, dn as q, dp as tt } from "./index-r_DA-pny.js";
3
- import { jsx as t, jsxs as s, Fragment as O } from "react/jsx-runtime";
4
- import { V as at, E as st, a as rt, b as ot, L as nt, c as it, d as lt, C as dt, u as ct, e as ut } from "./use-create-flow-overlay-state-C1xhazfY.js";
5
- import { u as ve } from "./use-visual-utils-CqL5PNOR.js";
6
- import { k as J } from "./date-formatter-vkCj9Ct-.js";
1
+ import ge, { useState as L, useRef as O, useCallback as M, useEffect as F, useContext as be } from "react";
2
+ import { bM as ee, b as _, aC as k, bJ as $, bF as te, bG as j, aD as ae, bE as xe, d as se, e as re, f as oe, g as ne, h as ie, L as K, I as Ce, d8 as we, v as ye, B as S, w as H, U as R, J as Ne, u as z, K as De, N as X, d9 as Ae, da as W, x as P, b_ as le, af as Se, cC as de, cD as ce, a6 as ue, cF as he, cG as U, s as Ee, cK as Ie, ct as Le, M as Fe, db as Te, c as V, dc as G, dd as ke, cS as Ue, cT as Ve, cU as Me, cV as Pe, cW as ze, cX as Be, cY as Oe, as as Re, bL as _e, X as $e, de as je, df as He, cz as Xe, bH as q, a8 as Ge, aF as Ke, P as me, j as pe, dg as We, l as fe, dh as qe, di as Je, dj as Qe, dk as Ye, dl as Ze, dm as J, dn as et } from "./index-Bz0-3JKw.js";
3
+ import { jsx as t, jsxs as s, Fragment as B } from "react/jsx-runtime";
4
+ import { V as tt, E as at, a as st, b as rt, L as ot, c as nt, d as it, C as lt, u as dt, e as ct } from "./use-create-flow-overlay-state-CJiyn4FY.js";
5
+ import { u as ve } from "./use-visual-utils-CWVz-eYg.js";
6
+ import { k as Q } from "./date-formatter-vkCj9Ct-.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 Y = Z("FileDown", [
13
+ const Y = ee("FileDown", [
14
14
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
15
15
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
16
16
  ["path", { d: "M12 18v-6", key: "17g6i2" }],
@@ -22,48 +22,48 @@ const Y = Z("FileDown", [
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
24
  */
25
- const ht = Z("FilterX", [
25
+ const ut = ee("FilterX", [
26
26
  ["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
27
27
  ["path", { d: "m22 3-5 5", key: "12jva0" }],
28
28
  ["path", { d: "m17 3 5 5", key: "k36vhe" }]
29
- ]), mt = 1e4, pt = 15e3, ft = 3e4, vt = 3e4, gt = 12e4, Q = 2 * 60 * 60 * 1e3;
30
- function bt(e) {
29
+ ]), ht = 1e4, mt = 15e3, pt = 3e4, ft = 3e4, vt = 12e4, Z = 2 * 60 * 60 * 1e3;
30
+ function gt(e) {
31
31
  const a = Date.now() - e.getTime();
32
- return a < vt ? mt : a < gt ? pt : ft;
32
+ return a < ft ? ht : a < vt ? mt : pt;
33
33
  }
34
- function Tt() {
35
- const { authToken: e, tokenProps: a } = $(), p = U((m) => m.activeExports), [d, c] = F(
34
+ function Ft() {
35
+ const { authToken: e, tokenProps: a } = _(), p = k((m) => m.activeExports), [d, l] = L(
36
36
  typeof document < "u" ? !document.hidden : !0
37
- ), u = z(null), n = z(!1), l = z(void 0), h = a == null ? void 0 : a.apiServiceUrl, o = e == null ? void 0 : e.accessToken, v = V(() => {
38
- const m = U.getState().activeExports;
37
+ ), h = O(null), o = O(!1), c = O(void 0), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken, v = M(() => {
38
+ const m = k.getState().activeExports;
39
39
  return Array.from(m.values()).filter(
40
- (C) => _(C.status)
40
+ (x) => $(x.status)
41
41
  );
42
42
  }, []);
43
- T(() => {
43
+ F(() => {
44
44
  if (typeof document > "u") return;
45
45
  const m = () => {
46
- c(!document.hidden);
46
+ l(!document.hidden);
47
47
  };
48
48
  return document.addEventListener("visibilitychange", m), () => {
49
49
  document.removeEventListener("visibilitychange", m);
50
50
  };
51
51
  }, []);
52
- const b = V(async () => {
53
- if (!h || !o) {
54
- n.current = !1;
52
+ const b = M(async () => {
53
+ if (!u || !n) {
54
+ o.current = !1;
55
55
  return;
56
56
  }
57
57
  const m = v();
58
58
  if (m.length === 0) {
59
- n.current = !1;
59
+ o.current = !1;
60
60
  return;
61
61
  }
62
- const C = Date.now(), N = m.filter(
63
- (r) => C - r.startedAt.getTime() > Q
62
+ const x = Date.now(), N = m.filter(
63
+ (r) => x - r.startedAt.getTime() > Z
64
64
  );
65
65
  if (N.length > 0) {
66
- const { updateExport: r } = U.getState().actions;
66
+ const { updateExport: r } = k.getState().actions;
67
67
  for (const i of N)
68
68
  r(i.id, {
69
69
  status: "failed",
@@ -72,24 +72,24 @@ function Tt() {
72
72
  });
73
73
  }
74
74
  const f = m.filter(
75
- (r) => C - r.startedAt.getTime() <= Q
75
+ (r) => x - r.startedAt.getTime() <= Z
76
76
  );
77
77
  if (f.length === 0) {
78
- n.current = !1;
78
+ o.current = !1;
79
79
  return;
80
80
  }
81
- const x = await Promise.allSettled(
81
+ const w = await Promise.allSettled(
82
82
  f.map(async (r) => {
83
83
  try {
84
- const i = await ee(h, o, r.id);
84
+ const i = await te(u, n, r.id);
85
85
  let g;
86
86
  if (i.status === "completed")
87
87
  try {
88
- g = await j(h, o, r.id);
89
- } catch (E) {
88
+ g = await j(u, n, r.id);
89
+ } catch (I) {
90
90
  console.error(
91
91
  `[useExportPolling] Failed to get download URL for ${r.id}:`,
92
- E
92
+ I
93
93
  );
94
94
  }
95
95
  return {
@@ -110,119 +110,119 @@ function Tt() {
110
110
  ), null;
111
111
  }
112
112
  })
113
- ), { updateExport: S } = U.getState().actions;
114
- for (const r of x)
115
- r.status === "fulfilled" && r.value && S(r.value.id, r.value);
116
- const w = v();
117
- if (w.length > 0 && !document.hidden) {
118
- const r = w.reduce(
119
- (g, E) => E.startedAt < g ? E.startedAt : g,
120
- w[0].startedAt
121
- ), i = bt(r);
122
- u.current && clearTimeout(u.current), u.current = setTimeout(() => {
113
+ ), { updateExport: E } = k.getState().actions;
114
+ for (const r of w)
115
+ r.status === "fulfilled" && r.value && E(r.value.id, r.value);
116
+ const C = v();
117
+ if (C.length > 0 && !document.hidden) {
118
+ const r = C.reduce(
119
+ (g, I) => I.startedAt < g ? I.startedAt : g,
120
+ C[0].startedAt
121
+ ), i = gt(r);
122
+ h.current && clearTimeout(h.current), h.current = setTimeout(() => {
123
123
  var g;
124
- (g = l.current) == null || g.call(l);
124
+ (g = c.current) == null || g.call(c);
125
125
  }, i);
126
126
  } else
127
- n.current = !1;
128
- }, [h, o, v]);
129
- return T(() => {
130
- l.current = b;
131
- }, [b]), T(() => {
132
- var C;
133
- v().length > 0 && d && !n.current && (n.current = !0, (C = l.current) == null || C.call(l));
134
- }, [p, d, v]), T(() => {
135
- var C;
127
+ o.current = !1;
128
+ }, [u, n, v]);
129
+ return F(() => {
130
+ c.current = b;
131
+ }, [b]), F(() => {
132
+ var x;
133
+ v().length > 0 && d && !o.current && (o.current = !0, (x = c.current) == null || x.call(c));
134
+ }, [p, d, v]), F(() => {
135
+ var x;
136
136
  const m = v();
137
- d && m.length > 0 && !n.current && (n.current = !0, (C = l.current) == null || C.call(l));
138
- }, [d, v]), T(() => {
139
- !d && u.current && (clearTimeout(u.current), u.current = null, n.current = !1);
140
- }, [d]), T(() => () => {
141
- u.current && (clearTimeout(u.current), u.current = null);
137
+ d && m.length > 0 && !o.current && (o.current = !0, (x = c.current) == null || x.call(c));
138
+ }, [d, v]), F(() => {
139
+ !d && h.current && (clearTimeout(h.current), h.current = null, o.current = !1);
140
+ }, [d]), F(() => () => {
141
+ h.current && (clearTimeout(h.current), h.current = null);
142
142
  }, []), {
143
- isPolling: n.current,
143
+ isPolling: o.current,
144
144
  isTabVisible: d,
145
145
  inProgressCount: v().length
146
146
  };
147
147
  }
148
- function kt() {
149
- const { authToken: e, tokenProps: a } = $(), p = U((l) => l.activeExports), { addExport: d } = te(), c = z(!1), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken;
150
- T(() => {
151
- if (c.current || !u || !n) return;
148
+ function Tt() {
149
+ const { authToken: e, tokenProps: a } = _(), p = k((c) => c.activeExports), { addExport: d } = ae(), l = O(!1), h = a == null ? void 0 : a.apiServiceUrl, o = e == null ? void 0 : e.accessToken;
150
+ F(() => {
151
+ if (l.current || !h || !o) return;
152
152
  (async () => {
153
153
  try {
154
- const { exports: h } = await Ce(u, n, {
154
+ const { exports: u } = await xe(h, 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 o of h) {
160
- if (p.has(o.id)) continue;
161
- const v = o.totalChunks ? Math.round(o.completedChunks / o.totalChunks * 100) : 0;
159
+ for (const n of u) {
160
+ if (p.has(n.id)) continue;
161
+ const v = n.totalChunks ? Math.round(n.completedChunks / n.totalChunks * 100) : 0;
162
162
  let b;
163
- if (o.status === "completed")
163
+ if (n.status === "completed")
164
164
  try {
165
- b = await j(u, n, o.id);
166
- } catch (C) {
165
+ b = await j(h, o, n.id);
166
+ } catch (x) {
167
167
  console.error(
168
- `[useExportRecovery] Failed to get download URL for ${o.id}:`,
169
- C
168
+ `[useExportRecovery] Failed to get download URL for ${n.id}:`,
169
+ x
170
170
  );
171
171
  }
172
172
  const m = {
173
- id: o.id,
174
- status: o.status,
173
+ id: n.id,
174
+ status: n.status,
175
175
  progress: v,
176
- title: Ct(o),
177
- totalRows: o.totalRows,
178
- totalChunks: o.totalChunks,
179
- completedChunks: o.completedChunks,
180
- startedAt: new Date(o.createdAt),
176
+ title: bt(n),
177
+ totalRows: n.totalRows,
178
+ totalChunks: n.totalChunks,
179
+ completedChunks: n.completedChunks,
180
+ startedAt: new Date(n.createdAt),
181
181
  lastUpdatedAt: /* @__PURE__ */ new Date(),
182
- completedAt: o.completedAt ? new Date(o.completedAt) : void 0,
183
- fileSize: o.fileSize,
184
- error: o.error,
185
- expiresAt: new Date(o.expiresAt),
182
+ completedAt: n.completedAt ? new Date(n.completedAt) : void 0,
183
+ fileSize: n.fileSize,
184
+ error: n.error,
185
+ expiresAt: new Date(n.expiresAt),
186
186
  downloadUrl: b
187
187
  };
188
188
  d(m);
189
189
  }
190
- c.current = !0;
191
- } catch (h) {
192
- console.error("[useExportRecovery] Failed to recover exports:", h), c.current = !0;
190
+ l.current = !0;
191
+ } catch (u) {
192
+ console.error("[useExportRecovery] Failed to recover exports:", u), l.current = !0;
193
193
  }
194
194
  })();
195
- }, [u, n, d, p]);
195
+ }, [h, o, d, p]);
196
196
  }
197
- function Ct(e) {
198
- return e.title ? e.title : _(
197
+ function bt(e) {
198
+ return e.title ? e.title : $(
199
199
  e.status
200
200
  ) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
201
201
  }
202
- function wt({
202
+ function xt({
203
203
  open: e,
204
204
  onOpenChange: a,
205
205
  isLibraryVisual: p,
206
206
  currentVisualName: d,
207
- isSaving: c = !1,
208
- destinationMode: u = "both",
209
- onConfirm: n
207
+ isSaving: l = !1,
208
+ destinationMode: h = "both",
209
+ onConfirm: o
210
210
  }) {
211
- const [l, h] = F(
211
+ const [c, u] = L(
212
212
  p && d ? `Copy of ${d}` : d || ""
213
- ), [o, v] = F("");
213
+ ), [n, v] = L("");
214
214
  ge.useEffect(() => {
215
- e && (h(
215
+ e && (u(
216
216
  p && d ? `Copy of ${d}` : d || ""
217
217
  ), v(""));
218
218
  }, [e, p, d]);
219
- const b = !!l.trim(), m = u === "local" ? {
219
+ const b = !!c.trim(), m = h === "local" ? {
220
220
  saveToLibrary: !1,
221
221
  saveToCurrentDashboard: !0,
222
222
  badgeType: "local",
223
223
  description: "Creates a local copy on the current dashboard.",
224
224
  actionLabel: "Add to Dashboard (Local)"
225
- } : u === "library" ? {
225
+ } : h === "library" ? {
226
226
  saveToLibrary: !0,
227
227
  saveToCurrentDashboard: !1,
228
228
  badgeType: "library",
@@ -234,20 +234,20 @@ function wt({
234
234
  badgeType: "linked",
235
235
  description: "Creates a new library visual and adds a linked copy to this dashboard.",
236
236
  actionLabel: "Save Copy as Linked Visual"
237
- }, C = () => {
238
- !b || c || n({
239
- name: l.trim(),
240
- description: o.trim() || void 0,
237
+ }, x = () => {
238
+ !b || l || o({
239
+ name: c.trim(),
240
+ description: n.trim() || void 0,
241
241
  saveToLibrary: m.saveToLibrary,
242
242
  saveToCurrentDashboard: m.saveToCurrentDashboard
243
243
  });
244
244
  };
245
- return /* @__PURE__ */ t(ae, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(se, { className: "sm:max-w-[500px]", children: [
246
- /* @__PURE__ */ s(re, { children: [
247
- /* @__PURE__ */ s(oe, { className: "flex items-center gap-2", children: [
245
+ return /* @__PURE__ */ t(se, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(re, { className: "sm:max-w-[500px]", children: [
246
+ /* @__PURE__ */ s(oe, { children: [
247
+ /* @__PURE__ */ s(ne, { className: "flex items-center gap-2", children: [
248
248
  /* @__PURE__ */ t("span", { children: "Save Visual As" }),
249
249
  m.badgeType !== "local" && /* @__PURE__ */ t(
250
- at,
250
+ tt,
251
251
  {
252
252
  type: m.badgeType,
253
253
  showLabel: !0,
@@ -255,70 +255,70 @@ function wt({
255
255
  }
256
256
  )
257
257
  ] }),
258
- /* @__PURE__ */ t(ne, { children: m.description })
258
+ /* @__PURE__ */ t(ie, { children: m.description })
259
259
  ] }),
260
260
  /* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
261
261
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
262
- /* @__PURE__ */ t(G, { htmlFor: "name", children: "Name" }),
262
+ /* @__PURE__ */ t(K, { htmlFor: "name", children: "Name" }),
263
263
  /* @__PURE__ */ t(
264
- we,
264
+ Ce,
265
265
  {
266
266
  id: "name",
267
- value: l,
268
- onChange: (N) => h(N.target.value),
267
+ value: c,
268
+ onChange: (N) => u(N.target.value),
269
269
  placeholder: "Enter visual name",
270
- disabled: c
270
+ disabled: l
271
271
  }
272
272
  )
273
273
  ] }),
274
274
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
275
- /* @__PURE__ */ t(G, { htmlFor: "description", children: "Description (optional)" }),
275
+ /* @__PURE__ */ t(K, { htmlFor: "description", children: "Description (optional)" }),
276
276
  /* @__PURE__ */ t(
277
- xe,
277
+ we,
278
278
  {
279
279
  id: "description",
280
- value: o,
280
+ value: n,
281
281
  onChange: (N) => v(N.target.value),
282
282
  placeholder: "Enter visual description",
283
283
  rows: 3,
284
- disabled: c
284
+ disabled: l
285
285
  }
286
286
  )
287
287
  ] })
288
288
  ] }),
289
289
  /* @__PURE__ */ s(ye, { children: [
290
290
  /* @__PURE__ */ t(
291
- I,
291
+ S,
292
292
  {
293
293
  variant: "outline",
294
294
  onClick: () => a(!1),
295
- disabled: c,
295
+ disabled: l,
296
296
  children: "Cancel"
297
297
  }
298
298
  ),
299
- /* @__PURE__ */ s(I, { onClick: C, disabled: !b || c, children: [
300
- c && /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
299
+ /* @__PURE__ */ s(S, { onClick: x, disabled: !b || l, children: [
300
+ l && /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
301
301
  m.actionLabel
302
302
  ] })
303
303
  ] })
304
304
  ] }) });
305
305
  }
306
- function xt() {
307
- const [e, a] = F(!1), [p, d] = F(!1), [c, u] = F(null), n = R((i) => i.frame), l = R((i) => i.card), h = Ne(), o = B((i) => i.selectedSheetId), v = B(
306
+ function Ct() {
307
+ const [e, a] = L(!1), [p, d] = L(!1), [l, h] = L(null), o = R((i) => i.frame), c = R((i) => i.card), u = Ne(), n = z((i) => i.selectedSheetId), v = z(
308
308
  (i) => i.actions.setIsDashboardPanelOpen
309
- ), { getUpdatedFrame: b } = ve(), { selectVisual: m } = De(), { addFrame: C, setSelectedFrameId: N, setIsVisualEditing: f } = X(), x = !!(n != null && n.visualId), S = (() => {
309
+ ), { getUpdatedFrame: b } = ve(), { selectVisual: m } = De(), { addFrame: x, setSelectedFrameId: N, setIsVisualEditing: f } = X(), w = !!(o != null && o.visualId), E = (() => {
310
310
  var i, g;
311
- return ((i = n == null ? void 0 : n.cards) == null ? void 0 : i.length) === 1 && ((g = n.cards[0]) != null && g.title) ? n.cards[0].title : h != null && h.title ? h.title : (l == null ? void 0 : l.title) || "Untitled Visual";
312
- })(), w = Ae((i) => {
311
+ return ((i = o == null ? void 0 : o.cards) == null ? void 0 : i.length) === 1 && ((g = o.cards[0]) != null && g.title) ? o.cards[0].title : u != null && u.title ? u.title : (c == null ? void 0 : c.title) || "Untitled Visual";
312
+ })(), C = Ae((i) => {
313
313
  if (i != null && i.id) {
314
- if (m(i), p && c && o) {
314
+ if (m(i), p && l && n) {
315
315
  const g = {
316
- ...c,
317
- id: K(),
316
+ ...l,
317
+ id: W(),
318
318
  visualId: i.id
319
319
  // Link to the newly created library visual
320
320
  };
321
- C(o, g, "end"), N(g.id), d(!1), u(null), f(!1);
321
+ x(n, g, "end"), N(g.id), d(!1), h(null), f(!1);
322
322
  }
323
323
  v(!0), a(!1);
324
324
  }
@@ -327,13 +327,13 @@ function xt() {
327
327
  saveAsDialogOpen: e,
328
328
  setSaveAsDialogOpen: a,
329
329
  handleSaveAs: async (i) => {
330
- if (!o) {
330
+ if (!n) {
331
331
  P.error("No sheet selected");
332
332
  return;
333
333
  }
334
- const g = b(), E = ie(g);
335
- if (E) {
336
- P.error(E);
334
+ const g = b(), I = le(g);
335
+ if (I) {
336
+ P.error(I);
337
337
  return;
338
338
  }
339
339
  const A = g.cards.length === 1 ? {
@@ -345,7 +345,7 @@ function xt() {
345
345
  }))
346
346
  } : g;
347
347
  if (i.saveToLibrary) {
348
- d(i.saveToCurrentDashboard), u(A);
348
+ d(i.saveToCurrentDashboard), h(A);
349
349
  const y = {
350
350
  title: i.name,
351
351
  description: i.description,
@@ -353,244 +353,275 @@ function xt() {
353
353
  // Card title synced for single-card frames
354
354
  isPrivate: !1
355
355
  };
356
- w.mutate(y);
356
+ C.mutate(y);
357
357
  } else if (i.saveToCurrentDashboard) {
358
358
  const y = {
359
359
  ...A,
360
360
  // Card title already synced
361
- id: K(),
361
+ id: W(),
362
362
  visualId: void 0
363
363
  // Explicitly no visualId for local visuals
364
364
  };
365
- C(o, y, "end"), N(y.id), P.success("Visual saved to dashboard"), a(!1), f(!1);
365
+ x(n, y, "end"), N(y.id), P.success("Visual saved to dashboard"), a(!1), f(!1);
366
366
  }
367
367
  },
368
- isLibraryVisual: x,
369
- currentVisualName: S,
370
- isSaving: w.isPending
368
+ isLibraryVisual: w,
369
+ currentVisualName: E,
370
+ isSaving: C.isPending
371
371
  };
372
372
  }
373
- function Ut({
374
- className: e
375
- }) {
376
- const a = R((D) => D.frame), p = Se((D) => D.selectedVisual), d = B((D) => D.selectedFrameId), c = B((D) => D.selectedSheetId), { setIsVisualEditing: u, updateFrame: n } = X(), [l, h] = F(!1), [o, v] = F("both"), b = !!(a != null && a.visualId || p != null && p.id), m = !!(a != null && a.visualId && d), C = b && !m, {
373
+ function kt(e = {}) {
374
+ const a = R((D) => D.frame), p = Se((D) => D.selectedVisual), d = z((D) => D.selectedFrameId), l = z((D) => D.selectedSheetId), { setIsVisualEditing: h, updateFrame: o } = X(), [c, u] = L(!1), [n, v] = L("both"), b = !!(a != null && a.visualId || p != null && p.id), m = !!(a != null && a.visualId && d), x = b && !m, {
377
375
  saveAsDialogOpen: N,
378
376
  setSaveAsDialogOpen: f,
379
- handleSaveAs: x,
380
- isLibraryVisual: S,
381
- currentVisualName: w,
377
+ handleSaveAs: w,
378
+ isLibraryVisual: E,
379
+ currentVisualName: C,
382
380
  isSaving: r
383
- } = xt(), { getUpdatedFrame: i } = ve(), g = () => {
384
- if (!c) {
381
+ } = Ct(), { getUpdatedFrame: i } = ve(), g = () => {
382
+ if (!l) {
385
383
  P.error("No sheet selected");
386
384
  return;
387
385
  }
388
- if (l) return;
389
- h(!0);
390
- const D = i(), A = ie(D);
386
+ if (c) return;
387
+ u(!0);
388
+ const D = i(), A = le(D);
391
389
  if (A) {
392
- h(!1), P.error(A);
390
+ u(!1), P.error(A);
393
391
  return;
394
392
  }
395
393
  const y = {
396
394
  ...D,
397
395
  visualId: void 0
398
396
  };
399
- n(c, y), setTimeout(() => {
400
- h(!1), P.success("Changes applied. Visual is now local to this dashboard"), u(!1);
397
+ o(l, y), setTimeout(() => {
398
+ u(!1), P.success("Changes applied. Visual is now local to this dashboard"), h(!1);
401
399
  }, 300);
402
- }, E = (D) => {
400
+ }, I = (D) => {
403
401
  v(D), f(!0);
404
402
  };
405
- return /* @__PURE__ */ s(O, { children: [
406
- /* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-md border border-input", children: [
403
+ return /* @__PURE__ */ s(B, { children: [
404
+ /* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-[5px]", children: [
407
405
  !b && /* @__PURE__ */ t(
408
- st,
406
+ at,
409
407
  {
410
- className: L(e, "rounded-none border-0"),
408
+ className: "rounded-none",
411
409
  variant: "default"
412
410
  }
413
411
  ),
414
- b && C && /* @__PURE__ */ t(
415
- rt,
412
+ b && x && /* @__PURE__ */ t(
413
+ st,
416
414
  {
417
- className: L(e, "rounded-none border-0"),
415
+ className: "rounded-none",
418
416
  variant: "default"
419
417
  }
420
418
  ),
421
- b && m && /* @__PURE__ */ t(
422
- ot,
423
- {
424
- className: L(e, "rounded-none border-0")
425
- }
426
- ),
427
- /* @__PURE__ */ s(le, { modal: !1, children: [
428
- /* @__PURE__ */ t(de, { className: "h-8", asChild: !0, children: /* @__PURE__ */ t(
429
- I,
419
+ b && m && /* @__PURE__ */ t(rt, { className: "rounded-none" }),
420
+ /* @__PURE__ */ s(de, { modal: !1, children: [
421
+ /* @__PURE__ */ t(ce, { asChild: !0, children: /* @__PURE__ */ t(
422
+ S,
430
423
  {
431
424
  variant: "default",
432
- size: "sm",
433
- className: L(
434
- e,
435
- "w-8 rounded-none border-0 border-l border-primary-foreground/30 px-2"
436
- ),
425
+ size: "xs",
426
+ className: "w-7 rounded-none border-l border-primary-foreground/20 px-0",
437
427
  "aria-label": "Open visual save options",
438
- disabled: r || l,
439
- children: /* @__PURE__ */ t(ce, { className: "h-4 w-4" })
428
+ disabled: r || c,
429
+ children: /* @__PURE__ */ t(ue, { className: "h-3.5 w-3.5" })
440
430
  }
441
431
  ) }),
442
- /* @__PURE__ */ s(ue, { align: "end", children: [
443
- m && /* @__PURE__ */ s(O, { children: [
444
- /* @__PURE__ */ s(
445
- M,
446
- {
447
- onClick: g,
448
- disabled: l,
449
- children: [
450
- /* @__PURE__ */ t(Ee, { className: "mr-2 h-4 w-4" }),
451
- l ? "Applying..." : "Apply Locally"
452
- ]
453
- }
454
- ),
455
- /* @__PURE__ */ t(Ie, {})
456
- ] }),
457
- /* @__PURE__ */ s(
458
- M,
459
- {
460
- onClick: () => E("local"),
461
- disabled: r,
462
- children: [
463
- /* @__PURE__ */ t(Le, { className: "mr-2 h-4 w-4" }),
464
- "Add to Dashboard (Local)"
465
- ]
466
- }
467
- ),
468
- /* @__PURE__ */ s(
469
- M,
470
- {
471
- onClick: () => E("library"),
472
- disabled: r,
473
- children: [
474
- /* @__PURE__ */ t(nt, { className: "mr-2 h-4 w-4" }),
475
- "Save as Library Visual"
476
- ]
477
- }
478
- ),
479
- /* @__PURE__ */ s(
480
- M,
481
- {
482
- onClick: () => E("both"),
483
- disabled: r,
484
- children: [
485
- /* @__PURE__ */ t(it, { className: "mr-2 h-4 w-4" }),
486
- "Save Copy as Linked Visual"
487
- ]
488
- }
489
- )
490
- ] })
432
+ /* @__PURE__ */ s(
433
+ he,
434
+ {
435
+ align: "end",
436
+ className: "min-w-[220px] rounded-[6px] border border-border/60 p-1 shadow-sm",
437
+ children: [
438
+ m && /* @__PURE__ */ s(B, { children: [
439
+ /* @__PURE__ */ s(
440
+ U,
441
+ {
442
+ onClick: g,
443
+ disabled: c,
444
+ children: [
445
+ /* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5" }),
446
+ c ? "Applying..." : "Apply Locally"
447
+ ]
448
+ }
449
+ ),
450
+ /* @__PURE__ */ t(Ie, {})
451
+ ] }),
452
+ /* @__PURE__ */ s(
453
+ U,
454
+ {
455
+ onClick: () => I("local"),
456
+ disabled: r,
457
+ children: [
458
+ /* @__PURE__ */ t(Le, { className: "h-3.5 w-3.5" }),
459
+ "Add to Dashboard (Local)"
460
+ ]
461
+ }
462
+ ),
463
+ /* @__PURE__ */ s(
464
+ U,
465
+ {
466
+ onClick: () => I("library"),
467
+ disabled: r,
468
+ children: [
469
+ /* @__PURE__ */ t(ot, { className: "h-3.5 w-3.5" }),
470
+ "Save as Library Visual"
471
+ ]
472
+ }
473
+ ),
474
+ /* @__PURE__ */ s(
475
+ U,
476
+ {
477
+ onClick: () => I("both"),
478
+ disabled: r,
479
+ children: [
480
+ /* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
481
+ "Save Copy as Linked Visual"
482
+ ]
483
+ }
484
+ )
485
+ ]
486
+ }
487
+ )
491
488
  ] })
492
489
  ] }),
493
- /* @__PURE__ */ t(lt, { className: e }),
490
+ /* @__PURE__ */ t(it, {}),
494
491
  /* @__PURE__ */ t(
495
- wt,
492
+ xt,
496
493
  {
497
494
  open: N,
498
495
  onOpenChange: (D) => {
499
496
  r || f(D);
500
497
  },
501
- isLibraryVisual: S,
502
- currentVisualName: w,
498
+ isLibraryVisual: E,
499
+ currentVisualName: C,
503
500
  isSaving: r,
504
- destinationMode: o,
505
- onConfirm: x
501
+ destinationMode: n,
502
+ onConfirm: w
506
503
  }
507
504
  )
508
505
  ] });
509
506
  }
510
- function Mt({
511
- className: e,
512
- //labelClassName,
513
- switchClassName: a
514
- }) {
515
- const p = R((l) => l.isDevMode), d = B((l) => l.isVisualEditing), { setIsDevMode: c } = Fe(), { config: u } = be(Te).tokenProps, n = (u == null ? void 0 : u.showAdvancedMode) !== !1;
516
- return !d || !n ? null : /* @__PURE__ */ s("div", { className: L("flex items-center space-x-2", e), children: [
517
- /* @__PURE__ */ t(
518
- ke,
519
- {
520
- className: L("", a),
521
- checked: p,
522
- onCheckedChange: () => c(!p),
523
- id: "advanced-mode",
524
- icon: /* @__PURE__ */ t(Ue, { className: "h-4 w-4" }),
525
- tooltip: "Advanced Mode"
526
- }
527
- ),
528
- /* @__PURE__ */ t("label", { htmlFor: "advanced-mode", className: "sr-only", children: "Advanced Mode" })
529
- ] });
507
+ function Ut({ className: e }) {
508
+ const a = R((u) => u.isDevMode), p = z((u) => u.isVisualEditing), { setIsDevMode: d } = Fe(), { config: l } = be(Te).tokenProps, h = (l == null ? void 0 : l.showAdvancedMode) !== !1;
509
+ if (!p || !h)
510
+ return null;
511
+ const o = "h-7 rounded-none border-0 bg-transparent px-2.5 shadow-none text-muted-foreground hover:bg-accent/50 hover:text-foreground", c = "bg-muted text-foreground hover:bg-muted";
512
+ return /* @__PURE__ */ s(
513
+ "div",
514
+ {
515
+ role: "radiogroup",
516
+ "aria-label": "Editor mode",
517
+ className: V(
518
+ "inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
519
+ e
520
+ ),
521
+ children: [
522
+ /* @__PURE__ */ s(
523
+ S,
524
+ {
525
+ type: "button",
526
+ variant: "ghost",
527
+ size: "xs",
528
+ role: "radio",
529
+ "aria-checked": !a,
530
+ className: V(o, !a && c),
531
+ onClick: () => d(!1),
532
+ children: [
533
+ /* @__PURE__ */ t(G, { className: "h-3.5 w-3.5" }),
534
+ "Drag & drop"
535
+ ]
536
+ }
537
+ ),
538
+ /* @__PURE__ */ s(
539
+ S,
540
+ {
541
+ type: "button",
542
+ variant: "ghost",
543
+ size: "xs",
544
+ role: "radio",
545
+ "aria-checked": a,
546
+ className: V(
547
+ o,
548
+ "border-l border-border/60",
549
+ a && c
550
+ ),
551
+ onClick: () => d(!0),
552
+ children: [
553
+ /* @__PURE__ */ t(ke, { className: "h-3.5 w-3.5" }),
554
+ "SQL"
555
+ ]
556
+ }
557
+ )
558
+ ]
559
+ }
560
+ );
530
561
  }
531
562
  function Vt({
532
563
  open: e,
533
564
  onOpenChange: a,
534
565
  onSave: p,
535
566
  onDiscard: d,
536
- isSaving: c,
537
- title: u = "Unsaved changes",
538
- description: n = "You have unsaved changes to this dashboard. What would you like to do?",
539
- cancelLabel: l = "Cancel",
540
- discardLabel: h = "Discard",
541
- saveLabel: o = "Save"
567
+ isSaving: l,
568
+ title: h = "Unsaved changes",
569
+ description: o = "You have unsaved changes to this dashboard. What would you like to do?",
570
+ cancelLabel: c = "Cancel",
571
+ discardLabel: u = "Discard",
572
+ saveLabel: n = "Save"
542
573
  }) {
543
- return /* @__PURE__ */ t(Me, { open: e, onOpenChange: (b) => {
544
- !b && c || a(b);
574
+ return /* @__PURE__ */ t(Ue, { open: e, onOpenChange: (b) => {
575
+ !b && l || a(b);
545
576
  }, children: /* @__PURE__ */ s(Ve, { children: [
546
- /* @__PURE__ */ s(Pe, { children: [
547
- /* @__PURE__ */ t(Be, { children: u }),
548
- /* @__PURE__ */ t(Oe, { children: n })
577
+ /* @__PURE__ */ s(Me, { children: [
578
+ /* @__PURE__ */ t(Pe, { children: h }),
579
+ /* @__PURE__ */ t(ze, { children: o })
549
580
  ] }),
550
- /* @__PURE__ */ s(ze, { children: [
581
+ /* @__PURE__ */ s(Be, { children: [
551
582
  /* @__PURE__ */ t(
552
- I,
583
+ S,
553
584
  {
554
585
  type: "button",
555
586
  size: "xs",
556
587
  onClick: d,
557
- disabled: c,
588
+ disabled: l,
558
589
  variant: "ghost",
559
590
  className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
560
- children: h
591
+ children: u
561
592
  }
562
593
  ),
563
- /* @__PURE__ */ t(Re, { disabled: c, children: l }),
564
- /* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: p, disabled: c, children: c ? /* @__PURE__ */ s(O, { children: [
594
+ /* @__PURE__ */ t(Oe, { disabled: l, children: c }),
595
+ /* @__PURE__ */ t(S, { type: "button", size: "xs", onClick: p, disabled: l, children: l ? /* @__PURE__ */ s(B, { children: [
565
596
  /* @__PURE__ */ t(H, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
566
597
  "Saving..."
567
- ] }) : o })
598
+ ] }) : n })
568
599
  ] })
569
600
  ] }) });
570
601
  }
571
- function Pt(e, a, p, d) {
572
- T(() => {
573
- e && !p && a && d($e(a));
602
+ function Mt(e, a, p, d) {
603
+ F(() => {
604
+ e && !p && a && d(Re(a));
574
605
  }, [e, p, a, d]);
575
606
  }
576
- function yt({
607
+ function wt({
577
608
  export: e,
578
609
  onRemove: a
579
610
  }) {
580
611
  const p = () => {
581
612
  e.downloadUrl && window.open(e.downloadUrl, "_blank");
582
- }, d = (l) => {
583
- l.stopPropagation(), a == null || a(e.id);
584
- }, c = () => {
613
+ }, d = (c) => {
614
+ c.stopPropagation(), a == null || a(e.id);
615
+ }, l = () => {
585
616
  switch (e.status) {
586
617
  case "completed":
587
- return /* @__PURE__ */ t(Ge, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
618
+ return /* @__PURE__ */ t(Xe, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
588
619
  case "failed":
589
- return /* @__PURE__ */ t(dt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
620
+ return /* @__PURE__ */ t(lt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
590
621
  default:
591
622
  return /* @__PURE__ */ t(H, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
592
623
  }
593
- }, u = _(e.status), n = (() => {
624
+ }, h = $(e.status), o = (() => {
594
625
  switch (e.status) {
595
626
  case "pending":
596
627
  return "Queued...";
@@ -607,7 +638,7 @@ function yt({
607
638
  return /* @__PURE__ */ s("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
608
639
  /* @__PURE__ */ s("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
609
640
  /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
610
- c(),
641
+ l(),
611
642
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
612
643
  /* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
613
644
  e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
@@ -615,82 +646,82 @@ function yt({
615
646
  e.totalRows.toLocaleString(),
616
647
  " rows"
617
648
  ] }),
618
- e.fileSize && /* @__PURE__ */ s(O, { children: [
649
+ e.fileSize && /* @__PURE__ */ s(B, { children: [
619
650
  /* @__PURE__ */ t("span", { children: "•" }),
620
651
  /* @__PURE__ */ t("span", { children: _e(e.fileSize) })
621
652
  ] })
622
653
  ] }),
623
- u && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: n }),
654
+ h && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: o }),
624
655
  e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
625
656
  ] })
626
657
  ] }),
627
658
  /* @__PURE__ */ t(
628
- I,
659
+ S,
629
660
  {
630
661
  variant: "ghost",
631
662
  size: "icon",
632
663
  className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
633
664
  onClick: d,
634
665
  "aria-label": "Remove notification",
635
- children: /* @__PURE__ */ t(je, { className: "h-4 w-4" })
666
+ children: /* @__PURE__ */ t($e, { className: "h-4 w-4" })
636
667
  }
637
668
  )
638
669
  ] }),
639
670
  /* @__PURE__ */ s("div", { className: "ml-8", children: [
640
671
  e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
641
- /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: J(e.startedAt, { addSuffix: !0 }) }),
672
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Q(e.startedAt, { addSuffix: !0 }) }),
642
673
  e.downloadUrl && /* @__PURE__ */ s(
643
- I,
674
+ S,
644
675
  {
645
676
  size: "sm",
646
677
  variant: "outline",
647
678
  className: "h-8 bg-transparent",
648
679
  onClick: p,
649
680
  children: [
650
- /* @__PURE__ */ t(He, { className: "mr-1.5 h-3.5 w-3.5" }),
681
+ /* @__PURE__ */ t(je, { className: "mr-1.5 h-3.5 w-3.5" }),
651
682
  "Download"
652
683
  ]
653
684
  }
654
685
  )
655
686
  ] }),
656
- u && /* @__PURE__ */ s("div", { children: [
657
- /* @__PURE__ */ t(Xe, { value: e.progress, className: "h-1.5" }),
687
+ h && /* @__PURE__ */ s("div", { children: [
688
+ /* @__PURE__ */ t(He, { value: e.progress, className: "h-1.5" }),
658
689
  /* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
659
690
  e.progress,
660
691
  "% complete"
661
692
  ] })
662
693
  ] }),
663
- e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: J(e.startedAt, { addSuffix: !0 }) })
694
+ e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Q(e.startedAt, { addSuffix: !0 }) })
664
695
  ] })
665
696
  ] });
666
697
  }
667
- function Nt() {
668
- const { authToken: e, tokenProps: a } = $(), p = U((f) => f.activeExports), { clearCompleted: d, removeExport: c, updateExport: u } = te(), [n, l] = F(!1), [h, o] = F(!1), v = Array.from(p.values()).sort(
669
- (f, x) => x.startedAt.getTime() - f.startedAt.getTime()
698
+ function yt() {
699
+ const { authToken: e, tokenProps: a } = _(), p = k((f) => f.activeExports), { clearCompleted: d, removeExport: l, updateExport: h } = ae(), [o, c] = L(!1), [u, n] = L(!1), v = Array.from(p.values()).sort(
700
+ (f, w) => w.startedAt.getTime() - f.startedAt.getTime()
670
701
  ), b = v.some(
671
702
  (f) => f.status === "completed" || f.status === "failed"
672
- ), m = V(async () => {
673
- const f = a == null ? void 0 : a.apiServiceUrl, x = e == null ? void 0 : e.accessToken;
674
- if (!(!f || !x)) {
675
- l(!0);
703
+ ), m = M(async () => {
704
+ const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
705
+ if (!(!f || !w)) {
706
+ c(!0);
676
707
  try {
677
- const S = Array.from(p.values());
708
+ const E = Array.from(p.values());
678
709
  await Promise.all(
679
- S.map(async (w) => {
710
+ E.map(async (C) => {
680
711
  try {
681
- const r = await ee(f, x, w.id);
712
+ const r = await te(f, w, C.id);
682
713
  let i;
683
714
  if (r.status === "completed")
684
715
  try {
685
716
  i = await j(
686
717
  f,
687
- x,
688
- w.id
718
+ w,
719
+ C.id
689
720
  );
690
721
  } catch (g) {
691
- console.error(`Failed to get download URL for ${w.id}:`, g);
722
+ console.error(`Failed to get download URL for ${C.id}:`, g);
692
723
  }
693
- u(w.id, {
724
+ h(C.id, {
694
725
  status: r.status,
695
726
  progress: r.progress,
696
727
  completedChunks: r.completedChunks,
@@ -701,56 +732,56 @@ function Nt() {
701
732
  downloadUrl: i
702
733
  });
703
734
  } catch (r) {
704
- console.error(`Failed to refresh export ${w.id}:`, r);
735
+ console.error(`Failed to refresh export ${C.id}:`, r);
705
736
  }
706
737
  })
707
738
  );
708
739
  } finally {
709
- l(!1);
740
+ c(!1);
710
741
  }
711
742
  }
712
743
  }, [
713
744
  p,
714
745
  e == null ? void 0 : e.accessToken,
715
746
  a == null ? void 0 : a.apiServiceUrl,
716
- u
717
- ]), C = V(async () => {
718
- const f = a == null ? void 0 : a.apiServiceUrl, x = e == null ? void 0 : e.accessToken;
719
- if (!f || !x) {
747
+ h
748
+ ]), x = M(async () => {
749
+ const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
750
+ if (!f || !w) {
720
751
  d();
721
752
  return;
722
753
  }
723
- o(!0);
754
+ n(!0);
724
755
  try {
725
- const S = v.filter(
756
+ const E = v.filter(
726
757
  (r) => r.status === "completed" || r.status === "failed"
727
- ), w = await Promise.allSettled(
728
- S.map(async (r) => (await W(f, x, r.id), r.id))
758
+ ), C = await Promise.allSettled(
759
+ E.map(async (r) => (await q(f, w, r.id), r.id))
729
760
  );
730
- for (const r of w)
731
- r.status === "fulfilled" ? c(r.value) : console.error("Failed to delete export:", r.reason);
761
+ for (const r of C)
762
+ r.status === "fulfilled" ? l(r.value) : console.error("Failed to delete export:", r.reason);
732
763
  } finally {
733
- o(!1);
764
+ n(!1);
734
765
  }
735
766
  }, [
736
767
  v,
737
768
  a == null ? void 0 : a.apiServiceUrl,
738
769
  e == null ? void 0 : e.accessToken,
739
770
  d,
740
- c
741
- ]), N = V(
771
+ l
772
+ ]), N = M(
742
773
  async (f) => {
743
- const x = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
744
- if (x && S)
774
+ const w = a == null ? void 0 : a.apiServiceUrl, E = e == null ? void 0 : e.accessToken;
775
+ if (w && E)
745
776
  try {
746
- await W(x, S, f), c(f);
777
+ await q(w, E, f), l(f);
747
778
  return;
748
- } catch (w) {
749
- console.error(`Failed to cancel export ${f}:`, w);
779
+ } catch (C) {
780
+ console.error(`Failed to cancel export ${f}:`, C);
750
781
  }
751
- c(f);
782
+ l(f);
752
783
  },
753
- [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, c]
784
+ [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, l]
754
785
  );
755
786
  return v.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
756
787
  /* @__PURE__ */ t(Y, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
@@ -764,37 +795,37 @@ function Nt() {
764
795
  ] }),
765
796
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
766
797
  /* @__PURE__ */ t(
767
- I,
798
+ S,
768
799
  {
769
800
  variant: "ghost",
770
801
  size: "sm",
771
802
  className: "h-7 w-7 p-0",
772
803
  onClick: m,
773
- disabled: n,
804
+ disabled: o,
774
805
  title: "Refresh status",
775
806
  children: /* @__PURE__ */ t(
776
- Ke,
807
+ Ge,
777
808
  {
778
- className: `h-4 w-4 ${n ? "animate-spin" : ""}`
809
+ className: `h-4 w-4 ${o ? "animate-spin" : ""}`
779
810
  }
780
811
  )
781
812
  }
782
813
  ),
783
814
  b && /* @__PURE__ */ t(
784
- I,
815
+ S,
785
816
  {
786
817
  variant: "ghost",
787
818
  size: "sm",
788
819
  className: "h-7 px-2 text-sm",
789
- onClick: C,
790
- disabled: h,
791
- children: h ? "Clearing..." : "Clear all"
820
+ onClick: x,
821
+ disabled: u,
822
+ children: u ? "Clearing..." : "Clear all"
792
823
  }
793
824
  )
794
825
  ] })
795
826
  ] }),
796
827
  /* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: v.map((f) => /* @__PURE__ */ t(
797
- yt,
828
+ wt,
798
829
  {
799
830
  export: f,
800
831
  onRemove: N
@@ -803,36 +834,36 @@ function Nt() {
803
834
  )) }) })
804
835
  ] });
805
836
  }
806
- function Bt({
837
+ function Pt({
807
838
  variant: e
808
839
  }) {
809
- const a = U((h) => h.activeExports), p = We(), d = a.size > 0, c = Array.from(a.values()).some(
810
- (h) => h.status === "completed" || h.status === "failed"
811
- ), n = p > 0 ? p > 9 ? "9+" : String(p) : null;
812
- return /* @__PURE__ */ s(he, { children: [
813
- /* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ s(
814
- I,
840
+ const a = k((u) => u.activeExports), p = Ke(), d = a.size > 0, l = Array.from(a.values()).some(
841
+ (u) => u.status === "completed" || u.status === "failed"
842
+ ), o = p > 0 ? p > 9 ? "9+" : String(p) : null;
843
+ return /* @__PURE__ */ s(me, { children: [
844
+ /* @__PURE__ */ t(pe, { asChild: !0, children: /* @__PURE__ */ s(
845
+ S,
815
846
  {
816
847
  variant: e ?? "ghost",
817
- size: "icon",
818
- className: "relative h-8 w-8",
848
+ size: "xs",
849
+ className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
819
850
  "aria-label": "Export notifications",
820
851
  children: [
821
- /* @__PURE__ */ t(qe, { className: "h-4 w-4" }),
852
+ /* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
822
853
  d && /* @__PURE__ */ t(
823
854
  "span",
824
855
  {
825
- 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"}`,
826
- children: n
856
+ className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${o ? "-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold" : "right-1 top-1 h-1.5 w-1.5"}`,
857
+ children: o
827
858
  }
828
859
  )
829
860
  ]
830
861
  }
831
862
  ) }),
832
- /* @__PURE__ */ t(pe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Nt, {}) })
863
+ /* @__PURE__ */ t(fe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(yt, {}) })
833
864
  ] });
834
865
  }
835
- function Dt(e) {
866
+ function Nt(e) {
836
867
  if (e)
837
868
  return {
838
869
  renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
@@ -841,24 +872,24 @@ function Dt(e) {
841
872
  affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
842
873
  };
843
874
  }
844
- function Ot({
875
+ function zt({
845
876
  open: e,
846
877
  onOpenChange: a,
847
878
  trigger: p,
848
879
  showTrigger: d = !0,
849
- initialMode: c = "manage"
880
+ initialMode: l = "manage"
850
881
  }) {
851
- const u = c === "create", {
852
- forceClose: n,
853
- handleOpenChange: l,
854
- isCreateFlowActive: h,
855
- preventPassiveDismissDuringCreate: o,
882
+ const h = l === "create", {
883
+ forceClose: o,
884
+ handleOpenChange: c,
885
+ isCreateFlowActive: u,
886
+ preventPassiveDismissDuringCreate: n,
856
887
  resolvedOpen: v,
857
888
  setIsCreateFlowActive: b
858
- } = ct({
889
+ } = dt({
859
890
  open: e,
860
891
  onOpenChange: a,
861
- initialCreateFlowActive: c === "create",
892
+ initialCreateFlowActive: l === "create",
862
893
  // Dialog mode renders a built-in X close button — allow explicit
863
894
  // closes through `handleOpenChange`. Popover mode has no X; its
864
895
  // only close-via-trigger path is a re-click that would silently
@@ -866,109 +897,109 @@ function Ot({
866
897
  // create and make consumers use `forceClose()` from a dedicated
867
898
  // button.
868
899
  dismissMode: d ? "passive" : "explicit-only"
869
- }), m = B((A) => A.dashboard), { setDashboardControlsModel: C } = X(), { participants: N } = Je(Ye(m)), f = Array.from(
900
+ }), m = z((A) => A.dashboard), { setDashboardControlsModel: x } = X(), { participants: N } = qe(Je(m)), f = Array.from(
870
901
  new Map(
871
902
  N.flatMap(
872
903
  (A) => A.fieldChoices.map((y) => {
873
- var k;
904
+ var T;
874
905
  return [
875
906
  y.value,
876
907
  {
877
908
  option: y,
878
- target: (k = A.fieldTargetMap) == null ? void 0 : k[y.value]
909
+ target: (T = A.fieldTargetMap) == null ? void 0 : T[y.value]
879
910
  }
880
911
  ];
881
912
  })
882
913
  )
883
914
  ).values()
884
- ), x = Array.from(
915
+ ), w = Array.from(
885
916
  new Map(
886
917
  N.flatMap(
887
918
  (A) => A.metricChoices.map((y) => {
888
- var k;
919
+ var T;
889
920
  return [
890
921
  y.value,
891
922
  {
892
923
  option: y,
893
- target: (k = A.metricTargetMap) == null ? void 0 : k[y.value]
924
+ target: (T = A.metricTargetMap) == null ? void 0 : T[y.value]
894
925
  }
895
926
  ];
896
927
  })
897
928
  )
898
929
  ).values()
899
- ), S = Qe({
930
+ ), E = Qe({
900
931
  ...m || {},
901
932
  controls: []
902
- }), w = Ze(m), r = (A, y, k) => {
903
- C(
933
+ }), C = Ye(m), r = (A, y, T) => {
934
+ x(
904
935
  A,
905
936
  y,
906
- Dt(k)
937
+ Nt(T)
907
938
  );
908
- }, i = V(() => {
909
- if (u) {
910
- n();
939
+ }, i = M(() => {
940
+ if (h) {
941
+ o();
911
942
  return;
912
943
  }
913
944
  b(!1);
914
- }, [u, n, b]), g = /* @__PURE__ */ t(
915
- ut,
945
+ }, [h, o, b]), g = /* @__PURE__ */ t(
946
+ ct,
916
947
  {
917
948
  scope: "dashboard",
918
949
  controls: m.controls || [],
919
- reservedControlIds: S,
950
+ reservedControlIds: E,
920
951
  defaultValues: m.defaultControlValues || {},
921
- usageByControlId: et(m),
952
+ usageByControlId: Ze(m),
922
953
  availableFieldChoices: f,
923
- availableMetricChoices: x,
954
+ availableMetricChoices: w,
924
955
  structuralParticipants: N,
925
- structuralParticipantIdsByControlId: w,
926
- initialCreateFlow: c === "create",
956
+ structuralParticipantIdsByControlId: C,
957
+ initialCreateFlow: l === "create",
927
958
  onCreateFlowActiveChange: b,
928
959
  onCreateFlowComplete: i,
929
960
  onChange: r,
930
961
  emptyMessage: "No dashboard controls yet."
931
962
  }
932
- ), E = h ? "Add dashboard control" : "Dashboard Controls", D = /* @__PURE__ */ s(O, { children: [
963
+ ), I = u ? "Add dashboard control" : "Dashboard Controls", D = /* @__PURE__ */ s(B, { children: [
933
964
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
934
965
  /* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
935
966
  /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
936
967
  ] }),
937
968
  g
938
969
  ] });
939
- return d ? /* @__PURE__ */ s(he, { open: v, onOpenChange: l, children: [
940
- /* @__PURE__ */ t(me, { asChild: !0, children: p || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
941
- /* @__PURE__ */ t(fe, { className: "mr-2 h-4 w-4" }),
970
+ return d ? /* @__PURE__ */ s(me, { open: v, onOpenChange: c, children: [
971
+ /* @__PURE__ */ t(pe, { asChild: !0, children: p || /* @__PURE__ */ s(S, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
972
+ /* @__PURE__ */ t(G, { className: "mr-2 h-4 w-4" }),
942
973
  "Controls"
943
974
  ] }) }),
944
975
  /* @__PURE__ */ t(
945
- pe,
976
+ fe,
946
977
  {
947
978
  className: "w-[620px] max-w-[95vw] space-y-4",
948
979
  align: "end",
949
- onEscapeKeyDown: o,
950
- onPointerDownOutside: o,
980
+ onEscapeKeyDown: n,
981
+ onPointerDownOutside: n,
951
982
  children: D
952
983
  }
953
984
  )
954
- ] }) : /* @__PURE__ */ t(ae, { open: v, onOpenChange: l, children: /* @__PURE__ */ s(
955
- se,
985
+ ] }) : /* @__PURE__ */ t(se, { open: v, onOpenChange: c, children: /* @__PURE__ */ s(
986
+ re,
956
987
  {
957
988
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
958
- onEscapeKeyDown: o,
959
- onPointerDownOutside: o,
989
+ onEscapeKeyDown: n,
990
+ onPointerDownOutside: n,
960
991
  children: [
961
992
  /* @__PURE__ */ s(
962
- re,
993
+ oe,
963
994
  {
964
- className: h ? "space-y-0" : void 0,
995
+ className: u ? "space-y-0" : void 0,
965
996
  children: [
966
- /* @__PURE__ */ t(oe, { className: "text-[15px]", children: E }),
997
+ /* @__PURE__ */ t(ne, { className: "text-[15px]", children: I }),
967
998
  /* @__PURE__ */ t(
968
- ne,
999
+ ie,
969
1000
  {
970
- className: h ? "sr-only" : "text-[13px]",
971
- children: h ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
1001
+ className: u ? "sr-only" : "text-[13px]",
1002
+ children: u ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
972
1003
  }
973
1004
  )
974
1005
  ]
@@ -979,75 +1010,78 @@ function Ot({
979
1010
  }
980
1011
  ) });
981
1012
  }
982
- function zt({
1013
+ function Bt({
983
1014
  showFilters: e,
984
1015
  onToggleFilters: a,
985
1016
  onAddFilter: p,
986
1017
  onAddControl: d,
987
- onManageControls: c,
988
- size: u = "default",
989
- className: n,
990
- primaryButtonClassName: l,
991
- secondaryButtonClassName: h,
992
- dropdownContentClassName: o
1018
+ onManageControls: l,
1019
+ size: h = "default",
1020
+ className: o,
1021
+ primaryButtonClassName: c,
1022
+ secondaryButtonClassName: u,
1023
+ dropdownContentClassName: n
993
1024
  }) {
994
- const v = u === "toolbar";
1025
+ const v = h === "toolbar";
995
1026
  return /* @__PURE__ */ s(
996
1027
  "div",
997
1028
  {
998
- className: L(
999
- "relative inline-flex items-stretch overflow-visible rounded-md border border-input bg-background shadow-none",
1000
- n
1029
+ className: V(
1030
+ "relative inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
1031
+ o
1001
1032
  ),
1002
1033
  children: [
1003
1034
  /* @__PURE__ */ s(
1004
- I,
1035
+ S,
1005
1036
  {
1006
1037
  variant: "ghost",
1007
- className: L(
1038
+ size: "xs",
1039
+ className: V(
1008
1040
  v ? "h-8" : "h-7",
1009
- "rounded-none border-0 bg-transparent pl-3 pr-2 shadow-none hover:bg-accent/50",
1010
- l
1041
+ "rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
1042
+ c
1011
1043
  ),
1012
1044
  onClick: a,
1013
- size: "sm",
1014
1045
  children: [
1015
- e ? /* @__PURE__ */ t(ht, { className: "mr-2 h-4 w-4" }) : /* @__PURE__ */ t(q, { className: "mr-2 h-4 w-4" }),
1046
+ e ? /* @__PURE__ */ t(ut, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(J, { className: "h-3.5 w-3.5" }),
1016
1047
  "Filter"
1017
1048
  ]
1018
1049
  }
1019
1050
  ),
1020
- /* @__PURE__ */ s(le, { children: [
1021
- /* @__PURE__ */ t(de, { asChild: !0, children: /* @__PURE__ */ t(
1022
- I,
1051
+ /* @__PURE__ */ s(de, { children: [
1052
+ /* @__PURE__ */ t(ce, { asChild: !0, children: /* @__PURE__ */ t(
1053
+ S,
1023
1054
  {
1024
- className: L(
1025
- v ? "h-8 w-8" : "h-7 w-8",
1026
- "rounded-none border-0 bg-transparent px-1 shadow-none hover:bg-accent/50",
1027
- h
1028
- ),
1029
1055
  variant: "ghost",
1030
- size: "sm",
1056
+ size: "xs",
1057
+ className: V(
1058
+ v ? "h-8 w-7" : "h-7 w-7",
1059
+ "rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
1060
+ u
1061
+ ),
1031
1062
  "aria-label": "Filter and control actions",
1032
- children: /* @__PURE__ */ t(ce, { className: "h-4 w-4" })
1063
+ children: /* @__PURE__ */ t(ue, { className: "h-3.5 w-3.5" })
1033
1064
  }
1034
1065
  ) }),
1035
1066
  /* @__PURE__ */ s(
1036
- ue,
1067
+ he,
1037
1068
  {
1038
1069
  align: "start",
1039
- className: L("rounded-xl border border-border/60 p-1 shadow-sm", o),
1070
+ className: V(
1071
+ "min-w-[180px] rounded-[6px] border border-border/60 p-1 shadow-sm",
1072
+ n
1073
+ ),
1040
1074
  children: [
1041
- /* @__PURE__ */ s(M, { onSelect: p, children: [
1042
- /* @__PURE__ */ t(q, { className: "mr-2 h-4 w-4" }),
1075
+ /* @__PURE__ */ s(U, { onSelect: p, children: [
1076
+ /* @__PURE__ */ t(J, { className: "h-3.5 w-3.5" }),
1043
1077
  "Add filter"
1044
1078
  ] }),
1045
- /* @__PURE__ */ s(M, { onSelect: d, children: [
1046
- /* @__PURE__ */ t(fe, { className: "mr-2 h-4 w-4" }),
1079
+ /* @__PURE__ */ s(U, { onSelect: d, children: [
1080
+ /* @__PURE__ */ t(G, { className: "h-3.5 w-3.5" }),
1047
1081
  "Add control"
1048
1082
  ] }),
1049
- /* @__PURE__ */ s(M, { onSelect: c, children: [
1050
- /* @__PURE__ */ t(tt, { className: "mr-2 h-4 w-4" }),
1083
+ /* @__PURE__ */ s(U, { onSelect: l, children: [
1084
+ /* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" }),
1051
1085
  "Manage controls"
1052
1086
  ] })
1053
1087
  ]
@@ -1059,15 +1093,15 @@ function zt({
1059
1093
  );
1060
1094
  }
1061
1095
  export {
1062
- Mt as A,
1063
- Ot as D,
1064
- Nt as E,
1065
- Bt as N,
1096
+ Ut as A,
1097
+ zt as D,
1098
+ yt as E,
1099
+ Pt as N,
1066
1100
  Vt as U,
1067
- Ut as V,
1068
- yt as a,
1069
- kt as b,
1070
- zt as c,
1071
- Pt as d,
1072
- Tt as u
1101
+ kt as V,
1102
+ wt as a,
1103
+ Tt as b,
1104
+ Bt as c,
1105
+ Mt as d,
1106
+ Ft as u
1073
1107
  };