react-semaphor 0.1.100 → 0.1.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/chunks/{dashboard-controls-DW1JJWP7.js → dashboard-controls-BOWrupBW.js} +599 -599
  2. package/dist/chunks/dashboard-controls-DZ3mfITk.js +26 -0
  3. package/dist/chunks/{dashboard-json-C0CKQW3d.js → dashboard-json-37BidbHV.js} +1 -1
  4. package/dist/chunks/{dashboard-json-BDAEIUep.js → dashboard-json-BHLhFEdC.js} +1 -1
  5. package/dist/chunks/{edit-dashboard-visual-BtV3RWgf.js → edit-dashboard-visual-BJD5eZpR.js} +31 -31
  6. package/dist/chunks/{edit-dashboard-visual-DQzy1fUR.js → edit-dashboard-visual-D7Ic8u1b.js} +30 -21
  7. package/dist/chunks/{editor-action-buttons-CReBF7FV.js → editor-action-buttons-DPAlJF2w.js} +1 -1
  8. package/dist/chunks/{editor-action-buttons-BJRrkj_n.js → editor-action-buttons-DpbEl7Rx.js} +2 -2
  9. package/dist/chunks/{index-f2IZ7tlh.js → index-CGyjzIO0.js} +7985 -7967
  10. package/dist/chunks/{index-BDtdPUUE.js → index-DUJ50AjE.js} +160 -160
  11. package/dist/chunks/resource-management-panel-Ddyzqha7.js +11 -0
  12. package/dist/chunks/resource-management-panel-DpASGkNn.js +924 -0
  13. package/dist/chunks/{schedule-dashboard-D8ctQToc.js → schedule-dashboard-Dy7czCFY.js} +1 -1
  14. package/dist/chunks/{schedule-dashboard-CfeYnMXp.js → schedule-dashboard-e0SVfJ6s.js} +3 -3
  15. package/dist/chunks/use-click-outside-B9T3lmcw.js +1 -0
  16. package/dist/chunks/use-click-outside-CMeO_QFI.js +16 -0
  17. package/dist/chunks/{use-visual-utils-BN4h1-xa.js → use-visual-utils-CFuV8lsO.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-CRA2-3Z2.js → use-visual-utils-CfCFNHJ6.js} +1 -1
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +4 -4
  23. package/dist/style.css +1 -1
  24. package/dist/surfboard/index.cjs +1 -1
  25. package/dist/surfboard/index.js +1 -1
  26. package/package.json +1 -1
  27. package/dist/chunks/dashboard-controls-DKci3my0.js +0 -26
  28. package/dist/chunks/resource-management-panel-BQVERuRi.js +0 -11
  29. package/dist/chunks/resource-management-panel-DNpbhYNu.js +0 -982
  30. package/dist/chunks/use-local-storage-state-CWjTT77L.js +0 -26
  31. package/dist/chunks/use-local-storage-state-DXYWw213.js +0 -1
@@ -1,17 +1,17 @@
1
1
  import { jsxs as n, jsx as e, Fragment as E } from "react/jsx-runtime";
2
- import { b as X, bt as ys, bu as ws, u as w, aC as Se, aD as Me, B as M, aF as ke, aG as J, bv as Le, a8 as Qe, aj as R, ao as ie, bw as xs, aS as Pe, ap as le, aq as ce, ar as de, as as Ae, at as re, bx as Q, ax as He, I as V, by as Ds, aW as Cs, bz as Ss, bA as ze, bB as Be, c as Y, bC as Ke, bD as Ms, bE as ks, bF as Ls, bG as Ps, bH as As, ah as C, z as _e, ad as ue, bI as me, bJ as We, av as Is, bK as Es, ac as H, aR as z, bL as Fs, bM as Ts, bN as Gs, bp as Je, bq as Xe, br as ne, bs as oe, bO as ve, aM as Ne, bP as ye, aX as Ye, bQ as we, aw as Ze, b0 as es, bR as Rs, b3 as Os, b4 as Us, b5 as qs, b6 as zs, b7 as _s, b8 as $s, b9 as js, ba as Vs, bS as Qs, aO as Hs, be as Bs, bT as Ks, bU as Ws, aa as $e, aA as ae, bV as Js, R as be, bW as Xs, bX as Ys, bY as Zs, bZ as ea, y as sa, b_ as aa, b$ as ta, c0 as ra, c1 as na, v as oa } from "./index-f2IZ7tlh.js";
2
+ import { b as J, bp as Ns, bq as ys, u as y, aC as Ce, aD as Se, B as k, aF as Me, aG as W, br as ke, a8 as Ve, aj as R, ao as oe, bs as ws, aU as Le, ap as ie, aq as le, ar as ce, as as Pe, at as te, bt as Q, ax as Qe, I as V, bu as xs, aW as Ds, bv as Cs, bw as qe, bx as He, c as X, by as Be, bz as Ss, bA as Ms, bB as ks, bC as Ls, bD as Ps, ah as C, z as ze, ad as de, bE as ue, bF as Ke, av as As, bG as Is, ac as H, aR as _, bH as Es, bI as Fs, bJ as Ts, bK as We, bL as Je, bM as re, bN as ne, bj as be, aM as ve, bO as Ne, aX as Xe, bP as ye, aw as Ye, a$ as Ze, bQ as Gs, b3 as Rs, b4 as Os, b5 as Us, b6 as qs, b7 as zs, b8 as _s, b9 as $s, ba as js, bR as Vs, aO as Qs, be as Hs, bS as Bs, bT as Ks, aa as _e, aA as se, bU as Ws, R as fe, bV as Js, bW as Xs, bX as Ys, bY as Zs, y as ea, bZ as sa, b_ as aa, b$ as ta, c0 as ra, v as na } from "./index-CGyjzIO0.js";
3
3
  import * as S from "react";
4
- import { useState as x, useMemo as te, useEffect as ia } from "react";
4
+ import { useState as w, useMemo as ae, useEffect as oa } from "react";
5
5
  import "react-dom";
6
- import { g as xe, A as la, V as ca, S as da } from "./schedule-dashboard-CfeYnMXp.js";
7
- import { S as je } from "./editor-action-buttons-BJRrkj_n.js";
6
+ import { g as we, A as ia, V as la, S as ca } from "./schedule-dashboard-e0SVfJ6s.js";
7
+ import { S as $e } from "./editor-action-buttons-DpbEl7Rx.js";
8
8
  /**
9
9
  * @license lucide-react v0.453.0 - ISC
10
10
  *
11
11
  * This source code is licensed under the ISC license.
12
12
  * See the LICENSE file in the root directory of this source tree.
13
13
  */
14
- const ua = X("Glasses", [
14
+ const da = J("Glasses", [
15
15
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
16
16
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
17
17
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -24,7 +24,7 @@ const ua = X("Glasses", [
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
26
  */
27
- const ma = X("Menu", [
27
+ const ua = J("Menu", [
28
28
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
29
29
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
30
30
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
@@ -35,7 +35,7 @@ const ma = X("Menu", [
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
37
  */
38
- const ha = X("Moon", [
38
+ const ma = J("Moon", [
39
39
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
40
40
  ]);
41
41
  /**
@@ -44,7 +44,7 @@ const ha = X("Moon", [
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
46
  */
47
- const pa = X("ShieldX", [
47
+ const ha = J("ShieldX", [
48
48
  [
49
49
  "path",
50
50
  {
@@ -61,7 +61,7 @@ const pa = X("ShieldX", [
61
61
  * This source code is licensed under the ISC license.
62
62
  * See the LICENSE file in the root directory of this source tree.
63
63
  */
64
- const ga = X("Sun", [
64
+ const pa = J("Sun", [
65
65
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
66
66
  ["path", { d: "M12 2v2", key: "tus03m" }],
67
67
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -72,22 +72,22 @@ const ga = X("Sun", [
72
72
  ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
73
73
  ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
74
74
  ]);
75
- var fa = ys();
76
- function ba() {
77
- const { setTheme: s } = ws(), r = w(
75
+ var ga = Ns();
76
+ function fa() {
77
+ const { setTheme: s } = ys(), r = y(
78
78
  (a) => a.actions.setDashboardTheme
79
79
  );
80
- return /* @__PURE__ */ n(Se, { children: [
81
- /* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ n(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
80
+ return /* @__PURE__ */ n(Ce, { children: [
81
+ /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ n(k, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
82
82
  /* @__PURE__ */ e(
83
- ga,
83
+ pa,
84
84
  {
85
85
  strokeWidth: 1.5,
86
86
  className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
87
87
  }
88
88
  ),
89
89
  /* @__PURE__ */ e(
90
- ha,
90
+ ma,
91
91
  {
92
92
  strokeWidth: 1.5,
93
93
  className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
@@ -95,9 +95,9 @@ function ba() {
95
95
  ),
96
96
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
97
97
  ] }) }),
98
- /* @__PURE__ */ n(ke, { align: "end", children: [
98
+ /* @__PURE__ */ n(Me, { align: "end", children: [
99
99
  /* @__PURE__ */ e(
100
- J,
100
+ W,
101
101
  {
102
102
  onClick: () => {
103
103
  s("light"), r("light");
@@ -106,7 +106,7 @@ function ba() {
106
106
  }
107
107
  ),
108
108
  /* @__PURE__ */ e(
109
- J,
109
+ W,
110
110
  {
111
111
  onClick: () => {
112
112
  s("dark"), r("dark");
@@ -115,7 +115,7 @@ function ba() {
115
115
  }
116
116
  ),
117
117
  /* @__PURE__ */ e(
118
- J,
118
+ W,
119
119
  {
120
120
  onClick: () => {
121
121
  s("system"), r("system");
@@ -126,80 +126,80 @@ function ba() {
126
126
  ] })
127
127
  ] });
128
128
  }
129
- async function va(s, r, a, t, l) {
130
- if (!l)
129
+ async function ba(s, r, a, t, i) {
130
+ if (!i)
131
131
  return null;
132
- const c = JSON.stringify(a), i = `${s}/v1/lens`;
133
- return await Le(i, l, {
132
+ const o = JSON.stringify(a), l = `${s}/v1/lens`;
133
+ return await ke(l, i, {
134
134
  name: r,
135
- template: c,
135
+ template: o,
136
136
  filterValues: t,
137
137
  operation: "create"
138
138
  });
139
139
  }
140
- async function De(s, r, a) {
140
+ async function xe(s, r, a) {
141
141
  if (!a)
142
142
  return null;
143
- const { id: t, template: l, filterValues: c, isDefault: i, shared: u } = r, h = `${s}/v1/lens`;
144
- return await Le(h, a, {
143
+ const { id: t, template: i, filterValues: o, isDefault: l, shared: m } = r, h = `${s}/v1/lens`;
144
+ return await ke(h, a, {
145
145
  lensId: t,
146
- template: l,
147
- filterValues: c,
148
- isDefault: i,
149
- shared: u,
146
+ template: i,
147
+ filterValues: o,
148
+ isDefault: l,
149
+ shared: m,
150
150
  operation: "update"
151
151
  });
152
152
  }
153
- async function Na(s, r, a) {
153
+ async function va(s, r, a) {
154
154
  if (!a)
155
155
  return null;
156
156
  const t = `${s}/v1/lens`;
157
- return await Le(t, a, {
157
+ return await ke(t, a, {
158
158
  operation: "delete",
159
159
  lensId: r
160
160
  });
161
161
  }
162
- function ya() {
163
- const [s, r] = x(""), [a, t] = x(!1), l = w((k) => k.lenses), { setLenses: c, setSelectedLensId: i } = Qe(), [u, h] = x(!1), [f, g] = x(!1), o = w((k) => k.dashboard), m = w((k) => k.filterValues), { authToken: b, tokenProps: N } = R();
164
- async function y() {
162
+ function Na() {
163
+ const [s, r] = w(""), [a, t] = w(!1), i = y((M) => M.lenses), { setLenses: o, setSelectedLensId: l } = Ve(), [m, h] = w(!1), [f, u] = w(!1), c = y((M) => M.dashboard), p = y((M) => M.filterValues), { authToken: b, tokenProps: v } = R();
164
+ async function x() {
165
165
  h(!0);
166
- const k = xe(
167
- o
168
- ), P = await va(
169
- N.apiServiceUrl,
166
+ const M = we(
167
+ c
168
+ ), P = await ba(
169
+ v.apiServiceUrl,
170
170
  s,
171
- k,
172
- m,
171
+ M,
172
+ p,
173
173
  b == null ? void 0 : b.accessToken
174
174
  );
175
- P && (c([...l || [], P]), i(P.id), g(!1)), h(!1);
175
+ P && (o([...i || [], P]), l(P.id), u(!1)), h(!1);
176
176
  }
177
- return /* @__PURE__ */ n(ie, { open: f, onOpenChange: g, children: [
178
- /* @__PURE__ */ e(xs, { asChild: !0, children: /* @__PURE__ */ n(
179
- M,
177
+ return /* @__PURE__ */ n(oe, { open: f, onOpenChange: u, children: [
178
+ /* @__PURE__ */ e(ws, { asChild: !0, children: /* @__PURE__ */ n(
179
+ k,
180
180
  {
181
181
  variant: "secondary",
182
182
  className: "h-7 p-2",
183
183
  size: "sm",
184
184
  children: [
185
- /* @__PURE__ */ e(Pe, { className: "mr-2 h-4 w-4" }),
185
+ /* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
186
186
  "Lens"
187
187
  ]
188
188
  }
189
189
  ) }),
190
- /* @__PURE__ */ n(le, { className: "sm:max-w-[425px]", children: [
191
- /* @__PURE__ */ n(ce, { children: [
192
- /* @__PURE__ */ e(de, { children: "Create Lens" }),
193
- /* @__PURE__ */ e(Ae, { children: "Lenses are private by default and are only visible to you." })
190
+ /* @__PURE__ */ n(ie, { className: "sm:max-w-[425px]", children: [
191
+ /* @__PURE__ */ n(le, { children: [
192
+ /* @__PURE__ */ e(ce, { children: "Create Lens" }),
193
+ /* @__PURE__ */ e(Pe, { children: "Lenses are private by default and are only visible to you." })
194
194
  ] }),
195
195
  /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ n("div", { className: "grid grid-cols-8 items-center gap-4", children: [
196
- /* @__PURE__ */ e(re, { className: "text-right", children: "Name" }),
196
+ /* @__PURE__ */ e(te, { className: "text-right", children: "Name" }),
197
197
  /* @__PURE__ */ e(
198
198
  Q,
199
199
  {
200
200
  value: s,
201
- onChange: (k) => {
202
- r(k.target.value);
201
+ onChange: (M) => {
202
+ r(M.target.value);
203
203
  },
204
204
  id: "name",
205
205
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -207,95 +207,95 @@ function ya() {
207
207
  )
208
208
  ] }) }),
209
209
  a && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
210
- /* @__PURE__ */ e(He, { children: /* @__PURE__ */ e(
211
- M,
210
+ /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ e(
211
+ k,
212
212
  {
213
213
  size: "sm",
214
214
  variant: "outline",
215
215
  type: "submit",
216
- onClick: y,
217
- disabled: u,
218
- children: u ? "Creating..." : "Add"
216
+ onClick: x,
217
+ disabled: m,
218
+ children: m ? "Creating..." : "Add"
219
219
  }
220
220
  ) })
221
221
  ] })
222
222
  ] });
223
223
  }
224
- function wa() {
225
- const [s, r] = x(!1), a = w((o) => o.lenses), t = w((o) => o.selectedLensId), { setLenses: l, setSelectedLensId: c } = Qe(), { authToken: i, tokenProps: u } = R();
226
- async function h(o) {
227
- c(o);
224
+ function ya() {
225
+ const [s, r] = w(!1), a = y((c) => c.lenses), t = y((c) => c.selectedLensId), { setLenses: i, setSelectedLensId: o } = Ve(), { authToken: l, tokenProps: m } = R();
226
+ async function h(c) {
227
+ o(c);
228
228
  }
229
- async function f(o) {
230
- if (await Na(u.apiServiceUrl, o, i == null ? void 0 : i.accessToken)) {
231
- const b = a == null ? void 0 : a.filter((N) => N.id !== o);
232
- l(b || []), c("original");
229
+ async function f(c) {
230
+ if (await va(m.apiServiceUrl, c, l == null ? void 0 : l.accessToken)) {
231
+ const b = a == null ? void 0 : a.filter((v) => v.id !== c);
232
+ i(b || []), o("original");
233
233
  }
234
234
  }
235
- async function g(o) {
236
- const m = a == null ? void 0 : a.map((y) => y.id === o.id ? {
237
- ...y,
238
- isDefault: !o.isDefault
235
+ async function u(c) {
236
+ const p = a == null ? void 0 : a.map((x) => x.id === c.id ? {
237
+ ...x,
238
+ isDefault: !c.isDefault
239
239
  } : {
240
- ...y,
240
+ ...x,
241
241
  isDefault: !1
242
242
  });
243
- l(m || []);
243
+ i(p || []);
244
244
  const b = {
245
- ...o,
246
- isDefault: !o.isDefault
245
+ ...c,
246
+ isDefault: !c.isDefault
247
247
  };
248
- await De(u.apiServiceUrl, b, i == null ? void 0 : i.accessToken);
249
- const N = a == null ? void 0 : a.find((y) => y.isDefault);
250
- if (N && N.id !== o.id) {
251
- const y = {
252
- ...N,
248
+ await xe(m.apiServiceUrl, b, l == null ? void 0 : l.accessToken);
249
+ const v = a == null ? void 0 : a.find((x) => x.isDefault);
250
+ if (v && v.id !== c.id) {
251
+ const x = {
252
+ ...v,
253
253
  isDefault: !1
254
254
  };
255
- await De(u.apiServiceUrl, y, i == null ? void 0 : i.accessToken);
255
+ await xe(m.apiServiceUrl, x, l == null ? void 0 : l.accessToken);
256
256
  }
257
257
  }
258
- return /* @__PURE__ */ n(Se, { open: s, onOpenChange: r, children: [
259
- /* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e(V, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(ua, { className: "h-4 w-4" }) }) }),
260
- /* @__PURE__ */ n(ke, { align: "end", className: "w-60", children: [
261
- /* @__PURE__ */ e(Ds, { className: "px-3", children: "Lenses" }),
262
- /* @__PURE__ */ e(Cs, {}),
258
+ return /* @__PURE__ */ n(Ce, { open: s, onOpenChange: r, children: [
259
+ /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ e(V, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(da, { className: "h-4 w-4" }) }) }),
260
+ /* @__PURE__ */ n(Me, { align: "end", className: "w-60", children: [
261
+ /* @__PURE__ */ e(xs, { className: "px-3", children: "Lenses" }),
262
+ /* @__PURE__ */ e(Ds, {}),
263
263
  /* @__PURE__ */ n(
264
- Ss,
264
+ Cs,
265
265
  {
266
266
  value: t,
267
267
  onValueChange: h,
268
268
  children: [
269
- /* @__PURE__ */ e(ze, { value: "original", children: "Original" }),
270
- a == null ? void 0 : a.map((o) => /* @__PURE__ */ n(
271
- ze,
269
+ /* @__PURE__ */ e(qe, { value: "original", children: "Original" }),
270
+ a == null ? void 0 : a.map((c) => /* @__PURE__ */ n(
271
+ qe,
272
272
  {
273
273
  className: "group flex justify-between gap-2",
274
- value: o.id,
274
+ value: c.id,
275
275
  children: [
276
- /* @__PURE__ */ e("p", { children: o.name }),
276
+ /* @__PURE__ */ e("p", { children: c.name }),
277
277
  /* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
278
278
  /* @__PURE__ */ e(
279
- Be,
279
+ He,
280
280
  {
281
- onClick: (m) => {
282
- m.preventDefault(), g(o);
281
+ onClick: (p) => {
282
+ p.preventDefault(), u(c);
283
283
  },
284
- className: Y(
284
+ className: X(
285
285
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
286
286
  {
287
- invisible: !o.isDefault,
288
- "text-green-500": o.isDefault
287
+ invisible: !c.isDefault,
288
+ "text-green-500": c.isDefault
289
289
  }
290
290
  ),
291
291
  strokeWidth: 1.5
292
292
  }
293
293
  ),
294
294
  /* @__PURE__ */ e(
295
- Ke,
295
+ Be,
296
296
  {
297
- onClick: (m) => {
298
- m.preventDefault(), f(o.id);
297
+ onClick: (p) => {
298
+ p.preventDefault(), f(c.id);
299
299
  },
300
300
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
301
301
  strokeWidth: 1.5
@@ -304,7 +304,7 @@ function wa() {
304
304
  ] })
305
305
  ]
306
306
  },
307
- o.id
307
+ c.id
308
308
  ))
309
309
  ]
310
310
  }
@@ -312,138 +312,138 @@ function wa() {
312
312
  ] })
313
313
  ] });
314
314
  }
315
- function xa({
315
+ function wa({
316
316
  iconClassName: s
317
317
  }) {
318
- const [r, a] = x(!1), [t, l] = x(""), [c, i] = x(!1), u = w((o) => o.isDownloadingPdf), { tokenProps: h } = R();
318
+ const [r, a] = w(!1), [t, i] = w(""), [o, l] = w(!1), m = y((c) => c.isDownloadingPdf), { tokenProps: h } = R();
319
319
  async function f() {
320
- const o = C.loading(
320
+ const c = C.loading(
321
321
  "Generating PDF... may take up to 60 seconds"
322
322
  );
323
323
  try {
324
- await _e(h.apiServiceUrl), C.dismiss(o), C.success("PDF downloaded successfully!", {
324
+ await ze(h.apiServiceUrl), C.dismiss(c), C.success("PDF downloaded successfully!", {
325
325
  duration: 2e3
326
326
  });
327
- } catch (m) {
328
- C.dismiss(o), C.error("Failed to download PDF", {
327
+ } catch (p) {
328
+ C.dismiss(c), C.error("Failed to download PDF", {
329
329
  description: "Please try again or contact support.",
330
330
  richColors: !0
331
- }), console.error("PDF download error:", m);
331
+ }), console.error("PDF download error:", p);
332
332
  }
333
333
  }
334
- async function g() {
334
+ async function u() {
335
335
  if (!t) return;
336
- a(!1), l(""), i(!1);
337
- const o = C.loading(
336
+ a(!1), i(""), l(!1);
337
+ const c = C.loading(
338
338
  "Generating protected PDF... may take up to 60 seconds"
339
339
  );
340
340
  try {
341
- await _e(h.apiServiceUrl, t), C.dismiss(o), C.success("Protected PDF downloaded successfully!", {
341
+ await ze(h.apiServiceUrl, t), C.dismiss(c), C.success("Protected PDF downloaded successfully!", {
342
342
  duration: 2e3,
343
343
  position: "top-right"
344
344
  });
345
- } catch (m) {
346
- C.dismiss(o), C.error("Failed to download protected PDF. Please try again."), console.error("Protected PDF download error:", m);
345
+ } catch (p) {
346
+ C.dismiss(c), C.error("Failed to download protected PDF. Please try again."), console.error("Protected PDF download error:", p);
347
347
  }
348
348
  }
349
349
  return /* @__PURE__ */ n(E, { children: [
350
- /* @__PURE__ */ n(Se, { modal: !1, children: [
351
- /* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e(
352
- M,
350
+ /* @__PURE__ */ n(Ce, { modal: !1, children: [
351
+ /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ e(
352
+ k,
353
353
  {
354
354
  variant: "ghost",
355
355
  size: "sm",
356
356
  className: "h-7 p-2",
357
- disabled: u,
358
- children: /* @__PURE__ */ e(Ms, { className: Y("size-4", s) })
357
+ disabled: m,
358
+ children: /* @__PURE__ */ e(Ss, { className: X("size-4", s) })
359
359
  }
360
360
  ) }),
361
- /* @__PURE__ */ n(ke, { align: "end", children: [
362
- /* @__PURE__ */ n(J, { onClick: f, children: [
363
- /* @__PURE__ */ e(ks, { className: "mr-2 h-4 w-4" }),
361
+ /* @__PURE__ */ n(Me, { align: "end", children: [
362
+ /* @__PURE__ */ n(W, { onClick: f, children: [
363
+ /* @__PURE__ */ e(Ms, { className: "mr-2 h-4 w-4" }),
364
364
  "Download PDF"
365
365
  ] }),
366
- /* @__PURE__ */ n(J, { onClick: () => a(!0), children: [
367
- /* @__PURE__ */ e(Ls, { className: "mr-2 h-4 w-4" }),
366
+ /* @__PURE__ */ n(W, { onClick: () => a(!0), children: [
367
+ /* @__PURE__ */ e(ks, { className: "mr-2 h-4 w-4" }),
368
368
  "Download Protected PDF"
369
369
  ] })
370
370
  ] })
371
371
  ] }),
372
372
  /* @__PURE__ */ e(
373
- ie,
373
+ oe,
374
374
  {
375
375
  open: r,
376
376
  onOpenChange: a,
377
- children: /* @__PURE__ */ n(le, { className: "sm:max-w-[425px]", children: [
378
- /* @__PURE__ */ n(ce, { children: [
379
- /* @__PURE__ */ e(de, { children: "Download Protected PDF" }),
380
- /* @__PURE__ */ e(Ae, { children: "Enter a password to protect your PDF. The PDF will be encrypted and require this password to open." })
377
+ children: /* @__PURE__ */ n(ie, { className: "sm:max-w-[425px]", children: [
378
+ /* @__PURE__ */ n(le, { children: [
379
+ /* @__PURE__ */ e(ce, { children: "Download Protected PDF" }),
380
+ /* @__PURE__ */ e(Pe, { children: "Enter a password to protect your PDF. The PDF will be encrypted and require this password to open." })
381
381
  ] }),
382
382
  /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ n("div", { className: "grid gap-2", children: [
383
- /* @__PURE__ */ e(re, { htmlFor: "password", children: "Password" }),
383
+ /* @__PURE__ */ e(te, { htmlFor: "password", children: "Password" }),
384
384
  /* @__PURE__ */ n("div", { className: "relative", children: [
385
385
  /* @__PURE__ */ e(
386
386
  Q,
387
387
  {
388
388
  id: "password",
389
- type: c ? "text" : "password",
389
+ type: o ? "text" : "password",
390
390
  value: t,
391
- onChange: (o) => l(o.target.value),
391
+ onChange: (c) => i(c.target.value),
392
392
  placeholder: "Enter password",
393
393
  className: "pr-10",
394
- onKeyDown: (o) => {
395
- o.key === "Enter" && t && g();
394
+ onKeyDown: (c) => {
395
+ c.key === "Enter" && t && u();
396
396
  }
397
397
  }
398
398
  ),
399
399
  /* @__PURE__ */ e(
400
- M,
400
+ k,
401
401
  {
402
402
  type: "button",
403
403
  variant: "ghost",
404
404
  size: "sm",
405
405
  className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
406
- onClick: () => i(!c),
407
- children: c ? /* @__PURE__ */ e(Ps, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ e(As, { className: "h-4 w-4 text-muted-foreground" })
406
+ onClick: () => l(!o),
407
+ children: o ? /* @__PURE__ */ e(Ls, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ e(Ps, { className: "h-4 w-4 text-muted-foreground" })
408
408
  }
409
409
  )
410
410
  ] })
411
411
  ] }) }),
412
- /* @__PURE__ */ n(He, { children: [
412
+ /* @__PURE__ */ n(Qe, { children: [
413
413
  /* @__PURE__ */ e(
414
- M,
414
+ k,
415
415
  {
416
416
  variant: "outline",
417
417
  onClick: () => a(!1),
418
418
  children: "Cancel"
419
419
  }
420
420
  ),
421
- /* @__PURE__ */ e(M, { onClick: g, disabled: !t, children: "Download" })
421
+ /* @__PURE__ */ e(k, { onClick: u, disabled: !t, children: "Download" })
422
422
  ] })
423
423
  ] })
424
424
  }
425
425
  )
426
426
  ] });
427
427
  }
428
- const Da = async (s, r, a) => {
428
+ const xa = async (s, r, a) => {
429
429
  const t = `${s}/management/v1/groups`;
430
- return await We(t, r, a);
431
- }, Ca = async (s, r, a) => {
432
- const t = `${s}/management/v1/groups/${a}`, l = await fetch(t, {
430
+ return await Ke(t, r, a);
431
+ }, Da = async (s, r, a) => {
432
+ const t = `${s}/management/v1/groups/${a}`, i = await fetch(t, {
433
433
  method: "DELETE",
434
434
  headers: {
435
435
  Authorization: `Bearer ${r}`
436
436
  }
437
437
  });
438
- if (!l.ok) {
439
- const c = await l.text();
440
- throw new Error(c || "Failed to delete group");
438
+ if (!i.ok) {
439
+ const o = await i.text();
440
+ throw new Error(o || "Failed to delete group");
441
441
  }
442
+ }, Ca = async (s, r, a, t) => {
443
+ const i = `${s}/management/v1/groups/${a}/members`;
444
+ return await Ke(i, r, t);
442
445
  }, Sa = async (s, r, a, t) => {
443
- const l = `${s}/management/v1/groups/${a}/members`;
444
- return await We(l, r, t);
445
- }, Ma = async (s, r, a, t) => {
446
- const l = `${s}/management/v1/groups/${a}/members`, c = await fetch(l, {
446
+ const i = `${s}/management/v1/groups/${a}/members`, o = await fetch(i, {
447
447
  method: "DELETE",
448
448
  headers: {
449
449
  "Content-Type": "application/json",
@@ -451,15 +451,15 @@ const Da = async (s, r, a) => {
451
451
  },
452
452
  body: JSON.stringify(t)
453
453
  });
454
- if (!c.ok) {
455
- const i = await c.text();
456
- throw new Error(i || "Failed to remove group members");
454
+ if (!o.ok) {
455
+ const l = await o.text();
456
+ throw new Error(l || "Failed to remove group members");
457
457
  }
458
458
  };
459
- function ka() {
460
- const { authToken: s, tokenProps: r } = R(), a = ue();
461
- return me({
462
- mutationFn: (t) => Da(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
459
+ function Ma() {
460
+ const { authToken: s, tokenProps: r } = R(), a = de();
461
+ return ue({
462
+ mutationFn: (t) => xa(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
463
463
  onSuccess: () => {
464
464
  a.invalidateQueries({ queryKey: ["groups"] }), C.success("Group created successfully");
465
465
  },
@@ -470,12 +470,12 @@ function ka() {
470
470
  }
471
471
  });
472
472
  }
473
- function La() {
474
- const { authToken: s, tokenProps: r } = R(), a = ue();
475
- return me({
476
- mutationFn: (t) => Ca(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
477
- onSuccess: (t, l) => {
478
- a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", l] }), C.success("Group deleted successfully");
473
+ function ka() {
474
+ const { authToken: s, tokenProps: r } = R(), a = de();
475
+ return ue({
476
+ mutationFn: (t) => Da(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
477
+ onSuccess: (t, i) => {
478
+ a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", i] }), C.success("Group deleted successfully");
479
479
  },
480
480
  onError: (t) => {
481
481
  console.error("Failed to delete group:", t), C.error("Failed to delete group", {
@@ -484,16 +484,16 @@ function La() {
484
484
  }
485
485
  });
486
486
  }
487
- function Pa() {
488
- const { authToken: s, tokenProps: r } = R(), a = ue();
489
- return me({
487
+ function La() {
488
+ const { authToken: s, tokenProps: r } = R(), a = de();
489
+ return ue({
490
490
  mutationFn: ({
491
491
  groupId: t,
492
- data: l
493
- }) => Sa(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
494
- onSuccess: (t, l) => {
495
- a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
496
- queryKey: ["group-members", l.groupId]
492
+ data: i
493
+ }) => Ca(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
494
+ onSuccess: (t, i) => {
495
+ a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
496
+ queryKey: ["group-members", i.groupId]
497
497
  }), a.invalidateQueries({ queryKey: ["groups"] }), C.success("Members added successfully");
498
498
  },
499
499
  onError: (t) => {
@@ -503,16 +503,16 @@ function Pa() {
503
503
  }
504
504
  });
505
505
  }
506
- function Aa() {
507
- const { authToken: s, tokenProps: r } = R(), a = ue();
508
- return me({
506
+ function Pa() {
507
+ const { authToken: s, tokenProps: r } = R(), a = de();
508
+ return ue({
509
509
  mutationFn: ({
510
510
  groupId: t,
511
- data: l
512
- }) => Ma(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
513
- onSuccess: (t, l) => {
514
- a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
515
- queryKey: ["group-members", l.groupId]
511
+ data: i
512
+ }) => Sa(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
513
+ onSuccess: (t, i) => {
514
+ a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
515
+ queryKey: ["group-members", i.groupId]
516
516
  }), a.invalidateQueries({ queryKey: ["groups"] }), C.success("Members removed successfully");
517
517
  },
518
518
  onError: (t) => {
@@ -522,32 +522,32 @@ function Aa() {
522
522
  }
523
523
  });
524
524
  }
525
- function Ia({
525
+ function Aa({
526
526
  onSuccess: s,
527
527
  tenantId: r,
528
528
  isTenantUser: a
529
529
  }) {
530
- const [t, l] = x(""), [c, i] = x(""), [u, h] = x({}), f = ka(), g = () => {
531
- const m = {};
532
- return t.trim() ? t.length < 3 ? m.name = "Group name must be at least 3 characters" : t.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"), h(m), Object.keys(m).length === 0;
530
+ const [t, i] = w(""), [o, l] = w(""), [m, h] = w({}), f = Ma(), u = () => {
531
+ const p = {};
532
+ return t.trim() ? t.length < 3 ? p.name = "Group name must be at least 3 characters" : t.length > 50 && (p.name = "Group name must be less than 50 characters") : p.name = "Group name is required", o && o.length > 200 && (p.description = "Description must be less than 200 characters"), h(p), Object.keys(p).length === 0;
533
533
  };
534
- return /* @__PURE__ */ n("form", { onSubmit: async (m) => {
535
- if (m.preventDefault(), !g()) return;
534
+ return /* @__PURE__ */ n("form", { onSubmit: async (p) => {
535
+ if (p.preventDefault(), !u()) return;
536
536
  const b = {
537
537
  name: t.trim(),
538
- description: c.trim() || void 0,
538
+ description: o.trim() || void 0,
539
539
  type: a ? "TENANT_GROUP" : "ORG_GROUP",
540
540
  ...a && r ? { tenantId: r } : {}
541
541
  };
542
542
  try {
543
- await f.mutateAsync(b), l(""), i(""), h({}), s();
544
- } catch (N) {
545
- console.error("Failed to create group:", N);
543
+ await f.mutateAsync(b), i(""), l(""), h({}), s();
544
+ } catch (v) {
545
+ console.error("Failed to create group:", v);
546
546
  }
547
547
  }, className: "space-y-6", children: [
548
548
  /* @__PURE__ */ n("div", { className: "space-y-4", children: [
549
549
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
550
- /* @__PURE__ */ n(re, { htmlFor: "group-name", children: [
550
+ /* @__PURE__ */ n(te, { htmlFor: "group-name", children: [
551
551
  "Group Name ",
552
552
  /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
553
553
  ] }),
@@ -557,60 +557,60 @@ function Ia({
557
557
  id: "group-name",
558
558
  placeholder: "e.g., Marketing Team, Engineering Squad",
559
559
  value: t,
560
- onChange: (m) => {
561
- l(m.target.value), u.name && h((b) => ({ ...b, name: "" }));
560
+ onChange: (p) => {
561
+ i(p.target.value), m.name && h((b) => ({ ...b, name: "" }));
562
562
  },
563
- className: u.name ? "border-destructive" : "",
563
+ className: m.name ? "border-destructive" : "",
564
564
  disabled: f.isPending
565
565
  }
566
566
  ),
567
- u.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.name })
567
+ m.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.name })
568
568
  ] }),
569
569
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
570
- /* @__PURE__ */ n(re, { htmlFor: "group-description", children: [
570
+ /* @__PURE__ */ n(te, { htmlFor: "group-description", children: [
571
571
  "Description",
572
572
  /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
573
573
  ] }),
574
574
  /* @__PURE__ */ e(
575
- Is,
575
+ As,
576
576
  {
577
577
  id: "group-description",
578
578
  placeholder: "Describe the purpose of this group...",
579
- value: c,
580
- onChange: (m) => {
581
- i(m.target.value), u.description && h((b) => ({ ...b, description: "" }));
579
+ value: o,
580
+ onChange: (p) => {
581
+ l(p.target.value), m.description && h((b) => ({ ...b, description: "" }));
582
582
  },
583
- className: u.description ? "border-destructive" : "",
583
+ className: m.description ? "border-destructive" : "",
584
584
  disabled: f.isPending,
585
585
  rows: 3
586
586
  }
587
587
  ),
588
- u.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.description }),
588
+ m.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.description }),
589
589
  /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground", children: [
590
- c.length,
590
+ o.length,
591
591
  "/200 characters"
592
592
  ] })
593
593
  ] }),
594
594
  /* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ n("div", { className: "flex gap-3", children: [
595
- /* @__PURE__ */ e(Es, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
595
+ /* @__PURE__ */ e(Is, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
596
596
  /* @__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." })
597
597
  ] }) })
598
598
  ] }),
599
599
  /* @__PURE__ */ n("div", { className: "flex justify-end gap-3", children: [
600
600
  /* @__PURE__ */ e(
601
- M,
601
+ k,
602
602
  {
603
603
  type: "button",
604
604
  variant: "outline",
605
605
  onClick: () => {
606
- l(""), i(""), h({});
606
+ i(""), l(""), h({});
607
607
  },
608
608
  disabled: f.isPending,
609
609
  children: "Clear"
610
610
  }
611
611
  ),
612
612
  /* @__PURE__ */ e(
613
- M,
613
+ k,
614
614
  {
615
615
  type: "submit",
616
616
  disabled: f.isPending || !t.trim(),
@@ -618,7 +618,7 @@ function Ia({
618
618
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
619
619
  "Creating..."
620
620
  ] }) : /* @__PURE__ */ n(E, { children: [
621
- /* @__PURE__ */ e(z, { className: "mr-2 h-4 w-4" }),
621
+ /* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4" }),
622
622
  "Create Group"
623
623
  ] })
624
624
  }
@@ -626,57 +626,57 @@ function Ia({
626
626
  ] })
627
627
  ] });
628
628
  }
629
- function Ea(s, r = []) {
629
+ function Ia(s, r = []) {
630
630
  let a = [];
631
- function t(c, i) {
632
- const u = S.createContext(i), h = a.length;
633
- a = [...a, i];
634
- const f = (o) => {
631
+ function t(o, l) {
632
+ const m = S.createContext(l), h = a.length;
633
+ a = [...a, l];
634
+ const f = (c) => {
635
635
  var P;
636
- const { scope: m, children: b, ...N } = o, y = ((P = m == null ? void 0 : m[s]) == null ? void 0 : P[h]) || u, k = S.useMemo(() => N, Object.values(N));
637
- return /* @__PURE__ */ e(y.Provider, { value: k, children: b });
636
+ const { scope: p, children: b, ...v } = c, x = ((P = p == null ? void 0 : p[s]) == null ? void 0 : P[h]) || m, M = S.useMemo(() => v, Object.values(v));
637
+ return /* @__PURE__ */ e(x.Provider, { value: M, children: b });
638
638
  };
639
- f.displayName = c + "Provider";
640
- function g(o, m) {
641
- var y;
642
- const b = ((y = m == null ? void 0 : m[s]) == null ? void 0 : y[h]) || u, N = S.useContext(b);
643
- if (N) return N;
644
- if (i !== void 0) return i;
645
- throw new Error(`\`${o}\` must be used within \`${c}\``);
639
+ f.displayName = o + "Provider";
640
+ function u(c, p) {
641
+ var x;
642
+ const b = ((x = p == null ? void 0 : p[s]) == null ? void 0 : x[h]) || m, v = S.useContext(b);
643
+ if (v) return v;
644
+ if (l !== void 0) return l;
645
+ throw new Error(`\`${c}\` must be used within \`${o}\``);
646
646
  }
647
- return [f, g];
647
+ return [f, u];
648
648
  }
649
- const l = () => {
650
- const c = a.map((i) => S.createContext(i));
651
- return function(u) {
652
- const h = (u == null ? void 0 : u[s]) || c;
649
+ const i = () => {
650
+ const o = a.map((l) => S.createContext(l));
651
+ return function(m) {
652
+ const h = (m == null ? void 0 : m[s]) || o;
653
653
  return S.useMemo(
654
- () => ({ [`__scope${s}`]: { ...u, [s]: h } }),
655
- [u, h]
654
+ () => ({ [`__scope${s}`]: { ...m, [s]: h } }),
655
+ [m, h]
656
656
  );
657
657
  };
658
658
  };
659
- return l.scopeName = s, [t, Fa(l, ...r)];
659
+ return i.scopeName = s, [t, Ea(i, ...r)];
660
660
  }
661
- function Fa(...s) {
661
+ function Ea(...s) {
662
662
  const r = s[0];
663
663
  if (s.length === 1) return r;
664
664
  const a = () => {
665
- const t = s.map((l) => ({
666
- useScope: l(),
667
- scopeName: l.scopeName
665
+ const t = s.map((i) => ({
666
+ useScope: i(),
667
+ scopeName: i.scopeName
668
668
  }));
669
- return function(c) {
670
- const i = t.reduce((u, { useScope: h, scopeName: f }) => {
671
- const o = h(c)[`__scope${f}`];
672
- return { ...u, ...o };
669
+ return function(o) {
670
+ const l = t.reduce((m, { useScope: h, scopeName: f }) => {
671
+ const c = h(o)[`__scope${f}`];
672
+ return { ...m, ...c };
673
673
  }, {});
674
- return S.useMemo(() => ({ [`__scope${r.scopeName}`]: i }), [i]);
674
+ return S.useMemo(() => ({ [`__scope${r.scopeName}`]: l }), [l]);
675
675
  };
676
676
  };
677
677
  return a.scopeName = r.scopeName, a;
678
678
  }
679
- function Ta(s) {
679
+ function Fa(s) {
680
680
  const r = S.useRef(s);
681
681
  return S.useEffect(() => {
682
682
  r.current = s;
@@ -685,8 +685,8 @@ function Ta(s) {
685
685
  return (t = r.current) == null ? void 0 : t.call(r, ...a);
686
686
  }, []);
687
687
  }
688
- var Ce = globalThis != null && globalThis.document ? S.useLayoutEffect : () => {
689
- }, Ga = [
688
+ var De = globalThis != null && globalThis.document ? S.useLayoutEffect : () => {
689
+ }, Ta = [
690
690
  "a",
691
691
  "button",
692
692
  "div",
@@ -704,183 +704,183 @@ var Ce = globalThis != null && globalThis.document ? S.useLayoutEffect : () => {
704
704
  "span",
705
705
  "svg",
706
706
  "ul"
707
- ], Ie = Ga.reduce((s, r) => {
708
- const a = Fs(`Primitive.${r}`), t = S.forwardRef((l, c) => {
709
- const { asChild: i, ...u } = l, h = i ? a : r;
710
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(h, { ...u, ref: c });
707
+ ], Ae = Ta.reduce((s, r) => {
708
+ const a = Es(`Primitive.${r}`), t = S.forwardRef((i, o) => {
709
+ const { asChild: l, ...m } = i, h = l ? a : r;
710
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(h, { ...m, ref: o });
711
711
  });
712
712
  return t.displayName = `Primitive.${r}`, { ...s, [r]: t };
713
713
  }, {});
714
- function Ra() {
715
- return fa.useSyncExternalStore(
716
- Oa,
714
+ function Ga() {
715
+ return ga.useSyncExternalStore(
716
+ Ra,
717
717
  () => !0,
718
718
  () => !1
719
719
  );
720
720
  }
721
- function Oa() {
721
+ function Ra() {
722
722
  return () => {
723
723
  };
724
724
  }
725
- var Ee = "Avatar", [Ua] = Ea(Ee), [qa, ss] = Ua(Ee), as = S.forwardRef(
725
+ var Ie = "Avatar", [Oa] = Ia(Ie), [Ua, es] = Oa(Ie), ss = S.forwardRef(
726
726
  (s, r) => {
727
- const { __scopeAvatar: a, ...t } = s, [l, c] = S.useState("idle");
727
+ const { __scopeAvatar: a, ...t } = s, [i, o] = S.useState("idle");
728
728
  return /* @__PURE__ */ e(
729
- qa,
729
+ Ua,
730
730
  {
731
731
  scope: a,
732
- imageLoadingStatus: l,
733
- onImageLoadingStatusChange: c,
734
- children: /* @__PURE__ */ e(Ie.span, { ...t, ref: r })
732
+ imageLoadingStatus: i,
733
+ onImageLoadingStatusChange: o,
734
+ children: /* @__PURE__ */ e(Ae.span, { ...t, ref: r })
735
735
  }
736
736
  );
737
737
  }
738
738
  );
739
- as.displayName = Ee;
740
- var ts = "AvatarImage", rs = S.forwardRef(
739
+ ss.displayName = Ie;
740
+ var as = "AvatarImage", ts = S.forwardRef(
741
741
  (s, r) => {
742
- const { __scopeAvatar: a, src: t, onLoadingStatusChange: l = () => {
743
- }, ...c } = s, i = ss(ts, a), u = za(t, c), h = Ta((f) => {
744
- l(f), i.onImageLoadingStatusChange(f);
742
+ const { __scopeAvatar: a, src: t, onLoadingStatusChange: i = () => {
743
+ }, ...o } = s, l = es(as, a), m = qa(t, o), h = Fa((f) => {
744
+ i(f), l.onImageLoadingStatusChange(f);
745
745
  });
746
- return Ce(() => {
747
- u !== "idle" && h(u);
748
- }, [u, h]), u === "loaded" ? /* @__PURE__ */ e(Ie.img, { ...c, ref: r, src: t }) : null;
746
+ return De(() => {
747
+ m !== "idle" && h(m);
748
+ }, [m, h]), m === "loaded" ? /* @__PURE__ */ e(Ae.img, { ...o, ref: r, src: t }) : null;
749
749
  }
750
750
  );
751
- rs.displayName = ts;
752
- var ns = "AvatarFallback", os = S.forwardRef(
751
+ ts.displayName = as;
752
+ var rs = "AvatarFallback", ns = S.forwardRef(
753
753
  (s, r) => {
754
- const { __scopeAvatar: a, delayMs: t, ...l } = s, c = ss(ns, a), [i, u] = S.useState(t === void 0);
754
+ const { __scopeAvatar: a, delayMs: t, ...i } = s, o = es(rs, a), [l, m] = S.useState(t === void 0);
755
755
  return S.useEffect(() => {
756
756
  if (t !== void 0) {
757
- const h = window.setTimeout(() => u(!0), t);
757
+ const h = window.setTimeout(() => m(!0), t);
758
758
  return () => window.clearTimeout(h);
759
759
  }
760
- }, [t]), i && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Ie.span, { ...l, ref: r }) : null;
760
+ }, [t]), l && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Ae.span, { ...i, ref: r }) : null;
761
761
  }
762
762
  );
763
- os.displayName = ns;
764
- function Ve(s, r) {
763
+ ns.displayName = rs;
764
+ function je(s, r) {
765
765
  return s ? r ? (s.src !== r && (s.src = r), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
766
766
  }
767
- function za(s, { referrerPolicy: r, crossOrigin: a }) {
768
- const t = Ra(), l = S.useRef(null), c = t ? (l.current || (l.current = new window.Image()), l.current) : null, [i, u] = S.useState(
769
- () => Ve(c, s)
767
+ function qa(s, { referrerPolicy: r, crossOrigin: a }) {
768
+ const t = Ga(), i = S.useRef(null), o = t ? (i.current || (i.current = new window.Image()), i.current) : null, [l, m] = S.useState(
769
+ () => je(o, s)
770
770
  );
771
- return Ce(() => {
772
- u(Ve(c, s));
773
- }, [c, s]), Ce(() => {
774
- const h = (o) => () => {
775
- u(o);
771
+ return De(() => {
772
+ m(je(o, s));
773
+ }, [o, s]), De(() => {
774
+ const h = (c) => () => {
775
+ m(c);
776
776
  };
777
- if (!c) return;
778
- const f = h("loaded"), g = h("error");
779
- return c.addEventListener("load", f), c.addEventListener("error", g), r && (c.referrerPolicy = r), typeof a == "string" && (c.crossOrigin = a), () => {
780
- c.removeEventListener("load", f), c.removeEventListener("error", g);
777
+ if (!o) return;
778
+ const f = h("loaded"), u = h("error");
779
+ return o.addEventListener("load", f), o.addEventListener("error", u), r && (o.referrerPolicy = r), typeof a == "string" && (o.crossOrigin = a), () => {
780
+ o.removeEventListener("load", f), o.removeEventListener("error", u);
781
781
  };
782
- }, [c, a, r]), i;
782
+ }, [o, a, r]), l;
783
783
  }
784
- var is = as, ls = rs, cs = os;
785
- const Fe = S.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
786
- is,
784
+ var os = ss, is = ts, ls = ns;
785
+ const Ee = S.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
786
+ os,
787
787
  {
788
788
  ref: a,
789
- className: Y(
789
+ className: X(
790
790
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
791
791
  s
792
792
  ),
793
793
  ...r
794
794
  }
795
795
  ));
796
- Fe.displayName = is.displayName;
797
- const _a = S.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
798
- ls,
796
+ Ee.displayName = os.displayName;
797
+ const za = S.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
798
+ is,
799
799
  {
800
800
  ref: a,
801
- className: Y("aspect-square h-full w-full", s),
801
+ className: X("aspect-square h-full w-full", s),
802
802
  ...r
803
803
  }
804
804
  ));
805
- _a.displayName = ls.displayName;
806
- const Te = S.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
807
- cs,
805
+ za.displayName = is.displayName;
806
+ const Fe = S.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
807
+ ls,
808
808
  {
809
809
  ref: a,
810
- className: Y(
810
+ className: X(
811
811
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
812
812
  s
813
813
  ),
814
814
  ...r
815
815
  }
816
816
  ));
817
- Te.displayName = cs.displayName;
818
- function $a({
817
+ Fe.displayName = ls.displayName;
818
+ function _a({
819
819
  open: s,
820
820
  onOpenChange: r,
821
821
  group: a,
822
822
  onUpdate: t
823
823
  }) {
824
- const [l, c] = x("members"), [i, u] = x(""), [h, f] = x([]), [g, o] = x([]), { data: m, isLoading: b, refetch: N } = Ts(a.id), y = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: k, isLoading: P } = Gs({
825
- type: y,
824
+ const [i, o] = w("members"), [l, m] = w(""), [h, f] = w([]), [u, c] = w([]), { data: p, isLoading: b, refetch: v } = Fs(a.id), x = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: M, isLoading: P } = Ts({
825
+ type: x,
826
826
  tenantId: a.tenantId || void 0,
827
827
  active: !0,
828
828
  limit: 100
829
- }), U = Pa(), T = Aa(), A = (m == null ? void 0 : m.members) || [], _ = te(() => new Set(A.map((p) => p.userId)), [A]), q = te(() => k.filter((p) => !_.has(p.id)), [k, _]), D = te(() => {
830
- if (!i) return q;
831
- const p = i.toLowerCase();
832
- return q.filter(
829
+ }), O = La(), G = Pa(), A = (p == null ? void 0 : p.members) || [], $ = ae(() => new Set(A.map((g) => g.userId)), [A]), N = ae(() => M.filter((g) => !$.has(g.id)), [M, $]), F = ae(() => {
830
+ if (!l) return N;
831
+ const g = l.toLowerCase();
832
+ return N.filter(
833
833
  (L) => {
834
- var I, O;
835
- return ((I = L.name) == null ? void 0 : I.toLowerCase().includes(p)) || ((O = L.email) == null ? void 0 : O.toLowerCase().includes(p));
834
+ var I, q;
835
+ return ((I = L.name) == null ? void 0 : I.toLowerCase().includes(g)) || ((q = L.email) == null ? void 0 : q.toLowerCase().includes(g));
836
836
  }
837
837
  );
838
- }, [q, i]), v = te(() => {
839
- if (!i) return A;
840
- const p = i.toLowerCase();
838
+ }, [N, l]), D = ae(() => {
839
+ if (!l) return A;
840
+ const g = l.toLowerCase();
841
841
  return A.filter(
842
842
  (L) => {
843
- var I, O, K, Z;
844
- return ((O = (I = L.user) == null ? void 0 : I.name) == null ? void 0 : O.toLowerCase().includes(p)) || ((Z = (K = L.user) == null ? void 0 : K.email) == null ? void 0 : Z.toLowerCase().includes(p));
843
+ var I, q, Y, z;
844
+ return ((q = (I = L.user) == null ? void 0 : I.name) == null ? void 0 : q.toLowerCase().includes(g)) || ((z = (Y = L.user) == null ? void 0 : Y.email) == null ? void 0 : z.toLowerCase().includes(g));
845
845
  }
846
846
  );
847
- }, [A, i]), G = async () => {
847
+ }, [A, l]), U = async () => {
848
848
  if (h.length !== 0)
849
849
  try {
850
- await U.mutateAsync({
850
+ await O.mutateAsync({
851
851
  groupId: a.id,
852
852
  data: {
853
853
  userIds: h,
854
- userType: y === "tenant" ? "tenant" : "org"
854
+ userType: x === "tenant" ? "tenant" : "org"
855
855
  }
856
- }), f([]), c("members"), N(), t == null || t();
857
- } catch (p) {
858
- console.error("Failed to add members:", p);
856
+ }), f([]), o("members"), v(), t == null || t();
857
+ } catch (g) {
858
+ console.error("Failed to add members:", g);
859
859
  }
860
- }, B = async () => {
861
- if (g.length !== 0)
860
+ }, me = async () => {
861
+ if (u.length !== 0)
862
862
  try {
863
- await T.mutateAsync({
863
+ await G.mutateAsync({
864
864
  groupId: a.id,
865
865
  data: {
866
- userIds: g
866
+ userIds: u
867
867
  }
868
- }), o([]), N(), t == null || t();
869
- } catch (p) {
870
- console.error("Failed to remove members:", p);
868
+ }), c([]), v(), t == null || t();
869
+ } catch (g) {
870
+ console.error("Failed to remove members:", g);
871
871
  }
872
- }, he = (p) => {
872
+ }, he = (g) => {
873
873
  f(
874
- (L) => L.includes(p) ? L.filter((I) => I !== p) : [...L, p]
874
+ (L) => L.includes(g) ? L.filter((I) => I !== g) : [...L, g]
875
875
  );
876
- }, pe = (p) => {
877
- o(
878
- (L) => L.includes(p) ? L.filter((I) => I !== p) : [...L, p]
876
+ }, B = (g) => {
877
+ c(
878
+ (L) => L.includes(g) ? L.filter((I) => I !== g) : [...L, g]
879
879
  );
880
880
  };
881
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(ie, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(le, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
882
- /* @__PURE__ */ n(ce, { children: [
883
- /* @__PURE__ */ e(de, { children: a.name }),
881
+ return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(oe, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(ie, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
882
+ /* @__PURE__ */ n(le, { children: [
883
+ /* @__PURE__ */ e(ce, { children: a.name }),
884
884
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground", children: [
885
885
  A.length,
886
886
  " ",
@@ -892,89 +892,89 @@ function $a({
892
892
  " group"
893
893
  ] })
894
894
  ] }),
895
- /* @__PURE__ */ n(Je, { value: l, onValueChange: (p) => {
896
- c(p), u(""), o([]);
895
+ /* @__PURE__ */ n(We, { value: i, onValueChange: (g) => {
896
+ o(g), m(""), c([]);
897
897
  }, className: "mt-4", children: [
898
- /* @__PURE__ */ n(Xe, { className: "grid w-full grid-cols-2", children: [
899
- /* @__PURE__ */ e(ne, { value: "members", children: "Current Members" }),
900
- /* @__PURE__ */ e(ne, { value: "add", children: "Add Members" })
898
+ /* @__PURE__ */ n(Je, { className: "grid w-full grid-cols-2", children: [
899
+ /* @__PURE__ */ e(re, { value: "members", children: "Current Members" }),
900
+ /* @__PURE__ */ e(re, { value: "add", children: "Add Members" })
901
901
  ] }),
902
- /* @__PURE__ */ n(oe, { value: "members", className: "mt-4 space-y-4", children: [
902
+ /* @__PURE__ */ n(ne, { value: "members", className: "mt-4 space-y-4", children: [
903
903
  /* @__PURE__ */ n("div", { className: "relative", children: [
904
- /* @__PURE__ */ e(ve, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
904
+ /* @__PURE__ */ e(be, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
905
905
  /* @__PURE__ */ e(
906
906
  Q,
907
907
  {
908
908
  placeholder: "Search members...",
909
- value: i,
910
- onChange: (p) => u(p.target.value),
909
+ value: l,
910
+ onChange: (g) => m(g.target.value),
911
911
  className: "pl-10"
912
912
  }
913
913
  )
914
914
  ] }),
915
- /* @__PURE__ */ e(Ne, { className: g.length > 0 ? "h-[300px]" : "h-[350px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((p) => /* @__PURE__ */ e(ye, { className: "h-16 w-full" }, p)) }) : v.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
916
- /* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
917
- /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: i ? "No members found" : "No members yet" }),
918
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
919
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: v.map((p) => /* @__PURE__ */ e(
920
- ja,
915
+ /* @__PURE__ */ e(ve, { className: u.length > 0 ? "h-[300px]" : "h-[350px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ne, { className: "h-16 w-full" }, g)) }) : D.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
916
+ /* @__PURE__ */ e(_, { className: "h-12 w-12 mb-3 opacity-50" }),
917
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: l ? "No members found" : "No members yet" }),
918
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
919
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((g) => /* @__PURE__ */ e(
920
+ $a,
921
921
  {
922
- member: p,
923
- selected: g.includes(p.userId),
924
- onToggle: () => pe(p.userId)
922
+ member: g,
923
+ selected: u.includes(g.userId),
924
+ onToggle: () => B(g.userId)
925
925
  },
926
- p.id
926
+ g.id
927
927
  )) }) }),
928
- g.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
928
+ u.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
929
929
  /* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
930
- g.length,
930
+ u.length,
931
931
  " member",
932
- g.length !== 1 ? "s" : "",
932
+ u.length !== 1 ? "s" : "",
933
933
  " selected"
934
934
  ] }),
935
935
  /* @__PURE__ */ e(
936
- M,
936
+ k,
937
937
  {
938
938
  variant: "destructive",
939
939
  size: "sm",
940
- onClick: B,
941
- disabled: T.isPending,
942
- children: T.isPending ? /* @__PURE__ */ n(E, { children: [
940
+ onClick: me,
941
+ disabled: G.isPending,
942
+ children: G.isPending ? /* @__PURE__ */ n(E, { children: [
943
943
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
944
944
  "Removing..."
945
945
  ] }) : /* @__PURE__ */ n(E, { children: [
946
- /* @__PURE__ */ e(Ye, { className: "mr-2 h-4 w-4" }),
946
+ /* @__PURE__ */ e(Xe, { className: "mr-2 h-4 w-4" }),
947
947
  "Remove Selected"
948
948
  ] })
949
949
  }
950
950
  )
951
951
  ] })
952
952
  ] }),
953
- /* @__PURE__ */ n(oe, { value: "add", className: "mt-4 space-y-4", children: [
953
+ /* @__PURE__ */ n(ne, { value: "add", className: "mt-4 space-y-4", children: [
954
954
  /* @__PURE__ */ n("div", { className: "relative", children: [
955
- /* @__PURE__ */ e(ve, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
955
+ /* @__PURE__ */ e(be, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
956
956
  /* @__PURE__ */ e(
957
957
  Q,
958
958
  {
959
959
  placeholder: "Search users to add...",
960
- value: i,
961
- onChange: (p) => u(p.target.value),
960
+ value: l,
961
+ onChange: (g) => m(g.target.value),
962
962
  className: "pl-10"
963
963
  }
964
964
  )
965
965
  ] }),
966
- /* @__PURE__ */ e(Ne, { className: "h-[300px]", children: P ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((p) => /* @__PURE__ */ e(ye, { className: "h-16 w-full" }, p)) }) : D.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
967
- /* @__PURE__ */ e(we, { className: "h-12 w-12 mb-3 opacity-50" }),
966
+ /* @__PURE__ */ e(ve, { className: "h-[300px]", children: P ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ne, { className: "h-16 w-full" }, g)) }) : F.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
967
+ /* @__PURE__ */ e(ye, { className: "h-12 w-12 mb-3 opacity-50" }),
968
968
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
969
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i ? "Try a different search" : "All eligible users are already members" })
970
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((p) => /* @__PURE__ */ e(
971
- Va,
969
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "All eligible users are already members" })
970
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: F.map((g) => /* @__PURE__ */ e(
971
+ ja,
972
972
  {
973
- user: p,
974
- selected: h.includes(p.id),
975
- onToggle: () => he(p.id)
973
+ user: g,
974
+ selected: h.includes(g.id),
975
+ onToggle: () => he(g.id)
976
976
  },
977
- p.id
977
+ g.id
978
978
  )) }) }),
979
979
  h.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
980
980
  /* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
@@ -984,15 +984,15 @@ function $a({
984
984
  " selected"
985
985
  ] }),
986
986
  /* @__PURE__ */ e(
987
- M,
987
+ k,
988
988
  {
989
- onClick: G,
990
- disabled: U.isPending,
991
- children: U.isPending ? /* @__PURE__ */ n(E, { children: [
989
+ onClick: U,
990
+ disabled: O.isPending,
991
+ children: O.isPending ? /* @__PURE__ */ n(E, { children: [
992
992
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
993
993
  "Adding..."
994
994
  ] }) : /* @__PURE__ */ n(E, { children: [
995
- /* @__PURE__ */ e(we, { className: "mr-2 h-4 w-4" }),
995
+ /* @__PURE__ */ e(ye, { className: "mr-2 h-4 w-4" }),
996
996
  "Add Members"
997
997
  ] })
998
998
  }
@@ -1002,44 +1002,44 @@ function $a({
1002
1002
  ] })
1003
1003
  ] }) }) });
1004
1004
  }
1005
- function ja({
1005
+ function $a({
1006
1006
  member: s,
1007
1007
  selected: r,
1008
1008
  onToggle: a
1009
1009
  }) {
1010
- var l, c, i, u;
1011
- const t = ((c = (l = s.user) == null ? void 0 : l.name) == null ? void 0 : c.split(" ").map((h) => h[0]).join("").toUpperCase()) || "?";
1010
+ var i, o, l, m;
1011
+ const t = ((o = (i = s.user) == null ? void 0 : i.name) == null ? void 0 : o.split(" ").map((h) => h[0]).join("").toUpperCase()) || "?";
1012
1012
  return /* @__PURE__ */ n(
1013
1013
  "div",
1014
1014
  {
1015
1015
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
1016
1016
  onClick: a,
1017
1017
  children: [
1018
- /* @__PURE__ */ e(Ze, { checked: r }),
1019
- /* @__PURE__ */ e(Fe, { className: "h-8 w-8", children: /* @__PURE__ */ e(Te, { className: "text-xs", children: t }) }),
1018
+ /* @__PURE__ */ e(Ye, { checked: r }),
1019
+ /* @__PURE__ */ e(Ee, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
1020
1020
  /* @__PURE__ */ n("div", { className: "flex-1", children: [
1021
- /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((i = s.user) == null ? void 0 : i.name) || "Unknown User" }),
1022
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = s.user) == null ? void 0 : u.email })
1021
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((l = s.user) == null ? void 0 : l.name) || "Unknown User" }),
1022
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (m = s.user) == null ? void 0 : m.email })
1023
1023
  ] })
1024
1024
  ]
1025
1025
  }
1026
1026
  );
1027
1027
  }
1028
- function Va({
1028
+ function ja({
1029
1029
  user: s,
1030
1030
  selected: r,
1031
1031
  onToggle: a
1032
1032
  }) {
1033
- var l;
1034
- const t = ((l = s.name) == null ? void 0 : l.split(" ").map((c) => c[0]).join("").toUpperCase()) || "?";
1033
+ var i;
1034
+ const t = ((i = s.name) == null ? void 0 : i.split(" ").map((o) => o[0]).join("").toUpperCase()) || "?";
1035
1035
  return /* @__PURE__ */ n(
1036
1036
  "div",
1037
1037
  {
1038
1038
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
1039
1039
  onClick: a,
1040
1040
  children: [
1041
- /* @__PURE__ */ e(Ze, { checked: r }),
1042
- /* @__PURE__ */ e(Fe, { className: "h-8 w-8", children: /* @__PURE__ */ e(Te, { className: "text-xs", children: t }) }),
1041
+ /* @__PURE__ */ e(Ye, { checked: r }),
1042
+ /* @__PURE__ */ e(Ee, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
1043
1043
  /* @__PURE__ */ n("div", { className: "flex-1", children: [
1044
1044
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
1045
1045
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
@@ -1048,121 +1048,121 @@ function Va({
1048
1048
  }
1049
1049
  );
1050
1050
  }
1051
- function Qa({
1051
+ function Va({
1052
1052
  open: s,
1053
1053
  onOpenChange: r
1054
1054
  }) {
1055
- const [a, t] = x("groups"), [l, c] = x(""), [i, u] = x(null), [h, f] = x(!1), [g, o] = x(null), { tokenProps: m } = R(), { currentUser: b } = es(), N = La(), y = (b == null ? void 0 : b.type) === "tenant", k = m == null ? void 0 : m.tenantId, { groups: P, isLoading: U, refetch: T } = Rs({
1056
- type: y ? "TENANT_GROUP" : "all",
1057
- tenantId: y ? k : void 0,
1055
+ const [a, t] = w("groups"), [i, o] = w(""), [l, m] = w(null), [h, f] = w(!1), [u, c] = w(null), { tokenProps: p } = R(), { currentUser: b } = Ze(), v = ka(), x = (b == null ? void 0 : b.type) === "tenant", M = p == null ? void 0 : p.tenantId, { groups: P, isLoading: O, refetch: G } = Gs({
1056
+ type: x ? "TENANT_GROUP" : "all",
1057
+ tenantId: x ? M : void 0,
1058
1058
  includeMembers: !1
1059
1059
  }), A = P.filter(
1060
- (v) => {
1061
- var G;
1062
- return v.name.toLowerCase().includes(l.toLowerCase()) || ((G = v.description) == null ? void 0 : G.toLowerCase().includes(l.toLowerCase()));
1060
+ (D) => {
1061
+ var U;
1062
+ return D.name.toLowerCase().includes(i.toLowerCase()) || ((U = D.description) == null ? void 0 : U.toLowerCase().includes(i.toLowerCase()));
1063
1063
  }
1064
- ), _ = async () => {
1065
- if (g)
1064
+ ), $ = async () => {
1065
+ if (u)
1066
1066
  try {
1067
- await N.mutateAsync(g.id), o(null), T();
1068
- } catch (v) {
1069
- console.error("Failed to delete group:", v);
1067
+ await v.mutateAsync(u.id), c(null), G();
1068
+ } catch (D) {
1069
+ console.error("Failed to delete group:", D);
1070
1070
  }
1071
- }, q = (v) => {
1072
- u(v), f(!0);
1073
- }, D = () => {
1074
- t("groups"), T();
1071
+ }, N = (D) => {
1072
+ m(D), f(!0);
1073
+ }, F = () => {
1074
+ t("groups"), G();
1075
1075
  };
1076
1076
  return /* @__PURE__ */ n(E, { children: [
1077
- /* @__PURE__ */ e(ie, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(le, { className: "max-w-4xl max-h-[80vh]", children: [
1078
- /* @__PURE__ */ n(ce, { children: [
1079
- /* @__PURE__ */ n(de, { className: "flex items-center gap-2", children: [
1080
- /* @__PURE__ */ e(z, { className: "h-5 w-5" }),
1077
+ /* @__PURE__ */ e(oe, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(ie, { className: "max-w-4xl max-h-[80vh]", children: [
1078
+ /* @__PURE__ */ n(le, { children: [
1079
+ /* @__PURE__ */ n(ce, { className: "flex items-center gap-2", children: [
1080
+ /* @__PURE__ */ e(_, { className: "h-5 w-5" }),
1081
1081
  "Group Management"
1082
1082
  ] }),
1083
- /* @__PURE__ */ e(Ae, { children: "Manage your groups, create new groups, and control group membership" })
1083
+ /* @__PURE__ */ e(Pe, { children: "Manage your groups, create new groups, and control group membership" })
1084
1084
  ] }),
1085
- /* @__PURE__ */ n(Je, { value: a, onValueChange: t, className: "mt-4", children: [
1086
- /* @__PURE__ */ n(Xe, { className: "grid w-full grid-cols-2", children: [
1087
- /* @__PURE__ */ n(ne, { value: "groups", className: "flex items-center gap-2", children: [
1088
- /* @__PURE__ */ e(z, { className: "h-4 w-4" }),
1085
+ /* @__PURE__ */ n(We, { value: a, onValueChange: t, className: "mt-4", children: [
1086
+ /* @__PURE__ */ n(Je, { className: "grid w-full grid-cols-2", children: [
1087
+ /* @__PURE__ */ n(re, { value: "groups", className: "flex items-center gap-2", children: [
1088
+ /* @__PURE__ */ e(_, { className: "h-4 w-4" }),
1089
1089
  "Groups"
1090
1090
  ] }),
1091
- /* @__PURE__ */ n(ne, { value: "create", className: "flex items-center gap-2", children: [
1092
- /* @__PURE__ */ e(Pe, { className: "h-4 w-4" }),
1091
+ /* @__PURE__ */ n(re, { value: "create", className: "flex items-center gap-2", children: [
1092
+ /* @__PURE__ */ e(Le, { className: "h-4 w-4" }),
1093
1093
  "Create Group"
1094
1094
  ] })
1095
1095
  ] }),
1096
- /* @__PURE__ */ e(oe, { value: "groups", className: "mt-4", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
1096
+ /* @__PURE__ */ e(ne, { value: "groups", className: "mt-4", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
1097
1097
  /* @__PURE__ */ n("div", { className: "relative", children: [
1098
- /* @__PURE__ */ e(ve, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1098
+ /* @__PURE__ */ e(be, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1099
1099
  /* @__PURE__ */ e(
1100
1100
  Q,
1101
1101
  {
1102
1102
  placeholder: "Search groups...",
1103
- value: l,
1104
- onChange: (v) => c(v.target.value),
1103
+ value: i,
1104
+ onChange: (D) => o(D.target.value),
1105
1105
  className: "pl-10"
1106
1106
  }
1107
1107
  )
1108
1108
  ] }),
1109
- /* @__PURE__ */ e(Ne, { className: "h-[400px]", children: U ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((v) => /* @__PURE__ */ e(ye, { className: "h-24 w-full" }, v)) }) : A.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1110
- /* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
1109
+ /* @__PURE__ */ e(ve, { className: "h-[400px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Ne, { className: "h-24 w-full" }, D)) }) : A.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1110
+ /* @__PURE__ */ e(_, { className: "h-12 w-12 mb-3 opacity-50" }),
1111
1111
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
1112
- /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
1113
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: A.map((v) => /* @__PURE__ */ e(
1114
- Ha,
1112
+ /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i ? "Try a different search" : "Create your first group to get started" })
1113
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: A.map((D) => /* @__PURE__ */ e(
1114
+ Qa,
1115
1115
  {
1116
- group: v,
1117
- onManageMembers: () => q(v),
1118
- onDelete: () => o(v),
1116
+ group: D,
1117
+ onManageMembers: () => N(D),
1118
+ onDelete: () => c(D),
1119
1119
  currentUserId: b == null ? void 0 : b.id
1120
1120
  },
1121
- v.id
1121
+ D.id
1122
1122
  )) }) })
1123
1123
  ] }) }),
1124
- /* @__PURE__ */ e(oe, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1125
- Ia,
1124
+ /* @__PURE__ */ e(ne, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1125
+ Aa,
1126
1126
  {
1127
- onSuccess: D,
1128
- tenantId: k,
1129
- isTenantUser: y
1127
+ onSuccess: F,
1128
+ tenantId: M,
1129
+ isTenantUser: x
1130
1130
  }
1131
1131
  ) })
1132
1132
  ] })
1133
1133
  ] }) }),
1134
- i && /* @__PURE__ */ e(
1135
- $a,
1134
+ l && /* @__PURE__ */ e(
1135
+ _a,
1136
1136
  {
1137
1137
  open: h,
1138
1138
  onOpenChange: f,
1139
- group: i,
1140
- onUpdate: () => T()
1139
+ group: l,
1140
+ onUpdate: () => G()
1141
1141
  }
1142
1142
  ),
1143
1143
  /* @__PURE__ */ e(
1144
- Os,
1144
+ Rs,
1145
1145
  {
1146
- open: !!g,
1147
- onOpenChange: () => o(null),
1148
- children: /* @__PURE__ */ n(Us, { children: [
1149
- /* @__PURE__ */ n(qs, { children: [
1150
- /* @__PURE__ */ e(zs, { children: "Delete Group" }),
1151
- /* @__PURE__ */ n(_s, { children: [
1146
+ open: !!u,
1147
+ onOpenChange: () => c(null),
1148
+ children: /* @__PURE__ */ n(Os, { children: [
1149
+ /* @__PURE__ */ n(Us, { children: [
1150
+ /* @__PURE__ */ e(qs, { children: "Delete Group" }),
1151
+ /* @__PURE__ */ n(zs, { children: [
1152
1152
  'Are you sure you want to delete "',
1153
- g == null ? void 0 : g.name,
1153
+ u == null ? void 0 : u.name,
1154
1154
  '"? This action cannot be undone and will remove all members from the group.'
1155
1155
  ] })
1156
1156
  ] }),
1157
- /* @__PURE__ */ n($s, { children: [
1158
- /* @__PURE__ */ e(js, { children: "Cancel" }),
1157
+ /* @__PURE__ */ n(_s, { children: [
1158
+ /* @__PURE__ */ e($s, { children: "Cancel" }),
1159
1159
  /* @__PURE__ */ e(
1160
- Vs,
1160
+ js,
1161
1161
  {
1162
- onClick: _,
1163
- disabled: N.isPending,
1162
+ onClick: $,
1163
+ disabled: v.isPending,
1164
1164
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1165
- children: N.isPending ? /* @__PURE__ */ n(E, { children: [
1165
+ children: v.isPending ? /* @__PURE__ */ n(E, { children: [
1166
1166
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
1167
1167
  "Deleting..."
1168
1168
  ] }) : "Delete Group"
@@ -1174,13 +1174,13 @@ function Qa({
1174
1174
  )
1175
1175
  ] });
1176
1176
  }
1177
- function Ha({
1177
+ function Qa({
1178
1178
  group: s,
1179
1179
  onManageMembers: r,
1180
1180
  onDelete: a,
1181
1181
  currentUserId: t
1182
1182
  }) {
1183
- const l = s.createdBy === t;
1183
+ const i = s.createdBy === t;
1184
1184
  return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3", children: [
1185
1185
  /* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
1186
1186
  /* @__PURE__ */ n("div", { children: [
@@ -1189,159 +1189,159 @@ function Ha({
1189
1189
  ] }),
1190
1190
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
1191
1191
  /* @__PURE__ */ n("span", { className: "flex items-center gap-1", children: [
1192
- /* @__PURE__ */ e(z, { className: "h-3 w-3" }),
1192
+ /* @__PURE__ */ e(_, { className: "h-3 w-3" }),
1193
1193
  s.memberCount,
1194
1194
  " ",
1195
1195
  s.memberCount === 1 ? "member" : "members"
1196
1196
  ] }),
1197
1197
  /* @__PURE__ */ n("span", { children: [
1198
1198
  "Created ",
1199
- Qs(new Date(s.createdAt), "MMM d, yyyy")
1199
+ Vs(new Date(s.createdAt), "MMM d, yyyy")
1200
1200
  ] })
1201
1201
  ] })
1202
1202
  ] }),
1203
1203
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
1204
1204
  /* @__PURE__ */ e(
1205
- M,
1205
+ k,
1206
1206
  {
1207
1207
  variant: "ghost",
1208
1208
  size: "sm",
1209
1209
  onClick: r,
1210
1210
  title: "Manage members",
1211
- children: /* @__PURE__ */ e(we, { className: "h-4 w-4" })
1211
+ children: /* @__PURE__ */ e(ye, { className: "h-4 w-4" })
1212
1212
  }
1213
1213
  ),
1214
- l && /* @__PURE__ */ e(
1215
- M,
1214
+ i && /* @__PURE__ */ e(
1215
+ k,
1216
1216
  {
1217
1217
  variant: "ghost",
1218
1218
  size: "sm",
1219
1219
  onClick: a,
1220
1220
  title: "Delete group",
1221
1221
  className: "text-destructive hover:text-destructive",
1222
- children: /* @__PURE__ */ e(Ye, { className: "h-4 w-4" })
1222
+ children: /* @__PURE__ */ e(Xe, { className: "h-4 w-4" })
1223
1223
  }
1224
1224
  )
1225
1225
  ] })
1226
1226
  ] }) });
1227
1227
  }
1228
- function et() {
1229
- var Oe, Ue, qe;
1228
+ function Ya() {
1229
+ var Re, Oe, Ue;
1230
1230
  const {
1231
1231
  authToken: s,
1232
1232
  tokenProps: r,
1233
1233
  id: a
1234
- } = R(), { isLocalDev: t, isConsoleMode: l } = Hs(), { permissions: c } = Bs(), i = Ks(), { isLoading: u } = Ws();
1235
- w((d) => d.theme);
1236
- const h = w((d) => d.lenses), f = w((d) => d.selectedLensId), g = h == null ? void 0 : h.find((d) => d.id === f), o = w((d) => d.dashboard);
1237
- w((d) => d.selectedSheetId);
1238
- const m = w(
1234
+ } = R(), { isLocalDev: t } = Qs(), { permissions: i } = Hs(), o = Bs(), { isLoading: l } = Ks();
1235
+ y((d) => d.theme);
1236
+ const m = y((d) => d.lenses), h = y((d) => d.selectedLensId), f = m == null ? void 0 : m.find((d) => d.id === h), u = y((d) => d.dashboard);
1237
+ y((d) => d.selectedSheetId);
1238
+ const c = y(
1239
1239
  (d) => d.isDashboardEditing
1240
- ), { setDashboardTitle: b } = w((d) => d.actions), [N, y] = x(!1), [k, P] = x(!1), [U, T] = x(!1), A = w((d) => d.isDashboardPanelOpen), _ = w(
1240
+ ), { setDashboardTitle: p } = y((d) => d.actions), [b, v] = w(!1), [x, M] = w(!1), [P, O] = w(!1), G = y((d) => d.isDashboardPanelOpen), A = y(
1241
1241
  (d) => d.actions.setIsDashboardPanelOpen
1242
- ), q = w((d) => d.filterValues), D = w((d) => d.isVisualEditing);
1243
- $e((d) => d.card);
1244
- const v = ae(
1242
+ ), $ = y((d) => d.filterValues), N = y((d) => d.isVisualEditing);
1243
+ _e((d) => d.card);
1244
+ const F = se(
1245
1245
  (d) => d.selectedDashboard
1246
- ), G = ae(
1246
+ ), D = se(
1247
1247
  (d) => d.initialDashboard
1248
1248
  );
1249
- ae((d) => d.selectedVisual), w((d) => d.selectedFrameId), $e((d) => d.frame);
1250
- const B = v ? (Ue = v == null ? void 0 : v.permissions) == null ? void 0 : Ue.canEdit : (Oe = G == null ? void 0 : G.permissions) == null ? void 0 : Oe.canEdit, he = w((d) => d.showFilters), pe = w(
1249
+ se((d) => d.selectedVisual), y((d) => d.selectedFrameId), _e((d) => d.frame);
1250
+ const U = F ? (Oe = F == null ? void 0 : F.permissions) == null ? void 0 : Oe.canEdit : (Re = D == null ? void 0 : D.permissions) == null ? void 0 : Re.canEdit, me = y((d) => d.showFilters), he = y(
1251
1251
  (d) => d.showDashboardJSON
1252
- ), p = w((d) => d.onSaveFunction), L = w(
1252
+ ), B = y((d) => d.onSaveFunction), g = y(
1253
1253
  (d) => d.actions.setShowFilters
1254
- ), { setIsDashboardEditing: I, setShowDashboardJSON: O } = w(
1254
+ ), { setIsDashboardEditing: L, setShowDashboardJSON: I } = y(
1255
1255
  (d) => d.actions
1256
- ), { setInitialDashboard: K, clearSelectedDashboard: Z } = ae(
1256
+ ), { setInitialDashboard: q, clearSelectedDashboard: Y } = se(
1257
1257
  (d) => d.actions
1258
- ), { resources: $ } = Js(be.DASHBOARD), { currentUser: ds } = es(), us = Xs(ds), j = v || G, Ge = j ? {
1258
+ ), { resources: z } = Ws(fe.DASHBOARD), { currentUser: cs } = Ze(), ds = Js(cs), j = F || D, Te = j ? {
1259
1259
  id: j.id,
1260
- title: (o == null ? void 0 : o.title) || j.title || "Dashboard"
1261
- } : null, { handleAddNewFrame: ms } = Ys(), [ge, fe] = x(!1), ee = Zs(be.DASHBOARD), hs = async (d, F) => {
1262
- if (!(o != null && o.id)) {
1260
+ title: (u == null ? void 0 : u.title) || j.title || "Dashboard"
1261
+ } : null, { handleAddNewFrame: us } = Xs(), [pe, ge] = w(!1), Z = Ys(fe.DASHBOARD), ms = async (d, T) => {
1262
+ if (!(u != null && u.id)) {
1263
1263
  console.log("No dashboard ID found");
1264
1264
  return;
1265
1265
  }
1266
1266
  console.log("Updating dashboard title:", {
1267
- dashboardId: o.id,
1267
+ dashboardId: u.id,
1268
1268
  newTitle: d,
1269
- previousTitle: F
1270
- }), ee.mutate(
1269
+ previousTitle: T
1270
+ }), Z.mutate(
1271
1271
  {
1272
- resourceId: o.id,
1272
+ resourceId: u.id,
1273
1273
  data: { title: d }
1274
1274
  },
1275
1275
  {
1276
1276
  onSuccess: () => {
1277
1277
  console.log("Dashboard title updated successfully"), C.success("Dashboard title updated");
1278
1278
  },
1279
- onError: (W) => {
1280
- console.error("Failed to update dashboard title:", W), C.error("Failed to update dashboard title"), b(F);
1279
+ onError: (K) => {
1280
+ console.error("Failed to update dashboard title:", K), C.error("Failed to update dashboard title"), p(T);
1281
1281
  }
1282
1282
  }
1283
1283
  );
1284
1284
  };
1285
- ia(() => {
1286
- if ($ && $.length > 0) {
1287
- const d = o == null ? void 0 : o.id;
1285
+ oa(() => {
1286
+ if (z && z.length > 0) {
1287
+ const d = u == null ? void 0 : u.id;
1288
1288
  if (d) {
1289
- const F = $.find(
1290
- (W) => W.id === d
1289
+ const T = z.find(
1290
+ (K) => K.id === d
1291
1291
  );
1292
- F && K(F);
1292
+ T && q(T);
1293
1293
  }
1294
1294
  }
1295
- }, [$, o == null ? void 0 : o.id, K]);
1296
- const se = r.orgUserId || r.tenantId, ps = m && !D && se && B, gs = () => {
1297
- I(!0);
1295
+ }, [z, u == null ? void 0 : u.id, q]);
1296
+ const ee = r.orgUserId || r.tenantId, hs = c && !N && ee && U, ps = () => {
1297
+ L(!0);
1298
1298
  };
1299
- async function fs() {
1300
- const d = xe(
1301
- o
1299
+ async function gs() {
1300
+ const d = we(
1301
+ u
1302
1302
  );
1303
- fe(!0);
1304
- const F = {
1303
+ ge(!0);
1304
+ const T = {
1305
1305
  template: d
1306
1306
  };
1307
- ee.mutate(
1307
+ Z.mutate(
1308
1308
  {
1309
1309
  resourceId: d.id,
1310
- data: F
1310
+ data: T
1311
1311
  },
1312
1312
  {
1313
1313
  onSuccess: () => {
1314
- fe(!1), C.success("Dashboard saved!");
1314
+ ge(!1), C.success("Dashboard saved!");
1315
1315
  },
1316
1316
  onError: () => {
1317
- fe(!1), C.error("Failed to save dashboard");
1317
+ ge(!1), C.error("Failed to save dashboard");
1318
1318
  }
1319
1319
  }
1320
1320
  );
1321
1321
  }
1322
- async function bs() {
1323
- if (y(!0), !f || !g) return;
1324
- const d = xe(
1325
- o
1326
- ), F = JSON.stringify(d), W = {
1327
- ...g,
1328
- template: F,
1329
- filterValues: q
1322
+ async function fs() {
1323
+ if (v(!0), !h || !f) return;
1324
+ const d = we(
1325
+ u
1326
+ ), T = JSON.stringify(d), K = {
1327
+ ...f,
1328
+ template: T,
1329
+ filterValues: $
1330
1330
  };
1331
- await De(
1331
+ await xe(
1332
1332
  r.apiServiceUrl,
1333
- W,
1333
+ K,
1334
1334
  s == null ? void 0 : s.accessToken
1335
- ), C.success("Lens saved"), p == null || p(d), y(!1);
1335
+ ), C.success("Lens saved"), B == null || B(d), v(!1);
1336
1336
  }
1337
- const Re = (g == null ? void 0 : g.name) || o.title;
1338
- ee.isPending && console.log("Title during update:", {
1339
- title: Re,
1340
- dashboardStateTitle: o.title,
1341
- dashboardId: o == null ? void 0 : o.id,
1342
- currentLensName: g == null ? void 0 : g.name
1337
+ const Ge = (f == null ? void 0 : f.name) || u.title;
1338
+ Z.isPending && console.log("Title during update:", {
1339
+ title: Ge,
1340
+ dashboardStateTitle: u.title,
1341
+ dashboardId: u == null ? void 0 : u.id,
1342
+ currentLensName: f == null ? void 0 : f.name
1343
1343
  });
1344
- const vs = $ && $.length > 0 && (r.orgUserId || r.tenantId && r.endUserId && r.endUserEmail), Ns = v && !(r != null && r.dashboard_id) && !a;
1344
+ const bs = r.orgUserId || r.tenantId && r.endUserId && r.endUserEmail, vs = F && !(r != null && r.dashboard_id) && !a;
1345
1345
  return /* @__PURE__ */ n(
1346
1346
  "div",
1347
1347
  {
@@ -1349,192 +1349,192 @@ function et() {
1349
1349
  role: "dashboard-controls",
1350
1350
  children: [
1351
1351
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1352
- vs && /* @__PURE__ */ n(E, { children: [
1352
+ bs && /* @__PURE__ */ n(E, { children: [
1353
1353
  /* @__PURE__ */ e(
1354
1354
  V,
1355
1355
  {
1356
1356
  "aria-label": "Manage Dashboards",
1357
1357
  tooltip: "Manage Dashboards",
1358
1358
  onClick: () => {
1359
- _(!A);
1359
+ A(!G);
1360
1360
  },
1361
1361
  className: "h-7 p-2",
1362
- children: /* @__PURE__ */ e(ma, { className: "h-4 w-4" })
1362
+ children: /* @__PURE__ */ e(ua, { className: "h-4 w-4" })
1363
1363
  }
1364
1364
  ),
1365
- Ns && !D && /* @__PURE__ */ e(
1365
+ vs && !N && /* @__PURE__ */ e(
1366
1366
  V,
1367
1367
  {
1368
1368
  "aria-label": "Dashboard Hub",
1369
1369
  tooltip: "Dashboard Hub",
1370
- onClick: () => Z(),
1370
+ onClick: () => Y(),
1371
1371
  className: "h-7 p-2",
1372
- children: /* @__PURE__ */ e(Be, { className: "h-4 w-4" })
1372
+ children: /* @__PURE__ */ e(He, { className: "h-4 w-4" })
1373
1373
  }
1374
1374
  )
1375
1375
  ] }),
1376
- !D && i && (u ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1376
+ !N && o && (l ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1377
1377
  /* @__PURE__ */ e(H, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
1378
1378
  /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
1379
1379
  ] }) : /* @__PURE__ */ e(
1380
- ea,
1380
+ Zs,
1381
1381
  {
1382
- value: Re || "Untitled Dashboard",
1382
+ value: Ge || "Untitled Dashboard",
1383
1383
  onSave: (d) => {
1384
1384
  console.log("EditableText onSave called:", {
1385
1385
  newTitle: d,
1386
- canEditDashboard: B,
1387
- dashboardId: o == null ? void 0 : o.id
1386
+ canEditDashboard: U,
1387
+ dashboardId: u == null ? void 0 : u.id
1388
1388
  });
1389
- const F = (o == null ? void 0 : o.title) || "";
1390
- b(d), hs(d, F);
1389
+ const T = (u == null ? void 0 : u.title) || "";
1390
+ p(d), ms(d, T);
1391
1391
  },
1392
- isEditable: B && !g,
1392
+ isEditable: U && !f,
1393
1393
  displayClassName: "text-sm font-medium",
1394
1394
  inputClassName: "text-sm font-medium",
1395
1395
  placeholder: "Dashboard Title",
1396
- isPending: ee.isPending
1396
+ isPending: Z.isPending
1397
1397
  }
1398
1398
  ))
1399
1399
  ] }),
1400
1400
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1401
- D && /* @__PURE__ */ n(E, { children: [
1402
- /* @__PURE__ */ e(la, { className: "mr-2" }),
1403
- /* @__PURE__ */ e(ca, { className: "h-7" })
1401
+ N && /* @__PURE__ */ n(E, { children: [
1402
+ /* @__PURE__ */ e(ia, { className: "mr-2" }),
1403
+ /* @__PURE__ */ e(la, { className: "h-7" })
1404
1404
  ] }),
1405
- t && !D && /* @__PURE__ */ e(
1405
+ t && !N && /* @__PURE__ */ e(
1406
1406
  V,
1407
1407
  {
1408
1408
  tooltip: "Invalidate Token",
1409
- onClick: () => sa(r.apiServiceUrl),
1409
+ onClick: () => ea(r.apiServiceUrl),
1410
1410
  className: "h-7 p-2",
1411
- children: /* @__PURE__ */ e(pa, { className: "h-4 w-4" })
1411
+ children: /* @__PURE__ */ e(ha, { className: "h-4 w-4" })
1412
1412
  }
1413
1413
  ),
1414
- !D && i && /* @__PURE__ */ e(xa, {}),
1415
- !D && i && /* @__PURE__ */ e(da, {}),
1416
- !D && i && us && /* @__PURE__ */ e(
1414
+ !N && o && /* @__PURE__ */ e(wa, {}),
1415
+ !N && o && /* @__PURE__ */ e(ca, {}),
1416
+ !N && o && ds && /* @__PURE__ */ e(
1417
1417
  V,
1418
1418
  {
1419
1419
  tooltip: "Manage Groups",
1420
- onClick: () => T(!0),
1420
+ onClick: () => O(!0),
1421
1421
  className: "h-7 p-2",
1422
- children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
1422
+ children: /* @__PURE__ */ e(_, { className: "h-4 w-4" })
1423
1423
  }
1424
1424
  ),
1425
- !D && i && ((qe = j == null ? void 0 : j.permissions) == null ? void 0 : qe.canShare) && /* @__PURE__ */ e(
1425
+ !N && o && ((Ue = j == null ? void 0 : j.permissions) == null ? void 0 : Ue.canShare) && /* @__PURE__ */ e(
1426
1426
  V,
1427
1427
  {
1428
1428
  tooltip: "Share Dashboard",
1429
- onClick: () => P(!0),
1429
+ onClick: () => M(!0),
1430
1430
  className: "h-7 p-2",
1431
- children: /* @__PURE__ */ e(aa, { className: "h-4 w-4" })
1431
+ children: /* @__PURE__ */ e(sa, { className: "h-4 w-4" })
1432
1432
  }
1433
1433
  ),
1434
- !he && !D && m && c.canUseFilters && i && /* @__PURE__ */ e(
1435
- M,
1434
+ !me && !N && c && i.canUseFilters && o && /* @__PURE__ */ e(
1435
+ k,
1436
1436
  {
1437
1437
  className: "h-7 p-2",
1438
1438
  variant: "outline",
1439
- onClick: () => L(!0),
1439
+ onClick: () => g(!0),
1440
1440
  size: "sm",
1441
- children: /* @__PURE__ */ e(ta, { className: "h-4 w-4" })
1441
+ children: /* @__PURE__ */ e(aa, { className: "h-4 w-4" })
1442
1442
  }
1443
1443
  ),
1444
- m && !D && se && t && i && /* @__PURE__ */ e(ya, {}),
1445
- !D && se && t && i && /* @__PURE__ */ e(wa, {}),
1446
- m && !D && se && g && t && i && /* @__PURE__ */ n(
1447
- M,
1444
+ c && !N && ee && t && o && /* @__PURE__ */ e(Na, {}),
1445
+ !N && ee && t && o && /* @__PURE__ */ e(ya, {}),
1446
+ c && !N && ee && f && t && o && /* @__PURE__ */ n(
1447
+ k,
1448
1448
  {
1449
1449
  className: "h-7 p-2",
1450
1450
  variant: "secondary",
1451
- disabled: N,
1452
- onClick: bs,
1451
+ disabled: b,
1452
+ onClick: fs,
1453
1453
  size: "sm",
1454
1454
  children: [
1455
- /* @__PURE__ */ e(je, { className: "mr-2 h-4 w-4" }),
1455
+ /* @__PURE__ */ e($e, { className: "mr-2 h-4 w-4" }),
1456
1456
  "Save Lens"
1457
1457
  ]
1458
1458
  }
1459
1459
  ),
1460
- m && !D && i && /* @__PURE__ */ n(
1461
- M,
1460
+ c && !N && o && /* @__PURE__ */ n(
1461
+ k,
1462
1462
  {
1463
1463
  variant: "outline",
1464
1464
  className: "h-7 p-2",
1465
1465
  size: "sm",
1466
- disabled: !m,
1467
- onClick: () => ms(),
1466
+ disabled: !c,
1467
+ onClick: () => us(),
1468
1468
  children: [
1469
- /* @__PURE__ */ e(Pe, { className: "mr-2 h-4 w-4" }),
1469
+ /* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
1470
1470
  "Visual"
1471
1471
  ]
1472
1472
  }
1473
1473
  ),
1474
- !D && !m && c.canEdit && i && /* @__PURE__ */ n(
1475
- M,
1474
+ !N && !c && i.canEdit && o && /* @__PURE__ */ n(
1475
+ k,
1476
1476
  {
1477
1477
  variant: "outline",
1478
1478
  className: "h-7 p-2",
1479
- onClick: gs,
1479
+ onClick: ps,
1480
1480
  size: "sm",
1481
1481
  children: [
1482
- /* @__PURE__ */ e(ra, { className: "mr-2 h-4 w-4" }),
1482
+ /* @__PURE__ */ e(ta, { className: "mr-2 h-4 w-4" }),
1483
1483
  "Edit"
1484
1484
  ]
1485
1485
  }
1486
1486
  ),
1487
- ps && i && /* @__PURE__ */ n(
1488
- M,
1487
+ hs && o && /* @__PURE__ */ n(
1488
+ k,
1489
1489
  {
1490
1490
  className: "h-7 p-2",
1491
- disabled: ge,
1492
- onClick: fs,
1491
+ disabled: pe,
1492
+ onClick: gs,
1493
1493
  size: "sm",
1494
1494
  children: [
1495
- ge ? /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(je, { className: "mr-2 h-4 w-4" }),
1496
- ge ? "Saving..." : "Save"
1495
+ pe ? /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e($e, { className: "mr-2 h-4 w-4" }),
1496
+ pe ? "Saving..." : "Save"
1497
1497
  ]
1498
1498
  }
1499
1499
  ),
1500
- !D && m && t && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1501
- M,
1500
+ !N && c && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1501
+ k,
1502
1502
  {
1503
1503
  className: "h-7 p-2",
1504
- onClick: () => O(!pe),
1504
+ onClick: () => I(!he),
1505
1505
  size: "sm",
1506
1506
  variant: "ghost",
1507
- children: /* @__PURE__ */ e(na, { className: "h-4 w-4" })
1507
+ children: /* @__PURE__ */ e(ra, { className: "h-4 w-4" })
1508
1508
  }
1509
1509
  ) }),
1510
- !D && t && /* @__PURE__ */ e(ba, {}),
1511
- m && !D && i && /* @__PURE__ */ n(
1512
- M,
1510
+ !N && t && /* @__PURE__ */ e(fa, {}),
1511
+ c && !N && o && /* @__PURE__ */ n(
1512
+ k,
1513
1513
  {
1514
1514
  variant: "outline",
1515
1515
  className: "h-7 p-2",
1516
1516
  onClick: () => {
1517
- I(!1), O(!1);
1517
+ L(!1), I(!1);
1518
1518
  },
1519
1519
  children: [
1520
- /* @__PURE__ */ e(Ke, { className: "mr-2 h-4 w-4" }),
1520
+ /* @__PURE__ */ e(Be, { className: "mr-2 h-4 w-4" }),
1521
1521
  "Close"
1522
1522
  ]
1523
1523
  }
1524
1524
  ),
1525
- k && Ge && /* @__PURE__ */ e(
1526
- oa,
1525
+ x && Te && /* @__PURE__ */ e(
1526
+ na,
1527
1527
  {
1528
- resource: Ge,
1529
- resourceType: be.DASHBOARD,
1530
- onClose: () => P(!1)
1528
+ resource: Te,
1529
+ resourceType: fe.DASHBOARD,
1530
+ onClose: () => M(!1)
1531
1531
  }
1532
1532
  ),
1533
1533
  /* @__PURE__ */ e(
1534
- Qa,
1534
+ Va,
1535
1535
  {
1536
- open: U,
1537
- onOpenChange: T
1536
+ open: P,
1537
+ onOpenChange: O
1538
1538
  }
1539
1539
  )
1540
1540
  ] })
@@ -1543,5 +1543,5 @@ function et() {
1543
1543
  );
1544
1544
  }
1545
1545
  export {
1546
- et as default
1546
+ Ya as default
1547
1547
  };