react-semaphor 0.1.534 → 0.1.536
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/brand-studio/index.js +25 -25
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{calculated-field-identity-Cz1ZU_UL.js → calculated-field-identity-BptYhyOP.js} +4 -4
- package/dist/chunks/{card-config-utils-BlIiFn0O.js → card-config-utils-BOM1dxCk.js} +102 -86
- package/dist/chunks/{dashboard-CCK80YKL.js → dashboard-BTDY_I5L.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-DV_rlhT2.js +4224 -0
- package/dist/chunks/{dashboard-controls-CoiTGnEr.js → dashboard-controls-B4LxN5dr.js} +862 -873
- package/dist/chunks/{dashboard-json-BRGozO--.js → dashboard-json-Ccjo0Dzw.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CZFnhGZQ.js → edit-dashboard-visual-L5zsle6X.js} +9922 -9900
- package/dist/chunks/{index-BQl5rC54.js → index-DTcTAGGM.js} +1 -1
- package/dist/chunks/{matrix-control-sources-Tls-h3AN.js → matrix-control-sources-DTqcA2_L.js} +1 -1
- package/dist/chunks/report-preferences-dialog-CW8VEIDx.js +1623 -0
- package/dist/chunks/{layout-grid-CiubineE.js → save-kO6cIaob.js} +20 -2
- package/dist/chunks/{semaphor-ready-indicator-z4SNdxiC.js → semaphor-ready-indicator-3TXTZgw-.js} +65377 -79784
- package/dist/chunks/shelf-drop-preview-context-CBCs9rjz.js +2404 -0
- package/dist/chunks/{switch-BR3Xgbqr.js → switch-CKB-kUaC.js} +4355 -4779
- package/dist/chunks/upload-CAIpsti1.js +15 -0
- package/dist/chunks/use-create-flow-overlay-state-Bk-SBnaY.js +1457 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +4 -4
- package/dist/index.js +221 -220
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/surfboard/controls/dashboard-filter-controls-launcher.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard-query.d.ts +0 -2
- package/dist/types/lib/hooks/use-dashboard.d.ts +0 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +1 -11
- package/dist/types/lib/stores/editor-store.d.ts +1 -10
- package/dist/types/lib/types/ai-context-types.d.ts +20 -0
- package/dist/types/lib/types/common-types.d.ts +1 -20
- package/dist/types/lib/types/token-types.d.ts +0 -7
- package/dist/types/lib/utils.d.ts +0 -2
- package/package.json +1 -7
- package/dist/chunks/dashboard-briefing-launcher-B9Fq2Rf3.js +0 -3489
- package/dist/chunks/editor-action-buttons-CVtSO3I3.js +0 -2067
- package/dist/chunks/report-preferences-dialog-CWdTlWsr.js +0 -1231
- package/dist/chunks/save-DgMfP0j8.js +0 -21
- package/dist/chunks/slider-DbwmuVB-.js +0 -875
- package/dist/dashboard-assistant/index.js +0 -11
- package/dist/types/dashboard-assistant/index.d.ts +0 -80
- package/dist/types/dashboard-assistant.d.ts +0 -2
- package/dist/types/lib/types/assistant-types.d.ts +0 -127
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsx as t, jsxs as i, Fragment as
|
|
2
|
-
import { u as D, B as
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import { d as
|
|
8
|
-
import "./
|
|
9
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as i, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { u as D, B as T, aP as Gr, aQ as Vr, aR as Xe, c as be, aO as C, aS as ge, aT as at, aU as Ht, L as Pe, m as jr, s as Hr, t as qr, v as zr, w as Kr, x as Qr, aV as Wr, aW as St, aX as Yr, P as Jr, a as Xr, b as Zr, aK as ea, a1 as kt, n as Ct, o as Dt, p as Et, q as It, I as ta, D as ra } from "./switch-CKB-kUaC.js";
|
|
3
|
+
import { bd as aa, be as na, bf as nt, bg as oa, bh as sa, bi as ia, bj as da, bk as la, bl as ca, aK as q, aI as xe, bm as ve, bn as ua, b8 as qt, b9 as zt, bb as Ze, bc as et, bo as Kt, av as ot, aE as ee, bp as ma, bq as ha, br as Qt, bs as pa, bt as Wt, ba as fa, bu as ba, bv as R, bw as ga, bx as At, by as xa, bz as va, bA as ya, bB as wa, ag as Na, aW as Sa, bC as ka, bD as Ca, bE as Da, f as Ea, u as Le, l as Ia, g as Qe, bF as Aa, bG as La, bH as Ma, bI as Oa, y as Pa, bJ as _a, bK as Ra, bL as Ua, aY as Ta, bM as $a, bN as Fa, bO as Ba, bP as Lt, bQ as Mt, bR as Ot, bS as Ga, bT as Va, bU as ja, bV as Ha, bW as Me, bX as qa, bY as za, bZ as We, b_ as Pt, k as Ka, b$ as Qa, c0 as Wa, c1 as Ya, c2 as Ja, c3 as Xa, c4 as Za, c5 as en, c6 as tn, c7 as _t } from "./semaphor-ready-indicator-3TXTZgw-.js";
|
|
4
|
+
import { c as te, X as Yt, C as rn } from "./x-CXDkqdur.js";
|
|
5
|
+
import * as I from "react";
|
|
6
|
+
import Jt, { useMemo as V, useState as S, useEffect as _e, useRef as Rt, useLayoutEffect as an } from "react";
|
|
7
|
+
import { d as nn, c as on, u as sn, A as dn, a as ln, g as cn, V as un, N as mn, h as hn, U as pn } from "./dashboard-briefing-launcher-DV_rlhT2.js";
|
|
8
|
+
import { I as Ut } from "./use-create-flow-overlay-state-Bk-SBnaY.js";
|
|
9
|
+
import "./card-config-utils-BOM1dxCk.js";
|
|
10
|
+
import { createPortal as fn } from "react-dom";
|
|
10
11
|
import "./validators-DMSH81OM.js";
|
|
11
12
|
import "./matrix-operation-contract-BKupLHXL.js";
|
|
12
13
|
import "zod";
|
|
13
14
|
import "../value-format-preferences/index.js";
|
|
14
|
-
import { S as
|
|
15
|
-
import { k as
|
|
16
|
-
import { I as
|
|
17
|
-
import { R as
|
|
18
|
-
import { r as
|
|
19
|
-
import { u as
|
|
20
|
-
import { s as
|
|
21
|
-
import { k as
|
|
22
|
-
import { S as
|
|
23
|
-
import { P as
|
|
24
|
-
import { B as
|
|
15
|
+
import { S as bn, C as gn } from "./selection-reducer-CiDEtmAq.js";
|
|
16
|
+
import { k as Xt } from "./matrix-formatter-DJCk8Znf.js";
|
|
17
|
+
import { I as tt } from "./calculated-field-identity-BptYhyOP.js";
|
|
18
|
+
import { R as xn } from "./report-preferences-dialog-CW8VEIDx.js";
|
|
19
|
+
import { r as vn } from "./pivot-result-lifecycle-DQz_gjGu.js";
|
|
20
|
+
import { u as yn } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
21
|
+
import { s as wn } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
|
|
22
|
+
import { k as Re, h as Tt } from "./bookmark-state-B-I9BDD0.js";
|
|
23
|
+
import { S as Nn } from "./save-kO6cIaob.js";
|
|
24
|
+
import { P as Sn } from "./palette-Cp1hqZtm.js";
|
|
25
|
+
import { B as kn } from "./braces-8TRlDwDw.js";
|
|
25
26
|
/**
|
|
26
27
|
* @license lucide-react v0.453.0 - ISC
|
|
27
28
|
*
|
|
28
29
|
* This source code is licensed under the ISC license.
|
|
29
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
30
31
|
*/
|
|
31
|
-
const
|
|
32
|
+
const Cn = te("Monitor", [
|
|
32
33
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
33
34
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
34
35
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
@@ -39,7 +40,7 @@ const Mn = ae("Monitor", [
|
|
|
39
40
|
* This source code is licensed under the ISC license.
|
|
40
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
42
|
*/
|
|
42
|
-
const
|
|
43
|
+
const Dn = te("Moon", [
|
|
43
44
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
44
45
|
]);
|
|
45
46
|
/**
|
|
@@ -48,7 +49,7 @@ const Ln = ae("Moon", [
|
|
|
48
49
|
* This source code is licensed under the ISC license.
|
|
49
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
50
51
|
*/
|
|
51
|
-
const
|
|
52
|
+
const En = te("ShieldX", [
|
|
52
53
|
[
|
|
53
54
|
"path",
|
|
54
55
|
{
|
|
@@ -65,7 +66,7 @@ const On = ae("ShieldX", [
|
|
|
65
66
|
* This source code is licensed under the ISC license.
|
|
66
67
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
68
|
*/
|
|
68
|
-
const
|
|
69
|
+
const In = te("Sun", [
|
|
69
70
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
70
71
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
71
72
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -82,7 +83,7 @@ const Pn = ae("Sun", [
|
|
|
82
83
|
* This source code is licensed under the ISC license.
|
|
83
84
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
85
|
*/
|
|
85
|
-
const
|
|
86
|
+
const An = te("UserPlus", [
|
|
86
87
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
87
88
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
88
89
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
@@ -94,138 +95,21 @@ const _n = ae("UserPlus", [
|
|
|
94
95
|
* This source code is licensed under the ISC license.
|
|
95
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
97
|
*/
|
|
97
|
-
const
|
|
98
|
+
const Zt = te("UserRound", [
|
|
98
99
|
["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
|
|
99
100
|
["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
|
|
100
|
-
]);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* @license React
|
|
104
|
-
* use-sync-external-store-shim.production.js
|
|
105
|
-
*
|
|
106
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the MIT license found in the
|
|
109
|
-
* LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/
|
|
111
|
-
var qt;
|
|
112
|
-
function Rn() {
|
|
113
|
-
if (qt) return tt;
|
|
114
|
-
qt = 1;
|
|
115
|
-
var e = nr;
|
|
116
|
-
function n(c, u) {
|
|
117
|
-
return c === u && (c !== 0 || 1 / c === 1 / u) || c !== c && u !== u;
|
|
118
|
-
}
|
|
119
|
-
var a = typeof Object.is == "function" ? Object.is : n, r = e.useState, o = e.useEffect, d = e.useLayoutEffect, m = e.useDebugValue;
|
|
120
|
-
function h(c, u) {
|
|
121
|
-
var s = u(), x = r({ inst: { value: s, getSnapshot: u } }), v = x[0].inst, w = x[1];
|
|
122
|
-
return d(
|
|
123
|
-
function() {
|
|
124
|
-
v.value = s, v.getSnapshot = u, b(v) && w({ inst: v });
|
|
125
|
-
},
|
|
126
|
-
[c, s, u]
|
|
127
|
-
), o(
|
|
128
|
-
function() {
|
|
129
|
-
return b(v) && w({ inst: v }), c(function() {
|
|
130
|
-
b(v) && w({ inst: v });
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
[c]
|
|
134
|
-
), m(s), s;
|
|
135
|
-
}
|
|
136
|
-
function b(c) {
|
|
137
|
-
var u = c.getSnapshot;
|
|
138
|
-
c = c.value;
|
|
139
|
-
try {
|
|
140
|
-
var s = u();
|
|
141
|
-
return !a(c, s);
|
|
142
|
-
} catch {
|
|
143
|
-
return !0;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function f(c, u) {
|
|
147
|
-
return u();
|
|
148
|
-
}
|
|
149
|
-
var g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : h;
|
|
150
|
-
return tt.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : g, tt;
|
|
151
|
-
}
|
|
152
|
-
var rt = {};
|
|
153
|
-
/**
|
|
154
|
-
* @license React
|
|
155
|
-
* use-sync-external-store-shim.development.js
|
|
156
|
-
*
|
|
157
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the MIT license found in the
|
|
160
|
-
* LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/
|
|
162
|
-
var zt;
|
|
163
|
-
function Un() {
|
|
164
|
-
return zt || (zt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
165
|
-
function e(s, x) {
|
|
166
|
-
return s === x && (s !== 0 || 1 / s === 1 / x) || s !== s && x !== x;
|
|
167
|
-
}
|
|
168
|
-
function n(s, x) {
|
|
169
|
-
g || o.startTransition === void 0 || (g = !0, console.error(
|
|
170
|
-
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
171
|
-
));
|
|
172
|
-
var v = x();
|
|
173
|
-
if (!c) {
|
|
174
|
-
var w = x();
|
|
175
|
-
d(v, w) || (console.error(
|
|
176
|
-
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
177
|
-
), c = !0);
|
|
178
|
-
}
|
|
179
|
-
w = m({
|
|
180
|
-
inst: { value: v, getSnapshot: x }
|
|
181
|
-
});
|
|
182
|
-
var S = w[0].inst, p = w[1];
|
|
183
|
-
return b(
|
|
184
|
-
function() {
|
|
185
|
-
S.value = v, S.getSnapshot = x, a(S) && p({ inst: S });
|
|
186
|
-
},
|
|
187
|
-
[s, v, x]
|
|
188
|
-
), h(
|
|
189
|
-
function() {
|
|
190
|
-
return a(S) && p({ inst: S }), s(function() {
|
|
191
|
-
a(S) && p({ inst: S });
|
|
192
|
-
});
|
|
193
|
-
},
|
|
194
|
-
[s]
|
|
195
|
-
), f(v), v;
|
|
196
|
-
}
|
|
197
|
-
function a(s) {
|
|
198
|
-
var x = s.getSnapshot;
|
|
199
|
-
s = s.value;
|
|
200
|
-
try {
|
|
201
|
-
var v = x();
|
|
202
|
-
return !d(s, v);
|
|
203
|
-
} catch {
|
|
204
|
-
return !0;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function r(s, x) {
|
|
208
|
-
return x();
|
|
209
|
-
}
|
|
210
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
211
|
-
var o = nr, d = typeof Object.is == "function" ? Object.is : e, m = o.useState, h = o.useEffect, b = o.useLayoutEffect, f = o.useDebugValue, g = !1, c = !1, u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
|
|
212
|
-
rt.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : u, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
213
|
-
}()), rt;
|
|
214
|
-
}
|
|
215
|
-
process.env.NODE_ENV === "production" ? it.exports = Rn() : it.exports = Un();
|
|
216
|
-
var Tn = it.exports;
|
|
217
|
-
const _e = ["light", "dark", "system"];
|
|
218
|
-
function $n() {
|
|
219
|
-
const { theme: e, setTheme: n } = da(), a = D(
|
|
101
|
+
]), Oe = ["light", "dark", "system"];
|
|
102
|
+
function Ln() {
|
|
103
|
+
const { theme: e, setTheme: n } = aa(), a = D(
|
|
220
104
|
(m) => m.actions.setDashboardTheme
|
|
221
105
|
);
|
|
222
106
|
function r() {
|
|
223
|
-
const m =
|
|
224
|
-
n(
|
|
107
|
+
const m = Oe.includes(e) ? e : "system", p = Oe[(Oe.indexOf(m) + 1) % Oe.length];
|
|
108
|
+
n(p), a(p);
|
|
225
109
|
}
|
|
226
|
-
const o = e === "light" ?
|
|
110
|
+
const o = e === "light" ? In : e === "dark" ? Dn : Cn, d = e === "light" ? "Theme: light (click for dark)" : e === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
227
111
|
return /* @__PURE__ */ t(
|
|
228
|
-
|
|
112
|
+
T,
|
|
229
113
|
{
|
|
230
114
|
type: "button",
|
|
231
115
|
variant: "ghost",
|
|
@@ -238,19 +122,19 @@ function $n() {
|
|
|
238
122
|
}
|
|
239
123
|
);
|
|
240
124
|
}
|
|
241
|
-
function
|
|
242
|
-
const { displayPreferences: e, shouldShowElement: n } =
|
|
243
|
-
() =>
|
|
125
|
+
function Mn() {
|
|
126
|
+
const { displayPreferences: e, shouldShowElement: n } = na(), { currentUser: a, userContext: r } = nt(), o = V(
|
|
127
|
+
() => oa(a),
|
|
244
128
|
[a]
|
|
245
|
-
), d =
|
|
129
|
+
), d = V(() => (p) => o && o[p] !== void 0 && o[p] === !1 ? !1 : n(p), [o, n, e]), m = V(
|
|
246
130
|
() => {
|
|
247
|
-
var
|
|
131
|
+
var p, b, f, g, l;
|
|
248
132
|
return {
|
|
249
|
-
canEdit: ((
|
|
250
|
-
canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ??
|
|
251
|
-
canManageDashboards: ((f = r == null ? void 0 : r.permissions) == null ? void 0 : f.canCreateDashboard) ??
|
|
252
|
-
canCreateDashboards: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canCreateDashboard) ??
|
|
253
|
-
canAccessVisuals: ((
|
|
133
|
+
canEdit: ((p = r == null ? void 0 : r.permissions) == null ? void 0 : p.canEdit) ?? ca(a),
|
|
134
|
+
canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ?? la(a),
|
|
135
|
+
canManageDashboards: ((f = r == null ? void 0 : r.permissions) == null ? void 0 : f.canCreateDashboard) ?? da(a),
|
|
136
|
+
canCreateDashboards: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canCreateDashboard) ?? ia(a),
|
|
137
|
+
canAccessVisuals: ((l = r == null ? void 0 : r.permissions) == null ? void 0 : l.canEdit) ?? sa(a)
|
|
254
138
|
};
|
|
255
139
|
},
|
|
256
140
|
[a, r]
|
|
@@ -262,41 +146,41 @@ function Fn() {
|
|
|
262
146
|
currentUser: a
|
|
263
147
|
};
|
|
264
148
|
}
|
|
265
|
-
function
|
|
149
|
+
function On(e, n = []) {
|
|
266
150
|
let a = [];
|
|
267
151
|
function r(d, m) {
|
|
268
|
-
const
|
|
269
|
-
|
|
152
|
+
const p = I.createContext(m);
|
|
153
|
+
p.displayName = d + "Context";
|
|
270
154
|
const b = a.length;
|
|
271
155
|
a = [...a, m];
|
|
272
|
-
const f = (
|
|
273
|
-
var
|
|
274
|
-
const { scope:
|
|
156
|
+
const f = (l) => {
|
|
157
|
+
var h;
|
|
158
|
+
const { scope: c, children: s, ...x } = l, v = ((h = c == null ? void 0 : c[e]) == null ? void 0 : h[b]) || p, w = I.useMemo(() => x, Object.values(x));
|
|
275
159
|
return /* @__PURE__ */ t(v.Provider, { value: w, children: s });
|
|
276
160
|
};
|
|
277
161
|
f.displayName = d + "Provider";
|
|
278
|
-
function g(
|
|
162
|
+
function g(l, c) {
|
|
279
163
|
var v;
|
|
280
|
-
const s = ((v =
|
|
164
|
+
const s = ((v = c == null ? void 0 : c[e]) == null ? void 0 : v[b]) || p, x = I.useContext(s);
|
|
281
165
|
if (x) return x;
|
|
282
166
|
if (m !== void 0) return m;
|
|
283
|
-
throw new Error(`\`${
|
|
167
|
+
throw new Error(`\`${l}\` must be used within \`${d}\``);
|
|
284
168
|
}
|
|
285
169
|
return [f, g];
|
|
286
170
|
}
|
|
287
171
|
const o = () => {
|
|
288
|
-
const d = a.map((m) =>
|
|
289
|
-
return function(
|
|
290
|
-
const b = (
|
|
291
|
-
return
|
|
292
|
-
() => ({ [`__scope${e}`]: { ...
|
|
293
|
-
[
|
|
172
|
+
const d = a.map((m) => I.createContext(m));
|
|
173
|
+
return function(p) {
|
|
174
|
+
const b = (p == null ? void 0 : p[e]) || d;
|
|
175
|
+
return I.useMemo(
|
|
176
|
+
() => ({ [`__scope${e}`]: { ...p, [e]: b } }),
|
|
177
|
+
[p, b]
|
|
294
178
|
);
|
|
295
179
|
};
|
|
296
180
|
};
|
|
297
|
-
return o.scopeName = e, [r,
|
|
181
|
+
return o.scopeName = e, [r, Pn(o, ...n)];
|
|
298
182
|
}
|
|
299
|
-
function
|
|
183
|
+
function Pn(...e) {
|
|
300
184
|
const n = e[0];
|
|
301
185
|
if (e.length === 1) return n;
|
|
302
186
|
const a = () => {
|
|
@@ -305,16 +189,16 @@ function Gn(...e) {
|
|
|
305
189
|
scopeName: o.scopeName
|
|
306
190
|
}));
|
|
307
191
|
return function(d) {
|
|
308
|
-
const m = r.reduce((
|
|
309
|
-
const
|
|
310
|
-
return { ...
|
|
192
|
+
const m = r.reduce((p, { useScope: b, scopeName: f }) => {
|
|
193
|
+
const l = b(d)[`__scope${f}`];
|
|
194
|
+
return { ...p, ...l };
|
|
311
195
|
}, {});
|
|
312
|
-
return
|
|
196
|
+
return I.useMemo(() => ({ [`__scope${n.scopeName}`]: m }), [m]);
|
|
313
197
|
};
|
|
314
198
|
};
|
|
315
199
|
return a.scopeName = n.scopeName, a;
|
|
316
200
|
}
|
|
317
|
-
var
|
|
201
|
+
var _n = [
|
|
318
202
|
"a",
|
|
319
203
|
"button",
|
|
320
204
|
"div",
|
|
@@ -332,75 +216,190 @@ var Vn = [
|
|
|
332
216
|
"span",
|
|
333
217
|
"svg",
|
|
334
218
|
"ul"
|
|
335
|
-
],
|
|
336
|
-
const a =
|
|
337
|
-
const { asChild: m, ...
|
|
338
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ t(b, { ...
|
|
219
|
+
], st = _n.reduce((e, n) => {
|
|
220
|
+
const a = Gr(`Primitive.${n}`), r = I.forwardRef((o, d) => {
|
|
221
|
+
const { asChild: m, ...p } = o, b = m ? a : n;
|
|
222
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ t(b, { ...p, ref: d });
|
|
339
223
|
});
|
|
340
224
|
return r.displayName = `Primitive.${n}`, { ...e, [n]: r };
|
|
341
|
-
}, {});
|
|
342
|
-
|
|
225
|
+
}, {}), rt = { exports: {} }, Ye = {};
|
|
226
|
+
/**
|
|
227
|
+
* @license React
|
|
228
|
+
* use-sync-external-store-shim.production.js
|
|
229
|
+
*
|
|
230
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the MIT license found in the
|
|
233
|
+
* LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/
|
|
235
|
+
var $t;
|
|
236
|
+
function Rn() {
|
|
237
|
+
if ($t) return Ye;
|
|
238
|
+
$t = 1;
|
|
239
|
+
var e = Jt;
|
|
240
|
+
function n(l, c) {
|
|
241
|
+
return l === c && (l !== 0 || 1 / l === 1 / c) || l !== l && c !== c;
|
|
242
|
+
}
|
|
243
|
+
var a = typeof Object.is == "function" ? Object.is : n, r = e.useState, o = e.useEffect, d = e.useLayoutEffect, m = e.useDebugValue;
|
|
244
|
+
function p(l, c) {
|
|
245
|
+
var s = c(), x = r({ inst: { value: s, getSnapshot: c } }), v = x[0].inst, w = x[1];
|
|
246
|
+
return d(
|
|
247
|
+
function() {
|
|
248
|
+
v.value = s, v.getSnapshot = c, b(v) && w({ inst: v });
|
|
249
|
+
},
|
|
250
|
+
[l, s, c]
|
|
251
|
+
), o(
|
|
252
|
+
function() {
|
|
253
|
+
return b(v) && w({ inst: v }), l(function() {
|
|
254
|
+
b(v) && w({ inst: v });
|
|
255
|
+
});
|
|
256
|
+
},
|
|
257
|
+
[l]
|
|
258
|
+
), m(s), s;
|
|
259
|
+
}
|
|
260
|
+
function b(l) {
|
|
261
|
+
var c = l.getSnapshot;
|
|
262
|
+
l = l.value;
|
|
263
|
+
try {
|
|
264
|
+
var s = c();
|
|
265
|
+
return !a(l, s);
|
|
266
|
+
} catch {
|
|
267
|
+
return !0;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
function f(l, c) {
|
|
271
|
+
return c();
|
|
272
|
+
}
|
|
273
|
+
var g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : p;
|
|
274
|
+
return Ye.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : g, Ye;
|
|
275
|
+
}
|
|
276
|
+
var Je = {};
|
|
277
|
+
/**
|
|
278
|
+
* @license React
|
|
279
|
+
* use-sync-external-store-shim.development.js
|
|
280
|
+
*
|
|
281
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the MIT license found in the
|
|
284
|
+
* LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/
|
|
286
|
+
var Ft;
|
|
287
|
+
function Un() {
|
|
288
|
+
return Ft || (Ft = 1, process.env.NODE_ENV !== "production" && function() {
|
|
289
|
+
function e(s, x) {
|
|
290
|
+
return s === x && (s !== 0 || 1 / s === 1 / x) || s !== s && x !== x;
|
|
291
|
+
}
|
|
292
|
+
function n(s, x) {
|
|
293
|
+
g || o.startTransition === void 0 || (g = !0, console.error(
|
|
294
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
295
|
+
));
|
|
296
|
+
var v = x();
|
|
297
|
+
if (!l) {
|
|
298
|
+
var w = x();
|
|
299
|
+
d(v, w) || (console.error(
|
|
300
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
301
|
+
), l = !0);
|
|
302
|
+
}
|
|
303
|
+
w = m({
|
|
304
|
+
inst: { value: v, getSnapshot: x }
|
|
305
|
+
});
|
|
306
|
+
var h = w[0].inst, E = w[1];
|
|
307
|
+
return b(
|
|
308
|
+
function() {
|
|
309
|
+
h.value = v, h.getSnapshot = x, a(h) && E({ inst: h });
|
|
310
|
+
},
|
|
311
|
+
[s, v, x]
|
|
312
|
+
), p(
|
|
313
|
+
function() {
|
|
314
|
+
return a(h) && E({ inst: h }), s(function() {
|
|
315
|
+
a(h) && E({ inst: h });
|
|
316
|
+
});
|
|
317
|
+
},
|
|
318
|
+
[s]
|
|
319
|
+
), f(v), v;
|
|
320
|
+
}
|
|
321
|
+
function a(s) {
|
|
322
|
+
var x = s.getSnapshot;
|
|
323
|
+
s = s.value;
|
|
324
|
+
try {
|
|
325
|
+
var v = x();
|
|
326
|
+
return !d(s, v);
|
|
327
|
+
} catch {
|
|
328
|
+
return !0;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function r(s, x) {
|
|
332
|
+
return x();
|
|
333
|
+
}
|
|
334
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
335
|
+
var o = Jt, d = typeof Object.is == "function" ? Object.is : e, m = o.useState, p = o.useEffect, b = o.useLayoutEffect, f = o.useDebugValue, g = !1, l = !1, c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
|
|
336
|
+
Je.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : c, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
337
|
+
}()), Je;
|
|
338
|
+
}
|
|
339
|
+
process.env.NODE_ENV === "production" ? rt.exports = Rn() : rt.exports = Un();
|
|
340
|
+
var Tn = rt.exports;
|
|
341
|
+
function $n() {
|
|
343
342
|
return Tn.useSyncExternalStore(
|
|
344
|
-
|
|
343
|
+
Fn,
|
|
345
344
|
() => !0,
|
|
346
345
|
() => !1
|
|
347
346
|
);
|
|
348
347
|
}
|
|
349
|
-
function
|
|
348
|
+
function Fn() {
|
|
350
349
|
return () => {
|
|
351
350
|
};
|
|
352
351
|
}
|
|
353
|
-
var
|
|
352
|
+
var it = "Avatar", [Bn] = On(it), [Gn, er] = Bn(it), tr = I.forwardRef(
|
|
354
353
|
(e, n) => {
|
|
355
|
-
const { __scopeAvatar: a, ...r } = e, [o, d] =
|
|
354
|
+
const { __scopeAvatar: a, ...r } = e, [o, d] = I.useState("idle");
|
|
356
355
|
return /* @__PURE__ */ t(
|
|
357
|
-
|
|
356
|
+
Gn,
|
|
358
357
|
{
|
|
359
358
|
scope: a,
|
|
360
359
|
imageLoadingStatus: o,
|
|
361
360
|
onImageLoadingStatusChange: d,
|
|
362
|
-
children: /* @__PURE__ */ t(
|
|
361
|
+
children: /* @__PURE__ */ t(st.span, { ...r, ref: n })
|
|
363
362
|
}
|
|
364
363
|
);
|
|
365
364
|
}
|
|
366
365
|
);
|
|
367
|
-
|
|
368
|
-
var
|
|
366
|
+
tr.displayName = it;
|
|
367
|
+
var rr = "AvatarImage", ar = I.forwardRef(
|
|
369
368
|
(e, n) => {
|
|
370
369
|
const { __scopeAvatar: a, src: r, onLoadingStatusChange: o = () => {
|
|
371
|
-
}, ...d } = e, m =
|
|
370
|
+
}, ...d } = e, m = er(rr, a), p = Vn(r, d), b = Vr((f) => {
|
|
372
371
|
o(f), m.onImageLoadingStatusChange(f);
|
|
373
372
|
});
|
|
374
|
-
return
|
|
375
|
-
|
|
376
|
-
}, [
|
|
373
|
+
return Xe(() => {
|
|
374
|
+
p !== "idle" && b(p);
|
|
375
|
+
}, [p, b]), p === "loaded" ? /* @__PURE__ */ t(st.img, { ...d, ref: n, src: r }) : null;
|
|
377
376
|
}
|
|
378
377
|
);
|
|
379
|
-
|
|
380
|
-
var
|
|
378
|
+
ar.displayName = rr;
|
|
379
|
+
var nr = "AvatarFallback", or = I.forwardRef(
|
|
381
380
|
(e, n) => {
|
|
382
|
-
const { __scopeAvatar: a, delayMs: r, ...o } = e, d =
|
|
383
|
-
return
|
|
381
|
+
const { __scopeAvatar: a, delayMs: r, ...o } = e, d = er(nr, a), [m, p] = I.useState(r === void 0);
|
|
382
|
+
return I.useEffect(() => {
|
|
384
383
|
if (r !== void 0) {
|
|
385
|
-
const b = window.setTimeout(() =>
|
|
384
|
+
const b = window.setTimeout(() => p(!0), r);
|
|
386
385
|
return () => window.clearTimeout(b);
|
|
387
386
|
}
|
|
388
|
-
}, [r]), m && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ t(
|
|
387
|
+
}, [r]), m && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ t(st.span, { ...o, ref: n }) : null;
|
|
389
388
|
}
|
|
390
389
|
);
|
|
391
|
-
|
|
392
|
-
function
|
|
390
|
+
or.displayName = nr;
|
|
391
|
+
function Bt(e, n) {
|
|
393
392
|
return e ? n ? (e.src !== n && (e.src = n), e.complete && e.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
394
393
|
}
|
|
395
|
-
function
|
|
396
|
-
const r =
|
|
397
|
-
() =>
|
|
394
|
+
function Vn(e, { referrerPolicy: n, crossOrigin: a }) {
|
|
395
|
+
const r = $n(), o = I.useRef(null), d = r ? (o.current || (o.current = new window.Image()), o.current) : null, [m, p] = I.useState(
|
|
396
|
+
() => Bt(d, e)
|
|
398
397
|
);
|
|
399
|
-
return
|
|
400
|
-
|
|
401
|
-
}, [d, e]),
|
|
402
|
-
const b = (
|
|
403
|
-
|
|
398
|
+
return Xe(() => {
|
|
399
|
+
p(Bt(d, e));
|
|
400
|
+
}, [d, e]), Xe(() => {
|
|
401
|
+
const b = (l) => () => {
|
|
402
|
+
p(l);
|
|
404
403
|
};
|
|
405
404
|
if (!d) return;
|
|
406
405
|
const f = b("loaded"), g = b("error");
|
|
@@ -409,108 +408,108 @@ function Kn(e, { referrerPolicy: n, crossOrigin: a }) {
|
|
|
409
408
|
};
|
|
410
409
|
}, [d, a, n]), m;
|
|
411
410
|
}
|
|
412
|
-
var
|
|
413
|
-
const
|
|
414
|
-
|
|
411
|
+
var sr = tr, ir = ar, dr = or;
|
|
412
|
+
const lr = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
413
|
+
sr,
|
|
415
414
|
{
|
|
416
415
|
ref: a,
|
|
417
|
-
className:
|
|
416
|
+
className: be(
|
|
418
417
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
419
418
|
e
|
|
420
419
|
),
|
|
421
420
|
...n
|
|
422
421
|
}
|
|
423
422
|
));
|
|
424
|
-
|
|
425
|
-
const
|
|
426
|
-
|
|
423
|
+
lr.displayName = sr.displayName;
|
|
424
|
+
const jn = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
425
|
+
ir,
|
|
427
426
|
{
|
|
428
427
|
ref: a,
|
|
429
|
-
className:
|
|
428
|
+
className: be("aspect-square h-full w-full", e),
|
|
430
429
|
...n
|
|
431
430
|
}
|
|
432
431
|
));
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
-
|
|
432
|
+
jn.displayName = ir.displayName;
|
|
433
|
+
const cr = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
434
|
+
dr,
|
|
436
435
|
{
|
|
437
436
|
ref: a,
|
|
438
|
-
className:
|
|
437
|
+
className: be(
|
|
439
438
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
440
439
|
e
|
|
441
440
|
),
|
|
442
441
|
...n
|
|
443
442
|
}
|
|
444
443
|
));
|
|
445
|
-
|
|
446
|
-
const
|
|
444
|
+
cr.displayName = dr.displayName;
|
|
445
|
+
const Hn = async (e, n, a) => {
|
|
447
446
|
const r = `${e}/management/v1/groups`;
|
|
448
|
-
return await
|
|
449
|
-
},
|
|
447
|
+
return await Ht(r, n, a);
|
|
448
|
+
}, qn = async (e, n, a, r) => {
|
|
450
449
|
const o = `${e}/management/v1/groups/${a}`;
|
|
451
|
-
return
|
|
452
|
-
},
|
|
450
|
+
return at(o, n, "PATCH", r);
|
|
451
|
+
}, zn = async (e, n, a) => {
|
|
453
452
|
const r = `${e}/management/v1/groups/${a}`;
|
|
454
|
-
await
|
|
455
|
-
},
|
|
453
|
+
await at(r, n, "DELETE");
|
|
454
|
+
}, Kn = async (e, n, a, r) => {
|
|
456
455
|
const o = `${e}/management/v1/groups/${a}/members`;
|
|
457
|
-
return await
|
|
458
|
-
},
|
|
456
|
+
return await Ht(o, n, r);
|
|
457
|
+
}, Qn = async (e, n, a, r) => {
|
|
459
458
|
const o = `${e}/management/v1/groups/${a}/members`;
|
|
460
|
-
await
|
|
459
|
+
await at(o, n, "DELETE", r);
|
|
461
460
|
};
|
|
462
|
-
function
|
|
463
|
-
const { authToken: e, tokenProps: n } =
|
|
464
|
-
return
|
|
465
|
-
mutationFn: (r) =>
|
|
461
|
+
function Wn() {
|
|
462
|
+
const { authToken: e, tokenProps: n } = q(), a = xe();
|
|
463
|
+
return ve({
|
|
464
|
+
mutationFn: (r) => Hn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r),
|
|
466
465
|
onSuccess: () => {
|
|
467
466
|
a.invalidateQueries({ queryKey: ["groups"] }), C.success("Group created successfully");
|
|
468
467
|
},
|
|
469
468
|
onError: (r) => {
|
|
470
469
|
console.error("Failed to create group:", r), C.error("Failed to create group", {
|
|
471
|
-
description:
|
|
470
|
+
description: ge(r, "Failed to create group")
|
|
472
471
|
});
|
|
473
472
|
}
|
|
474
473
|
});
|
|
475
474
|
}
|
|
476
|
-
function
|
|
477
|
-
const { authToken: e, tokenProps: n } =
|
|
478
|
-
return
|
|
475
|
+
function Yn() {
|
|
476
|
+
const { authToken: e, tokenProps: n } = q(), a = xe();
|
|
477
|
+
return ve({
|
|
479
478
|
mutationFn: ({
|
|
480
479
|
groupId: r,
|
|
481
480
|
data: o
|
|
482
|
-
}) =>
|
|
481
|
+
}) => qn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, o),
|
|
483
482
|
onSuccess: (r, o) => {
|
|
484
483
|
a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({ queryKey: ["groups"] }), C.success("Group updated successfully");
|
|
485
484
|
},
|
|
486
485
|
onError: (r) => {
|
|
487
486
|
console.error("Failed to update group:", r), C.error("Failed to update group", {
|
|
488
|
-
description:
|
|
487
|
+
description: ge(r, "Failed to update group")
|
|
489
488
|
});
|
|
490
489
|
}
|
|
491
490
|
});
|
|
492
491
|
}
|
|
493
|
-
function
|
|
494
|
-
const { authToken: e, tokenProps: n } =
|
|
495
|
-
return
|
|
496
|
-
mutationFn: (r) =>
|
|
492
|
+
function Jn() {
|
|
493
|
+
const { authToken: e, tokenProps: n } = q(), a = xe();
|
|
494
|
+
return ve({
|
|
495
|
+
mutationFn: (r) => zn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r),
|
|
497
496
|
onSuccess: (r, o) => {
|
|
498
497
|
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", o] }), C.success("Group deleted successfully");
|
|
499
498
|
},
|
|
500
499
|
onError: (r) => {
|
|
501
500
|
console.error("Failed to delete group:", r), C.error("Failed to delete group", {
|
|
502
|
-
description:
|
|
501
|
+
description: ge(r, "Failed to delete group")
|
|
503
502
|
});
|
|
504
503
|
}
|
|
505
504
|
});
|
|
506
505
|
}
|
|
507
|
-
function
|
|
508
|
-
const { authToken: e, tokenProps: n } =
|
|
509
|
-
return
|
|
506
|
+
function Xn() {
|
|
507
|
+
const { authToken: e, tokenProps: n } = q(), a = xe();
|
|
508
|
+
return ve({
|
|
510
509
|
mutationFn: ({
|
|
511
510
|
groupId: r,
|
|
512
511
|
data: o
|
|
513
|
-
}) =>
|
|
512
|
+
}) => Kn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, o),
|
|
514
513
|
onSuccess: (r, o) => {
|
|
515
514
|
a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
|
|
516
515
|
queryKey: ["group-members", o.groupId]
|
|
@@ -518,18 +517,18 @@ function ao() {
|
|
|
518
517
|
},
|
|
519
518
|
onError: (r) => {
|
|
520
519
|
console.error("Failed to add group members:", r), C.error("Failed to add members", {
|
|
521
|
-
description:
|
|
520
|
+
description: ge(r, "Failed to add members")
|
|
522
521
|
});
|
|
523
522
|
}
|
|
524
523
|
});
|
|
525
524
|
}
|
|
526
|
-
function
|
|
527
|
-
const { authToken: e, tokenProps: n } =
|
|
528
|
-
return
|
|
525
|
+
function Zn() {
|
|
526
|
+
const { authToken: e, tokenProps: n } = q(), a = xe();
|
|
527
|
+
return ve({
|
|
529
528
|
mutationFn: ({
|
|
530
529
|
groupId: r,
|
|
531
530
|
data: o
|
|
532
|
-
}) =>
|
|
531
|
+
}) => Qn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, o),
|
|
533
532
|
onSuccess: (r, o) => {
|
|
534
533
|
a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
|
|
535
534
|
queryKey: ["group-members", o.groupId]
|
|
@@ -537,91 +536,91 @@ function no() {
|
|
|
537
536
|
},
|
|
538
537
|
onError: (r) => {
|
|
539
538
|
console.error("Failed to remove group members:", r), C.error("Failed to remove members", {
|
|
540
|
-
description:
|
|
539
|
+
description: ge(r, "Failed to remove members")
|
|
541
540
|
});
|
|
542
541
|
}
|
|
543
542
|
});
|
|
544
543
|
}
|
|
545
|
-
const
|
|
546
|
-
function
|
|
544
|
+
const eo = [];
|
|
545
|
+
function to({
|
|
547
546
|
open: e,
|
|
548
547
|
onOpenChange: n
|
|
549
548
|
}) {
|
|
550
|
-
var
|
|
551
|
-
const { tokenProps: a } =
|
|
549
|
+
var E, A, L;
|
|
550
|
+
const { tokenProps: a } = q(), { currentUser: r } = nt(), o = (r == null ? void 0 : r.type) === "tenant", d = a == null ? void 0 : a.tenantId, {
|
|
552
551
|
groups: m,
|
|
553
|
-
isLoading:
|
|
552
|
+
isLoading: p,
|
|
554
553
|
error: b,
|
|
555
554
|
refetch: f
|
|
556
|
-
} =
|
|
555
|
+
} = ua({
|
|
557
556
|
type: o ? "TENANT_GROUP" : "all",
|
|
558
557
|
tenantId: o ? d : void 0,
|
|
559
558
|
includeMembers: !1
|
|
560
|
-
}), g = b ?
|
|
561
|
-
|
|
562
|
-
e || (
|
|
559
|
+
}), g = b ? ur(b, "Unable to load groups.") : null, [l, c] = S({ kind: "list" }), [s, x] = S(null), v = Jn();
|
|
560
|
+
_e(() => {
|
|
561
|
+
e || (c({ kind: "list" }), x(null));
|
|
563
562
|
}, [e]);
|
|
564
|
-
const w =
|
|
563
|
+
const w = l.kind === "members" && m.find((N) => N.id === l.groupId) || null, h = async () => {
|
|
565
564
|
if (s)
|
|
566
565
|
try {
|
|
567
|
-
await v.mutateAsync(s.id), x(null),
|
|
566
|
+
await v.mutateAsync(s.id), x(null), c({ kind: "list" }), f();
|
|
568
567
|
} catch {
|
|
569
568
|
}
|
|
570
569
|
};
|
|
571
|
-
return /* @__PURE__ */ t(
|
|
572
|
-
|
|
573
|
-
/* @__PURE__ */ t(
|
|
574
|
-
/* @__PURE__ */ t(
|
|
575
|
-
] }) :
|
|
570
|
+
return /* @__PURE__ */ t(qt, { open: e, onOpenChange: n, children: /* @__PURE__ */ i(zt, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
|
|
571
|
+
l.kind === "list" ? /* @__PURE__ */ i("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
|
|
572
|
+
/* @__PURE__ */ t(Ze, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
|
|
573
|
+
/* @__PURE__ */ t(et, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
|
|
574
|
+
] }) : l.kind === "create" ? /* @__PURE__ */ i("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
576
575
|
/* @__PURE__ */ t(
|
|
577
576
|
"button",
|
|
578
577
|
{
|
|
579
578
|
type: "button",
|
|
580
|
-
onClick: () =>
|
|
579
|
+
onClick: () => c({ kind: "list" }),
|
|
581
580
|
"aria-label": "Back",
|
|
582
581
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
583
|
-
children: /* @__PURE__ */ t(
|
|
582
|
+
children: /* @__PURE__ */ t(Kt, { className: "h-3.5 w-3.5" })
|
|
584
583
|
}
|
|
585
584
|
),
|
|
586
|
-
/* @__PURE__ */ t(
|
|
587
|
-
/* @__PURE__ */ t(
|
|
585
|
+
/* @__PURE__ */ t(Ze, { className: "truncate text-[13px] font-medium", children: "New group" }),
|
|
586
|
+
/* @__PURE__ */ t(et, { className: "sr-only", children: "Create a new group to organize members." })
|
|
588
587
|
] }) : null,
|
|
589
|
-
|
|
590
|
-
|
|
588
|
+
l.kind === "list" && /* @__PURE__ */ t(
|
|
589
|
+
ro,
|
|
591
590
|
{
|
|
592
591
|
groups: m,
|
|
593
|
-
isLoading:
|
|
592
|
+
isLoading: p,
|
|
594
593
|
errorMessage: g,
|
|
595
594
|
onRetry: () => f(),
|
|
596
595
|
currentUserId: r == null ? void 0 : r.id,
|
|
597
|
-
onOpenGroup: (
|
|
598
|
-
onCreate: () =>
|
|
599
|
-
onDeleteRequest: (
|
|
596
|
+
onOpenGroup: (N) => c({ kind: "members", groupId: N }),
|
|
597
|
+
onCreate: () => c({ kind: "create" }),
|
|
598
|
+
onDeleteRequest: (N) => x(N)
|
|
600
599
|
}
|
|
601
600
|
),
|
|
602
|
-
|
|
603
|
-
|
|
601
|
+
l.kind === "members" && w && /* @__PURE__ */ t(
|
|
602
|
+
oo,
|
|
604
603
|
{
|
|
605
604
|
group: w,
|
|
606
605
|
isTenantViewer: o,
|
|
607
|
-
canEdit: ((
|
|
608
|
-
canDelete: ((
|
|
606
|
+
canEdit: ((E = w.permissions) == null ? void 0 : E.canEdit) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
607
|
+
canDelete: ((A = w.permissions) == null ? void 0 : A.canDelete) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
609
608
|
canManageMembers: ((L = w.permissions) == null ? void 0 : L.canManageMembers) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
610
|
-
onBack: () =>
|
|
609
|
+
onBack: () => c({ kind: "list" }),
|
|
611
610
|
onMembersChanged: f,
|
|
612
611
|
onUpdated: f,
|
|
613
612
|
onRequestDelete: () => x(w)
|
|
614
613
|
},
|
|
615
614
|
w.id
|
|
616
615
|
),
|
|
617
|
-
|
|
618
|
-
|
|
616
|
+
l.kind === "create" && /* @__PURE__ */ t(
|
|
617
|
+
so,
|
|
619
618
|
{
|
|
620
619
|
isTenantUser: o,
|
|
621
620
|
tenantId: d,
|
|
622
|
-
onCancel: () =>
|
|
623
|
-
onCreated: (
|
|
624
|
-
f(),
|
|
621
|
+
onCancel: () => c({ kind: "list" }),
|
|
622
|
+
onCreated: (N) => {
|
|
623
|
+
f(), c({ kind: "members", groupId: N });
|
|
625
624
|
}
|
|
626
625
|
}
|
|
627
626
|
),
|
|
@@ -647,11 +646,11 @@ function so({
|
|
|
647
646
|
"button",
|
|
648
647
|
{
|
|
649
648
|
type: "button",
|
|
650
|
-
onClick:
|
|
649
|
+
onClick: h,
|
|
651
650
|
disabled: v.isPending,
|
|
652
651
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
|
|
653
652
|
children: [
|
|
654
|
-
v.isPending ? /* @__PURE__ */ t(
|
|
653
|
+
v.isPending ? /* @__PURE__ */ t(Pe, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(ot, { className: "h-3 w-3" }),
|
|
655
654
|
"Delete group"
|
|
656
655
|
]
|
|
657
656
|
}
|
|
@@ -660,7 +659,7 @@ function so({
|
|
|
660
659
|
] })
|
|
661
660
|
] }) });
|
|
662
661
|
}
|
|
663
|
-
function
|
|
662
|
+
function ro({
|
|
664
663
|
groups: e,
|
|
665
664
|
isLoading: n,
|
|
666
665
|
errorMessage: a,
|
|
@@ -668,23 +667,23 @@ function io({
|
|
|
668
667
|
currentUserId: o,
|
|
669
668
|
onOpenGroup: d,
|
|
670
669
|
onCreate: m,
|
|
671
|
-
onDeleteRequest:
|
|
670
|
+
onDeleteRequest: p
|
|
672
671
|
}) {
|
|
673
|
-
const [b, f] =
|
|
672
|
+
const [b, f] = S(""), g = V(
|
|
674
673
|
() => e.filter(
|
|
675
|
-
(
|
|
674
|
+
(l) => !b.trim() || l.name.toLowerCase().includes(b.toLowerCase()) || (l.description || "").toLowerCase().includes(b.toLowerCase())
|
|
676
675
|
),
|
|
677
676
|
[e, b]
|
|
678
677
|
);
|
|
679
678
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
680
679
|
/* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
|
|
681
680
|
/* @__PURE__ */ i("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
|
|
682
|
-
/* @__PURE__ */ t(
|
|
681
|
+
/* @__PURE__ */ t(bn, { className: "h-3 w-3 text-muted-foreground" }),
|
|
683
682
|
/* @__PURE__ */ t(
|
|
684
683
|
"input",
|
|
685
684
|
{
|
|
686
685
|
value: b,
|
|
687
|
-
onChange: (
|
|
686
|
+
onChange: (l) => f(l.target.value),
|
|
688
687
|
placeholder: "Search groups…",
|
|
689
688
|
className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none"
|
|
690
689
|
}
|
|
@@ -695,7 +694,7 @@ function io({
|
|
|
695
694
|
type: "button",
|
|
696
695
|
onClick: () => f(""),
|
|
697
696
|
className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
698
|
-
children: /* @__PURE__ */ t(
|
|
697
|
+
children: /* @__PURE__ */ t(Yt, { className: "h-2.5 w-2.5" })
|
|
699
698
|
}
|
|
700
699
|
)
|
|
701
700
|
] }),
|
|
@@ -706,48 +705,48 @@ function io({
|
|
|
706
705
|
onClick: m,
|
|
707
706
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
|
|
708
707
|
children: [
|
|
709
|
-
/* @__PURE__ */ t(
|
|
708
|
+
/* @__PURE__ */ t(ee, { className: "h-3 w-3" }),
|
|
710
709
|
"New group"
|
|
711
710
|
]
|
|
712
711
|
}
|
|
713
712
|
)
|
|
714
713
|
] }),
|
|
715
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children: n ? /* @__PURE__ */ t("div", { className: "space-y-px p-3", children: [1, 2, 3].map((
|
|
714
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children: n ? /* @__PURE__ */ t("div", { className: "space-y-px p-3", children: [1, 2, 3].map((l) => /* @__PURE__ */ t(
|
|
716
715
|
"div",
|
|
717
716
|
{
|
|
718
717
|
className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
|
|
719
718
|
},
|
|
720
|
-
|
|
719
|
+
l
|
|
721
720
|
)) }) : a ? /* @__PURE__ */ t(
|
|
722
|
-
|
|
721
|
+
mr,
|
|
723
722
|
{
|
|
724
723
|
title: "Can't load groups",
|
|
725
724
|
message: a,
|
|
726
725
|
onRetry: r
|
|
727
726
|
}
|
|
728
|
-
) : g.length === 0 && e.length === 0 ? /* @__PURE__ */ t(
|
|
727
|
+
) : g.length === 0 && e.length === 0 ? /* @__PURE__ */ t(no, { onCreate: m }) : g.length === 0 ? /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
729
728
|
/* @__PURE__ */ i("div", { className: "text-[12px] text-foreground", children: [
|
|
730
729
|
'No groups match "',
|
|
731
730
|
b,
|
|
732
731
|
'"'
|
|
733
732
|
] }),
|
|
734
733
|
/* @__PURE__ */ t("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
|
|
735
|
-
] }) : g.map((
|
|
736
|
-
var
|
|
734
|
+
] }) : g.map((l) => {
|
|
735
|
+
var c;
|
|
737
736
|
return /* @__PURE__ */ t(
|
|
738
|
-
|
|
737
|
+
ao,
|
|
739
738
|
{
|
|
740
|
-
group:
|
|
741
|
-
canDelete: ((
|
|
742
|
-
onClick: () => d(
|
|
743
|
-
onDelete: () =>
|
|
739
|
+
group: l,
|
|
740
|
+
canDelete: ((c = l.permissions) == null ? void 0 : c.canDelete) ?? l.createdBy === o,
|
|
741
|
+
onClick: () => d(l.id),
|
|
742
|
+
onDelete: () => p(l)
|
|
744
743
|
},
|
|
745
|
-
|
|
744
|
+
l.id
|
|
746
745
|
);
|
|
747
746
|
}) })
|
|
748
747
|
] });
|
|
749
748
|
}
|
|
750
|
-
function
|
|
749
|
+
function ao({
|
|
751
750
|
group: e,
|
|
752
751
|
canDelete: n,
|
|
753
752
|
onClick: a,
|
|
@@ -755,7 +754,7 @@ function co({
|
|
|
755
754
|
}) {
|
|
756
755
|
let o = "";
|
|
757
756
|
try {
|
|
758
|
-
o =
|
|
757
|
+
o = Xt(new Date(e.createdAt), "MMM d, yyyy");
|
|
759
758
|
} catch {
|
|
760
759
|
o = "";
|
|
761
760
|
}
|
|
@@ -766,24 +765,24 @@ function co({
|
|
|
766
765
|
onClick: a,
|
|
767
766
|
className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
|
|
768
767
|
children: [
|
|
769
|
-
/* @__PURE__ */ t("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ t(
|
|
768
|
+
/* @__PURE__ */ t("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ t(pa, { className: "h-3.5 w-3.5" }) }),
|
|
770
769
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
771
770
|
/* @__PURE__ */ t("div", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
|
|
772
771
|
/* @__PURE__ */ i("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
773
772
|
/* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1", children: [
|
|
774
|
-
/* @__PURE__ */ t(
|
|
773
|
+
/* @__PURE__ */ t(Zt, { className: "h-2.5 w-2.5" }),
|
|
775
774
|
e.memberCount,
|
|
776
775
|
" member",
|
|
777
776
|
e.memberCount === 1 ? "" : "s"
|
|
778
777
|
] }),
|
|
779
|
-
o && /* @__PURE__ */ i(
|
|
778
|
+
o && /* @__PURE__ */ i($, { children: [
|
|
780
779
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
781
780
|
/* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1", children: [
|
|
782
|
-
/* @__PURE__ */ t(
|
|
781
|
+
/* @__PURE__ */ t(Wt, { className: "h-2.5 w-2.5" }),
|
|
783
782
|
o
|
|
784
783
|
] })
|
|
785
784
|
] }),
|
|
786
|
-
e.description && /* @__PURE__ */ i(
|
|
785
|
+
e.description && /* @__PURE__ */ i($, { children: [
|
|
787
786
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
788
787
|
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: e.description })
|
|
789
788
|
] })
|
|
@@ -803,18 +802,18 @@ function co({
|
|
|
803
802
|
},
|
|
804
803
|
"aria-label": `Delete ${e.name}`,
|
|
805
804
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
806
|
-
children: /* @__PURE__ */ t(
|
|
805
|
+
children: /* @__PURE__ */ t(ot, { className: "h-3 w-3" })
|
|
807
806
|
}
|
|
808
807
|
),
|
|
809
|
-
/* @__PURE__ */ t(
|
|
808
|
+
/* @__PURE__ */ t(gn, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
810
809
|
] })
|
|
811
810
|
]
|
|
812
811
|
}
|
|
813
812
|
);
|
|
814
813
|
}
|
|
815
|
-
function
|
|
814
|
+
function no({ onCreate: e }) {
|
|
816
815
|
return /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
|
|
817
|
-
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ t(
|
|
816
|
+
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ t(Qt, { className: "h-4 w-4" }) }),
|
|
818
817
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
|
|
819
818
|
/* @__PURE__ */ t("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
|
|
820
819
|
/* @__PURE__ */ i(
|
|
@@ -824,14 +823,14 @@ function lo({ onCreate: e }) {
|
|
|
824
823
|
onClick: e,
|
|
825
824
|
className: "mt-1 inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
|
|
826
825
|
children: [
|
|
827
|
-
/* @__PURE__ */ t(
|
|
826
|
+
/* @__PURE__ */ t(ee, { className: "h-3 w-3" }),
|
|
828
827
|
"New group"
|
|
829
828
|
]
|
|
830
829
|
}
|
|
831
830
|
)
|
|
832
831
|
] });
|
|
833
832
|
}
|
|
834
|
-
function
|
|
833
|
+
function oo({
|
|
835
834
|
group: e,
|
|
836
835
|
isTenantViewer: n,
|
|
837
836
|
canEdit: a,
|
|
@@ -839,76 +838,76 @@ function uo({
|
|
|
839
838
|
canManageMembers: o,
|
|
840
839
|
onBack: d,
|
|
841
840
|
onMembersChanged: m,
|
|
842
|
-
onUpdated:
|
|
841
|
+
onUpdated: p,
|
|
843
842
|
onRequestDelete: b
|
|
844
843
|
}) {
|
|
845
844
|
const {
|
|
846
845
|
data: f,
|
|
847
846
|
isLoading: g,
|
|
848
|
-
error:
|
|
849
|
-
refetch:
|
|
850
|
-
} =
|
|
847
|
+
error: l,
|
|
848
|
+
refetch: c
|
|
849
|
+
} = ma(e.id), s = (f == null ? void 0 : f.members) ?? eo, x = l ? ur(l, "Unable to load members for this group.") : null, v = e.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = ha({
|
|
851
850
|
type: v,
|
|
852
851
|
tenantId: e.tenantId || void 0,
|
|
853
852
|
active: !0,
|
|
854
853
|
limit: 200
|
|
855
|
-
}),
|
|
854
|
+
}), h = V(
|
|
856
855
|
() => new Set(s.map((y) => y.userId)),
|
|
857
856
|
[s]
|
|
858
|
-
),
|
|
859
|
-
const y =
|
|
860
|
-
return w.filter((
|
|
861
|
-
(
|
|
857
|
+
), E = Xn(), A = Zn(), L = Yn(), [N, k] = S(!1), [re, ae] = S(e.name), [ye, z] = S(!1), [K, Q] = S(e.description || ""), [W, we] = S(""), [Ne, ne] = S(!1), oe = V(() => {
|
|
858
|
+
const y = W.trim().toLowerCase();
|
|
859
|
+
return w.filter((U) => !h.has(U.id)).filter(
|
|
860
|
+
(U) => !y || (U.name || "").toLowerCase().includes(y) || (U.email || "").toLowerCase().includes(y)
|
|
862
861
|
).slice(0, 50);
|
|
863
|
-
}, [w,
|
|
864
|
-
const y =
|
|
865
|
-
if (
|
|
862
|
+
}, [w, h, W]), Se = async () => {
|
|
863
|
+
const y = re.trim();
|
|
864
|
+
if (k(!1), y.length >= 3 && y !== e.name)
|
|
866
865
|
try {
|
|
867
866
|
await L.mutateAsync({
|
|
868
867
|
groupId: e.id,
|
|
869
868
|
data: { name: y }
|
|
870
|
-
}),
|
|
869
|
+
}), p();
|
|
871
870
|
} catch {
|
|
872
871
|
}
|
|
873
|
-
},
|
|
874
|
-
const y =
|
|
875
|
-
if (
|
|
872
|
+
}, se = async () => {
|
|
873
|
+
const y = K.trim();
|
|
874
|
+
if (z(!1), y !== (e.description || ""))
|
|
876
875
|
try {
|
|
877
876
|
await L.mutateAsync({
|
|
878
877
|
groupId: e.id,
|
|
879
878
|
data: { description: y }
|
|
880
|
-
}),
|
|
879
|
+
}), p();
|
|
881
880
|
} catch {
|
|
882
881
|
}
|
|
883
|
-
},
|
|
882
|
+
}, Ue = async (y) => {
|
|
884
883
|
if (o) {
|
|
885
|
-
|
|
884
|
+
we(""), ne(!1);
|
|
886
885
|
try {
|
|
887
|
-
await
|
|
886
|
+
await E.mutateAsync({
|
|
888
887
|
groupId: e.id,
|
|
889
888
|
data: {
|
|
890
889
|
userIds: [y.id],
|
|
891
890
|
userType: v === "tenant" ? "tenant" : "org"
|
|
892
891
|
}
|
|
893
|
-
}),
|
|
892
|
+
}), c(), m();
|
|
894
893
|
} catch {
|
|
895
894
|
}
|
|
896
895
|
}
|
|
897
|
-
},
|
|
896
|
+
}, Y = async (y) => {
|
|
898
897
|
if (o)
|
|
899
898
|
try {
|
|
900
|
-
await
|
|
899
|
+
await A.mutateAsync({
|
|
901
900
|
groupId: e.id,
|
|
902
901
|
data: { userIds: [y] }
|
|
903
|
-
}),
|
|
902
|
+
}), c(), m();
|
|
904
903
|
} catch {
|
|
905
904
|
}
|
|
906
905
|
};
|
|
907
|
-
let
|
|
906
|
+
let F = "";
|
|
908
907
|
try {
|
|
909
|
-
|
|
908
|
+
F = Xt(new Date(e.createdAt), "MMM d, yyyy");
|
|
910
909
|
} catch {
|
|
911
|
-
|
|
910
|
+
F = "";
|
|
912
911
|
}
|
|
913
912
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
914
913
|
/* @__PURE__ */ i("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
@@ -919,18 +918,18 @@ function uo({
|
|
|
919
918
|
onClick: d,
|
|
920
919
|
"aria-label": "Back",
|
|
921
920
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
922
|
-
children: /* @__PURE__ */ t(
|
|
921
|
+
children: /* @__PURE__ */ t(Kt, { className: "h-3.5 w-3.5" })
|
|
923
922
|
}
|
|
924
923
|
),
|
|
925
|
-
|
|
924
|
+
N ? /* @__PURE__ */ t(
|
|
926
925
|
"input",
|
|
927
926
|
{
|
|
928
927
|
autoFocus: !0,
|
|
929
|
-
value:
|
|
930
|
-
onChange: (y) =>
|
|
931
|
-
onBlur:
|
|
928
|
+
value: re,
|
|
929
|
+
onChange: (y) => ae(y.target.value),
|
|
930
|
+
onBlur: Se,
|
|
932
931
|
onKeyDown: (y) => {
|
|
933
|
-
y.key === "Enter" &&
|
|
932
|
+
y.key === "Enter" && Se(), y.key === "Escape" && (ae(e.name), k(!1));
|
|
934
933
|
},
|
|
935
934
|
className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
|
|
936
935
|
}
|
|
@@ -939,7 +938,7 @@ function uo({
|
|
|
939
938
|
{
|
|
940
939
|
type: "button",
|
|
941
940
|
onClick: () => {
|
|
942
|
-
a && (
|
|
941
|
+
a && (ae(e.name), k(!0));
|
|
943
942
|
},
|
|
944
943
|
title: a ? "Click to rename" : e.name,
|
|
945
944
|
disabled: !a,
|
|
@@ -948,23 +947,23 @@ function uo({
|
|
|
948
947
|
}
|
|
949
948
|
),
|
|
950
949
|
/* @__PURE__ */ i("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
|
|
951
|
-
/* @__PURE__ */ t(
|
|
950
|
+
/* @__PURE__ */ t(Zt, { className: "h-2.5 w-2.5" }),
|
|
952
951
|
s.length,
|
|
953
952
|
" member",
|
|
954
953
|
s.length === 1 ? "" : "s"
|
|
955
954
|
] })
|
|
956
955
|
] }),
|
|
957
|
-
/* @__PURE__ */ t("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children:
|
|
956
|
+
/* @__PURE__ */ t("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: ye ? /* @__PURE__ */ i("div", { children: [
|
|
958
957
|
/* @__PURE__ */ t(
|
|
959
958
|
"textarea",
|
|
960
959
|
{
|
|
961
960
|
autoFocus: !0,
|
|
962
961
|
rows: 2,
|
|
963
|
-
value:
|
|
964
|
-
onChange: (y) =>
|
|
962
|
+
value: K,
|
|
963
|
+
onChange: (y) => Q(y.target.value),
|
|
965
964
|
maxLength: 200,
|
|
966
965
|
onKeyDown: (y) => {
|
|
967
|
-
y.key === "Escape" && (
|
|
966
|
+
y.key === "Escape" && (Q(e.description || ""), z(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && se();
|
|
968
967
|
},
|
|
969
968
|
placeholder: "What is this group for?",
|
|
970
969
|
className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
@@ -972,7 +971,7 @@ function uo({
|
|
|
972
971
|
),
|
|
973
972
|
/* @__PURE__ */ i("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
974
973
|
/* @__PURE__ */ i("span", { className: "text-[10.5px] text-muted-foreground", children: [
|
|
975
|
-
|
|
974
|
+
K.length,
|
|
976
975
|
"/200 · Esc to cancel · ⌘↩ to save"
|
|
977
976
|
] }),
|
|
978
977
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
|
|
@@ -981,7 +980,7 @@ function uo({
|
|
|
981
980
|
{
|
|
982
981
|
type: "button",
|
|
983
982
|
onClick: () => {
|
|
984
|
-
|
|
983
|
+
Q(e.description || ""), z(!1);
|
|
985
984
|
},
|
|
986
985
|
className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
|
|
987
986
|
children: "Cancel"
|
|
@@ -991,7 +990,7 @@ function uo({
|
|
|
991
990
|
"button",
|
|
992
991
|
{
|
|
993
992
|
type: "button",
|
|
994
|
-
onClick:
|
|
993
|
+
onClick: se,
|
|
995
994
|
className: "inline-flex h-6 items-center rounded-[5px] bg-foreground px-2 text-[11px] font-medium text-background hover:opacity-90",
|
|
996
995
|
children: "Save"
|
|
997
996
|
}
|
|
@@ -1003,7 +1002,7 @@ function uo({
|
|
|
1003
1002
|
{
|
|
1004
1003
|
type: "button",
|
|
1005
1004
|
onClick: () => {
|
|
1006
|
-
a && (
|
|
1005
|
+
a && (Q(e.description || ""), z(!0));
|
|
1007
1006
|
},
|
|
1008
1007
|
disabled: !a,
|
|
1009
1008
|
title: a ? "Click to edit description" : void 0,
|
|
@@ -1011,23 +1010,23 @@ function uo({
|
|
|
1011
1010
|
children: [
|
|
1012
1011
|
e.description ? /* @__PURE__ */ t("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: e.description }) : /* @__PURE__ */ t("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: a ? "Add a description…" : "No description" }),
|
|
1013
1012
|
/* @__PURE__ */ i("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
|
|
1014
|
-
|
|
1013
|
+
F ? `Created ${F}` : "Recently created",
|
|
1015
1014
|
a ? " · You can edit this group" : ""
|
|
1016
1015
|
] })
|
|
1017
1016
|
]
|
|
1018
1017
|
}
|
|
1019
1018
|
) }),
|
|
1020
1019
|
o && /* @__PURE__ */ t(
|
|
1021
|
-
|
|
1020
|
+
io,
|
|
1022
1021
|
{
|
|
1023
|
-
query:
|
|
1024
|
-
setQuery:
|
|
1025
|
-
open:
|
|
1026
|
-
setOpen:
|
|
1027
|
-
candidates:
|
|
1022
|
+
query: W,
|
|
1023
|
+
setQuery: we,
|
|
1024
|
+
open: Ne,
|
|
1025
|
+
setOpen: ne,
|
|
1026
|
+
candidates: oe,
|
|
1028
1027
|
showKindChip: !n,
|
|
1029
|
-
onAdd:
|
|
1030
|
-
busy:
|
|
1028
|
+
onAdd: Ue,
|
|
1029
|
+
busy: E.isPending
|
|
1031
1030
|
}
|
|
1032
1031
|
),
|
|
1033
1032
|
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children: g ? /* @__PURE__ */ t("div", { className: "space-y-px p-3", children: [1, 2, 3].map((y) => /* @__PURE__ */ t(
|
|
@@ -1037,37 +1036,37 @@ function uo({
|
|
|
1037
1036
|
},
|
|
1038
1037
|
y
|
|
1039
1038
|
)) }) : x ? /* @__PURE__ */ t(
|
|
1040
|
-
|
|
1039
|
+
mr,
|
|
1041
1040
|
{
|
|
1042
1041
|
title: "Can't load members",
|
|
1043
1042
|
message: x,
|
|
1044
|
-
onRetry: () =>
|
|
1043
|
+
onRetry: () => c()
|
|
1045
1044
|
}
|
|
1046
1045
|
) : s.length === 0 ? /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
1047
1046
|
/* @__PURE__ */ t("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
|
|
1048
1047
|
/* @__PURE__ */ t("div", { className: "text-[11px] text-muted-foreground", children: o ? "Search above to add people to this group." : "This group does not have any members." })
|
|
1049
1048
|
] }) : s.map((y) => {
|
|
1050
|
-
var
|
|
1049
|
+
var U, j, ie, H, ke, de;
|
|
1051
1050
|
return /* @__PURE__ */ i(
|
|
1052
1051
|
"div",
|
|
1053
1052
|
{
|
|
1054
1053
|
className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
|
|
1055
1054
|
children: [
|
|
1056
|
-
/* @__PURE__ */ t(
|
|
1055
|
+
/* @__PURE__ */ t(hr, { name: ((U = y.user) == null ? void 0 : U.name) || ((j = y.user) == null ? void 0 : j.email) || "?" }),
|
|
1057
1056
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
1058
|
-
/* @__PURE__ */ t("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((
|
|
1059
|
-
((
|
|
1057
|
+
/* @__PURE__ */ t("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((ie = y.user) == null ? void 0 : ie.name) || ((H = y.user) == null ? void 0 : H.email) || "Unknown" }),
|
|
1058
|
+
((ke = y.user) == null ? void 0 : ke.email) && y.user.name && /* @__PURE__ */ t("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
|
|
1060
1059
|
] }),
|
|
1061
1060
|
!n && /* @__PURE__ */ t("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
|
|
1062
1061
|
/* @__PURE__ */ t(
|
|
1063
1062
|
"button",
|
|
1064
1063
|
{
|
|
1065
1064
|
type: "button",
|
|
1066
|
-
onClick: () =>
|
|
1067
|
-
disabled: !o ||
|
|
1068
|
-
"aria-label": `Remove ${((
|
|
1065
|
+
onClick: () => Y(y.userId),
|
|
1066
|
+
disabled: !o || A.isPending,
|
|
1067
|
+
"aria-label": `Remove ${((de = y.user) == null ? void 0 : de.name) || "member"}`,
|
|
1069
1068
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
|
|
1070
|
-
children: /* @__PURE__ */ t(
|
|
1069
|
+
children: /* @__PURE__ */ t(Yt, { className: "h-3 w-3" })
|
|
1071
1070
|
}
|
|
1072
1071
|
)
|
|
1073
1072
|
]
|
|
@@ -1082,21 +1081,21 @@ function uo({
|
|
|
1082
1081
|
onClick: b,
|
|
1083
1082
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
|
|
1084
1083
|
children: [
|
|
1085
|
-
/* @__PURE__ */ t(
|
|
1084
|
+
/* @__PURE__ */ t(ot, { className: "h-3 w-3" }),
|
|
1086
1085
|
"Delete group"
|
|
1087
1086
|
]
|
|
1088
1087
|
}
|
|
1089
1088
|
) })
|
|
1090
1089
|
] });
|
|
1091
1090
|
}
|
|
1092
|
-
function
|
|
1091
|
+
function so({
|
|
1093
1092
|
isTenantUser: e,
|
|
1094
1093
|
tenantId: n,
|
|
1095
1094
|
onCancel: a,
|
|
1096
1095
|
onCreated: r
|
|
1097
1096
|
}) {
|
|
1098
|
-
const [o, d] =
|
|
1099
|
-
if (!
|
|
1097
|
+
const [o, d] = S(""), [m, p] = S(""), [b, f] = S(null), g = Wn(), l = o.trim().length >= 3 && o.trim().length <= 50, c = async () => {
|
|
1098
|
+
if (!l) return;
|
|
1100
1099
|
f(null);
|
|
1101
1100
|
const s = {
|
|
1102
1101
|
name: o.trim(),
|
|
@@ -1113,7 +1112,7 @@ function mo({
|
|
|
1113
1112
|
};
|
|
1114
1113
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1115
1114
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
1116
|
-
/* @__PURE__ */ t(
|
|
1115
|
+
/* @__PURE__ */ t(Gt, { children: "Name" }),
|
|
1117
1116
|
/* @__PURE__ */ t(
|
|
1118
1117
|
"input",
|
|
1119
1118
|
{
|
|
@@ -1127,13 +1126,13 @@ function mo({
|
|
|
1127
1126
|
),
|
|
1128
1127
|
/* @__PURE__ */ t("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
|
|
1129
1128
|
/* @__PURE__ */ i("div", { className: "mt-4", children: [
|
|
1130
|
-
/* @__PURE__ */ t(
|
|
1129
|
+
/* @__PURE__ */ t(Gt, { children: "Description (optional)" }),
|
|
1131
1130
|
/* @__PURE__ */ t(
|
|
1132
1131
|
"textarea",
|
|
1133
1132
|
{
|
|
1134
1133
|
rows: 2,
|
|
1135
1134
|
value: m,
|
|
1136
|
-
onChange: (s) =>
|
|
1135
|
+
onChange: (s) => p(s.target.value),
|
|
1137
1136
|
maxLength: 200,
|
|
1138
1137
|
placeholder: "What is this group for?",
|
|
1139
1138
|
className: "mt-1 block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
@@ -1161,14 +1160,14 @@ function mo({
|
|
|
1161
1160
|
"button",
|
|
1162
1161
|
{
|
|
1163
1162
|
type: "button",
|
|
1164
|
-
onClick:
|
|
1165
|
-
disabled: !
|
|
1163
|
+
onClick: c,
|
|
1164
|
+
disabled: !l || g.isPending,
|
|
1166
1165
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
1167
|
-
children: g.isPending ? /* @__PURE__ */ i(
|
|
1168
|
-
/* @__PURE__ */ t(
|
|
1166
|
+
children: g.isPending ? /* @__PURE__ */ i($, { children: [
|
|
1167
|
+
/* @__PURE__ */ t(Pe, { className: "h-3 w-3 animate-spin" }),
|
|
1169
1168
|
"Creating…"
|
|
1170
|
-
] }) : /* @__PURE__ */ i(
|
|
1171
|
-
/* @__PURE__ */ t(
|
|
1169
|
+
] }) : /* @__PURE__ */ i($, { children: [
|
|
1170
|
+
/* @__PURE__ */ t(ee, { className: "h-3 w-3" }),
|
|
1172
1171
|
"Create group"
|
|
1173
1172
|
] })
|
|
1174
1173
|
}
|
|
@@ -1176,7 +1175,7 @@ function mo({
|
|
|
1176
1175
|
] })
|
|
1177
1176
|
] });
|
|
1178
1177
|
}
|
|
1179
|
-
function
|
|
1178
|
+
function io({
|
|
1180
1179
|
query: e,
|
|
1181
1180
|
setQuery: n,
|
|
1182
1181
|
open: a,
|
|
@@ -1184,38 +1183,38 @@ function ho({
|
|
|
1184
1183
|
candidates: o,
|
|
1185
1184
|
showKindChip: d,
|
|
1186
1185
|
onAdd: m,
|
|
1187
|
-
busy:
|
|
1186
|
+
busy: p
|
|
1188
1187
|
}) {
|
|
1189
|
-
const b =
|
|
1190
|
-
|
|
1188
|
+
const b = Rt(null), f = Rt(null), [g, l] = S(null);
|
|
1189
|
+
an(() => {
|
|
1191
1190
|
if (!a) {
|
|
1192
|
-
|
|
1191
|
+
l(null);
|
|
1193
1192
|
return;
|
|
1194
1193
|
}
|
|
1195
1194
|
const s = () => {
|
|
1196
1195
|
const x = b.current;
|
|
1197
1196
|
if (!x) return;
|
|
1198
|
-
const v = x.getBoundingClientRect(), w = 240,
|
|
1199
|
-
|
|
1197
|
+
const v = x.getBoundingClientRect(), w = 240, E = window.innerHeight - v.bottom < w + 16 && v.top > w;
|
|
1198
|
+
l({
|
|
1200
1199
|
left: v.left,
|
|
1201
|
-
top:
|
|
1200
|
+
top: E ? v.top - 6 : v.bottom + 6,
|
|
1202
1201
|
width: v.width,
|
|
1203
|
-
above:
|
|
1202
|
+
above: E
|
|
1204
1203
|
});
|
|
1205
1204
|
};
|
|
1206
1205
|
return s(), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), () => {
|
|
1207
1206
|
window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0);
|
|
1208
1207
|
};
|
|
1209
|
-
}, [a, o.length]),
|
|
1208
|
+
}, [a, o.length]), _e(() => {
|
|
1210
1209
|
if (!a) return;
|
|
1211
1210
|
const s = (x) => {
|
|
1212
|
-
var w,
|
|
1211
|
+
var w, h;
|
|
1213
1212
|
const v = x.target;
|
|
1214
|
-
(w = b.current) != null && w.contains(v) || (
|
|
1213
|
+
(w = b.current) != null && w.contains(v) || (h = f.current) != null && h.contains(v) || r(!1);
|
|
1215
1214
|
};
|
|
1216
1215
|
return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
|
|
1217
1216
|
}, [a, r]);
|
|
1218
|
-
const
|
|
1217
|
+
const c = a && o.length > 0 && g;
|
|
1219
1218
|
return /* @__PURE__ */ i("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
|
|
1220
1219
|
/* @__PURE__ */ i(
|
|
1221
1220
|
"div",
|
|
@@ -1223,7 +1222,7 @@ function ho({
|
|
|
1223
1222
|
ref: b,
|
|
1224
1223
|
className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
|
|
1225
1224
|
children: [
|
|
1226
|
-
/* @__PURE__ */ t(
|
|
1225
|
+
/* @__PURE__ */ t(An, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1227
1226
|
/* @__PURE__ */ t(
|
|
1228
1227
|
"input",
|
|
1229
1228
|
{
|
|
@@ -1233,14 +1232,14 @@ function ho({
|
|
|
1233
1232
|
},
|
|
1234
1233
|
onFocus: () => r(!0),
|
|
1235
1234
|
placeholder: "Add a member by name or email…",
|
|
1236
|
-
disabled:
|
|
1235
|
+
disabled: p,
|
|
1237
1236
|
className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
|
|
1238
1237
|
}
|
|
1239
1238
|
)
|
|
1240
1239
|
]
|
|
1241
1240
|
}
|
|
1242
1241
|
),
|
|
1243
|
-
|
|
1242
|
+
c && typeof document < "u" && fn(
|
|
1244
1243
|
/* @__PURE__ */ t(
|
|
1245
1244
|
"div",
|
|
1246
1245
|
{
|
|
@@ -1260,7 +1259,7 @@ function ho({
|
|
|
1260
1259
|
onClick: () => m(s),
|
|
1261
1260
|
className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
|
|
1262
1261
|
children: [
|
|
1263
|
-
/* @__PURE__ */ t(
|
|
1262
|
+
/* @__PURE__ */ t(hr, { name: s.name || s.email || "?" }),
|
|
1264
1263
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
1265
1264
|
/* @__PURE__ */ t("div", { className: "truncate text-[12px] font-medium text-foreground", children: s.name || s.email || "Unknown" }),
|
|
1266
1265
|
s.email && s.name && /* @__PURE__ */ t("div", { className: "truncate text-[10.5px] text-muted-foreground", children: s.email })
|
|
@@ -1276,7 +1275,7 @@ function ho({
|
|
|
1276
1275
|
)
|
|
1277
1276
|
] });
|
|
1278
1277
|
}
|
|
1279
|
-
function
|
|
1278
|
+
function ur(e, n) {
|
|
1280
1279
|
if (!e) return n;
|
|
1281
1280
|
if (e instanceof Error) {
|
|
1282
1281
|
const a = e.message || "", r = a.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
|
|
@@ -1284,7 +1283,7 @@ function xr(e, n) {
|
|
|
1284
1283
|
}
|
|
1285
1284
|
return typeof e == "string" ? e : n;
|
|
1286
1285
|
}
|
|
1287
|
-
function
|
|
1286
|
+
function mr({
|
|
1288
1287
|
title: e,
|
|
1289
1288
|
message: n,
|
|
1290
1289
|
onRetry: a
|
|
@@ -1303,66 +1302,66 @@ function vr({
|
|
|
1303
1302
|
)
|
|
1304
1303
|
] });
|
|
1305
1304
|
}
|
|
1306
|
-
function
|
|
1305
|
+
function Gt({ children: e }) {
|
|
1307
1306
|
return /* @__PURE__ */ t("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: e });
|
|
1308
1307
|
}
|
|
1309
|
-
function
|
|
1308
|
+
function hr({ name: e }) {
|
|
1310
1309
|
const n = e.split(" ").map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
1311
|
-
return /* @__PURE__ */ t(
|
|
1310
|
+
return /* @__PURE__ */ t(lr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ t(cr, { className: "text-[9px] font-semibold", children: n || "?" }) });
|
|
1312
1311
|
}
|
|
1313
|
-
const
|
|
1314
|
-
function
|
|
1312
|
+
const lo = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
1313
|
+
function co({
|
|
1315
1314
|
open: e,
|
|
1316
1315
|
onOpenChange: n
|
|
1317
1316
|
}) {
|
|
1318
1317
|
const a = D(
|
|
1319
1318
|
(o) => {
|
|
1320
1319
|
var d, m;
|
|
1321
|
-
return
|
|
1320
|
+
return vn({
|
|
1322
1321
|
dashboardDefault: (m = (d = o.dashboard) == null ? void 0 : d.exportDefaults) == null ? void 0 : m.csvEncoding
|
|
1323
1322
|
});
|
|
1324
1323
|
}
|
|
1325
1324
|
), { setDashboardExportDefaults: r } = D(
|
|
1326
1325
|
(o) => o.actions
|
|
1327
1326
|
);
|
|
1328
|
-
return /* @__PURE__ */ t(
|
|
1329
|
-
/* @__PURE__ */ i(
|
|
1330
|
-
/* @__PURE__ */ t(
|
|
1331
|
-
/* @__PURE__ */ t(
|
|
1327
|
+
return /* @__PURE__ */ t(qt, { open: e, onOpenChange: n, children: /* @__PURE__ */ i(zt, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
|
|
1328
|
+
/* @__PURE__ */ i(fa, { children: [
|
|
1329
|
+
/* @__PURE__ */ t(Ze, { className: "text-[15px]", children: "Download settings" }),
|
|
1330
|
+
/* @__PURE__ */ t(et, { className: "text-[13px] leading-5", children: "Applies to every CSV downloaded or delivered from this dashboard. People can still change it for a single download." })
|
|
1332
1331
|
] }),
|
|
1333
1332
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
1334
|
-
/* @__PURE__ */ t(
|
|
1333
|
+
/* @__PURE__ */ t(jr, { htmlFor: "dashboard-csv-encoding", className: lo, children: "CSV encoding" }),
|
|
1335
1334
|
/* @__PURE__ */ i(
|
|
1336
|
-
|
|
1335
|
+
Hr,
|
|
1337
1336
|
{
|
|
1338
1337
|
value: a,
|
|
1339
1338
|
onValueChange: (o) => r({ csvEncoding: o }),
|
|
1340
1339
|
children: [
|
|
1341
|
-
/* @__PURE__ */ t(
|
|
1342
|
-
/* @__PURE__ */ t(
|
|
1340
|
+
/* @__PURE__ */ t(qr, { id: "dashboard-csv-encoding", size: "sm", children: /* @__PURE__ */ t(zr, {}) }),
|
|
1341
|
+
/* @__PURE__ */ t(Kr, { children: ba.map((o) => /* @__PURE__ */ t(Qr, { value: o.value, children: o.label }, o.value)) })
|
|
1343
1342
|
]
|
|
1344
1343
|
}
|
|
1345
1344
|
)
|
|
1346
1345
|
] })
|
|
1347
1346
|
] }) });
|
|
1348
1347
|
}
|
|
1349
|
-
function
|
|
1348
|
+
function pe(e, n, a) {
|
|
1350
1349
|
var d, m;
|
|
1351
1350
|
const r = (e.controls || []).find(
|
|
1352
|
-
(
|
|
1351
|
+
(p) => p.id === a
|
|
1353
1352
|
);
|
|
1354
1353
|
if (r)
|
|
1355
1354
|
return r.label;
|
|
1356
|
-
const o = (m = (d =
|
|
1357
|
-
(
|
|
1355
|
+
const o = (m = (d = Re(e, n)) == null ? void 0 : d.controls) == null ? void 0 : m.find(
|
|
1356
|
+
(p) => p.id === a
|
|
1358
1357
|
);
|
|
1359
1358
|
return (o == null ? void 0 : o.label) || a;
|
|
1360
1359
|
}
|
|
1361
|
-
function
|
|
1360
|
+
function fe(e, n) {
|
|
1362
1361
|
var a;
|
|
1363
|
-
return ((a =
|
|
1362
|
+
return ((a = Re(e, n)) == null ? void 0 : a.title) || n;
|
|
1364
1363
|
}
|
|
1365
|
-
function
|
|
1364
|
+
function uo(e) {
|
|
1366
1365
|
const { errors: n, dashboard: a } = e;
|
|
1367
1366
|
if (!a)
|
|
1368
1367
|
return n;
|
|
@@ -1372,13 +1371,13 @@ function bo(e) {
|
|
|
1372
1371
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1373
1372
|
);
|
|
1374
1373
|
if (d) {
|
|
1375
|
-
const [, g,
|
|
1376
|
-
r.has(
|
|
1377
|
-
|
|
1378
|
-
`"${
|
|
1374
|
+
const [, g, l] = d, c = `${g}:${l}:missing-metric`;
|
|
1375
|
+
r.has(c) || r.set(
|
|
1376
|
+
c,
|
|
1377
|
+
`"${fe(a, g)}" has an outdated "${pe(
|
|
1379
1378
|
a,
|
|
1380
1379
|
g,
|
|
1381
|
-
|
|
1380
|
+
l
|
|
1382
1381
|
)}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1383
1382
|
);
|
|
1384
1383
|
continue;
|
|
@@ -1387,28 +1386,28 @@ function bo(e) {
|
|
|
1387
1386
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1388
1387
|
);
|
|
1389
1388
|
if (m) {
|
|
1390
|
-
const [, g,
|
|
1391
|
-
r.has(
|
|
1392
|
-
|
|
1393
|
-
`"${
|
|
1389
|
+
const [, g, l] = m, c = `${g}:${l}:missing-group-by`;
|
|
1390
|
+
r.has(c) || r.set(
|
|
1391
|
+
c,
|
|
1392
|
+
`"${fe(a, g)}" has an outdated "${pe(
|
|
1394
1393
|
a,
|
|
1395
1394
|
g,
|
|
1396
|
-
|
|
1395
|
+
l
|
|
1397
1396
|
)}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1398
1397
|
);
|
|
1399
1398
|
continue;
|
|
1400
1399
|
}
|
|
1401
|
-
const
|
|
1400
|
+
const p = o.match(
|
|
1402
1401
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1403
1402
|
);
|
|
1404
|
-
if (
|
|
1405
|
-
const [, g,
|
|
1406
|
-
r.has(
|
|
1407
|
-
|
|
1408
|
-
`"${
|
|
1403
|
+
if (p) {
|
|
1404
|
+
const [, g, l] = p, c = `${g}:${l}:invalid-metric`;
|
|
1405
|
+
r.has(c) || r.set(
|
|
1406
|
+
c,
|
|
1407
|
+
`"${fe(a, g)}" has an invalid "${pe(
|
|
1409
1408
|
a,
|
|
1410
1409
|
g,
|
|
1411
|
-
|
|
1410
|
+
l
|
|
1412
1411
|
)}" metric mapping. Open the card controls and choose a valid metric for each option.`
|
|
1413
1412
|
);
|
|
1414
1413
|
continue;
|
|
@@ -1417,13 +1416,13 @@ function bo(e) {
|
|
|
1417
1416
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1418
1417
|
);
|
|
1419
1418
|
if (b) {
|
|
1420
|
-
const [, g,
|
|
1421
|
-
r.has(
|
|
1422
|
-
|
|
1423
|
-
`"${
|
|
1419
|
+
const [, g, l] = b, c = `${g}:${l}:invalid-group-by`;
|
|
1420
|
+
r.has(c) || r.set(
|
|
1421
|
+
c,
|
|
1422
|
+
`"${fe(a, g)}" has an invalid "${pe(
|
|
1424
1423
|
a,
|
|
1425
1424
|
g,
|
|
1426
|
-
|
|
1425
|
+
l
|
|
1427
1426
|
)}" field mapping. Open the card controls and choose a valid field for each option.`
|
|
1428
1427
|
);
|
|
1429
1428
|
continue;
|
|
@@ -1432,13 +1431,13 @@ function bo(e) {
|
|
|
1432
1431
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1433
1432
|
);
|
|
1434
1433
|
if (f) {
|
|
1435
|
-
const [, g,
|
|
1436
|
-
r.has(
|
|
1437
|
-
|
|
1438
|
-
`"${
|
|
1434
|
+
const [, g, l] = f, c = `${g}:${l}:missing-temporal-group-by`;
|
|
1435
|
+
r.has(c) || r.set(
|
|
1436
|
+
c,
|
|
1437
|
+
`"${fe(a, g)}" can no longer use "${pe(
|
|
1439
1438
|
a,
|
|
1440
1439
|
g,
|
|
1441
|
-
|
|
1440
|
+
l
|
|
1442
1441
|
)}" for time grain because the card does not currently group by a date field.`
|
|
1443
1442
|
);
|
|
1444
1443
|
continue;
|
|
@@ -1447,82 +1446,82 @@ function bo(e) {
|
|
|
1447
1446
|
}
|
|
1448
1447
|
return Array.from(r.values());
|
|
1449
1448
|
}
|
|
1450
|
-
function
|
|
1449
|
+
function mo({
|
|
1451
1450
|
visible: e,
|
|
1452
1451
|
onSelect: n
|
|
1453
1452
|
}) {
|
|
1454
|
-
return e ? /* @__PURE__ */ i(
|
|
1455
|
-
/* @__PURE__ */ t(
|
|
1453
|
+
return e ? /* @__PURE__ */ i(R, { onSelect: n, children: [
|
|
1454
|
+
/* @__PURE__ */ t(ga, { className: "h-3.5 w-3.5" }),
|
|
1456
1455
|
"Schedule email report"
|
|
1457
1456
|
] }) : null;
|
|
1458
1457
|
}
|
|
1459
|
-
function
|
|
1458
|
+
function ho({
|
|
1460
1459
|
scheduleReportVisible: e,
|
|
1461
1460
|
analyticalBriefingVisible: n,
|
|
1462
1461
|
onScheduleReport: a,
|
|
1463
1462
|
onCreateAnalyticalBriefing: r
|
|
1464
1463
|
}) {
|
|
1465
|
-
return /* @__PURE__ */ i(
|
|
1464
|
+
return /* @__PURE__ */ i($, { children: [
|
|
1466
1465
|
/* @__PURE__ */ t(
|
|
1467
|
-
|
|
1466
|
+
mo,
|
|
1468
1467
|
{
|
|
1469
1468
|
visible: e,
|
|
1470
1469
|
onSelect: a
|
|
1471
1470
|
}
|
|
1472
1471
|
),
|
|
1473
|
-
n ? /* @__PURE__ */ i(
|
|
1474
|
-
/* @__PURE__ */ t(
|
|
1472
|
+
n ? /* @__PURE__ */ i(R, { onSelect: r, children: [
|
|
1473
|
+
/* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" }),
|
|
1475
1474
|
"Create analytical briefing"
|
|
1476
1475
|
] }) : null
|
|
1477
1476
|
] });
|
|
1478
1477
|
}
|
|
1479
|
-
function
|
|
1480
|
-
var f, g,
|
|
1481
|
-
const { saved: n, draft: a, usage: r } = e, o = [], d =
|
|
1482
|
-
for (const [
|
|
1483
|
-
!s || !
|
|
1478
|
+
function po(e) {
|
|
1479
|
+
var f, g, l;
|
|
1480
|
+
const { saved: n, draft: a, usage: r } = e, o = [], d = Wr(n);
|
|
1481
|
+
for (const [c, s] of Object.entries(r.inputs))
|
|
1482
|
+
!s || !St(n, c) || St(a, c) || o.push({
|
|
1484
1483
|
target: "input",
|
|
1485
|
-
id:
|
|
1486
|
-
label:
|
|
1484
|
+
id: c,
|
|
1485
|
+
label: Yr(n, d, c),
|
|
1487
1486
|
bookmarks: s,
|
|
1488
1487
|
remembered: 0
|
|
1489
1488
|
});
|
|
1490
|
-
const m = new Set((a.sheets ?? []).map((
|
|
1491
|
-
for (const
|
|
1492
|
-
const s = r.sheets[
|
|
1493
|
-
!s || m.has(
|
|
1489
|
+
const m = new Set((a.sheets ?? []).map((c) => c.id));
|
|
1490
|
+
for (const c of n.sheets ?? []) {
|
|
1491
|
+
const s = r.sheets[c.id] ?? 0;
|
|
1492
|
+
!s || m.has(c.id) || o.push({
|
|
1494
1493
|
target: "sheet",
|
|
1495
|
-
id:
|
|
1496
|
-
label: ((f =
|
|
1494
|
+
id: c.id,
|
|
1495
|
+
label: ((f = c.title) == null ? void 0 : f.trim()) || "Untitled sheet",
|
|
1497
1496
|
bookmarks: s,
|
|
1498
1497
|
remembered: 0
|
|
1499
1498
|
});
|
|
1500
1499
|
}
|
|
1501
|
-
const
|
|
1502
|
-
for (const [
|
|
1503
|
-
if (!
|
|
1504
|
-
const x =
|
|
1505
|
-
if (!b.has(
|
|
1500
|
+
const p = Tt(n), b = Tt(a);
|
|
1501
|
+
for (const [c, s] of Object.entries(r.tables)) {
|
|
1502
|
+
if (!p.has(c)) continue;
|
|
1503
|
+
const x = Re(n, c), v = ((g = x == null ? void 0 : x.title) == null ? void 0 : g.trim()) || "Untitled table";
|
|
1504
|
+
if (!b.has(c)) {
|
|
1506
1505
|
o.push({
|
|
1507
1506
|
target: "table",
|
|
1508
|
-
id:
|
|
1507
|
+
id: c,
|
|
1509
1508
|
label: v,
|
|
1510
1509
|
bookmarks: s.bookmarks,
|
|
1511
1510
|
remembered: s.remembered
|
|
1512
1511
|
});
|
|
1513
1512
|
continue;
|
|
1514
1513
|
}
|
|
1515
|
-
const w = x ?
|
|
1516
|
-
if (!(!x || !w || !
|
|
1517
|
-
for (const [
|
|
1518
|
-
if (!(L.bookmarks || L.remembered) ||
|
|
1514
|
+
const w = x ? At(x) : void 0, h = Re(a, c), E = h ? At(h) : void 0;
|
|
1515
|
+
if (!(!x || !w || !E))
|
|
1516
|
+
for (const [A, L] of Object.entries(s.columns)) {
|
|
1517
|
+
if (!(L.bookmarks || L.remembered) || xa(A) || !w.has(A) || E.has(A))
|
|
1519
1518
|
continue;
|
|
1520
|
-
const
|
|
1519
|
+
const N = va(x, A), k = ((l = N == null ? void 0 : N.label) == null ? void 0 : l.trim()) || (N == null ? void 0 : N.name);
|
|
1521
1520
|
o.push({
|
|
1522
1521
|
target: "column",
|
|
1523
|
-
id:
|
|
1524
|
-
cardId:
|
|
1525
|
-
label:
|
|
1522
|
+
id: A,
|
|
1523
|
+
cardId: c,
|
|
1524
|
+
label: k ? `${k} in ${v}` : `A column in ${v}`,
|
|
1526
1525
|
bookmarks: L.bookmarks,
|
|
1527
1526
|
remembered: L.remembered
|
|
1528
1527
|
});
|
|
@@ -1530,49 +1529,49 @@ function vo(e) {
|
|
|
1530
1529
|
}
|
|
1531
1530
|
return o;
|
|
1532
1531
|
}
|
|
1533
|
-
const
|
|
1534
|
-
function
|
|
1532
|
+
const fo = "dashboard-bookmark-usage";
|
|
1533
|
+
function bo(e) {
|
|
1535
1534
|
var b;
|
|
1536
|
-
const n = D((f) => f.viewerStateClient), a = (b = e.saved) == null ? void 0 : b.id, o =
|
|
1535
|
+
const n = D((f) => f.viewerStateClient), a = (b = e.saved) == null ? void 0 : b.id, o = ya({
|
|
1537
1536
|
// Keyed by the viewer, never by the client object (TanStack drops functions when hashing).
|
|
1538
|
-
queryKey: [
|
|
1537
|
+
queryKey: [fo, (n == null ? void 0 : n.viewerKey) ?? null],
|
|
1539
1538
|
queryFn: () => n.bookmarks.usage(),
|
|
1540
1539
|
enabled: e.enabled && !!n && !!a,
|
|
1541
1540
|
staleTime: 5 * 6e4,
|
|
1542
1541
|
retry: !1
|
|
1543
|
-
}).data, { saved: d, draft: m, enabled:
|
|
1544
|
-
return
|
|
1542
|
+
}).data, { saved: d, draft: m, enabled: p } = e;
|
|
1543
|
+
return V(() => !p || !d || !o ? [] : !o.bookmarks && !Object.keys(o.tables).length ? [] : po({ saved: d, draft: m, usage: o }), [m, p, d, o]);
|
|
1545
1544
|
}
|
|
1546
|
-
function
|
|
1545
|
+
function Vt(e, n, a) {
|
|
1547
1546
|
return `${e} ${e === 1 ? n : a}`;
|
|
1548
1547
|
}
|
|
1549
|
-
function
|
|
1548
|
+
function go(e) {
|
|
1550
1549
|
const n = [
|
|
1551
|
-
e.bookmarks ?
|
|
1552
|
-
e.remembered ?
|
|
1550
|
+
e.bookmarks ? Vt(e.bookmarks, "bookmark", "bookmarks") : null,
|
|
1551
|
+
e.remembered ? Vt(e.remembered, "remembered layout", "remembered layouts") : null
|
|
1553
1552
|
].filter(Boolean).join(", ");
|
|
1554
1553
|
return e.target === "sheet" ? { name: `${e.label} sheet`, uses: n } : e.target === "table" ? { name: `${e.label} table`, uses: n } : { name: e.label, uses: n };
|
|
1555
1554
|
}
|
|
1556
|
-
function
|
|
1555
|
+
function xo({
|
|
1557
1556
|
saved: e,
|
|
1558
1557
|
draft: n,
|
|
1559
1558
|
enabled: a
|
|
1560
1559
|
}) {
|
|
1561
|
-
const r =
|
|
1562
|
-
return r.length ? /* @__PURE__ */ i(
|
|
1563
|
-
/* @__PURE__ */ t(
|
|
1564
|
-
|
|
1560
|
+
const r = bo({ saved: e, draft: n, enabled: a });
|
|
1561
|
+
return r.length ? /* @__PURE__ */ i(Jr, { children: [
|
|
1562
|
+
/* @__PURE__ */ t(Xr, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1563
|
+
T,
|
|
1565
1564
|
{
|
|
1566
1565
|
variant: "ghost",
|
|
1567
1566
|
size: "xs",
|
|
1568
1567
|
className: "gap-1 text-muted-foreground hover:text-foreground",
|
|
1569
1568
|
children: [
|
|
1570
|
-
/* @__PURE__ */ t(
|
|
1569
|
+
/* @__PURE__ */ t(wa, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
1571
1570
|
"Affects saved views"
|
|
1572
1571
|
]
|
|
1573
1572
|
}
|
|
1574
1573
|
) }),
|
|
1575
|
-
/* @__PURE__ */ i(
|
|
1574
|
+
/* @__PURE__ */ i(Zr, { align: "end", className: "w-[320px] p-3 text-[12px]", children: [
|
|
1576
1575
|
/* @__PURE__ */ t("p", { className: "text-foreground", children: "This edit removes parts of the dashboard that viewers saved. Their views still open, with a note about what no longer applies." }),
|
|
1577
1576
|
/* @__PURE__ */ t(
|
|
1578
1577
|
"ul",
|
|
@@ -1580,7 +1579,7 @@ function So({
|
|
|
1580
1579
|
"aria-label": "Affected saved views",
|
|
1581
1580
|
className: "mt-2 grid gap-1 border-t border-border/60 pt-2",
|
|
1582
1581
|
children: r.map((o) => {
|
|
1583
|
-
const { name: d, uses: m } =
|
|
1582
|
+
const { name: d, uses: m } = go(o);
|
|
1584
1583
|
return /* @__PURE__ */ i(
|
|
1585
1584
|
"li",
|
|
1586
1585
|
{
|
|
@@ -1598,271 +1597,261 @@ function So({
|
|
|
1598
1597
|
] })
|
|
1599
1598
|
] }) : null;
|
|
1600
1599
|
}
|
|
1601
|
-
function
|
|
1600
|
+
function jt(e, n) {
|
|
1602
1601
|
return {
|
|
1603
|
-
dashboard:
|
|
1604
|
-
semanticExecutionPayload:
|
|
1602
|
+
dashboard: tt(e),
|
|
1603
|
+
semanticExecutionPayload: tt(n)
|
|
1605
1604
|
};
|
|
1606
1605
|
}
|
|
1607
|
-
function
|
|
1608
|
-
var
|
|
1609
|
-
|
|
1606
|
+
function Ho() {
|
|
1607
|
+
var xt, vt, yt, wt, Nt;
|
|
1608
|
+
nn(), on();
|
|
1610
1609
|
const {
|
|
1611
1610
|
authToken: e,
|
|
1612
1611
|
tokenProps: n,
|
|
1613
1612
|
id: a,
|
|
1614
1613
|
showBriefings: r
|
|
1615
|
-
} =
|
|
1614
|
+
} = q(), o = Na(), { isLocalDev: d } = Sa(), {
|
|
1616
1615
|
canEditDashboard: m,
|
|
1617
|
-
hasInspectionUser:
|
|
1616
|
+
hasInspectionUser: p,
|
|
1618
1617
|
inspectionMessage: b,
|
|
1619
1618
|
isInspectionMode: f,
|
|
1620
1619
|
isInspectionSurface: g
|
|
1621
|
-
} =
|
|
1622
|
-
(
|
|
1623
|
-
),
|
|
1624
|
-
(
|
|
1625
|
-
),
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
(
|
|
1631
|
-
), Nr = Oe(
|
|
1632
|
-
(l) => l.initialDashboard
|
|
1620
|
+
} = ka(), { openBrandStudioPreview: l } = Ca(), { permissions: c } = Mn(), s = Da(), { isLoading: x } = Ea(), v = D((u) => u.theme), w = D((u) => u.isDownloadingPdf), h = D((u) => u.dashboard), E = D((u) => u.selectedSheetId), A = (xt = h == null ? void 0 : h.sheets) == null ? void 0 : xt.find(
|
|
1621
|
+
(u) => u.id === E
|
|
1622
|
+
), L = ea(A), N = L ? (vt = A == null ? void 0 : A.document) == null ? void 0 : vt.page : void 0, k = D(
|
|
1623
|
+
(u) => u.isDashboardEditing
|
|
1624
|
+
), { setDashboardTitle: re } = D((u) => u.actions), [ae, ye] = S(!1), [z, K] = S(!1), [Q, W] = S(!1), [we, Ne] = S(!1), [ne, oe] = S(null), [Se, se] = S(!1), [Ue, Y] = S(!1), [F, y] = S(null), [U, j] = S([]), [ie, H] = S(!1), [ke, de] = S(!1), P = D((u) => u.isVisualEditing);
|
|
1625
|
+
kt((u) => u.card);
|
|
1626
|
+
const pr = Le(
|
|
1627
|
+
(u) => u.selectedDashboard
|
|
1628
|
+
), fr = Le(
|
|
1629
|
+
(u) => u.initialDashboard
|
|
1633
1630
|
);
|
|
1634
|
-
|
|
1635
|
-
const
|
|
1636
|
-
(
|
|
1631
|
+
Le((u) => u.selectedVisual), D((u) => u.selectedFrameId), kt((u) => u.frame);
|
|
1632
|
+
const dt = D(
|
|
1633
|
+
(u) => u.showDashboardJSON
|
|
1637
1634
|
);
|
|
1638
|
-
D((
|
|
1639
|
-
const { setIsDashboardEditing:
|
|
1640
|
-
(
|
|
1641
|
-
), { setInitialDashboard:
|
|
1642
|
-
(
|
|
1643
|
-
), le = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources:
|
|
1635
|
+
D((u) => u.onSaveFunction);
|
|
1636
|
+
const { setIsDashboardEditing: lt, setShowDashboardJSON: ct } = D(
|
|
1637
|
+
(u) => u.actions
|
|
1638
|
+
), { setInitialDashboard: ut, clearSelectedDashboard: Te } = Le(
|
|
1639
|
+
(u) => u.actions
|
|
1640
|
+
), le = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Ce } = Ia(Qe.DASHBOARD), { data: $e } = Aa(), br = ((yt = $e == null ? void 0 : $e.preference) == null ? void 0 : yt.defaultDashboardId) || null, { mutate: gr, isPending: xr } = La(), { currentUser: vr } = nt(), yr = Ma(vr), B = pr || fr, J = Oa({
|
|
1644
1641
|
config: n.config,
|
|
1645
1642
|
canNavigateDashboardHub: le,
|
|
1646
|
-
canShareDashboard: ((
|
|
1647
|
-
canManageGroups:
|
|
1648
|
-
}),
|
|
1649
|
-
id:
|
|
1650
|
-
title: (
|
|
1651
|
-
} : null, { handleAddNewFrame:
|
|
1643
|
+
canShareDashboard: ((wt = B == null ? void 0 : B.permissions) == null ? void 0 : wt.canShare) === !0,
|
|
1644
|
+
canManageGroups: yr
|
|
1645
|
+
}), mt = B ? {
|
|
1646
|
+
id: B.id,
|
|
1647
|
+
title: (h == null ? void 0 : h.title) || B.title || "Dashboard"
|
|
1648
|
+
} : null, { handleAddNewFrame: wr } = Pa(), [Fe, Be] = S(!1), [Nr, ce] = S(!1), [Ge, De] = S("close"), ue = _a(Qe.DASHBOARD), [M, me] = S(null), Sr = async (u, _) => {
|
|
1652
1649
|
if (!f) {
|
|
1653
|
-
if (!(
|
|
1650
|
+
if (!(h != null && h.id)) {
|
|
1654
1651
|
console.log("No dashboard ID found");
|
|
1655
1652
|
return;
|
|
1656
1653
|
}
|
|
1657
1654
|
console.log("Updating dashboard title:", {
|
|
1658
|
-
dashboardId:
|
|
1659
|
-
newTitle:
|
|
1660
|
-
previousTitle:
|
|
1661
|
-
}),
|
|
1655
|
+
dashboardId: h.id,
|
|
1656
|
+
newTitle: u,
|
|
1657
|
+
previousTitle: _
|
|
1658
|
+
}), ue.mutate(
|
|
1662
1659
|
{
|
|
1663
|
-
resourceId:
|
|
1664
|
-
data: { title:
|
|
1660
|
+
resourceId: h.id,
|
|
1661
|
+
data: { title: u }
|
|
1665
1662
|
},
|
|
1666
1663
|
{
|
|
1667
1664
|
onSuccess: () => {
|
|
1668
|
-
|
|
1669
|
-
(
|
|
1670
|
-
...
|
|
1671
|
-
dashboard: { ...
|
|
1672
|
-
} :
|
|
1665
|
+
me(
|
|
1666
|
+
(O) => (O == null ? void 0 : O.dashboard.id) === h.id ? {
|
|
1667
|
+
...O,
|
|
1668
|
+
dashboard: { ...O.dashboard, title: u }
|
|
1669
|
+
} : O
|
|
1673
1670
|
), C.success("Dashboard title updated");
|
|
1674
1671
|
},
|
|
1675
|
-
onError: (
|
|
1676
|
-
console.error("Failed to update dashboard title:",
|
|
1677
|
-
const
|
|
1678
|
-
(
|
|
1672
|
+
onError: (O) => {
|
|
1673
|
+
console.error("Failed to update dashboard title:", O), C.error("Failed to update dashboard title");
|
|
1674
|
+
const Z = D.getState().dashboard;
|
|
1675
|
+
(Z == null ? void 0 : Z.id) === h.id && Z.title === u && re(_);
|
|
1679
1676
|
}
|
|
1680
1677
|
}
|
|
1681
1678
|
);
|
|
1682
1679
|
}
|
|
1683
1680
|
};
|
|
1684
|
-
|
|
1685
|
-
if (
|
|
1686
|
-
const
|
|
1687
|
-
if (
|
|
1688
|
-
const
|
|
1689
|
-
(
|
|
1681
|
+
_e(() => {
|
|
1682
|
+
if (Ce && Ce.length > 0) {
|
|
1683
|
+
const u = h == null ? void 0 : h.id;
|
|
1684
|
+
if (u) {
|
|
1685
|
+
const _ = Ce.find(
|
|
1686
|
+
(O) => O.id === u
|
|
1690
1687
|
);
|
|
1691
|
-
|
|
1688
|
+
_ && ut(_);
|
|
1692
1689
|
}
|
|
1693
1690
|
}
|
|
1694
|
-
}, [
|
|
1695
|
-
const
|
|
1696
|
-
() =>
|
|
1691
|
+
}, [Ce, h == null ? void 0 : h.id, ut]);
|
|
1692
|
+
const kr = n.orgUserId || n.tenantId, Ve = V(
|
|
1693
|
+
() => vo({
|
|
1697
1694
|
accessToken: e == null ? void 0 : e.accessToken,
|
|
1698
|
-
dashboardId: (
|
|
1699
|
-
selectedSheetId:
|
|
1700
|
-
pageSize:
|
|
1701
|
-
orientation:
|
|
1695
|
+
dashboardId: (h == null ? void 0 : h.id) || a || n.dashboard_id,
|
|
1696
|
+
selectedSheetId: L ? E : void 0,
|
|
1697
|
+
pageSize: N == null ? void 0 : N.size,
|
|
1698
|
+
orientation: N == null ? void 0 : N.orientation,
|
|
1702
1699
|
theme: v
|
|
1703
1700
|
}),
|
|
1704
1701
|
[
|
|
1705
1702
|
e == null ? void 0 : e.accessToken,
|
|
1706
1703
|
a,
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1704
|
+
h == null ? void 0 : h.id,
|
|
1705
|
+
L,
|
|
1706
|
+
N == null ? void 0 : N.orientation,
|
|
1707
|
+
N == null ? void 0 : N.size,
|
|
1708
|
+
E,
|
|
1712
1709
|
v,
|
|
1713
1710
|
n.dashboard_id
|
|
1714
1711
|
]
|
|
1715
|
-
),
|
|
1716
|
-
(
|
|
1717
|
-
),
|
|
1718
|
-
|
|
1712
|
+
), je = k && !P && !f && kr && m, { setDashboard: He } = D((u) => u.actions), ht = D(
|
|
1713
|
+
(u) => u.semanticExecutionPayload
|
|
1714
|
+
), Cr = () => {
|
|
1715
|
+
lt(!0);
|
|
1719
1716
|
}, Ee = () => {
|
|
1720
|
-
|
|
1717
|
+
lt(!1), ct(!1), me(null);
|
|
1721
1718
|
};
|
|
1722
|
-
|
|
1723
|
-
if (!
|
|
1724
|
-
|
|
1719
|
+
_e(() => {
|
|
1720
|
+
if (!k) {
|
|
1721
|
+
M && me(null);
|
|
1725
1722
|
return;
|
|
1726
1723
|
}
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1724
|
+
M || !h || x || me(
|
|
1725
|
+
jt(
|
|
1726
|
+
h,
|
|
1727
|
+
ht
|
|
1731
1728
|
)
|
|
1732
1729
|
);
|
|
1733
1730
|
}, [
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1731
|
+
h,
|
|
1732
|
+
M,
|
|
1733
|
+
k,
|
|
1737
1734
|
x,
|
|
1738
|
-
|
|
1735
|
+
ht
|
|
1739
1736
|
]);
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1742
|
-
|
|
1737
|
+
const qe = (M == null ? void 0 : M.dashboard) ?? null, { isDirty: ze, isDirtyPending: Dr, resetDirty: he } = yn(
|
|
1738
|
+
h,
|
|
1739
|
+
qe,
|
|
1743
1740
|
300,
|
|
1744
1741
|
1e3,
|
|
1745
|
-
|
|
1746
|
-
),
|
|
1747
|
-
|
|
1742
|
+
wn
|
|
1743
|
+
), pt = sn(
|
|
1744
|
+
qe,
|
|
1748
1745
|
f,
|
|
1749
1746
|
m
|
|
1750
|
-
),
|
|
1747
|
+
), ft = ze || Dr, Ie = Fe || ue.isPending, Er = () => {
|
|
1751
1748
|
if (f) {
|
|
1752
|
-
|
|
1753
|
-
semanticExecutionPayload:
|
|
1754
|
-
}), Ee(),
|
|
1749
|
+
M && He(M.dashboard, {
|
|
1750
|
+
semanticExecutionPayload: M.semanticExecutionPayload
|
|
1751
|
+
}), Ee(), he();
|
|
1755
1752
|
return;
|
|
1756
1753
|
}
|
|
1757
|
-
|
|
1758
|
-
},
|
|
1759
|
-
await
|
|
1754
|
+
pt() ? (De("close"), ce(!0)) : (Ee(), he());
|
|
1755
|
+
}, Ir = async () => {
|
|
1756
|
+
await Ke({
|
|
1760
1757
|
closeAfterSave: !0,
|
|
1761
|
-
navigateHomeAfterSave:
|
|
1758
|
+
navigateHomeAfterSave: Ge === "home"
|
|
1762
1759
|
});
|
|
1763
|
-
},
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1766
|
-
semanticExecutionPayload:
|
|
1767
|
-
}), Ee(),
|
|
1768
|
-
},
|
|
1769
|
-
|
|
1770
|
-
semanticExecutionPayload:
|
|
1771
|
-
}),
|
|
1772
|
-
},
|
|
1760
|
+
}, Ar = () => {
|
|
1761
|
+
const u = Ge === "home" && !!le;
|
|
1762
|
+
M && He(M.dashboard, {
|
|
1763
|
+
semanticExecutionPayload: M.semanticExecutionPayload
|
|
1764
|
+
}), Ee(), u && Te(), De("close"), ce(!1), he();
|
|
1765
|
+
}, Lr = () => {
|
|
1766
|
+
M && (He(M.dashboard, {
|
|
1767
|
+
semanticExecutionPayload: M.semanticExecutionPayload
|
|
1768
|
+
}), he());
|
|
1769
|
+
}, Mr = () => {
|
|
1773
1770
|
if (le) {
|
|
1774
|
-
if (
|
|
1775
|
-
|
|
1771
|
+
if (k && pt()) {
|
|
1772
|
+
De("home"), ce(!0);
|
|
1776
1773
|
return;
|
|
1777
1774
|
}
|
|
1778
|
-
|
|
1775
|
+
Te();
|
|
1779
1776
|
}
|
|
1780
1777
|
};
|
|
1781
|
-
async function
|
|
1778
|
+
async function Ke(u) {
|
|
1782
1779
|
if (f)
|
|
1783
1780
|
return;
|
|
1784
|
-
const
|
|
1785
|
-
if (!
|
|
1781
|
+
const _ = D.getState().dashboard;
|
|
1782
|
+
if (!_)
|
|
1786
1783
|
return;
|
|
1787
|
-
const
|
|
1788
|
-
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1791
|
-
const
|
|
1792
|
-
template:
|
|
1784
|
+
const O = (u == null ? void 0 : u.closeAfterSave) ?? ie, Z = (u == null ? void 0 : u.navigateHomeAfterSave) ?? !1;
|
|
1785
|
+
H(O), O && ce(!1);
|
|
1786
|
+
const Ur = tt(_);
|
|
1787
|
+
Y(!0), y(null), j([]), Be(!0);
|
|
1788
|
+
const Tr = {
|
|
1789
|
+
template: _
|
|
1793
1790
|
};
|
|
1794
|
-
|
|
1791
|
+
ue.mutate(
|
|
1795
1792
|
{
|
|
1796
|
-
resourceId:
|
|
1797
|
-
data:
|
|
1793
|
+
resourceId: _.id,
|
|
1794
|
+
data: Tr
|
|
1798
1795
|
},
|
|
1799
1796
|
{
|
|
1800
|
-
onSuccess: (
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
const Xe = ia.getState(), Le = Xe.pendingDashboardDraftMigration;
|
|
1805
|
-
(Le == null ? void 0 : Le.scopeKey) === S ? Xe.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1806
|
-
W
|
|
1807
|
-
) : Le && Xe.actions.clearPendingDashboardDraftMigration();
|
|
1808
|
-
}
|
|
1809
|
-
He(!1), C.success("Dashboard saved!"), he(
|
|
1810
|
-
Yt(
|
|
1811
|
-
jr,
|
|
1797
|
+
onSuccess: () => {
|
|
1798
|
+
Be(!1), C.success("Dashboard saved!"), me(
|
|
1799
|
+
jt(
|
|
1800
|
+
Ur,
|
|
1812
1801
|
D.getState().semanticExecutionPayload
|
|
1813
1802
|
)
|
|
1814
|
-
),
|
|
1803
|
+
), Y(!1), H(!1), O && (Ee(), he(), Z && le && Te()), De("close");
|
|
1815
1804
|
},
|
|
1816
|
-
onError: (
|
|
1817
|
-
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1820
|
-
) ? (
|
|
1821
|
-
(
|
|
1805
|
+
onError: ($r) => {
|
|
1806
|
+
Be(!1), y("Failed to save dashboard. Please try again.");
|
|
1807
|
+
const Ae = $r.details, Fr = Array.isArray(
|
|
1808
|
+
Ae == null ? void 0 : Ae.errors
|
|
1809
|
+
) ? (Ae.errors || []).filter(
|
|
1810
|
+
(Br) => typeof Br == "string"
|
|
1822
1811
|
) : [];
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
errors:
|
|
1826
|
-
dashboard:
|
|
1812
|
+
j(
|
|
1813
|
+
uo({
|
|
1814
|
+
errors: Fr,
|
|
1815
|
+
dashboard: _ || void 0
|
|
1827
1816
|
})
|
|
1828
1817
|
), C.error("Failed to save dashboard");
|
|
1829
1818
|
}
|
|
1830
1819
|
}
|
|
1831
1820
|
);
|
|
1832
1821
|
}
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
title:
|
|
1836
|
-
dashboardStateTitle:
|
|
1837
|
-
dashboardId:
|
|
1822
|
+
const bt = h.title;
|
|
1823
|
+
ue.isPending && console.log("Title during update:", {
|
|
1824
|
+
title: bt,
|
|
1825
|
+
dashboardStateTitle: h.title,
|
|
1826
|
+
dashboardId: h == null ? void 0 : h.id
|
|
1838
1827
|
});
|
|
1839
|
-
const
|
|
1840
|
-
(
|
|
1828
|
+
const Or = le && !!(e != null && e.accessToken) && !!(n != null && n.apiServiceUrl), Pr = !f && J.showDashboardHub && Or, _r = !f && s && J.showDashboardHub, G = (h == null ? void 0 : h.id) || null, gt = Ra(
|
|
1829
|
+
(Nt = n.config) == null ? void 0 : Nt.showBriefings,
|
|
1841
1830
|
r
|
|
1842
|
-
),
|
|
1843
|
-
!
|
|
1844
|
-
dashboardId:
|
|
1831
|
+
), X = !!G && br === G, Rr = () => {
|
|
1832
|
+
!G || f || gr({
|
|
1833
|
+
dashboardId: X ? null : G
|
|
1845
1834
|
});
|
|
1846
1835
|
};
|
|
1847
|
-
return !s && !
|
|
1836
|
+
return !s && !P ? null : /* @__PURE__ */ i(
|
|
1848
1837
|
"div",
|
|
1849
1838
|
{
|
|
1850
1839
|
className: "flex min-h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-1.5",
|
|
1851
1840
|
role: "dashboard-controls",
|
|
1852
1841
|
children: [
|
|
1853
1842
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1854
|
-
|
|
1855
|
-
|
|
1843
|
+
_r && !P && /* @__PURE__ */ t(
|
|
1844
|
+
Ut,
|
|
1856
1845
|
{
|
|
1857
1846
|
"aria-label": "Dashboard Hub",
|
|
1858
1847
|
tooltip: "Dashboard Hub",
|
|
1859
|
-
onClick:
|
|
1848
|
+
onClick: Mr,
|
|
1860
1849
|
className: "h-7 w-7 px-0",
|
|
1861
1850
|
buttonProps: { size: "xs" },
|
|
1862
|
-
children: /* @__PURE__ */ t(
|
|
1851
|
+
children: /* @__PURE__ */ t(Ua, { className: "h-3.5 w-3.5" })
|
|
1863
1852
|
}
|
|
1864
1853
|
),
|
|
1865
|
-
!
|
|
1854
|
+
!P && s && (x ? /* @__PURE__ */ t(
|
|
1866
1855
|
"div",
|
|
1867
1856
|
{
|
|
1868
1857
|
className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
|
|
@@ -1870,31 +1859,31 @@ function Qo() {
|
|
|
1870
1859
|
role: "status",
|
|
1871
1860
|
children: /* @__PURE__ */ t("span", { className: "sr-only", children: "Loading dashboard title" })
|
|
1872
1861
|
}
|
|
1873
|
-
) : /* @__PURE__ */ i(
|
|
1862
|
+
) : /* @__PURE__ */ i($, { children: [
|
|
1874
1863
|
/* @__PURE__ */ t(
|
|
1875
|
-
|
|
1864
|
+
Ta,
|
|
1876
1865
|
{
|
|
1877
|
-
value:
|
|
1878
|
-
onSave: (
|
|
1866
|
+
value: bt || "Untitled Dashboard",
|
|
1867
|
+
onSave: (u) => {
|
|
1879
1868
|
console.log("EditableText onSave called:", {
|
|
1880
|
-
newTitle:
|
|
1869
|
+
newTitle: u,
|
|
1881
1870
|
canEditDashboard: m,
|
|
1882
|
-
dashboardId:
|
|
1871
|
+
dashboardId: h == null ? void 0 : h.id
|
|
1883
1872
|
});
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1873
|
+
const _ = (h == null ? void 0 : h.title) || "";
|
|
1874
|
+
re(u), Sr(u, _);
|
|
1886
1875
|
},
|
|
1887
|
-
isEditable:
|
|
1888
|
-
isDashboardEditing:
|
|
1876
|
+
isEditable: $a({
|
|
1877
|
+
isDashboardEditing: k,
|
|
1889
1878
|
canEditDashboard: m === !0 && !f
|
|
1890
1879
|
}),
|
|
1891
1880
|
displayClassName: "text-[13px] font-medium",
|
|
1892
1881
|
inputClassName: "text-[13px] font-medium",
|
|
1893
1882
|
placeholder: "Dashboard Title",
|
|
1894
|
-
isPending:
|
|
1883
|
+
isPending: ue.isPending
|
|
1895
1884
|
}
|
|
1896
1885
|
),
|
|
1897
|
-
|
|
1886
|
+
J.showDashboardHub && X && /* @__PURE__ */ t(
|
|
1898
1887
|
"span",
|
|
1899
1888
|
{
|
|
1900
1889
|
className: "shrink-0 rounded-[4px] border border-border/60 px-1.5 py-px text-[10px] font-medium uppercase tracking-[0.06em] text-muted-foreground",
|
|
@@ -1902,153 +1891,153 @@ function Qo() {
|
|
|
1902
1891
|
children: "Default"
|
|
1903
1892
|
}
|
|
1904
1893
|
),
|
|
1905
|
-
|
|
1906
|
-
/* @__PURE__ */ t(
|
|
1907
|
-
|
|
1894
|
+
Pr && G && /* @__PURE__ */ t(Ct, { children: /* @__PURE__ */ i(Dt, { children: [
|
|
1895
|
+
/* @__PURE__ */ t(Et, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1896
|
+
T,
|
|
1908
1897
|
{
|
|
1909
1898
|
variant: "ghost",
|
|
1910
1899
|
size: "xs",
|
|
1911
|
-
onClick:
|
|
1912
|
-
disabled:
|
|
1913
|
-
className:
|
|
1900
|
+
onClick: Rr,
|
|
1901
|
+
disabled: xr || !(e != null && e.accessToken) || !(n != null && n.apiServiceUrl),
|
|
1902
|
+
className: be(
|
|
1914
1903
|
"w-7 px-0",
|
|
1915
|
-
|
|
1904
|
+
X ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
|
|
1916
1905
|
),
|
|
1917
|
-
"aria-pressed":
|
|
1918
|
-
"aria-label":
|
|
1919
|
-
children: /* @__PURE__ */ t(
|
|
1906
|
+
"aria-pressed": X,
|
|
1907
|
+
"aria-label": X ? "Remove as default dashboard" : "Set as default dashboard",
|
|
1908
|
+
children: /* @__PURE__ */ t(Fa, { className: "h-3.5 w-3.5" })
|
|
1920
1909
|
}
|
|
1921
1910
|
) }),
|
|
1922
|
-
/* @__PURE__ */ t(
|
|
1911
|
+
/* @__PURE__ */ t(It, { children: /* @__PURE__ */ t("p", { children: X ? "Remove as default dashboard" : "Set as default dashboard" }) })
|
|
1923
1912
|
] }) })
|
|
1924
1913
|
] }))
|
|
1925
1914
|
] }),
|
|
1926
1915
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1927
|
-
|
|
1928
|
-
/* @__PURE__ */ t(
|
|
1929
|
-
/* @__PURE__ */ t(
|
|
1916
|
+
P && /* @__PURE__ */ i($, { children: [
|
|
1917
|
+
/* @__PURE__ */ t(dn, {}),
|
|
1918
|
+
/* @__PURE__ */ t(ln, {})
|
|
1930
1919
|
] }),
|
|
1931
|
-
!
|
|
1932
|
-
|
|
1920
|
+
!P && s && !f && J.showDashboardSharing && /* @__PURE__ */ i(
|
|
1921
|
+
T,
|
|
1933
1922
|
{
|
|
1934
1923
|
variant: "outline",
|
|
1935
1924
|
size: "xs",
|
|
1936
|
-
onClick: () =>
|
|
1925
|
+
onClick: () => ye(!0),
|
|
1937
1926
|
children: [
|
|
1938
|
-
/* @__PURE__ */ t(
|
|
1927
|
+
/* @__PURE__ */ t(Ba, { className: "h-3.5 w-3.5" }),
|
|
1939
1928
|
"Share"
|
|
1940
1929
|
]
|
|
1941
1930
|
}
|
|
1942
1931
|
),
|
|
1943
|
-
!
|
|
1944
|
-
|
|
1932
|
+
!P && k && !f && c.canUseFilters && s && /* @__PURE__ */ t(cn, {}),
|
|
1933
|
+
k && !P && !f && s && !L && /* @__PURE__ */ i("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1945
1934
|
/* @__PURE__ */ i(
|
|
1946
|
-
|
|
1935
|
+
T,
|
|
1947
1936
|
{
|
|
1948
1937
|
variant: "ghost",
|
|
1949
1938
|
size: "xs",
|
|
1950
|
-
disabled: !
|
|
1951
|
-
onClick: () => void
|
|
1939
|
+
disabled: !k,
|
|
1940
|
+
onClick: () => void wr(),
|
|
1952
1941
|
className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
|
|
1953
1942
|
children: [
|
|
1954
|
-
/* @__PURE__ */ t(
|
|
1943
|
+
/* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" }),
|
|
1955
1944
|
"Visual"
|
|
1956
1945
|
]
|
|
1957
1946
|
}
|
|
1958
1947
|
),
|
|
1959
|
-
/* @__PURE__ */ i(
|
|
1960
|
-
/* @__PURE__ */ t(
|
|
1961
|
-
|
|
1948
|
+
/* @__PURE__ */ i(Lt, { modal: !1, children: [
|
|
1949
|
+
/* @__PURE__ */ t(Mt, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1950
|
+
T,
|
|
1962
1951
|
{
|
|
1963
1952
|
variant: "ghost",
|
|
1964
1953
|
size: "xs",
|
|
1965
1954
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1966
1955
|
"aria-label": "Open visual options",
|
|
1967
|
-
disabled: !
|
|
1968
|
-
children: /* @__PURE__ */ t(
|
|
1956
|
+
disabled: !k,
|
|
1957
|
+
children: /* @__PURE__ */ t(rn, { className: "h-3.5 w-3.5" })
|
|
1969
1958
|
}
|
|
1970
1959
|
) }),
|
|
1971
1960
|
/* @__PURE__ */ t(
|
|
1972
|
-
|
|
1961
|
+
Ot,
|
|
1973
1962
|
{
|
|
1974
1963
|
align: "end",
|
|
1975
1964
|
className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1976
|
-
children: /* @__PURE__ */ i(
|
|
1977
|
-
/* @__PURE__ */ t(
|
|
1965
|
+
children: /* @__PURE__ */ i(R, { onClick: () => de(!0), children: [
|
|
1966
|
+
/* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" }),
|
|
1978
1967
|
"From library..."
|
|
1979
1968
|
] })
|
|
1980
1969
|
}
|
|
1981
1970
|
)
|
|
1982
1971
|
] }),
|
|
1983
1972
|
/* @__PURE__ */ t(
|
|
1984
|
-
|
|
1973
|
+
un,
|
|
1985
1974
|
{
|
|
1986
1975
|
open: ke,
|
|
1987
|
-
onOpenChange:
|
|
1976
|
+
onOpenChange: de
|
|
1988
1977
|
}
|
|
1989
1978
|
)
|
|
1990
1979
|
] }),
|
|
1991
|
-
!
|
|
1992
|
-
/* @__PURE__ */ i(
|
|
1993
|
-
/* @__PURE__ */ t(
|
|
1980
|
+
!P && !k && (m || f) && (!g || !p || m !== void 0) && s && /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-1", children: [
|
|
1981
|
+
/* @__PURE__ */ i(T, { size: "xs", onClick: Cr, children: [
|
|
1982
|
+
/* @__PURE__ */ t(Ga, { className: "h-3.5 w-3.5" }),
|
|
1994
1983
|
f ? "Inspect" : "Edit"
|
|
1995
1984
|
] }),
|
|
1996
|
-
b ? /* @__PURE__ */ t(
|
|
1997
|
-
/* @__PURE__ */ t(
|
|
1985
|
+
b ? /* @__PURE__ */ t(Ct, { children: /* @__PURE__ */ i(Dt, { children: [
|
|
1986
|
+
/* @__PURE__ */ t(Et, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1998
1987
|
"button",
|
|
1999
1988
|
{
|
|
2000
1989
|
type: "button",
|
|
2001
1990
|
"aria-label": b,
|
|
2002
1991
|
className: "inline-flex size-6 items-center justify-center rounded-control text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
2003
|
-
children: /* @__PURE__ */ t(
|
|
1992
|
+
children: /* @__PURE__ */ t(ta, { "aria-hidden": "true", className: "size-3.5" })
|
|
2004
1993
|
}
|
|
2005
1994
|
) }),
|
|
2006
|
-
/* @__PURE__ */ t(
|
|
1995
|
+
/* @__PURE__ */ t(It, { children: /* @__PURE__ */ t("p", { children: b }) })
|
|
2007
1996
|
] }) }) : null
|
|
2008
1997
|
] }),
|
|
2009
|
-
|
|
2010
|
-
|
|
1998
|
+
je && s && ze && /* @__PURE__ */ t(
|
|
1999
|
+
xo,
|
|
2011
2000
|
{
|
|
2012
|
-
saved:
|
|
2013
|
-
draft:
|
|
2014
|
-
enabled:
|
|
2001
|
+
saved: qe,
|
|
2002
|
+
draft: h,
|
|
2003
|
+
enabled: k && !f
|
|
2015
2004
|
}
|
|
2016
2005
|
),
|
|
2017
|
-
|
|
2018
|
-
|
|
2006
|
+
je && s && ze && /* @__PURE__ */ i(
|
|
2007
|
+
T,
|
|
2019
2008
|
{
|
|
2020
2009
|
variant: "outline",
|
|
2021
2010
|
size: "xs",
|
|
2022
|
-
onClick:
|
|
2011
|
+
onClick: Lr,
|
|
2023
2012
|
disabled: Ie,
|
|
2024
2013
|
children: [
|
|
2025
|
-
/* @__PURE__ */ t(
|
|
2014
|
+
/* @__PURE__ */ t(Va, { className: "h-3.5 w-3.5" }),
|
|
2026
2015
|
"Undo"
|
|
2027
2016
|
]
|
|
2028
2017
|
}
|
|
2029
2018
|
),
|
|
2030
|
-
|
|
2031
|
-
|
|
2019
|
+
je && s && /* @__PURE__ */ i(
|
|
2020
|
+
T,
|
|
2032
2021
|
{
|
|
2033
2022
|
size: "xs",
|
|
2034
|
-
className:
|
|
2035
|
-
disabled: Ie || !
|
|
2036
|
-
onClick: () =>
|
|
2023
|
+
className: be(!ft && "opacity-60"),
|
|
2024
|
+
disabled: Ie || !ft,
|
|
2025
|
+
onClick: () => Ke(),
|
|
2037
2026
|
children: [
|
|
2038
|
-
Ie ? /* @__PURE__ */ t(
|
|
2027
|
+
Ie ? /* @__PURE__ */ t(Pe, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Nn, { className: "h-3.5 w-3.5" }),
|
|
2039
2028
|
Ie ? "Saving..." : "Save"
|
|
2040
2029
|
]
|
|
2041
2030
|
}
|
|
2042
2031
|
),
|
|
2043
|
-
|
|
2044
|
-
/* @__PURE__ */ t(
|
|
2032
|
+
k && !P && s && /* @__PURE__ */ i(T, { variant: "outline", size: "xs", onClick: Er, children: [
|
|
2033
|
+
/* @__PURE__ */ t(ja, { className: "h-3.5 w-3.5" }),
|
|
2045
2034
|
"Close"
|
|
2046
2035
|
] }),
|
|
2047
|
-
!
|
|
2048
|
-
!
|
|
2049
|
-
!
|
|
2050
|
-
/* @__PURE__ */ t(
|
|
2051
|
-
|
|
2036
|
+
!P && s && /* @__PURE__ */ t("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ t(mn, {}) }),
|
|
2037
|
+
!P && d && /* @__PURE__ */ t(Ln, {}),
|
|
2038
|
+
!P && s && !f && /* @__PURE__ */ i(Lt, { children: [
|
|
2039
|
+
/* @__PURE__ */ t(Mt, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2040
|
+
Ut,
|
|
2052
2041
|
{
|
|
2053
2042
|
tooltip: "More Options",
|
|
2054
2043
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
@@ -2057,97 +2046,97 @@ function Qo() {
|
|
|
2057
2046
|
variant: "ghost",
|
|
2058
2047
|
"aria-label": "More dashboard options"
|
|
2059
2048
|
},
|
|
2060
|
-
children: /* @__PURE__ */ t(
|
|
2049
|
+
children: /* @__PURE__ */ t(Ha, { className: "h-3.5 w-3.5" })
|
|
2061
2050
|
}
|
|
2062
2051
|
) }),
|
|
2063
2052
|
/* @__PURE__ */ i(
|
|
2064
|
-
|
|
2053
|
+
Ot,
|
|
2065
2054
|
{
|
|
2066
2055
|
align: "end",
|
|
2067
2056
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
2068
2057
|
children: [
|
|
2069
|
-
/* @__PURE__ */ t(
|
|
2058
|
+
/* @__PURE__ */ t(Me, { children: "Reports & briefings" }),
|
|
2070
2059
|
/* @__PURE__ */ i(
|
|
2071
|
-
|
|
2060
|
+
R,
|
|
2072
2061
|
{
|
|
2073
2062
|
disabled: w,
|
|
2074
|
-
onSelect: () =>
|
|
2063
|
+
onSelect: () => se(!0),
|
|
2075
2064
|
children: [
|
|
2076
|
-
/* @__PURE__ */ t(
|
|
2065
|
+
/* @__PURE__ */ t(qa, { className: "h-3.5 w-3.5" }),
|
|
2077
2066
|
"Export"
|
|
2078
2067
|
]
|
|
2079
2068
|
}
|
|
2080
2069
|
),
|
|
2081
2070
|
/* @__PURE__ */ t(
|
|
2082
|
-
|
|
2071
|
+
ho,
|
|
2083
2072
|
{
|
|
2084
|
-
scheduleReportVisible: !!(
|
|
2085
|
-
analyticalBriefingVisible: !!(
|
|
2086
|
-
onScheduleReport: () =>
|
|
2087
|
-
onCreateAnalyticalBriefing: () =>
|
|
2073
|
+
scheduleReportVisible: !!(gt && o.surfaceVisible && G && !k),
|
|
2074
|
+
analyticalBriefingVisible: !!(gt && o.surfaceVisible && G && !k),
|
|
2075
|
+
onScheduleReport: () => oe("scheduled_report"),
|
|
2076
|
+
onCreateAnalyticalBriefing: () => oe("analytical_briefing")
|
|
2088
2077
|
}
|
|
2089
2078
|
),
|
|
2090
|
-
|
|
2091
|
-
|
|
2079
|
+
k && /* @__PURE__ */ i(
|
|
2080
|
+
R,
|
|
2092
2081
|
{
|
|
2093
|
-
onSelect: () =>
|
|
2082
|
+
onSelect: () => Ne(!0),
|
|
2094
2083
|
children: [
|
|
2095
|
-
/* @__PURE__ */ t(
|
|
2084
|
+
/* @__PURE__ */ t(za, { className: "h-3.5 w-3.5" }),
|
|
2096
2085
|
"Download settings"
|
|
2097
2086
|
]
|
|
2098
2087
|
}
|
|
2099
2088
|
),
|
|
2100
|
-
/* @__PURE__ */ t(
|
|
2101
|
-
|
|
2102
|
-
/* @__PURE__ */ t(
|
|
2089
|
+
/* @__PURE__ */ t(We, {}),
|
|
2090
|
+
J.showGroupManagement && /* @__PURE__ */ i($, { children: [
|
|
2091
|
+
/* @__PURE__ */ t(Me, { children: "Access" }),
|
|
2103
2092
|
/* @__PURE__ */ i(
|
|
2104
|
-
|
|
2093
|
+
R,
|
|
2105
2094
|
{
|
|
2106
|
-
onClick: () =>
|
|
2095
|
+
onClick: () => K(!0),
|
|
2107
2096
|
children: [
|
|
2108
|
-
/* @__PURE__ */ t(
|
|
2097
|
+
/* @__PURE__ */ t(Qt, { className: "h-3.5 w-3.5" }),
|
|
2109
2098
|
"Manage Groups"
|
|
2110
2099
|
]
|
|
2111
2100
|
}
|
|
2112
2101
|
),
|
|
2113
|
-
/* @__PURE__ */ t(
|
|
2102
|
+
/* @__PURE__ */ t(We, {})
|
|
2114
2103
|
] }),
|
|
2115
|
-
/* @__PURE__ */ t(
|
|
2116
|
-
/* @__PURE__ */ i(
|
|
2117
|
-
/* @__PURE__ */ t(
|
|
2104
|
+
/* @__PURE__ */ t(Me, { children: "Preferences" }),
|
|
2105
|
+
/* @__PURE__ */ i(R, { onClick: () => W(!0), children: [
|
|
2106
|
+
/* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
|
|
2118
2107
|
"Report preferences"
|
|
2119
2108
|
] }),
|
|
2120
|
-
d && s && /* @__PURE__ */ i(
|
|
2121
|
-
/* @__PURE__ */ t(
|
|
2122
|
-
/* @__PURE__ */ t(
|
|
2109
|
+
d && s && /* @__PURE__ */ i($, { children: [
|
|
2110
|
+
/* @__PURE__ */ t(We, {}),
|
|
2111
|
+
/* @__PURE__ */ t(Me, { children: "Developer" }),
|
|
2123
2112
|
/* @__PURE__ */ i(
|
|
2124
|
-
|
|
2113
|
+
R,
|
|
2125
2114
|
{
|
|
2126
2115
|
onSelect: () => {
|
|
2127
|
-
var
|
|
2128
|
-
e != null && e.accessToken && ((
|
|
2116
|
+
var u;
|
|
2117
|
+
e != null && e.accessToken && ((u = navigator == null ? void 0 : navigator.clipboard) != null && u.writeText ? navigator.clipboard.writeText(e.accessToken).then(
|
|
2129
2118
|
() => C.success("Token copied to clipboard")
|
|
2130
2119
|
).catch(() => C.error("Unable to copy token")) : C.error("Clipboard not available"));
|
|
2131
2120
|
},
|
|
2132
2121
|
children: [
|
|
2133
|
-
/* @__PURE__ */ t(
|
|
2122
|
+
/* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
|
|
2134
2123
|
"Copy token"
|
|
2135
2124
|
]
|
|
2136
2125
|
}
|
|
2137
2126
|
),
|
|
2138
|
-
|
|
2139
|
-
|
|
2127
|
+
L && /* @__PURE__ */ i(
|
|
2128
|
+
R,
|
|
2140
2129
|
{
|
|
2141
|
-
disabled: !
|
|
2130
|
+
disabled: !Ve,
|
|
2142
2131
|
onSelect: () => {
|
|
2143
|
-
var
|
|
2144
|
-
if (!
|
|
2132
|
+
var u;
|
|
2133
|
+
if (!Ve) {
|
|
2145
2134
|
C.error(
|
|
2146
2135
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2147
2136
|
);
|
|
2148
2137
|
return;
|
|
2149
2138
|
}
|
|
2150
|
-
(
|
|
2139
|
+
(u = navigator == null ? void 0 : navigator.clipboard) != null && u.writeText ? navigator.clipboard.writeText(Ve).then(
|
|
2151
2140
|
() => C.success(
|
|
2152
2141
|
"Local document PDF URL copied to clipboard"
|
|
2153
2142
|
)
|
|
@@ -2158,32 +2147,32 @@ function Qo() {
|
|
|
2158
2147
|
) : C.error("Clipboard not available");
|
|
2159
2148
|
},
|
|
2160
2149
|
children: [
|
|
2161
|
-
/* @__PURE__ */ t(
|
|
2150
|
+
/* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
|
|
2162
2151
|
"Copy local document PDF URL"
|
|
2163
2152
|
]
|
|
2164
2153
|
}
|
|
2165
2154
|
),
|
|
2166
2155
|
/* @__PURE__ */ i(
|
|
2167
|
-
|
|
2156
|
+
R,
|
|
2168
2157
|
{
|
|
2169
|
-
onSelect: () =>
|
|
2158
|
+
onSelect: () => ra(n.apiServiceUrl),
|
|
2170
2159
|
children: [
|
|
2171
|
-
/* @__PURE__ */ t(
|
|
2160
|
+
/* @__PURE__ */ t(En, { className: "h-3.5 w-3.5" }),
|
|
2172
2161
|
"Invalidate token"
|
|
2173
2162
|
]
|
|
2174
2163
|
}
|
|
2175
2164
|
),
|
|
2176
|
-
/* @__PURE__ */ i(
|
|
2177
|
-
/* @__PURE__ */ t(
|
|
2165
|
+
/* @__PURE__ */ i(R, { onSelect: l, children: [
|
|
2166
|
+
/* @__PURE__ */ t(Sn, { className: "h-3.5 w-3.5" }),
|
|
2178
2167
|
"Brand Studio"
|
|
2179
2168
|
] }),
|
|
2180
|
-
|
|
2181
|
-
|
|
2169
|
+
k && /* @__PURE__ */ i(
|
|
2170
|
+
R,
|
|
2182
2171
|
{
|
|
2183
|
-
onSelect: () =>
|
|
2172
|
+
onSelect: () => ct(!dt),
|
|
2184
2173
|
children: [
|
|
2185
|
-
/* @__PURE__ */ t(
|
|
2186
|
-
|
|
2174
|
+
/* @__PURE__ */ t(kn, { className: "h-3.5 w-3.5" }),
|
|
2175
|
+
dt ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2187
2176
|
]
|
|
2188
2177
|
}
|
|
2189
2178
|
)
|
|
@@ -2192,110 +2181,110 @@ function Qo() {
|
|
|
2192
2181
|
}
|
|
2193
2182
|
)
|
|
2194
2183
|
] }),
|
|
2195
|
-
|
|
2196
|
-
|
|
2184
|
+
ae && mt && /* @__PURE__ */ t(
|
|
2185
|
+
Ka,
|
|
2197
2186
|
{
|
|
2198
|
-
resource:
|
|
2199
|
-
resourceType:
|
|
2200
|
-
onClose: () =>
|
|
2187
|
+
resource: mt,
|
|
2188
|
+
resourceType: Qe.DASHBOARD,
|
|
2189
|
+
onClose: () => ye(!1)
|
|
2201
2190
|
}
|
|
2202
2191
|
),
|
|
2203
|
-
|
|
2204
|
-
|
|
2192
|
+
J.showGroupManagement && /* @__PURE__ */ t(
|
|
2193
|
+
to,
|
|
2205
2194
|
{
|
|
2206
|
-
open:
|
|
2207
|
-
onOpenChange:
|
|
2195
|
+
open: z,
|
|
2196
|
+
onOpenChange: K
|
|
2208
2197
|
}
|
|
2209
2198
|
),
|
|
2210
2199
|
/* @__PURE__ */ t(
|
|
2211
|
-
|
|
2200
|
+
xn,
|
|
2212
2201
|
{
|
|
2213
|
-
open:
|
|
2214
|
-
onOpenChange:
|
|
2202
|
+
open: Q,
|
|
2203
|
+
onOpenChange: W
|
|
2215
2204
|
}
|
|
2216
2205
|
),
|
|
2217
2206
|
/* @__PURE__ */ t(
|
|
2218
|
-
|
|
2207
|
+
co,
|
|
2219
2208
|
{
|
|
2220
|
-
open:
|
|
2221
|
-
onOpenChange:
|
|
2209
|
+
open: we,
|
|
2210
|
+
onOpenChange: Ne
|
|
2222
2211
|
}
|
|
2223
2212
|
),
|
|
2224
|
-
|
|
2225
|
-
|
|
2213
|
+
G && ne ? /* @__PURE__ */ t(
|
|
2214
|
+
hn,
|
|
2226
2215
|
{
|
|
2227
|
-
dashboardId:
|
|
2228
|
-
dashboardTitle: (
|
|
2216
|
+
dashboardId: G,
|
|
2217
|
+
dashboardTitle: (h == null ? void 0 : h.title) || (B == null ? void 0 : B.title),
|
|
2229
2218
|
open: !0,
|
|
2230
|
-
onOpenChange: (
|
|
2231
|
-
|
|
2219
|
+
onOpenChange: (u) => {
|
|
2220
|
+
u || oe(null);
|
|
2232
2221
|
},
|
|
2233
2222
|
hideTrigger: !0,
|
|
2234
|
-
workflowIntent:
|
|
2223
|
+
workflowIntent: ne
|
|
2235
2224
|
}
|
|
2236
2225
|
) : null,
|
|
2237
2226
|
s && /* @__PURE__ */ t(
|
|
2238
|
-
|
|
2227
|
+
Qa,
|
|
2239
2228
|
{
|
|
2240
|
-
open:
|
|
2241
|
-
onOpenChange:
|
|
2229
|
+
open: Se,
|
|
2230
|
+
onOpenChange: se
|
|
2242
2231
|
}
|
|
2243
2232
|
),
|
|
2244
2233
|
/* @__PURE__ */ t(
|
|
2245
|
-
|
|
2234
|
+
Wa,
|
|
2246
2235
|
{
|
|
2247
|
-
open:
|
|
2248
|
-
onOpenChange: (
|
|
2249
|
-
!
|
|
2236
|
+
open: Ue,
|
|
2237
|
+
onOpenChange: (u) => {
|
|
2238
|
+
!u && Fe && !F || (Y(u), u || (y(null), j([]), H(!1)));
|
|
2250
2239
|
},
|
|
2251
|
-
children: /* @__PURE__ */ i(
|
|
2252
|
-
/* @__PURE__ */ i(
|
|
2253
|
-
/* @__PURE__ */ t(
|
|
2254
|
-
/* @__PURE__ */ t(
|
|
2255
|
-
|
|
2240
|
+
children: /* @__PURE__ */ i(Ya, { className: "max-w-sm", children: [
|
|
2241
|
+
/* @__PURE__ */ i(Ja, { children: [
|
|
2242
|
+
/* @__PURE__ */ t(Xa, { children: F ? "Save failed" : "Saving dashboard" }),
|
|
2243
|
+
/* @__PURE__ */ t(Za, { className: "pt-2", children: F ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2244
|
+
U.length > 0 && /* @__PURE__ */ i("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2256
2245
|
/* @__PURE__ */ t("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2257
|
-
/* @__PURE__ */ t("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children:
|
|
2246
|
+
/* @__PURE__ */ t("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: U.slice(0, 5).map((u) => /* @__PURE__ */ t("li", { children: u }, u)) })
|
|
2258
2247
|
] })
|
|
2259
2248
|
] }),
|
|
2260
|
-
/* @__PURE__ */ t(
|
|
2249
|
+
/* @__PURE__ */ t(en, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: F ? /* @__PURE__ */ i($, { children: [
|
|
2261
2250
|
/* @__PURE__ */ t(
|
|
2262
|
-
|
|
2251
|
+
tn,
|
|
2263
2252
|
{
|
|
2264
2253
|
onClick: () => {
|
|
2265
|
-
|
|
2254
|
+
Y(!1), y(null), j([]), H(!1);
|
|
2266
2255
|
},
|
|
2267
2256
|
className: "m-0",
|
|
2268
2257
|
children: "Close"
|
|
2269
2258
|
}
|
|
2270
2259
|
),
|
|
2271
2260
|
/* @__PURE__ */ t(
|
|
2272
|
-
|
|
2261
|
+
_t,
|
|
2273
2262
|
{
|
|
2274
|
-
onClick: () =>
|
|
2275
|
-
closeAfterSave:
|
|
2276
|
-
navigateHomeAfterSave:
|
|
2263
|
+
onClick: () => Ke({
|
|
2264
|
+
closeAfterSave: ie,
|
|
2265
|
+
navigateHomeAfterSave: Ge === "home"
|
|
2277
2266
|
}),
|
|
2278
2267
|
className: "m-0",
|
|
2279
2268
|
children: "Retry"
|
|
2280
2269
|
}
|
|
2281
2270
|
)
|
|
2282
|
-
] }) : /* @__PURE__ */ i(
|
|
2283
|
-
/* @__PURE__ */ t(
|
|
2271
|
+
] }) : /* @__PURE__ */ i(_t, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2272
|
+
/* @__PURE__ */ t(Pe, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2284
2273
|
"Saving..."
|
|
2285
2274
|
] }) })
|
|
2286
2275
|
] })
|
|
2287
2276
|
}
|
|
2288
2277
|
),
|
|
2289
2278
|
/* @__PURE__ */ t(
|
|
2290
|
-
|
|
2279
|
+
pn,
|
|
2291
2280
|
{
|
|
2292
|
-
open:
|
|
2293
|
-
onOpenChange: (
|
|
2294
|
-
|
|
2281
|
+
open: Nr,
|
|
2282
|
+
onOpenChange: (u) => {
|
|
2283
|
+
ce(u);
|
|
2295
2284
|
},
|
|
2296
|
-
onSave:
|
|
2297
|
-
onDiscard:
|
|
2298
|
-
isSaving:
|
|
2285
|
+
onSave: Ir,
|
|
2286
|
+
onDiscard: Ar,
|
|
2287
|
+
isSaving: Fe,
|
|
2299
2288
|
saveLabel: "Save",
|
|
2300
2289
|
discardLabel: "Discard changes"
|
|
2301
2290
|
}
|
|
@@ -2305,7 +2294,7 @@ function Qo() {
|
|
|
2305
2294
|
}
|
|
2306
2295
|
);
|
|
2307
2296
|
}
|
|
2308
|
-
function
|
|
2297
|
+
function vo({
|
|
2309
2298
|
accessToken: e,
|
|
2310
2299
|
dashboardId: n,
|
|
2311
2300
|
selectedSheetId: a,
|
|
@@ -2317,9 +2306,9 @@ function ko({
|
|
|
2317
2306
|
return null;
|
|
2318
2307
|
const m = new URL("http://localhost:5173/print-document");
|
|
2319
2308
|
m.searchParams.set("token", e), n && m.searchParams.set("dashboardId", n), m.searchParams.set("selectedSheetId", a), d && m.searchParams.set("theme", d);
|
|
2320
|
-
const
|
|
2321
|
-
return
|
|
2309
|
+
const p = new URL("http://127.0.0.1:3002/");
|
|
2310
|
+
return p.searchParams.set("pdfMode", "document"), p.searchParams.set("pageSize", r || "letter"), p.searchParams.set("orientation", o || "portrait"), p.searchParams.set("url", m.toString()), p.toString();
|
|
2322
2311
|
}
|
|
2323
2312
|
export {
|
|
2324
|
-
|
|
2313
|
+
Ho as default
|
|
2325
2314
|
};
|