react-semaphor 0.1.302 → 0.1.304

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