react-semaphor 0.1.252 → 0.1.253
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.
- package/dist/chunks/{dashboard-controls-RKNlZLUy.js → dashboard-controls-BgaOqhnw.js} +1 -1
- package/dist/chunks/{dashboard-controls-tzai5JMp.js → dashboard-controls-CHH9Ea4j.js} +36 -36
- package/dist/chunks/{dashboard-json-B5wllXw0.js → dashboard-json-Blynp1N2.js} +1 -1
- package/dist/chunks/{dashboard-json-ihTGgefO.js → dashboard-json-CJ6i6izi.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-5tiQcv5v.js → dashboard-summary-settings-dialog-BtpW7fJ0.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-aTE5vsbO.js → dashboard-summary-settings-dialog-CHhYvPUB.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DWk1Nj1P.js → edit-dashboard-visual-C22E6KJj.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BIQd7lCz.js → edit-dashboard-visual-CZvBuYhN.js} +1 -1
- package/dist/chunks/{editor-action-buttons-CmELP3na.js → editor-action-buttons-1cbHJIqv.js} +1 -1
- package/dist/chunks/{editor-action-buttons-B7ESBjzC.js → editor-action-buttons-DNSIXb3y.js} +2 -2
- package/dist/chunks/index-9_GiUNMO.js +1109 -0
- package/dist/chunks/{index-BDN1Q9RG.js → index-DsMIsFii.js} +32323 -32077
- package/dist/chunks/{notification-bell-CYrG1hcX.js → notification-bell-DXQ2fu8Y.js} +36 -36
- package/dist/chunks/{notification-bell-TG-yGjyj.js → notification-bell-DxOIm0IK.js} +1 -1
- package/dist/chunks/{resource-management-panel-jsX9tgNz.js → resource-management-panel-D427FGhi.js} +1 -1
- package/dist/chunks/{resource-management-panel-CnDTYkf7.js → resource-management-panel-DkW4oYpN.js} +26 -26
- package/dist/chunks/{use-visual-utils-H6Nd2HfE.js → use-visual-utils-BqG8Hwpl.js} +1 -1
- package/dist/chunks/{use-visual-utils-BNXkYg0F.js → use-visual-utils-CW_sw621.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +413 -252
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +249 -48
- package/dist/types/types.d.ts +92 -20
- package/package.json +1 -1
- package/dist/chunks/index-DvjTd3ue.js +0 -1109
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-9_GiUNMO.js"),b=require("react");require("react-dom");const _=require("./notification-bell-DxOIm0IK.js"),Ss=require("./date-formatter-CqXdM6JO.js"),Pe=require("./dashboard-summary-settings-dialog-BtpW7fJ0.js"),ys=require("./use-debounced-dirty-check-XHSwAefL.js"),xe=require("./normalize-dashboard-for-dirty-check-B7NQDI1H.js"),Fe=require("./editor-action-buttons-1cbHJIqv.js");function Ds(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return n.default=t,Object.freeze(n)}const w=Ds(b);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as M } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { bL as Z, cL as wa, u as w, c0 as Ke, c1 as Qe, B as E, c3 as We, c4 as j, cM as Je, N as Es, b as G, e as Xe, cN as xa, b$ as Ye, f as Ze, g as es, h as ss, i as Ls, L as Re, I as oe, v as Da, a6 as V, cO as fe, c8 as Ge, cP as Ca, cQ as Ns, cR as As, c as X, cS as ks, cT as Ea, cq as as, cU as La, cV as Aa, cW as ka, cX as Ma, cY as Oa, cZ as Ia, H as be, V as ye, x as k, c_ as Ms, cA as Ta, c$ as _a, w as Y, c7 as H, d0 as Ua, d1 as Pa, d2 as Fe, d3 as Ra, d4 as Ga, d5 as Os, d6 as Is, d7 as ge, d8 as ve, cw as Ve, ce as je, d9 as qe, c9 as Ts, da as He, db as _s, dc as Fa, ch as Us, ci as Ps, cj as Rs, ck as Gs, cl as Fs, cm as Vs, cn as js, co as $e, b_ as Va, dd as ja, af as qa, U as Ss, ae as pe, de as Ha, al as $a, ag as Te, df as za, dg as Ba, dh as Ka, aA as Qa, di as Wa, dj as Ja, bS as Xa, bT as Ya, bU as Za, dk as et, bV as st, c5 as at, as as tt, dl as rt, dm as nt, dn as ot, dp as it, dq as lt, dr as ct, c2 as dt, a8 as ut, cb as mt, ds as ht, ak as pt, a9 as ft, ar as gt } from "./index-DsMIsFii.js";
|
|
3
3
|
import * as L from "react";
|
|
4
4
|
import qs, { useState as S, useMemo as q, useEffect as vt, useCallback as bt } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import { b as yt, u as Nt, c as St, A as wt, V as xt, N as Dt, U as Ct } from "./notification-bell-
|
|
6
|
+
import { b as yt, u as Nt, c as St, A as wt, V as xt, N as Dt, U as Ct } from "./notification-bell-DXQ2fu8Y.js";
|
|
7
7
|
import { l as Et } from "./date-formatter-vkCj9Ct-.js";
|
|
8
|
-
import { C as Lt, D as At } from "./dashboard-summary-settings-dialog-
|
|
8
|
+
import { C as Lt, D as At } from "./dashboard-summary-settings-dialog-CHhYvPUB.js";
|
|
9
9
|
import { u as kt } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
10
10
|
import { s as _e } from "./normalize-dashboard-for-dirty-check-Bn27S0PN.js";
|
|
11
|
-
import { S as ws } from "./editor-action-buttons-
|
|
11
|
+
import { S as ws } from "./editor-action-buttons-DNSIXb3y.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license lucide-react v0.453.0 - ISC
|
|
14
14
|
*
|
|
@@ -76,7 +76,7 @@ const _t = Z("ShieldX", [
|
|
|
76
76
|
* This source code is licensed under the ISC license.
|
|
77
77
|
* See the LICENSE file in the root directory of this source tree.
|
|
78
78
|
*/
|
|
79
|
-
const
|
|
79
|
+
const Ut = Z("Sun", [
|
|
80
80
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
81
81
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
82
82
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -87,7 +87,7 @@ const Pt = Z("Sun", [
|
|
|
87
87
|
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
88
88
|
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
89
89
|
]);
|
|
90
|
-
var ze = { exports: {} },
|
|
90
|
+
var ze = { exports: {} }, Ue = {};
|
|
91
91
|
/**
|
|
92
92
|
* @license React
|
|
93
93
|
* use-sync-external-store-shim.production.js
|
|
@@ -98,8 +98,8 @@ var ze = { exports: {} }, Pe = {};
|
|
|
98
98
|
* LICENSE file in the root directory of this source tree.
|
|
99
99
|
*/
|
|
100
100
|
var xs;
|
|
101
|
-
function
|
|
102
|
-
if (xs) return
|
|
101
|
+
function Pt() {
|
|
102
|
+
if (xs) return Ue;
|
|
103
103
|
xs = 1;
|
|
104
104
|
var s = qs;
|
|
105
105
|
function n(d, h) {
|
|
@@ -136,9 +136,9 @@ function Ut() {
|
|
|
136
136
|
return h();
|
|
137
137
|
}
|
|
138
138
|
var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? g : m;
|
|
139
|
-
return
|
|
139
|
+
return Ue.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : c, Ue;
|
|
140
140
|
}
|
|
141
|
-
var
|
|
141
|
+
var Pe = {};
|
|
142
142
|
/**
|
|
143
143
|
* @license React
|
|
144
144
|
* use-sync-external-store-shim.development.js
|
|
@@ -198,10 +198,10 @@ function Rt() {
|
|
|
198
198
|
}
|
|
199
199
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
200
200
|
var o = qs, l = typeof Object.is == "function" ? Object.is : s, u = o.useState, m = o.useEffect, p = o.useLayoutEffect, g = o.useDebugValue, c = !1, d = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? a : n;
|
|
201
|
-
|
|
202
|
-
}()),
|
|
201
|
+
Pe.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
202
|
+
}()), Pe;
|
|
203
203
|
}
|
|
204
|
-
process.env.NODE_ENV === "production" ? ze.exports =
|
|
204
|
+
process.env.NODE_ENV === "production" ? ze.exports = Pt() : ze.exports = Rt();
|
|
205
205
|
var Gt = ze.exports;
|
|
206
206
|
function Ft() {
|
|
207
207
|
const { setTheme: s } = wa(), n = w(
|
|
@@ -210,7 +210,7 @@ function Ft() {
|
|
|
210
210
|
return /* @__PURE__ */ r(Ke, { children: [
|
|
211
211
|
/* @__PURE__ */ e(Qe, { asChild: !0, children: /* @__PURE__ */ r(E, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
212
212
|
/* @__PURE__ */ e(
|
|
213
|
-
|
|
213
|
+
Ut,
|
|
214
214
|
{
|
|
215
215
|
strokeWidth: 1.5,
|
|
216
216
|
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
@@ -736,7 +736,7 @@ var ar = [
|
|
|
736
736
|
"svg",
|
|
737
737
|
"ul"
|
|
738
738
|
], ts = ar.reduce((s, n) => {
|
|
739
|
-
const t =
|
|
739
|
+
const t = Ua(`Primitive.${n}`), a = L.forwardRef((o, l) => {
|
|
740
740
|
const { asChild: u, ...m } = o, p = u ? t : n;
|
|
741
741
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...m, ref: l });
|
|
742
742
|
});
|
|
@@ -771,7 +771,7 @@ $s.displayName = rs;
|
|
|
771
771
|
var zs = "AvatarImage", Bs = L.forwardRef(
|
|
772
772
|
(s, n) => {
|
|
773
773
|
const { __scopeAvatar: t, src: a, onLoadingStatusChange: o = () => {
|
|
774
|
-
}, ...l } = s, u = Hs(zs, t), m = ir(a, l), p =
|
|
774
|
+
}, ...l } = s, u = Hs(zs, t), m = ir(a, l), p = Pa((g) => {
|
|
775
775
|
o(g), u.onImageLoadingStatusChange(g);
|
|
776
776
|
});
|
|
777
777
|
return Fe(() => {
|
|
@@ -857,7 +857,7 @@ function cr({
|
|
|
857
857
|
tenantId: t.tenantId || void 0,
|
|
858
858
|
active: !0,
|
|
859
859
|
limit: 100
|
|
860
|
-
}), T = Xt(),
|
|
860
|
+
}), T = Xt(), U = Yt(), O = (h == null ? void 0 : h.members) || [], $ = q(() => new Set(O.map((b) => b.userId)), [O]), R = q(() => N.filter((b) => !$.has(b.id)), [N, $]), z = q(() => {
|
|
861
861
|
if (!u) return R;
|
|
862
862
|
const b = u.toLowerCase();
|
|
863
863
|
return R.filter(
|
|
@@ -891,7 +891,7 @@ function cr({
|
|
|
891
891
|
}, K = async () => {
|
|
892
892
|
if (c.length !== 0)
|
|
893
893
|
try {
|
|
894
|
-
await
|
|
894
|
+
await U.mutateAsync({
|
|
895
895
|
groupId: t.id,
|
|
896
896
|
data: {
|
|
897
897
|
userIds: c
|
|
@@ -969,8 +969,8 @@ function cr({
|
|
|
969
969
|
variant: "destructive",
|
|
970
970
|
size: "sm",
|
|
971
971
|
onClick: K,
|
|
972
|
-
disabled:
|
|
973
|
-
children:
|
|
972
|
+
disabled: U.isPending,
|
|
973
|
+
children: U.isPending ? /* @__PURE__ */ r(M, { children: [
|
|
974
974
|
/* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
975
975
|
"Removing..."
|
|
976
976
|
] }) : /* @__PURE__ */ r(M, { children: [
|
|
@@ -1083,7 +1083,7 @@ function mr({
|
|
|
1083
1083
|
open: s,
|
|
1084
1084
|
onOpenChange: n
|
|
1085
1085
|
}) {
|
|
1086
|
-
const [t, a] = S("groups"), [o, l] = S(""), [u, m] = S(null), [p, g] = S(!1), [c, d] = S(null), { tokenProps: h } = G(), { currentUser: f } = as(), v = Jt(), y = (f == null ? void 0 : f.type) === "tenant", N = h == null ? void 0 : h.tenantId, { groups: A, isLoading: T, refetch:
|
|
1086
|
+
const [t, a] = S("groups"), [o, l] = S(""), [u, m] = S(null), [p, g] = S(!1), [c, d] = S(null), { tokenProps: h } = G(), { currentUser: f } = as(), v = Jt(), y = (f == null ? void 0 : f.type) === "tenant", N = h == null ? void 0 : h.tenantId, { groups: A, isLoading: T, refetch: U } = Fa({
|
|
1087
1087
|
type: y ? "TENANT_GROUP" : "all",
|
|
1088
1088
|
tenantId: y ? N : void 0,
|
|
1089
1089
|
includeMembers: !1
|
|
@@ -1095,14 +1095,14 @@ function mr({
|
|
|
1095
1095
|
), $ = async () => {
|
|
1096
1096
|
if (c)
|
|
1097
1097
|
try {
|
|
1098
|
-
await v.mutateAsync(c.id), d(null),
|
|
1098
|
+
await v.mutateAsync(c.id), d(null), U();
|
|
1099
1099
|
} catch (x) {
|
|
1100
1100
|
console.error("Failed to delete group:", x);
|
|
1101
1101
|
}
|
|
1102
1102
|
}, R = (x) => {
|
|
1103
1103
|
m(x), g(!0);
|
|
1104
1104
|
}, z = () => {
|
|
1105
|
-
a("groups"),
|
|
1105
|
+
a("groups"), U();
|
|
1106
1106
|
};
|
|
1107
1107
|
return /* @__PURE__ */ r(M, { children: [
|
|
1108
1108
|
/* @__PURE__ */ e(Xe, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Ze, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
@@ -1168,15 +1168,15 @@ function mr({
|
|
|
1168
1168
|
open: p,
|
|
1169
1169
|
onOpenChange: g,
|
|
1170
1170
|
group: u,
|
|
1171
|
-
onUpdate: () =>
|
|
1171
|
+
onUpdate: () => U()
|
|
1172
1172
|
}
|
|
1173
1173
|
),
|
|
1174
1174
|
/* @__PURE__ */ e(
|
|
1175
|
-
|
|
1175
|
+
Us,
|
|
1176
1176
|
{
|
|
1177
1177
|
open: !!c,
|
|
1178
1178
|
onOpenChange: () => d(null),
|
|
1179
|
-
children: /* @__PURE__ */ r(
|
|
1179
|
+
children: /* @__PURE__ */ r(Ps, { children: [
|
|
1180
1180
|
/* @__PURE__ */ r(Rs, { children: [
|
|
1181
1181
|
/* @__PURE__ */ e(Gs, { children: "Delete Group" }),
|
|
1182
1182
|
/* @__PURE__ */ r(Fs, { children: [
|
|
@@ -1269,7 +1269,7 @@ function Dr() {
|
|
|
1269
1269
|
w((i) => i.selectedSheetId);
|
|
1270
1270
|
const d = w(
|
|
1271
1271
|
(i) => i.isDashboardEditing
|
|
1272
|
-
), { setDashboardTitle: h } = w((i) => i.actions), [f, v] = S(!1), [y, N] = S(!1), [A, T] = S(!1), [
|
|
1272
|
+
), { setDashboardTitle: h } = w((i) => i.actions), [f, v] = S(!1), [y, N] = S(!1), [A, T] = S(!1), [U, O] = S(!1), [$, R] = S(!1), [z, x] = S(!1), [B, K] = S(!1), [Q, W] = S(null), [b, C] = S(!1), _ = w((i) => i.isDashboardPanelOpen), F = w(
|
|
1273
1273
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
1274
1274
|
), ie = w((i) => i.filterValues), D = w((i) => i.isVisualEditing);
|
|
1275
1275
|
Ss((i) => i.card);
|
|
@@ -1290,7 +1290,7 @@ function Dr() {
|
|
|
1290
1290
|
), { resources: de } = $a(Te.DASHBOARD), { data: xe } = za(), sa = ((bs = xe == null ? void 0 : xe.preference) == null ? void 0 : bs.defaultDashboardId) || null, { mutate: aa, isPending: ta } = Ba(), { currentUser: ra } = as(), na = Ka(ra), J = ee || le, ds = J ? {
|
|
1291
1291
|
id: J.id,
|
|
1292
1292
|
title: (c == null ? void 0 : c.title) || J.title || "Dashboard"
|
|
1293
|
-
} : null, { handleAddNewFrame: oa } = Qa(), [De, Ce] = S(!1), [ia, se] = S(!1), [Ee, ue] = S("close"), ae = Wa(Te.DASHBOARD), [
|
|
1293
|
+
} : null, { handleAddNewFrame: oa } = Qa(), [De, Ce] = S(!1), [ia, se] = S(!1), [Ee, ue] = S("close"), ae = Wa(Te.DASHBOARD), [P, Le] = S(
|
|
1294
1294
|
null
|
|
1295
1295
|
), la = async (i, I) => {
|
|
1296
1296
|
if (!(c != null && c.id)) {
|
|
@@ -1335,16 +1335,16 @@ function Dr() {
|
|
|
1335
1335
|
St(
|
|
1336
1336
|
d,
|
|
1337
1337
|
c,
|
|
1338
|
-
|
|
1338
|
+
P,
|
|
1339
1339
|
(i) => Le(i)
|
|
1340
1340
|
);
|
|
1341
1341
|
const { isDirty: ms, isDirtyPending: da, resetDirty: he } = kt(
|
|
1342
1342
|
c,
|
|
1343
|
-
|
|
1343
|
+
P,
|
|
1344
1344
|
300,
|
|
1345
1345
|
1e3,
|
|
1346
1346
|
_e
|
|
1347
|
-
), hs = bt(() =>
|
|
1347
|
+
), hs = bt(() => P ? _e(c) !== _e(P) : !1, [c, P]), Me = ms || da, te = De || ae.isPending, ua = () => {
|
|
1348
1348
|
hs() ? (ue("close"), se(!0)) : (ke(), he());
|
|
1349
1349
|
}, ma = async () => {
|
|
1350
1350
|
await Oe({
|
|
@@ -1352,9 +1352,9 @@ function Dr() {
|
|
|
1352
1352
|
navigateHomeAfterSave: Ee === "home"
|
|
1353
1353
|
});
|
|
1354
1354
|
}, ha = () => {
|
|
1355
|
-
|
|
1355
|
+
P && Ae(P), ke(), Ee === "home" && we(), ue("close"), se(!1), he();
|
|
1356
1356
|
}, pa = () => {
|
|
1357
|
-
|
|
1357
|
+
P && (Ae(P), he());
|
|
1358
1358
|
}, fa = () => {
|
|
1359
1359
|
if (d && hs()) {
|
|
1360
1360
|
ue("home"), se(!0);
|
|
@@ -1739,7 +1739,7 @@ function Dr() {
|
|
|
1739
1739
|
(c == null ? void 0 : c.id) && /* @__PURE__ */ e(
|
|
1740
1740
|
ft,
|
|
1741
1741
|
{
|
|
1742
|
-
open:
|
|
1742
|
+
open: U,
|
|
1743
1743
|
onOpenChange: O,
|
|
1744
1744
|
dashboardId: c.id,
|
|
1745
1745
|
dashboardName: c == null ? void 0 : c.title
|
|
@@ -1766,13 +1766,13 @@ function Dr() {
|
|
|
1766
1766
|
}
|
|
1767
1767
|
),
|
|
1768
1768
|
/* @__PURE__ */ e(
|
|
1769
|
-
|
|
1769
|
+
Us,
|
|
1770
1770
|
{
|
|
1771
1771
|
open: B,
|
|
1772
1772
|
onOpenChange: (i) => {
|
|
1773
1773
|
!i && De && !Q || (K(i), i || (W(null), C(!1)));
|
|
1774
1774
|
},
|
|
1775
|
-
children: /* @__PURE__ */ r(
|
|
1775
|
+
children: /* @__PURE__ */ r(Ps, { className: "max-w-sm", children: [
|
|
1776
1776
|
/* @__PURE__ */ r(Rs, { children: [
|
|
1777
1777
|
/* @__PURE__ */ e(Gs, { children: Q ? "Save failed" : "Saving dashboard" }),
|
|
1778
1778
|
/* @__PURE__ */ e(Fs, { className: "pt-2", children: Q ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("./index-9_GiUNMO.js");require("react");require("react-dom");function i(){const o=a.useDashboardStore(e=>e.dashboard),r=a.useDashboardStore(e=>e.actions.setDashboard),t=a.useDashboardStore(e=>e.showDashboardJSON),n=a.useDashboardStore(e=>e.actions.setShowDashboardJSON);return s.jsxs("div",{className:a.cn("relative p-2",{hidden:!t}),children:[s.jsxs(a.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>n(!1),children:[s.jsx(a.X,{className:"mr-2 h-4 w-4"}),"Close"]}),s.jsx(a.de,{onChange:e=>{if(e)try{JSON.parse(e),r(JSON.parse(e))}catch{}},defaultLanguage:"json",className:"h-[550px] overflow-y-auto",value:JSON.stringify(o,null,2),options:{minimap:{enabled:!1},glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})]})}exports.default=i;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { u as s, c as l, B as h, X as d, d as c } from "./index-
|
|
2
|
+
import { u as s, c as l, B as h, X as d, d as c } from "./index-DsMIsFii.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function N() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),l=require("react"),a=require("./index-DvjTd3ue.js");function W(){var N,C,T,y;const{authToken:s,tokenProps:r}=a.useSemaphorContext(),[i,S]=l.useState(!1),[x,v]=l.useState(!1),[j,b]=l.useState(!1),[p,u]=l.useState(null),[m,n]=l.useState(null),g=m||{tz:((C=(N=r==null?void 0:r.params)==null?void 0:N.calendarContext)==null?void 0:C.tz)||null,weekStart:((y=(T=r==null?void 0:r.params)==null?void 0:T.calendarContext)==null?void 0:y.weekStart)??null},d=l.useCallback(async()=>{if(!(!(s!=null&&s.accessToken)||!(r!=null&&r.apiServiceUrl))){S(!0),u(null);try{const c=await fetch(`${r.apiServiceUrl}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${s.accessToken}`}});if(!c.ok){const h=await c.json().catch(()=>({}));throw new Error(h.error||"Failed to fetch preferences")}const o=await c.json();n({tz:o.tz,weekStart:o.weekStart,source:o.source,isInherited:o.isInherited,userHasPrefs:o.userHasPrefs,inherited:o.inherited})}catch(c){const o=c instanceof Error?c.message:"Unknown error";u(o)}finally{S(!1)}}},[s,r]);l.useEffect(()=>{d()},[d]);const f=l.useCallback(async c=>{if(!(s!=null&&s.accessToken)||!(r!=null&&r.apiServiceUrl))return u("Not authenticated"),!1;v(!0),u(null);try{const o=await fetch(`${r.apiServiceUrl}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s.accessToken}`},body:JSON.stringify(c)});if(!o.ok){const h=await o.json().catch(()=>({}));throw new Error(h.error||"Failed to update preferences")}return await d(),!0}catch(o){const h=o instanceof Error?o.message:"Unknown error";return u(h),!1}finally{v(!1)}},[s,r,d]),w=l.useCallback(async()=>{if(!(s!=null&&s.accessToken)||!(r!=null&&r.apiServiceUrl))return u("Not authenticated"),!1;b(!0),u(null);try{const c=await fetch(`${r.apiServiceUrl}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${s.accessToken}`}});if(!c.ok){const h=await c.json().catch(()=>({}));throw new Error(h.error||"Failed to clear preferences")}const o=await c.text();if(o)try{const h=JSON.parse(o);return n({tz:h.tz,weekStart:h.weekStart,source:h.source,isInherited:h.isInherited??!0,userHasPrefs:!1,inherited:h.inherited}),!0}catch{}return await d(),!0}catch(c){const o=c instanceof Error?c.message:"Unknown error";return u(o),!1}finally{b(!1)}},[s,r,d]);return{preferences:g,isLoading:i,isSaving:x,isClearing:j,error:p,updatePreferences:f,clearPreferences:w,refetch:d}}const I=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}];function G(){try{const s=Intl;if(s.supportedValuesOf)return s.supportedValuesOf("timeZone")}catch{}return I.map(s=>s.value)}function V(s){switch(s){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function L(s){const r=I.find(i=>i.value===s);return r?r.label:s}function X(s){const r=M.find(i=>i.value===s);return r?r.label:String(s)}function q({open:s,onOpenChange:r}){var E,P,A;const{preferences:i,isLoading:S,isSaving:x,isClearing:v,updatePreferences:j,clearPreferences:b}=W(),p=i.tz||((E=i.inherited)==null?void 0:E.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,u=i.weekStart??((P=i.inherited)==null?void 0:P.weekStart)??1,[m,n]=l.useState(!i.userHasPrefs),[g,d]=l.useState(!1),[f,w]=l.useState(p),[N,C]=l.useState(u),[T,y]=l.useState(!1),c=l.useMemo(()=>G(),[]),o=l.useMemo(()=>c.filter(t=>!I.some(R=>R.value===t)),[c]),h=l.useMemo(()=>L(f),[f]),F=i.inherited?L(i.inherited.tz):"UTC",H=i.inherited?X(i.inherited.weekStart):"Monday",B=V((A=i.inherited)==null?void 0:A.source);l.useEffect(()=>{if(!s){d(!1);return}g||(i.userHasPrefs!==void 0&&n(!i.userHasPrefs),w(p),C(u))},[s,g,i.userHasPrefs,p,u]);const _=async()=>{if(S){a.ue.error("Preferences are still loading. Please try again.");return}m?await b()?(a.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),r(!1)):a.ue.error("Failed to save preferences. Please try again."):await j({tz:f,weekStart:N})?(a.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),r(!1)):a.ue.error("Failed to save preferences. Please try again.")},$=()=>{r(!1)},D=x||v,O=D||S;return e.jsx(a.Dialog,{open:s,onOpenChange:r,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:"Calendar Preferences"}),e.jsx(a.DialogDescription,{children:"Set your timezone and week start preferences for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs(a.RadioGroup,{value:m?"defaults":"custom",onValueChange:t=>{d(!0),n(t==="defaults")},className:"space-y-3",children:[e.jsxs("div",{className:a.cn("flex items-start space-x-3 rounded-lg border p-4 cursor-pointer transition-colors",m?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"),onClick:()=>{d(!0),n(!0)},children:[e.jsx(a.RadioGroupItem,{value:"defaults",id:"mode-defaults"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs(a.Label,{htmlFor:"mode-defaults",className:"cursor-pointer font-medium",children:["Use ",B," defaults"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[F,", Week starts ",H]})]})]}),e.jsxs("div",{className:a.cn("flex items-start space-x-3 rounded-lg border p-4 cursor-pointer transition-colors",m?"border-border hover:border-muted-foreground/50":"border-primary bg-primary/5"),onClick:()=>{d(!0),n(!1)},children:[e.jsx(a.RadioGroupItem,{value:"custom",id:"mode-custom"}),e.jsx(a.Label,{htmlFor:"mode-custom",className:"cursor-pointer font-medium",children:"Use custom settings"})]})]}),e.jsxs("div",{className:a.cn("space-y-6 transition-opacity",m&&"opacity-50 pointer-events-none"),children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{children:"Timezone"}),e.jsxs(a.Popover,{open:T,onOpenChange:y,modal:!0,children:[e.jsx(a.PopoverTrigger,{asChild:!0,children:e.jsxs(a.Button,{variant:"outline",role:"combobox","aria-expanded":T,className:"w-full justify-between",disabled:m,children:[h,e.jsx(a.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(a.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(a.Command,{className:"overflow-visible",children:[e.jsx(a.CommandInput,{placeholder:"Search timezones..."}),e.jsxs(a.CommandList,{children:[e.jsx(a.CommandEmpty,{children:"No timezone found."}),e.jsx(a.CommandGroup,{heading:"Common",children:I.map(t=>e.jsxs(a.CommandItem,{value:`${t.value} ${t.label}`,onSelect:()=>{d(!0),w(t.value),y(!1)},children:[e.jsx(a.Check,{className:a.cn("mr-2 h-4 w-4",f===t.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:t.label}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t.value})]},t.value))}),e.jsx(a.CommandSeparator,{}),e.jsx(a.CommandGroup,{heading:"All Timezones",children:o.map(t=>e.jsxs(a.CommandItem,{value:t,onSelect:()=>{d(!0),w(t),y(!1)},children:[e.jsx(a.Check,{className:a.cn("mr-2 h-4 w-4",f===t?"opacity-100":"opacity-0")}),t]},t))})]})]})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(a.Label,{children:"Week Starts On"}),e.jsx(a.RadioGroup,{value:String(N),onValueChange:t=>{d(!0),C(Number(t))},className:"flex gap-4",disabled:m,children:M.map(t=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(a.RadioGroupItem,{value:String(t.value),id:`week-start-${t.value}`,disabled:m}),e.jsx(a.Label,{htmlFor:`week-start-${t.value}`,className:a.cn("cursor-pointer font-normal",m&&"cursor-not-allowed"),children:t.label})]},t.value))})]})]})]}),e.jsxs(a.DialogFooter,{children:[e.jsx(a.Button,{variant:"outline",onClick:$,disabled:D,children:"Cancel"}),e.jsx(a.Button,{onClick:_,disabled:O,children:D?e.jsxs(e.Fragment,{children:[e.jsx(a.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]})})}const k=6,z=1,U=20;function Z(s){return Number.isNaN(s)?k:Math.min(U,Math.max(z,s))}function J({open:s,onOpenChange:r,dashboard:i,onApply:S,disabled:x=!1}){const[v,j]=l.useState(!1),[b,p]=l.useState("top"),[u,m]=l.useState(String(k)),n=i.summary;l.useEffect(()=>{s&&(j((n==null?void 0:n.enabled)===!0),p((n==null?void 0:n.position)==="bottom"?"bottom":"top"),m(String((n==null?void 0:n.maxItems)??k)))},[s,n==null?void 0:n.enabled,n==null?void 0:n.position,n==null?void 0:n.maxItems]);const g=l.useMemo(()=>Z(Number.parseInt(u||`${k}`,10)),[u]),d=()=>{S({enabled:v,position:b,maxItems:g}),r(!1)};return e.jsx(a.Dialog,{open:s,onOpenChange:r,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[420px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:"Summary Settings"}),e.jsx(a.DialogDescription,{children:"Configure dashboard-level summary display. Card-level summary settings still control which cards contribute."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-enabled",children:"Enable Dashboard Summary"}),e.jsx(a.SmallSwitch,{id:"dashboard-summary-enabled",checked:v,disabled:x,onCheckedChange:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-position",children:"Position"}),e.jsxs(a.Select,{value:b,disabled:x,onValueChange:f=>p(f),children:[e.jsx(a.SelectTrigger,{id:"dashboard-summary-position",children:e.jsx(a.SelectValue,{placeholder:"Select position"})}),e.jsxs(a.SelectContent,{children:[e.jsx(a.SelectItem,{value:"top",children:"Top"}),e.jsx(a.SelectItem,{value:"bottom",children:"Bottom"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-max-items",children:"Max Items"}),e.jsx(a.Input,{id:"dashboard-summary-max-items",type:"number",min:z,max:U,disabled:x,value:u,onChange:f=>m(f.target.value),onBlur:()=>m(String(g))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Display limit only. Computation is unchanged."})]}),x&&e.jsx("p",{className:"text-xs text-amber-700",children:"Enter dashboard edit mode to modify summary settings."})]}),e.jsxs(a.DialogFooter,{children:[e.jsx(a.Button,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(a.Button,{onClick:d,disabled:x,children:"Apply"})]})]})})}exports.CalendarPreferencesDialog=q;exports.DashboardSummarySettingsDialog=J;
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("react"),a=require("./index-9_GiUNMO.js");function W(){var N,C,T,y;const{authToken:s,tokenProps:r}=a.useSemaphorContext(),[i,S]=l.useState(!1),[x,v]=l.useState(!1),[j,b]=l.useState(!1),[p,u]=l.useState(null),[m,n]=l.useState(null),g=m||{tz:((C=(N=r==null?void 0:r.params)==null?void 0:N.calendarContext)==null?void 0:C.tz)||null,weekStart:((y=(T=r==null?void 0:r.params)==null?void 0:T.calendarContext)==null?void 0:y.weekStart)??null},d=l.useCallback(async()=>{if(!(!(s!=null&&s.accessToken)||!(r!=null&&r.apiServiceUrl))){S(!0),u(null);try{const c=await fetch(`${r.apiServiceUrl}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${s.accessToken}`}});if(!c.ok){const h=await c.json().catch(()=>({}));throw new Error(h.error||"Failed to fetch preferences")}const o=await c.json();n({tz:o.tz,weekStart:o.weekStart,source:o.source,isInherited:o.isInherited,userHasPrefs:o.userHasPrefs,inherited:o.inherited})}catch(c){const o=c instanceof Error?c.message:"Unknown error";u(o)}finally{S(!1)}}},[s,r]);l.useEffect(()=>{d()},[d]);const f=l.useCallback(async c=>{if(!(s!=null&&s.accessToken)||!(r!=null&&r.apiServiceUrl))return u("Not authenticated"),!1;v(!0),u(null);try{const o=await fetch(`${r.apiServiceUrl}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s.accessToken}`},body:JSON.stringify(c)});if(!o.ok){const h=await o.json().catch(()=>({}));throw new Error(h.error||"Failed to update preferences")}return await d(),!0}catch(o){const h=o instanceof Error?o.message:"Unknown error";return u(h),!1}finally{v(!1)}},[s,r,d]),w=l.useCallback(async()=>{if(!(s!=null&&s.accessToken)||!(r!=null&&r.apiServiceUrl))return u("Not authenticated"),!1;b(!0),u(null);try{const c=await fetch(`${r.apiServiceUrl}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${s.accessToken}`}});if(!c.ok){const h=await c.json().catch(()=>({}));throw new Error(h.error||"Failed to clear preferences")}const o=await c.text();if(o)try{const h=JSON.parse(o);return n({tz:h.tz,weekStart:h.weekStart,source:h.source,isInherited:h.isInherited??!0,userHasPrefs:!1,inherited:h.inherited}),!0}catch{}return await d(),!0}catch(c){const o=c instanceof Error?c.message:"Unknown error";return u(o),!1}finally{b(!1)}},[s,r,d]);return{preferences:g,isLoading:i,isSaving:x,isClearing:j,error:p,updatePreferences:f,clearPreferences:w,refetch:d}}const I=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}];function G(){try{const s=Intl;if(s.supportedValuesOf)return s.supportedValuesOf("timeZone")}catch{}return I.map(s=>s.value)}function V(s){switch(s){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function L(s){const r=I.find(i=>i.value===s);return r?r.label:s}function X(s){const r=M.find(i=>i.value===s);return r?r.label:String(s)}function q({open:s,onOpenChange:r}){var E,P,A;const{preferences:i,isLoading:S,isSaving:x,isClearing:v,updatePreferences:j,clearPreferences:b}=W(),p=i.tz||((E=i.inherited)==null?void 0:E.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,u=i.weekStart??((P=i.inherited)==null?void 0:P.weekStart)??1,[m,n]=l.useState(!i.userHasPrefs),[g,d]=l.useState(!1),[f,w]=l.useState(p),[N,C]=l.useState(u),[T,y]=l.useState(!1),c=l.useMemo(()=>G(),[]),o=l.useMemo(()=>c.filter(t=>!I.some(R=>R.value===t)),[c]),h=l.useMemo(()=>L(f),[f]),F=i.inherited?L(i.inherited.tz):"UTC",H=i.inherited?X(i.inherited.weekStart):"Monday",B=V((A=i.inherited)==null?void 0:A.source);l.useEffect(()=>{if(!s){d(!1);return}g||(i.userHasPrefs!==void 0&&n(!i.userHasPrefs),w(p),C(u))},[s,g,i.userHasPrefs,p,u]);const _=async()=>{if(S){a.ue.error("Preferences are still loading. Please try again.");return}m?await b()?(a.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),r(!1)):a.ue.error("Failed to save preferences. Please try again."):await j({tz:f,weekStart:N})?(a.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),r(!1)):a.ue.error("Failed to save preferences. Please try again.")},$=()=>{r(!1)},D=x||v,O=D||S;return e.jsx(a.Dialog,{open:s,onOpenChange:r,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:"Calendar Preferences"}),e.jsx(a.DialogDescription,{children:"Set your timezone and week start preferences for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs(a.RadioGroup,{value:m?"defaults":"custom",onValueChange:t=>{d(!0),n(t==="defaults")},className:"space-y-3",children:[e.jsxs("div",{className:a.cn("flex items-start space-x-3 rounded-lg border p-4 cursor-pointer transition-colors",m?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"),onClick:()=>{d(!0),n(!0)},children:[e.jsx(a.RadioGroupItem,{value:"defaults",id:"mode-defaults"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs(a.Label,{htmlFor:"mode-defaults",className:"cursor-pointer font-medium",children:["Use ",B," defaults"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[F,", Week starts ",H]})]})]}),e.jsxs("div",{className:a.cn("flex items-start space-x-3 rounded-lg border p-4 cursor-pointer transition-colors",m?"border-border hover:border-muted-foreground/50":"border-primary bg-primary/5"),onClick:()=>{d(!0),n(!1)},children:[e.jsx(a.RadioGroupItem,{value:"custom",id:"mode-custom"}),e.jsx(a.Label,{htmlFor:"mode-custom",className:"cursor-pointer font-medium",children:"Use custom settings"})]})]}),e.jsxs("div",{className:a.cn("space-y-6 transition-opacity",m&&"opacity-50 pointer-events-none"),children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{children:"Timezone"}),e.jsxs(a.Popover,{open:T,onOpenChange:y,modal:!0,children:[e.jsx(a.PopoverTrigger,{asChild:!0,children:e.jsxs(a.Button,{variant:"outline",role:"combobox","aria-expanded":T,className:"w-full justify-between",disabled:m,children:[h,e.jsx(a.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(a.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(a.Command,{className:"overflow-visible",children:[e.jsx(a.CommandInput,{placeholder:"Search timezones..."}),e.jsxs(a.CommandList,{children:[e.jsx(a.CommandEmpty,{children:"No timezone found."}),e.jsx(a.CommandGroup,{heading:"Common",children:I.map(t=>e.jsxs(a.CommandItem,{value:`${t.value} ${t.label}`,onSelect:()=>{d(!0),w(t.value),y(!1)},children:[e.jsx(a.Check,{className:a.cn("mr-2 h-4 w-4",f===t.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:t.label}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t.value})]},t.value))}),e.jsx(a.CommandSeparator,{}),e.jsx(a.CommandGroup,{heading:"All Timezones",children:o.map(t=>e.jsxs(a.CommandItem,{value:t,onSelect:()=>{d(!0),w(t),y(!1)},children:[e.jsx(a.Check,{className:a.cn("mr-2 h-4 w-4",f===t?"opacity-100":"opacity-0")}),t]},t))})]})]})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(a.Label,{children:"Week Starts On"}),e.jsx(a.RadioGroup,{value:String(N),onValueChange:t=>{d(!0),C(Number(t))},className:"flex gap-4",disabled:m,children:M.map(t=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(a.RadioGroupItem,{value:String(t.value),id:`week-start-${t.value}`,disabled:m}),e.jsx(a.Label,{htmlFor:`week-start-${t.value}`,className:a.cn("cursor-pointer font-normal",m&&"cursor-not-allowed"),children:t.label})]},t.value))})]})]})]}),e.jsxs(a.DialogFooter,{children:[e.jsx(a.Button,{variant:"outline",onClick:$,disabled:D,children:"Cancel"}),e.jsx(a.Button,{onClick:_,disabled:O,children:D?e.jsxs(e.Fragment,{children:[e.jsx(a.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]})})}const k=6,z=1,U=20;function Z(s){return Number.isNaN(s)?k:Math.min(U,Math.max(z,s))}function J({open:s,onOpenChange:r,dashboard:i,onApply:S,disabled:x=!1}){const[v,j]=l.useState(!1),[b,p]=l.useState("top"),[u,m]=l.useState(String(k)),n=i.summary;l.useEffect(()=>{s&&(j((n==null?void 0:n.enabled)===!0),p((n==null?void 0:n.position)==="bottom"?"bottom":"top"),m(String((n==null?void 0:n.maxItems)??k)))},[s,n==null?void 0:n.enabled,n==null?void 0:n.position,n==null?void 0:n.maxItems]);const g=l.useMemo(()=>Z(Number.parseInt(u||`${k}`,10)),[u]),d=()=>{S({enabled:v,position:b,maxItems:g}),r(!1)};return e.jsx(a.Dialog,{open:s,onOpenChange:r,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[420px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:"Summary Settings"}),e.jsx(a.DialogDescription,{children:"Configure dashboard-level summary display. Card-level summary settings still control which cards contribute."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-enabled",children:"Enable Dashboard Summary"}),e.jsx(a.SmallSwitch,{id:"dashboard-summary-enabled",checked:v,disabled:x,onCheckedChange:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-position",children:"Position"}),e.jsxs(a.Select,{value:b,disabled:x,onValueChange:f=>p(f),children:[e.jsx(a.SelectTrigger,{id:"dashboard-summary-position",children:e.jsx(a.SelectValue,{placeholder:"Select position"})}),e.jsxs(a.SelectContent,{children:[e.jsx(a.SelectItem,{value:"top",children:"Top"}),e.jsx(a.SelectItem,{value:"bottom",children:"Bottom"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-max-items",children:"Max Items"}),e.jsx(a.Input,{id:"dashboard-summary-max-items",type:"number",min:z,max:U,disabled:x,value:u,onChange:f=>m(f.target.value),onBlur:()=>m(String(g))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Display limit only. Computation is unchanged."})]}),x&&e.jsx("p",{className:"text-xs text-amber-700",children:"Enter dashboard edit mode to modify summary settings."})]}),e.jsxs(a.DialogFooter,{children:[e.jsx(a.Button,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(a.Button,{onClick:d,disabled:x,children:"Apply"})]})]})})}exports.CalendarPreferencesDialog=q;exports.DashboardSummarySettingsDialog=J;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as oe } from "react/jsx-runtime";
|
|
2
2
|
import de, { useState as h, useCallback as L, useEffect as G, useMemo as z } from "react";
|
|
3
|
-
import { b as ue, e as X, f as Z, g as J, h as K, i as q, R as $, c as C, j as F, L as b, P as me, k as he, B as P, C as fe, l as pe, m as ve, n as be, o as Se, p as ge, q as B, r as O, s as W, t as ye, v as Y, w as we, x as A, S as xe, y as Ne, z as Ce, A as Te, E as ke, F as R, I as Ie } from "./index-
|
|
3
|
+
import { b as ue, e as X, f as Z, g as J, h as K, i as q, R as $, c as C, j as F, L as b, P as me, k as he, B as P, C as fe, l as pe, m as ve, n as be, o as Se, p as ge, q as B, r as O, s as W, t as ye, v as Y, w as we, x as A, S as xe, y as Ne, z as Ce, A as Te, E as ke, F as R, I as Ie } from "./index-DsMIsFii.js";
|
|
4
4
|
function Ee() {
|
|
5
5
|
var k, I, E, N;
|
|
6
6
|
const { authToken: a, tokenProps: r } = ue(), [l, S] = h(!1), [p, g] = h(!1), [x, y] = h(!1), [v, o] = h(null), [u, n] = h(null), w = u || {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as be } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { bL as Pe, dt as co, x as gt, M as xe, U as M, du as pn, dv as uo, L as V, y as te, z as ae, A as ne, E as se, F as _, ab as Qe, B as H, b$ as kt, dw as zn, dx as ql, dy as zl, dz as _l, dA as jl, dB as _n, a5 as Ft, X as at, dC as zs, c9 as _s, e as Ea, f as Ma, g as Oa, h as Fa, i as dn, bY as vt, bV as mt, bS as ht, bT as rt, bU as lt, dD as Zr, dE as Kl, u as Le, v as Ds, dF as Ra, ce as Ga, c as Z, db as bt, dG as Gl, b_ as Ul, dH as mo, dI as ho, dJ as po, dK as ln, dL as fo, dM as Hl, dN as go, cL as Jl, dO as xo, dP as Ql, dQ as bo, dR as js, dS as vo, dT as jt, dU as on, c0 as Ua, c1 as Ha, dV as As, c3 as Ja, c4 as ut, dW as La, dX as yo, dY as Es, dZ as En, b as ua, af as Yl, d_ as cn, d$ as Ks, e0 as No, e1 as Co, e2 as Wl, e3 as Xl, e4 as Zl, c_ as Gs, I as Ye, P as It, e5 as wo, l as Dt, e6 as So, w as ra, e7 as To, e8 as ko, H as Io, e9 as Do, bM as Qa, bN as ma, bO as ha, bP as fn, bQ as qt, bR as Da, ea as Ms, eb as la, ec as xt, ed as ia, ee as Ao, ef as Ln, eg as Pn, eh as Vn, ei as Us, dn as Pa, ej as gn, ek as Eo, R as xn, el as jn, em as Ya, cf as Hs, en as ei, j as Wt, cG as Mo, eo as Vt, ep as zt, eq as Oo, er as _t, cq as Js, cD as Qs, N as ti, es as Ys, et as Fo, eu as ai, ev as ni, ew as $t, dj as us, ex as Ro, ey as Lo, ez as Po, eA as si, aw as ri, eB as li, eC as Vo, eD as Bo, eE as $o, eF as Kn, eG as qo, eH as zo, eI as el, eJ as _o, Y as Gn, a3 as Ws, eK as jo, eL as Xs, cN as Ko, eM as tl, a6 as dt, eN as Go, d5 as Zs, d6 as er, d7 as sa, d8 as Mn, eO as Uo, dk as Ho, eP as ii, eQ as Jo, eR as Qo, cw as Un, cu as ct, eS as Yo, eT as Wo, eU as al, eV as Xo, k as Rt, cO as Hn, c8 as Pt, eW as Gt, eX as oa, eY as ca, eZ as Xt, e_ as Va, e$ as Zo, b1 as ec, f0 as tc, f1 as ac, f2 as nc, f3 as sc, cC as Aa, f4 as rc, f5 as oi, f6 as lc, f7 as ic, f8 as oc, ae as cc, f9 as dc, fa as ci, fb as uc, fc as mc, fd as hc, fe as pc, ff as fc, fg as gc, fh as Os, fi as xc, fj as bc, fk as vc, fl as Fs, fm as yc, fn as Nc, fo as Cc, fp as wc, fq as Sc, fr as Qt, fs as di, c2 as tr, cH as Tc, c5 as kc, ft as ui, fu as un, fv as Bn, fw as Ic, fx as Ba, fy as qe, fz as ze, fA as _e, fB as Dc, fC as Ac, fD as Ec, fE as Mc, fF as Ut, fG as In, fH as nl, fI as Oc, dp as mi, S as Ge, fJ as Fc, fK as Rc, fL as Lc, fM as Pc, fN as Vc, fO as Bc, m as $a, n as qa, o as za, p as _a, q as ja, r as Ka, fP as $c, fQ as qc, fR as sl, fS as zc, s as pa, fT as _c, fU as ms, fV as rl, fW as jc, fX as Tt, fY as Kc, fZ as Gc, f_ as Uc, f$ as Hc, g0 as Jc, g1 as hs, g2 as hi, g3 as Qc, g4 as Yc, g5 as Wc, g6 as $n, g7 as Xc, g8 as Zc, g9 as ar, ga as nr, gb as pi, gc as ed, ct as fi, gd as gi, ge as Jn, ds as td, gf as et, bf as ad, gg as nd, gh as sd, bb as ll, gi as il, gj as rd, gk as ld, gl as id, gm as od, gn as cd, go as dd, gp as ud, gq as md, gr as hd, gs as pd, gt as fd, gu as gd, gv as xd, gw as bd, gx as xi, gy as vd, gz as yd, gA as Nd, gB as Cd, gC as wd, gD as Sd, gE as Td, gF as kd, gG as Id, gH as Dd, gI as Ad, gJ as Ed, gK as Md, gL as bi, gM as Od, gN as Qn, gO as vi, gP as yi, gQ as Fd, gR as Rd, gS as Yn, gT as ps, gU as Ld, gV as Pd, gW as Vd, gX as Bd, gY as $d, gZ as ol, g_ as da, g$ as qd, h0 as Ni, aZ as zd, h1 as cl, cy as dl, h2 as _d, h3 as jd, h4 as Kd, h5 as On, h6 as Gd, h7 as sr, h8 as Fn, h9 as Ud, ha as Hd, hb as qn, hc as Jd, C as Qd, hd as Yd, he as Wd, hf as Xd, hg as mn, hh as Ht, hi as Rs, hj as Ls, hk as hn, hl as Ci, aX as Zd, hm as eu, hn as fs, ho as tu, hp as gs, hq as au, hr as ul, hs as ml, ht as nu, hu as su, hv as ru, hw as lu, hx as iu, hy as ou, hz as cu, hA as Wn, cb as Xn, hB as Zn, hC as hl, hD as wi, de as xs, hE as du, hF as uu, hG as mu, Z as hu } from "./index-DsMIsFii.js";
|
|
3
3
|
import * as Ps from "react";
|
|
4
4
|
import Vs, { useState as K, useRef as Re, useEffect as we, useCallback as Ie, useMemo as ce, useContext as rr, Suspense as pu } from "react";
|
|
5
|
-
import { C as pl, e as lr, u as yt, V as Si } from "./editor-action-buttons-
|
|
5
|
+
import { C as pl, e as lr, u as yt, V as Si } from "./editor-action-buttons-DNSIXb3y.js";
|
|
6
6
|
import { createPortal as fu } from "react-dom";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-9_GiUNMO.js"),N=require("react"),Ae=require("./editor-action-buttons-1cbHJIqv.js"),dn=require("react-dom");function un(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>s[a]})}}return n.default=s,Object.freeze(n)}const ns=un(N);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./index-
|
|
1
|
+
"use strict";const e=require("./index-9_GiUNMO.js"),r=require("react/jsx-runtime"),x=require("./use-visual-utils-CW_sw621.js"),f=require("react");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bL as D, U as d, bM as U, bN as te, bO as se, bP as re, bQ as le, bR as oe, u as M, ae as ne, bS as de, bT as ie, bU as ue, ab as ce, c as g, bV as pe, bW as me, M as q, B as x, s as be, H as F, N as K, J as j, bX as O, w as H, bY as X, X as G, x as C } from "./index-DsMIsFii.js";
|
|
2
2
|
import { jsx as b, jsxs as f, Fragment as T } from "react/jsx-runtime";
|
|
3
|
-
import { u as ye, a as P } from "./use-visual-utils-
|
|
3
|
+
import { u as ye, a as P } from "./use-visual-utils-BqG8Hwpl.js";
|
|
4
4
|
import { useMemo as k, useState as R } from "react";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|