react-semaphor 0.1.261 → 0.1.263

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 (29) hide show
  1. package/dist/chunks/{dashboard-controls-BYi_r2lH.js → dashboard-controls-DVMSiuTb.js} +781 -791
  2. package/dist/chunks/dashboard-controls-JZ-mgUSY.js +42 -0
  3. package/dist/chunks/{dashboard-filter-controls-button-BPCw1GMh.js → dashboard-filter-controls-button-ClYx7NdN.js} +3 -3
  4. package/dist/chunks/{dashboard-filter-controls-button-f4pDkDUL.js → dashboard-filter-controls-button-CnijsTUC.js} +1 -1
  5. package/dist/chunks/{dashboard-json-Dpy-zKf2.js → dashboard-json-BILMCUhG.js} +1 -1
  6. package/dist/chunks/{dashboard-json-2NJCXsDD.js → dashboard-json-CKWfqC0m.js} +1 -1
  7. package/dist/chunks/dashboard-summary-settings-dialog-5JMWm5zV.js +1 -0
  8. package/dist/chunks/dashboard-summary-settings-dialog-6SEdlbOP.js +535 -0
  9. package/dist/chunks/{edit-dashboard-visual-CqTlmuYL.js → edit-dashboard-visual-BjU_0_QA.js} +890 -884
  10. package/dist/chunks/{edit-dashboard-visual-Bon08erH.js → edit-dashboard-visual-DPqnhyq1.js} +5 -5
  11. package/dist/chunks/index-BUNYVJ8g.js +1114 -0
  12. package/dist/chunks/{index-C2c-_lPE.js → index-D2dG8YFx.js} +29265 -29226
  13. package/dist/chunks/{resource-management-panel-BtLPW2b4.js → resource-management-panel-BAytqOVf.js} +1 -1
  14. package/dist/chunks/{resource-management-panel-Bva2_0OU.js → resource-management-panel-I5Q6TQbc.js} +2 -2
  15. package/dist/chunks/{use-create-flow-overlay-state-Vyd5mSnf.js → use-create-flow-overlay-state-CPUI4zrE.js} +2 -2
  16. package/dist/chunks/{use-create-flow-overlay-state-9X7GyUzl.js → use-create-flow-overlay-state-DakZJeCH.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-OPk_1t4I.js → use-visual-utils-B_9CT1PY.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-Jv4hWSLm.js → use-visual-utils-Cd9d6nnp.js} +1 -1
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +5 -5
  23. package/dist/surfboard/index.cjs +1 -1
  24. package/dist/surfboard/index.js +2 -2
  25. package/package.json +1 -1
  26. package/dist/chunks/dashboard-controls-0hbftZxY.js +0 -42
  27. package/dist/chunks/dashboard-summary-settings-dialog-B9zRCvc-.js +0 -544
  28. package/dist/chunks/dashboard-summary-settings-dialog-Be3JilRI.js +0 -1
  29. package/dist/chunks/index-BoJEr_9F.js +0 -1114
@@ -1,21 +1,21 @@
1
- import { jsxs as o, jsx as e, Fragment as k } from "react/jsx-runtime";
2
- import { bL as de, dn as Fs, u as x, cy as ta, cz as ra, B as M, cB as na, cC as K, dp as oa, N as Va, b as F, e as ia, dq as $s, cp as la, f as ca, g as da, h as ua, i as qa, L as Ke, I as ce, v as Vs, a6 as B, dr as De, cG as Qe, ds as qs, dt as _a, du as Ha, c as X, dv as ja, dw as Hs, cX as ma, dx as js, dy as zs, dz as Bs, dA as Ks, dB as Qs, dC as Ws, H as Ae, V as Me, x as L, dD as za, d5 as Js, dE as Xs, w as Y, cF as W, dF as Ys, dG as Zs, dH as We, dI as et, dJ as at, dK as Ba, dL as Ka, dM as Ce, dN as Ee, d1 as Je, cL as Xe, dO as Ye, cc as Qa, dP as Ze, c7 as Wa, dQ as st, cO as Ja, cP as Xa, cQ as Ya, cR as Za, cS as es, cT as as, cU as ss, cV as ea, dR as ts, cx as tt, dS as rt, af as nt, U as Pa, ae as we, dT as ot, al as it, ag as He, dU as lt, dV as ct, dW as dt, aA as ut, dX as mt, dY as ht, bS as pt, bT as ft, bU as gt, dZ as vt, bV as bt, cD as yt, as as Nt, d_ as St, d$ as xt, dm as wt, e0 as Dt, e1 as Ct, cA as Et, a8 as At, cI as Mt, e2 as Lt, ak as kt, a9 as It, ar as Ot, e3 as Tt } from "./index-C2c-_lPE.js";
1
+ import { jsxs as o, jsx as e, Fragment as I } from "react/jsx-runtime";
2
+ import { bL as de, dn as qs, u as x, cy as ra, cz as na, B as M, cB as oa, cC as Q, dp as ia, N as qa, b as $, e as la, dq as Hs, cp as ca, f as da, g as ua, h as ma, i as Ha, L as Qe, I as ce, v as js, a6 as K, dr as we, cG as We, ds as zs, dt as Pa, du as ja, c as Y, dv as za, dw as Bs, cX as ha, dx as Ks, dy as Qs, dz as Ws, dA as Js, dB as Xs, dC as Ys, H as Ae, V as Me, x as k, dD as Le, dE as Ba, dF as Ka, d5 as Zs, dG as et, w as Z, cF as J, dH as at, dI as st, dJ as Je, dK as tt, dL as rt, dM as Qa, dN as Wa, dO as Ce, dP as Ee, d1 as Xe, cL as Ye, dQ as Ze, cc as Ja, dR as ea, c7 as Xa, dS as nt, cO as Ya, cP as Za, cQ as es, cR as as, cS as ss, cT as ts, cU as rs, cV as aa, dT as ns, cx as ot, dU as it, af as lt, U as Ua, ae as De, dV as ct, al as dt, ag as je, dW as ut, dX as mt, dY as ht, aA as pt, dZ as ft, d_ as gt, bS as vt, bT as bt, bU as yt, d$ as Nt, bV as St, cD as xt, as as Dt, e0 as wt, e1 as Ct, dm as Et, e2 as At, e3 as Mt, cA as Lt, a8 as kt, cI as It, e4 as Ot, ak as Tt, a9 as _t, ar as Pt, e5 as Ut } from "./index-D2dG8YFx.js";
3
3
  import * as A from "react";
4
- import rs, { useState as N, useMemo as Q, useCallback as Ua, useEffect as _t } from "react";
4
+ import os, { useState as N, useMemo as W, useCallback as Ra, useEffect as Rt } from "react";
5
5
  import "react-dom";
6
- import { b as Pt, u as Ut, d as Gt, A as Rt, V as Ft, N as $t, c as Vt, D as qt, U as Ht } from "./dashboard-filter-controls-button-BPCw1GMh.js";
7
- import { l as jt } from "./date-formatter-vkCj9Ct-.js";
8
- import { C as zt, D as Bt } from "./dashboard-summary-settings-dialog-B9zRCvc-.js";
9
- import { u as Kt } from "./use-debounced-dirty-check-BwAbnX_5.js";
10
- import { s as je } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
11
- import { S as Ga } from "./use-create-flow-overlay-state-Vyd5mSnf.js";
6
+ import { b as Gt, u as Ft, d as $t, A as Vt, V as qt, N as Ht, c as jt, D as zt, U as Bt } from "./dashboard-filter-controls-button-ClYx7NdN.js";
7
+ import { l as Kt } from "./date-formatter-vkCj9Ct-.js";
8
+ import { C as Qt, D as Wt } from "./dashboard-summary-settings-dialog-6SEdlbOP.js";
9
+ import { u as Jt } from "./use-debounced-dirty-check-BwAbnX_5.js";
10
+ import { s as ze } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
11
+ import { S as Ga } from "./use-create-flow-overlay-state-CPUI4zrE.js";
12
12
  /**
13
13
  * @license lucide-react v0.453.0 - ISC
14
14
  *
15
15
  * This source code is licensed under the ISC license.
16
16
  * See the LICENSE file in the root directory of this source tree.
17
17
  */
18
- const Qt = de("Glasses", [
18
+ const Xt = de("Glasses", [
19
19
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
20
20
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
21
21
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -28,7 +28,7 @@ const Qt = de("Glasses", [
28
28
  * This source code is licensed under the ISC license.
29
29
  * See the LICENSE file in the root directory of this source tree.
30
30
  */
31
- const Wt = de("Menu", [
31
+ const Yt = de("Menu", [
32
32
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
33
33
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
34
34
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
@@ -39,7 +39,7 @@ const Wt = de("Menu", [
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
41
  */
42
- const Jt = de("Moon", [
42
+ const Zt = de("Moon", [
43
43
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
44
44
  ]);
45
45
  /**
@@ -48,7 +48,7 @@ const Jt = de("Moon", [
48
48
  * This source code is licensed under the ISC license.
49
49
  * See the LICENSE file in the root directory of this source tree.
50
50
  */
51
- const Xt = de("ShieldX", [
51
+ const er = de("ShieldX", [
52
52
  [
53
53
  "path",
54
54
  {
@@ -65,7 +65,7 @@ const Xt = de("ShieldX", [
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
67
  */
68
- const Yt = de("Sun", [
68
+ const ar = de("Sun", [
69
69
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
70
70
  ["path", { d: "M12 2v2", key: "tus03m" }],
71
71
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -76,7 +76,7 @@ const Yt = de("Sun", [
76
76
  ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
77
77
  ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
78
78
  ]);
79
- var aa = { exports: {} }, ze = {};
79
+ var sa = { exports: {} }, Be = {};
80
80
  /**
81
81
  * @license React
82
82
  * use-sync-external-store-shim.production.js
@@ -86,48 +86,48 @@ var aa = { exports: {} }, ze = {};
86
86
  * This source code is licensed under the MIT license found in the
87
87
  * LICENSE file in the root directory of this source tree.
88
88
  */
89
- var Ra;
90
- function Zt() {
91
- if (Ra) return ze;
92
- Ra = 1;
93
- var a = rs;
94
- function n(s, d) {
95
- return s === d && (s !== 0 || 1 / s === 1 / d) || s !== s && d !== d;
89
+ var Fa;
90
+ function sr() {
91
+ if (Fa) return Be;
92
+ Fa = 1;
93
+ var a = os;
94
+ function n(r, d) {
95
+ return r === d && (r !== 0 || 1 / r === 1 / d) || r !== r && d !== d;
96
96
  }
97
- var t = typeof Object.is == "function" ? Object.is : n, r = a.useState, i = a.useEffect, c = a.useLayoutEffect, u = a.useDebugValue;
98
- function m(s, d) {
99
- var f = d(), v = r({ inst: { value: f, getSnapshot: d } }), b = v[0].inst, S = v[1];
97
+ var s = typeof Object.is == "function" ? Object.is : n, t = a.useState, l = a.useEffect, c = a.useLayoutEffect, m = a.useDebugValue;
98
+ function u(r, d) {
99
+ var f = d(), v = t({ inst: { value: f, getSnapshot: d } }), b = v[0].inst, S = v[1];
100
100
  return c(
101
101
  function() {
102
102
  b.value = f, b.getSnapshot = d, p(b) && S({ inst: b });
103
103
  },
104
- [s, f, d]
105
- ), i(
104
+ [r, f, d]
105
+ ), l(
106
106
  function() {
107
- return p(b) && S({ inst: b }), s(function() {
107
+ return p(b) && S({ inst: b }), r(function() {
108
108
  p(b) && S({ inst: b });
109
109
  });
110
110
  },
111
- [s]
112
- ), u(f), f;
111
+ [r]
112
+ ), m(f), f;
113
113
  }
114
- function p(s) {
115
- var d = s.getSnapshot;
116
- s = s.value;
114
+ function p(r) {
115
+ var d = r.getSnapshot;
116
+ r = r.value;
117
117
  try {
118
118
  var f = d();
119
- return !t(s, f);
119
+ return !s(r, f);
120
120
  } catch {
121
121
  return !0;
122
122
  }
123
123
  }
124
- function y(s, d) {
124
+ function y(r, d) {
125
125
  return d();
126
126
  }
127
- var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? y : m;
128
- return ze.useSyncExternalStore = a.useSyncExternalStore !== void 0 ? a.useSyncExternalStore : h, ze;
127
+ var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? y : u;
128
+ return Be.useSyncExternalStore = a.useSyncExternalStore !== void 0 ? a.useSyncExternalStore : h, Be;
129
129
  }
130
- var Be = {};
130
+ var Ke = {};
131
131
  /**
132
132
  * @license React
133
133
  * use-sync-external-store-shim.development.js
@@ -137,42 +137,42 @@ var Be = {};
137
137
  * This source code is licensed under the MIT license found in the
138
138
  * LICENSE file in the root directory of this source tree.
139
139
  */
140
- var Fa;
141
- function er() {
142
- return Fa || (Fa = 1, process.env.NODE_ENV !== "production" && function() {
140
+ var $a;
141
+ function tr() {
142
+ return $a || ($a = 1, process.env.NODE_ENV !== "production" && function() {
143
143
  function a(f, v) {
144
144
  return f === v && (f !== 0 || 1 / f === 1 / v) || f !== f && v !== v;
145
145
  }
146
146
  function n(f, v) {
147
- h || i.startTransition === void 0 || (h = !0, console.error(
147
+ h || l.startTransition === void 0 || (h = !0, console.error(
148
148
  "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."
149
149
  ));
150
150
  var b = v();
151
- if (!s) {
151
+ if (!r) {
152
152
  var S = v();
153
153
  c(b, S) || (console.error(
154
154
  "The result of getSnapshot should be cached to avoid an infinite loop"
155
- ), s = !0);
155
+ ), r = !0);
156
156
  }
157
- S = u({
157
+ S = m({
158
158
  inst: { value: b, getSnapshot: v }
159
159
  });
160
160
  var C = S[0].inst, P = S[1];
161
161
  return p(
162
162
  function() {
163
- C.value = b, C.getSnapshot = v, t(C) && P({ inst: C });
163
+ C.value = b, C.getSnapshot = v, s(C) && P({ inst: C });
164
164
  },
165
165
  [f, b, v]
166
- ), m(
166
+ ), u(
167
167
  function() {
168
- return t(C) && P({ inst: C }), f(function() {
169
- t(C) && P({ inst: C });
168
+ return s(C) && P({ inst: C }), f(function() {
169
+ s(C) && P({ inst: C });
170
170
  });
171
171
  },
172
172
  [f]
173
173
  ), y(b), b;
174
174
  }
175
- function t(f) {
175
+ function s(f) {
176
176
  var v = f.getSnapshot;
177
177
  f = f.value;
178
178
  try {
@@ -182,31 +182,31 @@ function er() {
182
182
  return !0;
183
183
  }
184
184
  }
185
- function r(f, v) {
185
+ function t(f, v) {
186
186
  return v();
187
187
  }
188
188
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
189
- var i = rs, c = typeof Object.is == "function" ? Object.is : a, u = i.useState, m = i.useEffect, p = i.useLayoutEffect, y = i.useDebugValue, h = !1, s = !1, d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
190
- Be.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
191
- }()), Be;
189
+ var l = os, c = typeof Object.is == "function" ? Object.is : a, m = l.useState, u = l.useEffect, p = l.useLayoutEffect, y = l.useDebugValue, h = !1, r = !1, d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : n;
190
+ Ke.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
191
+ }()), Ke;
192
192
  }
193
- process.env.NODE_ENV === "production" ? aa.exports = Zt() : aa.exports = er();
194
- var ar = aa.exports;
195
- function sr() {
196
- const { setTheme: a } = Fs(), n = x(
197
- (t) => t.actions.setDashboardTheme
193
+ process.env.NODE_ENV === "production" ? sa.exports = sr() : sa.exports = tr();
194
+ var rr = sa.exports;
195
+ function nr() {
196
+ const { setTheme: a } = qs(), n = x(
197
+ (s) => s.actions.setDashboardTheme
198
198
  );
199
- return /* @__PURE__ */ o(ta, { children: [
200
- /* @__PURE__ */ e(ra, { asChild: !0, children: /* @__PURE__ */ o(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
199
+ return /* @__PURE__ */ o(ra, { children: [
200
+ /* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ o(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
201
201
  /* @__PURE__ */ e(
202
- Yt,
202
+ ar,
203
203
  {
204
204
  strokeWidth: 1.5,
205
205
  className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
206
206
  }
207
207
  ),
208
208
  /* @__PURE__ */ e(
209
- Jt,
209
+ Zt,
210
210
  {
211
211
  strokeWidth: 1.5,
212
212
  className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
@@ -214,9 +214,9 @@ function sr() {
214
214
  ),
215
215
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
216
216
  ] }) }),
217
- /* @__PURE__ */ o(na, { align: "end", children: [
217
+ /* @__PURE__ */ o(oa, { align: "end", children: [
218
218
  /* @__PURE__ */ e(
219
- K,
219
+ Q,
220
220
  {
221
221
  onClick: () => {
222
222
  a("light"), n("light");
@@ -225,7 +225,7 @@ function sr() {
225
225
  }
226
226
  ),
227
227
  /* @__PURE__ */ e(
228
- K,
228
+ Q,
229
229
  {
230
230
  onClick: () => {
231
231
  a("dark"), n("dark");
@@ -234,7 +234,7 @@ function sr() {
234
234
  }
235
235
  ),
236
236
  /* @__PURE__ */ e(
237
- K,
237
+ Q,
238
238
  {
239
239
  onClick: () => {
240
240
  a("system"), n("system");
@@ -245,72 +245,72 @@ function sr() {
245
245
  ] })
246
246
  ] });
247
247
  }
248
- async function tr(a, n, t, r, i) {
249
- if (!i)
248
+ async function or(a, n, s, t, l) {
249
+ if (!l)
250
250
  return null;
251
- const c = JSON.stringify(t), u = `${a}/v1/lens`;
252
- return await oa(u, i, {
251
+ const c = JSON.stringify(s), m = `${a}/v1/lens`;
252
+ return await ia(m, l, {
253
253
  name: n,
254
254
  template: c,
255
- filterValues: r,
255
+ filterValues: t,
256
256
  operation: "create"
257
257
  });
258
258
  }
259
- async function sa(a, n, t) {
260
- if (!t)
259
+ async function ta(a, n, s) {
260
+ if (!s)
261
261
  return null;
262
- const { id: r, template: i, filterValues: c, isDefault: u, shared: m } = n, p = `${a}/v1/lens`;
263
- return await oa(p, t, {
264
- lensId: r,
265
- template: i,
262
+ const { id: t, template: l, filterValues: c, isDefault: m, shared: u } = n, p = `${a}/v1/lens`;
263
+ return await ia(p, s, {
264
+ lensId: t,
265
+ template: l,
266
266
  filterValues: c,
267
- isDefault: u,
268
- shared: m,
267
+ isDefault: m,
268
+ shared: u,
269
269
  operation: "update"
270
270
  });
271
271
  }
272
- async function rr(a, n, t) {
273
- if (!t)
272
+ async function ir(a, n, s) {
273
+ if (!s)
274
274
  return null;
275
- const r = `${a}/v1/lens`;
276
- return await oa(r, t, {
275
+ const t = `${a}/v1/lens`;
276
+ return await ia(t, s, {
277
277
  operation: "delete",
278
278
  lensId: n
279
279
  });
280
280
  }
281
- function nr() {
282
- const [a, n] = N(""), [t, r] = N(!1), i = x((S) => S.lenses), { setLenses: c, setSelectedLensId: u } = Va(), [m, p] = N(!1), [y, h] = N(!1), s = x((S) => S.dashboard), d = x((S) => S.filterValues), { authToken: f, tokenProps: v } = F();
281
+ function lr() {
282
+ const [a, n] = N(""), [s, t] = N(!1), l = x((S) => S.lenses), { setLenses: c, setSelectedLensId: m } = qa(), [u, p] = N(!1), [y, h] = N(!1), r = x((S) => S.dashboard), d = x((S) => S.filterValues), { authToken: f, tokenProps: v } = $();
283
283
  async function b() {
284
284
  p(!0);
285
- const S = await tr(
285
+ const S = await or(
286
286
  v.apiServiceUrl,
287
287
  a,
288
- s,
288
+ r,
289
289
  d,
290
290
  f == null ? void 0 : f.accessToken
291
291
  );
292
- S && (c([...i || [], S]), u(S.id), h(!1)), p(!1);
292
+ S && (c([...l || [], S]), m(S.id), h(!1)), p(!1);
293
293
  }
294
- return /* @__PURE__ */ o(ia, { open: y, onOpenChange: h, children: [
295
- /* @__PURE__ */ e($s, { asChild: !0, children: /* @__PURE__ */ o(
294
+ return /* @__PURE__ */ o(la, { open: y, onOpenChange: h, children: [
295
+ /* @__PURE__ */ e(Hs, { asChild: !0, children: /* @__PURE__ */ o(
296
296
  M,
297
297
  {
298
298
  variant: "secondary",
299
299
  className: "h-7 p-2",
300
300
  size: "sm",
301
301
  children: [
302
- /* @__PURE__ */ e(la, { className: "mr-2 h-4 w-4" }),
302
+ /* @__PURE__ */ e(ca, { className: "mr-2 h-4 w-4" }),
303
303
  "Lens"
304
304
  ]
305
305
  }
306
306
  ) }),
307
- /* @__PURE__ */ o(ca, { className: "sm:max-w-[425px]", children: [
308
- /* @__PURE__ */ o(da, { children: [
309
- /* @__PURE__ */ e(ua, { children: "Create Lens" }),
310
- /* @__PURE__ */ e(qa, { children: "Lenses are private by default and are only visible to you." })
307
+ /* @__PURE__ */ o(da, { className: "sm:max-w-[425px]", children: [
308
+ /* @__PURE__ */ o(ua, { children: [
309
+ /* @__PURE__ */ e(ma, { children: "Create Lens" }),
310
+ /* @__PURE__ */ e(Ha, { children: "Lenses are private by default and are only visible to you." })
311
311
  ] }),
312
312
  /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-8 items-center gap-4", children: [
313
- /* @__PURE__ */ e(Ke, { className: "text-right", children: "Name" }),
313
+ /* @__PURE__ */ e(Qe, { className: "text-right", children: "Name" }),
314
314
  /* @__PURE__ */ e(
315
315
  ce,
316
316
  {
@@ -323,96 +323,96 @@ function nr() {
323
323
  }
324
324
  )
325
325
  ] }) }),
326
- t && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
327
- /* @__PURE__ */ e(Vs, { children: /* @__PURE__ */ e(
326
+ s && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
327
+ /* @__PURE__ */ e(js, { children: /* @__PURE__ */ e(
328
328
  M,
329
329
  {
330
330
  size: "sm",
331
331
  variant: "outline",
332
332
  type: "submit",
333
333
  onClick: b,
334
- disabled: m,
335
- children: m ? "Creating..." : "Add"
334
+ disabled: u,
335
+ children: u ? "Creating..." : "Add"
336
336
  }
337
337
  ) })
338
338
  ] })
339
339
  ] });
340
340
  }
341
- function or() {
342
- const [a, n] = N(!1), t = x((s) => s.lenses), r = x((s) => s.selectedLensId), { setLenses: i, setSelectedLensId: c } = Va(), { authToken: u, tokenProps: m } = F();
343
- async function p(s) {
344
- c(s);
341
+ function cr() {
342
+ const [a, n] = N(!1), s = x((r) => r.lenses), t = x((r) => r.selectedLensId), { setLenses: l, setSelectedLensId: c } = qa(), { authToken: m, tokenProps: u } = $();
343
+ async function p(r) {
344
+ c(r);
345
345
  }
346
- async function y(s) {
347
- if (await rr(m.apiServiceUrl, s, u == null ? void 0 : u.accessToken)) {
348
- const f = t == null ? void 0 : t.filter((v) => v.id !== s);
349
- i(f || []), c("original");
346
+ async function y(r) {
347
+ if (await ir(u.apiServiceUrl, r, m == null ? void 0 : m.accessToken)) {
348
+ const f = s == null ? void 0 : s.filter((v) => v.id !== r);
349
+ l(f || []), c("original");
350
350
  }
351
351
  }
352
- async function h(s) {
353
- const d = t == null ? void 0 : t.map((b) => b.id === s.id ? {
352
+ async function h(r) {
353
+ const d = s == null ? void 0 : s.map((b) => b.id === r.id ? {
354
354
  ...b,
355
- isDefault: !s.isDefault
355
+ isDefault: !r.isDefault
356
356
  } : {
357
357
  ...b,
358
358
  isDefault: !1
359
359
  });
360
- i(d || []);
360
+ l(d || []);
361
361
  const f = {
362
- ...s,
363
- isDefault: !s.isDefault
362
+ ...r,
363
+ isDefault: !r.isDefault
364
364
  };
365
- await sa(m.apiServiceUrl, f, u == null ? void 0 : u.accessToken);
366
- const v = t == null ? void 0 : t.find((b) => b.isDefault);
367
- if (v && v.id !== s.id) {
365
+ await ta(u.apiServiceUrl, f, m == null ? void 0 : m.accessToken);
366
+ const v = s == null ? void 0 : s.find((b) => b.isDefault);
367
+ if (v && v.id !== r.id) {
368
368
  const b = {
369
369
  ...v,
370
370
  isDefault: !1
371
371
  };
372
- await sa(m.apiServiceUrl, b, u == null ? void 0 : u.accessToken);
372
+ await ta(u.apiServiceUrl, b, m == null ? void 0 : m.accessToken);
373
373
  }
374
374
  }
375
- return /* @__PURE__ */ o(ta, { open: a, onOpenChange: n, children: [
376
- /* @__PURE__ */ e(ra, { asChild: !0, children: /* @__PURE__ */ e(B, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Qt, { className: "h-4 w-4" }) }) }),
377
- /* @__PURE__ */ o(na, { align: "end", className: "w-60", children: [
378
- /* @__PURE__ */ e(De, { className: "px-3", children: "Lenses" }),
379
- /* @__PURE__ */ e(Qe, {}),
375
+ return /* @__PURE__ */ o(ra, { open: a, onOpenChange: n, children: [
376
+ /* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ e(K, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Xt, { className: "h-4 w-4" }) }) }),
377
+ /* @__PURE__ */ o(oa, { align: "end", className: "w-60", children: [
378
+ /* @__PURE__ */ e(we, { className: "px-3", children: "Lenses" }),
379
+ /* @__PURE__ */ e(We, {}),
380
380
  /* @__PURE__ */ o(
381
- qs,
381
+ zs,
382
382
  {
383
- value: r,
383
+ value: t,
384
384
  onValueChange: p,
385
385
  children: [
386
- /* @__PURE__ */ e(_a, { value: "original", children: "Original" }),
387
- t == null ? void 0 : t.map((s) => /* @__PURE__ */ o(
388
- _a,
386
+ /* @__PURE__ */ e(Pa, { value: "original", children: "Original" }),
387
+ s == null ? void 0 : s.map((r) => /* @__PURE__ */ o(
388
+ Pa,
389
389
  {
390
390
  className: "group flex justify-between gap-2",
391
- value: s.id,
391
+ value: r.id,
392
392
  children: [
393
- /* @__PURE__ */ e("p", { children: s.name }),
393
+ /* @__PURE__ */ e("p", { children: r.name }),
394
394
  /* @__PURE__ */ o("span", { className: "flex items-center gap-3", children: [
395
395
  /* @__PURE__ */ e(
396
- Ha,
396
+ ja,
397
397
  {
398
398
  onClick: (d) => {
399
- d.preventDefault(), h(s);
399
+ d.preventDefault(), h(r);
400
400
  },
401
- className: X(
401
+ className: Y(
402
402
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
403
403
  {
404
- invisible: !s.isDefault,
405
- "text-green-500": s.isDefault
404
+ invisible: !r.isDefault,
405
+ "text-green-500": r.isDefault
406
406
  }
407
407
  ),
408
408
  strokeWidth: 1.5
409
409
  }
410
410
  ),
411
411
  /* @__PURE__ */ e(
412
- ja,
412
+ za,
413
413
  {
414
414
  onClick: (d) => {
415
- d.preventDefault(), y(s.id);
415
+ d.preventDefault(), y(r.id);
416
416
  },
417
417
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
418
418
  strokeWidth: 1.5
@@ -421,7 +421,7 @@ function or() {
421
421
  ] })
422
422
  ]
423
423
  },
424
- s.id
424
+ r.id
425
425
  ))
426
426
  ]
427
427
  }
@@ -429,153 +429,135 @@ function or() {
429
429
  ] })
430
430
  ] });
431
431
  }
432
- function ir() {
433
- const { displayPreferences: a, shouldShowElement: n } = Hs(), { currentUser: t, userContext: r } = ma(), i = Q(
434
- () => js(t),
435
- [t]
436
- ), c = Q(() => (m) => i && i[m] !== void 0 && i[m] === !1 ? !1 : n(m), [i, n, a]), u = Q(
432
+ function dr() {
433
+ const { displayPreferences: a, shouldShowElement: n } = Bs(), { currentUser: s, userContext: t } = ha(), l = W(
434
+ () => Ks(s),
435
+ [s]
436
+ ), c = W(() => (u) => l && l[u] !== void 0 && l[u] === !1 ? !1 : n(u), [l, n, a]), m = W(
437
437
  () => {
438
- var m, p, y, h, s;
438
+ var u, p, y, h, r;
439
439
  return {
440
- canEdit: ((m = r == null ? void 0 : r.permissions) == null ? void 0 : m.canEdit) ?? Ws(t),
441
- canUseFilters: ((p = r == null ? void 0 : r.permissions) == null ? void 0 : p.canEdit) ?? Qs(t),
442
- canManageDashboards: ((y = r == null ? void 0 : r.permissions) == null ? void 0 : y.canCreateDashboard) ?? Ks(t),
443
- canCreateDashboards: ((h = r == null ? void 0 : r.permissions) == null ? void 0 : h.canCreateDashboard) ?? Bs(t),
444
- canAccessVisuals: ((s = r == null ? void 0 : r.permissions) == null ? void 0 : s.canEdit) ?? zs(t)
440
+ canEdit: ((u = t == null ? void 0 : t.permissions) == null ? void 0 : u.canEdit) ?? Ys(s),
441
+ canUseFilters: ((p = t == null ? void 0 : t.permissions) == null ? void 0 : p.canEdit) ?? Xs(s),
442
+ canManageDashboards: ((y = t == null ? void 0 : t.permissions) == null ? void 0 : y.canCreateDashboard) ?? Js(s),
443
+ canCreateDashboards: ((h = t == null ? void 0 : t.permissions) == null ? void 0 : h.canCreateDashboard) ?? Ws(s),
444
+ canAccessVisuals: ((r = t == null ? void 0 : t.permissions) == null ? void 0 : r.canEdit) ?? Qs(s)
445
445
  };
446
446
  },
447
- [t, r]
447
+ [s, t]
448
448
  );
449
449
  return {
450
450
  displayPreferences: a,
451
451
  shouldShowElement: c,
452
- permissions: u,
453
- currentUser: t
452
+ permissions: m,
453
+ currentUser: s
454
454
  };
455
455
  }
456
- const lr = async (a, n, t) => {
457
- const r = `${a}/management/v1/groups`;
458
- return await za(r, n, t);
459
- }, cr = async (a, n, t) => {
460
- const r = `${a}/management/v1/groups/${t}`, i = await fetch(r, {
461
- method: "DELETE",
462
- headers: {
463
- Authorization: `Bearer ${n}`
464
- }
465
- });
466
- if (!i.ok) {
467
- const c = await i.text();
468
- throw new Error(c || "Failed to delete group");
469
- }
470
- }, dr = async (a, n, t, r) => {
471
- const i = `${a}/management/v1/groups/${t}/members`;
472
- return await za(i, n, r);
473
- }, ur = async (a, n, t, r) => {
474
- const i = `${a}/management/v1/groups/${t}/members`, c = await fetch(i, {
475
- method: "DELETE",
476
- headers: {
477
- "Content-Type": "application/json",
478
- Authorization: `Bearer ${n}`
479
- },
480
- body: JSON.stringify(r)
481
- });
482
- if (!c.ok) {
483
- const u = await c.text();
484
- throw new Error(u || "Failed to remove group members");
485
- }
456
+ const ur = async (a, n, s) => {
457
+ const t = `${a}/management/v1/groups`;
458
+ return await Ka(t, n, s);
459
+ }, mr = async (a, n, s) => {
460
+ const t = `${a}/management/v1/groups/${s}`;
461
+ await Ba(t, n, "DELETE");
462
+ }, hr = async (a, n, s, t) => {
463
+ const l = `${a}/management/v1/groups/${s}/members`;
464
+ return await Ka(l, n, t);
465
+ }, pr = async (a, n, s, t) => {
466
+ const l = `${a}/management/v1/groups/${s}/members`;
467
+ await Ba(l, n, "DELETE", t);
486
468
  };
487
- function mr() {
488
- const { authToken: a, tokenProps: n } = F(), t = Ae();
469
+ function fr() {
470
+ const { authToken: a, tokenProps: n } = $(), s = Ae();
489
471
  return Me({
490
- mutationFn: (r) => lr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", r),
472
+ mutationFn: (t) => ur(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t),
491
473
  onSuccess: () => {
492
- t.invalidateQueries({ queryKey: ["groups"] }), L.success("Group created successfully");
474
+ s.invalidateQueries({ queryKey: ["groups"] }), k.success("Group created successfully");
493
475
  },
494
- onError: (r) => {
495
- console.error("Failed to create group:", r), L.error("Failed to create group", {
496
- description: r.message
476
+ onError: (t) => {
477
+ console.error("Failed to create group:", t), k.error("Failed to create group", {
478
+ description: Le(t, "Failed to create group")
497
479
  });
498
480
  }
499
481
  });
500
482
  }
501
- function hr() {
502
- const { authToken: a, tokenProps: n } = F(), t = Ae();
483
+ function gr() {
484
+ const { authToken: a, tokenProps: n } = $(), s = Ae();
503
485
  return Me({
504
- mutationFn: (r) => cr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", r),
505
- onSuccess: (r, i) => {
506
- t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", i] }), L.success("Group deleted successfully");
486
+ mutationFn: (t) => mr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t),
487
+ onSuccess: (t, l) => {
488
+ s.invalidateQueries({ queryKey: ["groups"] }), s.removeQueries({ queryKey: ["group", l] }), k.success("Group deleted successfully");
507
489
  },
508
- onError: (r) => {
509
- console.error("Failed to delete group:", r), L.error("Failed to delete group", {
510
- description: r.message
490
+ onError: (t) => {
491
+ console.error("Failed to delete group:", t), k.error("Failed to delete group", {
492
+ description: Le(t, "Failed to delete group")
511
493
  });
512
494
  }
513
495
  });
514
496
  }
515
- function pr() {
516
- const { authToken: a, tokenProps: n } = F(), t = Ae();
497
+ function vr() {
498
+ const { authToken: a, tokenProps: n } = $(), s = Ae();
517
499
  return Me({
518
500
  mutationFn: ({
519
- groupId: r,
520
- data: i
521
- }) => dr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", r, i),
522
- onSuccess: (r, i) => {
523
- t.invalidateQueries({ queryKey: ["group", i.groupId] }), t.invalidateQueries({
524
- queryKey: ["group-members", i.groupId]
525
- }), t.invalidateQueries({ queryKey: ["groups"] }), L.success("Members added successfully");
501
+ groupId: t,
502
+ data: l
503
+ }) => hr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t, l),
504
+ onSuccess: (t, l) => {
505
+ s.invalidateQueries({ queryKey: ["group", l.groupId] }), s.invalidateQueries({
506
+ queryKey: ["group-members", l.groupId]
507
+ }), s.invalidateQueries({ queryKey: ["groups"] }), k.success("Members added successfully");
526
508
  },
527
- onError: (r) => {
528
- console.error("Failed to add group members:", r), L.error("Failed to add members", {
529
- description: r.message
509
+ onError: (t) => {
510
+ console.error("Failed to add group members:", t), k.error("Failed to add members", {
511
+ description: Le(t, "Failed to add members")
530
512
  });
531
513
  }
532
514
  });
533
515
  }
534
- function fr() {
535
- const { authToken: a, tokenProps: n } = F(), t = Ae();
516
+ function br() {
517
+ const { authToken: a, tokenProps: n } = $(), s = Ae();
536
518
  return Me({
537
519
  mutationFn: ({
538
- groupId: r,
539
- data: i
540
- }) => ur(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", r, i),
541
- onSuccess: (r, i) => {
542
- t.invalidateQueries({ queryKey: ["group", i.groupId] }), t.invalidateQueries({
543
- queryKey: ["group-members", i.groupId]
544
- }), t.invalidateQueries({ queryKey: ["groups"] }), L.success("Members removed successfully");
520
+ groupId: t,
521
+ data: l
522
+ }) => pr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t, l),
523
+ onSuccess: (t, l) => {
524
+ s.invalidateQueries({ queryKey: ["group", l.groupId] }), s.invalidateQueries({
525
+ queryKey: ["group-members", l.groupId]
526
+ }), s.invalidateQueries({ queryKey: ["groups"] }), k.success("Members removed successfully");
545
527
  },
546
- onError: (r) => {
547
- console.error("Failed to remove group members:", r), L.error("Failed to remove members", {
548
- description: r.message
528
+ onError: (t) => {
529
+ console.error("Failed to remove group members:", t), k.error("Failed to remove members", {
530
+ description: Le(t, "Failed to remove members")
549
531
  });
550
532
  }
551
533
  });
552
534
  }
553
- function gr({
535
+ function yr({
554
536
  onSuccess: a,
555
537
  tenantId: n,
556
- isTenantUser: t
538
+ isTenantUser: s
557
539
  }) {
558
- const [r, i] = N(""), [c, u] = N(""), [m, p] = N({}), y = mr(), h = () => {
540
+ const [t, l] = N(""), [c, m] = N(""), [u, p] = N({}), y = fr(), h = () => {
559
541
  const d = {};
560
- return r.trim() ? r.length < 3 ? d.name = "Group name must be at least 3 characters" : r.length > 50 && (d.name = "Group name must be less than 50 characters") : d.name = "Group name is required", c && c.length > 200 && (d.description = "Description must be less than 200 characters"), p(d), Object.keys(d).length === 0;
542
+ return t.trim() ? t.length < 3 ? d.name = "Group name must be at least 3 characters" : t.length > 50 && (d.name = "Group name must be less than 50 characters") : d.name = "Group name is required", c && c.length > 200 && (d.description = "Description must be less than 200 characters"), p(d), Object.keys(d).length === 0;
561
543
  };
562
544
  return /* @__PURE__ */ o("form", { onSubmit: async (d) => {
563
545
  if (d.preventDefault(), !h()) return;
564
546
  const f = {
565
- name: r.trim(),
547
+ name: t.trim(),
566
548
  description: c.trim() || void 0,
567
- type: t ? "TENANT_GROUP" : "ORG_GROUP",
568
- ...t && n ? { tenantId: n } : {}
549
+ type: s ? "TENANT_GROUP" : "ORG_GROUP",
550
+ ...s && n ? { tenantId: n } : {}
569
551
  };
570
552
  try {
571
- await y.mutateAsync(f), i(""), u(""), p({}), a();
553
+ await y.mutateAsync(f), l(""), m(""), p({}), a();
572
554
  } catch (v) {
573
555
  console.error("Failed to create group:", v);
574
556
  }
575
557
  }, className: "space-y-6", children: [
576
558
  /* @__PURE__ */ o("div", { className: "space-y-4", children: [
577
559
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
578
- /* @__PURE__ */ o(Ke, { htmlFor: "group-name", children: [
560
+ /* @__PURE__ */ o(Qe, { htmlFor: "group-name", children: [
579
561
  "Group Name ",
580
562
  /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
581
563
  ] }),
@@ -584,43 +566,43 @@ function gr({
584
566
  {
585
567
  id: "group-name",
586
568
  placeholder: "e.g., Marketing Team, Engineering Squad",
587
- value: r,
569
+ value: t,
588
570
  onChange: (d) => {
589
- i(d.target.value), m.name && p((f) => ({ ...f, name: "" }));
571
+ l(d.target.value), u.name && p((f) => ({ ...f, name: "" }));
590
572
  },
591
- className: m.name ? "border-destructive" : "",
573
+ className: u.name ? "border-destructive" : "",
592
574
  disabled: y.isPending
593
575
  }
594
576
  ),
595
- m.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.name })
577
+ u.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.name })
596
578
  ] }),
597
579
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
598
- /* @__PURE__ */ o(Ke, { htmlFor: "group-description", children: [
580
+ /* @__PURE__ */ o(Qe, { htmlFor: "group-description", children: [
599
581
  "Description",
600
582
  /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
601
583
  ] }),
602
584
  /* @__PURE__ */ e(
603
- Js,
585
+ Zs,
604
586
  {
605
587
  id: "group-description",
606
588
  placeholder: "Describe the purpose of this group...",
607
589
  value: c,
608
590
  onChange: (d) => {
609
- u(d.target.value), m.description && p((f) => ({ ...f, description: "" }));
591
+ m(d.target.value), u.description && p((f) => ({ ...f, description: "" }));
610
592
  },
611
- className: m.description ? "border-destructive" : "",
593
+ className: u.description ? "border-destructive" : "",
612
594
  disabled: y.isPending,
613
595
  rows: 3
614
596
  }
615
597
  ),
616
- m.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.description }),
598
+ u.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.description }),
617
599
  /* @__PURE__ */ o("p", { className: "text-xs text-muted-foreground", children: [
618
600
  c.length,
619
601
  "/200 characters"
620
602
  ] })
621
603
  ] }),
622
604
  /* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ o("div", { className: "flex gap-3", children: [
623
- /* @__PURE__ */ e(Xs, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
605
+ /* @__PURE__ */ e(et, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
624
606
  /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: "This group will be accessible to users in your workspace. You can add members after creating the group." })
625
607
  ] }) })
626
608
  ] }),
@@ -631,7 +613,7 @@ function gr({
631
613
  type: "button",
632
614
  variant: "outline",
633
615
  onClick: () => {
634
- i(""), u(""), p({});
616
+ l(""), m(""), p({});
635
617
  },
636
618
  disabled: y.isPending,
637
619
  children: "Clear"
@@ -641,12 +623,12 @@ function gr({
641
623
  M,
642
624
  {
643
625
  type: "submit",
644
- disabled: y.isPending || !r.trim(),
645
- children: y.isPending ? /* @__PURE__ */ o(k, { children: [
646
- /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
626
+ disabled: y.isPending || !t.trim(),
627
+ children: y.isPending ? /* @__PURE__ */ o(I, { children: [
628
+ /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
647
629
  "Creating..."
648
- ] }) : /* @__PURE__ */ o(k, { children: [
649
- /* @__PURE__ */ e(W, { className: "mr-2 h-4 w-4" }),
630
+ ] }) : /* @__PURE__ */ o(I, { children: [
631
+ /* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
650
632
  "Create Group"
651
633
  ] })
652
634
  }
@@ -654,59 +636,59 @@ function gr({
654
636
  ] })
655
637
  ] });
656
638
  }
657
- function vr(a, n = []) {
658
- let t = [];
659
- function r(c, u) {
660
- const m = A.createContext(u);
661
- m.displayName = c + "Context";
662
- const p = t.length;
663
- t = [...t, u];
664
- const y = (s) => {
639
+ function Nr(a, n = []) {
640
+ let s = [];
641
+ function t(c, m) {
642
+ const u = A.createContext(m);
643
+ u.displayName = c + "Context";
644
+ const p = s.length;
645
+ s = [...s, m];
646
+ const y = (r) => {
665
647
  var C;
666
- const { scope: d, children: f, ...v } = s, b = ((C = d == null ? void 0 : d[a]) == null ? void 0 : C[p]) || m, S = A.useMemo(() => v, Object.values(v));
648
+ const { scope: d, children: f, ...v } = r, b = ((C = d == null ? void 0 : d[a]) == null ? void 0 : C[p]) || u, S = A.useMemo(() => v, Object.values(v));
667
649
  return /* @__PURE__ */ e(b.Provider, { value: S, children: f });
668
650
  };
669
651
  y.displayName = c + "Provider";
670
- function h(s, d) {
652
+ function h(r, d) {
671
653
  var b;
672
- const f = ((b = d == null ? void 0 : d[a]) == null ? void 0 : b[p]) || m, v = A.useContext(f);
654
+ const f = ((b = d == null ? void 0 : d[a]) == null ? void 0 : b[p]) || u, v = A.useContext(f);
673
655
  if (v) return v;
674
- if (u !== void 0) return u;
675
- throw new Error(`\`${s}\` must be used within \`${c}\``);
656
+ if (m !== void 0) return m;
657
+ throw new Error(`\`${r}\` must be used within \`${c}\``);
676
658
  }
677
659
  return [y, h];
678
660
  }
679
- const i = () => {
680
- const c = t.map((u) => A.createContext(u));
681
- return function(m) {
682
- const p = (m == null ? void 0 : m[a]) || c;
661
+ const l = () => {
662
+ const c = s.map((m) => A.createContext(m));
663
+ return function(u) {
664
+ const p = (u == null ? void 0 : u[a]) || c;
683
665
  return A.useMemo(
684
- () => ({ [`__scope${a}`]: { ...m, [a]: p } }),
685
- [m, p]
666
+ () => ({ [`__scope${a}`]: { ...u, [a]: p } }),
667
+ [u, p]
686
668
  );
687
669
  };
688
670
  };
689
- return i.scopeName = a, [r, br(i, ...n)];
671
+ return l.scopeName = a, [t, Sr(l, ...n)];
690
672
  }
691
- function br(...a) {
673
+ function Sr(...a) {
692
674
  const n = a[0];
693
675
  if (a.length === 1) return n;
694
- const t = () => {
695
- const r = a.map((i) => ({
696
- useScope: i(),
697
- scopeName: i.scopeName
676
+ const s = () => {
677
+ const t = a.map((l) => ({
678
+ useScope: l(),
679
+ scopeName: l.scopeName
698
680
  }));
699
681
  return function(c) {
700
- const u = r.reduce((m, { useScope: p, scopeName: y }) => {
701
- const s = p(c)[`__scope${y}`];
702
- return { ...m, ...s };
682
+ const m = t.reduce((u, { useScope: p, scopeName: y }) => {
683
+ const r = p(c)[`__scope${y}`];
684
+ return { ...u, ...r };
703
685
  }, {});
704
- return A.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
686
+ return A.useMemo(() => ({ [`__scope${n.scopeName}`]: m }), [m]);
705
687
  };
706
688
  };
707
- return t.scopeName = n.scopeName, t;
689
+ return s.scopeName = n.scopeName, s;
708
690
  }
709
- var yr = [
691
+ var xr = [
710
692
  "a",
711
693
  "button",
712
694
  "div",
@@ -724,156 +706,156 @@ var yr = [
724
706
  "span",
725
707
  "svg",
726
708
  "ul"
727
- ], ha = yr.reduce((a, n) => {
728
- const t = Ys(`Primitive.${n}`), r = A.forwardRef((i, c) => {
729
- const { asChild: u, ...m } = i, p = u ? t : n;
730
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...m, ref: c });
709
+ ], pa = xr.reduce((a, n) => {
710
+ const s = at(`Primitive.${n}`), t = A.forwardRef((l, c) => {
711
+ const { asChild: m, ...u } = l, p = m ? s : n;
712
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...u, ref: c });
731
713
  });
732
- return r.displayName = `Primitive.${n}`, { ...a, [n]: r };
714
+ return t.displayName = `Primitive.${n}`, { ...a, [n]: t };
733
715
  }, {});
734
- function Nr() {
735
- return ar.useSyncExternalStore(
736
- Sr,
716
+ function Dr() {
717
+ return rr.useSyncExternalStore(
718
+ wr,
737
719
  () => !0,
738
720
  () => !1
739
721
  );
740
722
  }
741
- function Sr() {
723
+ function wr() {
742
724
  return () => {
743
725
  };
744
726
  }
745
- var pa = "Avatar", [xr] = vr(pa), [wr, ns] = xr(pa), os = A.forwardRef(
727
+ var fa = "Avatar", [Cr] = Nr(fa), [Er, is] = Cr(fa), ls = A.forwardRef(
746
728
  (a, n) => {
747
- const { __scopeAvatar: t, ...r } = a, [i, c] = A.useState("idle");
729
+ const { __scopeAvatar: s, ...t } = a, [l, c] = A.useState("idle");
748
730
  return /* @__PURE__ */ e(
749
- wr,
731
+ Er,
750
732
  {
751
- scope: t,
752
- imageLoadingStatus: i,
733
+ scope: s,
734
+ imageLoadingStatus: l,
753
735
  onImageLoadingStatusChange: c,
754
- children: /* @__PURE__ */ e(ha.span, { ...r, ref: n })
736
+ children: /* @__PURE__ */ e(pa.span, { ...t, ref: n })
755
737
  }
756
738
  );
757
739
  }
758
740
  );
759
- os.displayName = pa;
760
- var is = "AvatarImage", ls = A.forwardRef(
741
+ ls.displayName = fa;
742
+ var cs = "AvatarImage", ds = A.forwardRef(
761
743
  (a, n) => {
762
- const { __scopeAvatar: t, src: r, onLoadingStatusChange: i = () => {
763
- }, ...c } = a, u = ns(is, t), m = Dr(r, c), p = Zs((y) => {
764
- i(y), u.onImageLoadingStatusChange(y);
744
+ const { __scopeAvatar: s, src: t, onLoadingStatusChange: l = () => {
745
+ }, ...c } = a, m = is(cs, s), u = Ar(t, c), p = st((y) => {
746
+ l(y), m.onImageLoadingStatusChange(y);
765
747
  });
766
- return We(() => {
767
- m !== "idle" && p(m);
768
- }, [m, p]), m === "loaded" ? /* @__PURE__ */ e(ha.img, { ...c, ref: n, src: r }) : null;
748
+ return Je(() => {
749
+ u !== "idle" && p(u);
750
+ }, [u, p]), u === "loaded" ? /* @__PURE__ */ e(pa.img, { ...c, ref: n, src: t }) : null;
769
751
  }
770
752
  );
771
- ls.displayName = is;
772
- var cs = "AvatarFallback", ds = A.forwardRef(
753
+ ds.displayName = cs;
754
+ var us = "AvatarFallback", ms = A.forwardRef(
773
755
  (a, n) => {
774
- const { __scopeAvatar: t, delayMs: r, ...i } = a, c = ns(cs, t), [u, m] = A.useState(r === void 0);
756
+ const { __scopeAvatar: s, delayMs: t, ...l } = a, c = is(us, s), [m, u] = A.useState(t === void 0);
775
757
  return A.useEffect(() => {
776
- if (r !== void 0) {
777
- const p = window.setTimeout(() => m(!0), r);
758
+ if (t !== void 0) {
759
+ const p = window.setTimeout(() => u(!0), t);
778
760
  return () => window.clearTimeout(p);
779
761
  }
780
- }, [r]), u && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(ha.span, { ...i, ref: n }) : null;
762
+ }, [t]), m && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(pa.span, { ...l, ref: n }) : null;
781
763
  }
782
764
  );
783
- ds.displayName = cs;
784
- function $a(a, n) {
765
+ ms.displayName = us;
766
+ function Va(a, n) {
785
767
  return a ? n ? (a.src !== n && (a.src = n), a.complete && a.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
786
768
  }
787
- function Dr(a, { referrerPolicy: n, crossOrigin: t }) {
788
- const r = Nr(), i = A.useRef(null), c = r ? (i.current || (i.current = new window.Image()), i.current) : null, [u, m] = A.useState(
789
- () => $a(c, a)
769
+ function Ar(a, { referrerPolicy: n, crossOrigin: s }) {
770
+ const t = Dr(), l = A.useRef(null), c = t ? (l.current || (l.current = new window.Image()), l.current) : null, [m, u] = A.useState(
771
+ () => Va(c, a)
790
772
  );
791
- return We(() => {
792
- m($a(c, a));
793
- }, [c, a]), We(() => {
794
- const p = (s) => () => {
795
- m(s);
773
+ return Je(() => {
774
+ u(Va(c, a));
775
+ }, [c, a]), Je(() => {
776
+ const p = (r) => () => {
777
+ u(r);
796
778
  };
797
779
  if (!c) return;
798
780
  const y = p("loaded"), h = p("error");
799
- return c.addEventListener("load", y), c.addEventListener("error", h), n && (c.referrerPolicy = n), typeof t == "string" && (c.crossOrigin = t), () => {
781
+ return c.addEventListener("load", y), c.addEventListener("error", h), n && (c.referrerPolicy = n), typeof s == "string" && (c.crossOrigin = s), () => {
800
782
  c.removeEventListener("load", y), c.removeEventListener("error", h);
801
783
  };
802
- }, [c, t, n]), u;
784
+ }, [c, s, n]), m;
803
785
  }
804
- var us = os, ms = ls, hs = ds;
805
- const fa = A.forwardRef(({ className: a, ...n }, t) => /* @__PURE__ */ e(
806
- us,
786
+ var hs = ls, ps = ds, fs = ms;
787
+ const ga = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
788
+ hs,
807
789
  {
808
- ref: t,
809
- className: X(
790
+ ref: s,
791
+ className: Y(
810
792
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
811
793
  a
812
794
  ),
813
795
  ...n
814
796
  }
815
797
  ));
816
- fa.displayName = us.displayName;
817
- const Cr = A.forwardRef(({ className: a, ...n }, t) => /* @__PURE__ */ e(
818
- ms,
798
+ ga.displayName = hs.displayName;
799
+ const Mr = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
800
+ ps,
819
801
  {
820
- ref: t,
821
- className: X("aspect-square h-full w-full", a),
802
+ ref: s,
803
+ className: Y("aspect-square h-full w-full", a),
822
804
  ...n
823
805
  }
824
806
  ));
825
- Cr.displayName = ms.displayName;
826
- const ga = A.forwardRef(({ className: a, ...n }, t) => /* @__PURE__ */ e(
827
- hs,
807
+ Mr.displayName = ps.displayName;
808
+ const va = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
809
+ fs,
828
810
  {
829
- ref: t,
830
- className: X(
811
+ ref: s,
812
+ className: Y(
831
813
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
832
814
  a
833
815
  ),
834
816
  ...n
835
817
  }
836
818
  ));
837
- ga.displayName = hs.displayName;
838
- function Er({
819
+ va.displayName = fs.displayName;
820
+ function Lr({
839
821
  open: a,
840
822
  onOpenChange: n,
841
- group: t,
842
- onUpdate: r
823
+ group: s,
824
+ onUpdate: t
843
825
  }) {
844
- const [i, c] = N("members"), [u, m] = N(""), [p, y] = N([]), [h, s] = N([]), { data: d, isLoading: f, refetch: v } = et(t.id), b = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: S, isLoading: C } = at({
826
+ const [l, c] = N("members"), [m, u] = N(""), [p, y] = N([]), [h, r] = N([]), { data: d, isLoading: f, refetch: v } = tt(s.id), b = s.type === "TENANT_GROUP" ? "tenant" : "organization", { users: S, isLoading: C } = rt({
845
827
  type: b,
846
- tenantId: t.tenantId || void 0,
828
+ tenantId: s.tenantId || void 0,
847
829
  active: !0,
848
830
  limit: 100
849
- }), P = pr(), U = fr(), _ = (d == null ? void 0 : d.members) || [], $ = Q(() => new Set(_.map((g) => g.userId)), [_]), V = Q(() => S.filter((g) => !$.has(g.id)), [S, $]), q = Q(() => {
850
- if (!u) return V;
851
- const g = u.toLowerCase();
852
- return V.filter(
831
+ }), P = vr(), U = br(), _ = (d == null ? void 0 : d.members) || [], V = W(() => new Set(_.map((g) => g.userId)), [_]), q = W(() => S.filter((g) => !V.has(g.id)), [S, V]), H = W(() => {
832
+ if (!m) return q;
833
+ const g = m.toLowerCase();
834
+ return q.filter(
853
835
  (E) => {
854
- var I, R;
855
- return ((I = E.name) == null ? void 0 : I.toLowerCase().includes(g)) || ((R = E.email) == null ? void 0 : R.toLowerCase().includes(g));
836
+ var O, F;
837
+ return ((O = E.name) == null ? void 0 : O.toLowerCase().includes(g)) || ((F = E.email) == null ? void 0 : F.toLowerCase().includes(g));
856
838
  }
857
839
  );
858
- }, [V, u]), w = Q(() => {
859
- if (!u) return _;
860
- const g = u.toLowerCase();
840
+ }, [q, m]), D = W(() => {
841
+ if (!m) return _;
842
+ const g = m.toLowerCase();
861
843
  return _.filter(
862
844
  (E) => {
863
- var I, R, j, ee;
864
- return ((R = (I = E.user) == null ? void 0 : I.name) == null ? void 0 : R.toLowerCase().includes(g)) || ((ee = (j = E.user) == null ? void 0 : j.email) == null ? void 0 : ee.toLowerCase().includes(g));
845
+ var O, F, z, ae;
846
+ return ((F = (O = E.user) == null ? void 0 : O.name) == null ? void 0 : F.toLowerCase().includes(g)) || ((ae = (z = E.user) == null ? void 0 : z.email) == null ? void 0 : ae.toLowerCase().includes(g));
865
847
  }
866
848
  );
867
- }, [_, u]), H = async () => {
849
+ }, [_, m]), j = async () => {
868
850
  if (p.length !== 0)
869
851
  try {
870
852
  await P.mutateAsync({
871
- groupId: t.id,
853
+ groupId: s.id,
872
854
  data: {
873
855
  userIds: p,
874
856
  userType: b === "tenant" ? "tenant" : "org"
875
857
  }
876
- }), y([]), c("members"), v(), r == null || r();
858
+ }), y([]), c("members"), v(), t == null || t();
877
859
  } catch (g) {
878
860
  console.error("Failed to add members:", g);
879
861
  }
@@ -881,26 +863,26 @@ function Er({
881
863
  if (h.length !== 0)
882
864
  try {
883
865
  await U.mutateAsync({
884
- groupId: t.id,
866
+ groupId: s.id,
885
867
  data: {
886
868
  userIds: h
887
869
  }
888
- }), s([]), v(), r == null || r();
870
+ }), r([]), v(), t == null || t();
889
871
  } catch (g) {
890
872
  console.error("Failed to remove members:", g);
891
873
  }
892
- }, Z = (g) => {
874
+ }, ee = (g) => {
893
875
  y(
894
- (E) => E.includes(g) ? E.filter((I) => I !== g) : [...E, g]
876
+ (E) => E.includes(g) ? E.filter((O) => O !== g) : [...E, g]
895
877
  );
896
- }, Le = (g) => {
897
- s(
898
- (E) => E.includes(g) ? E.filter((I) => I !== g) : [...E, g]
878
+ }, ke = (g) => {
879
+ r(
880
+ (E) => E.includes(g) ? E.filter((O) => O !== g) : [...E, g]
899
881
  );
900
882
  };
901
- return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(ia, { open: a, onOpenChange: n, children: /* @__PURE__ */ o(ca, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
902
- /* @__PURE__ */ o(da, { children: [
903
- /* @__PURE__ */ e(ua, { children: t.name }),
883
+ return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(la, { open: a, onOpenChange: n, children: /* @__PURE__ */ o(da, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
884
+ /* @__PURE__ */ o(ua, { children: [
885
+ /* @__PURE__ */ e(ma, { children: s.name }),
904
886
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ o("p", { className: "text-sm text-muted-foreground", children: [
905
887
  _.length,
906
888
  " ",
@@ -908,40 +890,40 @@ function Er({
908
890
  ] }) }),
909
891
  /* @__PURE__ */ o("p", { id: "group-members-description", className: "sr-only", children: [
910
892
  "Add or remove members from the ",
911
- t.name,
893
+ s.name,
912
894
  " group"
913
895
  ] })
914
896
  ] }),
915
- /* @__PURE__ */ o(Ba, { value: i, onValueChange: (g) => {
916
- c(g), m(""), s([]);
897
+ /* @__PURE__ */ o(Qa, { value: l, onValueChange: (g) => {
898
+ c(g), u(""), r([]);
917
899
  }, className: "mt-4", children: [
918
- /* @__PURE__ */ o(Ka, { className: "grid w-full grid-cols-2", children: [
900
+ /* @__PURE__ */ o(Wa, { className: "grid w-full grid-cols-2", children: [
919
901
  /* @__PURE__ */ e(Ce, { value: "members", children: "Current Members" }),
920
902
  /* @__PURE__ */ e(Ce, { value: "add", children: "Add Members" })
921
903
  ] }),
922
904
  /* @__PURE__ */ o(Ee, { value: "members", className: "mt-4 space-y-4", children: [
923
905
  /* @__PURE__ */ o("div", { className: "relative", children: [
924
- /* @__PURE__ */ e(Je, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
906
+ /* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
925
907
  /* @__PURE__ */ e(
926
908
  ce,
927
909
  {
928
910
  placeholder: "Search members...",
929
- value: u,
930
- onChange: (g) => m(g.target.value),
911
+ value: m,
912
+ onChange: (g) => u(g.target.value),
931
913
  className: "pl-10"
932
914
  }
933
915
  )
934
916
  ] }),
935
- /* @__PURE__ */ e(Xe, { className: h.length > 0 ? "h-[300px]" : "h-[350px]", children: f ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ye, { className: "h-16 w-full" }, g)) }) : w.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
936
- /* @__PURE__ */ e(W, { className: "h-12 w-12 mb-3 opacity-50" }),
937
- /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
938
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
939
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: w.map((g) => /* @__PURE__ */ e(
940
- Ar,
917
+ /* @__PURE__ */ e(Ye, { className: h.length > 0 ? "h-[300px]" : "h-[350px]", children: f ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ze, { className: "h-16 w-full" }, g)) }) : D.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
918
+ /* @__PURE__ */ e(J, { className: "h-12 w-12 mb-3 opacity-50" }),
919
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: m ? "No members found" : "No members yet" }),
920
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: m ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
921
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((g) => /* @__PURE__ */ e(
922
+ kr,
941
923
  {
942
924
  member: g,
943
925
  selected: h.includes(g.userId),
944
- onToggle: () => Le(g.userId)
926
+ onToggle: () => ke(g.userId)
945
927
  },
946
928
  g.id
947
929
  )) }) }),
@@ -959,11 +941,11 @@ function Er({
959
941
  size: "sm",
960
942
  onClick: ue,
961
943
  disabled: U.isPending,
962
- children: U.isPending ? /* @__PURE__ */ o(k, { children: [
963
- /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
944
+ children: U.isPending ? /* @__PURE__ */ o(I, { children: [
945
+ /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
964
946
  "Removing..."
965
- ] }) : /* @__PURE__ */ o(k, { children: [
966
- /* @__PURE__ */ e(Qa, { className: "mr-2 h-4 w-4" }),
947
+ ] }) : /* @__PURE__ */ o(I, { children: [
948
+ /* @__PURE__ */ e(Ja, { className: "mr-2 h-4 w-4" }),
967
949
  "Remove Selected"
968
950
  ] })
969
951
  }
@@ -972,27 +954,27 @@ function Er({
972
954
  ] }),
973
955
  /* @__PURE__ */ o(Ee, { value: "add", className: "mt-4 space-y-4", children: [
974
956
  /* @__PURE__ */ o("div", { className: "relative", children: [
975
- /* @__PURE__ */ e(Je, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
957
+ /* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
976
958
  /* @__PURE__ */ e(
977
959
  ce,
978
960
  {
979
961
  placeholder: "Search users to add...",
980
- value: u,
981
- onChange: (g) => m(g.target.value),
962
+ value: m,
963
+ onChange: (g) => u(g.target.value),
982
964
  className: "pl-10"
983
965
  }
984
966
  )
985
967
  ] }),
986
- /* @__PURE__ */ e(Xe, { className: "h-[300px]", children: C ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ye, { className: "h-16 w-full" }, g)) }) : q.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
987
- /* @__PURE__ */ e(Ze, { className: "h-12 w-12 mb-3 opacity-50" }),
968
+ /* @__PURE__ */ e(Ye, { className: "h-[300px]", children: C ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ze, { className: "h-16 w-full" }, g)) }) : H.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
969
+ /* @__PURE__ */ e(ea, { className: "h-12 w-12 mb-3 opacity-50" }),
988
970
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
989
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
990
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: q.map((g) => /* @__PURE__ */ e(
991
- Mr,
971
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: m ? "Try a different search" : "All eligible users are already members" })
972
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: H.map((g) => /* @__PURE__ */ e(
973
+ Ir,
992
974
  {
993
975
  user: g,
994
976
  selected: p.includes(g.id),
995
- onToggle: () => Z(g.id)
977
+ onToggle: () => ee(g.id)
996
978
  },
997
979
  g.id
998
980
  )) }) }),
@@ -1006,13 +988,13 @@ function Er({
1006
988
  /* @__PURE__ */ e(
1007
989
  M,
1008
990
  {
1009
- onClick: H,
991
+ onClick: j,
1010
992
  disabled: P.isPending,
1011
- children: P.isPending ? /* @__PURE__ */ o(k, { children: [
1012
- /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
993
+ children: P.isPending ? /* @__PURE__ */ o(I, { children: [
994
+ /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
1013
995
  "Adding..."
1014
- ] }) : /* @__PURE__ */ o(k, { children: [
1015
- /* @__PURE__ */ e(Ze, { className: "mr-2 h-4 w-4" }),
996
+ ] }) : /* @__PURE__ */ o(I, { children: [
997
+ /* @__PURE__ */ e(ea, { className: "mr-2 h-4 w-4" }),
1016
998
  "Add Members"
1017
999
  ] })
1018
1000
  }
@@ -1022,44 +1004,44 @@ function Er({
1022
1004
  ] })
1023
1005
  ] }) }) });
1024
1006
  }
1025
- function Ar({
1007
+ function kr({
1026
1008
  member: a,
1027
1009
  selected: n,
1028
- onToggle: t
1010
+ onToggle: s
1029
1011
  }) {
1030
- var i, c, u, m;
1031
- const r = ((c = (i = a.user) == null ? void 0 : i.name) == null ? void 0 : c.split(" ").map((p) => p[0]).join("").toUpperCase()) || "?";
1012
+ var l, c, m, u;
1013
+ const t = ((c = (l = a.user) == null ? void 0 : l.name) == null ? void 0 : c.split(" ").map((p) => p[0]).join("").toUpperCase()) || "?";
1032
1014
  return /* @__PURE__ */ o(
1033
1015
  "div",
1034
1016
  {
1035
1017
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
1036
- onClick: t,
1018
+ onClick: s,
1037
1019
  children: [
1038
- /* @__PURE__ */ e(Wa, { checked: n }),
1039
- /* @__PURE__ */ e(fa, { className: "h-8 w-8", children: /* @__PURE__ */ e(ga, { className: "text-xs", children: r }) }),
1020
+ /* @__PURE__ */ e(Xa, { checked: n }),
1021
+ /* @__PURE__ */ e(ga, { className: "h-8 w-8", children: /* @__PURE__ */ e(va, { className: "text-xs", children: t }) }),
1040
1022
  /* @__PURE__ */ o("div", { className: "flex-1", children: [
1041
- /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((u = a.user) == null ? void 0 : u.name) || "Unknown User" }),
1042
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (m = a.user) == null ? void 0 : m.email })
1023
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((m = a.user) == null ? void 0 : m.name) || "Unknown User" }),
1024
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = a.user) == null ? void 0 : u.email })
1043
1025
  ] })
1044
1026
  ]
1045
1027
  }
1046
1028
  );
1047
1029
  }
1048
- function Mr({
1030
+ function Ir({
1049
1031
  user: a,
1050
1032
  selected: n,
1051
- onToggle: t
1033
+ onToggle: s
1052
1034
  }) {
1053
- var i;
1054
- const r = ((i = a.name) == null ? void 0 : i.split(" ").map((c) => c[0]).join("").toUpperCase()) || "?";
1035
+ var l;
1036
+ const t = ((l = a.name) == null ? void 0 : l.split(" ").map((c) => c[0]).join("").toUpperCase()) || "?";
1055
1037
  return /* @__PURE__ */ o(
1056
1038
  "div",
1057
1039
  {
1058
1040
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
1059
- onClick: t,
1041
+ onClick: s,
1060
1042
  children: [
1061
- /* @__PURE__ */ e(Wa, { checked: n }),
1062
- /* @__PURE__ */ e(fa, { className: "h-8 w-8", children: /* @__PURE__ */ e(ga, { className: "text-xs", children: r }) }),
1043
+ /* @__PURE__ */ e(Xa, { checked: n }),
1044
+ /* @__PURE__ */ e(ga, { className: "h-8 w-8", children: /* @__PURE__ */ e(va, { className: "text-xs", children: t }) }),
1063
1045
  /* @__PURE__ */ o("div", { className: "flex-1", children: [
1064
1046
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: a.name }),
1065
1047
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: a.email })
@@ -1068,122 +1050,122 @@ function Mr({
1068
1050
  }
1069
1051
  );
1070
1052
  }
1071
- function Lr({
1053
+ function Or({
1072
1054
  open: a,
1073
1055
  onOpenChange: n
1074
1056
  }) {
1075
- const [t, r] = N("groups"), [i, c] = N(""), [u, m] = N(null), [p, y] = N(!1), [h, s] = N(null), { tokenProps: d } = F(), { currentUser: f } = ma(), v = hr(), b = (f == null ? void 0 : f.type) === "tenant", S = d == null ? void 0 : d.tenantId, { groups: C, isLoading: P, refetch: U } = st({
1057
+ const [s, t] = N("groups"), [l, c] = N(""), [m, u] = N(null), [p, y] = N(!1), [h, r] = N(null), { tokenProps: d } = $(), { currentUser: f } = ha(), v = gr(), b = (f == null ? void 0 : f.type) === "tenant", S = d == null ? void 0 : d.tenantId, { groups: C, isLoading: P, refetch: U } = nt({
1076
1058
  type: b ? "TENANT_GROUP" : "all",
1077
1059
  tenantId: b ? S : void 0,
1078
1060
  includeMembers: !1
1079
1061
  }), _ = C.filter(
1080
- (w) => {
1081
- var H;
1082
- return w.name.toLowerCase().includes(i.toLowerCase()) || ((H = w.description) == null ? void 0 : H.toLowerCase().includes(i.toLowerCase()));
1062
+ (D) => {
1063
+ var j;
1064
+ return D.name.toLowerCase().includes(l.toLowerCase()) || ((j = D.description) == null ? void 0 : j.toLowerCase().includes(l.toLowerCase()));
1083
1065
  }
1084
- ), $ = async () => {
1066
+ ), V = async () => {
1085
1067
  if (h)
1086
1068
  try {
1087
- await v.mutateAsync(h.id), s(null), U();
1088
- } catch (w) {
1089
- console.error("Failed to delete group:", w);
1069
+ await v.mutateAsync(h.id), r(null), U();
1070
+ } catch (D) {
1071
+ console.error("Failed to delete group:", D);
1090
1072
  }
1091
- }, V = (w) => {
1092
- m(w), y(!0);
1093
- }, q = () => {
1094
- r("groups"), U();
1073
+ }, q = (D) => {
1074
+ u(D), y(!0);
1075
+ }, H = () => {
1076
+ t("groups"), U();
1095
1077
  };
1096
- return /* @__PURE__ */ o(k, { children: [
1097
- /* @__PURE__ */ e(ia, { open: a, onOpenChange: n, children: /* @__PURE__ */ o(ca, { className: "max-w-4xl max-h-[80vh]", children: [
1098
- /* @__PURE__ */ o(da, { children: [
1099
- /* @__PURE__ */ o(ua, { className: "flex items-center gap-2", children: [
1100
- /* @__PURE__ */ e(W, { className: "h-5 w-5" }),
1078
+ return /* @__PURE__ */ o(I, { children: [
1079
+ /* @__PURE__ */ e(la, { open: a, onOpenChange: n, children: /* @__PURE__ */ o(da, { className: "max-w-4xl max-h-[80vh]", children: [
1080
+ /* @__PURE__ */ o(ua, { children: [
1081
+ /* @__PURE__ */ o(ma, { className: "flex items-center gap-2", children: [
1082
+ /* @__PURE__ */ e(J, { className: "h-5 w-5" }),
1101
1083
  "Group Management"
1102
1084
  ] }),
1103
- /* @__PURE__ */ e(qa, { children: "Manage your groups, create new groups, and control group membership" })
1085
+ /* @__PURE__ */ e(Ha, { children: "Manage your groups, create new groups, and control group membership" })
1104
1086
  ] }),
1105
- /* @__PURE__ */ o(Ba, { value: t, onValueChange: r, className: "mt-4", children: [
1106
- /* @__PURE__ */ o(Ka, { className: "grid w-full grid-cols-2", children: [
1087
+ /* @__PURE__ */ o(Qa, { value: s, onValueChange: t, className: "mt-4", children: [
1088
+ /* @__PURE__ */ o(Wa, { className: "grid w-full grid-cols-2", children: [
1107
1089
  /* @__PURE__ */ o(Ce, { value: "groups", className: "flex items-center gap-2", children: [
1108
- /* @__PURE__ */ e(W, { className: "h-4 w-4" }),
1090
+ /* @__PURE__ */ e(J, { className: "h-4 w-4" }),
1109
1091
  "Groups"
1110
1092
  ] }),
1111
1093
  /* @__PURE__ */ o(Ce, { value: "create", className: "flex items-center gap-2", children: [
1112
- /* @__PURE__ */ e(la, { className: "h-4 w-4" }),
1094
+ /* @__PURE__ */ e(ca, { className: "h-4 w-4" }),
1113
1095
  "Create Group"
1114
1096
  ] })
1115
1097
  ] }),
1116
1098
  /* @__PURE__ */ e(Ee, { value: "groups", className: "mt-4", children: /* @__PURE__ */ o("div", { className: "space-y-4", children: [
1117
1099
  /* @__PURE__ */ o("div", { className: "relative", children: [
1118
- /* @__PURE__ */ e(Je, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1100
+ /* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1119
1101
  /* @__PURE__ */ e(
1120
1102
  ce,
1121
1103
  {
1122
1104
  placeholder: "Search groups...",
1123
- value: i,
1124
- onChange: (w) => c(w.target.value),
1105
+ value: l,
1106
+ onChange: (D) => c(D.target.value),
1125
1107
  className: "pl-10"
1126
1108
  }
1127
1109
  )
1128
1110
  ] }),
1129
- /* @__PURE__ */ e(Xe, { className: "h-[400px]", children: P ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((w) => /* @__PURE__ */ e(Ye, { className: "h-24 w-full" }, w)) }) : _.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1130
- /* @__PURE__ */ e(W, { className: "h-12 w-12 mb-3 opacity-50" }),
1111
+ /* @__PURE__ */ e(Ye, { className: "h-[400px]", children: P ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Ze, { className: "h-24 w-full" }, D)) }) : _.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1112
+ /* @__PURE__ */ e(J, { className: "h-12 w-12 mb-3 opacity-50" }),
1131
1113
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
1132
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i ? "Try a different search" : "Create your first group to get started" })
1133
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: _.map((w) => /* @__PURE__ */ e(
1134
- kr,
1114
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
1115
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: _.map((D) => /* @__PURE__ */ e(
1116
+ Tr,
1135
1117
  {
1136
- group: w,
1137
- onManageMembers: () => V(w),
1138
- onDelete: () => s(w),
1118
+ group: D,
1119
+ onManageMembers: () => q(D),
1120
+ onDelete: () => r(D),
1139
1121
  currentUserId: f == null ? void 0 : f.id
1140
1122
  },
1141
- w.id
1123
+ D.id
1142
1124
  )) }) })
1143
1125
  ] }) }),
1144
1126
  /* @__PURE__ */ e(Ee, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1145
- gr,
1127
+ yr,
1146
1128
  {
1147
- onSuccess: q,
1129
+ onSuccess: H,
1148
1130
  tenantId: S,
1149
1131
  isTenantUser: b
1150
1132
  }
1151
1133
  ) })
1152
1134
  ] })
1153
1135
  ] }) }),
1154
- u && /* @__PURE__ */ e(
1155
- Er,
1136
+ m && /* @__PURE__ */ e(
1137
+ Lr,
1156
1138
  {
1157
1139
  open: p,
1158
1140
  onOpenChange: y,
1159
- group: u,
1141
+ group: m,
1160
1142
  onUpdate: () => U()
1161
1143
  }
1162
1144
  ),
1163
1145
  /* @__PURE__ */ e(
1164
- Ja,
1146
+ Ya,
1165
1147
  {
1166
1148
  open: !!h,
1167
- onOpenChange: () => s(null),
1168
- children: /* @__PURE__ */ o(Xa, { children: [
1169
- /* @__PURE__ */ o(Ya, { children: [
1170
- /* @__PURE__ */ e(Za, { children: "Delete Group" }),
1171
- /* @__PURE__ */ o(es, { children: [
1149
+ onOpenChange: () => r(null),
1150
+ children: /* @__PURE__ */ o(Za, { children: [
1151
+ /* @__PURE__ */ o(es, { children: [
1152
+ /* @__PURE__ */ e(as, { children: "Delete Group" }),
1153
+ /* @__PURE__ */ o(ss, { children: [
1172
1154
  'Are you sure you want to delete "',
1173
1155
  h == null ? void 0 : h.name,
1174
1156
  '"? This action cannot be undone and will remove all members from the group.'
1175
1157
  ] })
1176
1158
  ] }),
1177
- /* @__PURE__ */ o(as, { children: [
1178
- /* @__PURE__ */ e(ss, { children: "Cancel" }),
1159
+ /* @__PURE__ */ o(ts, { children: [
1160
+ /* @__PURE__ */ e(rs, { children: "Cancel" }),
1179
1161
  /* @__PURE__ */ e(
1180
- ea,
1162
+ aa,
1181
1163
  {
1182
- onClick: $,
1164
+ onClick: V,
1183
1165
  disabled: v.isPending,
1184
1166
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1185
- children: v.isPending ? /* @__PURE__ */ o(k, { children: [
1186
- /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
1167
+ children: v.isPending ? /* @__PURE__ */ o(I, { children: [
1168
+ /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
1187
1169
  "Deleting..."
1188
1170
  ] }) : "Delete Group"
1189
1171
  }
@@ -1194,13 +1176,13 @@ function Lr({
1194
1176
  )
1195
1177
  ] });
1196
1178
  }
1197
- function kr({
1179
+ function Tr({
1198
1180
  group: a,
1199
1181
  onManageMembers: n,
1200
- onDelete: t,
1201
- currentUserId: r
1182
+ onDelete: s,
1183
+ currentUserId: t
1202
1184
  }) {
1203
- const i = a.createdBy === r;
1185
+ const l = a.createdBy === t;
1204
1186
  return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ o("div", { className: "flex items-start justify-between gap-3", children: [
1205
1187
  /* @__PURE__ */ o("div", { className: "flex-1 space-y-2", children: [
1206
1188
  /* @__PURE__ */ o("div", { children: [
@@ -1209,14 +1191,14 @@ function kr({
1209
1191
  ] }),
1210
1192
  /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
1211
1193
  /* @__PURE__ */ o("span", { className: "flex items-center gap-1", children: [
1212
- /* @__PURE__ */ e(W, { className: "h-3 w-3" }),
1194
+ /* @__PURE__ */ e(J, { className: "h-3 w-3" }),
1213
1195
  a.memberCount,
1214
1196
  " ",
1215
1197
  a.memberCount === 1 ? "member" : "members"
1216
1198
  ] }),
1217
1199
  /* @__PURE__ */ o("span", { children: [
1218
1200
  "Created ",
1219
- jt(new Date(a.createdAt), "MMM d, yyyy")
1201
+ Kt(new Date(a.createdAt), "MMM d, yyyy")
1220
1202
  ] })
1221
1203
  ] })
1222
1204
  ] }),
@@ -1228,304 +1210,312 @@ function kr({
1228
1210
  size: "sm",
1229
1211
  onClick: n,
1230
1212
  title: "Manage members",
1231
- children: /* @__PURE__ */ e(Ze, { className: "h-4 w-4" })
1213
+ children: /* @__PURE__ */ e(ea, { className: "h-4 w-4" })
1232
1214
  }
1233
1215
  ),
1234
- i && /* @__PURE__ */ e(
1216
+ l && /* @__PURE__ */ e(
1235
1217
  M,
1236
1218
  {
1237
1219
  variant: "ghost",
1238
1220
  size: "sm",
1239
- onClick: t,
1221
+ onClick: s,
1240
1222
  title: "Delete group",
1241
1223
  className: "text-destructive hover:text-destructive",
1242
- children: /* @__PURE__ */ e(Qa, { className: "h-4 w-4" })
1224
+ children: /* @__PURE__ */ e(Ja, { className: "h-4 w-4" })
1243
1225
  }
1244
1226
  )
1245
1227
  ] })
1246
1228
  ] }) });
1247
1229
  }
1248
- function ie(a, n, t) {
1249
- var c, u;
1250
- const r = (a.controls || []).find(
1251
- (m) => m.id === t
1230
+ function ie(a, n, s) {
1231
+ var c, m;
1232
+ const t = (a.controls || []).find(
1233
+ (u) => u.id === s
1252
1234
  );
1253
- if (r)
1254
- return r.label;
1255
- const i = (u = (c = ts(a, n)) == null ? void 0 : c.controls) == null ? void 0 : u.find(
1256
- (m) => m.id === t
1235
+ if (t)
1236
+ return t.label;
1237
+ const l = (m = (c = ns(a, n)) == null ? void 0 : c.controls) == null ? void 0 : m.find(
1238
+ (u) => u.id === s
1257
1239
  );
1258
- return (i == null ? void 0 : i.label) || t;
1240
+ return (l == null ? void 0 : l.label) || s;
1259
1241
  }
1260
1242
  function le(a, n) {
1261
- var t;
1262
- return ((t = ts(a, n)) == null ? void 0 : t.title) || n;
1243
+ var s;
1244
+ return ((s = ns(a, n)) == null ? void 0 : s.title) || n;
1263
1245
  }
1264
- function Ir(a) {
1265
- const { errors: n, dashboard: t } = a;
1266
- if (!t)
1246
+ function _r(a) {
1247
+ const { errors: n, dashboard: s } = a;
1248
+ if (!s)
1267
1249
  return n;
1268
- const r = /* @__PURE__ */ new Map();
1269
- for (const i of n) {
1270
- const c = i.match(
1250
+ const t = /* @__PURE__ */ new Map();
1251
+ for (const l of n) {
1252
+ const c = l.match(
1271
1253
  /^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
1272
1254
  );
1273
1255
  if (c) {
1274
- const [, h, s] = c, d = `${h}:${s}:missing-metric`;
1275
- r.has(d) || r.set(
1256
+ const [, h, r] = c, d = `${h}:${r}:missing-metric`;
1257
+ t.has(d) || t.set(
1276
1258
  d,
1277
- `"${le(t, h)}" has an outdated "${ie(
1278
- t,
1259
+ `"${le(s, h)}" has an outdated "${ie(
1260
+ s,
1279
1261
  h,
1280
- s
1262
+ r
1281
1263
  )}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
1282
1264
  );
1283
1265
  continue;
1284
1266
  }
1285
- const u = i.match(
1267
+ const m = l.match(
1286
1268
  /^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
1287
1269
  );
1288
- if (u) {
1289
- const [, h, s] = u, d = `${h}:${s}:missing-group-by`;
1290
- r.has(d) || r.set(
1270
+ if (m) {
1271
+ const [, h, r] = m, d = `${h}:${r}:missing-group-by`;
1272
+ t.has(d) || t.set(
1291
1273
  d,
1292
- `"${le(t, h)}" has an outdated "${ie(
1293
- t,
1274
+ `"${le(s, h)}" has an outdated "${ie(
1275
+ s,
1294
1276
  h,
1295
- s
1277
+ r
1296
1278
  )}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
1297
1279
  );
1298
1280
  continue;
1299
1281
  }
1300
- const m = i.match(
1282
+ const u = l.match(
1301
1283
  /^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
1302
1284
  );
1303
- if (m) {
1304
- const [, h, s] = m, d = `${h}:${s}:invalid-metric`;
1305
- r.has(d) || r.set(
1285
+ if (u) {
1286
+ const [, h, r] = u, d = `${h}:${r}:invalid-metric`;
1287
+ t.has(d) || t.set(
1306
1288
  d,
1307
- `"${le(t, h)}" has an invalid "${ie(
1308
- t,
1289
+ `"${le(s, h)}" has an invalid "${ie(
1290
+ s,
1309
1291
  h,
1310
- s
1292
+ r
1311
1293
  )}" metric mapping. Open the card controls and choose a valid metric for each option.`
1312
1294
  );
1313
1295
  continue;
1314
1296
  }
1315
- const p = i.match(
1297
+ const p = l.match(
1316
1298
  /^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
1317
1299
  );
1318
1300
  if (p) {
1319
- const [, h, s] = p, d = `${h}:${s}:invalid-group-by`;
1320
- r.has(d) || r.set(
1301
+ const [, h, r] = p, d = `${h}:${r}:invalid-group-by`;
1302
+ t.has(d) || t.set(
1321
1303
  d,
1322
- `"${le(t, h)}" has an invalid "${ie(
1323
- t,
1304
+ `"${le(s, h)}" has an invalid "${ie(
1305
+ s,
1324
1306
  h,
1325
- s
1307
+ r
1326
1308
  )}" field mapping. Open the card controls and choose a valid field for each option.`
1327
1309
  );
1328
1310
  continue;
1329
1311
  }
1330
- const y = i.match(
1312
+ const y = l.match(
1331
1313
  /^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
1332
1314
  );
1333
1315
  if (y) {
1334
- const [, h, s] = y, d = `${h}:${s}:missing-temporal-group-by`;
1335
- r.has(d) || r.set(
1316
+ const [, h, r] = y, d = `${h}:${r}:missing-temporal-group-by`;
1317
+ t.has(d) || t.set(
1336
1318
  d,
1337
- `"${le(t, h)}" can no longer use "${ie(
1338
- t,
1319
+ `"${le(s, h)}" can no longer use "${ie(
1320
+ s,
1339
1321
  h,
1340
- s
1322
+ r
1341
1323
  )}" for time grain because the card does not currently group by a date field.`
1342
1324
  );
1343
1325
  continue;
1344
1326
  }
1345
- r.set(i, i);
1327
+ t.set(l, l);
1346
1328
  }
1347
- return Array.from(r.values());
1329
+ return Array.from(t.values());
1348
1330
  }
1349
- function qr() {
1350
- var La, ka, Ia, Oa;
1351
- Pt(), Ut();
1331
+ function zr() {
1332
+ var ka, Ia, Oa, Ta;
1333
+ Gt(), Ft();
1352
1334
  const {
1353
1335
  authToken: a,
1354
1336
  tokenProps: n,
1355
- id: t
1356
- } = F(), { isLocalDev: r } = tt(), { permissions: i } = ir(), c = rt(), { isLoading: u } = nt();
1357
- x((l) => l.theme);
1358
- const m = x(
1359
- (l) => l.dashboardAssistantDraftScopeKey
1360
- ), p = x((l) => l.lenses), y = x((l) => l.selectedLensId), h = p == null ? void 0 : p.find((l) => l.id === y), s = x((l) => l.dashboard);
1361
- x((l) => l.selectedSheetId);
1337
+ id: s
1338
+ } = $(), { isLocalDev: t } = ot(), { permissions: l } = dr(), c = it(), { isLoading: m } = lt();
1339
+ x((i) => i.theme);
1340
+ const u = x(
1341
+ (i) => i.dashboardAssistantDraftScopeKey
1342
+ ), p = x((i) => i.lenses), y = x((i) => i.selectedLensId), h = p == null ? void 0 : p.find((i) => i.id === y), r = x((i) => i.dashboard);
1343
+ x((i) => i.selectedSheetId);
1362
1344
  const d = x(
1363
- (l) => l.isDashboardEditing
1364
- ), { setDashboardTitle: f } = x((l) => l.actions), [v, b] = N(!1), [S, C] = N(!1), [P, U] = N(!1), [_, $] = N(!1), [V, q] = N(!1), [w, H] = N(!1), [ue, Z] = N(null), [Le, g] = N(!1), [E, I] = N(null), [R, j] = N([]), [ee, me] = N(!1), ps = x((l) => l.isDashboardPanelOpen), fs = x(
1365
- (l) => l.actions.setIsDashboardPanelOpen
1366
- ), gs = x((l) => l.filterValues), D = x((l) => l.isVisualEditing);
1367
- Pa((l) => l.card);
1368
- const ae = we(
1369
- (l) => l.selectedDashboard
1370
- ), he = we(
1371
- (l) => l.initialDashboard
1345
+ (i) => i.isDashboardEditing
1346
+ ), { setDashboardTitle: f } = x((i) => i.actions), [v, b] = N(!1), [S, C] = N(!1), [P, U] = N(!1), [_, V] = N(!1), [q, H] = N(!1), [D, j] = N(!1), [ue, ee] = N(null), [ke, g] = N(!1), [E, O] = N(null), [F, z] = N([]), [ae, me] = N(!1), gs = x((i) => i.isDashboardPanelOpen), vs = x(
1347
+ (i) => i.actions.setIsDashboardPanelOpen
1348
+ ), bs = x((i) => i.filterValues), w = x((i) => i.isVisualEditing);
1349
+ Ua((i) => i.card);
1350
+ const se = De(
1351
+ (i) => i.selectedDashboard
1352
+ ), he = De(
1353
+ (i) => i.initialDashboard
1372
1354
  );
1373
- we((l) => l.selectedVisual), x((l) => l.selectedFrameId), Pa((l) => l.frame);
1374
- const pe = ae ? (ka = ae == null ? void 0 : ae.permissions) == null ? void 0 : ka.canEdit : (La = he == null ? void 0 : he.permissions) == null ? void 0 : La.canEdit, fe = x((l) => l.showFilters), va = ot((l) => l.setPanelOpen), vs = x(
1375
- (l) => l.showDashboardJSON
1376
- ), ke = x((l) => l.onSaveFunction), ba = x(
1377
- (l) => l.actions.setShowFilters
1378
- ), { setIsDashboardEditing: ya, setShowDashboardJSON: Na } = x(
1379
- (l) => l.actions
1380
- ), { setInitialDashboard: Sa, clearSelectedDashboard: Ie } = we(
1381
- (l) => l.actions
1382
- ), { resources: ge } = it(He.DASHBOARD), { data: Oe } = lt(), bs = ((Ia = Oe == null ? void 0 : Oe.preference) == null ? void 0 : Ia.defaultDashboardId) || null, { mutate: ys, isPending: Ns } = ct(), { currentUser: Ss } = ma(), xs = dt(Ss), J = ae || he, xa = J ? {
1383
- id: J.id,
1384
- title: (s == null ? void 0 : s.title) || J.title || "Dashboard"
1385
- } : null, { handleAddNewFrame: ws } = ut(), [Te, _e] = N(!1), [Ds, se] = N(!1), [Pe, ve] = N("close"), te = mt(He.DASHBOARD), [G, Ue] = N(
1355
+ De((i) => i.selectedVisual), x((i) => i.selectedFrameId), Ua((i) => i.frame);
1356
+ const pe = se ? (Ia = se == null ? void 0 : se.permissions) == null ? void 0 : Ia.canEdit : (ka = he == null ? void 0 : he.permissions) == null ? void 0 : ka.canEdit, fe = x((i) => i.showFilters), ba = ct((i) => i.setPanelOpen), ys = x(
1357
+ (i) => i.showDashboardJSON
1358
+ ), Ie = x((i) => i.onSaveFunction), ya = x(
1359
+ (i) => i.actions.setShowFilters
1360
+ ), { setIsDashboardEditing: Na, setShowDashboardJSON: Sa } = x(
1361
+ (i) => i.actions
1362
+ ), { setInitialDashboard: xa, clearSelectedDashboard: Oe } = De(
1363
+ (i) => i.actions
1364
+ ), { resources: ge } = dt(je.DASHBOARD), { data: Te } = ut(), Ns = ((Oa = Te == null ? void 0 : Te.preference) == null ? void 0 : Oa.defaultDashboardId) || null, { mutate: Ss, isPending: xs } = mt(), { currentUser: Ds } = ha(), ws = ht(Ds), X = se || he, Da = X ? {
1365
+ id: X.id,
1366
+ title: (r == null ? void 0 : r.title) || X.title || "Dashboard"
1367
+ } : null, { handleAddNewFrame: Cs } = pt(), [_e, Pe] = N(!1), [Es, te] = N(!1), [Ue, ve] = N("close"), re = ft(je.DASHBOARD), [R, Re] = N(
1386
1368
  null
1387
- ), wa = Ua(
1388
- (l) => {
1369
+ ), wa = Ra(
1370
+ (i) => {
1389
1371
  window.setTimeout(() => {
1390
- Z(l);
1372
+ ee(i);
1391
1373
  }, 0);
1392
1374
  },
1393
1375
  []
1394
- ), Cs = async (l, T) => {
1395
- if (!(s != null && s.id)) {
1376
+ ), As = async (i, L) => {
1377
+ if (!(r != null && r.id)) {
1396
1378
  console.log("No dashboard ID found");
1397
1379
  return;
1398
1380
  }
1399
1381
  console.log("Updating dashboard title:", {
1400
- dashboardId: s.id,
1401
- newTitle: l,
1402
- previousTitle: T
1403
- }), te.mutate(
1382
+ dashboardId: r.id,
1383
+ newTitle: i,
1384
+ previousTitle: L
1385
+ }), re.mutate(
1404
1386
  {
1405
- resourceId: s.id,
1406
- data: { title: l }
1387
+ resourceId: r.id,
1388
+ data: { title: i }
1407
1389
  },
1408
1390
  {
1409
1391
  onSuccess: () => {
1410
- console.log("Dashboard title updated successfully"), L.success("Dashboard title updated");
1392
+ console.log("Dashboard title updated successfully"), k.success("Dashboard title updated");
1411
1393
  },
1412
- onError: (oe) => {
1413
- console.error("Failed to update dashboard title:", oe), L.error("Failed to update dashboard title"), f(T);
1394
+ onError: (G) => {
1395
+ console.error("Failed to update dashboard title:", G), k.error("Failed to update dashboard title"), f(L);
1414
1396
  }
1415
1397
  }
1416
1398
  );
1417
1399
  };
1418
- _t(() => {
1400
+ Rt(() => {
1419
1401
  if (ge && ge.length > 0) {
1420
- const l = s == null ? void 0 : s.id;
1421
- if (l) {
1422
- const T = ge.find(
1423
- (oe) => oe.id === l
1402
+ const i = r == null ? void 0 : r.id;
1403
+ if (i) {
1404
+ const L = ge.find(
1405
+ (G) => G.id === i
1424
1406
  );
1425
- T && Sa(T);
1407
+ L && xa(L);
1426
1408
  }
1427
1409
  }
1428
- }, [ge, s == null ? void 0 : s.id, Sa]);
1429
- const be = n.orgUserId || n.tenantId, Da = d && !D && be && pe, { setDashboard: Ge } = x((l) => l.actions), Es = () => {
1430
- ya(!0);
1431
- }, Re = () => {
1432
- ya(!1), Na(!1), Ue(null), Z(null);
1410
+ }, [ge, r == null ? void 0 : r.id, xa]);
1411
+ const be = n.orgUserId || n.tenantId, Ca = d && !w && be && pe, { setDashboard: Ge } = x((i) => i.actions), Ms = () => {
1412
+ Na(!0);
1413
+ }, Fe = () => {
1414
+ Na(!1), Sa(!1), Re(null), ee(null);
1433
1415
  };
1434
- Gt(
1416
+ $t(
1435
1417
  d,
1436
- s,
1437
- G,
1438
- (l) => Ue(l)
1418
+ r,
1419
+ R,
1420
+ (i) => Re(i)
1439
1421
  );
1440
- const { isDirty: Ca, isDirtyPending: As, resetDirty: ye } = Kt(
1441
- s,
1442
- G,
1422
+ const { isDirty: Ea, isDirtyPending: Ls, resetDirty: ye } = Jt(
1423
+ r,
1424
+ R,
1443
1425
  300,
1444
1426
  1e3,
1445
- je
1446
- ), Ea = Ua(() => G ? je(s) !== je(G) : !1, [s, G]), Fe = Ca || As, re = Te || te.isPending, Ms = () => {
1447
- Ea() ? (ve("close"), se(!0)) : (Re(), ye());
1448
- }, Ls = async () => {
1449
- await $e({
1427
+ ze
1428
+ ), Aa = Ra(() => R ? ze(r) !== ze(R) : !1, [r, R]), $e = Ea || Ls, ne = _e || re.isPending, ks = () => {
1429
+ Aa() ? (ve("close"), te(!0)) : (Fe(), ye());
1430
+ }, Is = async () => {
1431
+ await Ve({
1450
1432
  closeAfterSave: !0,
1451
- navigateHomeAfterSave: Pe === "home"
1433
+ navigateHomeAfterSave: Ue === "home"
1452
1434
  });
1453
- }, ks = () => {
1454
- G && Ge(G), Re(), Pe === "home" && Ie(), ve("close"), se(!1), ye();
1455
- }, Is = () => {
1456
- G && (Ge(G), ye());
1457
1435
  }, Os = () => {
1458
- if (d && Ea()) {
1459
- ve("home"), se(!0);
1436
+ R && Ge(R), Fe(), Ue === "home" && Oe(), ve("close"), te(!1), ye();
1437
+ }, Ts = () => {
1438
+ R && (Ge(R), ye());
1439
+ }, _s = () => {
1440
+ if (d && Aa()) {
1441
+ ve("home"), te(!0);
1460
1442
  return;
1461
1443
  }
1462
- Ie();
1444
+ Oe();
1463
1445
  };
1464
- async function $e(l) {
1465
- const T = (l == null ? void 0 : l.closeAfterSave) ?? ee, oe = (l == null ? void 0 : l.navigateHomeAfterSave) ?? !1;
1466
- me(T), T && se(!1);
1467
- const Gs = Ot(s);
1468
- g(!0), I(null), j([]), _e(!0);
1469
- const Rs = {
1470
- template: s
1446
+ async function Ve(i) {
1447
+ const L = x.getState().dashboard;
1448
+ if (!L)
1449
+ return;
1450
+ const G = (i == null ? void 0 : i.closeAfterSave) ?? ae, Fs = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
1451
+ me(G), G && te(!1);
1452
+ const $s = Pt(L);
1453
+ g(!0), O(null), z([]), Pe(!0);
1454
+ const Vs = {
1455
+ template: L
1471
1456
  };
1472
- te.mutate(
1457
+ re.mutate(
1473
1458
  {
1474
- resourceId: s.id,
1475
- data: Rs
1459
+ resourceId: L.id,
1460
+ data: Vs
1476
1461
  },
1477
1462
  {
1478
- onSuccess: (O) => {
1479
- var Ne, Se, Ta;
1480
- const z = (O == null ? void 0 : O.id) || ((Ne = O == null ? void 0 : O.dashboard) == null ? void 0 : Ne.id) || ((Se = O == null ? void 0 : O.resource) == null ? void 0 : Se.id) || ((Ta = O == null ? void 0 : O.template) == null ? void 0 : Ta.id) || null;
1481
- if (!s.id && z) {
1482
- const qe = Tt.getState(), xe = qe.pendingDashboardDraftMigration;
1483
- (xe == null ? void 0 : xe.scopeKey) === m ? qe.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1484
- z
1485
- ) : xe && qe.actions.clearPendingDashboardDraftMigration();
1463
+ onSuccess: (T) => {
1464
+ var Ne, Se, _a;
1465
+ const B = (T == null ? void 0 : T.id) || ((Ne = T == null ? void 0 : T.dashboard) == null ? void 0 : Ne.id) || ((Se = T == null ? void 0 : T.resource) == null ? void 0 : Se.id) || ((_a = T == null ? void 0 : T.template) == null ? void 0 : _a.id) || null;
1466
+ if (!L.id && B) {
1467
+ const He = Ut.getState(), xe = He.pendingDashboardDraftMigration;
1468
+ (xe == null ? void 0 : xe.scopeKey) === u ? He.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1469
+ B
1470
+ ) : xe && He.actions.clearPendingDashboardDraftMigration();
1486
1471
  }
1487
- _e(!1), L.success("Dashboard saved!"), Ue(Gs), g(!1), me(!1), T && (Re(), ye(), oe && Ie()), ve("close");
1472
+ Pe(!1), k.success("Dashboard saved!"), Re($s), g(!1), me(!1), G && (Fe(), ye(), Fs && Oe()), ve("close");
1488
1473
  },
1489
- onError: (O) => {
1490
- _e(!1), I("Failed to save dashboard. Please try again.");
1491
- const z = O.details, Ne = Array.isArray(
1492
- z == null ? void 0 : z.errors
1493
- ) ? (z.errors || []).filter(
1474
+ onError: (T) => {
1475
+ Pe(!1), O("Failed to save dashboard. Please try again.");
1476
+ const B = T.details, Ne = Array.isArray(
1477
+ B == null ? void 0 : B.errors
1478
+ ) ? (B.errors || []).filter(
1494
1479
  (Se) => typeof Se == "string"
1495
1480
  ) : [];
1496
- j(
1497
- Ir({
1481
+ z(
1482
+ _r({
1498
1483
  errors: Ne,
1499
- dashboard: s || void 0
1484
+ dashboard: L || void 0
1500
1485
  })
1501
- ), L.error("Failed to save dashboard");
1486
+ ), k.error("Failed to save dashboard");
1502
1487
  }
1503
1488
  }
1504
1489
  );
1505
1490
  }
1506
- async function Ts() {
1491
+ async function Ps() {
1507
1492
  if (b(!0), !y || !h) return;
1508
- const l = JSON.stringify(s), T = {
1493
+ const i = x.getState().dashboard;
1494
+ if (!i) {
1495
+ b(!1);
1496
+ return;
1497
+ }
1498
+ const L = JSON.stringify(i), G = {
1509
1499
  ...h,
1510
- template: l,
1511
- filterValues: gs
1500
+ template: L,
1501
+ filterValues: bs
1512
1502
  };
1513
- await sa(
1503
+ await ta(
1514
1504
  n.apiServiceUrl,
1515
- T,
1505
+ G,
1516
1506
  a == null ? void 0 : a.accessToken
1517
- ), L.success("Lens saved"), ke == null || ke(s), b(!1);
1507
+ ), k.success("Lens saved"), Ie == null || Ie(i), b(!1);
1518
1508
  }
1519
- const Aa = (h == null ? void 0 : h.name) || s.title;
1520
- te.isPending && console.log("Title during update:", {
1521
- title: Aa,
1522
- dashboardStateTitle: s.title,
1523
- dashboardId: s == null ? void 0 : s.id,
1509
+ const Ma = (h == null ? void 0 : h.name) || r.title;
1510
+ re.isPending && console.log("Title during update:", {
1511
+ title: Ma,
1512
+ dashboardStateTitle: r.title,
1513
+ dashboardId: r == null ? void 0 : r.id,
1524
1514
  currentLensName: h == null ? void 0 : h.name
1525
1515
  });
1526
- const Ma = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail, _s = !!Ma && !!(a != null && a.accessToken) && !!(n != null && n.apiServiceUrl), Ps = c, ne = (s == null ? void 0 : s.id) || null, Ve = !!ne && bs === ne, Us = () => {
1527
- ne && ys({
1528
- dashboardId: Ve ? null : ne
1516
+ const La = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail, Us = !!La && !!(a != null && a.accessToken) && !!(n != null && n.apiServiceUrl), Rs = c, oe = (r == null ? void 0 : r.id) || null, qe = !!oe && Ns === oe, Gs = () => {
1517
+ oe && Ss({
1518
+ dashboardId: qe ? null : oe
1529
1519
  });
1530
1520
  };
1531
1521
  return /* @__PURE__ */ o(
@@ -1535,31 +1525,31 @@ function qr() {
1535
1525
  role: "dashboard-controls",
1536
1526
  children: [
1537
1527
  /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1538
- Ma && /* @__PURE__ */ o(k, { children: [
1528
+ La && /* @__PURE__ */ o(I, { children: [
1539
1529
  /* @__PURE__ */ e(
1540
- B,
1530
+ K,
1541
1531
  {
1542
1532
  "aria-label": "Manage Dashboards",
1543
1533
  tooltip: "Manage Dashboards",
1544
1534
  onClick: () => {
1545
- fs(!ps);
1535
+ vs(!gs);
1546
1536
  },
1547
1537
  className: "h-7 p-2",
1548
- children: /* @__PURE__ */ e(Wt, { className: "h-4 w-4" })
1538
+ children: /* @__PURE__ */ e(Yt, { className: "h-4 w-4" })
1549
1539
  }
1550
1540
  ),
1551
- Ps && !D && /* @__PURE__ */ e(
1552
- B,
1541
+ Rs && !w && /* @__PURE__ */ e(
1542
+ K,
1553
1543
  {
1554
1544
  "aria-label": "Dashboard Hub",
1555
1545
  tooltip: "Dashboard Hub",
1556
- onClick: Os,
1546
+ onClick: _s,
1557
1547
  className: "h-7 p-2",
1558
- children: /* @__PURE__ */ e(Ha, { className: "h-4 w-4" })
1548
+ children: /* @__PURE__ */ e(ja, { className: "h-4 w-4" })
1559
1549
  }
1560
1550
  )
1561
1551
  ] }),
1562
- !D && c && (u ? /* @__PURE__ */ e(
1552
+ !w && c && (m ? /* @__PURE__ */ e(
1563
1553
  "div",
1564
1554
  {
1565
1555
  className: "h-4 w-28 rounded-md bg-muted/70 animate-pulse",
@@ -1567,99 +1557,99 @@ function qr() {
1567
1557
  role: "status",
1568
1558
  children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Loading dashboard title" })
1569
1559
  }
1570
- ) : /* @__PURE__ */ o(k, { children: [
1560
+ ) : /* @__PURE__ */ o(I, { children: [
1571
1561
  /* @__PURE__ */ e(
1572
- ht,
1562
+ gt,
1573
1563
  {
1574
- value: Aa || "Untitled Dashboard",
1575
- onSave: (l) => {
1564
+ value: Ma || "Untitled Dashboard",
1565
+ onSave: (i) => {
1576
1566
  console.log("EditableText onSave called:", {
1577
- newTitle: l,
1567
+ newTitle: i,
1578
1568
  canEditDashboard: pe,
1579
- dashboardId: s == null ? void 0 : s.id
1569
+ dashboardId: r == null ? void 0 : r.id
1580
1570
  });
1581
- const T = (s == null ? void 0 : s.title) || "";
1582
- f(l), Cs(l, T);
1571
+ const L = (r == null ? void 0 : r.title) || "";
1572
+ f(i), As(i, L);
1583
1573
  },
1584
1574
  isEditable: pe && !h,
1585
1575
  displayClassName: "text-sm font-medium",
1586
1576
  inputClassName: "text-sm font-medium",
1587
1577
  placeholder: "Dashboard Title",
1588
- isPending: te.isPending
1578
+ isPending: re.isPending
1589
1579
  }
1590
1580
  ),
1591
- _s && ne && /* @__PURE__ */ e(pt, { children: /* @__PURE__ */ o(ft, { children: [
1592
- /* @__PURE__ */ e(gt, { asChild: !0, children: /* @__PURE__ */ e(
1581
+ Us && oe && /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ o(bt, { children: [
1582
+ /* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ e(
1593
1583
  M,
1594
1584
  {
1595
1585
  variant: "ghost",
1596
1586
  size: "icon",
1597
- onClick: Us,
1598
- disabled: Ns || !(a != null && a.accessToken) || !(n != null && n.apiServiceUrl),
1587
+ onClick: Gs,
1588
+ disabled: xs || !(a != null && a.accessToken) || !(n != null && n.apiServiceUrl),
1599
1589
  className: "h-7 w-7",
1600
1590
  children: /* @__PURE__ */ e(
1601
- vt,
1591
+ Nt,
1602
1592
  {
1603
- className: X(
1593
+ className: Y(
1604
1594
  "h-4 w-4 transition-colors",
1605
- Ve ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground hover:text-yellow-400"
1595
+ qe ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground hover:text-yellow-400"
1606
1596
  )
1607
1597
  }
1608
1598
  )
1609
1599
  }
1610
1600
  ) }),
1611
- /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ e("p", { children: Ve ? "Remove as default dashboard" : "Make this a default dashboard" }) })
1601
+ /* @__PURE__ */ e(St, { children: /* @__PURE__ */ e("p", { children: qe ? "Remove as default dashboard" : "Make this a default dashboard" }) })
1612
1602
  ] }) })
1613
1603
  ] }))
1614
1604
  ] }),
1615
1605
  /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1616
- D && /* @__PURE__ */ o(k, { children: [
1617
- /* @__PURE__ */ e(Rt, { className: "mr-2" }),
1618
- /* @__PURE__ */ e(Ft, { className: "h-7" })
1606
+ w && /* @__PURE__ */ o(I, { children: [
1607
+ /* @__PURE__ */ e(Vt, { className: "mr-2" }),
1608
+ /* @__PURE__ */ e(qt, { className: "h-7" })
1619
1609
  ] }),
1620
- r && !D && /* @__PURE__ */ o(k, { children: [
1610
+ t && !w && /* @__PURE__ */ o(I, { children: [
1621
1611
  /* @__PURE__ */ e(
1622
- B,
1612
+ K,
1623
1613
  {
1624
1614
  tooltip: "Copy Token",
1625
1615
  onClick: () => {
1626
- var l;
1627
- a != null && a.accessToken && ((l = navigator == null ? void 0 : navigator.clipboard) != null && l.writeText ? navigator.clipboard.writeText(a.accessToken).then(() => L.success("Token copied to clipboard")).catch(() => L.error("Unable to copy token")) : L.error("Clipboard not available"));
1616
+ var i;
1617
+ a != null && a.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(a.accessToken).then(() => k.success("Token copied to clipboard")).catch(() => k.error("Unable to copy token")) : k.error("Clipboard not available"));
1628
1618
  },
1629
1619
  className: "h-7 p-2",
1630
- children: /* @__PURE__ */ e(yt, { className: "h-4 w-4" })
1620
+ children: /* @__PURE__ */ e(xt, { className: "h-4 w-4" })
1631
1621
  }
1632
1622
  ),
1633
1623
  /* @__PURE__ */ e(
1634
- B,
1624
+ K,
1635
1625
  {
1636
1626
  tooltip: "Invalidate Token",
1637
- onClick: () => Nt(n.apiServiceUrl),
1627
+ onClick: () => Dt(n.apiServiceUrl),
1638
1628
  className: "h-7 p-2",
1639
- children: /* @__PURE__ */ e(Xt, { className: "h-4 w-4" })
1629
+ children: /* @__PURE__ */ e(er, { className: "h-4 w-4" })
1640
1630
  }
1641
1631
  )
1642
1632
  ] }),
1643
- !D && c && /* @__PURE__ */ e(St, {}),
1644
- !D && c && /* @__PURE__ */ e($t, {}),
1645
- !D && c && ((Oa = J == null ? void 0 : J.permissions) == null ? void 0 : Oa.canShare) && /* @__PURE__ */ e(
1646
- B,
1633
+ !w && c && /* @__PURE__ */ e(wt, {}),
1634
+ !w && c && /* @__PURE__ */ e(Ht, {}),
1635
+ !w && c && ((Ta = X == null ? void 0 : X.permissions) == null ? void 0 : Ta.canShare) && /* @__PURE__ */ e(
1636
+ K,
1647
1637
  {
1648
1638
  tooltip: "Share Dashboard",
1649
1639
  onClick: () => C(!0),
1650
1640
  className: "h-7 p-2",
1651
- children: /* @__PURE__ */ e(xt, { className: "h-4 w-4" })
1641
+ children: /* @__PURE__ */ e(Ct, { className: "h-4 w-4" })
1652
1642
  }
1653
1643
  ),
1654
- !D && d && i.canUseFilters && c && /* @__PURE__ */ e(
1655
- Vt,
1644
+ !w && d && l.canUseFilters && c && /* @__PURE__ */ e(
1645
+ jt,
1656
1646
  {
1657
1647
  showFilters: fe,
1658
1648
  onToggleFilters: () => {
1659
- fe || va("dashboard", !1), ba(!fe);
1649
+ fe || ba("dashboard", !1), ya(!fe);
1660
1650
  },
1661
1651
  onAddFilter: () => {
1662
- fe || (va("dashboard", !1), ba(!0));
1652
+ fe || (ba("dashboard", !1), ya(!0));
1663
1653
  },
1664
1654
  onAddControl: () => {
1665
1655
  wa("create");
@@ -1667,26 +1657,26 @@ function qr() {
1667
1657
  onManageControls: () => wa("manage")
1668
1658
  }
1669
1659
  ),
1670
- d && !D && c && ue ? /* @__PURE__ */ e(
1671
- qt,
1660
+ d && !w && c && ue ? /* @__PURE__ */ e(
1661
+ zt,
1672
1662
  {
1673
1663
  open: !0,
1674
- onOpenChange: (l) => {
1675
- l || Z(null);
1664
+ onOpenChange: (i) => {
1665
+ i || ee(null);
1676
1666
  },
1677
1667
  showTrigger: !1,
1678
1668
  initialMode: ue
1679
1669
  }
1680
1670
  ) : null,
1681
- d && !D && be && r && c && /* @__PURE__ */ e(nr, {}),
1682
- !D && be && r && c && /* @__PURE__ */ e(or, {}),
1683
- d && !D && be && h && r && c && /* @__PURE__ */ o(
1671
+ d && !w && be && t && c && /* @__PURE__ */ e(lr, {}),
1672
+ !w && be && t && c && /* @__PURE__ */ e(cr, {}),
1673
+ d && !w && be && h && t && c && /* @__PURE__ */ o(
1684
1674
  M,
1685
1675
  {
1686
1676
  className: "h-7 p-2",
1687
1677
  variant: "secondary",
1688
1678
  disabled: v,
1689
- onClick: Ts,
1679
+ onClick: Ps,
1690
1680
  size: "sm",
1691
1681
  children: [
1692
1682
  /* @__PURE__ */ e(Ga, { className: "mr-2 h-4 w-4" }),
@@ -1694,62 +1684,62 @@ function qr() {
1694
1684
  ]
1695
1685
  }
1696
1686
  ),
1697
- d && !D && c && /* @__PURE__ */ o(
1687
+ d && !w && c && /* @__PURE__ */ o(
1698
1688
  M,
1699
1689
  {
1700
1690
  variant: "outline",
1701
1691
  className: "h-7 p-2",
1702
1692
  size: "sm",
1703
1693
  disabled: !d,
1704
- onClick: () => ws(),
1694
+ onClick: () => Cs(),
1705
1695
  children: [
1706
- /* @__PURE__ */ e(la, { className: "mr-2 h-4 w-4" }),
1696
+ /* @__PURE__ */ e(ca, { className: "mr-2 h-4 w-4" }),
1707
1697
  "Visual"
1708
1698
  ]
1709
1699
  }
1710
1700
  ),
1711
- !D && !d && pe && c && /* @__PURE__ */ o(
1701
+ !w && !d && pe && c && /* @__PURE__ */ o(
1712
1702
  M,
1713
1703
  {
1714
1704
  variant: "outline",
1715
1705
  className: "h-7 p-2",
1716
- onClick: Es,
1706
+ onClick: Ms,
1717
1707
  size: "sm",
1718
1708
  children: [
1719
- /* @__PURE__ */ e(wt, { className: "mr-2 h-4 w-4" }),
1709
+ /* @__PURE__ */ e(Et, { className: "mr-2 h-4 w-4" }),
1720
1710
  "Edit"
1721
1711
  ]
1722
1712
  }
1723
1713
  ),
1724
- Da && c && Ca && /* @__PURE__ */ o(
1714
+ Ca && c && Ea && /* @__PURE__ */ o(
1725
1715
  M,
1726
1716
  {
1727
1717
  variant: "outline",
1728
1718
  className: "h-7 p-2",
1729
- onClick: Is,
1719
+ onClick: Ts,
1730
1720
  size: "sm",
1731
- disabled: re,
1721
+ disabled: ne,
1732
1722
  children: [
1733
- /* @__PURE__ */ e(Dt, { className: "mr-2 h-4 w-4" }),
1723
+ /* @__PURE__ */ e(At, { className: "mr-2 h-4 w-4" }),
1734
1724
  "Undo"
1735
1725
  ]
1736
1726
  }
1737
1727
  ),
1738
- Da && c && /* @__PURE__ */ o("div", { className: "relative inline-flex", children: [
1728
+ Ca && c && /* @__PURE__ */ o("div", { className: "relative inline-flex", children: [
1739
1729
  /* @__PURE__ */ o(
1740
1730
  M,
1741
1731
  {
1742
- className: X("h-7 p-2", !Fe && "opacity-60"),
1743
- disabled: re || !Fe,
1744
- onClick: () => $e(),
1732
+ className: Y("h-7 p-2", !$e && "opacity-60"),
1733
+ disabled: ne || !$e,
1734
+ onClick: () => Ve(),
1745
1735
  size: "sm",
1746
1736
  children: [
1747
- re ? /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Ga, { className: "mr-2 h-4 w-4" }),
1748
- re ? "Saving..." : "Save"
1737
+ ne ? /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Ga, { className: "mr-2 h-4 w-4" }),
1738
+ ne ? "Saving..." : "Save"
1749
1739
  ]
1750
1740
  }
1751
1741
  ),
1752
- Fe && !re && /* @__PURE__ */ e(
1742
+ $e && !ne && /* @__PURE__ */ e(
1753
1743
  "span",
1754
1744
  {
1755
1745
  "aria-hidden": "true",
@@ -1757,92 +1747,92 @@ function qr() {
1757
1747
  }
1758
1748
  )
1759
1749
  ] }),
1760
- !D && d && r && c && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1750
+ !w && d && t && c && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1761
1751
  M,
1762
1752
  {
1763
1753
  className: "h-7 p-2",
1764
- onClick: () => Na(!vs),
1754
+ onClick: () => Sa(!ys),
1765
1755
  size: "sm",
1766
1756
  variant: "ghost",
1767
- children: /* @__PURE__ */ e(Ct, { className: "h-4 w-4" })
1757
+ children: /* @__PURE__ */ e(Mt, { className: "h-4 w-4" })
1768
1758
  }
1769
1759
  ) }),
1770
- !D && r && /* @__PURE__ */ e(sr, {}),
1771
- d && !D && c && /* @__PURE__ */ o(
1760
+ !w && t && /* @__PURE__ */ e(nr, {}),
1761
+ d && !w && c && /* @__PURE__ */ o(
1772
1762
  M,
1773
1763
  {
1774
1764
  variant: "outline",
1775
1765
  className: "h-7 p-2",
1776
- onClick: Ms,
1766
+ onClick: ks,
1777
1767
  children: [
1778
- /* @__PURE__ */ e(ja, { className: "mr-2 h-4 w-4" }),
1768
+ /* @__PURE__ */ e(za, { className: "mr-2 h-4 w-4" }),
1779
1769
  "Close"
1780
1770
  ]
1781
1771
  }
1782
1772
  ),
1783
- !D && c && /* @__PURE__ */ o(ta, { children: [
1784
- /* @__PURE__ */ e(ra, { asChild: !0, children: /* @__PURE__ */ e(
1785
- B,
1773
+ !w && c && /* @__PURE__ */ o(ra, { children: [
1774
+ /* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ e(
1775
+ K,
1786
1776
  {
1787
1777
  tooltip: "More Options",
1788
1778
  className: "h-8 w-8 rounded-md border border-transparent p-0 text-muted-foreground hover:bg-muted/50 hover:text-foreground",
1789
1779
  buttonProps: { "aria-label": "More dashboard options" },
1790
- children: /* @__PURE__ */ e(Et, { className: "h-4 w-4" })
1780
+ children: /* @__PURE__ */ e(Lt, { className: "h-4 w-4" })
1791
1781
  }
1792
1782
  ) }),
1793
1783
  /* @__PURE__ */ o(
1794
- na,
1784
+ oa,
1795
1785
  {
1796
1786
  align: "end",
1797
1787
  className: "w-56 rounded-xl border border-border/60 p-1 shadow-sm",
1798
1788
  children: [
1799
- /* @__PURE__ */ e(De, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Automation" }),
1789
+ /* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Automation" }),
1800
1790
  /* @__PURE__ */ o(
1801
- K,
1791
+ Q,
1802
1792
  {
1803
- onClick: () => $(!0),
1793
+ onClick: () => V(!0),
1804
1794
  className: "flex items-center gap-2",
1805
1795
  children: [
1806
- /* @__PURE__ */ e(At, { className: "mr-2 h-4 w-4" }),
1796
+ /* @__PURE__ */ e(kt, { className: "mr-2 h-4 w-4" }),
1807
1797
  "Schedule Dashboard"
1808
1798
  ]
1809
1799
  }
1810
1800
  ),
1811
- /* @__PURE__ */ e(Qe, {}),
1812
- xs && /* @__PURE__ */ o(k, { children: [
1813
- /* @__PURE__ */ e(De, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Access" }),
1801
+ /* @__PURE__ */ e(We, {}),
1802
+ ws && /* @__PURE__ */ o(I, { children: [
1803
+ /* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Access" }),
1814
1804
  /* @__PURE__ */ o(
1815
- K,
1805
+ Q,
1816
1806
  {
1817
1807
  onClick: () => U(!0),
1818
1808
  className: "flex items-center gap-2",
1819
1809
  children: [
1820
- /* @__PURE__ */ e(W, { className: "mr-2 h-4 w-4" }),
1810
+ /* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
1821
1811
  "Manage Groups"
1822
1812
  ]
1823
1813
  }
1824
1814
  ),
1825
- /* @__PURE__ */ e(Qe, {})
1815
+ /* @__PURE__ */ e(We, {})
1826
1816
  ] }),
1827
- /* @__PURE__ */ e(De, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Preferences" }),
1817
+ /* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Preferences" }),
1828
1818
  /* @__PURE__ */ o(
1829
- K,
1819
+ Q,
1830
1820
  {
1831
- onClick: () => q(!0),
1821
+ onClick: () => H(!0),
1832
1822
  className: "flex items-center gap-2",
1833
1823
  children: [
1834
- /* @__PURE__ */ e(Mt, { className: "mr-2 h-4 w-4" }),
1824
+ /* @__PURE__ */ e(It, { className: "mr-2 h-4 w-4" }),
1835
1825
  "Calendar Preferences"
1836
1826
  ]
1837
1827
  }
1838
1828
  ),
1839
1829
  /* @__PURE__ */ o(
1840
- K,
1830
+ Q,
1841
1831
  {
1842
- onClick: () => H(!0),
1832
+ onClick: () => j(!0),
1843
1833
  className: "flex items-center gap-2",
1844
1834
  children: [
1845
- /* @__PURE__ */ e(Lt, { className: "mr-2 h-4 w-4" }),
1835
+ /* @__PURE__ */ e(Ot, { className: "mr-2 h-4 w-4" }),
1846
1836
  "Summary Settings"
1847
1837
  ]
1848
1838
  }
@@ -1851,95 +1841,95 @@ function qr() {
1851
1841
  }
1852
1842
  )
1853
1843
  ] }),
1854
- S && xa && /* @__PURE__ */ e(
1855
- kt,
1844
+ S && Da && /* @__PURE__ */ e(
1845
+ Tt,
1856
1846
  {
1857
- resource: xa,
1858
- resourceType: He.DASHBOARD,
1847
+ resource: Da,
1848
+ resourceType: je.DASHBOARD,
1859
1849
  onClose: () => C(!1)
1860
1850
  }
1861
1851
  ),
1862
1852
  /* @__PURE__ */ e(
1863
- Lr,
1853
+ Or,
1864
1854
  {
1865
1855
  open: P,
1866
1856
  onOpenChange: U
1867
1857
  }
1868
1858
  ),
1869
- (s == null ? void 0 : s.id) && /* @__PURE__ */ e(
1870
- It,
1859
+ (r == null ? void 0 : r.id) && /* @__PURE__ */ e(
1860
+ _t,
1871
1861
  {
1872
1862
  open: _,
1873
- onOpenChange: $,
1874
- dashboardId: s.id,
1875
- dashboardName: s == null ? void 0 : s.title
1863
+ onOpenChange: V,
1864
+ dashboardId: r.id,
1865
+ dashboardName: r == null ? void 0 : r.title
1876
1866
  }
1877
1867
  ),
1878
1868
  /* @__PURE__ */ e(
1879
- zt,
1869
+ Qt,
1880
1870
  {
1881
- open: V,
1882
- onOpenChange: q
1871
+ open: q,
1872
+ onOpenChange: H
1883
1873
  }
1884
1874
  ),
1885
1875
  /* @__PURE__ */ e(
1886
- Bt,
1876
+ Wt,
1887
1877
  {
1888
- open: w,
1889
- onOpenChange: H,
1890
- dashboard: s,
1878
+ open: D,
1879
+ onOpenChange: j,
1880
+ dashboard: r,
1891
1881
  disabled: !d,
1892
- onApply: (l) => Ge({
1893
- ...s,
1894
- summary: l
1882
+ onApply: (i) => Ge({
1883
+ ...r,
1884
+ summary: i
1895
1885
  })
1896
1886
  }
1897
1887
  ),
1898
1888
  /* @__PURE__ */ e(
1899
- Ja,
1889
+ Ya,
1900
1890
  {
1901
- open: Le,
1902
- onOpenChange: (l) => {
1903
- !l && Te && !E || (g(l), l || (I(null), j([]), me(!1)));
1891
+ open: ke,
1892
+ onOpenChange: (i) => {
1893
+ !i && _e && !E || (g(i), i || (O(null), z([]), me(!1)));
1904
1894
  },
1905
- children: /* @__PURE__ */ o(Xa, { className: "max-w-sm", children: [
1906
- /* @__PURE__ */ o(Ya, { children: [
1907
- /* @__PURE__ */ e(Za, { children: E ? "Save failed" : "Saving dashboard" }),
1908
- /* @__PURE__ */ e(es, { className: "pt-2", children: E ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
1909
- R.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
1895
+ children: /* @__PURE__ */ o(Za, { className: "max-w-sm", children: [
1896
+ /* @__PURE__ */ o(es, { children: [
1897
+ /* @__PURE__ */ e(as, { children: E ? "Save failed" : "Saving dashboard" }),
1898
+ /* @__PURE__ */ e(ss, { className: "pt-2", children: E ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
1899
+ F.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
1910
1900
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
1911
- /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: R.slice(0, 5).map((l) => /* @__PURE__ */ e("li", { children: l }, l)) })
1901
+ /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: F.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
1912
1902
  ] })
1913
1903
  ] }),
1914
- /* @__PURE__ */ e(as, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: E ? /* @__PURE__ */ o(k, { children: [
1904
+ /* @__PURE__ */ e(ts, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: E ? /* @__PURE__ */ o(I, { children: [
1915
1905
  /* @__PURE__ */ e(
1916
- ss,
1906
+ rs,
1917
1907
  {
1918
1908
  onClick: () => {
1919
- g(!1), I(null), j([]), me(!1);
1909
+ g(!1), O(null), z([]), me(!1);
1920
1910
  },
1921
1911
  className: "m-0",
1922
1912
  children: "Close"
1923
1913
  }
1924
1914
  ),
1925
1915
  /* @__PURE__ */ e(
1926
- ea,
1916
+ aa,
1927
1917
  {
1928
- onClick: () => $e({
1929
- closeAfterSave: ee,
1930
- navigateHomeAfterSave: Pe === "home"
1918
+ onClick: () => Ve({
1919
+ closeAfterSave: ae,
1920
+ navigateHomeAfterSave: Ue === "home"
1931
1921
  }),
1932
1922
  className: "m-0",
1933
1923
  children: "Retry"
1934
1924
  }
1935
1925
  )
1936
1926
  ] }) : /* @__PURE__ */ o(
1937
- ea,
1927
+ aa,
1938
1928
  {
1939
1929
  disabled: !0,
1940
1930
  className: "m-0 cursor-default",
1941
1931
  children: [
1942
- /* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
1932
+ /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
1943
1933
  "Saving..."
1944
1934
  ]
1945
1935
  }
@@ -1948,15 +1938,15 @@ function qr() {
1948
1938
  }
1949
1939
  ),
1950
1940
  /* @__PURE__ */ e(
1951
- Ht,
1941
+ Bt,
1952
1942
  {
1953
- open: Ds,
1954
- onOpenChange: (l) => {
1955
- se(l);
1943
+ open: Es,
1944
+ onOpenChange: (i) => {
1945
+ te(i);
1956
1946
  },
1957
- onSave: Ls,
1958
- onDiscard: ks,
1959
- isSaving: Te,
1947
+ onSave: Is,
1948
+ onDiscard: Os,
1949
+ isSaving: _e,
1960
1950
  saveLabel: "Save",
1961
1951
  discardLabel: "Discard"
1962
1952
  }
@@ -1967,5 +1957,5 @@ function qr() {
1967
1957
  );
1968
1958
  }
1969
1959
  export {
1970
- qr as default
1960
+ zr as default
1971
1961
  };