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