react-semaphor 0.1.210 → 0.1.211

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 (32) hide show
  1. package/dist/chunks/{dashboard-controls-C08300Wi.js → dashboard-controls-7KpXzAWL.js} +592 -585
  2. package/dist/chunks/dashboard-controls-CnDq9Uh_.js +42 -0
  3. package/dist/chunks/{dashboard-json-GjDBGO26.js → dashboard-json-dqey5VK0.js} +1 -1
  4. package/dist/chunks/{dashboard-json-DlEE5-WA.js → dashboard-json-stWvjp2O.js} +1 -1
  5. package/dist/chunks/{dashboard-summary-settings-dialog-THx-gjnG.js → dashboard-summary-settings-dialog-DPEe6XBC.js} +1 -1
  6. package/dist/chunks/{dashboard-summary-settings-dialog-QUuhhXU9.js → dashboard-summary-settings-dialog-DuxhidK1.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-Bsmow1Pa.js → edit-dashboard-visual-CQAk_UsI.js} +483 -484
  8. package/dist/chunks/{edit-dashboard-visual-PfWJXb2-.js → edit-dashboard-visual-D_XPr8f8.js} +2 -2
  9. package/dist/chunks/{editor-action-buttons-FPyaC09X.js → editor-action-buttons-CH7W6KdH.js} +1 -1
  10. package/dist/chunks/{editor-action-buttons-DNbp_ZWy.js → editor-action-buttons-D34_GSZu.js} +27 -27
  11. package/dist/chunks/{index-CAVrkf9d.js → index-BDS2sWhv.js} +27718 -27508
  12. package/dist/chunks/index-BfiIPyeS.js +1109 -0
  13. package/dist/chunks/{notification-bell-C3a7wC1u.js → notification-bell-Cu3qDd9V.js} +251 -285
  14. package/dist/chunks/notification-bell-hijGST9g.js +6 -0
  15. package/dist/chunks/{resource-management-panel-BVTgbma8.js → resource-management-panel-BvHqslqC.js} +73 -73
  16. package/dist/chunks/{resource-management-panel-C5NjrVsA.js → resource-management-panel-gK3a6OEj.js} +1 -1
  17. package/dist/chunks/{use-role-aware-display-preferences-l7NFLYnn.js → use-role-aware-display-preferences-BlR29aKQ.js} +1 -1
  18. package/dist/chunks/{use-role-aware-display-preferences-DxCPoCgr.js → use-role-aware-display-preferences-a5FH9Y0k.js} +1 -1
  19. package/dist/chunks/{use-visual-utils-B82Q-Ytl.js → use-visual-utils-B11AA2fd.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-D9IJz9R0.js → use-visual-utils-ptPsQ3nC.js} +23 -23
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +251 -216
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.cjs +1 -1
  27. package/dist/surfboard/index.js +2 -2
  28. package/dist/types/main.d.ts +49 -0
  29. package/package.json +1 -1
  30. package/dist/chunks/dashboard-controls-BAOrAMV9.js +0 -42
  31. package/dist/chunks/index-CXKjmjfB.js +0 -1104
  32. package/dist/chunks/notification-bell-BqvKQSw9.js +0 -6
@@ -1,21 +1,21 @@
1
1
  import { jsxs as a, jsx as e, Fragment as k } from "react/jsx-runtime";
2
- import { bP as ne, cR as ba, u as x, c5 as He, c6 as Ve, B as C, c8 as ze, c9 as te, cS as $e, bs as Ns, l as j, m as Be, cT as ya, c4 as Ke, n as Qe, o as We, p as Je, q as Ss, L as Te, Q as re, G as Na, a2 as q, cU as Sa, cd as wa, cV as xa, cW as ps, cX as ws, c as J, cY as xs, bJ as ge, cZ as ve, I as L, c_ as Ds, cE as Da, c$ as Ca, H as V, cc as z, d0 as Xe, d1 as La, d2 as Ea, d3 as _e, d4 as Aa, d5 as ka, d6 as Cs, d7 as Ls, d8 as pe, d9 as fe, cA as Ue, cj as Re, da as Ge, ce as Es, db as Pe, dc as As, e as ks, dd as Ma, cm as Ms, cn as Is, co as Os, cp as Ts, cq as _s, cr as Us, cs as Rs, ct as Fe, c3 as Ia, de as Oa, bu as Ta, bA as fs, bE as me, df as _a, bF as Ua, ag as ke, dg as Ra, dh as Ga, di as Pa, dj as Fa, dk as qa, dl as ja, bW as Ha, bX as Va, bY as za, dm as $a, b_ as Ba, ca as Ka, aO as Qa, dn as Wa, dp as Ja, dq as Xa, dr as Ya, ds as Za, dt as et, c7 as st, cg as at, du as tt, ai as rt, am as nt } from "./index-CAVrkf9d.js";
2
+ import { bS as oe, cS as Na, u as w, c8 as ze, c9 as $e, B as L, cb as Be, cc as q, cT as Ke, Z as ws, l as P, m as Qe, cU as Sa, c7 as We, n as Je, o as Ze, p as Xe, q as xs, L as Ue, Q as re, G as wa, ac as j, cV as xa, cg as Da, cW as Ca, cX as gs, cY as Ds, c as Z, cZ as Cs, U as be, c_ as ye, I as E, c$ as Ls, cH as La, d0 as Ea, H, cf as V, d1 as Ye, d2 as Aa, d3 as ka, d4 as Ge, d5 as Ma, d6 as Oa, d7 as Es, d8 as As, d9 as ge, da as ve, cD as Re, cm as Pe, db as Fe, ch as ks, dc as je, dd as Ms, e as Os, de as Ia, cp as Is, cq as Ts, cr as _s, cs as Us, ct as Gs, cu as Rs, cv as Ps, cw as qe, c6 as Ta, df as _a, bG as Ua, a1 as vs, bO as pe, dg as Ga, bP as Ra, as as Oe, dh as Pa, di as Fa, dj as ja, bj as qa, dk as Ha, dl as Va, bZ as za, b_ as $a, b$ as Ba, dm as Ka, c1 as Qa, cd as Wa, a_ as Ja, dn as Za, dp as Xa, dq as Ya, dr as et, ds as st, dt as at, ca as tt, ae as nt, cj as rt, du as ot, au as it, af as lt, ay as ct } from "./index-BDS2sWhv.js";
3
3
  import * as _ from "react";
4
- import Gs, { useState as S, useMemo as he, useEffect as ot, useCallback as it } from "react";
4
+ import Fs, { useState as S, useMemo as fe, useEffect as dt, useCallback as ut } from "react";
5
5
  import "react-dom";
6
- import { b as lt, u as ct, c as dt, A as ut, V as mt, S as ht, N as pt, U as ft } from "./notification-bell-C3a7wC1u.js";
7
- import { u as gt } from "./use-role-aware-display-preferences-DxCPoCgr.js";
8
- import { d as vt } from "./date-formatter-Y8Za1ib3.js";
9
- import { C as bt, D as yt } from "./dashboard-summary-settings-dialog-THx-gjnG.js";
10
- import { u as Nt, s as Me } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
11
- import { S as gs } from "./editor-action-buttons-DNbp_ZWy.js";
6
+ import { b as mt, u as ht, c as pt, A as ft, V as gt, N as vt, U as bt } from "./notification-bell-Cu3qDd9V.js";
7
+ import { u as yt } from "./use-role-aware-display-preferences-a5FH9Y0k.js";
8
+ import { d as Nt } from "./date-formatter-Y8Za1ib3.js";
9
+ import { C as St, D as wt } from "./dashboard-summary-settings-dialog-DPEe6XBC.js";
10
+ import { u as xt, s as Ie } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
11
+ import { S as bs } from "./editor-action-buttons-D34_GSZu.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 St = ne("Glasses", [
18
+ const Dt = oe("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 St = ne("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 = ne("Menu", [
31
+ const Ct = oe("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 = ne("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 xt = ne("Moon", [
42
+ const Lt = oe("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 xt = ne("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 Dt = ne("ShieldX", [
51
+ const Et = oe("ShieldX", [
52
52
  [
53
53
  "path",
54
54
  {
@@ -65,7 +65,7 @@ const Dt = ne("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 Ct = ne("Sun", [
68
+ const At = oe("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 Ct = ne("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 qe = { exports: {} }, Ie = {};
79
+ var He = { exports: {} }, Te = {};
80
80
  /**
81
81
  * @license React
82
82
  * use-sync-external-store-shim.production.js
@@ -86,18 +86,18 @@ var qe = { exports: {} }, Ie = {};
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 vs;
90
- function Lt() {
91
- if (vs) return Ie;
92
- vs = 1;
93
- var s = Gs;
89
+ var ys;
90
+ function kt() {
91
+ if (ys) return Te;
92
+ ys = 1;
93
+ var s = Fs;
94
94
  function o(d, m) {
95
95
  return d === m && (d !== 0 || 1 / d === 1 / m) || d !== d && m !== m;
96
96
  }
97
- var t = typeof Object.is == "function" ? Object.is : o, r = s.useState, l = s.useEffect, i = s.useLayoutEffect, u = s.useDebugValue;
97
+ var t = typeof Object.is == "function" ? Object.is : o, n = s.useState, l = s.useEffect, c = s.useLayoutEffect, u = s.useDebugValue;
98
98
  function p(d, m) {
99
- var h = m(), b = r({ inst: { value: h, getSnapshot: m } }), y = b[0].inst, N = b[1];
100
- return i(
99
+ var h = m(), b = n({ inst: { value: h, getSnapshot: m } }), y = b[0].inst, N = b[1];
100
+ return c(
101
101
  function() {
102
102
  y.value = h, y.getSnapshot = m, g(y) && N({ inst: y });
103
103
  },
@@ -124,10 +124,10 @@ function Lt() {
124
124
  function v(d, m) {
125
125
  return m();
126
126
  }
127
- var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : p;
128
- return Ie.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : c, Ie;
127
+ var i = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : p;
128
+ return Te.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : i, Te;
129
129
  }
130
- var Oe = {};
130
+ var _e = {};
131
131
  /**
132
132
  * @license React
133
133
  * use-sync-external-store-shim.development.js
@@ -137,36 +137,36 @@ var Oe = {};
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 bs;
141
- function Et() {
142
- return bs || (bs = 1, process.env.NODE_ENV !== "production" && function() {
140
+ var Ns;
141
+ function Mt() {
142
+ return Ns || (Ns = 1, process.env.NODE_ENV !== "production" && function() {
143
143
  function s(h, b) {
144
144
  return h === b && (h !== 0 || 1 / h === 1 / b) || h !== h && b !== b;
145
145
  }
146
146
  function o(h, b) {
147
- c || l.startTransition === void 0 || (c = !0, console.error(
147
+ i || l.startTransition === void 0 || (i = !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 y = b();
151
151
  if (!d) {
152
152
  var N = b();
153
- i(y, N) || (console.error(
153
+ c(y, N) || (console.error(
154
154
  "The result of getSnapshot should be cached to avoid an infinite loop"
155
155
  ), d = !0);
156
156
  }
157
157
  N = u({
158
158
  inst: { value: y, getSnapshot: b }
159
159
  });
160
- var A = N[0].inst, O = N[1];
160
+ var A = N[0].inst, I = N[1];
161
161
  return g(
162
162
  function() {
163
- A.value = y, A.getSnapshot = b, t(A) && O({ inst: A });
163
+ A.value = y, A.getSnapshot = b, t(A) && I({ inst: A });
164
164
  },
165
165
  [h, y, b]
166
166
  ), p(
167
167
  function() {
168
- return t(A) && O({ inst: A }), h(function() {
169
- t(A) && O({ inst: A });
168
+ return t(A) && I({ inst: A }), h(function() {
169
+ t(A) && I({ inst: A });
170
170
  });
171
171
  },
172
172
  [h]
@@ -177,36 +177,36 @@ function Et() {
177
177
  h = h.value;
178
178
  try {
179
179
  var y = b();
180
- return !i(h, y);
180
+ return !c(h, y);
181
181
  } catch {
182
182
  return !0;
183
183
  }
184
184
  }
185
- function r(h, b) {
185
+ function n(h, b) {
186
186
  return b();
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 l = Gs, i = typeof Object.is == "function" ? Object.is : s, u = l.useState, p = l.useEffect, g = l.useLayoutEffect, v = l.useDebugValue, c = !1, d = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : o;
190
- Oe.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
191
- }()), Oe;
189
+ var l = Fs, c = typeof Object.is == "function" ? Object.is : s, u = l.useState, p = l.useEffect, g = l.useLayoutEffect, v = l.useDebugValue, i = !1, d = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : o;
190
+ _e.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
191
+ }()), _e;
192
192
  }
193
- process.env.NODE_ENV === "production" ? qe.exports = Lt() : qe.exports = Et();
194
- var At = qe.exports;
195
- function kt() {
196
- const { setTheme: s } = ba(), o = x(
193
+ process.env.NODE_ENV === "production" ? He.exports = kt() : He.exports = Mt();
194
+ var Ot = He.exports;
195
+ function It() {
196
+ const { setTheme: s } = Na(), o = w(
197
197
  (t) => t.actions.setDashboardTheme
198
198
  );
199
- return /* @__PURE__ */ a(He, { children: [
200
- /* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ a(C, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
199
+ return /* @__PURE__ */ a(ze, { children: [
200
+ /* @__PURE__ */ e($e, { asChild: !0, children: /* @__PURE__ */ a(L, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
201
201
  /* @__PURE__ */ e(
202
- Ct,
202
+ At,
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
- xt,
209
+ Lt,
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 kt() {
214
214
  ),
215
215
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
216
216
  ] }) }),
217
- /* @__PURE__ */ a(ze, { align: "end", children: [
217
+ /* @__PURE__ */ a(Be, { align: "end", children: [
218
218
  /* @__PURE__ */ e(
219
- te,
219
+ q,
220
220
  {
221
221
  onClick: () => {
222
222
  s("light"), o("light");
@@ -225,7 +225,7 @@ function kt() {
225
225
  }
226
226
  ),
227
227
  /* @__PURE__ */ e(
228
- te,
228
+ q,
229
229
  {
230
230
  onClick: () => {
231
231
  s("dark"), o("dark");
@@ -234,7 +234,7 @@ function kt() {
234
234
  }
235
235
  ),
236
236
  /* @__PURE__ */ e(
237
- te,
237
+ q,
238
238
  {
239
239
  onClick: () => {
240
240
  s("system"), o("system");
@@ -245,72 +245,72 @@ function kt() {
245
245
  ] })
246
246
  ] });
247
247
  }
248
- async function Mt(s, o, t, r, l) {
248
+ async function Tt(s, o, t, n, l) {
249
249
  if (!l)
250
250
  return null;
251
- const i = JSON.stringify(t), u = `${s}/v1/lens`;
252
- return await $e(u, l, {
251
+ const c = JSON.stringify(t), u = `${s}/v1/lens`;
252
+ return await Ke(u, l, {
253
253
  name: o,
254
- template: i,
255
- filterValues: r,
254
+ template: c,
255
+ filterValues: n,
256
256
  operation: "create"
257
257
  });
258
258
  }
259
- async function je(s, o, t) {
259
+ async function Ve(s, o, t) {
260
260
  if (!t)
261
261
  return null;
262
- const { id: r, template: l, filterValues: i, isDefault: u, shared: p } = o, g = `${s}/v1/lens`;
263
- return await $e(g, t, {
264
- lensId: r,
262
+ const { id: n, template: l, filterValues: c, isDefault: u, shared: p } = o, g = `${s}/v1/lens`;
263
+ return await Ke(g, t, {
264
+ lensId: n,
265
265
  template: l,
266
- filterValues: i,
266
+ filterValues: c,
267
267
  isDefault: u,
268
268
  shared: p,
269
269
  operation: "update"
270
270
  });
271
271
  }
272
- async function It(s, o, t) {
272
+ async function _t(s, o, t) {
273
273
  if (!t)
274
274
  return null;
275
- const r = `${s}/v1/lens`;
276
- return await $e(r, t, {
275
+ const n = `${s}/v1/lens`;
276
+ return await Ke(n, t, {
277
277
  operation: "delete",
278
278
  lensId: o
279
279
  });
280
280
  }
281
- function Ot() {
282
- const [s, o] = S(""), [t, r] = S(!1), l = x((N) => N.lenses), { setLenses: i, setSelectedLensId: u } = Ns(), [p, g] = S(!1), [v, c] = S(!1), d = x((N) => N.dashboard), m = x((N) => N.filterValues), { authToken: h, tokenProps: b } = j();
281
+ function Ut() {
282
+ const [s, o] = S(""), [t, n] = S(!1), l = w((N) => N.lenses), { setLenses: c, setSelectedLensId: u } = ws(), [p, g] = S(!1), [v, i] = S(!1), d = w((N) => N.dashboard), m = w((N) => N.filterValues), { authToken: h, tokenProps: b } = P();
283
283
  async function y() {
284
284
  g(!0);
285
- const N = await Mt(
285
+ const N = await Tt(
286
286
  b.apiServiceUrl,
287
287
  s,
288
288
  d,
289
289
  m,
290
290
  h == null ? void 0 : h.accessToken
291
291
  );
292
- N && (i([...l || [], N]), u(N.id), c(!1)), g(!1);
292
+ N && (c([...l || [], N]), u(N.id), i(!1)), g(!1);
293
293
  }
294
- return /* @__PURE__ */ a(Be, { open: v, onOpenChange: c, children: [
295
- /* @__PURE__ */ e(ya, { asChild: !0, children: /* @__PURE__ */ a(
296
- C,
294
+ return /* @__PURE__ */ a(Qe, { open: v, onOpenChange: i, children: [
295
+ /* @__PURE__ */ e(Sa, { asChild: !0, children: /* @__PURE__ */ a(
296
+ L,
297
297
  {
298
298
  variant: "secondary",
299
299
  className: "h-7 p-2",
300
300
  size: "sm",
301
301
  children: [
302
- /* @__PURE__ */ e(Ke, { className: "mr-2 h-4 w-4" }),
302
+ /* @__PURE__ */ e(We, { className: "mr-2 h-4 w-4" }),
303
303
  "Lens"
304
304
  ]
305
305
  }
306
306
  ) }),
307
- /* @__PURE__ */ a(Qe, { className: "sm:max-w-[425px]", children: [
308
- /* @__PURE__ */ a(We, { children: [
309
- /* @__PURE__ */ e(Je, { children: "Create Lens" }),
310
- /* @__PURE__ */ e(Ss, { children: "Lenses are private by default and are only visible to you." })
307
+ /* @__PURE__ */ a(Je, { className: "sm:max-w-[425px]", children: [
308
+ /* @__PURE__ */ a(Ze, { children: [
309
+ /* @__PURE__ */ e(Xe, { children: "Create Lens" }),
310
+ /* @__PURE__ */ e(xs, { 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__ */ a("div", { className: "grid grid-cols-8 items-center gap-4", children: [
313
- /* @__PURE__ */ e(Te, { className: "text-right", children: "Name" }),
313
+ /* @__PURE__ */ e(Ue, { className: "text-right", children: "Name" }),
314
314
  /* @__PURE__ */ e(
315
315
  re,
316
316
  {
@@ -324,8 +324,8 @@ function Ot() {
324
324
  )
325
325
  ] }) }),
326
326
  t && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
327
- /* @__PURE__ */ e(Na, { children: /* @__PURE__ */ e(
328
- C,
327
+ /* @__PURE__ */ e(wa, { children: /* @__PURE__ */ e(
328
+ L,
329
329
  {
330
330
  size: "sm",
331
331
  variant: "outline",
@@ -338,18 +338,18 @@ function Ot() {
338
338
  ] })
339
339
  ] });
340
340
  }
341
- function Tt() {
342
- const [s, o] = S(!1), t = x((d) => d.lenses), r = x((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: i } = Ns(), { authToken: u, tokenProps: p } = j();
341
+ function Gt() {
342
+ const [s, o] = S(!1), t = w((d) => d.lenses), n = w((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: c } = ws(), { authToken: u, tokenProps: p } = P();
343
343
  async function g(d) {
344
- i(d);
344
+ c(d);
345
345
  }
346
346
  async function v(d) {
347
- if (await It(p.apiServiceUrl, d, u == null ? void 0 : u.accessToken)) {
347
+ if (await _t(p.apiServiceUrl, d, u == null ? void 0 : u.accessToken)) {
348
348
  const h = t == null ? void 0 : t.filter((b) => b.id !== d);
349
- l(h || []), i("original");
349
+ l(h || []), c("original");
350
350
  }
351
351
  }
352
- async function c(d) {
352
+ async function i(d) {
353
353
  const m = t == null ? void 0 : t.map((y) => y.id === d.id ? {
354
354
  ...y,
355
355
  isDefault: !d.isDefault
@@ -362,30 +362,30 @@ function Tt() {
362
362
  ...d,
363
363
  isDefault: !d.isDefault
364
364
  };
365
- await je(p.apiServiceUrl, h, u == null ? void 0 : u.accessToken);
365
+ await Ve(p.apiServiceUrl, h, u == null ? void 0 : u.accessToken);
366
366
  const b = t == null ? void 0 : t.find((y) => y.isDefault);
367
367
  if (b && b.id !== d.id) {
368
368
  const y = {
369
369
  ...b,
370
370
  isDefault: !1
371
371
  };
372
- await je(p.apiServiceUrl, y, u == null ? void 0 : u.accessToken);
372
+ await Ve(p.apiServiceUrl, y, u == null ? void 0 : u.accessToken);
373
373
  }
374
374
  }
375
- return /* @__PURE__ */ a(He, { open: s, onOpenChange: o, children: [
376
- /* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(q, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(St, { className: "h-4 w-4" }) }) }),
377
- /* @__PURE__ */ a(ze, { align: "end", className: "w-60", children: [
378
- /* @__PURE__ */ e(Sa, { className: "px-3", children: "Lenses" }),
379
- /* @__PURE__ */ e(wa, {}),
375
+ return /* @__PURE__ */ a(ze, { open: s, onOpenChange: o, children: [
376
+ /* @__PURE__ */ e($e, { asChild: !0, children: /* @__PURE__ */ e(j, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Dt, { className: "h-4 w-4" }) }) }),
377
+ /* @__PURE__ */ a(Be, { align: "end", className: "w-60", children: [
378
+ /* @__PURE__ */ e(xa, { className: "px-3", children: "Lenses" }),
379
+ /* @__PURE__ */ e(Da, {}),
380
380
  /* @__PURE__ */ a(
381
- xa,
381
+ Ca,
382
382
  {
383
- value: r,
383
+ value: n,
384
384
  onValueChange: g,
385
385
  children: [
386
- /* @__PURE__ */ e(ps, { value: "original", children: "Original" }),
386
+ /* @__PURE__ */ e(gs, { value: "original", children: "Original" }),
387
387
  t == null ? void 0 : t.map((d) => /* @__PURE__ */ a(
388
- ps,
388
+ gs,
389
389
  {
390
390
  className: "group flex justify-between gap-2",
391
391
  value: d.id,
@@ -393,12 +393,12 @@ function Tt() {
393
393
  /* @__PURE__ */ e("p", { children: d.name }),
394
394
  /* @__PURE__ */ a("span", { className: "flex items-center gap-3", children: [
395
395
  /* @__PURE__ */ e(
396
- ws,
396
+ Ds,
397
397
  {
398
398
  onClick: (m) => {
399
- m.preventDefault(), c(d);
399
+ m.preventDefault(), i(d);
400
400
  },
401
- className: J(
401
+ className: Z(
402
402
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
403
403
  {
404
404
  invisible: !d.isDefault,
@@ -409,7 +409,7 @@ function Tt() {
409
409
  }
410
410
  ),
411
411
  /* @__PURE__ */ e(
412
- xs,
412
+ Cs,
413
413
  {
414
414
  onClick: (m) => {
415
415
  m.preventDefault(), v(d.id);
@@ -429,117 +429,117 @@ function Tt() {
429
429
  ] })
430
430
  ] });
431
431
  }
432
- const _t = async (s, o, t) => {
433
- const r = `${s}/management/v1/groups`;
434
- return await Ds(r, o, t);
435
- }, Ut = async (s, o, t) => {
436
- const r = `${s}/management/v1/groups/${t}`, l = await fetch(r, {
432
+ const Rt = async (s, o, t) => {
433
+ const n = `${s}/management/v1/groups`;
434
+ return await Ls(n, o, t);
435
+ }, Pt = async (s, o, t) => {
436
+ const n = `${s}/management/v1/groups/${t}`, l = await fetch(n, {
437
437
  method: "DELETE",
438
438
  headers: {
439
439
  Authorization: `Bearer ${o}`
440
440
  }
441
441
  });
442
442
  if (!l.ok) {
443
- const i = await l.text();
444
- throw new Error(i || "Failed to delete group");
443
+ const c = await l.text();
444
+ throw new Error(c || "Failed to delete group");
445
445
  }
446
- }, Rt = async (s, o, t, r) => {
446
+ }, Ft = async (s, o, t, n) => {
447
447
  const l = `${s}/management/v1/groups/${t}/members`;
448
- return await Ds(l, o, r);
449
- }, Gt = async (s, o, t, r) => {
450
- const l = `${s}/management/v1/groups/${t}/members`, i = await fetch(l, {
448
+ return await Ls(l, o, n);
449
+ }, jt = async (s, o, t, n) => {
450
+ const l = `${s}/management/v1/groups/${t}/members`, c = await fetch(l, {
451
451
  method: "DELETE",
452
452
  headers: {
453
453
  "Content-Type": "application/json",
454
454
  Authorization: `Bearer ${o}`
455
455
  },
456
- body: JSON.stringify(r)
456
+ body: JSON.stringify(n)
457
457
  });
458
- if (!i.ok) {
459
- const u = await i.text();
458
+ if (!c.ok) {
459
+ const u = await c.text();
460
460
  throw new Error(u || "Failed to remove group members");
461
461
  }
462
462
  };
463
- function Pt() {
464
- const { authToken: s, tokenProps: o } = j(), t = ge();
465
- return ve({
466
- mutationFn: (r) => _t(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
463
+ function qt() {
464
+ const { authToken: s, tokenProps: o } = P(), t = be();
465
+ return ye({
466
+ mutationFn: (n) => Rt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", n),
467
467
  onSuccess: () => {
468
- t.invalidateQueries({ queryKey: ["groups"] }), L.success("Group created successfully");
468
+ t.invalidateQueries({ queryKey: ["groups"] }), E.success("Group created successfully");
469
469
  },
470
- onError: (r) => {
471
- console.error("Failed to create group:", r), L.error("Failed to create group", {
472
- description: r.message
470
+ onError: (n) => {
471
+ console.error("Failed to create group:", n), E.error("Failed to create group", {
472
+ description: n.message
473
473
  });
474
474
  }
475
475
  });
476
476
  }
477
- function Ft() {
478
- const { authToken: s, tokenProps: o } = j(), t = ge();
479
- return ve({
480
- mutationFn: (r) => Ut(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
481
- onSuccess: (r, l) => {
482
- t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", l] }), L.success("Group deleted successfully");
477
+ function Ht() {
478
+ const { authToken: s, tokenProps: o } = P(), t = be();
479
+ return ye({
480
+ mutationFn: (n) => Pt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", n),
481
+ onSuccess: (n, l) => {
482
+ t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", l] }), E.success("Group deleted successfully");
483
483
  },
484
- onError: (r) => {
485
- console.error("Failed to delete group:", r), L.error("Failed to delete group", {
486
- description: r.message
484
+ onError: (n) => {
485
+ console.error("Failed to delete group:", n), E.error("Failed to delete group", {
486
+ description: n.message
487
487
  });
488
488
  }
489
489
  });
490
490
  }
491
- function qt() {
492
- const { authToken: s, tokenProps: o } = j(), t = ge();
493
- return ve({
491
+ function Vt() {
492
+ const { authToken: s, tokenProps: o } = P(), t = be();
493
+ return ye({
494
494
  mutationFn: ({
495
- groupId: r,
495
+ groupId: n,
496
496
  data: l
497
- }) => Rt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
498
- onSuccess: (r, l) => {
497
+ }) => Ft(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", n, l),
498
+ onSuccess: (n, l) => {
499
499
  t.invalidateQueries({ queryKey: ["group", l.groupId] }), t.invalidateQueries({
500
500
  queryKey: ["group-members", l.groupId]
501
- }), t.invalidateQueries({ queryKey: ["groups"] }), L.success("Members added successfully");
501
+ }), t.invalidateQueries({ queryKey: ["groups"] }), E.success("Members added successfully");
502
502
  },
503
- onError: (r) => {
504
- console.error("Failed to add group members:", r), L.error("Failed to add members", {
505
- description: r.message
503
+ onError: (n) => {
504
+ console.error("Failed to add group members:", n), E.error("Failed to add members", {
505
+ description: n.message
506
506
  });
507
507
  }
508
508
  });
509
509
  }
510
- function jt() {
511
- const { authToken: s, tokenProps: o } = j(), t = ge();
512
- return ve({
510
+ function zt() {
511
+ const { authToken: s, tokenProps: o } = P(), t = be();
512
+ return ye({
513
513
  mutationFn: ({
514
- groupId: r,
514
+ groupId: n,
515
515
  data: l
516
- }) => Gt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
517
- onSuccess: (r, l) => {
516
+ }) => jt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", n, l),
517
+ onSuccess: (n, l) => {
518
518
  t.invalidateQueries({ queryKey: ["group", l.groupId] }), t.invalidateQueries({
519
519
  queryKey: ["group-members", l.groupId]
520
- }), t.invalidateQueries({ queryKey: ["groups"] }), L.success("Members removed successfully");
520
+ }), t.invalidateQueries({ queryKey: ["groups"] }), E.success("Members removed successfully");
521
521
  },
522
- onError: (r) => {
523
- console.error("Failed to remove group members:", r), L.error("Failed to remove members", {
524
- description: r.message
522
+ onError: (n) => {
523
+ console.error("Failed to remove group members:", n), E.error("Failed to remove members", {
524
+ description: n.message
525
525
  });
526
526
  }
527
527
  });
528
528
  }
529
- function Ht({
529
+ function $t({
530
530
  onSuccess: s,
531
531
  tenantId: o,
532
532
  isTenantUser: t
533
533
  }) {
534
- const [r, l] = S(""), [i, u] = S(""), [p, g] = S({}), v = Pt(), c = () => {
534
+ const [n, l] = S(""), [c, u] = S(""), [p, g] = S({}), v = qt(), i = () => {
535
535
  const m = {};
536
- return r.trim() ? r.length < 3 ? m.name = "Group name must be at least 3 characters" : r.length > 50 && (m.name = "Group name must be less than 50 characters") : m.name = "Group name is required", i && i.length > 200 && (m.description = "Description must be less than 200 characters"), g(m), Object.keys(m).length === 0;
536
+ return n.trim() ? n.length < 3 ? m.name = "Group name must be at least 3 characters" : n.length > 50 && (m.name = "Group name must be less than 50 characters") : m.name = "Group name is required", c && c.length > 200 && (m.description = "Description must be less than 200 characters"), g(m), Object.keys(m).length === 0;
537
537
  };
538
538
  return /* @__PURE__ */ a("form", { onSubmit: async (m) => {
539
- if (m.preventDefault(), !c()) return;
539
+ if (m.preventDefault(), !i()) return;
540
540
  const h = {
541
- name: r.trim(),
542
- description: i.trim() || void 0,
541
+ name: n.trim(),
542
+ description: c.trim() || void 0,
543
543
  type: t ? "TENANT_GROUP" : "ORG_GROUP",
544
544
  ...t && o ? { tenantId: o } : {}
545
545
  };
@@ -551,7 +551,7 @@ function Ht({
551
551
  }, className: "space-y-6", children: [
552
552
  /* @__PURE__ */ a("div", { className: "space-y-4", children: [
553
553
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
554
- /* @__PURE__ */ a(Te, { htmlFor: "group-name", children: [
554
+ /* @__PURE__ */ a(Ue, { htmlFor: "group-name", children: [
555
555
  "Group Name ",
556
556
  /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
557
557
  ] }),
@@ -560,7 +560,7 @@ function Ht({
560
560
  {
561
561
  id: "group-name",
562
562
  placeholder: "e.g., Marketing Team, Engineering Squad",
563
- value: r,
563
+ value: n,
564
564
  onChange: (m) => {
565
565
  l(m.target.value), p.name && g((h) => ({ ...h, name: "" }));
566
566
  },
@@ -571,16 +571,16 @@ function Ht({
571
571
  p.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: p.name })
572
572
  ] }),
573
573
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
574
- /* @__PURE__ */ a(Te, { htmlFor: "group-description", children: [
574
+ /* @__PURE__ */ a(Ue, { htmlFor: "group-description", children: [
575
575
  "Description",
576
576
  /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
577
577
  ] }),
578
578
  /* @__PURE__ */ e(
579
- Da,
579
+ La,
580
580
  {
581
581
  id: "group-description",
582
582
  placeholder: "Describe the purpose of this group...",
583
- value: i,
583
+ value: c,
584
584
  onChange: (m) => {
585
585
  u(m.target.value), p.description && g((h) => ({ ...h, description: "" }));
586
586
  },
@@ -591,18 +591,18 @@ function Ht({
591
591
  ),
592
592
  p.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: p.description }),
593
593
  /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground", children: [
594
- i.length,
594
+ c.length,
595
595
  "/200 characters"
596
596
  ] })
597
597
  ] }),
598
598
  /* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ a("div", { className: "flex gap-3", children: [
599
- /* @__PURE__ */ e(Ca, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
599
+ /* @__PURE__ */ e(Ea, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
600
600
  /* @__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." })
601
601
  ] }) })
602
602
  ] }),
603
603
  /* @__PURE__ */ a("div", { className: "flex justify-end gap-3", children: [
604
604
  /* @__PURE__ */ e(
605
- C,
605
+ L,
606
606
  {
607
607
  type: "button",
608
608
  variant: "outline",
@@ -614,15 +614,15 @@ function Ht({
614
614
  }
615
615
  ),
616
616
  /* @__PURE__ */ e(
617
- C,
617
+ L,
618
618
  {
619
619
  type: "submit",
620
- disabled: v.isPending || !r.trim(),
620
+ disabled: v.isPending || !n.trim(),
621
621
  children: v.isPending ? /* @__PURE__ */ a(k, { children: [
622
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
622
+ /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
623
623
  "Creating..."
624
624
  ] }) : /* @__PURE__ */ a(k, { children: [
625
- /* @__PURE__ */ e(z, { className: "mr-2 h-4 w-4" }),
625
+ /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4" }),
626
626
  "Create Group"
627
627
  ] })
628
628
  }
@@ -630,176 +630,176 @@ function Ht({
630
630
  ] })
631
631
  ] });
632
632
  }
633
- function Vt() {
634
- return At.useSyncExternalStore(
635
- zt,
633
+ function Bt() {
634
+ return Ot.useSyncExternalStore(
635
+ Kt,
636
636
  () => !0,
637
637
  () => !1
638
638
  );
639
639
  }
640
- function zt() {
640
+ function Kt() {
641
641
  return () => {
642
642
  };
643
643
  }
644
- var Ye = "Avatar", [$t] = La(Ye), [Bt, Ps] = $t(Ye), Fs = _.forwardRef(
644
+ var es = "Avatar", [Qt] = Aa(es), [Wt, js] = Qt(es), qs = _.forwardRef(
645
645
  (s, o) => {
646
- const { __scopeAvatar: t, ...r } = s, [l, i] = _.useState("idle");
646
+ const { __scopeAvatar: t, ...n } = s, [l, c] = _.useState("idle");
647
647
  return /* @__PURE__ */ e(
648
- Bt,
648
+ Wt,
649
649
  {
650
650
  scope: t,
651
651
  imageLoadingStatus: l,
652
- onImageLoadingStatusChange: i,
653
- children: /* @__PURE__ */ e(Xe.span, { ...r, ref: o })
652
+ onImageLoadingStatusChange: c,
653
+ children: /* @__PURE__ */ e(Ye.span, { ...n, ref: o })
654
654
  }
655
655
  );
656
656
  }
657
657
  );
658
- Fs.displayName = Ye;
659
- var qs = "AvatarImage", js = _.forwardRef(
658
+ qs.displayName = es;
659
+ var Hs = "AvatarImage", Vs = _.forwardRef(
660
660
  (s, o) => {
661
- const { __scopeAvatar: t, src: r, onLoadingStatusChange: l = () => {
662
- }, ...i } = s, u = Ps(qs, t), p = Kt(r, i), g = Ea((v) => {
661
+ const { __scopeAvatar: t, src: n, onLoadingStatusChange: l = () => {
662
+ }, ...c } = s, u = js(Hs, t), p = Jt(n, c), g = ka((v) => {
663
663
  l(v), u.onImageLoadingStatusChange(v);
664
664
  });
665
- return _e(() => {
665
+ return Ge(() => {
666
666
  p !== "idle" && g(p);
667
- }, [p, g]), p === "loaded" ? /* @__PURE__ */ e(Xe.img, { ...i, ref: o, src: r }) : null;
667
+ }, [p, g]), p === "loaded" ? /* @__PURE__ */ e(Ye.img, { ...c, ref: o, src: n }) : null;
668
668
  }
669
669
  );
670
- js.displayName = qs;
671
- var Hs = "AvatarFallback", Vs = _.forwardRef(
670
+ Vs.displayName = Hs;
671
+ var zs = "AvatarFallback", $s = _.forwardRef(
672
672
  (s, o) => {
673
- const { __scopeAvatar: t, delayMs: r, ...l } = s, i = Ps(Hs, t), [u, p] = _.useState(r === void 0);
673
+ const { __scopeAvatar: t, delayMs: n, ...l } = s, c = js(zs, t), [u, p] = _.useState(n === void 0);
674
674
  return _.useEffect(() => {
675
- if (r !== void 0) {
676
- const g = window.setTimeout(() => p(!0), r);
675
+ if (n !== void 0) {
676
+ const g = window.setTimeout(() => p(!0), n);
677
677
  return () => window.clearTimeout(g);
678
678
  }
679
- }, [r]), u && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Xe.span, { ...l, ref: o }) : null;
679
+ }, [n]), u && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Ye.span, { ...l, ref: o }) : null;
680
680
  }
681
681
  );
682
- Vs.displayName = Hs;
683
- function ys(s, o) {
682
+ $s.displayName = zs;
683
+ function Ss(s, o) {
684
684
  return s ? o ? (s.src !== o && (s.src = o), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
685
685
  }
686
- function Kt(s, { referrerPolicy: o, crossOrigin: t }) {
687
- const r = Vt(), l = _.useRef(null), i = r ? (l.current || (l.current = new window.Image()), l.current) : null, [u, p] = _.useState(
688
- () => ys(i, s)
686
+ function Jt(s, { referrerPolicy: o, crossOrigin: t }) {
687
+ const n = Bt(), l = _.useRef(null), c = n ? (l.current || (l.current = new window.Image()), l.current) : null, [u, p] = _.useState(
688
+ () => Ss(c, s)
689
689
  );
690
- return _e(() => {
691
- p(ys(i, s));
692
- }, [i, s]), _e(() => {
690
+ return Ge(() => {
691
+ p(Ss(c, s));
692
+ }, [c, s]), Ge(() => {
693
693
  const g = (d) => () => {
694
694
  p(d);
695
695
  };
696
- if (!i) return;
697
- const v = g("loaded"), c = g("error");
698
- return i.addEventListener("load", v), i.addEventListener("error", c), o && (i.referrerPolicy = o), typeof t == "string" && (i.crossOrigin = t), () => {
699
- i.removeEventListener("load", v), i.removeEventListener("error", c);
696
+ if (!c) return;
697
+ const v = g("loaded"), i = g("error");
698
+ return c.addEventListener("load", v), c.addEventListener("error", i), o && (c.referrerPolicy = o), typeof t == "string" && (c.crossOrigin = t), () => {
699
+ c.removeEventListener("load", v), c.removeEventListener("error", i);
700
700
  };
701
- }, [i, t, o]), u;
701
+ }, [c, t, o]), u;
702
702
  }
703
- var zs = Fs, $s = js, Bs = Vs;
704
- const Ze = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
705
- zs,
703
+ var Bs = qs, Ks = Vs, Qs = $s;
704
+ const ss = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
705
+ Bs,
706
706
  {
707
707
  ref: t,
708
- className: J(
708
+ className: Z(
709
709
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
710
710
  s
711
711
  ),
712
712
  ...o
713
713
  }
714
714
  ));
715
- Ze.displayName = zs.displayName;
716
- const Qt = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
717
- $s,
715
+ ss.displayName = Bs.displayName;
716
+ const Zt = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
717
+ Ks,
718
718
  {
719
719
  ref: t,
720
- className: J("aspect-square h-full w-full", s),
720
+ className: Z("aspect-square h-full w-full", s),
721
721
  ...o
722
722
  }
723
723
  ));
724
- Qt.displayName = $s.displayName;
725
- const es = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
726
- Bs,
724
+ Zt.displayName = Ks.displayName;
725
+ const as = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
726
+ Qs,
727
727
  {
728
728
  ref: t,
729
- className: J(
729
+ className: Z(
730
730
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
731
731
  s
732
732
  ),
733
733
  ...o
734
734
  }
735
735
  ));
736
- es.displayName = Bs.displayName;
737
- function Wt({
736
+ as.displayName = Qs.displayName;
737
+ function Xt({
738
738
  open: s,
739
739
  onOpenChange: o,
740
740
  group: t,
741
- onUpdate: r
741
+ onUpdate: n
742
742
  }) {
743
- const [l, i] = S("members"), [u, p] = S(""), [g, v] = S([]), [c, d] = S([]), { data: m, isLoading: h, refetch: b } = Aa(t.id), y = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: A } = ka({
743
+ const [l, c] = S("members"), [u, p] = S(""), [g, v] = S([]), [i, d] = S([]), { data: m, isLoading: h, refetch: b } = Ma(t.id), y = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: A } = Oa({
744
744
  type: y,
745
745
  tenantId: t.tenantId || void 0,
746
746
  active: !0,
747
747
  limit: 100
748
- }), O = qt(), U = jt(), M = (m == null ? void 0 : m.members) || [], $ = he(() => new Set(M.map((f) => f.userId)), [M]), P = he(() => N.filter((f) => !$.has(f.id)), [N, $]), B = he(() => {
749
- if (!u) return P;
748
+ }), I = Vt(), U = zt(), M = (m == null ? void 0 : m.members) || [], z = fe(() => new Set(M.map((f) => f.userId)), [M]), R = fe(() => N.filter((f) => !z.has(f.id)), [N, z]), $ = fe(() => {
749
+ if (!u) return R;
750
750
  const f = u.toLowerCase();
751
- return P.filter(
752
- (E) => {
753
- var T, w;
754
- return ((T = E.name) == null ? void 0 : T.toLowerCase().includes(f)) || ((w = E.email) == null ? void 0 : w.toLowerCase().includes(f));
751
+ return R.filter(
752
+ (C) => {
753
+ var T, F;
754
+ return ((T = C.name) == null ? void 0 : T.toLowerCase().includes(f)) || ((F = C.email) == null ? void 0 : F.toLowerCase().includes(f));
755
755
  }
756
756
  );
757
- }, [P, u]), D = he(() => {
757
+ }, [R, u]), x = fe(() => {
758
758
  if (!u) return M;
759
759
  const f = u.toLowerCase();
760
760
  return M.filter(
761
- (E) => {
762
- var T, w, F, H;
763
- return ((w = (T = E.user) == null ? void 0 : T.name) == null ? void 0 : w.toLowerCase().includes(f)) || ((H = (F = E.user) == null ? void 0 : F.email) == null ? void 0 : H.toLowerCase().includes(f));
761
+ (C) => {
762
+ var T, F, ie, D;
763
+ return ((F = (T = C.user) == null ? void 0 : T.name) == null ? void 0 : F.toLowerCase().includes(f)) || ((D = (ie = C.user) == null ? void 0 : ie.email) == null ? void 0 : D.toLowerCase().includes(f));
764
764
  }
765
765
  );
766
- }, [M, u]), R = async () => {
766
+ }, [M, u]), B = async () => {
767
767
  if (g.length !== 0)
768
768
  try {
769
- await O.mutateAsync({
769
+ await I.mutateAsync({
770
770
  groupId: t.id,
771
771
  data: {
772
772
  userIds: g,
773
773
  userType: y === "tenant" ? "tenant" : "org"
774
774
  }
775
- }), v([]), i("members"), b(), r == null || r();
775
+ }), v([]), c("members"), b(), n == null || n();
776
776
  } catch (f) {
777
777
  console.error("Failed to add members:", f);
778
778
  }
779
779
  }, K = async () => {
780
- if (c.length !== 0)
780
+ if (i.length !== 0)
781
781
  try {
782
782
  await U.mutateAsync({
783
783
  groupId: t.id,
784
784
  data: {
785
- userIds: c
785
+ userIds: i
786
786
  }
787
- }), d([]), b(), r == null || r();
787
+ }), d([]), b(), n == null || n();
788
788
  } catch (f) {
789
789
  console.error("Failed to remove members:", f);
790
790
  }
791
- }, oe = (f) => {
791
+ }, Q = (f) => {
792
792
  v(
793
- (E) => E.includes(f) ? E.filter((T) => T !== f) : [...E, f]
793
+ (C) => C.includes(f) ? C.filter((T) => T !== f) : [...C, f]
794
794
  );
795
- }, Q = (f) => {
795
+ }, W = (f) => {
796
796
  d(
797
- (E) => E.includes(f) ? E.filter((T) => T !== f) : [...E, f]
797
+ (C) => C.includes(f) ? C.filter((T) => T !== f) : [...C, f]
798
798
  );
799
799
  };
800
- return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(Be, { open: s, onOpenChange: o, children: /* @__PURE__ */ a(Qe, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
801
- /* @__PURE__ */ a(We, { children: [
802
- /* @__PURE__ */ e(Je, { children: t.name }),
800
+ return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(Qe, { open: s, onOpenChange: o, children: /* @__PURE__ */ a(Je, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
801
+ /* @__PURE__ */ a(Ze, { children: [
802
+ /* @__PURE__ */ e(Xe, { children: t.name }),
803
803
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: [
804
804
  M.length,
805
805
  " ",
@@ -811,16 +811,16 @@ function Wt({
811
811
  " group"
812
812
  ] })
813
813
  ] }),
814
- /* @__PURE__ */ a(Cs, { value: l, onValueChange: (f) => {
815
- i(f), p(""), d([]);
814
+ /* @__PURE__ */ a(Es, { value: l, onValueChange: (f) => {
815
+ c(f), p(""), d([]);
816
816
  }, className: "mt-4", children: [
817
- /* @__PURE__ */ a(Ls, { className: "grid w-full grid-cols-2", children: [
818
- /* @__PURE__ */ e(pe, { value: "members", children: "Current Members" }),
819
- /* @__PURE__ */ e(pe, { value: "add", children: "Add Members" })
817
+ /* @__PURE__ */ a(As, { className: "grid w-full grid-cols-2", children: [
818
+ /* @__PURE__ */ e(ge, { value: "members", children: "Current Members" }),
819
+ /* @__PURE__ */ e(ge, { value: "add", children: "Add Members" })
820
820
  ] }),
821
- /* @__PURE__ */ a(fe, { value: "members", className: "mt-4 space-y-4", children: [
821
+ /* @__PURE__ */ a(ve, { value: "members", className: "mt-4 space-y-4", children: [
822
822
  /* @__PURE__ */ a("div", { className: "relative", children: [
823
- /* @__PURE__ */ e(Ue, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
823
+ /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
824
824
  /* @__PURE__ */ e(
825
825
  re,
826
826
  {
@@ -831,47 +831,47 @@ function Wt({
831
831
  }
832
832
  )
833
833
  ] }),
834
- /* @__PURE__ */ e(Re, { className: c.length > 0 ? "h-[300px]" : "h-[350px]", children: h ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Ge, { className: "h-16 w-full" }, f)) }) : D.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
835
- /* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
834
+ /* @__PURE__ */ e(Pe, { className: i.length > 0 ? "h-[300px]" : "h-[350px]", children: h ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Fe, { className: "h-16 w-full" }, f)) }) : x.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
835
+ /* @__PURE__ */ e(V, { className: "h-12 w-12 mb-3 opacity-50" }),
836
836
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
837
837
  /* @__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' })
838
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((f) => /* @__PURE__ */ e(
839
- Jt,
838
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: x.map((f) => /* @__PURE__ */ e(
839
+ Yt,
840
840
  {
841
841
  member: f,
842
- selected: c.includes(f.userId),
843
- onToggle: () => Q(f.userId)
842
+ selected: i.includes(f.userId),
843
+ onToggle: () => W(f.userId)
844
844
  },
845
845
  f.id
846
846
  )) }) }),
847
- c.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
847
+ i.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between pt-4 border-t", children: [
848
848
  /* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
849
- c.length,
849
+ i.length,
850
850
  " member",
851
- c.length !== 1 ? "s" : "",
851
+ i.length !== 1 ? "s" : "",
852
852
  " selected"
853
853
  ] }),
854
854
  /* @__PURE__ */ e(
855
- C,
855
+ L,
856
856
  {
857
857
  variant: "destructive",
858
858
  size: "sm",
859
859
  onClick: K,
860
860
  disabled: U.isPending,
861
861
  children: U.isPending ? /* @__PURE__ */ a(k, { children: [
862
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
862
+ /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
863
863
  "Removing..."
864
864
  ] }) : /* @__PURE__ */ a(k, { children: [
865
- /* @__PURE__ */ e(Es, { className: "mr-2 h-4 w-4" }),
865
+ /* @__PURE__ */ e(ks, { className: "mr-2 h-4 w-4" }),
866
866
  "Remove Selected"
867
867
  ] })
868
868
  }
869
869
  )
870
870
  ] })
871
871
  ] }),
872
- /* @__PURE__ */ a(fe, { value: "add", className: "mt-4 space-y-4", children: [
872
+ /* @__PURE__ */ a(ve, { value: "add", className: "mt-4 space-y-4", children: [
873
873
  /* @__PURE__ */ a("div", { className: "relative", children: [
874
- /* @__PURE__ */ e(Ue, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
874
+ /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
875
875
  /* @__PURE__ */ e(
876
876
  re,
877
877
  {
@@ -882,16 +882,16 @@ function Wt({
882
882
  }
883
883
  )
884
884
  ] }),
885
- /* @__PURE__ */ e(Re, { className: "h-[300px]", children: A ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Ge, { className: "h-16 w-full" }, f)) }) : B.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
886
- /* @__PURE__ */ e(Pe, { className: "h-12 w-12 mb-3 opacity-50" }),
885
+ /* @__PURE__ */ e(Pe, { className: "h-[300px]", children: A ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Fe, { className: "h-16 w-full" }, f)) }) : $.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
886
+ /* @__PURE__ */ e(je, { className: "h-12 w-12 mb-3 opacity-50" }),
887
887
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
888
888
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
889
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: B.map((f) => /* @__PURE__ */ e(
890
- Xt,
889
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: $.map((f) => /* @__PURE__ */ e(
890
+ en,
891
891
  {
892
892
  user: f,
893
893
  selected: g.includes(f.id),
894
- onToggle: () => oe(f.id)
894
+ onToggle: () => Q(f.id)
895
895
  },
896
896
  f.id
897
897
  )) }) }),
@@ -903,15 +903,15 @@ function Wt({
903
903
  " selected"
904
904
  ] }),
905
905
  /* @__PURE__ */ e(
906
- C,
906
+ L,
907
907
  {
908
- onClick: R,
909
- disabled: O.isPending,
910
- children: O.isPending ? /* @__PURE__ */ a(k, { children: [
911
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
908
+ onClick: B,
909
+ disabled: I.isPending,
910
+ children: I.isPending ? /* @__PURE__ */ a(k, { children: [
911
+ /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
912
912
  "Adding..."
913
913
  ] }) : /* @__PURE__ */ a(k, { children: [
914
- /* @__PURE__ */ e(Pe, { className: "mr-2 h-4 w-4" }),
914
+ /* @__PURE__ */ e(je, { className: "mr-2 h-4 w-4" }),
915
915
  "Add Members"
916
916
  ] })
917
917
  }
@@ -921,21 +921,21 @@ function Wt({
921
921
  ] })
922
922
  ] }) }) });
923
923
  }
924
- function Jt({
924
+ function Yt({
925
925
  member: s,
926
926
  selected: o,
927
927
  onToggle: t
928
928
  }) {
929
- var l, i, u, p;
930
- const r = ((i = (l = s.user) == null ? void 0 : l.name) == null ? void 0 : i.split(" ").map((g) => g[0]).join("").toUpperCase()) || "?";
929
+ var l, c, u, p;
930
+ const n = ((c = (l = s.user) == null ? void 0 : l.name) == null ? void 0 : c.split(" ").map((g) => g[0]).join("").toUpperCase()) || "?";
931
931
  return /* @__PURE__ */ a(
932
932
  "div",
933
933
  {
934
934
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
935
935
  onClick: t,
936
936
  children: [
937
- /* @__PURE__ */ e(As, { checked: o }),
938
- /* @__PURE__ */ e(Ze, { className: "h-8 w-8", children: /* @__PURE__ */ e(es, { className: "text-xs", children: r }) }),
937
+ /* @__PURE__ */ e(Ms, { checked: o }),
938
+ /* @__PURE__ */ e(ss, { className: "h-8 w-8", children: /* @__PURE__ */ e(as, { className: "text-xs", children: n }) }),
939
939
  /* @__PURE__ */ a("div", { className: "flex-1", children: [
940
940
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((u = s.user) == null ? void 0 : u.name) || "Unknown User" }),
941
941
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (p = s.user) == null ? void 0 : p.email })
@@ -944,21 +944,21 @@ function Jt({
944
944
  }
945
945
  );
946
946
  }
947
- function Xt({
947
+ function en({
948
948
  user: s,
949
949
  selected: o,
950
950
  onToggle: t
951
951
  }) {
952
952
  var l;
953
- const r = ((l = s.name) == null ? void 0 : l.split(" ").map((i) => i[0]).join("").toUpperCase()) || "?";
953
+ const n = ((l = s.name) == null ? void 0 : l.split(" ").map((c) => c[0]).join("").toUpperCase()) || "?";
954
954
  return /* @__PURE__ */ a(
955
955
  "div",
956
956
  {
957
957
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
958
958
  onClick: t,
959
959
  children: [
960
- /* @__PURE__ */ e(As, { checked: o }),
961
- /* @__PURE__ */ e(Ze, { className: "h-8 w-8", children: /* @__PURE__ */ e(es, { className: "text-xs", children: r }) }),
960
+ /* @__PURE__ */ e(Ms, { checked: o }),
961
+ /* @__PURE__ */ e(ss, { className: "h-8 w-8", children: /* @__PURE__ */ e(as, { className: "text-xs", children: n }) }),
962
962
  /* @__PURE__ */ a("div", { className: "flex-1", children: [
963
963
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
964
964
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
@@ -967,83 +967,83 @@ function Xt({
967
967
  }
968
968
  );
969
969
  }
970
- function Yt({
970
+ function sn({
971
971
  open: s,
972
972
  onOpenChange: o
973
973
  }) {
974
- const [t, r] = S("groups"), [l, i] = S(""), [u, p] = S(null), [g, v] = S(!1), [c, d] = S(null), { tokenProps: m } = j(), { currentUser: h } = ks(), b = Ft(), y = (h == null ? void 0 : h.type) === "tenant", N = m == null ? void 0 : m.tenantId, { groups: A, isLoading: O, refetch: U } = Ma({
974
+ const [t, n] = S("groups"), [l, c] = S(""), [u, p] = S(null), [g, v] = S(!1), [i, d] = S(null), { tokenProps: m } = P(), { currentUser: h } = Os(), b = Ht(), y = (h == null ? void 0 : h.type) === "tenant", N = m == null ? void 0 : m.tenantId, { groups: A, isLoading: I, refetch: U } = Ia({
975
975
  type: y ? "TENANT_GROUP" : "all",
976
976
  tenantId: y ? N : void 0,
977
977
  includeMembers: !1
978
978
  }), M = A.filter(
979
- (D) => {
980
- var R;
981
- return D.name.toLowerCase().includes(l.toLowerCase()) || ((R = D.description) == null ? void 0 : R.toLowerCase().includes(l.toLowerCase()));
979
+ (x) => {
980
+ var B;
981
+ return x.name.toLowerCase().includes(l.toLowerCase()) || ((B = x.description) == null ? void 0 : B.toLowerCase().includes(l.toLowerCase()));
982
982
  }
983
- ), $ = async () => {
984
- if (c)
983
+ ), z = async () => {
984
+ if (i)
985
985
  try {
986
- await b.mutateAsync(c.id), d(null), U();
987
- } catch (D) {
988
- console.error("Failed to delete group:", D);
986
+ await b.mutateAsync(i.id), d(null), U();
987
+ } catch (x) {
988
+ console.error("Failed to delete group:", x);
989
989
  }
990
- }, P = (D) => {
991
- p(D), v(!0);
992
- }, B = () => {
993
- r("groups"), U();
990
+ }, R = (x) => {
991
+ p(x), v(!0);
992
+ }, $ = () => {
993
+ n("groups"), U();
994
994
  };
995
995
  return /* @__PURE__ */ a(k, { children: [
996
- /* @__PURE__ */ e(Be, { open: s, onOpenChange: o, children: /* @__PURE__ */ a(Qe, { className: "max-w-4xl max-h-[80vh]", children: [
997
- /* @__PURE__ */ a(We, { children: [
998
- /* @__PURE__ */ a(Je, { className: "flex items-center gap-2", children: [
999
- /* @__PURE__ */ e(z, { className: "h-5 w-5" }),
996
+ /* @__PURE__ */ e(Qe, { open: s, onOpenChange: o, children: /* @__PURE__ */ a(Je, { className: "max-w-4xl max-h-[80vh]", children: [
997
+ /* @__PURE__ */ a(Ze, { children: [
998
+ /* @__PURE__ */ a(Xe, { className: "flex items-center gap-2", children: [
999
+ /* @__PURE__ */ e(V, { className: "h-5 w-5" }),
1000
1000
  "Group Management"
1001
1001
  ] }),
1002
- /* @__PURE__ */ e(Ss, { children: "Manage your groups, create new groups, and control group membership" })
1002
+ /* @__PURE__ */ e(xs, { children: "Manage your groups, create new groups, and control group membership" })
1003
1003
  ] }),
1004
- /* @__PURE__ */ a(Cs, { value: t, onValueChange: r, className: "mt-4", children: [
1005
- /* @__PURE__ */ a(Ls, { className: "grid w-full grid-cols-2", children: [
1006
- /* @__PURE__ */ a(pe, { value: "groups", className: "flex items-center gap-2", children: [
1007
- /* @__PURE__ */ e(z, { className: "h-4 w-4" }),
1004
+ /* @__PURE__ */ a(Es, { value: t, onValueChange: n, className: "mt-4", children: [
1005
+ /* @__PURE__ */ a(As, { className: "grid w-full grid-cols-2", children: [
1006
+ /* @__PURE__ */ a(ge, { value: "groups", className: "flex items-center gap-2", children: [
1007
+ /* @__PURE__ */ e(V, { className: "h-4 w-4" }),
1008
1008
  "Groups"
1009
1009
  ] }),
1010
- /* @__PURE__ */ a(pe, { value: "create", className: "flex items-center gap-2", children: [
1011
- /* @__PURE__ */ e(Ke, { className: "h-4 w-4" }),
1010
+ /* @__PURE__ */ a(ge, { value: "create", className: "flex items-center gap-2", children: [
1011
+ /* @__PURE__ */ e(We, { className: "h-4 w-4" }),
1012
1012
  "Create Group"
1013
1013
  ] })
1014
1014
  ] }),
1015
- /* @__PURE__ */ e(fe, { value: "groups", className: "mt-4", children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
1015
+ /* @__PURE__ */ e(ve, { value: "groups", className: "mt-4", children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
1016
1016
  /* @__PURE__ */ a("div", { className: "relative", children: [
1017
- /* @__PURE__ */ e(Ue, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1017
+ /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1018
1018
  /* @__PURE__ */ e(
1019
1019
  re,
1020
1020
  {
1021
1021
  placeholder: "Search groups...",
1022
1022
  value: l,
1023
- onChange: (D) => i(D.target.value),
1023
+ onChange: (x) => c(x.target.value),
1024
1024
  className: "pl-10"
1025
1025
  }
1026
1026
  )
1027
1027
  ] }),
1028
- /* @__PURE__ */ e(Re, { className: "h-[400px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Ge, { className: "h-24 w-full" }, D)) }) : M.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1029
- /* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
1028
+ /* @__PURE__ */ e(Pe, { className: "h-[400px]", children: I ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(Fe, { className: "h-24 w-full" }, x)) }) : M.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1029
+ /* @__PURE__ */ e(V, { className: "h-12 w-12 mb-3 opacity-50" }),
1030
1030
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
1031
1031
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
1032
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((D) => /* @__PURE__ */ e(
1033
- Zt,
1032
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((x) => /* @__PURE__ */ e(
1033
+ an,
1034
1034
  {
1035
- group: D,
1036
- onManageMembers: () => P(D),
1037
- onDelete: () => d(D),
1035
+ group: x,
1036
+ onManageMembers: () => R(x),
1037
+ onDelete: () => d(x),
1038
1038
  currentUserId: h == null ? void 0 : h.id
1039
1039
  },
1040
- D.id
1040
+ x.id
1041
1041
  )) }) })
1042
1042
  ] }) }),
1043
- /* @__PURE__ */ e(fe, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1044
- Ht,
1043
+ /* @__PURE__ */ e(ve, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1044
+ $t,
1045
1045
  {
1046
- onSuccess: B,
1046
+ onSuccess: $,
1047
1047
  tenantId: N,
1048
1048
  isTenantUser: y
1049
1049
  }
@@ -1051,7 +1051,7 @@ function Yt({
1051
1051
  ] })
1052
1052
  ] }) }),
1053
1053
  u && /* @__PURE__ */ e(
1054
- Wt,
1054
+ Xt,
1055
1055
  {
1056
1056
  open: g,
1057
1057
  onOpenChange: v,
@@ -1060,29 +1060,29 @@ function Yt({
1060
1060
  }
1061
1061
  ),
1062
1062
  /* @__PURE__ */ e(
1063
- Ms,
1063
+ Is,
1064
1064
  {
1065
- open: !!c,
1065
+ open: !!i,
1066
1066
  onOpenChange: () => d(null),
1067
- children: /* @__PURE__ */ a(Is, { children: [
1068
- /* @__PURE__ */ a(Os, { children: [
1069
- /* @__PURE__ */ e(Ts, { children: "Delete Group" }),
1070
- /* @__PURE__ */ a(_s, { children: [
1067
+ children: /* @__PURE__ */ a(Ts, { children: [
1068
+ /* @__PURE__ */ a(_s, { children: [
1069
+ /* @__PURE__ */ e(Us, { children: "Delete Group" }),
1070
+ /* @__PURE__ */ a(Gs, { children: [
1071
1071
  'Are you sure you want to delete "',
1072
- c == null ? void 0 : c.name,
1072
+ i == null ? void 0 : i.name,
1073
1073
  '"? This action cannot be undone and will remove all members from the group.'
1074
1074
  ] })
1075
1075
  ] }),
1076
- /* @__PURE__ */ a(Us, { children: [
1077
- /* @__PURE__ */ e(Rs, { children: "Cancel" }),
1076
+ /* @__PURE__ */ a(Rs, { children: [
1077
+ /* @__PURE__ */ e(Ps, { children: "Cancel" }),
1078
1078
  /* @__PURE__ */ e(
1079
- Fe,
1079
+ qe,
1080
1080
  {
1081
- onClick: $,
1081
+ onClick: z,
1082
1082
  disabled: b.isPending,
1083
1083
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1084
1084
  children: b.isPending ? /* @__PURE__ */ a(k, { children: [
1085
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
1085
+ /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
1086
1086
  "Deleting..."
1087
1087
  ] }) : "Delete Group"
1088
1088
  }
@@ -1093,13 +1093,13 @@ function Yt({
1093
1093
  )
1094
1094
  ] });
1095
1095
  }
1096
- function Zt({
1096
+ function an({
1097
1097
  group: s,
1098
1098
  onManageMembers: o,
1099
1099
  onDelete: t,
1100
- currentUserId: r
1100
+ currentUserId: n
1101
1101
  }) {
1102
- const l = s.createdBy === r;
1102
+ const l = s.createdBy === n;
1103
1103
  return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3", children: [
1104
1104
  /* @__PURE__ */ a("div", { className: "flex-1 space-y-2", children: [
1105
1105
  /* @__PURE__ */ a("div", { children: [
@@ -1108,194 +1108,194 @@ function Zt({
1108
1108
  ] }),
1109
1109
  /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
1110
1110
  /* @__PURE__ */ a("span", { className: "flex items-center gap-1", children: [
1111
- /* @__PURE__ */ e(z, { className: "h-3 w-3" }),
1111
+ /* @__PURE__ */ e(V, { className: "h-3 w-3" }),
1112
1112
  s.memberCount,
1113
1113
  " ",
1114
1114
  s.memberCount === 1 ? "member" : "members"
1115
1115
  ] }),
1116
1116
  /* @__PURE__ */ a("span", { children: [
1117
1117
  "Created ",
1118
- vt(new Date(s.createdAt), "MMM d, yyyy")
1118
+ Nt(new Date(s.createdAt), "MMM d, yyyy")
1119
1119
  ] })
1120
1120
  ] })
1121
1121
  ] }),
1122
1122
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
1123
1123
  /* @__PURE__ */ e(
1124
- C,
1124
+ L,
1125
1125
  {
1126
1126
  variant: "ghost",
1127
1127
  size: "sm",
1128
1128
  onClick: o,
1129
1129
  title: "Manage members",
1130
- children: /* @__PURE__ */ e(Pe, { className: "h-4 w-4" })
1130
+ children: /* @__PURE__ */ e(je, { className: "h-4 w-4" })
1131
1131
  }
1132
1132
  ),
1133
1133
  l && /* @__PURE__ */ e(
1134
- C,
1134
+ L,
1135
1135
  {
1136
1136
  variant: "ghost",
1137
1137
  size: "sm",
1138
1138
  onClick: t,
1139
1139
  title: "Delete group",
1140
1140
  className: "text-destructive hover:text-destructive",
1141
- children: /* @__PURE__ */ e(Es, { className: "h-4 w-4" })
1141
+ children: /* @__PURE__ */ e(ks, { className: "h-4 w-4" })
1142
1142
  }
1143
1143
  )
1144
1144
  ] })
1145
1145
  ] }) });
1146
1146
  }
1147
- function dr() {
1148
- var ds, us, ms, hs;
1149
- lt(), ct();
1147
+ function pn() {
1148
+ var ms, hs, ps, fs;
1149
+ mt(), ht();
1150
1150
  const {
1151
1151
  authToken: s,
1152
1152
  tokenProps: o,
1153
1153
  id: t
1154
- } = j(), { isLocalDev: r } = Ia(), { permissions: l } = gt(), i = Oa(), { isLoading: u } = Ta();
1155
- x((n) => n.theme);
1156
- const p = x((n) => n.lenses), g = x((n) => n.selectedLensId), v = p == null ? void 0 : p.find((n) => n.id === g), c = x((n) => n.dashboard);
1157
- x((n) => n.selectedSheetId);
1158
- const d = x(
1159
- (n) => n.isDashboardEditing
1160
- ), { setDashboardTitle: m } = x((n) => n.actions), [h, b] = S(!1), [y, N] = S(!1), [A, O] = S(!1), [U, M] = S(!1), [$, P] = S(!1), [B, D] = S(!1), [R, K] = S(null), [oe, Q] = S(!1), f = x((n) => n.isDashboardPanelOpen), E = x(
1161
- (n) => n.actions.setIsDashboardPanelOpen
1162
- ), T = x((n) => n.filterValues), w = x((n) => n.isVisualEditing);
1163
- fs((n) => n.card);
1164
- const F = me(
1165
- (n) => n.selectedDashboard
1166
- ), H = me(
1167
- (n) => n.initialDashboard
1154
+ } = P(), { isLocalDev: n } = Ta(), { permissions: l } = yt(), c = _a(), { isLoading: u } = Ua();
1155
+ w((r) => r.theme);
1156
+ const p = w((r) => r.lenses), g = w((r) => r.selectedLensId), v = p == null ? void 0 : p.find((r) => r.id === g), i = w((r) => r.dashboard);
1157
+ w((r) => r.selectedSheetId);
1158
+ const d = w(
1159
+ (r) => r.isDashboardEditing
1160
+ ), { setDashboardTitle: m } = w((r) => r.actions), [h, b] = S(!1), [y, N] = S(!1), [A, I] = S(!1), [U, M] = S(!1), [z, R] = S(!1), [$, x] = S(!1), [B, K] = S(!1), [Q, W] = S(null), [f, C] = S(!1), T = w((r) => r.isDashboardPanelOpen), F = w(
1161
+ (r) => r.actions.setIsDashboardPanelOpen
1162
+ ), ie = w((r) => r.filterValues), D = w((r) => r.isVisualEditing);
1163
+ vs((r) => r.card);
1164
+ const X = pe(
1165
+ (r) => r.selectedDashboard
1166
+ ), le = pe(
1167
+ (r) => r.initialDashboard
1168
1168
  );
1169
- me((n) => n.selectedVisual), x((n) => n.selectedFrameId), fs((n) => n.frame);
1170
- const ie = F ? (us = F == null ? void 0 : F.permissions) == null ? void 0 : us.canEdit : (ds = H == null ? void 0 : H.permissions) == null ? void 0 : ds.canEdit, Ks = x((n) => n.showFilters), Qs = _a((n) => n.setPanelOpen), Ws = x(
1171
- (n) => n.showDashboardJSON
1172
- ), be = x((n) => n.onSaveFunction), Js = x(
1173
- (n) => n.actions.setShowFilters
1174
- ), { setIsDashboardEditing: ss, setShowDashboardJSON: as } = x(
1175
- (n) => n.actions
1176
- ), { setInitialDashboard: ts, clearSelectedDashboard: ye } = me(
1177
- (n) => n.actions
1178
- ), { resources: le } = Ua(ke.DASHBOARD), { data: Ne } = Ra(), Xs = ((ms = Ne == null ? void 0 : Ne.preference) == null ? void 0 : ms.defaultDashboardId) || null, { mutate: Ys, isPending: Zs } = Ga(), { currentUser: ea } = ks(), sa = Pa(ea), W = F || H, rs = W ? {
1179
- id: W.id,
1180
- title: (c == null ? void 0 : c.title) || W.title || "Dashboard"
1181
- } : null, { handleAddNewFrame: aa } = Fa(), [Se, we] = S(!1), [ta, X] = S(!1), [Y, ce] = S("close"), Z = qa(ke.DASHBOARD), [G, xe] = S(
1169
+ pe((r) => r.selectedVisual), w((r) => r.selectedFrameId), vs((r) => r.frame);
1170
+ const ce = X ? (hs = X == null ? void 0 : X.permissions) == null ? void 0 : hs.canEdit : (ms = le == null ? void 0 : le.permissions) == null ? void 0 : ms.canEdit, Ws = w((r) => r.showFilters), Js = Ga((r) => r.setPanelOpen), Zs = w(
1171
+ (r) => r.showDashboardJSON
1172
+ ), Ne = w((r) => r.onSaveFunction), Xs = w(
1173
+ (r) => r.actions.setShowFilters
1174
+ ), { setIsDashboardEditing: ts, setShowDashboardJSON: ns } = w(
1175
+ (r) => r.actions
1176
+ ), { setInitialDashboard: rs, clearSelectedDashboard: Se } = pe(
1177
+ (r) => r.actions
1178
+ ), { resources: de } = Ra(Oe.DASHBOARD), { data: we } = Pa(), Ys = ((ps = we == null ? void 0 : we.preference) == null ? void 0 : ps.defaultDashboardId) || null, { mutate: ea, isPending: sa } = Fa(), { currentUser: aa } = Os(), ta = ja(aa), J = X || le, os = J ? {
1179
+ id: J.id,
1180
+ title: (i == null ? void 0 : i.title) || J.title || "Dashboard"
1181
+ } : null, { handleAddNewFrame: na } = qa(), [xe, De] = S(!1), [ra, Y] = S(!1), [ee, ue] = S("close"), se = Ha(Oe.DASHBOARD), [G, Ce] = S(
1182
1182
  null
1183
- ), ra = async (n, I) => {
1184
- if (!(c != null && c.id)) {
1183
+ ), oa = async (r, O) => {
1184
+ if (!(i != null && i.id)) {
1185
1185
  console.log("No dashboard ID found");
1186
1186
  return;
1187
1187
  }
1188
1188
  console.log("Updating dashboard title:", {
1189
- dashboardId: c.id,
1190
- newTitle: n,
1191
- previousTitle: I
1192
- }), Z.mutate(
1189
+ dashboardId: i.id,
1190
+ newTitle: r,
1191
+ previousTitle: O
1192
+ }), se.mutate(
1193
1193
  {
1194
- resourceId: c.id,
1195
- data: { title: n }
1194
+ resourceId: i.id,
1195
+ data: { title: r }
1196
1196
  },
1197
1197
  {
1198
1198
  onSuccess: () => {
1199
- console.log("Dashboard title updated successfully"), L.success("Dashboard title updated");
1199
+ console.log("Dashboard title updated successfully"), E.success("Dashboard title updated");
1200
1200
  },
1201
- onError: (ae) => {
1202
- console.error("Failed to update dashboard title:", ae), L.error("Failed to update dashboard title"), m(I);
1201
+ onError: (ne) => {
1202
+ console.error("Failed to update dashboard title:", ne), E.error("Failed to update dashboard title"), m(O);
1203
1203
  }
1204
1204
  }
1205
1205
  );
1206
1206
  };
1207
- ot(() => {
1208
- if (le && le.length > 0) {
1209
- const n = c == null ? void 0 : c.id;
1210
- if (n) {
1211
- const I = le.find(
1212
- (ae) => ae.id === n
1207
+ dt(() => {
1208
+ if (de && de.length > 0) {
1209
+ const r = i == null ? void 0 : i.id;
1210
+ if (r) {
1211
+ const O = de.find(
1212
+ (ne) => ne.id === r
1213
1213
  );
1214
- I && ts(I);
1214
+ O && rs(O);
1215
1215
  }
1216
1216
  }
1217
- }, [le, c == null ? void 0 : c.id, ts]);
1218
- const de = o.orgUserId || o.tenantId, ns = d && !w && de && ie, { setDashboard: De } = x((n) => n.actions), na = () => {
1219
- ss(!0);
1220
- }, Ce = () => {
1221
- ss(!1), as(!1), xe(null);
1217
+ }, [de, i == null ? void 0 : i.id, rs]);
1218
+ const me = o.orgUserId || o.tenantId, is = d && !D && me && ce, { setDashboard: Le } = w((r) => r.actions), ia = () => {
1219
+ ts(!0);
1220
+ }, Ee = () => {
1221
+ ts(!1), ns(!1), Ce(null);
1222
1222
  };
1223
- dt(
1223
+ pt(
1224
1224
  d,
1225
- c,
1225
+ i,
1226
1226
  G,
1227
- (n) => xe(n)
1227
+ (r) => Ce(r)
1228
1228
  );
1229
- const { isDirty: os, isDirtyPending: oa, resetDirty: ue } = Nt(
1230
- c,
1229
+ const { isDirty: ls, isDirtyPending: la, resetDirty: he } = xt(
1230
+ i,
1231
1231
  G,
1232
1232
  300,
1233
1233
  1e3,
1234
- Me
1235
- ), is = it(() => G ? Me(c) !== Me(G) : !1, [c, G]), Le = os || oa, ee = Se || Z.isPending, ia = () => {
1236
- is() ? (ce("close"), X(!0)) : (Ce(), ue());
1237
- }, la = async () => {
1238
- await Ee({
1234
+ Ie
1235
+ ), cs = ut(() => G ? Ie(i) !== Ie(G) : !1, [i, G]), Ae = ls || la, ae = xe || se.isPending, ca = () => {
1236
+ cs() ? (ue("close"), Y(!0)) : (Ee(), he());
1237
+ }, da = async () => {
1238
+ await ke({
1239
1239
  closeAfterSave: !0,
1240
- navigateHomeAfterSave: Y === "home"
1240
+ navigateHomeAfterSave: ee === "home"
1241
1241
  });
1242
- }, ca = () => {
1243
- G && De(G), Ce(), Y === "home" && ye(), ce("close"), X(!1), ue();
1244
- }, da = () => {
1245
- G && (De(G), ue());
1246
1242
  }, ua = () => {
1247
- if (d && is()) {
1248
- ce("home"), X(!0);
1243
+ G && Le(G), Ee(), ee === "home" && Se(), ue("close"), Y(!1), he();
1244
+ }, ma = () => {
1245
+ G && (Le(G), he());
1246
+ }, ha = () => {
1247
+ if (d && cs()) {
1248
+ ue("home"), Y(!0);
1249
1249
  return;
1250
1250
  }
1251
- ye();
1251
+ Se();
1252
1252
  };
1253
- async function Ee(n) {
1254
- const I = (n == null ? void 0 : n.closeAfterSave) ?? oe, ae = (n == null ? void 0 : n.navigateHomeAfterSave) ?? !1;
1255
- Q(I), I && X(!1);
1256
- const ga = nt(c);
1257
- D(!0), K(null), we(!0);
1258
- const va = {
1259
- template: c
1253
+ async function ke(r) {
1254
+ const O = (r == null ? void 0 : r.closeAfterSave) ?? f, ne = (r == null ? void 0 : r.navigateHomeAfterSave) ?? !1;
1255
+ C(O), O && Y(!1);
1256
+ const ba = ct(i);
1257
+ K(!0), W(null), De(!0);
1258
+ const ya = {
1259
+ template: i
1260
1260
  };
1261
- Z.mutate(
1261
+ se.mutate(
1262
1262
  {
1263
- resourceId: c.id,
1264
- data: va
1263
+ resourceId: i.id,
1264
+ data: ya
1265
1265
  },
1266
1266
  {
1267
1267
  onSuccess: () => {
1268
- we(!1), L.success("Dashboard saved!"), xe(ga), D(!1), Q(!1), I && (Ce(), ue(), ae && ye()), ce("close");
1268
+ De(!1), E.success("Dashboard saved!"), Ce(ba), K(!1), C(!1), O && (Ee(), he(), ne && Se()), ue("close");
1269
1269
  },
1270
1270
  onError: () => {
1271
- we(!1), K("Failed to save dashboard. Please try again."), L.error("Failed to save dashboard");
1271
+ De(!1), W("Failed to save dashboard. Please try again."), E.error("Failed to save dashboard");
1272
1272
  }
1273
1273
  }
1274
1274
  );
1275
1275
  }
1276
- async function ma() {
1276
+ async function pa() {
1277
1277
  if (b(!0), !g || !v) return;
1278
- const n = JSON.stringify(c), I = {
1278
+ const r = JSON.stringify(i), O = {
1279
1279
  ...v,
1280
- template: n,
1281
- filterValues: T
1280
+ template: r,
1281
+ filterValues: ie
1282
1282
  };
1283
- await je(
1283
+ await Ve(
1284
1284
  o.apiServiceUrl,
1285
- I,
1285
+ O,
1286
1286
  s == null ? void 0 : s.accessToken
1287
- ), L.success("Lens saved"), be == null || be(c), b(!1);
1287
+ ), E.success("Lens saved"), Ne == null || Ne(i), b(!1);
1288
1288
  }
1289
- const ls = (v == null ? void 0 : v.name) || c.title;
1290
- Z.isPending && console.log("Title during update:", {
1291
- title: ls,
1292
- dashboardStateTitle: c.title,
1293
- dashboardId: c == null ? void 0 : c.id,
1289
+ const ds = (v == null ? void 0 : v.name) || i.title;
1290
+ se.isPending && console.log("Title during update:", {
1291
+ title: ds,
1292
+ dashboardStateTitle: i.title,
1293
+ dashboardId: i == null ? void 0 : i.id,
1294
1294
  currentLensName: v == null ? void 0 : v.name
1295
1295
  });
1296
- const cs = o.orgUserId || o.tenantId && o.endUserId && o.endUserEmail, ha = !!cs && !!(s != null && s.accessToken) && !!(o != null && o.apiServiceUrl), pa = i, se = (c == null ? void 0 : c.id) || null, Ae = !!se && Xs === se, fa = () => {
1297
- se && Ys({
1298
- dashboardId: Ae ? null : se
1296
+ const us = o.orgUserId || o.tenantId && o.endUserId && o.endUserEmail, fa = !!us && !!(s != null && s.accessToken) && !!(o != null && o.apiServiceUrl), ga = c, te = (i == null ? void 0 : i.id) || null, Me = !!te && Ys === te, va = () => {
1297
+ te && ea({
1298
+ dashboardId: Me ? null : te
1299
1299
  });
1300
1300
  };
1301
1301
  return /* @__PURE__ */ a(
@@ -1305,211 +1305,201 @@ function dr() {
1305
1305
  role: "dashboard-controls",
1306
1306
  children: [
1307
1307
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1308
- cs && /* @__PURE__ */ a(k, { children: [
1308
+ us && /* @__PURE__ */ a(k, { children: [
1309
1309
  /* @__PURE__ */ e(
1310
- q,
1310
+ j,
1311
1311
  {
1312
1312
  "aria-label": "Manage Dashboards",
1313
1313
  tooltip: "Manage Dashboards",
1314
1314
  onClick: () => {
1315
- E(!f);
1315
+ F(!T);
1316
1316
  },
1317
1317
  className: "h-7 p-2",
1318
- children: /* @__PURE__ */ e(wt, { className: "h-4 w-4" })
1318
+ children: /* @__PURE__ */ e(Ct, { className: "h-4 w-4" })
1319
1319
  }
1320
1320
  ),
1321
- pa && !w && /* @__PURE__ */ e(
1322
- q,
1321
+ ga && !D && /* @__PURE__ */ e(
1322
+ j,
1323
1323
  {
1324
1324
  "aria-label": "Dashboard Hub",
1325
1325
  tooltip: "Dashboard Hub",
1326
- onClick: ua,
1326
+ onClick: ha,
1327
1327
  className: "h-7 p-2",
1328
- children: /* @__PURE__ */ e(ws, { className: "h-4 w-4" })
1328
+ children: /* @__PURE__ */ e(Ds, { className: "h-4 w-4" })
1329
1329
  }
1330
1330
  )
1331
1331
  ] }),
1332
- !w && i && (u ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1333
- /* @__PURE__ */ e(V, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
1332
+ !D && c && (u ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1333
+ /* @__PURE__ */ e(H, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
1334
1334
  /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
1335
1335
  ] }) : /* @__PURE__ */ a(k, { children: [
1336
1336
  /* @__PURE__ */ e(
1337
- ja,
1337
+ Va,
1338
1338
  {
1339
- value: ls || "Untitled Dashboard",
1340
- onSave: (n) => {
1339
+ value: ds || "Untitled Dashboard",
1340
+ onSave: (r) => {
1341
1341
  console.log("EditableText onSave called:", {
1342
- newTitle: n,
1343
- canEditDashboard: ie,
1344
- dashboardId: c == null ? void 0 : c.id
1342
+ newTitle: r,
1343
+ canEditDashboard: ce,
1344
+ dashboardId: i == null ? void 0 : i.id
1345
1345
  });
1346
- const I = (c == null ? void 0 : c.title) || "";
1347
- m(n), ra(n, I);
1346
+ const O = (i == null ? void 0 : i.title) || "";
1347
+ m(r), oa(r, O);
1348
1348
  },
1349
- isEditable: ie && !v,
1349
+ isEditable: ce && !v,
1350
1350
  displayClassName: "text-sm font-medium",
1351
1351
  inputClassName: "text-sm font-medium",
1352
1352
  placeholder: "Dashboard Title",
1353
- isPending: Z.isPending
1353
+ isPending: se.isPending
1354
1354
  }
1355
1355
  ),
1356
- ha && se && /* @__PURE__ */ e(Ha, { children: /* @__PURE__ */ a(Va, { children: [
1357
- /* @__PURE__ */ e(za, { asChild: !0, children: /* @__PURE__ */ e(
1358
- C,
1356
+ fa && te && /* @__PURE__ */ e(za, { children: /* @__PURE__ */ a($a, { children: [
1357
+ /* @__PURE__ */ e(Ba, { asChild: !0, children: /* @__PURE__ */ e(
1358
+ L,
1359
1359
  {
1360
1360
  variant: "ghost",
1361
1361
  size: "icon",
1362
- onClick: fa,
1363
- disabled: Zs || !(s != null && s.accessToken) || !(o != null && o.apiServiceUrl),
1362
+ onClick: va,
1363
+ disabled: sa || !(s != null && s.accessToken) || !(o != null && o.apiServiceUrl),
1364
1364
  className: "h-7 w-7",
1365
1365
  children: /* @__PURE__ */ e(
1366
- $a,
1366
+ Ka,
1367
1367
  {
1368
- className: J(
1368
+ className: Z(
1369
1369
  "h-4 w-4 transition-colors",
1370
- Ae ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground hover:text-yellow-400"
1370
+ Me ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground hover:text-yellow-400"
1371
1371
  )
1372
1372
  }
1373
1373
  )
1374
1374
  }
1375
1375
  ) }),
1376
- /* @__PURE__ */ e(Ba, { children: /* @__PURE__ */ e("p", { children: Ae ? "Remove as default dashboard" : "Make this a default dashboard" }) })
1376
+ /* @__PURE__ */ e(Qa, { children: /* @__PURE__ */ e("p", { children: Me ? "Remove as default dashboard" : "Make this a default dashboard" }) })
1377
1377
  ] }) })
1378
1378
  ] }))
1379
1379
  ] }),
1380
1380
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1381
- w && /* @__PURE__ */ a(k, { children: [
1382
- /* @__PURE__ */ e(ut, { className: "mr-2" }),
1383
- /* @__PURE__ */ e(mt, { className: "h-7" })
1381
+ D && /* @__PURE__ */ a(k, { children: [
1382
+ /* @__PURE__ */ e(ft, { className: "mr-2" }),
1383
+ /* @__PURE__ */ e(gt, { className: "h-7" })
1384
1384
  ] }),
1385
- r && !w && /* @__PURE__ */ a(k, { children: [
1385
+ n && !D && /* @__PURE__ */ a(k, { children: [
1386
1386
  /* @__PURE__ */ e(
1387
- q,
1387
+ j,
1388
1388
  {
1389
1389
  tooltip: "Copy Token",
1390
1390
  onClick: () => {
1391
- var n;
1392
- s != null && s.accessToken && ((n = navigator == null ? void 0 : navigator.clipboard) != null && n.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => L.success("Token copied to clipboard")).catch(() => L.error("Unable to copy token")) : L.error("Clipboard not available"));
1391
+ var r;
1392
+ s != null && s.accessToken && ((r = navigator == null ? void 0 : navigator.clipboard) != null && r.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => E.success("Token copied to clipboard")).catch(() => E.error("Unable to copy token")) : E.error("Clipboard not available"));
1393
1393
  },
1394
1394
  className: "h-7 p-2",
1395
- children: /* @__PURE__ */ e(Ka, { className: "h-4 w-4" })
1395
+ children: /* @__PURE__ */ e(Wa, { className: "h-4 w-4" })
1396
1396
  }
1397
1397
  ),
1398
1398
  /* @__PURE__ */ e(
1399
- q,
1399
+ j,
1400
1400
  {
1401
1401
  tooltip: "Invalidate Token",
1402
- onClick: () => Qa(o.apiServiceUrl),
1402
+ onClick: () => Ja(o.apiServiceUrl),
1403
1403
  className: "h-7 p-2",
1404
- children: /* @__PURE__ */ e(Dt, { className: "h-4 w-4" })
1404
+ children: /* @__PURE__ */ e(Et, { className: "h-4 w-4" })
1405
1405
  }
1406
1406
  )
1407
1407
  ] }),
1408
- !w && i && /* @__PURE__ */ e(Wa, {}),
1409
- !w && i && /* @__PURE__ */ e(ht, {}),
1410
- !w && i && /* @__PURE__ */ e(pt, {}),
1411
- !w && i && sa && /* @__PURE__ */ e(
1412
- q,
1413
- {
1414
- tooltip: "Manage Groups",
1415
- onClick: () => O(!0),
1416
- className: "h-7 p-2",
1417
- children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
1418
- }
1419
- ),
1420
- !w && i && ((hs = W == null ? void 0 : W.permissions) == null ? void 0 : hs.canShare) && /* @__PURE__ */ e(
1421
- q,
1408
+ !D && c && /* @__PURE__ */ e(Za, {}),
1409
+ !D && c && /* @__PURE__ */ e(vt, {}),
1410
+ !D && c && ((fs = J == null ? void 0 : J.permissions) == null ? void 0 : fs.canShare) && /* @__PURE__ */ e(
1411
+ j,
1422
1412
  {
1423
1413
  tooltip: "Share Dashboard",
1424
1414
  onClick: () => N(!0),
1425
1415
  className: "h-7 p-2",
1426
- children: /* @__PURE__ */ e(Ja, { className: "h-4 w-4" })
1416
+ children: /* @__PURE__ */ e(Xa, { className: "h-4 w-4" })
1427
1417
  }
1428
1418
  ),
1429
- !Ks && !w && d && l.canUseFilters && i && /* @__PURE__ */ e(
1430
- C,
1419
+ !Ws && !D && d && l.canUseFilters && c && /* @__PURE__ */ e(
1420
+ L,
1431
1421
  {
1432
1422
  className: "h-7 p-2",
1433
1423
  variant: "outline",
1434
1424
  onClick: () => {
1435
- Qs("dashboard", !1), Js(!0);
1425
+ Js("dashboard", !1), Xs(!0);
1436
1426
  },
1437
1427
  size: "sm",
1438
- children: /* @__PURE__ */ e(Xa, { className: "h-4 w-4" })
1428
+ children: /* @__PURE__ */ e(Ya, { className: "h-4 w-4" })
1439
1429
  }
1440
1430
  ),
1441
- d && !w && de && r && i && /* @__PURE__ */ e(Ot, {}),
1442
- !w && de && r && i && /* @__PURE__ */ e(Tt, {}),
1443
- d && !w && de && v && r && i && /* @__PURE__ */ a(
1444
- C,
1431
+ d && !D && me && n && c && /* @__PURE__ */ e(Ut, {}),
1432
+ !D && me && n && c && /* @__PURE__ */ e(Gt, {}),
1433
+ d && !D && me && v && n && c && /* @__PURE__ */ a(
1434
+ L,
1445
1435
  {
1446
1436
  className: "h-7 p-2",
1447
1437
  variant: "secondary",
1448
1438
  disabled: h,
1449
- onClick: ma,
1439
+ onClick: pa,
1450
1440
  size: "sm",
1451
1441
  children: [
1452
- /* @__PURE__ */ e(gs, { className: "mr-2 h-4 w-4" }),
1442
+ /* @__PURE__ */ e(bs, { className: "mr-2 h-4 w-4" }),
1453
1443
  "Save Lens"
1454
1444
  ]
1455
1445
  }
1456
1446
  ),
1457
- d && !w && i && /* @__PURE__ */ a(
1458
- C,
1447
+ d && !D && c && /* @__PURE__ */ a(
1448
+ L,
1459
1449
  {
1460
1450
  variant: "outline",
1461
1451
  className: "h-7 p-2",
1462
1452
  size: "sm",
1463
1453
  disabled: !d,
1464
- onClick: () => aa(),
1454
+ onClick: () => na(),
1465
1455
  children: [
1466
- /* @__PURE__ */ e(Ke, { className: "mr-2 h-4 w-4" }),
1456
+ /* @__PURE__ */ e(We, { className: "mr-2 h-4 w-4" }),
1467
1457
  "Visual"
1468
1458
  ]
1469
1459
  }
1470
1460
  ),
1471
- !w && !d && ie && i && /* @__PURE__ */ a(
1472
- C,
1461
+ !D && !d && ce && c && /* @__PURE__ */ a(
1462
+ L,
1473
1463
  {
1474
1464
  variant: "outline",
1475
1465
  className: "h-7 p-2",
1476
- onClick: na,
1466
+ onClick: ia,
1477
1467
  size: "sm",
1478
1468
  children: [
1479
- /* @__PURE__ */ e(Ya, { className: "mr-2 h-4 w-4" }),
1469
+ /* @__PURE__ */ e(et, { className: "mr-2 h-4 w-4" }),
1480
1470
  "Edit"
1481
1471
  ]
1482
1472
  }
1483
1473
  ),
1484
- ns && i && os && /* @__PURE__ */ a(
1485
- C,
1474
+ is && c && ls && /* @__PURE__ */ a(
1475
+ L,
1486
1476
  {
1487
1477
  variant: "outline",
1488
1478
  className: "h-7 p-2",
1489
- onClick: da,
1479
+ onClick: ma,
1490
1480
  size: "sm",
1491
- disabled: ee,
1481
+ disabled: ae,
1492
1482
  children: [
1493
- /* @__PURE__ */ e(Za, { className: "mr-2 h-4 w-4" }),
1483
+ /* @__PURE__ */ e(st, { className: "mr-2 h-4 w-4" }),
1494
1484
  "Undo"
1495
1485
  ]
1496
1486
  }
1497
1487
  ),
1498
- ns && i && /* @__PURE__ */ a("div", { className: "relative inline-flex", children: [
1488
+ is && c && /* @__PURE__ */ a("div", { className: "relative inline-flex", children: [
1499
1489
  /* @__PURE__ */ a(
1500
- C,
1490
+ L,
1501
1491
  {
1502
- className: J("h-7 p-2", !Le && "opacity-60"),
1503
- disabled: ee || !Le,
1504
- onClick: () => Ee(),
1492
+ className: Z("h-7 p-2", !Ae && "opacity-60"),
1493
+ disabled: ae || !Ae,
1494
+ onClick: () => ke(),
1505
1495
  size: "sm",
1506
1496
  children: [
1507
- ee ? /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(gs, { className: "mr-2 h-4 w-4" }),
1508
- ee ? "Saving..." : "Save"
1497
+ ae ? /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(bs, { className: "mr-2 h-4 w-4" }),
1498
+ ae ? "Saving..." : "Save"
1509
1499
  ]
1510
1500
  }
1511
1501
  ),
1512
- Le && !ee && /* @__PURE__ */ e(
1502
+ Ae && !ae && /* @__PURE__ */ e(
1513
1503
  "span",
1514
1504
  {
1515
1505
  "aria-hidden": "true",
@@ -1517,118 +1507,135 @@ function dr() {
1517
1507
  }
1518
1508
  )
1519
1509
  ] }),
1520
- !w && d && r && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1521
- C,
1510
+ !D && d && n && c && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1511
+ L,
1522
1512
  {
1523
1513
  className: "h-7 p-2",
1524
- onClick: () => as(!Ws),
1514
+ onClick: () => ns(!Zs),
1525
1515
  size: "sm",
1526
1516
  variant: "ghost",
1527
- children: /* @__PURE__ */ e(et, { className: "h-4 w-4" })
1517
+ children: /* @__PURE__ */ e(at, { className: "h-4 w-4" })
1528
1518
  }
1529
1519
  ) }),
1530
- !w && r && /* @__PURE__ */ e(kt, {}),
1531
- d && !w && i && /* @__PURE__ */ a(
1532
- C,
1520
+ !D && n && /* @__PURE__ */ e(It, {}),
1521
+ d && !D && c && /* @__PURE__ */ a(
1522
+ L,
1533
1523
  {
1534
1524
  variant: "outline",
1535
1525
  className: "h-7 p-2",
1536
- onClick: ia,
1526
+ onClick: ca,
1537
1527
  children: [
1538
- /* @__PURE__ */ e(xs, { className: "mr-2 h-4 w-4" }),
1528
+ /* @__PURE__ */ e(Cs, { className: "mr-2 h-4 w-4" }),
1539
1529
  "Close"
1540
1530
  ]
1541
1531
  }
1542
1532
  ),
1543
- !w && i && /* @__PURE__ */ a(He, { children: [
1544
- /* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(q, { tooltip: "More Options", className: "h-7 p-2", children: /* @__PURE__ */ e(st, { className: "h-4 w-4" }) }) }),
1545
- /* @__PURE__ */ a(ze, { align: "end", children: [
1546
- /* @__PURE__ */ a(te, { onClick: () => M(!0), children: [
1547
- /* @__PURE__ */ e(at, { className: "mr-2 h-4 w-4" }),
1533
+ !D && c && /* @__PURE__ */ a(ze, { children: [
1534
+ /* @__PURE__ */ e($e, { asChild: !0, children: /* @__PURE__ */ e(j, { tooltip: "More Options", className: "h-7 p-2", children: /* @__PURE__ */ e(tt, { className: "h-4 w-4" }) }) }),
1535
+ /* @__PURE__ */ a(Be, { align: "end", children: [
1536
+ /* @__PURE__ */ a(q, { onClick: () => M(!0), children: [
1537
+ /* @__PURE__ */ e(nt, { className: "mr-2 h-4 w-4" }),
1538
+ "Schedule Dashboard"
1539
+ ] }),
1540
+ ta && /* @__PURE__ */ a(q, { onClick: () => I(!0), children: [
1541
+ /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4" }),
1542
+ "Manage Groups"
1543
+ ] }),
1544
+ /* @__PURE__ */ a(q, { onClick: () => R(!0), children: [
1545
+ /* @__PURE__ */ e(rt, { className: "mr-2 h-4 w-4" }),
1548
1546
  "Calendar Preferences"
1549
1547
  ] }),
1550
- /* @__PURE__ */ a(te, { onClick: () => P(!0), children: [
1551
- /* @__PURE__ */ e(tt, { className: "mr-2 h-4 w-4" }),
1548
+ /* @__PURE__ */ a(q, { onClick: () => x(!0), children: [
1549
+ /* @__PURE__ */ e(ot, { className: "mr-2 h-4 w-4" }),
1552
1550
  "Summary Settings"
1553
1551
  ] })
1554
1552
  ] })
1555
1553
  ] }),
1556
- y && rs && /* @__PURE__ */ e(
1557
- rt,
1554
+ y && os && /* @__PURE__ */ e(
1555
+ it,
1558
1556
  {
1559
- resource: rs,
1560
- resourceType: ke.DASHBOARD,
1557
+ resource: os,
1558
+ resourceType: Oe.DASHBOARD,
1561
1559
  onClose: () => N(!1)
1562
1560
  }
1563
1561
  ),
1564
1562
  /* @__PURE__ */ e(
1565
- Yt,
1563
+ sn,
1566
1564
  {
1567
1565
  open: A,
1568
- onOpenChange: O
1566
+ onOpenChange: I
1569
1567
  }
1570
1568
  ),
1571
- /* @__PURE__ */ e(
1572
- bt,
1569
+ (i == null ? void 0 : i.id) && /* @__PURE__ */ e(
1570
+ lt,
1573
1571
  {
1574
1572
  open: U,
1575
- onOpenChange: M
1573
+ onOpenChange: M,
1574
+ dashboardId: i.id,
1575
+ dashboardName: i == null ? void 0 : i.title
1576
1576
  }
1577
1577
  ),
1578
1578
  /* @__PURE__ */ e(
1579
- yt,
1579
+ St,
1580
+ {
1581
+ open: z,
1582
+ onOpenChange: R
1583
+ }
1584
+ ),
1585
+ /* @__PURE__ */ e(
1586
+ wt,
1580
1587
  {
1581
1588
  open: $,
1582
- onOpenChange: P,
1583
- dashboard: c,
1589
+ onOpenChange: x,
1590
+ dashboard: i,
1584
1591
  disabled: !d,
1585
- onApply: (n) => De({
1586
- ...c,
1587
- summary: n
1592
+ onApply: (r) => Le({
1593
+ ...i,
1594
+ summary: r
1588
1595
  })
1589
1596
  }
1590
1597
  ),
1591
1598
  /* @__PURE__ */ e(
1592
- Ms,
1599
+ Is,
1593
1600
  {
1594
1601
  open: B,
1595
- onOpenChange: (n) => {
1596
- !n && Se && !R || (D(n), n || (K(null), Q(!1)));
1602
+ onOpenChange: (r) => {
1603
+ !r && xe && !Q || (K(r), r || (W(null), C(!1)));
1597
1604
  },
1598
- children: /* @__PURE__ */ a(Is, { className: "max-w-sm", children: [
1599
- /* @__PURE__ */ a(Os, { children: [
1600
- /* @__PURE__ */ e(Ts, { children: R ? "Save failed" : "Saving dashboard" }),
1601
- /* @__PURE__ */ e(_s, { className: "pt-2", children: R ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
1605
+ children: /* @__PURE__ */ a(Ts, { className: "max-w-sm", children: [
1606
+ /* @__PURE__ */ a(_s, { children: [
1607
+ /* @__PURE__ */ e(Us, { children: Q ? "Save failed" : "Saving dashboard" }),
1608
+ /* @__PURE__ */ e(Gs, { className: "pt-2", children: Q ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
1602
1609
  ] }),
1603
- /* @__PURE__ */ e(Us, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: R ? /* @__PURE__ */ a(k, { children: [
1610
+ /* @__PURE__ */ e(Rs, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: Q ? /* @__PURE__ */ a(k, { children: [
1604
1611
  /* @__PURE__ */ e(
1605
- Rs,
1612
+ Ps,
1606
1613
  {
1607
1614
  onClick: () => {
1608
- D(!1), K(null), Q(!1);
1615
+ K(!1), W(null), C(!1);
1609
1616
  },
1610
1617
  className: "m-0",
1611
1618
  children: "Close"
1612
1619
  }
1613
1620
  ),
1614
1621
  /* @__PURE__ */ e(
1615
- Fe,
1622
+ qe,
1616
1623
  {
1617
- onClick: () => Ee({
1618
- closeAfterSave: oe,
1619
- navigateHomeAfterSave: Y === "home"
1624
+ onClick: () => ke({
1625
+ closeAfterSave: f,
1626
+ navigateHomeAfterSave: ee === "home"
1620
1627
  }),
1621
1628
  className: "m-0",
1622
1629
  children: "Retry"
1623
1630
  }
1624
1631
  )
1625
1632
  ] }) : /* @__PURE__ */ a(
1626
- Fe,
1633
+ qe,
1627
1634
  {
1628
1635
  disabled: !0,
1629
1636
  className: "m-0 cursor-default",
1630
1637
  children: [
1631
- /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
1638
+ /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
1632
1639
  "Saving..."
1633
1640
  ]
1634
1641
  }
@@ -1637,17 +1644,17 @@ function dr() {
1637
1644
  }
1638
1645
  ),
1639
1646
  /* @__PURE__ */ e(
1640
- ft,
1647
+ bt,
1641
1648
  {
1642
- open: ta,
1643
- onOpenChange: (n) => {
1644
- X(n);
1649
+ open: ra,
1650
+ onOpenChange: (r) => {
1651
+ Y(r);
1645
1652
  },
1646
- onSave: la,
1647
- onDiscard: ca,
1648
- isSaving: Se,
1649
- saveLabel: Y === "home" ? "Save & Return to Hub" : "Save & Close",
1650
- discardLabel: Y === "home" ? "Discard & Return to Hub" : "Discard"
1653
+ onSave: da,
1654
+ onDiscard: ua,
1655
+ isSaving: xe,
1656
+ saveLabel: ee === "home" ? "Save & Return to Hub" : "Save & Close",
1657
+ discardLabel: ee === "home" ? "Discard & Return to Hub" : "Discard"
1651
1658
  }
1652
1659
  )
1653
1660
  ] })
@@ -1656,5 +1663,5 @@ function dr() {
1656
1663
  );
1657
1664
  }
1658
1665
  export {
1659
- dr as default
1666
+ pn as default
1660
1667
  };