react-semaphor 0.1.303 → 0.1.305

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 (49) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +4 -4
  3. package/dist/chunks/common-types-C6cAQgyh.js +9 -0
  4. package/dist/chunks/common-types-nBuCd3u2.js +1 -0
  5. package/dist/chunks/dashboard-controls-BcwXajYv.js +47 -0
  6. package/dist/chunks/{dashboard-controls-BCJZOzrL.js → dashboard-controls-DjOO0fkG.js} +799 -774
  7. package/dist/chunks/{dashboard-filter-controls-button-C-e7230k.js → dashboard-filter-controls-button-CR0_duPw.js} +3 -3
  8. package/dist/chunks/{dashboard-filter-controls-button-Cfbac4Jw.js → dashboard-filter-controls-button-YvRfoUuN.js} +142 -142
  9. package/dist/chunks/{dashboard-json-BzvLPhGM.js → dashboard-json-BYLaWi0-.js} +2 -2
  10. package/dist/chunks/{dashboard-json-BM5ywMgp.js → dashboard-json-tOsNVccY.js} +1 -1
  11. package/dist/chunks/{dashboard-summary-settings-dialog-ChK3344r.js → dashboard-summary-settings-dialog-CMxi2arh.js} +2 -2
  12. package/dist/chunks/{dashboard-summary-settings-dialog-BdxKl1UF.js → dashboard-summary-settings-dialog-DioOegLQ.js} +1 -1
  13. package/dist/chunks/{edit-dashboard-visual-nNaZ2IK1.js → edit-dashboard-visual-331vOmKT.js} +2 -2
  14. package/dist/chunks/{edit-dashboard-visual-D725CWD5.js → edit-dashboard-visual-ClLcFLD_.js} +164 -164
  15. package/dist/chunks/index-BOGpMmRo.js +1360 -0
  16. package/dist/chunks/{index-CYWgnME0.js → index-DJFckbGE.js} +42308 -40062
  17. package/dist/chunks/{palette-B9DJXMGo.js → palette-BqJlrRto.js} +1 -1
  18. package/dist/chunks/{palette-DGOzbtsn.js → palette-DD-i7bNS.js} +1 -1
  19. package/dist/chunks/{resource-management-panel-CE0-NcLL.js → resource-management-panel-BS9nfJbb.js} +65 -65
  20. package/dist/chunks/{resource-management-panel-mJmc5dMT.js → resource-management-panel-CoHy6cOi.js} +1 -1
  21. package/dist/chunks/{rotate-ccw-Bs7YJn10.js → rotate-ccw-CdGW8Rxm.js} +1 -1
  22. package/dist/chunks/{rotate-ccw-YsjQwpKm.js → rotate-ccw-X8MbX_hF.js} +1 -1
  23. package/dist/chunks/{save-Bj1y1rug.js → save-CFBIhbHD.js} +1 -1
  24. package/dist/chunks/{save-CUrexoNl.js → save-j-clxFtx.js} +1 -1
  25. package/dist/chunks/{switch-oojO-gal.js → switch-BFhVVwh9.js} +4248 -3243
  26. package/dist/chunks/switch-BH17qlxH.js +163 -0
  27. package/dist/chunks/use-create-flow-overlay-state-BSUi4chy.js +16 -0
  28. package/dist/chunks/{use-create-flow-overlay-state-BHDKxe7I.js → use-create-flow-overlay-state-Lmk-mIkA.js} +318 -316
  29. package/dist/chunks/{use-visual-utils-DYDXMl5v.js → use-visual-utils-CR9nLyEz.js} +1 -1
  30. package/dist/chunks/{use-visual-utils-CjFzlR0P.js → use-visual-utils-CikIkKb2.js} +2 -2
  31. package/dist/dashboard/index.cjs +1 -1
  32. package/dist/dashboard/index.js +5 -5
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.js +60 -59
  35. package/dist/style.css +1 -1
  36. package/dist/surfboard/index.cjs +1 -1
  37. package/dist/surfboard/index.js +6 -6
  38. package/dist/types/dashboard.d.ts +168 -0
  39. package/dist/types/index.cjs +1 -1
  40. package/dist/types/index.js +8 -11
  41. package/dist/types/main.d.ts +194 -2
  42. package/dist/types/shared.d.ts +120 -0
  43. package/dist/types/surfboard.d.ts +168 -0
  44. package/dist/types/types.d.ts +168 -0
  45. package/package.json +1 -1
  46. package/dist/chunks/dashboard-controls-CVFoOPti.js +0 -47
  47. package/dist/chunks/index-BWjB_9uz.js +0 -1356
  48. package/dist/chunks/switch-CiEX68py.js +0 -163
  49. package/dist/chunks/use-create-flow-overlay-state-D2I2wNey.js +0 -16
@@ -1,25 +1,25 @@
1
1
  import { jsx as e, jsxs as c, Fragment as T } from "react/jsx-runtime";
2
- import { c as Z, u as N, B as A, ai as St, m as Nt, L as dt, I as ue, a as Y, aj as Re, ak as da, al as ua, E as ls, f as X, am as ds, an as us, ao as ut, T as ma, q as ha, r as _e, t as Ue, s as mt, ap as pa, aq as ms, n as ta, z as hs, A as ps, D as fs, F as gs, K as vs, ar as bs } from "./switch-oojO-gal.js";
3
- import { ct as ys, u as K, b as Ge, cu as xs, bE as ht, c as $e, d as Ve, e as ze, f as wt, o as Ss, cv as de, bV as Te, cw as Ns, cx as aa, cy as fa, cz as ga, cA as ws, c9 as Dt, cB as Ds, cC as Cs, cD as Es, cE as Is, cF as Ms, cG as As, r as qe, z as Be, p as M, cg as Ls, cH as Os, cI as ks, cd as pt, cJ as ft, bU as Ct, bs as va, cK as gt, bn as ba, cL as Ps, c0 as ya, c1 as xa, c2 as Sa, c3 as Na, c4 as wa, c5 as Da, c6 as Ca, c7 as vt, cM as Ts, bM as _s, cN as Us, cO as Fs, X as Rs, W as ke, cP as Gs, a1 as $s, Y as nt, cQ as Vs, cR as zs, cS as qs, ad as Bs, cT as Hs, L as rt, cU as js, cV as Ks, cW as Qs, cs as Ws, cX as Js, bN as Ys, bO as Xs, bP as Zs, bQ as en, bR as $, ck as tn, N as an, bX as sn, cY as nn, bS as sa, cZ as rn, c_ as on, c$ as cn, a0 as ln, O as dn, d0 as un, K as bt } from "./index-CYWgnME0.js";
4
- import * as L from "react";
5
- import Ea, { useState as S, useMemo as F, useCallback as Fe, useEffect as ot } from "react";
2
+ import { c as X, u as S, B as L, aH as Nt, m as St, L as dt, I as ue, a as J, aI as Re, aJ as da, aK as ua, E as ls, f as Y, aL as ds, aM as us, aN as ut, T as ma, q as ha, r as _e, t as Ue, s as mt, aO as pa, aP as ms, n as ta, z as hs, A as ps, D as fs, F as gs, K as vs, aQ as bs } from "./switch-BFhVVwh9.js";
3
+ import { c5 as ys, u as j, b as Ge, c6 as xs, bl as ht, c as $e, d as Ve, e as ze, f as wt, o as Ns, c7 as de, by as Te, c8 as Ss, c9 as aa, ca as fa, cb as ga, cc as ws, bO as Dt, cd as Ds, ce as Cs, cf as Es, cg as Is, ch as As, ci as Ls, r as qe, z as Be, p as A, bV as Ms, cj as Os, ck as ks, bS as pt, cl as ft, bx as Ct, bc as va, cm as gt, ba, cn as Ps, bF as ya, bG as xa, bH as Na, bI as Sa, bJ as wa, bK as Da, bL as Ca, bM as vt, co as Ts, cp as _s, cq as Us, bp as Fs, cr as Rs, cs as Gs, X as $s, W as ke, ct as Vs, a1 as zs, Y as nt, cu as qs, cv as Bs, cw as Hs, ad as js, cx as Ks, L as rt, cy as Qs, cz as Ws, cA as Js, c4 as Ys, cB as Xs, bq as Zs, br as en, bs as tn, bt as an, bu as $, bZ as sn, N as nn, bA as rn, cC as on, bv as sa, cD as cn, cE as ln, cF as dn, a0 as un, O as mn, cG as hn, K as bt } from "./index-DJFckbGE.js";
4
+ import * as M from "react";
5
+ import Ea, { useState as N, useMemo as F, useCallback as Fe, useEffect as ot } from "react";
6
6
  import "./index-CJdxSyQq.js";
7
7
  import "react-dom";
8
- import { b as mn, u as hn, A as pn, V as fn, c as gn, D as vn, N as bn, U as yn } from "./dashboard-filter-controls-button-Cfbac4Jw.js";
9
- import { d as xn } from "./index-DFOb_6HB.js";
10
- import { C as Sn, D as Nn } from "./dashboard-summary-settings-dialog-ChK3344r.js";
11
- import { u as wn } from "./use-debounced-dirty-check-BwAbnX_5.js";
8
+ import { b as pn, u as fn, A as gn, V as vn, c as bn, D as yn, N as xn, U as Nn } from "./dashboard-filter-controls-button-YvRfoUuN.js";
9
+ import { d as Sn } from "./index-DFOb_6HB.js";
10
+ import { C as wn, D as Dn } from "./dashboard-summary-settings-dialog-CMxi2arh.js";
11
+ import { u as Cn } from "./use-debounced-dirty-check-BwAbnX_5.js";
12
12
  import { s as it } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
13
- import { u as Dn, e as Cn } from "./use-create-flow-overlay-state-BHDKxe7I.js";
14
- import { S as na } from "./save-CUrexoNl.js";
15
- import { P as En, B as In } from "./palette-DGOzbtsn.js";
13
+ import { u as En, e as In } from "./use-create-flow-overlay-state-Lmk-mIkA.js";
14
+ import { S as na } from "./save-j-clxFtx.js";
15
+ import { P as An, B as Ln } from "./palette-DD-i7bNS.js";
16
16
  /**
17
17
  * @license lucide-react v0.453.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */
22
- const Mn = Z("Glasses", [
22
+ const Mn = X("Glasses", [
23
23
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
24
24
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
25
25
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -32,7 +32,7 @@ const Mn = Z("Glasses", [
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
34
  */
35
- const An = Z("Menu", [
35
+ const On = X("Menu", [
36
36
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
37
37
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
38
38
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
@@ -43,7 +43,7 @@ const An = Z("Menu", [
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
45
  */
46
- const Ln = Z("Monitor", [
46
+ const kn = X("Monitor", [
47
47
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
48
48
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
49
49
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
@@ -54,7 +54,7 @@ const Ln = Z("Monitor", [
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
56
  */
57
- const On = Z("Moon", [
57
+ const Pn = X("Moon", [
58
58
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
59
59
  ]);
60
60
  /**
@@ -63,7 +63,7 @@ const On = Z("Moon", [
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
65
  */
66
- const kn = Z("ShieldX", [
66
+ const Tn = X("ShieldX", [
67
67
  [
68
68
  "path",
69
69
  {
@@ -80,7 +80,7 @@ const kn = Z("ShieldX", [
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
82
  */
83
- const Pn = Z("Sun", [
83
+ const _n = X("Sun", [
84
84
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
85
85
  ["path", { d: "M12 2v2", key: "tus03m" }],
86
86
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -102,45 +102,45 @@ var yt = { exports: {} }, ct = {};
102
102
  * LICENSE file in the root directory of this source tree.
103
103
  */
104
104
  var ra;
105
- function Tn() {
105
+ function Un() {
106
106
  if (ra) return ct;
107
107
  ra = 1;
108
108
  var t = Ea;
109
- function s(g, p) {
110
- return g === p && (g !== 0 || 1 / g === 1 / p) || g !== g && p !== p;
109
+ function a(f, h) {
110
+ return f === h && (f !== 0 || 1 / f === 1 / h) || f !== f && h !== h;
111
111
  }
112
- var n = typeof Object.is == "function" ? Object.is : s, a = t.useState, r = t.useEffect, d = t.useLayoutEffect, l = t.useDebugValue;
113
- function u(g, p) {
114
- var m = p(), o = a({ inst: { value: m, getSnapshot: p } }), b = o[0].inst, C = o[1];
115
- return d(
112
+ var n = typeof Object.is == "function" ? Object.is : a, s = t.useState, i = t.useEffect, u = t.useLayoutEffect, l = t.useDebugValue;
113
+ function p(f, h) {
114
+ var d = h(), r = s({ inst: { value: d, getSnapshot: h } }), b = r[0].inst, D = r[1];
115
+ return u(
116
116
  function() {
117
- b.value = m, b.getSnapshot = p, f(b) && C({ inst: b });
117
+ b.value = d, b.getSnapshot = h, g(b) && D({ inst: b });
118
118
  },
119
- [g, m, p]
120
- ), r(
119
+ [f, d, h]
120
+ ), i(
121
121
  function() {
122
- return f(b) && C({ inst: b }), g(function() {
123
- f(b) && C({ inst: b });
122
+ return g(b) && D({ inst: b }), f(function() {
123
+ g(b) && D({ inst: b });
124
124
  });
125
125
  },
126
- [g]
127
- ), l(m), m;
126
+ [f]
127
+ ), l(d), d;
128
128
  }
129
- function f(g) {
130
- var p = g.getSnapshot;
131
- g = g.value;
129
+ function g(f) {
130
+ var h = f.getSnapshot;
131
+ f = f.value;
132
132
  try {
133
- var m = p();
134
- return !n(g, m);
133
+ var d = h();
134
+ return !n(f, d);
135
135
  } catch {
136
136
  return !0;
137
137
  }
138
138
  }
139
- function v(g, p) {
140
- return p();
139
+ function v(f, h) {
140
+ return h();
141
141
  }
142
- var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : u;
143
- return ct.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : h, ct;
142
+ var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : p;
143
+ return ct.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : m, ct;
144
144
  }
145
145
  var lt = {};
146
146
  /**
@@ -153,138 +153,138 @@ var lt = {};
153
153
  * LICENSE file in the root directory of this source tree.
154
154
  */
155
155
  var oa;
156
- function _n() {
156
+ function Fn() {
157
157
  return oa || (oa = 1, process.env.NODE_ENV !== "production" && function() {
158
- function t(m, o) {
159
- return m === o && (m !== 0 || 1 / m === 1 / o) || m !== m && o !== o;
158
+ function t(d, r) {
159
+ return d === r && (d !== 0 || 1 / d === 1 / r) || d !== d && r !== r;
160
160
  }
161
- function s(m, o) {
162
- h || r.startTransition === void 0 || (h = !0, console.error(
161
+ function a(d, r) {
162
+ m || i.startTransition === void 0 || (m = !0, console.error(
163
163
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
164
164
  ));
165
- var b = o();
166
- if (!g) {
167
- var C = o();
168
- d(b, C) || (console.error(
165
+ var b = r();
166
+ if (!f) {
167
+ var D = r();
168
+ u(b, D) || (console.error(
169
169
  "The result of getSnapshot should be cached to avoid an infinite loop"
170
- ), g = !0);
170
+ ), f = !0);
171
171
  }
172
- C = l({
173
- inst: { value: b, getSnapshot: o }
172
+ D = l({
173
+ inst: { value: b, getSnapshot: r }
174
174
  });
175
- var w = C[0].inst, D = C[1];
176
- return f(
175
+ var w = D[0].inst, C = D[1];
176
+ return g(
177
177
  function() {
178
- w.value = b, w.getSnapshot = o, n(w) && D({ inst: w });
178
+ w.value = b, w.getSnapshot = r, n(w) && C({ inst: w });
179
179
  },
180
- [m, b, o]
181
- ), u(
180
+ [d, b, r]
181
+ ), p(
182
182
  function() {
183
- return n(w) && D({ inst: w }), m(function() {
184
- n(w) && D({ inst: w });
183
+ return n(w) && C({ inst: w }), d(function() {
184
+ n(w) && C({ inst: w });
185
185
  });
186
186
  },
187
- [m]
187
+ [d]
188
188
  ), v(b), b;
189
189
  }
190
- function n(m) {
191
- var o = m.getSnapshot;
192
- m = m.value;
190
+ function n(d) {
191
+ var r = d.getSnapshot;
192
+ d = d.value;
193
193
  try {
194
- var b = o();
195
- return !d(m, b);
194
+ var b = r();
195
+ return !u(d, b);
196
196
  } catch {
197
197
  return !0;
198
198
  }
199
199
  }
200
- function a(m, o) {
201
- return o();
200
+ function s(d, r) {
201
+ return r();
202
202
  }
203
203
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
204
- var r = Ea, d = typeof Object.is == "function" ? Object.is : t, l = r.useState, u = r.useEffect, f = r.useLayoutEffect, v = r.useDebugValue, h = !1, g = !1, p = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? a : s;
205
- lt.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : p, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
204
+ var i = Ea, u = typeof Object.is == "function" ? Object.is : t, l = i.useState, p = i.useEffect, g = i.useLayoutEffect, v = i.useDebugValue, m = !1, f = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? s : a;
205
+ lt.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
206
206
  }()), lt;
207
207
  }
208
- process.env.NODE_ENV === "production" ? yt.exports = Tn() : yt.exports = _n();
209
- var Un = yt.exports;
208
+ process.env.NODE_ENV === "production" ? yt.exports = Un() : yt.exports = Fn();
209
+ var Rn = yt.exports;
210
210
  const Pe = ["light", "dark", "system"];
211
- function Fn() {
212
- const { theme: t, setTheme: s } = ys(), n = N(
211
+ function Gn() {
212
+ const { theme: t, setTheme: a } = ys(), n = S(
213
213
  (l) => l.actions.setDashboardTheme
214
214
  );
215
- function a() {
216
- const l = Pe.includes(t) ? t : "system", u = Pe[(Pe.indexOf(l) + 1) % Pe.length];
217
- s(u), n(u);
215
+ function s() {
216
+ const l = Pe.includes(t) ? t : "system", p = Pe[(Pe.indexOf(l) + 1) % Pe.length];
217
+ a(p), n(p);
218
218
  }
219
- const r = t === "light" ? Pn : t === "dark" ? On : Ln, d = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
219
+ const i = t === "light" ? _n : t === "dark" ? Pn : kn, u = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
220
220
  return /* @__PURE__ */ e(
221
- A,
221
+ L,
222
222
  {
223
223
  type: "button",
224
224
  variant: "ghost",
225
225
  size: "xs",
226
226
  className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
227
- onClick: a,
228
- "aria-label": d,
229
- title: d,
230
- children: /* @__PURE__ */ e(r, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
227
+ onClick: s,
228
+ "aria-label": u,
229
+ title: u,
230
+ children: /* @__PURE__ */ e(i, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
231
231
  }
232
232
  );
233
233
  }
234
- async function Rn(t, s, n, a, r) {
235
- if (!r)
234
+ async function $n(t, a, n, s, i) {
235
+ if (!i)
236
236
  return null;
237
- const d = JSON.stringify(n), l = `${t}/v1/lens`;
238
- return await St(l, r, {
239
- name: s,
240
- template: d,
241
- filterValues: a,
237
+ const u = JSON.stringify(n), l = `${t}/v1/lens`;
238
+ return await Nt(l, i, {
239
+ name: a,
240
+ template: u,
241
+ filterValues: s,
242
242
  operation: "create"
243
243
  });
244
244
  }
245
- async function xt(t, s, n) {
245
+ async function xt(t, a, n) {
246
246
  if (!n)
247
247
  return null;
248
- const { id: a, template: r, filterValues: d, isDefault: l, shared: u } = s, f = `${t}/v1/lens`;
249
- return await St(f, n, {
250
- lensId: a,
251
- template: r,
252
- filterValues: d,
248
+ const { id: s, template: i, filterValues: u, isDefault: l, shared: p } = a, g = `${t}/v1/lens`;
249
+ return await Nt(g, n, {
250
+ lensId: s,
251
+ template: i,
252
+ filterValues: u,
253
253
  isDefault: l,
254
- shared: u,
254
+ shared: p,
255
255
  operation: "update"
256
256
  });
257
257
  }
258
- async function Gn(t, s, n) {
258
+ async function Vn(t, a, n) {
259
259
  if (!n)
260
260
  return null;
261
- const a = `${t}/v1/lens`;
262
- return await St(a, n, {
261
+ const s = `${t}/v1/lens`;
262
+ return await Nt(s, n, {
263
263
  operation: "delete",
264
- lensId: s
264
+ lensId: a
265
265
  });
266
266
  }
267
- const $n = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
268
- function Vn({
267
+ const zn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
268
+ function qn({
269
269
  open: t,
270
- onOpenChange: s
270
+ onOpenChange: a
271
271
  } = {}) {
272
- const [n, a] = S(""), [r, d] = S(!1), l = N((I) => I.lenses), { setLenses: u, setSelectedLensId: f } = Nt(), [v, h] = S(!1), [g, p] = S(!1), m = t !== void 0, o = m ? t : g, b = (I) => {
273
- m || p(I), s == null || s(I);
274
- }, C = N((I) => I.dashboard), w = N((I) => I.filterValues), { authToken: D, tokenProps: E } = K();
272
+ const [n, s] = N(""), [i, u] = N(!1), l = S((I) => I.lenses), { setLenses: p, setSelectedLensId: g } = St(), [v, m] = N(!1), [f, h] = N(!1), d = t !== void 0, r = d ? t : f, b = (I) => {
273
+ d || h(I), a == null || a(I);
274
+ }, D = S((I) => I.dashboard), w = S((I) => I.filterValues), { authToken: C, tokenProps: E } = j();
275
275
  async function O() {
276
- h(!0);
277
- const I = await Rn(
276
+ m(!0);
277
+ const I = await $n(
278
278
  E.apiServiceUrl,
279
279
  n,
280
- C,
280
+ D,
281
281
  w,
282
- D == null ? void 0 : D.accessToken
282
+ C == null ? void 0 : C.accessToken
283
283
  );
284
- I && (u([...l || [], I]), f(I.id), b(!1)), h(!1);
284
+ I && (p([...l || [], I]), g(I.id), b(!1)), m(!1);
285
285
  }
286
- return /* @__PURE__ */ c(Ge, { open: o, onOpenChange: b, children: [
287
- m ? null : /* @__PURE__ */ e(xs, { asChild: !0, children: /* @__PURE__ */ c(A, { variant: "secondary", size: "xs", children: [
286
+ return /* @__PURE__ */ c(Ge, { open: r, onOpenChange: b, children: [
287
+ d ? null : /* @__PURE__ */ e(xs, { asChild: !0, children: /* @__PURE__ */ c(L, { variant: "secondary", size: "xs", children: [
288
288
  /* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5" }),
289
289
  "Lens"
290
290
  ] }) }),
@@ -294,7 +294,7 @@ function Vn({
294
294
  /* @__PURE__ */ e(wt, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
295
295
  ] }),
296
296
  /* @__PURE__ */ c("div", { className: "space-y-1.5 py-1", children: [
297
- /* @__PURE__ */ e(dt, { htmlFor: "lens-name", className: $n, children: "Name" }),
297
+ /* @__PURE__ */ e(dt, { htmlFor: "lens-name", className: zn, children: "Name" }),
298
298
  /* @__PURE__ */ e(
299
299
  ue,
300
300
  {
@@ -302,15 +302,15 @@ function Vn({
302
302
  size: "xs",
303
303
  value: n,
304
304
  placeholder: "Monthly review, West region, …",
305
- onChange: (I) => a(I.target.value)
305
+ onChange: (I) => s(I.target.value)
306
306
  }
307
307
  ),
308
- r && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
308
+ i && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
309
309
  ] }),
310
- /* @__PURE__ */ c(Ss, { children: [
311
- /* @__PURE__ */ e(A, { variant: "outline", size: "xs", onClick: () => b(!1), children: "Cancel" }),
310
+ /* @__PURE__ */ c(Ns, { children: [
311
+ /* @__PURE__ */ e(L, { variant: "outline", size: "xs", onClick: () => b(!1), children: "Cancel" }),
312
312
  /* @__PURE__ */ e(
313
- A,
313
+ L,
314
314
  {
315
315
  size: "xs",
316
316
  type: "submit",
@@ -323,38 +323,38 @@ function Vn({
323
323
  ] })
324
324
  ] });
325
325
  }
326
- function zn({ includeLabel: t = !1 } = {}) {
327
- const s = N((h) => h.lenses), n = N((h) => h.selectedLensId), { setLenses: a, setSelectedLensId: r } = Nt(), { authToken: d, tokenProps: l } = K();
328
- async function u(h) {
329
- r(h);
326
+ function Bn({ includeLabel: t = !1 } = {}) {
327
+ const a = S((m) => m.lenses), n = S((m) => m.selectedLensId), { setLenses: s, setSelectedLensId: i } = St(), { authToken: u, tokenProps: l } = j();
328
+ async function p(m) {
329
+ i(m);
330
330
  }
331
- async function f(h) {
332
- if (await Gn(l.apiServiceUrl, h, d == null ? void 0 : d.accessToken)) {
333
- const p = s == null ? void 0 : s.filter((m) => m.id !== h);
334
- a(p || []), r("original");
331
+ async function g(m) {
332
+ if (await Vn(l.apiServiceUrl, m, u == null ? void 0 : u.accessToken)) {
333
+ const h = a == null ? void 0 : a.filter((d) => d.id !== m);
334
+ s(h || []), i("original");
335
335
  }
336
336
  }
337
- async function v(h) {
338
- const g = s == null ? void 0 : s.map((o) => o.id === h.id ? {
339
- ...o,
340
- isDefault: !h.isDefault
337
+ async function v(m) {
338
+ const f = a == null ? void 0 : a.map((r) => r.id === m.id ? {
339
+ ...r,
340
+ isDefault: !m.isDefault
341
341
  } : {
342
- ...o,
342
+ ...r,
343
343
  isDefault: !1
344
344
  });
345
- a(g || []);
346
- const p = {
347
- ...h,
348
- isDefault: !h.isDefault
345
+ s(f || []);
346
+ const h = {
347
+ ...m,
348
+ isDefault: !m.isDefault
349
349
  };
350
- await xt(l.apiServiceUrl, p, d == null ? void 0 : d.accessToken);
351
- const m = s == null ? void 0 : s.find((o) => o.isDefault);
352
- if (m && m.id !== h.id) {
353
- const o = {
354
- ...m,
350
+ await xt(l.apiServiceUrl, h, u == null ? void 0 : u.accessToken);
351
+ const d = a == null ? void 0 : a.find((r) => r.isDefault);
352
+ if (d && d.id !== m.id) {
353
+ const r = {
354
+ ...d,
355
355
  isDefault: !1
356
356
  };
357
- await xt(l.apiServiceUrl, o, d == null ? void 0 : d.accessToken);
357
+ await xt(l.apiServiceUrl, r, u == null ? void 0 : u.accessToken);
358
358
  }
359
359
  }
360
360
  return /* @__PURE__ */ c(T, { children: [
@@ -363,31 +363,31 @@ function zn({ includeLabel: t = !1 } = {}) {
363
363
  /* @__PURE__ */ e(Te, {})
364
364
  ] }) : null,
365
365
  /* @__PURE__ */ c(
366
- Ns,
366
+ Ss,
367
367
  {
368
368
  value: n,
369
- onValueChange: u,
369
+ onValueChange: p,
370
370
  children: [
371
371
  /* @__PURE__ */ e(aa, { value: "original", children: "Original" }),
372
- s == null ? void 0 : s.map((h) => /* @__PURE__ */ c(
372
+ a == null ? void 0 : a.map((m) => /* @__PURE__ */ c(
373
373
  aa,
374
374
  {
375
375
  className: "group flex justify-between gap-2",
376
- value: h.id,
376
+ value: m.id,
377
377
  children: [
378
- /* @__PURE__ */ e("p", { children: h.name }),
378
+ /* @__PURE__ */ e("p", { children: m.name }),
379
379
  /* @__PURE__ */ c("span", { className: "flex items-center gap-3", children: [
380
380
  /* @__PURE__ */ e(
381
381
  fa,
382
382
  {
383
- onClick: (g) => {
384
- g.preventDefault(), v(h);
383
+ onClick: (f) => {
384
+ f.preventDefault(), v(m);
385
385
  },
386
- className: Y(
386
+ className: J(
387
387
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
388
388
  {
389
- invisible: !h.isDefault,
390
- "text-green-500": h.isDefault
389
+ invisible: !m.isDefault,
390
+ "text-green-500": m.isDefault
391
391
  }
392
392
  ),
393
393
  strokeWidth: 1.5
@@ -396,8 +396,8 @@ function zn({ includeLabel: t = !1 } = {}) {
396
396
  /* @__PURE__ */ e(
397
397
  ga,
398
398
  {
399
- onClick: (g) => {
400
- g.preventDefault(), f(h.id);
399
+ onClick: (f) => {
400
+ f.preventDefault(), g(m.id);
401
401
  },
402
402
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
403
403
  strokeWidth: 1.5
@@ -406,138 +406,138 @@ function zn({ includeLabel: t = !1 } = {}) {
406
406
  ] })
407
407
  ]
408
408
  },
409
- h.id
409
+ m.id
410
410
  ))
411
411
  ]
412
412
  }
413
413
  )
414
414
  ] });
415
415
  }
416
- function qn() {
417
- const { displayPreferences: t, shouldShowElement: s } = ws(), { currentUser: n, userContext: a } = Dt(), r = F(
416
+ function Hn() {
417
+ const { displayPreferences: t, shouldShowElement: a } = ws(), { currentUser: n, userContext: s } = Dt(), i = F(
418
418
  () => Ds(n),
419
419
  [n]
420
- ), d = F(() => (u) => r && r[u] !== void 0 && r[u] === !1 ? !1 : s(u), [r, s, t]), l = F(
420
+ ), u = F(() => (p) => i && i[p] !== void 0 && i[p] === !1 ? !1 : a(p), [i, a, t]), l = F(
421
421
  () => {
422
- var u, f, v, h, g;
422
+ var p, g, v, m, f;
423
423
  return {
424
- canEdit: ((u = a == null ? void 0 : a.permissions) == null ? void 0 : u.canEdit) ?? As(n),
425
- canUseFilters: ((f = a == null ? void 0 : a.permissions) == null ? void 0 : f.canEdit) ?? Ms(n),
426
- canManageDashboards: ((v = a == null ? void 0 : a.permissions) == null ? void 0 : v.canCreateDashboard) ?? Is(n),
427
- canCreateDashboards: ((h = a == null ? void 0 : a.permissions) == null ? void 0 : h.canCreateDashboard) ?? Es(n),
428
- canAccessVisuals: ((g = a == null ? void 0 : a.permissions) == null ? void 0 : g.canEdit) ?? Cs(n)
424
+ canEdit: ((p = s == null ? void 0 : s.permissions) == null ? void 0 : p.canEdit) ?? Ls(n),
425
+ canUseFilters: ((g = s == null ? void 0 : s.permissions) == null ? void 0 : g.canEdit) ?? As(n),
426
+ canManageDashboards: ((v = s == null ? void 0 : s.permissions) == null ? void 0 : v.canCreateDashboard) ?? Is(n),
427
+ canCreateDashboards: ((m = s == null ? void 0 : s.permissions) == null ? void 0 : m.canCreateDashboard) ?? Es(n),
428
+ canAccessVisuals: ((f = s == null ? void 0 : s.permissions) == null ? void 0 : f.canEdit) ?? Cs(n)
429
429
  };
430
430
  },
431
- [n, a]
431
+ [n, s]
432
432
  );
433
433
  return {
434
434
  displayPreferences: t,
435
- shouldShowElement: d,
435
+ shouldShowElement: u,
436
436
  permissions: l,
437
437
  currentUser: n
438
438
  };
439
439
  }
440
- const Bn = async (t, s, n) => {
441
- const a = `${t}/management/v1/groups`;
442
- return await ua(a, s, n);
443
- }, Hn = async (t, s, n) => {
444
- const a = `${t}/management/v1/groups/${n}`;
445
- await da(a, s, "DELETE");
446
- }, jn = async (t, s, n, a) => {
447
- const r = `${t}/management/v1/groups/${n}/members`;
448
- return await ua(r, s, a);
449
- }, Kn = async (t, s, n, a) => {
450
- const r = `${t}/management/v1/groups/${n}/members`;
451
- await da(r, s, "DELETE", a);
440
+ const jn = async (t, a, n) => {
441
+ const s = `${t}/management/v1/groups`;
442
+ return await ua(s, a, n);
443
+ }, Kn = async (t, a, n) => {
444
+ const s = `${t}/management/v1/groups/${n}`;
445
+ await da(s, a, "DELETE");
446
+ }, Qn = async (t, a, n, s) => {
447
+ const i = `${t}/management/v1/groups/${n}/members`;
448
+ return await ua(i, a, s);
449
+ }, Wn = async (t, a, n, s) => {
450
+ const i = `${t}/management/v1/groups/${n}/members`;
451
+ await da(i, a, "DELETE", s);
452
452
  };
453
- function Qn() {
454
- const { authToken: t, tokenProps: s } = K(), n = qe();
453
+ function Jn() {
454
+ const { authToken: t, tokenProps: a } = j(), n = qe();
455
455
  return Be({
456
- mutationFn: (a) => Bn(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
456
+ mutationFn: (s) => jn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s),
457
457
  onSuccess: () => {
458
- n.invalidateQueries({ queryKey: ["groups"] }), M.success("Group created successfully");
458
+ n.invalidateQueries({ queryKey: ["groups"] }), A.success("Group created successfully");
459
459
  },
460
- onError: (a) => {
461
- console.error("Failed to create group:", a), M.error("Failed to create group", {
462
- description: Re(a, "Failed to create group")
460
+ onError: (s) => {
461
+ console.error("Failed to create group:", s), A.error("Failed to create group", {
462
+ description: Re(s, "Failed to create group")
463
463
  });
464
464
  }
465
465
  });
466
466
  }
467
- function Wn() {
468
- const { authToken: t, tokenProps: s } = K(), n = qe();
467
+ function Yn() {
468
+ const { authToken: t, tokenProps: a } = j(), n = qe();
469
469
  return Be({
470
- mutationFn: (a) => Hn(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
471
- onSuccess: (a, r) => {
472
- n.invalidateQueries({ queryKey: ["groups"] }), n.removeQueries({ queryKey: ["group", r] }), M.success("Group deleted successfully");
470
+ mutationFn: (s) => Kn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s),
471
+ onSuccess: (s, i) => {
472
+ n.invalidateQueries({ queryKey: ["groups"] }), n.removeQueries({ queryKey: ["group", i] }), A.success("Group deleted successfully");
473
473
  },
474
- onError: (a) => {
475
- console.error("Failed to delete group:", a), M.error("Failed to delete group", {
476
- description: Re(a, "Failed to delete group")
474
+ onError: (s) => {
475
+ console.error("Failed to delete group:", s), A.error("Failed to delete group", {
476
+ description: Re(s, "Failed to delete group")
477
477
  });
478
478
  }
479
479
  });
480
480
  }
481
- function Jn() {
482
- const { authToken: t, tokenProps: s } = K(), n = qe();
481
+ function Xn() {
482
+ const { authToken: t, tokenProps: a } = j(), n = qe();
483
483
  return Be({
484
484
  mutationFn: ({
485
- groupId: a,
486
- data: r
487
- }) => jn(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, r),
488
- onSuccess: (a, r) => {
489
- n.invalidateQueries({ queryKey: ["group", r.groupId] }), n.invalidateQueries({
490
- queryKey: ["group-members", r.groupId]
491
- }), n.invalidateQueries({ queryKey: ["groups"] }), M.success("Members added successfully");
485
+ groupId: s,
486
+ data: i
487
+ }) => Qn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s, i),
488
+ onSuccess: (s, i) => {
489
+ n.invalidateQueries({ queryKey: ["group", i.groupId] }), n.invalidateQueries({
490
+ queryKey: ["group-members", i.groupId]
491
+ }), n.invalidateQueries({ queryKey: ["groups"] }), A.success("Members added successfully");
492
492
  },
493
- onError: (a) => {
494
- console.error("Failed to add group members:", a), M.error("Failed to add members", {
495
- description: Re(a, "Failed to add members")
493
+ onError: (s) => {
494
+ console.error("Failed to add group members:", s), A.error("Failed to add members", {
495
+ description: Re(s, "Failed to add members")
496
496
  });
497
497
  }
498
498
  });
499
499
  }
500
- function Yn() {
501
- const { authToken: t, tokenProps: s } = K(), n = qe();
500
+ function Zn() {
501
+ const { authToken: t, tokenProps: a } = j(), n = qe();
502
502
  return Be({
503
503
  mutationFn: ({
504
- groupId: a,
505
- data: r
506
- }) => Kn(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, r),
507
- onSuccess: (a, r) => {
508
- n.invalidateQueries({ queryKey: ["group", r.groupId] }), n.invalidateQueries({
509
- queryKey: ["group-members", r.groupId]
510
- }), n.invalidateQueries({ queryKey: ["groups"] }), M.success("Members removed successfully");
504
+ groupId: s,
505
+ data: i
506
+ }) => Wn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s, i),
507
+ onSuccess: (s, i) => {
508
+ n.invalidateQueries({ queryKey: ["group", i.groupId] }), n.invalidateQueries({
509
+ queryKey: ["group-members", i.groupId]
510
+ }), n.invalidateQueries({ queryKey: ["groups"] }), A.success("Members removed successfully");
511
511
  },
512
- onError: (a) => {
513
- console.error("Failed to remove group members:", a), M.error("Failed to remove members", {
514
- description: Re(a, "Failed to remove members")
512
+ onError: (s) => {
513
+ console.error("Failed to remove group members:", s), A.error("Failed to remove members", {
514
+ description: Re(s, "Failed to remove members")
515
515
  });
516
516
  }
517
517
  });
518
518
  }
519
519
  const ia = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
520
- function Xn({
520
+ function er({
521
521
  onSuccess: t,
522
- tenantId: s,
522
+ tenantId: a,
523
523
  isTenantUser: n
524
524
  }) {
525
- const [a, r] = S(""), [d, l] = S(""), [u, f] = S({}), v = Qn(), h = () => {
526
- const p = {};
527
- return a.trim() ? a.length < 3 ? p.name = "Group name must be at least 3 characters" : a.length > 50 && (p.name = "Group name must be less than 50 characters") : p.name = "Group name is required", d && d.length > 200 && (p.description = "Description must be less than 200 characters"), f(p), Object.keys(p).length === 0;
525
+ const [s, i] = N(""), [u, l] = N(""), [p, g] = N({}), v = Jn(), m = () => {
526
+ const h = {};
527
+ return s.trim() ? s.length < 3 ? h.name = "Group name must be at least 3 characters" : s.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", u && u.length > 200 && (h.description = "Description must be less than 200 characters"), g(h), Object.keys(h).length === 0;
528
528
  };
529
- return /* @__PURE__ */ c("form", { onSubmit: async (p) => {
530
- if (p.preventDefault(), !h()) return;
531
- const m = {
532
- name: a.trim(),
533
- description: d.trim() || void 0,
529
+ return /* @__PURE__ */ c("form", { onSubmit: async (h) => {
530
+ if (h.preventDefault(), !m()) return;
531
+ const d = {
532
+ name: s.trim(),
533
+ description: u.trim() || void 0,
534
534
  type: n ? "TENANT_GROUP" : "ORG_GROUP",
535
- ...n && s ? { tenantId: s } : {}
535
+ ...n && a ? { tenantId: a } : {}
536
536
  };
537
537
  try {
538
- await v.mutateAsync(m), r(""), l(""), f({}), t();
539
- } catch (o) {
540
- console.error("Failed to create group:", o);
538
+ await v.mutateAsync(d), i(""), l(""), g({}), t();
539
+ } catch (r) {
540
+ console.error("Failed to create group:", r);
541
541
  }
542
542
  }, className: "space-y-4", children: [
543
543
  /* @__PURE__ */ c("div", { className: "space-y-1.5", children: [
@@ -551,34 +551,34 @@ function Xn({
551
551
  id: "group-name",
552
552
  size: "xs",
553
553
  placeholder: "e.g., Marketing Team, Engineering Squad",
554
- value: a,
555
- onChange: (p) => {
556
- r(p.target.value), u.name && f((m) => ({ ...m, name: "" }));
554
+ value: s,
555
+ onChange: (h) => {
556
+ i(h.target.value), p.name && g((d) => ({ ...d, name: "" }));
557
557
  },
558
- className: u.name ? "border-destructive" : "",
558
+ className: p.name ? "border-destructive" : "",
559
559
  disabled: v.isPending
560
560
  }
561
561
  ),
562
- u.name && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: u.name })
562
+ p.name && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: p.name })
563
563
  ] }),
564
564
  /* @__PURE__ */ c("div", { className: "space-y-1.5", children: [
565
565
  /* @__PURE__ */ e(dt, { htmlFor: "group-description", className: ia, children: "Description (optional)" }),
566
566
  /* @__PURE__ */ e(
567
- Ls,
567
+ Ms,
568
568
  {
569
569
  id: "group-description",
570
570
  placeholder: "Describe the purpose of this group…",
571
- value: d,
572
- onChange: (p) => {
573
- l(p.target.value), u.description && f((m) => ({ ...m, description: "" }));
571
+ value: u,
572
+ onChange: (h) => {
573
+ l(h.target.value), p.description && g((d) => ({ ...d, description: "" }));
574
574
  },
575
- className: `text-[13px] ${u.description ? "border-destructive" : ""}`,
575
+ className: `text-[13px] ${p.description ? "border-destructive" : ""}`,
576
576
  disabled: v.isPending,
577
577
  rows: 3
578
578
  }
579
579
  ),
580
- u.description ? /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: u.description }) : /* @__PURE__ */ c("p", { className: "text-[11px] text-muted-foreground", children: [
581
- d.length,
580
+ p.description ? /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: p.description }) : /* @__PURE__ */ c("p", { className: "text-[11px] text-muted-foreground", children: [
581
+ u.length,
582
582
  "/200"
583
583
  ] })
584
584
  ] }),
@@ -588,26 +588,26 @@ function Xn({
588
588
  ] }),
589
589
  /* @__PURE__ */ c("div", { className: "flex justify-end gap-1.5 pt-1", children: [
590
590
  /* @__PURE__ */ e(
591
- A,
591
+ L,
592
592
  {
593
593
  type: "button",
594
594
  variant: "outline",
595
595
  size: "xs",
596
596
  onClick: () => {
597
- r(""), l(""), f({});
597
+ i(""), l(""), g({});
598
598
  },
599
599
  disabled: v.isPending,
600
600
  children: "Clear"
601
601
  }
602
602
  ),
603
603
  /* @__PURE__ */ e(
604
- A,
604
+ L,
605
605
  {
606
606
  type: "submit",
607
607
  size: "xs",
608
- disabled: v.isPending || !a.trim(),
608
+ disabled: v.isPending || !s.trim(),
609
609
  children: v.isPending ? /* @__PURE__ */ c(T, { children: [
610
- /* @__PURE__ */ e(X, { className: "h-3.5 w-3.5 animate-spin" }),
610
+ /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }),
611
611
  "Creating…"
612
612
  ] }) : "Create group"
613
613
  }
@@ -615,59 +615,59 @@ function Xn({
615
615
  ] })
616
616
  ] });
617
617
  }
618
- function Zn(t, s = []) {
618
+ function tr(t, a = []) {
619
619
  let n = [];
620
- function a(d, l) {
621
- const u = L.createContext(l);
622
- u.displayName = d + "Context";
623
- const f = n.length;
620
+ function s(u, l) {
621
+ const p = M.createContext(l);
622
+ p.displayName = u + "Context";
623
+ const g = n.length;
624
624
  n = [...n, l];
625
- const v = (g) => {
625
+ const v = (f) => {
626
626
  var w;
627
- const { scope: p, children: m, ...o } = g, b = ((w = p == null ? void 0 : p[t]) == null ? void 0 : w[f]) || u, C = L.useMemo(() => o, Object.values(o));
628
- return /* @__PURE__ */ e(b.Provider, { value: C, children: m });
627
+ const { scope: h, children: d, ...r } = f, b = ((w = h == null ? void 0 : h[t]) == null ? void 0 : w[g]) || p, D = M.useMemo(() => r, Object.values(r));
628
+ return /* @__PURE__ */ e(b.Provider, { value: D, children: d });
629
629
  };
630
- v.displayName = d + "Provider";
631
- function h(g, p) {
630
+ v.displayName = u + "Provider";
631
+ function m(f, h) {
632
632
  var b;
633
- const m = ((b = p == null ? void 0 : p[t]) == null ? void 0 : b[f]) || u, o = L.useContext(m);
634
- if (o) return o;
633
+ const d = ((b = h == null ? void 0 : h[t]) == null ? void 0 : b[g]) || p, r = M.useContext(d);
634
+ if (r) return r;
635
635
  if (l !== void 0) return l;
636
- throw new Error(`\`${g}\` must be used within \`${d}\``);
636
+ throw new Error(`\`${f}\` must be used within \`${u}\``);
637
637
  }
638
- return [v, h];
638
+ return [v, m];
639
639
  }
640
- const r = () => {
641
- const d = n.map((l) => L.createContext(l));
642
- return function(u) {
643
- const f = (u == null ? void 0 : u[t]) || d;
644
- return L.useMemo(
645
- () => ({ [`__scope${t}`]: { ...u, [t]: f } }),
646
- [u, f]
640
+ const i = () => {
641
+ const u = n.map((l) => M.createContext(l));
642
+ return function(p) {
643
+ const g = (p == null ? void 0 : p[t]) || u;
644
+ return M.useMemo(
645
+ () => ({ [`__scope${t}`]: { ...p, [t]: g } }),
646
+ [p, g]
647
647
  );
648
648
  };
649
649
  };
650
- return r.scopeName = t, [a, er(r, ...s)];
650
+ return i.scopeName = t, [s, ar(i, ...a)];
651
651
  }
652
- function er(...t) {
653
- const s = t[0];
654
- if (t.length === 1) return s;
652
+ function ar(...t) {
653
+ const a = t[0];
654
+ if (t.length === 1) return a;
655
655
  const n = () => {
656
- const a = t.map((r) => ({
657
- useScope: r(),
658
- scopeName: r.scopeName
656
+ const s = t.map((i) => ({
657
+ useScope: i(),
658
+ scopeName: i.scopeName
659
659
  }));
660
- return function(d) {
661
- const l = a.reduce((u, { useScope: f, scopeName: v }) => {
662
- const g = f(d)[`__scope${v}`];
663
- return { ...u, ...g };
660
+ return function(u) {
661
+ const l = s.reduce((p, { useScope: g, scopeName: v }) => {
662
+ const f = g(u)[`__scope${v}`];
663
+ return { ...p, ...f };
664
664
  }, {});
665
- return L.useMemo(() => ({ [`__scope${s.scopeName}`]: l }), [l]);
665
+ return M.useMemo(() => ({ [`__scope${a.scopeName}`]: l }), [l]);
666
666
  };
667
667
  };
668
- return n.scopeName = s.scopeName, n;
668
+ return n.scopeName = a.scopeName, n;
669
669
  }
670
- var tr = [
670
+ var sr = [
671
671
  "a",
672
672
  "button",
673
673
  "div",
@@ -685,135 +685,135 @@ var tr = [
685
685
  "span",
686
686
  "svg",
687
687
  "ul"
688
- ], Et = tr.reduce((t, s) => {
689
- const n = ds(`Primitive.${s}`), a = L.forwardRef((r, d) => {
690
- const { asChild: l, ...u } = r, f = l ? n : s;
691
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(f, { ...u, ref: d });
688
+ ], Et = sr.reduce((t, a) => {
689
+ const n = ds(`Primitive.${a}`), s = M.forwardRef((i, u) => {
690
+ const { asChild: l, ...p } = i, g = l ? n : a;
691
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...p, ref: u });
692
692
  });
693
- return a.displayName = `Primitive.${s}`, { ...t, [s]: a };
693
+ return s.displayName = `Primitive.${a}`, { ...t, [a]: s };
694
694
  }, {});
695
- function ar() {
696
- return Un.useSyncExternalStore(
697
- sr,
695
+ function nr() {
696
+ return Rn.useSyncExternalStore(
697
+ rr,
698
698
  () => !0,
699
699
  () => !1
700
700
  );
701
701
  }
702
- function sr() {
702
+ function rr() {
703
703
  return () => {
704
704
  };
705
705
  }
706
- var It = "Avatar", [nr] = Zn(It), [rr, Ia] = nr(It), Ma = L.forwardRef(
707
- (t, s) => {
708
- const { __scopeAvatar: n, ...a } = t, [r, d] = L.useState("idle");
706
+ var It = "Avatar", [or] = tr(It), [ir, Ia] = or(It), Aa = M.forwardRef(
707
+ (t, a) => {
708
+ const { __scopeAvatar: n, ...s } = t, [i, u] = M.useState("idle");
709
709
  return /* @__PURE__ */ e(
710
- rr,
710
+ ir,
711
711
  {
712
712
  scope: n,
713
- imageLoadingStatus: r,
714
- onImageLoadingStatusChange: d,
715
- children: /* @__PURE__ */ e(Et.span, { ...a, ref: s })
713
+ imageLoadingStatus: i,
714
+ onImageLoadingStatusChange: u,
715
+ children: /* @__PURE__ */ e(Et.span, { ...s, ref: a })
716
716
  }
717
717
  );
718
718
  }
719
719
  );
720
- Ma.displayName = It;
721
- var Aa = "AvatarImage", La = L.forwardRef(
722
- (t, s) => {
723
- const { __scopeAvatar: n, src: a, onLoadingStatusChange: r = () => {
724
- }, ...d } = t, l = Ia(Aa, n), u = or(a, d), f = us((v) => {
725
- r(v), l.onImageLoadingStatusChange(v);
720
+ Aa.displayName = It;
721
+ var La = "AvatarImage", Ma = M.forwardRef(
722
+ (t, a) => {
723
+ const { __scopeAvatar: n, src: s, onLoadingStatusChange: i = () => {
724
+ }, ...u } = t, l = Ia(La, n), p = cr(s, u), g = us((v) => {
725
+ i(v), l.onImageLoadingStatusChange(v);
726
726
  });
727
727
  return ut(() => {
728
- u !== "idle" && f(u);
729
- }, [u, f]), u === "loaded" ? /* @__PURE__ */ e(Et.img, { ...d, ref: s, src: a }) : null;
728
+ p !== "idle" && g(p);
729
+ }, [p, g]), p === "loaded" ? /* @__PURE__ */ e(Et.img, { ...u, ref: a, src: s }) : null;
730
730
  }
731
731
  );
732
- La.displayName = Aa;
733
- var Oa = "AvatarFallback", ka = L.forwardRef(
734
- (t, s) => {
735
- const { __scopeAvatar: n, delayMs: a, ...r } = t, d = Ia(Oa, n), [l, u] = L.useState(a === void 0);
736
- return L.useEffect(() => {
737
- if (a !== void 0) {
738
- const f = window.setTimeout(() => u(!0), a);
739
- return () => window.clearTimeout(f);
732
+ Ma.displayName = La;
733
+ var Oa = "AvatarFallback", ka = M.forwardRef(
734
+ (t, a) => {
735
+ const { __scopeAvatar: n, delayMs: s, ...i } = t, u = Ia(Oa, n), [l, p] = M.useState(s === void 0);
736
+ return M.useEffect(() => {
737
+ if (s !== void 0) {
738
+ const g = window.setTimeout(() => p(!0), s);
739
+ return () => window.clearTimeout(g);
740
740
  }
741
- }, [a]), l && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Et.span, { ...r, ref: s }) : null;
741
+ }, [s]), l && u.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Et.span, { ...i, ref: a }) : null;
742
742
  }
743
743
  );
744
744
  ka.displayName = Oa;
745
- function ca(t, s) {
746
- return t ? s ? (t.src !== s && (t.src = s), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
745
+ function ca(t, a) {
746
+ return t ? a ? (t.src !== a && (t.src = a), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
747
747
  }
748
- function or(t, { referrerPolicy: s, crossOrigin: n }) {
749
- const a = ar(), r = L.useRef(null), d = a ? (r.current || (r.current = new window.Image()), r.current) : null, [l, u] = L.useState(
750
- () => ca(d, t)
748
+ function cr(t, { referrerPolicy: a, crossOrigin: n }) {
749
+ const s = nr(), i = M.useRef(null), u = s ? (i.current || (i.current = new window.Image()), i.current) : null, [l, p] = M.useState(
750
+ () => ca(u, t)
751
751
  );
752
752
  return ut(() => {
753
- u(ca(d, t));
754
- }, [d, t]), ut(() => {
755
- const f = (g) => () => {
756
- u(g);
753
+ p(ca(u, t));
754
+ }, [u, t]), ut(() => {
755
+ const g = (f) => () => {
756
+ p(f);
757
757
  };
758
- if (!d) return;
759
- const v = f("loaded"), h = f("error");
760
- return d.addEventListener("load", v), d.addEventListener("error", h), s && (d.referrerPolicy = s), typeof n == "string" && (d.crossOrigin = n), () => {
761
- d.removeEventListener("load", v), d.removeEventListener("error", h);
758
+ if (!u) return;
759
+ const v = g("loaded"), m = g("error");
760
+ return u.addEventListener("load", v), u.addEventListener("error", m), a && (u.referrerPolicy = a), typeof n == "string" && (u.crossOrigin = n), () => {
761
+ u.removeEventListener("load", v), u.removeEventListener("error", m);
762
762
  };
763
- }, [d, n, s]), l;
763
+ }, [u, n, a]), l;
764
764
  }
765
- var Pa = Ma, Ta = La, _a = ka;
766
- const Mt = L.forwardRef(({ className: t, ...s }, n) => /* @__PURE__ */ e(
765
+ var Pa = Aa, Ta = Ma, _a = ka;
766
+ const At = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
767
767
  Pa,
768
768
  {
769
769
  ref: n,
770
- className: Y(
770
+ className: J(
771
771
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
772
772
  t
773
773
  ),
774
- ...s
774
+ ...a
775
775
  }
776
776
  ));
777
- Mt.displayName = Pa.displayName;
778
- const ir = L.forwardRef(({ className: t, ...s }, n) => /* @__PURE__ */ e(
777
+ At.displayName = Pa.displayName;
778
+ const lr = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
779
779
  Ta,
780
780
  {
781
781
  ref: n,
782
- className: Y("aspect-square h-full w-full", t),
783
- ...s
782
+ className: J("aspect-square h-full w-full", t),
783
+ ...a
784
784
  }
785
785
  ));
786
- ir.displayName = Ta.displayName;
787
- const At = L.forwardRef(({ className: t, ...s }, n) => /* @__PURE__ */ e(
786
+ lr.displayName = Ta.displayName;
787
+ const Lt = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
788
788
  _a,
789
789
  {
790
790
  ref: n,
791
- className: Y(
791
+ className: J(
792
792
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
793
793
  t
794
794
  ),
795
- ...s
795
+ ...a
796
796
  }
797
797
  ));
798
- At.displayName = _a.displayName;
799
- function cr({
798
+ Lt.displayName = _a.displayName;
799
+ function dr({
800
800
  open: t,
801
- onOpenChange: s,
801
+ onOpenChange: a,
802
802
  group: n,
803
- onUpdate: a
803
+ onUpdate: s
804
804
  }) {
805
- const [r, d] = S("members"), [l, u] = S(""), [f, v] = S([]), [h, g] = S([]), { data: p, isLoading: m, refetch: o } = Os(n.id), b = n.type === "TENANT_GROUP" ? "tenant" : "organization", { users: C, isLoading: w } = ks({
805
+ const [i, u] = N("members"), [l, p] = N(""), [g, v] = N([]), [m, f] = N([]), { data: h, isLoading: d, refetch: r } = Os(n.id), b = n.type === "TENANT_GROUP" ? "tenant" : "organization", { users: D, isLoading: w } = ks({
806
806
  type: b,
807
807
  tenantId: n.tenantId || void 0,
808
808
  active: !0,
809
809
  limit: 100
810
- }), D = Jn(), E = Yn(), O = (p == null ? void 0 : p.members) || [], I = F(() => new Set(O.map((y) => y.userId)), [O]), V = F(() => C.filter((y) => !I.has(y.id)), [C, I]), z = F(() => {
810
+ }), C = Xn(), E = Zn(), O = (h == null ? void 0 : h.members) || [], I = F(() => new Set(O.map((y) => y.userId)), [O]), V = F(() => D.filter((y) => !I.has(y.id)), [D, I]), z = F(() => {
811
811
  if (!l) return V;
812
812
  const y = l.toLowerCase();
813
813
  return V.filter(
814
814
  (k) => {
815
- var G, j;
816
- return ((G = k.name) == null ? void 0 : G.toLowerCase().includes(y)) || ((j = k.email) == null ? void 0 : j.toLowerCase().includes(y));
815
+ var G, H;
816
+ return ((G = k.name) == null ? void 0 : G.toLowerCase().includes(y)) || ((H = k.email) == null ? void 0 : H.toLowerCase().includes(y));
817
817
  }
818
818
  );
819
819
  }, [V, l]), x = F(() => {
@@ -821,45 +821,45 @@ function cr({
821
821
  const y = l.toLowerCase();
822
822
  return O.filter(
823
823
  (k) => {
824
- var G, j, me, te;
825
- return ((j = (G = k.user) == null ? void 0 : G.name) == null ? void 0 : j.toLowerCase().includes(y)) || ((te = (me = k.user) == null ? void 0 : me.email) == null ? void 0 : te.toLowerCase().includes(y));
824
+ var G, H, me, te;
825
+ return ((H = (G = k.user) == null ? void 0 : G.name) == null ? void 0 : H.toLowerCase().includes(y)) || ((te = (me = k.user) == null ? void 0 : me.email) == null ? void 0 : te.toLowerCase().includes(y));
826
826
  }
827
827
  );
828
828
  }, [O, l]), B = async () => {
829
- if (f.length !== 0)
829
+ if (g.length !== 0)
830
830
  try {
831
- await D.mutateAsync({
831
+ await C.mutateAsync({
832
832
  groupId: n.id,
833
833
  data: {
834
- userIds: f,
834
+ userIds: g,
835
835
  userType: b === "tenant" ? "tenant" : "org"
836
836
  }
837
- }), v([]), d("members"), o(), a == null || a();
837
+ }), v([]), u("members"), r(), s == null || s();
838
838
  } catch (y) {
839
839
  console.error("Failed to add members:", y);
840
840
  }
841
- }, W = async () => {
842
- if (h.length !== 0)
841
+ }, Q = async () => {
842
+ if (m.length !== 0)
843
843
  try {
844
844
  await E.mutateAsync({
845
845
  groupId: n.id,
846
846
  data: {
847
- userIds: h
847
+ userIds: m
848
848
  }
849
- }), g([]), o(), a == null || a();
849
+ }), f([]), r(), s == null || s();
850
850
  } catch (y) {
851
851
  console.error("Failed to remove members:", y);
852
852
  }
853
- }, H = (y) => {
853
+ }, Z = (y) => {
854
854
  v(
855
855
  (k) => k.includes(y) ? k.filter((G) => G !== y) : [...k, y]
856
856
  );
857
857
  }, ee = (y) => {
858
- g(
858
+ f(
859
859
  (k) => k.includes(y) ? k.filter((G) => G !== y) : [...k, y]
860
860
  );
861
861
  };
862
- return /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(Ge, { open: t, onOpenChange: s, children: /* @__PURE__ */ c($e, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
862
+ return /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(Ge, { open: t, onOpenChange: a, children: /* @__PURE__ */ c($e, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
863
863
  /* @__PURE__ */ c(Ve, { children: [
864
864
  /* @__PURE__ */ e(ze, { children: n.name }),
865
865
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: [
@@ -873,8 +873,8 @@ function cr({
873
873
  " group"
874
874
  ] })
875
875
  ] }),
876
- /* @__PURE__ */ c(ma, { value: r, onValueChange: (y) => {
877
- d(y), u(""), g([]);
876
+ /* @__PURE__ */ c(ma, { value: i, onValueChange: (y) => {
877
+ u(y), p(""), f([]);
878
878
  }, className: "mt-4", children: [
879
879
  /* @__PURE__ */ c(ha, { className: "grid w-full grid-cols-2", children: [
880
880
  /* @__PURE__ */ e(_e, { value: "members", children: "Current Members" }),
@@ -888,40 +888,40 @@ function cr({
888
888
  {
889
889
  placeholder: "Search members...",
890
890
  value: l,
891
- onChange: (y) => u(y.target.value),
891
+ onChange: (y) => p(y.target.value),
892
892
  className: "pl-10"
893
893
  }
894
894
  )
895
895
  ] }),
896
- /* @__PURE__ */ e(mt, { className: h.length > 0 ? "h-[300px]" : "h-[350px]", children: m ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(ft, { className: "h-16 w-full" }, y)) }) : x.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
896
+ /* @__PURE__ */ e(mt, { className: m.length > 0 ? "h-[300px]" : "h-[350px]", children: d ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(ft, { className: "h-16 w-full" }, y)) }) : x.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
897
897
  /* @__PURE__ */ e(Ct, { className: "h-12 w-12 mb-3 opacity-50" }),
898
898
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: l ? "No members found" : "No members yet" }),
899
899
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
900
900
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: x.map((y) => /* @__PURE__ */ e(
901
- lr,
901
+ ur,
902
902
  {
903
903
  member: y,
904
- selected: h.includes(y.userId),
904
+ selected: m.includes(y.userId),
905
905
  onToggle: () => ee(y.userId)
906
906
  },
907
907
  y.id
908
908
  )) }) }),
909
- h.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-4 border-t", children: [
909
+ m.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-4 border-t", children: [
910
910
  /* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground", children: [
911
- h.length,
911
+ m.length,
912
912
  " member",
913
- h.length !== 1 ? "s" : "",
913
+ m.length !== 1 ? "s" : "",
914
914
  " selected"
915
915
  ] }),
916
916
  /* @__PURE__ */ e(
917
- A,
917
+ L,
918
918
  {
919
919
  variant: "destructive",
920
920
  size: "sm",
921
- onClick: W,
921
+ onClick: Q,
922
922
  disabled: E.isPending,
923
923
  children: E.isPending ? /* @__PURE__ */ c(T, { children: [
924
- /* @__PURE__ */ e(X, { className: "mr-2 h-4 w-4 animate-spin" }),
924
+ /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
925
925
  "Removing..."
926
926
  ] }) : /* @__PURE__ */ c(T, { children: [
927
927
  /* @__PURE__ */ e(va, { className: "mr-2 h-4 w-4" }),
@@ -939,7 +939,7 @@ function cr({
939
939
  {
940
940
  placeholder: "Search users to add...",
941
941
  value: l,
942
- onChange: (y) => u(y.target.value),
942
+ onChange: (y) => p(y.target.value),
943
943
  className: "pl-10"
944
944
  }
945
945
  )
@@ -949,28 +949,28 @@ function cr({
949
949
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
950
950
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "All eligible users are already members" })
951
951
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: z.map((y) => /* @__PURE__ */ e(
952
- dr,
952
+ mr,
953
953
  {
954
954
  user: y,
955
- selected: f.includes(y.id),
956
- onToggle: () => H(y.id)
955
+ selected: g.includes(y.id),
956
+ onToggle: () => Z(y.id)
957
957
  },
958
958
  y.id
959
959
  )) }) }),
960
- f.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-4 border-t", children: [
960
+ g.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-4 border-t", children: [
961
961
  /* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground", children: [
962
- f.length,
962
+ g.length,
963
963
  " user",
964
- f.length !== 1 ? "s" : "",
964
+ g.length !== 1 ? "s" : "",
965
965
  " selected"
966
966
  ] }),
967
967
  /* @__PURE__ */ e(
968
- A,
968
+ L,
969
969
  {
970
970
  onClick: B,
971
- disabled: D.isPending,
972
- children: D.isPending ? /* @__PURE__ */ c(T, { children: [
973
- /* @__PURE__ */ e(X, { className: "mr-2 h-4 w-4 animate-spin" }),
971
+ disabled: C.isPending,
972
+ children: C.isPending ? /* @__PURE__ */ c(T, { children: [
973
+ /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
974
974
  "Adding..."
975
975
  ] }) : /* @__PURE__ */ c(T, { children: [
976
976
  /* @__PURE__ */ e(gt, { className: "mr-2 h-4 w-4" }),
@@ -983,44 +983,44 @@ function cr({
983
983
  ] })
984
984
  ] }) }) });
985
985
  }
986
- function lr({
986
+ function ur({
987
987
  member: t,
988
- selected: s,
988
+ selected: a,
989
989
  onToggle: n
990
990
  }) {
991
- var r, d, l, u;
992
- const a = ((d = (r = t.user) == null ? void 0 : r.name) == null ? void 0 : d.split(" ").map((f) => f[0]).join("").toUpperCase()) || "?";
991
+ var i, u, l, p;
992
+ const s = ((u = (i = t.user) == null ? void 0 : i.name) == null ? void 0 : u.split(" ").map((g) => g[0]).join("").toUpperCase()) || "?";
993
993
  return /* @__PURE__ */ c(
994
994
  "div",
995
995
  {
996
996
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
997
997
  onClick: n,
998
998
  children: [
999
- /* @__PURE__ */ e(ba, { checked: s }),
1000
- /* @__PURE__ */ e(Mt, { className: "h-8 w-8", children: /* @__PURE__ */ e(At, { className: "text-xs", children: a }) }),
999
+ /* @__PURE__ */ e(ba, { checked: a }),
1000
+ /* @__PURE__ */ e(At, { className: "h-8 w-8", children: /* @__PURE__ */ e(Lt, { className: "text-xs", children: s }) }),
1001
1001
  /* @__PURE__ */ c("div", { className: "flex-1", children: [
1002
1002
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((l = t.user) == null ? void 0 : l.name) || "Unknown User" }),
1003
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = t.user) == null ? void 0 : u.email })
1003
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (p = t.user) == null ? void 0 : p.email })
1004
1004
  ] })
1005
1005
  ]
1006
1006
  }
1007
1007
  );
1008
1008
  }
1009
- function dr({
1009
+ function mr({
1010
1010
  user: t,
1011
- selected: s,
1011
+ selected: a,
1012
1012
  onToggle: n
1013
1013
  }) {
1014
- var r;
1015
- const a = ((r = t.name) == null ? void 0 : r.split(" ").map((d) => d[0]).join("").toUpperCase()) || "?";
1014
+ var i;
1015
+ const s = ((i = t.name) == null ? void 0 : i.split(" ").map((u) => u[0]).join("").toUpperCase()) || "?";
1016
1016
  return /* @__PURE__ */ c(
1017
1017
  "div",
1018
1018
  {
1019
1019
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
1020
1020
  onClick: n,
1021
1021
  children: [
1022
- /* @__PURE__ */ e(ba, { checked: s }),
1023
- /* @__PURE__ */ e(Mt, { className: "h-8 w-8", children: /* @__PURE__ */ e(At, { className: "text-xs", children: a }) }),
1022
+ /* @__PURE__ */ e(ba, { checked: a }),
1023
+ /* @__PURE__ */ e(At, { className: "h-8 w-8", children: /* @__PURE__ */ e(Lt, { className: "text-xs", children: s }) }),
1024
1024
  /* @__PURE__ */ c("div", { className: "flex-1", children: [
1025
1025
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: t.name }),
1026
1026
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: t.email })
@@ -1029,33 +1029,33 @@ function dr({
1029
1029
  }
1030
1030
  );
1031
1031
  }
1032
- function ur({
1032
+ function hr({
1033
1033
  open: t,
1034
- onOpenChange: s
1034
+ onOpenChange: a
1035
1035
  }) {
1036
- const [n, a] = S("groups"), [r, d] = S(""), [l, u] = S(null), [f, v] = S(!1), [h, g] = S(null), { tokenProps: p } = K(), { currentUser: m } = Dt(), o = Wn(), b = (m == null ? void 0 : m.type) === "tenant", C = p == null ? void 0 : p.tenantId, { groups: w, isLoading: D, refetch: E } = Ps({
1036
+ const [n, s] = N("groups"), [i, u] = N(""), [l, p] = N(null), [g, v] = N(!1), [m, f] = N(null), { tokenProps: h } = j(), { currentUser: d } = Dt(), r = Yn(), b = (d == null ? void 0 : d.type) === "tenant", D = h == null ? void 0 : h.tenantId, { groups: w, isLoading: C, refetch: E } = Ps({
1037
1037
  type: b ? "TENANT_GROUP" : "all",
1038
- tenantId: b ? C : void 0,
1038
+ tenantId: b ? D : void 0,
1039
1039
  includeMembers: !1
1040
1040
  }), O = w.filter(
1041
1041
  (x) => {
1042
1042
  var B;
1043
- return x.name.toLowerCase().includes(r.toLowerCase()) || ((B = x.description) == null ? void 0 : B.toLowerCase().includes(r.toLowerCase()));
1043
+ return x.name.toLowerCase().includes(i.toLowerCase()) || ((B = x.description) == null ? void 0 : B.toLowerCase().includes(i.toLowerCase()));
1044
1044
  }
1045
1045
  ), I = async () => {
1046
- if (h)
1046
+ if (m)
1047
1047
  try {
1048
- await o.mutateAsync(h.id), g(null), E();
1048
+ await r.mutateAsync(m.id), f(null), E();
1049
1049
  } catch (x) {
1050
1050
  console.error("Failed to delete group:", x);
1051
1051
  }
1052
1052
  }, V = (x) => {
1053
- u(x), v(!0);
1053
+ p(x), v(!0);
1054
1054
  }, z = () => {
1055
- a("groups"), E();
1055
+ s("groups"), E();
1056
1056
  };
1057
1057
  return /* @__PURE__ */ c(T, { children: [
1058
- /* @__PURE__ */ e(Ge, { open: t, onOpenChange: s, children: /* @__PURE__ */ c($e, { className: "max-h-[80vh] max-w-3xl rounded-[6px] border-border/60 sm:rounded-[6px]", children: [
1058
+ /* @__PURE__ */ e(Ge, { open: t, onOpenChange: a, children: /* @__PURE__ */ c($e, { className: "max-h-[80vh] max-w-3xl rounded-[6px] border-border/60 sm:rounded-[6px]", children: [
1059
1059
  /* @__PURE__ */ c(Ve, { children: [
1060
1060
  /* @__PURE__ */ e(ze, { className: "text-[15px]", children: "Group management" }),
1061
1061
  /* @__PURE__ */ e(wt, { className: "text-[13px] leading-5", children: "Manage groups, create new ones, and control membership." })
@@ -1064,7 +1064,7 @@ function ur({
1064
1064
  ma,
1065
1065
  {
1066
1066
  value: n,
1067
- onValueChange: a,
1067
+ onValueChange: s,
1068
1068
  className: "mt-2",
1069
1069
  children: [
1070
1070
  /* @__PURE__ */ c(ha, { className: "h-8 w-full justify-start gap-1 bg-transparent p-0 border-b border-border/60 rounded-none", children: [
@@ -1093,13 +1093,13 @@ function ur({
1093
1093
  {
1094
1094
  size: "xs",
1095
1095
  placeholder: "Search groups…",
1096
- value: r,
1097
- onChange: (x) => d(x.target.value),
1096
+ value: i,
1097
+ onChange: (x) => u(x.target.value),
1098
1098
  className: "pl-7"
1099
1099
  }
1100
1100
  )
1101
1101
  ] }),
1102
- /* @__PURE__ */ e(mt, { className: "h-[400px]", children: D ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(
1102
+ /* @__PURE__ */ e(mt, { className: "h-[400px]", children: C ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(
1103
1103
  ft,
1104
1104
  {
1105
1105
  className: "h-16 w-full rounded-[6px]"
@@ -1107,23 +1107,23 @@ function ur({
1107
1107
  x
1108
1108
  )) }) : O.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1109
1109
  /* @__PURE__ */ e("p", { className: "text-[13px]", children: "No groups found." }),
1110
- /* @__PURE__ */ e("p", { className: "mt-1 text-[12px]", children: r ? "Try a different search." : "Create your first group to get started." })
1110
+ /* @__PURE__ */ e("p", { className: "mt-1 text-[12px]", children: i ? "Try a different search." : "Create your first group to get started." })
1111
1111
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2 pr-2", children: O.map((x) => /* @__PURE__ */ e(
1112
- mr,
1112
+ pr,
1113
1113
  {
1114
1114
  group: x,
1115
1115
  onManageMembers: () => V(x),
1116
- onDelete: () => g(x),
1117
- currentUserId: m == null ? void 0 : m.id
1116
+ onDelete: () => f(x),
1117
+ currentUserId: d == null ? void 0 : d.id
1118
1118
  },
1119
1119
  x.id
1120
1120
  )) }) })
1121
1121
  ] }) }),
1122
1122
  /* @__PURE__ */ e(Ue, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1123
- Xn,
1123
+ er,
1124
1124
  {
1125
1125
  onSuccess: z,
1126
- tenantId: C,
1126
+ tenantId: D,
1127
1127
  isTenantUser: b
1128
1128
  }
1129
1129
  ) })
@@ -1132,9 +1132,9 @@ function ur({
1132
1132
  )
1133
1133
  ] }) }),
1134
1134
  l && /* @__PURE__ */ e(
1135
- cr,
1135
+ dr,
1136
1136
  {
1137
- open: f,
1137
+ open: g,
1138
1138
  onOpenChange: v,
1139
1139
  group: l,
1140
1140
  onUpdate: () => E()
@@ -1143,14 +1143,14 @@ function ur({
1143
1143
  /* @__PURE__ */ e(
1144
1144
  ya,
1145
1145
  {
1146
- open: !!h,
1147
- onOpenChange: () => g(null),
1146
+ open: !!m,
1147
+ onOpenChange: () => f(null),
1148
1148
  children: /* @__PURE__ */ c(xa, { children: [
1149
- /* @__PURE__ */ c(Sa, { children: [
1150
- /* @__PURE__ */ e(Na, { children: "Delete group" }),
1149
+ /* @__PURE__ */ c(Na, { children: [
1150
+ /* @__PURE__ */ e(Sa, { children: "Delete group" }),
1151
1151
  /* @__PURE__ */ c(wa, { children: [
1152
1152
  'Delete "',
1153
- h == null ? void 0 : h.name,
1153
+ m == null ? void 0 : m.name,
1154
1154
  `"? This removes all members and can't be undone.`
1155
1155
  ] })
1156
1156
  ] }),
@@ -1160,10 +1160,10 @@ function ur({
1160
1160
  vt,
1161
1161
  {
1162
1162
  onClick: I,
1163
- disabled: o.isPending,
1163
+ disabled: r.isPending,
1164
1164
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1165
- children: o.isPending ? /* @__PURE__ */ c(T, { children: [
1166
- /* @__PURE__ */ e(X, { className: "h-3.5 w-3.5 animate-spin" }),
1165
+ children: r.isPending ? /* @__PURE__ */ c(T, { children: [
1166
+ /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }),
1167
1167
  "Deleting…"
1168
1168
  ] }) : "Delete group"
1169
1169
  }
@@ -1174,13 +1174,13 @@ function ur({
1174
1174
  )
1175
1175
  ] });
1176
1176
  }
1177
- function mr({
1177
+ function pr({
1178
1178
  group: t,
1179
- onManageMembers: s,
1179
+ onManageMembers: a,
1180
1180
  onDelete: n,
1181
- currentUserId: a
1181
+ currentUserId: s
1182
1182
  }) {
1183
- const r = t.createdBy === a;
1183
+ const i = t.createdBy === s;
1184
1184
  return /* @__PURE__ */ e("div", { className: "rounded-[6px] border border-border/60 bg-card px-3 py-2.5 transition-colors hover:bg-muted/30", children: /* @__PURE__ */ c("div", { className: "flex items-start justify-between gap-2", children: [
1185
1185
  /* @__PURE__ */ c("div", { className: "min-w-0 flex-1 space-y-1", children: [
1186
1186
  /* @__PURE__ */ e("h4", { className: "text-[13px] font-medium text-foreground", children: t.name }),
@@ -1194,25 +1194,25 @@ function mr({
1194
1194
  ] }),
1195
1195
  /* @__PURE__ */ c("span", { children: [
1196
1196
  "Created ",
1197
- xn(new Date(t.createdAt), "MMM d, yyyy")
1197
+ Sn(new Date(t.createdAt), "MMM d, yyyy")
1198
1198
  ] })
1199
1199
  ] })
1200
1200
  ] }),
1201
1201
  /* @__PURE__ */ c("div", { className: "flex shrink-0 items-center gap-0.5", children: [
1202
1202
  /* @__PURE__ */ e(
1203
- A,
1203
+ L,
1204
1204
  {
1205
1205
  variant: "ghost",
1206
1206
  size: "xs",
1207
1207
  className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
1208
- onClick: s,
1208
+ onClick: a,
1209
1209
  title: "Manage members",
1210
1210
  "aria-label": "Manage members",
1211
1211
  children: /* @__PURE__ */ e(gt, { className: "h-3.5 w-3.5" })
1212
1212
  }
1213
1213
  ),
1214
- r && /* @__PURE__ */ e(
1215
- A,
1214
+ i && /* @__PURE__ */ e(
1215
+ L,
1216
1216
  {
1217
1217
  variant: "ghost",
1218
1218
  size: "xs",
@@ -1226,108 +1226,108 @@ function mr({
1226
1226
  ] })
1227
1227
  ] }) });
1228
1228
  }
1229
- function ce(t, s, n) {
1230
- var d, l;
1231
- const a = (t.controls || []).find(
1232
- (u) => u.id === n
1229
+ function ce(t, a, n) {
1230
+ var u, l;
1231
+ const s = (t.controls || []).find(
1232
+ (p) => p.id === n
1233
1233
  );
1234
- if (a)
1235
- return a.label;
1236
- const r = (l = (d = pa(t, s)) == null ? void 0 : d.controls) == null ? void 0 : l.find(
1237
- (u) => u.id === n
1234
+ if (s)
1235
+ return s.label;
1236
+ const i = (l = (u = pa(t, a)) == null ? void 0 : u.controls) == null ? void 0 : l.find(
1237
+ (p) => p.id === n
1238
1238
  );
1239
- return (r == null ? void 0 : r.label) || n;
1239
+ return (i == null ? void 0 : i.label) || n;
1240
1240
  }
1241
- function le(t, s) {
1241
+ function le(t, a) {
1242
1242
  var n;
1243
- return ((n = pa(t, s)) == null ? void 0 : n.title) || s;
1243
+ return ((n = pa(t, a)) == null ? void 0 : n.title) || a;
1244
1244
  }
1245
- function hr(t) {
1246
- const { errors: s, dashboard: n } = t;
1245
+ function fr(t) {
1246
+ const { errors: a, dashboard: n } = t;
1247
1247
  if (!n)
1248
- return s;
1249
- const a = /* @__PURE__ */ new Map();
1250
- for (const r of s) {
1251
- const d = r.match(
1248
+ return a;
1249
+ const s = /* @__PURE__ */ new Map();
1250
+ for (const i of a) {
1251
+ const u = i.match(
1252
1252
  /^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
1253
1253
  );
1254
- if (d) {
1255
- const [, h, g] = d, p = `${h}:${g}:missing-metric`;
1256
- a.has(p) || a.set(
1257
- p,
1258
- `"${le(n, h)}" has an outdated "${ce(
1254
+ if (u) {
1255
+ const [, m, f] = u, h = `${m}:${f}:missing-metric`;
1256
+ s.has(h) || s.set(
1257
+ h,
1258
+ `"${le(n, m)}" has an outdated "${ce(
1259
1259
  n,
1260
- h,
1261
- g
1260
+ m,
1261
+ f
1262
1262
  )}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
1263
1263
  );
1264
1264
  continue;
1265
1265
  }
1266
- const l = r.match(
1266
+ const l = i.match(
1267
1267
  /^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
1268
1268
  );
1269
1269
  if (l) {
1270
- const [, h, g] = l, p = `${h}:${g}:missing-group-by`;
1271
- a.has(p) || a.set(
1272
- p,
1273
- `"${le(n, h)}" has an outdated "${ce(
1270
+ const [, m, f] = l, h = `${m}:${f}:missing-group-by`;
1271
+ s.has(h) || s.set(
1272
+ h,
1273
+ `"${le(n, m)}" has an outdated "${ce(
1274
1274
  n,
1275
- h,
1276
- g
1275
+ m,
1276
+ f
1277
1277
  )}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
1278
1278
  );
1279
1279
  continue;
1280
1280
  }
1281
- const u = r.match(
1281
+ const p = i.match(
1282
1282
  /^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
1283
1283
  );
1284
- if (u) {
1285
- const [, h, g] = u, p = `${h}:${g}:invalid-metric`;
1286
- a.has(p) || a.set(
1287
- p,
1288
- `"${le(n, h)}" has an invalid "${ce(
1284
+ if (p) {
1285
+ const [, m, f] = p, h = `${m}:${f}:invalid-metric`;
1286
+ s.has(h) || s.set(
1287
+ h,
1288
+ `"${le(n, m)}" has an invalid "${ce(
1289
1289
  n,
1290
- h,
1291
- g
1290
+ m,
1291
+ f
1292
1292
  )}" metric mapping. Open the card controls and choose a valid metric for each option.`
1293
1293
  );
1294
1294
  continue;
1295
1295
  }
1296
- const f = r.match(
1296
+ const g = i.match(
1297
1297
  /^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
1298
1298
  );
1299
- if (f) {
1300
- const [, h, g] = f, p = `${h}:${g}:invalid-group-by`;
1301
- a.has(p) || a.set(
1302
- p,
1303
- `"${le(n, h)}" has an invalid "${ce(
1299
+ if (g) {
1300
+ const [, m, f] = g, h = `${m}:${f}:invalid-group-by`;
1301
+ s.has(h) || s.set(
1302
+ h,
1303
+ `"${le(n, m)}" has an invalid "${ce(
1304
1304
  n,
1305
- h,
1306
- g
1305
+ m,
1306
+ f
1307
1307
  )}" field mapping. Open the card controls and choose a valid field for each option.`
1308
1308
  );
1309
1309
  continue;
1310
1310
  }
1311
- const v = r.match(
1311
+ const v = i.match(
1312
1312
  /^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
1313
1313
  );
1314
1314
  if (v) {
1315
- const [, h, g] = v, p = `${h}:${g}:missing-temporal-group-by`;
1316
- a.has(p) || a.set(
1317
- p,
1318
- `"${le(n, h)}" can no longer use "${ce(
1315
+ const [, m, f] = v, h = `${m}:${f}:missing-temporal-group-by`;
1316
+ s.has(h) || s.set(
1317
+ h,
1318
+ `"${le(n, m)}" can no longer use "${ce(
1319
1319
  n,
1320
- h,
1321
- g
1320
+ m,
1321
+ f
1322
1322
  )}" for time grain because the card does not currently group by a date field.`
1323
1323
  );
1324
1324
  continue;
1325
1325
  }
1326
- a.set(r, r);
1326
+ s.set(i, i);
1327
1327
  }
1328
- return Array.from(a.values());
1328
+ return Array.from(s.values());
1329
1329
  }
1330
- const pr = [
1330
+ const gr = [
1331
1331
  "enum",
1332
1332
  "multi_enum",
1333
1333
  "text",
@@ -1335,69 +1335,76 @@ const pr = [
1335
1335
  "boolean",
1336
1336
  "date"
1337
1337
  ];
1338
- function fr({
1338
+ function vr({
1339
1339
  open: t,
1340
- onOpenChange: s,
1340
+ onOpenChange: a,
1341
1341
  initialMode: n = "manage"
1342
1342
  }) {
1343
1343
  var z;
1344
- const a = n === "create", {
1345
- forceClose: r,
1346
- handleOpenChange: d,
1344
+ const s = n === "create", {
1345
+ forceClose: i,
1346
+ handleOpenChange: u,
1347
1347
  isCreateFlowActive: l,
1348
- preventPassiveDismissDuringCreate: u,
1349
- resolvedOpen: f,
1348
+ preventPassiveDismissDuringCreate: p,
1349
+ resolvedOpen: g,
1350
1350
  setIsCreateFlowActive: v
1351
- } = Dn({
1351
+ } = En({
1352
1352
  open: t,
1353
- onOpenChange: s,
1353
+ onOpenChange: a,
1354
1354
  initialCreateFlowActive: n === "create",
1355
1355
  dismissMode: "explicit-only"
1356
- }), h = N((x) => x.dashboard), g = N((x) => x.selectedSheetId), { updateSheetDocument: p } = Nt(), m = (z = h.sheets) == null ? void 0 : z.find(
1357
- (x) => x.id === g
1358
- ), o = (m == null ? void 0 : m.kind) === "document" && !!m.document, b = F(
1359
- () => o && (m != null && m.document) ? m.document.inputs || [] : [],
1360
- [o, m == null ? void 0 : m.document]
1361
- ), C = F(
1356
+ }), m = S((x) => x.dashboard), f = S((x) => x.selectedSheetId), { setDashboardInputs: h } = St(), d = (z = m.sheets) == null ? void 0 : z.find(
1357
+ (x) => x.id === f
1358
+ ), r = (d == null ? void 0 : d.kind) === "document" && !!d.document, b = F(
1359
+ () => r && (d != null && d.document) ? Ts(m, d.id) : [],
1360
+ [m, r, d == null ? void 0 : d.document, d == null ? void 0 : d.id]
1361
+ ), D = F(
1362
1362
  () => b.filter(
1363
1363
  (x) => x.kind === "control"
1364
1364
  ),
1365
1365
  [b]
1366
1366
  ), w = F(
1367
- () => C.map((x) => x.control),
1368
- [C]
1369
- ), D = F(
1370
- () => vr(w),
1367
+ () => D.map((x) => x.control),
1368
+ [D]
1369
+ ), C = F(
1370
+ () => yr(w),
1371
1371
  [w]
1372
1372
  ), E = F(
1373
- () => gr(h),
1374
- [h]
1373
+ () => br(m),
1374
+ [m]
1375
1375
  ), O = Fe(() => {
1376
- if (a) {
1377
- r();
1376
+ if (s) {
1377
+ i();
1378
1378
  return;
1379
1379
  }
1380
1380
  v(!1);
1381
- }, [a, r, v]), I = Fe(
1382
- (x, B, W) => {
1383
- !o || !(m != null && m.document) || p(m.id, (H) => ({
1384
- ...H,
1385
- inputs: yr({
1386
- currentInputs: H.inputs || [],
1381
+ }, [s, i, v]), I = Fe(
1382
+ (x, B, Q) => {
1383
+ !r || !(d != null && d.document) || h(
1384
+ Nr({
1385
+ allInputs: m.inputs || [],
1386
+ documentSheetId: d.id,
1387
+ currentDocumentInputs: b,
1387
1388
  nextControls: x,
1388
1389
  nextDefaultValues: B,
1389
- change: W
1390
+ change: Q
1390
1391
  })
1391
- }));
1392
+ );
1392
1393
  },
1393
- [o, m, p]
1394
+ [
1395
+ m.inputs,
1396
+ b,
1397
+ r,
1398
+ d,
1399
+ h
1400
+ ]
1394
1401
  );
1395
- return !o || !(m != null && m.document) ? null : /* @__PURE__ */ e(Ge, { open: f, onOpenChange: d, children: /* @__PURE__ */ c(
1402
+ return !r || !(d != null && d.document) ? null : /* @__PURE__ */ e(Ge, { open: g, onOpenChange: u, children: /* @__PURE__ */ c(
1396
1403
  $e,
1397
1404
  {
1398
1405
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1399
- onEscapeKeyDown: u,
1400
- onPointerDownOutside: u,
1406
+ onEscapeKeyDown: p,
1407
+ onPointerDownOutside: p,
1401
1408
  children: [
1402
1409
  /* @__PURE__ */ c(Ve, { className: l ? "space-y-0" : void 0, children: [
1403
1410
  /* @__PURE__ */ e(ze, { className: "text-[15px]", children: l ? "Add document control" : "Document Controls" }),
@@ -1410,18 +1417,18 @@ function fr({
1410
1417
  )
1411
1418
  ] }),
1412
1419
  /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
1413
- Cn,
1420
+ In,
1414
1421
  {
1415
1422
  scope: "dashboard",
1416
1423
  controls: w,
1417
1424
  reservedControlIds: E,
1418
- defaultValues: D,
1425
+ defaultValues: C,
1419
1426
  usageByControlId: {},
1420
1427
  availableFieldChoices: [],
1421
1428
  availableMetricChoices: [],
1422
1429
  structuralParticipants: [],
1423
1430
  structuralParticipantIdsByControlId: {},
1424
- allowedControlTypes: pr,
1431
+ allowedControlTypes: gr,
1425
1432
  initialCreateFlow: n === "create",
1426
1433
  onCreateFlowActiveChange: v,
1427
1434
  onCreateFlowComplete: O,
@@ -1433,158 +1440,176 @@ function fr({
1433
1440
  }
1434
1441
  ) });
1435
1442
  }
1436
- function gr(t) {
1437
- return (t.controls || []).map((s) => s.id);
1443
+ function br(t) {
1444
+ return (t.controls || []).map((a) => a.id);
1438
1445
  }
1439
- function vr(t) {
1440
- const s = {};
1446
+ function yr(t) {
1447
+ const a = {};
1441
1448
  for (const n of t)
1442
- n.defaultValue !== void 0 && (s[n.id] = n.defaultValue);
1443
- return s;
1449
+ n.defaultValue !== void 0 && (a[n.id] = n.defaultValue);
1450
+ return a;
1444
1451
  }
1445
- function br(t, s) {
1446
- return s ? Object.prototype.hasOwnProperty.call(s, t.id) ? {
1452
+ function xr(t, a) {
1453
+ return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
1447
1454
  ...t,
1448
- defaultValue: s[t.id]
1455
+ defaultValue: a[t.id]
1449
1456
  } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
1450
1457
  }
1451
- function yr({
1452
- currentInputs: t,
1458
+ function Nr({
1459
+ allInputs: t,
1460
+ documentSheetId: a,
1461
+ currentDocumentInputs: n,
1453
1462
  nextControls: s,
1454
- nextDefaultValues: n,
1455
- change: a
1463
+ nextDefaultValues: i,
1464
+ change: u
1456
1465
  }) {
1457
- const r = new Map(
1458
- s.map((f) => [
1459
- f.id,
1460
- br(f, n)
1466
+ const l = new Map(
1467
+ s.map((h) => [
1468
+ h.id,
1469
+ xr(h, i)
1461
1470
  ])
1462
- ), d = (a == null ? void 0 : a.type) === "rename" ? { oldId: a.oldId, newId: a.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
1463
- for (const f of t) {
1464
- if (f.kind !== "control") {
1465
- u.push(f);
1471
+ ), p = (u == null ? void 0 : u.type) === "rename" ? { oldId: u.oldId, newId: u.newId } : null, g = /* @__PURE__ */ new Set(), v = [];
1472
+ for (const h of n) {
1473
+ if (h.kind !== "control") {
1474
+ v.push(h);
1466
1475
  continue;
1467
1476
  }
1468
- const v = r.get(f.control.id) || ((d == null ? void 0 : d.oldId) === f.control.id ? r.get(d.newId) : void 0);
1469
- v && (l.add(v.id), u.push({
1470
- ...f,
1471
- label: v.label,
1472
- requiredAtExecution: v.requiredAtExecution,
1473
- control: v
1474
- }));
1477
+ const d = l.get(h.control.id) || ((p == null ? void 0 : p.oldId) === h.control.id ? l.get(p.newId) : void 0);
1478
+ if (!d)
1479
+ continue;
1480
+ g.add(d.id);
1481
+ const r = _s(
1482
+ d.id,
1483
+ [...t, ...v].filter(
1484
+ (D) => D.id !== h.id
1485
+ )
1486
+ ), b = d.id === r ? d : { ...d, id: r };
1487
+ v.push({
1488
+ ...h,
1489
+ label: b.label,
1490
+ variableName: r,
1491
+ requiredAtExecution: b.requiredAtExecution,
1492
+ control: b
1493
+ });
1475
1494
  }
1476
- for (const f of r.values())
1477
- l.has(f.id) || u.push(
1478
- Ts({
1479
- control: f,
1480
- existingInputs: u
1495
+ for (const h of l.values())
1496
+ g.has(h.id) || v.push(
1497
+ Us({
1498
+ control: h,
1499
+ existingInputs: [...t, ...v],
1500
+ sheetId: a
1481
1501
  })
1482
1502
  );
1483
- return u;
1503
+ const m = new Set(
1504
+ n.map((h) => h.id)
1505
+ );
1506
+ return [...t.filter(
1507
+ (h) => !m.has(h.id)
1508
+ ), ...v];
1484
1509
  }
1485
- function la(t, s) {
1510
+ function la(t, a) {
1486
1511
  return {
1487
1512
  dashboard: bt(t),
1488
- semanticExecutionPayload: bt(s)
1513
+ semanticExecutionPayload: bt(a)
1489
1514
  };
1490
1515
  }
1491
- function _r() {
1516
+ function Fr() {
1492
1517
  var Qt, Wt, Jt, Yt, Xt, Zt;
1493
- mn(), hn();
1518
+ pn(), fn();
1494
1519
  const {
1495
1520
  authToken: t,
1496
- tokenProps: s,
1521
+ tokenProps: a,
1497
1522
  id: n
1498
- } = K(), { isLocalDev: a } = _s(), { openBrandStudioPreview: r } = Us(), { permissions: d } = qn(), l = Fs(), { isLoading: u } = Rs(), f = N((i) => i.theme), v = N((i) => i.isDownloadingPdf), h = N(
1499
- (i) => i.dashboardAssistantDraftScopeKey
1500
- ), g = N((i) => i.lenses), p = N((i) => i.selectedLensId), m = g == null ? void 0 : g.find((i) => i.id === p), o = N((i) => i.dashboard), b = N((i) => i.selectedSheetId), C = (Qt = o == null ? void 0 : o.sheets) == null ? void 0 : Qt.find(
1501
- (i) => i.id === b
1502
- ), w = ms(C), D = w ? (Wt = C == null ? void 0 : C.document) == null ? void 0 : Wt.page : void 0, E = N(
1503
- (i) => i.isDashboardEditing
1504
- ), { setDashboardTitle: O } = N((i) => i.actions), [I, V] = S(!1), [z, x] = S(!1), [B, W] = S(!1), [H, ee] = S(!1), [y, k] = S(!1), [G, j] = S(!1), [me, te] = S(!1), [Ua, Lt] = S(!1), [He, he] = S(null), [Fa, pe] = S(!1), [fe, ge] = S(null), [Ot, ve] = S([]), [kt, be] = S(!1), Ra = N((i) => i.isDashboardPanelOpen), Ga = N(
1505
- (i) => i.actions.setIsDashboardPanelOpen
1506
- ), $a = N((i) => i.filterValues), _ = N((i) => i.isVisualEditing);
1507
- ta((i) => i.card);
1523
+ } = j(), { isLocalDev: s } = Fs(), { openBrandStudioPreview: i } = Rs(), { permissions: u } = Hn(), l = Gs(), { isLoading: p } = $s(), g = S((o) => o.theme), v = S((o) => o.isDownloadingPdf), m = S(
1524
+ (o) => o.dashboardAssistantDraftScopeKey
1525
+ ), f = S((o) => o.lenses), h = S((o) => o.selectedLensId), d = f == null ? void 0 : f.find((o) => o.id === h), r = S((o) => o.dashboard), b = S((o) => o.selectedSheetId), D = (Qt = r == null ? void 0 : r.sheets) == null ? void 0 : Qt.find(
1526
+ (o) => o.id === b
1527
+ ), w = ms(D), C = w ? (Wt = D == null ? void 0 : D.document) == null ? void 0 : Wt.page : void 0, E = S(
1528
+ (o) => o.isDashboardEditing
1529
+ ), { setDashboardTitle: O } = S((o) => o.actions), [I, V] = N(!1), [z, x] = N(!1), [B, Q] = N(!1), [Z, ee] = N(!1), [y, k] = N(!1), [G, H] = N(!1), [me, te] = N(!1), [Ua, Mt] = N(!1), [He, he] = N(null), [Fa, pe] = N(!1), [fe, ge] = N(null), [Ot, ve] = N([]), [kt, be] = N(!1), Ra = S((o) => o.isDashboardPanelOpen), Ga = S(
1530
+ (o) => o.actions.setIsDashboardPanelOpen
1531
+ ), $a = S((o) => o.filterValues), _ = S((o) => o.isVisualEditing);
1532
+ ta((o) => o.card);
1508
1533
  const ae = ke(
1509
- (i) => i.selectedDashboard
1534
+ (o) => o.selectedDashboard
1510
1535
  ), ye = ke(
1511
- (i) => i.initialDashboard
1536
+ (o) => o.initialDashboard
1512
1537
  );
1513
- ke((i) => i.selectedVisual), N((i) => i.selectedFrameId), ta((i) => i.frame);
1514
- const xe = ae ? (Yt = ae == null ? void 0 : ae.permissions) == null ? void 0 : Yt.canEdit : (Jt = ye == null ? void 0 : ye.permissions) == null ? void 0 : Jt.canEdit, Se = N((i) => i.showFilters), Pt = Gs((i) => i.setPanelOpen), Tt = N(
1515
- (i) => i.showDashboardJSON
1516
- ), je = N((i) => i.onSaveFunction), _t = N(
1517
- (i) => i.actions.setShowFilters
1538
+ ke((o) => o.selectedVisual), S((o) => o.selectedFrameId), ta((o) => o.frame);
1539
+ const xe = ae ? (Yt = ae == null ? void 0 : ae.permissions) == null ? void 0 : Yt.canEdit : (Jt = ye == null ? void 0 : ye.permissions) == null ? void 0 : Jt.canEdit, Ne = S((o) => o.showFilters), Pt = Vs((o) => o.setPanelOpen), Tt = S(
1540
+ (o) => o.showDashboardJSON
1541
+ ), je = S((o) => o.onSaveFunction), _t = S(
1542
+ (o) => o.actions.setShowFilters
1518
1543
  ), {
1519
1544
  setDocumentInspectorTab: Ut,
1520
1545
  setIsDashboardEditing: Ft,
1521
1546
  setShowDashboardJSON: Rt
1522
- } = N((i) => i.actions), { setInitialDashboard: Gt, clearSelectedDashboard: Ke } = ke(
1523
- (i) => i.actions
1524
- ), { resources: Ne } = $s(nt.DASHBOARD), { data: Qe } = Vs(), Va = ((Xt = Qe == null ? void 0 : Qe.preference) == null ? void 0 : Xt.defaultDashboardId) || null, { mutate: za, isPending: qa } = zs(), { currentUser: Ba } = Dt(), Ha = qs(Ba), J = ae || ye, $t = J ? {
1525
- id: J.id,
1526
- title: (o == null ? void 0 : o.title) || J.title || "Dashboard"
1527
- } : null, { handleAddNewFrame: ja } = Bs(), [We, Je] = S(!1), [Ka, se] = S(!1), [Ye, we] = S("close"), ne = Hs(nt.DASHBOARD), [R, De] = S(null), Vt = Fe((i) => {
1547
+ } = S((o) => o.actions), { setInitialDashboard: Gt, clearSelectedDashboard: Ke } = ke(
1548
+ (o) => o.actions
1549
+ ), { resources: Se } = zs(nt.DASHBOARD), { data: Qe } = qs(), Va = ((Xt = Qe == null ? void 0 : Qe.preference) == null ? void 0 : Xt.defaultDashboardId) || null, { mutate: za, isPending: qa } = Bs(), { currentUser: Ba } = Dt(), Ha = Hs(Ba), W = ae || ye, $t = W ? {
1550
+ id: W.id,
1551
+ title: (r == null ? void 0 : r.title) || W.title || "Dashboard"
1552
+ } : null, { handleAddNewFrame: ja } = js(), [We, Je] = N(!1), [Ka, se] = N(!1), [Ye, we] = N("close"), ne = Ks(nt.DASHBOARD), [R, De] = N(null), Vt = Fe((o) => {
1528
1553
  window.setTimeout(() => {
1529
- he(i);
1554
+ he(o);
1530
1555
  }, 0);
1531
- }, []), Qa = async (i, P) => {
1532
- if (!(o != null && o.id)) {
1556
+ }, []), Qa = async (o, P) => {
1557
+ if (!(r != null && r.id)) {
1533
1558
  console.log("No dashboard ID found");
1534
1559
  return;
1535
1560
  }
1536
1561
  console.log("Updating dashboard title:", {
1537
- dashboardId: o.id,
1538
- newTitle: i,
1562
+ dashboardId: r.id,
1563
+ newTitle: o,
1539
1564
  previousTitle: P
1540
1565
  }), ne.mutate(
1541
1566
  {
1542
- resourceId: o.id,
1543
- data: { title: i }
1567
+ resourceId: r.id,
1568
+ data: { title: o }
1544
1569
  },
1545
1570
  {
1546
1571
  onSuccess: () => {
1547
- console.log("Dashboard title updated successfully"), M.success("Dashboard title updated");
1572
+ console.log("Dashboard title updated successfully"), A.success("Dashboard title updated");
1548
1573
  },
1549
1574
  onError: (q) => {
1550
- console.error("Failed to update dashboard title:", q), M.error("Failed to update dashboard title"), O(P);
1575
+ console.error("Failed to update dashboard title:", q), A.error("Failed to update dashboard title"), O(P);
1551
1576
  }
1552
1577
  }
1553
1578
  );
1554
1579
  };
1555
1580
  ot(() => {
1556
- if (Ne && Ne.length > 0) {
1557
- const i = o == null ? void 0 : o.id;
1558
- if (i) {
1559
- const P = Ne.find(
1560
- (q) => q.id === i
1581
+ if (Se && Se.length > 0) {
1582
+ const o = r == null ? void 0 : r.id;
1583
+ if (o) {
1584
+ const P = Se.find(
1585
+ (q) => q.id === o
1561
1586
  );
1562
1587
  P && Gt(P);
1563
1588
  }
1564
1589
  }
1565
- }, [Ne, o == null ? void 0 : o.id, Gt]);
1566
- const re = s.orgUserId || s.tenantId, Xe = F(
1567
- () => xr({
1590
+ }, [Se, r == null ? void 0 : r.id, Gt]);
1591
+ const re = a.orgUserId || a.tenantId, Xe = F(
1592
+ () => Sr({
1568
1593
  accessToken: t == null ? void 0 : t.accessToken,
1569
- dashboardId: (o == null ? void 0 : o.id) || n || s.dashboard_id,
1594
+ dashboardId: (r == null ? void 0 : r.id) || n || a.dashboard_id,
1570
1595
  selectedSheetId: w ? b : void 0,
1571
- pageSize: D == null ? void 0 : D.size,
1572
- orientation: D == null ? void 0 : D.orientation,
1573
- theme: f
1596
+ pageSize: C == null ? void 0 : C.size,
1597
+ orientation: C == null ? void 0 : C.orientation,
1598
+ theme: g
1574
1599
  }),
1575
1600
  [
1576
1601
  t == null ? void 0 : t.accessToken,
1577
1602
  n,
1578
- o == null ? void 0 : o.id,
1603
+ r == null ? void 0 : r.id,
1579
1604
  w,
1580
- D == null ? void 0 : D.orientation,
1581
- D == null ? void 0 : D.size,
1605
+ C == null ? void 0 : C.orientation,
1606
+ C == null ? void 0 : C.size,
1582
1607
  b,
1583
- f,
1584
- s.dashboard_id
1608
+ g,
1609
+ a.dashboard_id
1585
1610
  ]
1586
- ), zt = E && !_ && re && xe, { setDashboard: Ze } = N((i) => i.actions), et = N(
1587
- (i) => i.semanticExecutionPayload
1611
+ ), zt = E && !_ && re && xe, { setDashboard: Ze } = S((o) => o.actions), et = S(
1612
+ (o) => o.semanticExecutionPayload
1588
1613
  ), Wa = () => {
1589
1614
  Ft(!0);
1590
1615
  }, tt = () => {
@@ -1595,26 +1620,26 @@ function _r() {
1595
1620
  R && De(null);
1596
1621
  return;
1597
1622
  }
1598
- R || !o || u || De(
1623
+ R || !r || p || De(
1599
1624
  la(
1600
- o,
1625
+ r,
1601
1626
  et
1602
1627
  )
1603
1628
  );
1604
1629
  }, [
1605
- o,
1630
+ r,
1606
1631
  R,
1607
1632
  E,
1608
- u,
1633
+ p,
1609
1634
  et
1610
1635
  ]);
1611
- const Ce = (R == null ? void 0 : R.dashboard) ?? null, { isDirty: qt, isDirtyPending: Ja, resetDirty: Ee } = wn(
1612
- o,
1636
+ const Ce = (R == null ? void 0 : R.dashboard) ?? null, { isDirty: qt, isDirtyPending: Ja, resetDirty: Ee } = Cn(
1637
+ r,
1613
1638
  Ce,
1614
1639
  300,
1615
1640
  1e3,
1616
1641
  it
1617
- ), Bt = Fe(() => Ce ? it(o) !== it(Ce) : !1, [o, Ce]), Ht = qt || Ja, Ie = We || ne.isPending, Ya = () => {
1642
+ ), Bt = Fe(() => Ce ? it(r) !== it(Ce) : !1, [r, Ce]), Ht = qt || Ja, Ie = We || ne.isPending, Ya = () => {
1618
1643
  Bt() ? (we("close"), se(!0)) : (tt(), Ee());
1619
1644
  }, Xa = async () => {
1620
1645
  await at({
@@ -1636,11 +1661,11 @@ function _r() {
1636
1661
  }
1637
1662
  Ke();
1638
1663
  };
1639
- async function at(i) {
1640
- const P = N.getState().dashboard;
1664
+ async function at(o) {
1665
+ const P = S.getState().dashboard;
1641
1666
  if (!P)
1642
1667
  return;
1643
- const q = (i == null ? void 0 : i.closeAfterSave) ?? kt, os = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
1668
+ const q = (o == null ? void 0 : o.closeAfterSave) ?? kt, os = (o == null ? void 0 : o.navigateHomeAfterSave) ?? !1;
1644
1669
  be(q), q && se(!1);
1645
1670
  const is = bt(P);
1646
1671
  pe(!0), ge(null), ve([]), Je(!0);
@@ -1654,70 +1679,70 @@ function _r() {
1654
1679
  },
1655
1680
  {
1656
1681
  onSuccess: (U) => {
1657
- var Ae, Le, ea;
1658
- const Q = (U == null ? void 0 : U.id) || ((Ae = U == null ? void 0 : U.dashboard) == null ? void 0 : Ae.id) || ((Le = U == null ? void 0 : U.resource) == null ? void 0 : Le.id) || ((ea = U == null ? void 0 : U.template) == null ? void 0 : ea.id) || null;
1659
- if (!P.id && Q) {
1682
+ var Le, Me, ea;
1683
+ const K = (U == null ? void 0 : U.id) || ((Le = U == null ? void 0 : U.dashboard) == null ? void 0 : Le.id) || ((Me = U == null ? void 0 : U.resource) == null ? void 0 : Me.id) || ((ea = U == null ? void 0 : U.template) == null ? void 0 : ea.id) || null;
1684
+ if (!P.id && K) {
1660
1685
  const st = bs.getState(), Oe = st.pendingDashboardDraftMigration;
1661
- (Oe == null ? void 0 : Oe.scopeKey) === h ? st.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1662
- Q
1686
+ (Oe == null ? void 0 : Oe.scopeKey) === m ? st.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1687
+ K
1663
1688
  ) : Oe && st.actions.clearPendingDashboardDraftMigration();
1664
1689
  }
1665
- Je(!1), M.success("Dashboard saved!"), De(
1690
+ Je(!1), A.success("Dashboard saved!"), De(
1666
1691
  la(
1667
1692
  is,
1668
- N.getState().semanticExecutionPayload
1693
+ S.getState().semanticExecutionPayload
1669
1694
  )
1670
1695
  ), pe(!1), be(!1), q && (tt(), Ee(), os && Ke()), we("close");
1671
1696
  },
1672
1697
  onError: (U) => {
1673
1698
  Je(!1), ge("Failed to save dashboard. Please try again.");
1674
- const Q = U.details, Ae = Array.isArray(
1675
- Q == null ? void 0 : Q.errors
1676
- ) ? (Q.errors || []).filter(
1677
- (Le) => typeof Le == "string"
1699
+ const K = U.details, Le = Array.isArray(
1700
+ K == null ? void 0 : K.errors
1701
+ ) ? (K.errors || []).filter(
1702
+ (Me) => typeof Me == "string"
1678
1703
  ) : [];
1679
1704
  ve(
1680
- hr({
1681
- errors: Ae,
1705
+ fr({
1706
+ errors: Le,
1682
1707
  dashboard: P || void 0
1683
1708
  })
1684
- ), M.error("Failed to save dashboard");
1709
+ ), A.error("Failed to save dashboard");
1685
1710
  }
1686
1711
  }
1687
1712
  );
1688
1713
  }
1689
1714
  async function as() {
1690
- if (V(!0), !p || !m) return;
1691
- const i = N.getState().dashboard;
1692
- if (!i) {
1715
+ if (V(!0), !h || !d) return;
1716
+ const o = S.getState().dashboard;
1717
+ if (!o) {
1693
1718
  V(!1);
1694
1719
  return;
1695
1720
  }
1696
- const P = JSON.stringify(i), q = {
1697
- ...m,
1721
+ const P = JSON.stringify(o), q = {
1722
+ ...d,
1698
1723
  template: P,
1699
1724
  filterValues: $a
1700
1725
  };
1701
1726
  await xt(
1702
- s.apiServiceUrl,
1727
+ a.apiServiceUrl,
1703
1728
  q,
1704
1729
  t == null ? void 0 : t.accessToken
1705
- ), M.success("Lens saved"), je == null || je(i), V(!1);
1730
+ ), A.success("Lens saved"), je == null || je(o), V(!1);
1706
1731
  }
1707
- const jt = (m == null ? void 0 : m.name) || o.title, oe = !!(o != null && o.id);
1732
+ const jt = (d == null ? void 0 : d.name) || r.title, oe = !!(r != null && r.id);
1708
1733
  ne.isPending && console.log("Title during update:", {
1709
1734
  title: jt,
1710
- dashboardStateTitle: o.title,
1711
- dashboardId: o == null ? void 0 : o.id,
1712
- currentLensName: m == null ? void 0 : m.name
1735
+ dashboardStateTitle: r.title,
1736
+ dashboardId: r == null ? void 0 : r.id,
1737
+ currentLensName: d == null ? void 0 : d.name
1713
1738
  });
1714
- const Kt = s.orgUserId || s.tenantId && s.endUserId && s.endUserEmail, ss = !!Kt && !!(t != null && t.accessToken) && !!(s != null && s.apiServiceUrl);
1739
+ const Kt = a.orgUserId || a.tenantId && a.endUserId && a.endUserEmail, ss = !!Kt && !!(t != null && t.accessToken) && !!(a != null && a.apiServiceUrl);
1715
1740
  ot(() => {
1716
- !oe && H && ee(!1);
1717
- }, [oe, H]);
1718
- const ns = l, ie = (o == null ? void 0 : o.id) || null, Me = !!ie && Va === ie, rs = () => {
1741
+ !oe && Z && ee(!1);
1742
+ }, [oe, Z]);
1743
+ const ns = l, ie = (r == null ? void 0 : r.id) || null, Ae = !!ie && Va === ie, rs = () => {
1719
1744
  ie && za({
1720
- dashboardId: Me ? null : ie
1745
+ dashboardId: Ae ? null : ie
1721
1746
  });
1722
1747
  };
1723
1748
  return /* @__PURE__ */ c(
@@ -1738,7 +1763,7 @@ function _r() {
1738
1763
  },
1739
1764
  className: "h-7 w-7 px-0",
1740
1765
  buttonProps: { size: "xs" },
1741
- children: /* @__PURE__ */ e(An, { className: "h-3.5 w-3.5" })
1766
+ children: /* @__PURE__ */ e(On, { className: "h-3.5 w-3.5" })
1742
1767
  }
1743
1768
  ),
1744
1769
  ns && !_ && /* @__PURE__ */ e(
@@ -1753,7 +1778,7 @@ function _r() {
1753
1778
  }
1754
1779
  )
1755
1780
  ] }),
1756
- !_ && l && (u ? /* @__PURE__ */ e(
1781
+ !_ && l && (p ? /* @__PURE__ */ e(
1757
1782
  "div",
1758
1783
  {
1759
1784
  className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
@@ -1763,19 +1788,19 @@ function _r() {
1763
1788
  }
1764
1789
  ) : /* @__PURE__ */ c(T, { children: [
1765
1790
  /* @__PURE__ */ e(
1766
- js,
1791
+ Qs,
1767
1792
  {
1768
1793
  value: jt || "Untitled Dashboard",
1769
- onSave: (i) => {
1794
+ onSave: (o) => {
1770
1795
  console.log("EditableText onSave called:", {
1771
- newTitle: i,
1796
+ newTitle: o,
1772
1797
  canEditDashboard: xe,
1773
- dashboardId: o == null ? void 0 : o.id
1798
+ dashboardId: r == null ? void 0 : r.id
1774
1799
  });
1775
- const P = (o == null ? void 0 : o.title) || "";
1776
- O(i), Qa(i, P);
1800
+ const P = (r == null ? void 0 : r.title) || "";
1801
+ O(o), Qa(o, P);
1777
1802
  },
1778
- isEditable: xe && !m,
1803
+ isEditable: xe && !d,
1779
1804
  displayClassName: "text-[13px] font-medium",
1780
1805
  inputClassName: "text-[13px] font-medium",
1781
1806
  placeholder: "Dashboard Title",
@@ -1784,63 +1809,63 @@ function _r() {
1784
1809
  ),
1785
1810
  ss && ie && /* @__PURE__ */ e(hs, { children: /* @__PURE__ */ c(ps, { children: [
1786
1811
  /* @__PURE__ */ e(fs, { asChild: !0, children: /* @__PURE__ */ e(
1787
- A,
1812
+ L,
1788
1813
  {
1789
1814
  variant: "ghost",
1790
1815
  size: "xs",
1791
1816
  onClick: rs,
1792
- disabled: qa || !(t != null && t.accessToken) || !(s != null && s.apiServiceUrl),
1817
+ disabled: qa || !(t != null && t.accessToken) || !(a != null && a.apiServiceUrl),
1793
1818
  className: "w-7 px-0",
1794
- "aria-label": Me ? "Remove as default dashboard" : "Make this a default dashboard",
1819
+ "aria-label": Ae ? "Remove as default dashboard" : "Make this a default dashboard",
1795
1820
  children: /* @__PURE__ */ e(
1796
- Ks,
1821
+ Ws,
1797
1822
  {
1798
- className: Y(
1823
+ className: J(
1799
1824
  "h-3.5 w-3.5 transition-colors",
1800
- Me ? "fill-foreground text-foreground" : "text-muted-foreground hover:text-foreground"
1825
+ Ae ? "fill-foreground text-foreground" : "text-muted-foreground hover:text-foreground"
1801
1826
  )
1802
1827
  }
1803
1828
  )
1804
1829
  }
1805
1830
  ) }),
1806
- /* @__PURE__ */ e(gs, { children: /* @__PURE__ */ e("p", { children: Me ? "Remove as default dashboard" : "Make this a default dashboard" }) })
1831
+ /* @__PURE__ */ e(gs, { children: /* @__PURE__ */ e("p", { children: Ae ? "Remove as default dashboard" : "Make this a default dashboard" }) })
1807
1832
  ] }) })
1808
1833
  ] }))
1809
1834
  ] }),
1810
1835
  /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1811
1836
  _ && /* @__PURE__ */ c(T, { children: [
1812
- /* @__PURE__ */ e(pn, {}),
1813
- /* @__PURE__ */ e(fn, {})
1837
+ /* @__PURE__ */ e(gn, {}),
1838
+ /* @__PURE__ */ e(vn, {})
1814
1839
  ] }),
1815
- !_ && l && ((Zt = J == null ? void 0 : J.permissions) == null ? void 0 : Zt.canShare) && /* @__PURE__ */ c(
1816
- A,
1840
+ !_ && l && ((Zt = W == null ? void 0 : W.permissions) == null ? void 0 : Zt.canShare) && /* @__PURE__ */ c(
1841
+ L,
1817
1842
  {
1818
1843
  variant: "outline",
1819
1844
  size: "xs",
1820
1845
  onClick: () => x(!0),
1821
1846
  children: [
1822
- /* @__PURE__ */ e(Qs, { className: "h-3.5 w-3.5" }),
1847
+ /* @__PURE__ */ e(Js, { className: "h-3.5 w-3.5" }),
1823
1848
  "Share"
1824
1849
  ]
1825
1850
  }
1826
1851
  ),
1827
- !_ && E && d.canUseFilters && l && /* @__PURE__ */ e(
1828
- gn,
1852
+ !_ && E && u.canUseFilters && l && /* @__PURE__ */ e(
1853
+ bn,
1829
1854
  {
1830
- showFilters: w ? !1 : Se,
1855
+ showFilters: w ? !1 : Ne,
1831
1856
  onToggleFilters: () => {
1832
1857
  if (w && b) {
1833
1858
  Ut(b, "inputs");
1834
1859
  return;
1835
1860
  }
1836
- Se || Pt("dashboard", !1), _t(!Se);
1861
+ Ne || Pt("dashboard", !1), _t(!Ne);
1837
1862
  },
1838
1863
  onAddFilter: () => {
1839
1864
  if (w && b) {
1840
1865
  Ut(b, "inputs");
1841
1866
  return;
1842
1867
  }
1843
- Se || (Pt("dashboard", !1), _t(!0));
1868
+ Ne || (Pt("dashboard", !1), _t(!0));
1844
1869
  },
1845
1870
  onAddControl: () => {
1846
1871
  Vt("create");
@@ -1849,27 +1874,27 @@ function _r() {
1849
1874
  }
1850
1875
  ),
1851
1876
  E && !_ && l && He ? w ? /* @__PURE__ */ e(
1852
- fr,
1877
+ vr,
1853
1878
  {
1854
1879
  open: !0,
1855
- onOpenChange: (i) => {
1856
- i || he(null);
1880
+ onOpenChange: (o) => {
1881
+ o || he(null);
1857
1882
  },
1858
1883
  initialMode: He
1859
1884
  }
1860
1885
  ) : /* @__PURE__ */ e(
1861
- vn,
1886
+ yn,
1862
1887
  {
1863
1888
  open: !0,
1864
- onOpenChange: (i) => {
1865
- i || he(null);
1889
+ onOpenChange: (o) => {
1890
+ o || he(null);
1866
1891
  },
1867
1892
  showTrigger: !1,
1868
1893
  initialMode: He
1869
1894
  }
1870
1895
  ) : null,
1871
- E && !_ && re && m && a && l && /* @__PURE__ */ c(
1872
- A,
1896
+ E && !_ && re && d && s && l && /* @__PURE__ */ c(
1897
+ L,
1873
1898
  {
1874
1899
  variant: "secondary",
1875
1900
  size: "xs",
@@ -1882,7 +1907,7 @@ function _r() {
1882
1907
  }
1883
1908
  ),
1884
1909
  E && !_ && l && !w && /* @__PURE__ */ c(
1885
- A,
1910
+ L,
1886
1911
  {
1887
1912
  variant: "outline",
1888
1913
  size: "xs",
@@ -1894,44 +1919,44 @@ function _r() {
1894
1919
  ]
1895
1920
  }
1896
1921
  ),
1897
- !_ && !E && xe && l && /* @__PURE__ */ c(A, { size: "xs", onClick: Wa, children: [
1898
- /* @__PURE__ */ e(Ws, { className: "h-3.5 w-3.5" }),
1922
+ !_ && !E && xe && l && /* @__PURE__ */ c(L, { size: "xs", onClick: Wa, children: [
1923
+ /* @__PURE__ */ e(Ys, { className: "h-3.5 w-3.5" }),
1899
1924
  "Edit"
1900
1925
  ] }),
1901
1926
  zt && l && qt && /* @__PURE__ */ c(
1902
- A,
1927
+ L,
1903
1928
  {
1904
1929
  variant: "outline",
1905
1930
  size: "xs",
1906
1931
  onClick: es,
1907
1932
  disabled: Ie,
1908
1933
  children: [
1909
- /* @__PURE__ */ e(Js, { className: "h-3.5 w-3.5" }),
1934
+ /* @__PURE__ */ e(Xs, { className: "h-3.5 w-3.5" }),
1910
1935
  "Undo"
1911
1936
  ]
1912
1937
  }
1913
1938
  ),
1914
1939
  zt && l && /* @__PURE__ */ c(
1915
- A,
1940
+ L,
1916
1941
  {
1917
1942
  size: "xs",
1918
- className: Y(!Ht && "opacity-60"),
1943
+ className: J(!Ht && "opacity-60"),
1919
1944
  disabled: Ie || !Ht,
1920
1945
  onClick: () => at(),
1921
1946
  children: [
1922
- Ie ? /* @__PURE__ */ e(X, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(na, { className: "h-3.5 w-3.5" }),
1947
+ Ie ? /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(na, { className: "h-3.5 w-3.5" }),
1923
1948
  Ie ? "Saving..." : "Save"
1924
1949
  ]
1925
1950
  }
1926
1951
  ),
1927
- E && !_ && l && /* @__PURE__ */ c(A, { variant: "outline", size: "xs", onClick: Ya, children: [
1952
+ E && !_ && l && /* @__PURE__ */ c(L, { variant: "outline", size: "xs", onClick: Ya, children: [
1928
1953
  /* @__PURE__ */ e(ga, { className: "h-3.5 w-3.5" }),
1929
1954
  "Close"
1930
1955
  ] }),
1931
- !_ && l && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(bn, {}) }),
1932
- !_ && a && /* @__PURE__ */ e(Fn, {}),
1933
- !_ && l && /* @__PURE__ */ c(Ys, { children: [
1934
- /* @__PURE__ */ e(Xs, { asChild: !0, children: /* @__PURE__ */ e(
1956
+ !_ && l && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(xn, {}) }),
1957
+ !_ && s && /* @__PURE__ */ e(Gn, {}),
1958
+ !_ && l && /* @__PURE__ */ c(Zs, { children: [
1959
+ /* @__PURE__ */ e(en, { asChild: !0, children: /* @__PURE__ */ e(
1935
1960
  rt,
1936
1961
  {
1937
1962
  tooltip: "More Options",
@@ -1941,11 +1966,11 @@ function _r() {
1941
1966
  variant: "ghost",
1942
1967
  "aria-label": "More dashboard options"
1943
1968
  },
1944
- children: /* @__PURE__ */ e(Zs, { className: "h-3.5 w-3.5" })
1969
+ children: /* @__PURE__ */ e(tn, { className: "h-3.5 w-3.5" })
1945
1970
  }
1946
1971
  ) }),
1947
1972
  /* @__PURE__ */ c(
1948
- en,
1973
+ an,
1949
1974
  {
1950
1975
  align: "end",
1951
1976
  className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
@@ -1955,9 +1980,9 @@ function _r() {
1955
1980
  $,
1956
1981
  {
1957
1982
  disabled: v,
1958
- onSelect: () => Lt(!0),
1983
+ onSelect: () => Mt(!0),
1959
1984
  children: [
1960
- /* @__PURE__ */ e(tn, { className: "h-3.5 w-3.5" }),
1985
+ /* @__PURE__ */ e(sn, { className: "h-3.5 w-3.5" }),
1961
1986
  "Export"
1962
1987
  ]
1963
1988
  }
@@ -1970,7 +1995,7 @@ function _r() {
1970
1995
  oe && ee(!0);
1971
1996
  },
1972
1997
  children: [
1973
- /* @__PURE__ */ e(an, { className: "h-3.5 w-3.5" }),
1998
+ /* @__PURE__ */ e(nn, { className: "h-3.5 w-3.5" }),
1974
1999
  "Schedule"
1975
2000
  ]
1976
2001
  }
@@ -1981,7 +2006,7 @@ function _r() {
1981
2006
  /* @__PURE__ */ c(
1982
2007
  $,
1983
2008
  {
1984
- onClick: () => W(!0),
2009
+ onClick: () => Q(!0),
1985
2010
  children: [
1986
2011
  /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
1987
2012
  "Manage Groups"
@@ -1992,24 +2017,24 @@ function _r() {
1992
2017
  ] }),
1993
2018
  /* @__PURE__ */ e(de, { children: "Preferences" }),
1994
2019
  /* @__PURE__ */ c($, { onClick: () => k(!0), children: [
1995
- /* @__PURE__ */ e(sn, { className: "h-3.5 w-3.5" }),
2020
+ /* @__PURE__ */ e(rn, { className: "h-3.5 w-3.5" }),
1996
2021
  "Calendar Preferences"
1997
2022
  ] }),
1998
- /* @__PURE__ */ c($, { onClick: () => j(!0), children: [
1999
- /* @__PURE__ */ e(nn, { className: "h-3.5 w-3.5" }),
2023
+ /* @__PURE__ */ c($, { onClick: () => H(!0), children: [
2024
+ /* @__PURE__ */ e(on, { className: "h-3.5 w-3.5" }),
2000
2025
  "Summary Settings"
2001
2026
  ] }),
2002
- a && l && /* @__PURE__ */ c(T, { children: [
2027
+ s && l && /* @__PURE__ */ c(T, { children: [
2003
2028
  /* @__PURE__ */ e(Te, {}),
2004
2029
  /* @__PURE__ */ e(de, { children: "Developer" }),
2005
2030
  /* @__PURE__ */ c(
2006
2031
  $,
2007
2032
  {
2008
2033
  onSelect: () => {
2009
- var i;
2010
- t != null && t.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(t.accessToken).then(
2011
- () => M.success("Token copied to clipboard")
2012
- ).catch(() => M.error("Unable to copy token")) : M.error("Clipboard not available"));
2034
+ var o;
2035
+ t != null && t.accessToken && ((o = navigator == null ? void 0 : navigator.clipboard) != null && o.writeText ? navigator.clipboard.writeText(t.accessToken).then(
2036
+ () => A.success("Token copied to clipboard")
2037
+ ).catch(() => A.error("Unable to copy token")) : A.error("Clipboard not available"));
2013
2038
  },
2014
2039
  children: [
2015
2040
  /* @__PURE__ */ e(sa, { className: "h-3.5 w-3.5" }),
@@ -2022,22 +2047,22 @@ function _r() {
2022
2047
  {
2023
2048
  disabled: !Xe,
2024
2049
  onSelect: () => {
2025
- var i;
2050
+ var o;
2026
2051
  if (!Xe) {
2027
- M.error(
2052
+ A.error(
2028
2053
  "Open a document sheet with a token to copy the local PDF URL"
2029
2054
  );
2030
2055
  return;
2031
2056
  }
2032
- (i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(Xe).then(
2033
- () => M.success(
2057
+ (o = navigator == null ? void 0 : navigator.clipboard) != null && o.writeText ? navigator.clipboard.writeText(Xe).then(
2058
+ () => A.success(
2034
2059
  "Local document PDF URL copied to clipboard"
2035
2060
  )
2036
2061
  ).catch(
2037
- () => M.error(
2062
+ () => A.error(
2038
2063
  "Unable to copy local document PDF URL"
2039
2064
  )
2040
- ) : M.error("Clipboard not available");
2065
+ ) : A.error("Clipboard not available");
2041
2066
  },
2042
2067
  children: [
2043
2068
  /* @__PURE__ */ e(sa, { className: "h-3.5 w-3.5" }),
@@ -2048,15 +2073,15 @@ function _r() {
2048
2073
  /* @__PURE__ */ c(
2049
2074
  $,
2050
2075
  {
2051
- onSelect: () => vs(s.apiServiceUrl),
2076
+ onSelect: () => vs(a.apiServiceUrl),
2052
2077
  children: [
2053
- /* @__PURE__ */ e(kn, { className: "h-3.5 w-3.5" }),
2078
+ /* @__PURE__ */ e(Tn, { className: "h-3.5 w-3.5" }),
2054
2079
  "Invalidate token"
2055
2080
  ]
2056
2081
  }
2057
2082
  ),
2058
- /* @__PURE__ */ c($, { onSelect: r, children: [
2059
- /* @__PURE__ */ e(En, { className: "h-3.5 w-3.5" }),
2083
+ /* @__PURE__ */ c($, { onSelect: i, children: [
2084
+ /* @__PURE__ */ e(An, { className: "h-3.5 w-3.5" }),
2060
2085
  "Brand Studio"
2061
2086
  ] }),
2062
2087
  E && /* @__PURE__ */ c(
@@ -2064,7 +2089,7 @@ function _r() {
2064
2089
  {
2065
2090
  onSelect: () => Rt(!Tt),
2066
2091
  children: [
2067
- /* @__PURE__ */ e(In, { className: "h-3.5 w-3.5" }),
2092
+ /* @__PURE__ */ e(Ln, { className: "h-3.5 w-3.5" }),
2068
2093
  Tt ? "Hide dashboard JSON" : "Show dashboard JSON"
2069
2094
  ]
2070
2095
  }
@@ -2073,12 +2098,12 @@ function _r() {
2073
2098
  /* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5" }),
2074
2099
  "Add lens"
2075
2100
  ] }),
2076
- re && /* @__PURE__ */ c(rn, { children: [
2077
- /* @__PURE__ */ c(on, { children: [
2101
+ re && /* @__PURE__ */ c(cn, { children: [
2102
+ /* @__PURE__ */ c(ln, { children: [
2078
2103
  /* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
2079
2104
  "Lenses"
2080
2105
  ] }),
2081
- /* @__PURE__ */ e(cn, { className: "w-60", children: /* @__PURE__ */ e(zn, {}) })
2106
+ /* @__PURE__ */ e(dn, { className: "w-60", children: /* @__PURE__ */ e(Bn, {}) })
2082
2107
  ] })
2083
2108
  ] })
2084
2109
  ]
@@ -2086,7 +2111,7 @@ function _r() {
2086
2111
  )
2087
2112
  ] }),
2088
2113
  z && $t && /* @__PURE__ */ e(
2089
- ln,
2114
+ un,
2090
2115
  {
2091
2116
  resource: $t,
2092
2117
  resourceType: nt.DASHBOARD,
@@ -2094,39 +2119,39 @@ function _r() {
2094
2119
  }
2095
2120
  ),
2096
2121
  /* @__PURE__ */ e(
2097
- ur,
2122
+ hr,
2098
2123
  {
2099
2124
  open: B,
2100
- onOpenChange: W
2125
+ onOpenChange: Q
2101
2126
  }
2102
2127
  ),
2103
- oe && (o == null ? void 0 : o.id) && /* @__PURE__ */ e(
2104
- dn,
2128
+ oe && (r == null ? void 0 : r.id) && /* @__PURE__ */ e(
2129
+ mn,
2105
2130
  {
2106
- open: H,
2131
+ open: Z,
2107
2132
  onOpenChange: ee,
2108
- dashboardId: o.id,
2109
- dashboardName: o == null ? void 0 : o.title
2133
+ dashboardId: r.id,
2134
+ dashboardName: r == null ? void 0 : r.title
2110
2135
  }
2111
2136
  ),
2112
2137
  /* @__PURE__ */ e(
2113
- Sn,
2138
+ wn,
2114
2139
  {
2115
2140
  open: y,
2116
2141
  onOpenChange: k
2117
2142
  }
2118
2143
  ),
2119
2144
  /* @__PURE__ */ e(
2120
- Nn,
2145
+ Dn,
2121
2146
  {
2122
2147
  open: G,
2123
- onOpenChange: j,
2124
- dashboard: o,
2148
+ onOpenChange: H,
2149
+ dashboard: r,
2125
2150
  disabled: !E,
2126
- onApply: (i) => Ze(
2151
+ onApply: (o) => Ze(
2127
2152
  {
2128
- ...o,
2129
- summary: i
2153
+ ...r,
2154
+ summary: o
2130
2155
  },
2131
2156
  {
2132
2157
  semanticExecutionPayload: et
@@ -2134,28 +2159,28 @@ function _r() {
2134
2159
  )
2135
2160
  }
2136
2161
  ),
2137
- a && re && l && /* @__PURE__ */ e(Vn, { open: me, onOpenChange: te }),
2162
+ s && re && l && /* @__PURE__ */ e(qn, { open: me, onOpenChange: te }),
2138
2163
  l && /* @__PURE__ */ e(
2139
- un,
2164
+ hn,
2140
2165
  {
2141
2166
  open: Ua,
2142
- onOpenChange: Lt
2167
+ onOpenChange: Mt
2143
2168
  }
2144
2169
  ),
2145
2170
  /* @__PURE__ */ e(
2146
2171
  ya,
2147
2172
  {
2148
2173
  open: Fa,
2149
- onOpenChange: (i) => {
2150
- !i && We && !fe || (pe(i), i || (ge(null), ve([]), be(!1)));
2174
+ onOpenChange: (o) => {
2175
+ !o && We && !fe || (pe(o), o || (ge(null), ve([]), be(!1)));
2151
2176
  },
2152
2177
  children: /* @__PURE__ */ c(xa, { className: "max-w-sm", children: [
2153
- /* @__PURE__ */ c(Sa, { children: [
2154
- /* @__PURE__ */ e(Na, { children: fe ? "Save failed" : "Saving dashboard" }),
2178
+ /* @__PURE__ */ c(Na, { children: [
2179
+ /* @__PURE__ */ e(Sa, { children: fe ? "Save failed" : "Saving dashboard" }),
2155
2180
  /* @__PURE__ */ e(wa, { className: "pt-2", children: fe ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2156
2181
  Ot.length > 0 && /* @__PURE__ */ c("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2157
2182
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
2158
- /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: Ot.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
2183
+ /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: Ot.slice(0, 5).map((o) => /* @__PURE__ */ e("li", { children: o }, o)) })
2159
2184
  ] })
2160
2185
  ] }),
2161
2186
  /* @__PURE__ */ e(Da, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: fe ? /* @__PURE__ */ c(T, { children: [
@@ -2181,18 +2206,18 @@ function _r() {
2181
2206
  }
2182
2207
  )
2183
2208
  ] }) : /* @__PURE__ */ c(vt, { disabled: !0, className: "m-0 cursor-default", children: [
2184
- /* @__PURE__ */ e(X, { className: "mr-2 h-4 w-4 animate-spin" }),
2209
+ /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
2185
2210
  "Saving..."
2186
2211
  ] }) })
2187
2212
  ] })
2188
2213
  }
2189
2214
  ),
2190
2215
  /* @__PURE__ */ e(
2191
- yn,
2216
+ Nn,
2192
2217
  {
2193
2218
  open: Ka,
2194
- onOpenChange: (i) => {
2195
- se(i);
2219
+ onOpenChange: (o) => {
2220
+ se(o);
2196
2221
  },
2197
2222
  onSave: Xa,
2198
2223
  onDiscard: Za,
@@ -2206,21 +2231,21 @@ function _r() {
2206
2231
  }
2207
2232
  );
2208
2233
  }
2209
- function xr({
2234
+ function Sr({
2210
2235
  accessToken: t,
2211
- dashboardId: s,
2236
+ dashboardId: a,
2212
2237
  selectedSheetId: n,
2213
- pageSize: a,
2214
- orientation: r,
2215
- theme: d
2238
+ pageSize: s,
2239
+ orientation: i,
2240
+ theme: u
2216
2241
  }) {
2217
2242
  if (!t || !n)
2218
2243
  return null;
2219
2244
  const l = new URL("http://localhost:5173/print-document");
2220
- l.searchParams.set("token", t), s && l.searchParams.set("dashboardId", s), l.searchParams.set("selectedSheetId", n), d && l.searchParams.set("theme", d);
2221
- const u = new URL("http://127.0.0.1:3002/");
2222
- return u.searchParams.set("pdfMode", "document"), u.searchParams.set("pageSize", a || "letter"), u.searchParams.set("orientation", r || "portrait"), u.searchParams.set("url", l.toString()), u.toString();
2245
+ l.searchParams.set("token", t), a && l.searchParams.set("dashboardId", a), l.searchParams.set("selectedSheetId", n), u && l.searchParams.set("theme", u);
2246
+ const p = new URL("http://127.0.0.1:3002/");
2247
+ return p.searchParams.set("pdfMode", "document"), p.searchParams.set("pageSize", s || "letter"), p.searchParams.set("orientation", i || "portrait"), p.searchParams.set("url", l.toString()), p.toString();
2223
2248
  }
2224
2249
  export {
2225
- _r as default
2250
+ Fr as default
2226
2251
  };