react-semaphor 0.1.165 → 0.1.166

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-B9UPzyO5.js +26 -0
  2. package/dist/chunks/{dashboard-controls-BA7vyPHM.js → dashboard-controls-CixEPYYv.js} +273 -298
  3. package/dist/chunks/{dashboard-json-C8YFsFVt.js → dashboard-json-BYNwk3YG.js} +1 -1
  4. package/dist/chunks/{dashboard-json-B4UTFvyR.js → dashboard-json-LXUW-x_7.js} +1 -1
  5. package/dist/chunks/{edit-dashboard-visual-BMBiT_V_.js → edit-dashboard-visual-CyW3aGrM.js} +1 -1
  6. package/dist/chunks/{edit-dashboard-visual-DKqjPVRM.js → edit-dashboard-visual-DtiYOHX5.js} +2 -2
  7. package/dist/chunks/{editor-action-buttons-De18jUjn.js → editor-action-buttons-C2VJa0cF.js} +2 -2
  8. package/dist/chunks/{editor-action-buttons-xrbSWcSm.js → editor-action-buttons-CFZZpeDq.js} +1 -1
  9. package/dist/chunks/{index-odiH0LJA.js → index-CQ7RRL9U.js} +167 -167
  10. package/dist/chunks/{index-5dE6RqWv.js → index-DYeBGt71.js} +13920 -13687
  11. package/dist/chunks/{resource-management-panel-CjWRsuif.js → resource-management-panel-DJOLQsLL.js} +128 -128
  12. package/dist/chunks/{resource-management-panel-CK-wL4Jy.js → resource-management-panel-qqHHN4xT.js} +1 -1
  13. package/dist/chunks/schedule-dashboard-B5cLQ2sk.js +6 -0
  14. package/dist/chunks/schedule-dashboard-B9Y23qK6.js +416 -0
  15. package/dist/chunks/{use-role-aware-display-preferences-Bj_-I3oD.js → use-role-aware-display-preferences-8gWJAMO3.js} +1 -1
  16. package/dist/chunks/{use-role-aware-display-preferences-Cm7hg_Us.js → use-role-aware-display-preferences-BJCLNjn8.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-Du173Ucu.js → use-visual-utils-Bsvc2KNu.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-DwnVUHSd.js → use-visual-utils-DA9bk0Rh.js} +10 -10
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +2 -2
  22. package/dist/index.js +58 -58
  23. package/dist/surfboard/index.cjs +1 -1
  24. package/dist/surfboard/index.js +1 -1
  25. package/dist/types/dashboard.d.ts +5 -0
  26. package/dist/types/main.d.ts +5 -0
  27. package/dist/types/surfboard.d.ts +5 -0
  28. package/dist/types/types.d.ts +5 -0
  29. package/package.json +1 -1
  30. package/dist/chunks/dashboard-controls-CEnWdjuE.js +0 -26
  31. package/dist/chunks/dashboard-export-dialog-9nJsWzgJ.js +0 -6
  32. package/dist/chunks/dashboard-export-dialog-CEVJnrSj.js +0 -602
@@ -1,15 +1,15 @@
1
1
  import { jsx as e, jsxs as a, Fragment as ge } from "react/jsx-runtime";
2
- import { l as Ze, u as me, n as $e, aA as re, bg as Qe, bh as Xe, c as Q, bi as ke, aR as et, aS as tt, B as _, aT as st, aU as at, aV as J, bj as pe, L as oe, bk as nt, bl as it, bm as rt, bn as ve, bo as De, bp as ot, bq as lt, K as dt, br as ye, e as le, bs as Se, bt as Ee, bu as ct, _ as Ve, V as Le, bv as Ae, aZ as Re, a_ as Te, a$ as Oe, b1 as Pe, b2 as Ue, b3 as Ie, b4 as je, b5 as Fe, bw as ut, bx as ht, by as Me, bz as ze, bA as Be, bB as mt, bC as He, bD as pt, R as ne, az as ft, bE as _e, bF as gt, bG as Dt, aE as xt, aF as Nt, aG as bt, aH as wt, aI as vt, aJ as Ce, aK as fe, aN as Ct, bH as yt, bI as St, bJ as Et, bK as Vt } from "./index-5dE6RqWv.js";
2
+ import { l as $e, u as me, n as Qe, aB as re, b9 as Xe, ba as Ze, c as X, bb as ke, aS as et, aT as tt, B as _, aU as st, aV as at, aW as W, bc as pe, L as oe, bd as nt, be as it, bf as rt, bg as ve, bh as De, bi as ot, bj as lt, K as dt, bk as ye, e as le, bl as Se, bm as Ve, bn as ct, _ as Ee, V as Le, bo as Ae, a_ as Te, a$ as Oe, b0 as Re, b2 as Pe, b3 as Ue, b4 as Ie, b5 as je, b6 as Me, bp as ut, bq as ht, br as Fe, bs as Be, bt as ze, bu as mt, bv as He, bw as pt, R as ne, aA as ft, bx as _e, by as gt, bz as Dt, aF as xt, aG as Nt, aH as bt, aI as wt, aJ as vt, aK as Ce, aL as fe, aO as Ct, bA as yt, bB as St, bC as Vt, bD as Et } from "./index-DYeBGt71.js";
3
3
  import Lt, { useRef as At, useEffect as ie, useState as x } from "react";
4
- import { a as Ke } from "./use-visual-utils-DwnVUHSd.js";
5
- import { u as Rt } from "./use-role-aware-display-preferences-Cm7hg_Us.js";
4
+ import { a as Ke } from "./use-visual-utils-DA9bk0Rh.js";
5
+ import { u as Tt } from "./use-role-aware-display-preferences-BJCLNjn8.js";
6
6
  /**
7
7
  * @license lucide-react v0.453.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
11
  */
12
- const Tt = Ze("FolderOpen", [
12
+ const Ot = $e("FolderOpen", [
13
13
  [
14
14
  "path",
15
15
  {
@@ -18,7 +18,7 @@ const Tt = Ze("FolderOpen", [
18
18
  }
19
19
  ]
20
20
  ]);
21
- function Ot(t, f = {}) {
21
+ function Rt(t, f = {}) {
22
22
  const { enabled: h = !0, eventType: r = "mousedown" } = f, o = At(null);
23
23
  return ie(() => {
24
24
  const g = (D) => {
@@ -47,7 +47,7 @@ function Ge() {
47
47
  )) });
48
48
  }
49
49
  const Pt = (t) => {
50
- const f = me((o) => o.isVisualEditing), h = me((o) => o.selectedFrameId), r = $e((o) => o.frame);
50
+ const f = me((o) => o.isVisualEditing), h = me((o) => o.selectedFrameId), r = Qe((o) => o.frame);
51
51
  return !!(f && h && (r == null ? void 0 : r.visualId) === t);
52
52
  };
53
53
  function Ut({
@@ -63,12 +63,12 @@ function Ut({
63
63
  onShareVisual: N,
64
64
  formatDate: y
65
65
  }) {
66
- var R, S, P, v;
67
- const { selectVisual: d } = re(), c = Qe(t.id), m = Pt(t.id), { isConsoleMode: E } = Xe(), V = Lt.useRef(null), [w, C] = x(!1), [L, A] = x(!1);
66
+ var T, S, P, v;
67
+ const { selectVisual: d } = re(), c = Xe(t.id), m = Pt(t.id), { isConsoleMode: V } = Ze(), E = Lt.useRef(null), [w, C] = x(!1), [L, A] = x(!1);
68
68
  ie(() => {
69
69
  h ? (C(!0), A(!0)) : L && (C(!1), A(!1));
70
70
  }, [h, L]), ie(() => {
71
- m && V.current && V.current.scrollIntoView({
71
+ m && E.current && E.current.scrollIntoView({
72
72
  behavior: "smooth",
73
73
  block: "center"
74
74
  });
@@ -79,8 +79,8 @@ function Ut({
79
79
  return /* @__PURE__ */ a(
80
80
  "div",
81
81
  {
82
- ref: V,
83
- className: Q(
82
+ ref: E,
83
+ className: X(
84
84
  "group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
85
85
  m ? "bg-purple-500/10" : c && "bg-muted/80"
86
86
  ),
@@ -102,7 +102,7 @@ function Ut({
102
102
  {
103
103
  className: "truncate text-xs text-muted-foreground",
104
104
  title: t.description || "No description",
105
- children: (R = t.description) != null && R.trim() ? t.description : "No description"
105
+ children: (T = t.description) != null && T.trim() ? t.description : "No description"
106
106
  }
107
107
  )
108
108
  ] }),
@@ -122,7 +122,7 @@ function Ut({
122
122
  /* @__PURE__ */ e(tt, { asChild: !0, children: /* @__PURE__ */ e(_, { size: "sm", variant: "ghost", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e(st, { className: "h-3 w-3" }) }) }),
123
123
  /* @__PURE__ */ a(at, { align: "end", className: "z-[51] w-40", children: [
124
124
  /* @__PURE__ */ a(
125
- J,
125
+ W,
126
126
  {
127
127
  onClick: (p) => {
128
128
  p.stopPropagation(), r(t);
@@ -134,19 +134,19 @@ function Ut({
134
134
  }
135
135
  ),
136
136
  /* @__PURE__ */ a(
137
- J,
137
+ W,
138
138
  {
139
139
  onClick: (p) => {
140
140
  p.stopPropagation(), o == null || o(t);
141
141
  },
142
142
  children: [
143
- /* @__PURE__ */ e(Tt, { className: "mr-2 h-3 w-3" }),
143
+ /* @__PURE__ */ e(Ot, { className: "mr-2 h-3 w-3" }),
144
144
  "Open"
145
145
  ]
146
146
  }
147
147
  ),
148
148
  /* @__PURE__ */ a(
149
- J,
149
+ W,
150
150
  {
151
151
  onClick: (p) => {
152
152
  p.preventDefault(), p.stopPropagation(), i(t.id);
@@ -160,7 +160,7 @@ function Ut({
160
160
  ),
161
161
  t.ownership.isOwner && /* @__PURE__ */ a(ge, { children: [
162
162
  /* @__PURE__ */ a(
163
- J,
163
+ W,
164
164
  {
165
165
  onClick: (p) => {
166
166
  p.stopPropagation(), g == null || g(t);
@@ -172,7 +172,7 @@ function Ut({
172
172
  }
173
173
  ),
174
174
  /* @__PURE__ */ a(
175
- J,
175
+ W,
176
176
  {
177
177
  onClick: (p) => {
178
178
  p.stopPropagation(), N(t);
@@ -185,7 +185,7 @@ function Ut({
185
185
  ),
186
186
  /* @__PURE__ */ e(ve, {}),
187
187
  /* @__PURE__ */ a(
188
- J,
188
+ W,
189
189
  {
190
190
  onClick: (p) => {
191
191
  p.stopPropagation(), D(t);
@@ -201,7 +201,7 @@ function Ut({
201
201
  ] }),
202
202
  /* @__PURE__ */ e(ve, {}),
203
203
  /* @__PURE__ */ a("div", { className: "space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400", children: [
204
- (((S = t.ownership.createdBy) == null ? void 0 : S.type) === "tenant" || ((P = t.ownership.createdBy) == null ? void 0 : P.type) === "organization" && E) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
204
+ (((S = t.ownership.createdBy) == null ? void 0 : S.type) === "tenant" || ((P = t.ownership.createdBy) == null ? void 0 : P.type) === "organization" && V) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
205
205
  /* @__PURE__ */ e(ot, { className: "h-3 w-3" }),
206
206
  /* @__PURE__ */ e("span", { children: ((v = t.ownership.createdBy) == null ? void 0 : v.name) || "Unknown" })
207
207
  ] }),
@@ -243,27 +243,27 @@ function It({ searchQuery: t }) {
243
243
  null
244
244
  ), [g, D] = x(!1), [i, N] = x(null), [y, d] = x(null), [c, m] = x(
245
245
  null
246
- ), { selectVisual: E } = re(), { handleEditLibraryVisual: V, handleAddLibraryVisual: w } = Ke(), {
246
+ ), { selectVisual: V } = re(), { handleEditLibraryVisual: E, handleAddLibraryVisual: w } = Ke(), {
247
247
  resources: C,
248
248
  isLoading: L,
249
249
  isError: A,
250
250
  isFetching: j,
251
- updateResource: R,
251
+ updateResource: T,
252
252
  deleteResource: S,
253
253
  duplicateResource: P,
254
254
  isDeleting: v,
255
255
  isDuplicating: p,
256
- isUpdating: z
256
+ isUpdating: B
257
257
  } = ye(() => {
258
258
  D(!1), N(null);
259
259
  });
260
260
  le();
261
- const X = C.filter(
261
+ const Z = C.filter(
262
262
  (n) => {
263
- var T, l;
264
- return ((T = n == null ? void 0 : n.title) == null ? void 0 : T.toLowerCase().includes(t.toLowerCase())) || ((l = n == null ? void 0 : n.description) == null ? void 0 : l.toLowerCase().includes(t.toLowerCase()));
263
+ var O, l;
264
+ return ((O = n == null ? void 0 : n.title) == null ? void 0 : O.toLowerCase().includes(t.toLowerCase())) || ((l = n == null ? void 0 : n.description) == null ? void 0 : l.toLowerCase().includes(t.toLowerCase()));
265
265
  }
266
- ), F = (n) => new Date(n).toLocaleDateString("en-US", {
266
+ ), M = (n) => new Date(n).toLocaleDateString("en-US", {
267
267
  month: "short",
268
268
  day: "numeric",
269
269
  year: "numeric"
@@ -273,19 +273,19 @@ function It({ searchQuery: t }) {
273
273
  i && S(i.id);
274
274
  }, {
275
275
  startUpdating: k,
276
- stopUpdating: O,
276
+ stopUpdating: R,
277
277
  isUpdating: ee
278
- } = Se(), te = (n, T, l) => {
278
+ } = Se(), te = (n, O, l) => {
279
279
  var ae;
280
280
  const Y = Object.fromEntries(
281
- Object.entries(T).filter(([, I]) => I !== void 0)
281
+ Object.entries(O).filter(([, I]) => I !== void 0)
282
282
  );
283
283
  if (Object.keys(Y).length === 0) {
284
284
  (ae = l == null ? void 0 : l.onSuccess) == null || ae.call(l);
285
285
  return;
286
286
  }
287
- const Z = Object.keys(Y), $ = Z.length === 1 ? Z[0] : void 0;
288
- k(n, $), R(
287
+ const $ = Object.keys(Y), Q = $.length === 1 ? $[0] : void 0;
288
+ k(n, Q), T(
289
289
  {
290
290
  resourceId: n,
291
291
  data: Y
@@ -293,31 +293,31 @@ function It({ searchQuery: t }) {
293
293
  {
294
294
  onSuccess: () => {
295
295
  var I;
296
- O(n, $), (I = l == null ? void 0 : l.onSuccess) == null || I.call(l);
296
+ R(n, Q), (I = l == null ? void 0 : l.onSuccess) == null || I.call(l);
297
297
  },
298
298
  onError: () => {
299
299
  var I;
300
- O(n, $), (I = l == null ? void 0 : l.onError) == null || I.call(l);
300
+ R(n, Q), (I = l == null ? void 0 : l.onError) == null || I.call(l);
301
301
  }
302
302
  }
303
303
  );
304
- }, B = (n) => {
304
+ }, z = (n) => {
305
305
  d(n), P(n, {
306
306
  onSettled: () => d(null)
307
307
  });
308
- }, M = (n) => {
309
- V(n);
308
+ }, F = (n) => {
309
+ E(n);
310
310
  }, G = (n) => {
311
311
  w(n);
312
312
  }, b = (n) => {
313
- const T = C.find((l) => l.id === n);
314
- T && R({
313
+ const O = C.find((l) => l.id === n);
314
+ O && T({
315
315
  resourceId: n,
316
316
  data: {
317
- isPrivate: !T.isPrivate
317
+ isPrivate: !O.isPrivate
318
318
  }
319
319
  });
320
- }, W = (n) => {
320
+ }, J = (n) => {
321
321
  o(n), h(!0);
322
322
  }, se = (n) => {
323
323
  m(n);
@@ -325,18 +325,18 @@ function It({ searchQuery: t }) {
325
325
  m(null);
326
326
  }, ce = ({
327
327
  title: n,
328
- description: T
328
+ description: O
329
329
  }) => {
330
330
  if (!c)
331
331
  return;
332
332
  const l = {};
333
- n !== c.title && (l.title = n), (c.description || "") !== T && (l.description = T), te(c.id, l, {
333
+ n !== c.title && (l.title = n), (c.description || "") !== O && (l.description = O), te(c.id, l, {
334
334
  onSuccess: () => {
335
335
  m(null);
336
336
  }
337
337
  });
338
338
  };
339
- return L ? /* @__PURE__ */ e(Ge, {}) : A ? /* @__PURE__ */ e(Ee, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
339
+ return L ? /* @__PURE__ */ e(Ge, {}) : A ? /* @__PURE__ */ e(Ve, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
340
340
  /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
341
341
  /* @__PURE__ */ e(
342
342
  _,
@@ -349,29 +349,29 @@ function It({ searchQuery: t }) {
349
349
  }
350
350
  )
351
351
  ] }) }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
352
- /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: X.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
352
+ /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: Z.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
353
353
  /* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(ct, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
354
354
  /* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: t ? "No visuals found" : "No visuals yet" }),
355
355
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t ? "Try adjusting your search" : 'Click "Create" above to add your first visual' })
356
- ] }) : X.map((n) => /* @__PURE__ */ e(
356
+ ] }) : Z.map((n) => /* @__PURE__ */ e(
357
357
  Ut,
358
358
  {
359
359
  visual: n,
360
360
  onAddVisual: G,
361
- onOpenVisual: M,
361
+ onOpenVisual: F,
362
362
  onEditDetails: se,
363
363
  onDeleteClick: q,
364
- onDuplicateVisual: B,
364
+ onDuplicateVisual: z,
365
365
  onTogglePrivacy: b,
366
- onShareVisual: W,
366
+ onShareVisual: J,
367
367
  isDeleting: v,
368
368
  isDuplicating: y === n.id,
369
- formatDate: F
369
+ formatDate: M
370
370
  },
371
371
  n.id
372
372
  )) }),
373
373
  f && r && /* @__PURE__ */ e(
374
- Ve,
374
+ Ee,
375
375
  {
376
376
  resource: r,
377
377
  resourceType: Le.VISUAL,
@@ -393,14 +393,14 @@ function It({ searchQuery: t }) {
393
393
  }
394
394
  ),
395
395
  /* @__PURE__ */ e(
396
- Re,
396
+ Te,
397
397
  {
398
398
  open: g,
399
399
  onOpenChange: (n) => {
400
400
  !n && v || (D(n), n || N(null));
401
401
  },
402
- children: /* @__PURE__ */ a(Te, { children: [
403
- /* @__PURE__ */ a(Oe, { children: [
402
+ children: /* @__PURE__ */ a(Oe, { children: [
403
+ /* @__PURE__ */ a(Re, { children: [
404
404
  /* @__PURE__ */ e(Pe, { children: "Delete Visual" }),
405
405
  /* @__PURE__ */ a(Ue, { children: [
406
406
  'Are you sure you want to delete "',
@@ -411,7 +411,7 @@ function It({ searchQuery: t }) {
411
411
  /* @__PURE__ */ a(Ie, { children: [
412
412
  /* @__PURE__ */ e(je, { disabled: v, children: "Cancel" }),
413
413
  /* @__PURE__ */ a(
414
- Fe,
414
+ Me,
415
415
  {
416
416
  onClick: (n) => {
417
417
  n.preventDefault(), n.stopPropagation(), K();
@@ -443,23 +443,23 @@ function jt({
443
443
  formatDate: y,
444
444
  onDashboardItemClick: d
445
445
  }) {
446
- var R, S;
447
- const { selectDashboard: c } = re(), m = ut(t.id), { userContext: E, isLoading: V } = le(), { mutate: w } = ht(), C = ((R = E == null ? void 0 : E.permissions) == null ? void 0 : R.canEdit) ?? !1, L = V || !C, A = () => {
446
+ var T, S;
447
+ const { selectDashboard: c } = re(), m = ut(t.id), { userContext: V, isLoading: E } = le(), { mutate: w } = ht(), C = ((T = V == null ? void 0 : V.permissions) == null ? void 0 : T.canEdit) ?? !1, L = E || !C, A = () => {
448
448
  c(t), o(t.id), d == null || d(t.id);
449
449
  }, j = (P) => {
450
450
  P.stopPropagation(), w({ dashboardId: r ? null : t.id });
451
451
  };
452
- return /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ a(
452
+ return /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ a(
453
453
  "div",
454
454
  {
455
- className: Q(
455
+ className: X(
456
456
  "group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
457
457
  m && "bg-muted/80"
458
458
  ),
459
459
  onClick: A,
460
460
  children: [
461
- /* @__PURE__ */ a(ze, { children: [
462
- /* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
461
+ /* @__PURE__ */ a(Be, { children: [
462
+ /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(
463
463
  "button",
464
464
  {
465
465
  onClick: j,
@@ -467,7 +467,7 @@ function jt({
467
467
  children: /* @__PURE__ */ e(
468
468
  mt,
469
469
  {
470
- className: Q(
470
+ className: X(
471
471
  "h-4 w-4 transition-colors",
472
472
  r ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground/40 hover:text-yellow-400"
473
473
  )
@@ -516,43 +516,43 @@ function jt({
516
516
  t.id
517
517
  ) });
518
518
  }
519
- function Ft({ onRetry: t }) {
520
- return /* @__PURE__ */ e(Ee, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
519
+ function Mt({ onRetry: t }) {
520
+ return /* @__PURE__ */ e(Ve, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
521
521
  /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
522
522
  /* @__PURE__ */ e(_, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
523
523
  ] }) });
524
524
  }
525
- function Mt(t) {
525
+ function Ft(t) {
526
526
  var xe, Ne;
527
527
  const { searchQuery: f, onLoadDashboard: h, onEditDashboard: r, onDashboardItemClick: o } = t, [g, D] = x(!1), [i, N] = x(
528
528
  null
529
- ), [y, d] = x(!1), [c, m] = x(null), [E, V] = x(null), [w, C] = x(null), L = ne(
529
+ ), [y, d] = x(!1), [c, m] = x(null), [V, E] = x(null), [w, C] = x(null), L = ne(
530
530
  (s) => s.lastSelectedDashboard
531
531
  ), A = ne(
532
532
  (s) => s.selectedDashboard
533
533
  ), j = ne(
534
534
  (s) => s.actions.selectDashboard
535
- ), R = ne(
535
+ ), T = ne(
536
536
  (s) => s.actions.clearSelectedDashboard
537
537
  ), { tokenProps: S, id: P } = ft();
538
- Rt();
538
+ Tt();
539
539
  const {
540
540
  resources: v,
541
541
  isLoading: p,
542
- isError: z,
543
- isFetching: X,
544
- updateResource: F,
542
+ isError: B,
543
+ isFetching: Z,
544
+ updateResource: M,
545
545
  deleteResource: q,
546
546
  duplicateResource: K,
547
547
  isUpdating: k,
548
- isDeleting: O,
548
+ isDeleting: R,
549
549
  isDuplicating: ee,
550
550
  refetch: te
551
551
  } = _e(() => {
552
552
  d(!1);
553
553
  const s = c == null ? void 0 : c.id;
554
- m(null), (A == null ? void 0 : A.id) === s && (!(S != null && S.dashboard_id) && !P ? R() : L && L.id !== s && j(L));
555
- }), { currentUser: B, userContext: M } = le(), G = ((xe = M == null ? void 0 : M.permissions) == null ? void 0 : xe.canCreateDashboard) ?? !1, { data: b } = gt(), W = ((Ne = b == null ? void 0 : b.preference) == null ? void 0 : Ne.defaultDashboardId) || null, se = v.filter(
554
+ m(null), (A == null ? void 0 : A.id) === s && (!(S != null && S.dashboard_id) && !P ? T() : L && L.id !== s && j(L));
555
+ }), { currentUser: z, userContext: F } = le(), G = ((xe = F == null ? void 0 : F.permissions) == null ? void 0 : xe.canCreateDashboard) ?? !1, { data: b } = gt(), J = ((Ne = b == null ? void 0 : b.preference) == null ? void 0 : Ne.defaultDashboardId) || null, se = v.filter(
556
556
  (s) => {
557
557
  var U, u;
558
558
  return ((U = s == null ? void 0 : s.title) == null ? void 0 : U.toLowerCase().includes(f.toLowerCase())) || ((u = s == null ? void 0 : s.description) == null ? void 0 : u.toLowerCase().includes(f.toLowerCase()));
@@ -565,16 +565,16 @@ function Mt(t) {
565
565
  h == null || h(s);
566
566
  }, n = (s) => {
567
567
  m(s), d(!0);
568
- }, T = () => {
568
+ }, O = () => {
569
569
  c && q(c.id);
570
570
  }, l = (s) => {
571
- V(s), K(s, {
572
- onSettled: () => V(null)
571
+ E(s), K(s, {
572
+ onSettled: () => E(null)
573
573
  });
574
574
  }, {
575
575
  startUpdating: Y,
576
- stopUpdating: Z,
577
- isUpdating: $
576
+ stopUpdating: $,
577
+ isUpdating: Q
578
578
  } = Se(), ae = (s, U, u) => {
579
579
  var we;
580
580
  const ue = Object.fromEntries(
@@ -585,7 +585,7 @@ function Mt(t) {
585
585
  return;
586
586
  }
587
587
  const be = Object.keys(ue), he = be.length === 1 ? be[0] : void 0;
588
- Y(s, he), F(
588
+ Y(s, he), M(
589
589
  {
590
590
  resourceId: s,
591
591
  data: ue
@@ -593,11 +593,11 @@ function Mt(t) {
593
593
  {
594
594
  onSuccess: () => {
595
595
  var H;
596
- Z(s, he), (H = u == null ? void 0 : u.onSuccess) == null || H.call(u);
596
+ $(s, he), (H = u == null ? void 0 : u.onSuccess) == null || H.call(u);
597
597
  },
598
598
  onError: () => {
599
599
  var H;
600
- Z(s, he), (H = u == null ? void 0 : u.onError) == null || H.call(u);
600
+ $(s, he), (H = u == null ? void 0 : u.onError) == null || H.call(u);
601
601
  }
602
602
  }
603
603
  );
@@ -605,17 +605,17 @@ function Mt(t) {
605
605
  const U = v.find(
606
606
  (u) => u.id === s
607
607
  );
608
- U && F({
608
+ U && M({
609
609
  resourceId: s,
610
610
  data: {
611
611
  isPrivate: !U.isPrivate
612
612
  }
613
613
  });
614
- }, Je = (s) => {
615
- N(s), B == null || B.type, D(!0);
614
+ }, We = (s) => {
615
+ N(s), z == null || z.type, D(!0);
616
616
  }, qe = (s) => {
617
617
  r == null || r(s.id), C(s);
618
- }, We = () => {
618
+ }, Je = () => {
619
619
  C(null);
620
620
  }, Ye = ({
621
621
  title: s,
@@ -630,7 +630,7 @@ function Mt(t) {
630
630
  }
631
631
  });
632
632
  };
633
- return p ? /* @__PURE__ */ e(Ge, {}) : z ? /* @__PURE__ */ e(Ft, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
633
+ return p ? /* @__PURE__ */ e(Ge, {}) : B ? /* @__PURE__ */ e(Mt, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
634
634
  /* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: se.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
635
635
  /* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(Dt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
636
636
  /* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: f ? "No dashboards found" : "No dashboards yet" }),
@@ -639,22 +639,22 @@ function Mt(t) {
639
639
  jt,
640
640
  {
641
641
  dashboard: s,
642
- isDeleting: O,
643
- isDuplicating: E === s.id,
644
- isDefault: s.id === W,
642
+ isDeleting: R,
643
+ isDuplicating: V === s.id,
644
+ isDefault: s.id === J,
645
645
  onLoadDashboard: ce,
646
646
  onEditDetails: qe,
647
647
  onDeleteClick: n,
648
648
  onDuplicateDashboard: l,
649
649
  onTogglePrivacy: I,
650
- onShareDashboard: Je,
650
+ onShareDashboard: We,
651
651
  formatDate: de,
652
652
  onDashboardItemClick: o
653
653
  },
654
654
  s.id
655
655
  )) }),
656
656
  g && i && /* @__PURE__ */ e(
657
- Ve,
657
+ Ee,
658
658
  {
659
659
  resource: i,
660
660
  resourceType: Le.DASHBOARD,
@@ -664,14 +664,14 @@ function Mt(t) {
664
664
  }
665
665
  ),
666
666
  /* @__PURE__ */ e(
667
- Re,
667
+ Te,
668
668
  {
669
669
  open: y,
670
670
  onOpenChange: (s) => {
671
- !s && O || (d(s), s || m(null));
671
+ !s && R || (d(s), s || m(null));
672
672
  },
673
- children: /* @__PURE__ */ a(Te, { children: [
674
- /* @__PURE__ */ a(Oe, { children: [
673
+ children: /* @__PURE__ */ a(Oe, { children: [
674
+ /* @__PURE__ */ a(Re, { children: [
675
675
  /* @__PURE__ */ e(Pe, { children: "Delete Dashboard" }),
676
676
  /* @__PURE__ */ a(Ue, { children: [
677
677
  'Are you sure you want to delete "',
@@ -680,18 +680,18 @@ function Mt(t) {
680
680
  ] })
681
681
  ] }),
682
682
  /* @__PURE__ */ a(Ie, { children: [
683
- /* @__PURE__ */ e(je, { disabled: O, children: "Cancel" }),
683
+ /* @__PURE__ */ e(je, { disabled: R, children: "Cancel" }),
684
684
  /* @__PURE__ */ a(
685
- Fe,
685
+ Me,
686
686
  {
687
687
  onClick: (s) => {
688
- s.preventDefault(), s.stopPropagation(), T();
688
+ s.preventDefault(), s.stopPropagation(), O();
689
689
  },
690
690
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
691
- disabled: O,
691
+ disabled: R,
692
692
  children: [
693
- O ? /* @__PURE__ */ e(oe, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(De, { className: "mr-2 h-3.5 w-3.5" }),
694
- O ? "Deleting..." : "Delete"
693
+ R ? /* @__PURE__ */ e(oe, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(De, { className: "mr-2 h-3.5 w-3.5" }),
694
+ R ? "Deleting..." : "Delete"
695
695
  ]
696
696
  }
697
697
  )
@@ -706,14 +706,14 @@ function Mt(t) {
706
706
  resourceLabel: "Dashboard",
707
707
  initialTitle: w.title || "",
708
708
  initialDescription: w.description || "",
709
- onClose: We,
709
+ onClose: Je,
710
710
  onSave: Ye,
711
- isSaving: $(w.id)
711
+ isSaving: Q(w.id)
712
712
  }
713
713
  )
714
714
  ] });
715
715
  }
716
- function zt({
716
+ function Bt({
717
717
  open: t,
718
718
  onOpenChange: f,
719
719
  onSubmit: h,
@@ -788,33 +788,33 @@ function zt({
788
788
  ] })
789
789
  ] }) });
790
790
  }
791
- function Jt({
791
+ function Wt({
792
792
  isOpen: t,
793
793
  onClose: f,
794
794
  className: h,
795
795
  onDashboardItemClick: r,
796
796
  variant: o = "inline"
797
797
  }) {
798
- var M, G;
798
+ var F, G;
799
799
  const g = me(
800
800
  (b) => b.isDashboardEditing
801
- ), [D, i] = x(!1), [N, y] = x(""), [d, c] = x(!1), { currentUser: m, userContext: E } = le(), V = ((M = E == null ? void 0 : E.permissions) == null ? void 0 : M.canCreateDashboard) ?? !1, { onCreateSuccess: w } = yt({
801
+ ), [D, i] = x(!1), [N, y] = x(""), [d, c] = x(!1), { currentUser: m, userContext: V } = le(), E = ((F = V == null ? void 0 : V.permissions) == null ? void 0 : F.canCreateDashboard) ?? !1, { onCreateSuccess: w } = yt({
802
802
  onDashboardSelect: r
803
803
  }), { selectVisual: C } = re(), { handleEditLibraryVisual: L } = Ke(), {
804
804
  createResource: A,
805
805
  isCreating: j,
806
- refetch: R
806
+ refetch: T
807
807
  } = _e(), { createResource: S, isCreating: P } = ye(
808
808
  void 0,
809
809
  // onDeleteSuccess (not needed here)
810
810
  (b) => {
811
811
  i(!1), b && (C(b), L(b));
812
812
  }
813
- ), v = o === "overlay", p = ((m == null ? void 0 : m.name) ?? "").trim(), z = ((m == null ? void 0 : m.email) ?? "").trim(), F = p && p.toLowerCase() !== "undefined" ? p : z || "Current user", q = ((G = F.charAt(0)) == null ? void 0 : G.toUpperCase()) || "?", K = z && z.toLowerCase() !== "undefined" ? z : "", k = Ot(f, {
813
+ ), v = o === "overlay", p = ((m == null ? void 0 : m.name) ?? "").trim(), B = ((m == null ? void 0 : m.email) ?? "").trim(), M = p && p.toLowerCase() !== "undefined" ? p : B || "Current user", q = ((G = M.charAt(0)) == null ? void 0 : G.toUpperCase()) || "?", K = B && B.toLowerCase() !== "undefined" ? B : "", k = Rt(f, {
814
814
  enabled: t && v
815
- }), O = Q(
815
+ }), R = X(
816
816
  "flex h-full flex-col border-r bg-background",
817
- v ? Q(
817
+ v ? X(
818
818
  "absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",
819
819
  t ? "translate-x-0" : "pointer-events-none -translate-x-full"
820
820
  ) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden shadow-sm",
@@ -822,14 +822,14 @@ function Jt({
822
822
  ), ee = (b) => {
823
823
  }, te = (b) => {
824
824
  console.log("Editing dashboard:", b);
825
- }, B = (b) => {
825
+ }, z = (b) => {
826
826
  A(b, {
827
- onSuccess: (W) => {
828
- i(!1), w(W, R);
827
+ onSuccess: (J) => {
828
+ i(!1), w(J, T);
829
829
  }
830
830
  });
831
831
  };
832
- return /* @__PURE__ */ e(ge, { children: (!v || t) && /* @__PURE__ */ a("div", { ref: k, className: O, children: [
832
+ return /* @__PURE__ */ e(ge, { children: (!v || t) && /* @__PURE__ */ a("div", { ref: k, className: R, children: [
833
833
  /* @__PURE__ */ a("div", { className: "border-b border-border", children: [
834
834
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-1.5", children: [
835
835
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children: g ? "Visuals" : "Dashboards" }) }),
@@ -844,7 +844,7 @@ function Jt({
844
844
  children: /* @__PURE__ */ e(St, { className: "h-3.5 w-3.5" })
845
845
  }
846
846
  ),
847
- (g || V) && /* @__PURE__ */ e(
847
+ (g || E) && /* @__PURE__ */ e(
848
848
  _,
849
849
  {
850
850
  size: "sm",
@@ -868,7 +868,7 @@ function Jt({
868
868
  ) })
869
869
  ] }),
870
870
  /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: g ? /* @__PURE__ */ e(It, { searchQuery: N }) : /* @__PURE__ */ e(
871
- Mt,
871
+ Ft,
872
872
  {
873
873
  searchQuery: N,
874
874
  onLoadDashboard: ee,
@@ -876,22 +876,22 @@ function Jt({
876
876
  onDashboardItemClick: r
877
877
  }
878
878
  ) }),
879
- m && /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
880
- /* @__PURE__ */ a(ze, { children: [
881
- /* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-primary", children: q }) }) }),
879
+ m && /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
880
+ /* @__PURE__ */ a(Be, { children: [
881
+ /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-primary", children: q }) }) }),
882
882
  /* @__PURE__ */ e(He, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
883
- /* @__PURE__ */ e("div", { className: "font-medium", children: F }),
883
+ /* @__PURE__ */ e("div", { className: "font-medium", children: M }),
884
884
  K && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: K }),
885
885
  m.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
886
886
  "Role: ",
887
- Et(m.role.replace(/_/g, " "))
887
+ Vt(m.role.replace(/_/g, " "))
888
888
  ] })
889
889
  ] }) })
890
890
  ] }),
891
- /* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: F })
891
+ /* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: M })
892
892
  ] }) }) }),
893
893
  g ? /* @__PURE__ */ e(
894
- zt,
894
+ Bt,
895
895
  {
896
896
  open: D,
897
897
  onOpenChange: i,
@@ -899,16 +899,16 @@ function Jt({
899
899
  isCreating: P
900
900
  }
901
901
  ) : /* @__PURE__ */ e(
902
- Vt,
902
+ Et,
903
903
  {
904
904
  open: D,
905
905
  onOpenChange: i,
906
- onSubmit: B,
906
+ onSubmit: z,
907
907
  isCreating: j
908
908
  }
909
909
  )
910
910
  ] }) });
911
911
  }
912
912
  export {
913
- Jt as ResourceManagementPanel
913
+ Wt as ResourceManagementPanel
914
914
  };