react-semaphor 0.1.560 → 0.1.561
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +353 -349
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{analytics-base-schemas-CHLxsPfX.js → analytics-base-schemas-CB3oFAXk.js} +199 -171
- package/dist/chunks/{assistant-chat-Bu2fFm_I.js → assistant-chat-DiVHY3Hw.js} +27 -28
- package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
- package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
- package/dist/chunks/{braces-Da41xfUd.js → braces-u8VorWJc.js} +1 -1
- package/dist/chunks/{comparison-window-caption-4FNkMrzE.js → comparison-window-caption-DDsIWJYT.js} +108 -108
- package/dist/chunks/{context-BgPDzLHZ.js → context-TUjw9eqr.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-Dz-enUNR.js → custom-visual-inputs-DfolidZ9.js} +1 -1
- package/dist/chunks/{dashboard-_MeBuy67.js → dashboard-BRdZBPqr.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CEi4Pr_v.js → dashboard-briefing-launcher-CgvTLndW.js} +161 -162
- package/dist/chunks/{dashboard-controls-Bi7fyG-4.js → dashboard-controls-B4vfSzTF.js} +881 -945
- package/dist/chunks/{dashboard-json-B1mU_OMa.js → dashboard-json-Y3MF59g7.js} +5 -5
- package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
- package/dist/chunks/{edit-dashboard-visual-0CJN31Y3.js → edit-dashboard-visual-DwjZcxj-.js} +6112 -6146
- package/dist/chunks/{filter-reach-copy-BF4w4kI2.js → filter-reach-copy-bijwf_-b.js} +1250 -1392
- package/dist/chunks/{filter-value-text-CRC-K_l_.js → filter-value-text-DFnhwuEW.js} +3 -3
- package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
- package/dist/chunks/{index-DtHidOPV.js → index-ClwbY3BL.js} +197 -198
- package/dist/chunks/{layout-grid-BvsH4RY2.js → layout-grid-CtvCBfOm.js} +1 -1
- package/dist/chunks/{list-filter-Dg0otx5E.js → list-filter-BklYgciR.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CM18W8w6.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
- package/dist/chunks/{matrix-card-HPskLaPy.js → matrix-card-CUorIB7Q.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-Bbrfrke4.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-WPv4R-H_.js → matrix-operation-contract-BSiGEXVC.js} +255 -248
- package/dist/chunks/{metric-comparison-ljMKYZKa.js → metric-comparison-95aC0uEO.js} +6 -6
- package/dist/chunks/{model-change-Ccn1zaxl.js → model-change-B5wQhg5G.js} +1 -1
- package/dist/chunks/{palette-Bsh376zO.js → palette-DTnMhipt.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
- package/dist/chunks/{pivot-result-identity-vS9TSh4f.js → pivot-result-identity-olvXJoB9.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-BV8L0SeS.js → report-preferences-dialog-C2YUIwKG.js} +14 -14
- package/dist/chunks/{report-runtime-context-BZQh9ywy.js → report-runtime-context-DoIUr3MP.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
- package/dist/chunks/{save-B5EAsgQF.js → save-DH4RyrnG.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-n2Wn11cV.js → saved-dashboard-context-8jqfI7hI.js} +12 -12
- package/dist/chunks/{selection-reducer-D0YnaAD9.js → selection-reducer-CV7K4FI6.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-XLBLOJ2V.js → semaphor-ready-indicator-E2XWyibu.js} +30253 -31076
- package/dist/chunks/{shelf-drop-preview-context-DHMa54a-.js → shelf-drop-preview-context-C29EUzDp.js} +7 -7
- package/dist/chunks/{source-entity-resolution-dUG5VWRm.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
- package/dist/chunks/{switch-ByxH4M7t.js → switch-balDSHc7.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_GdeTYU.js → table-export-sheet-CK8tvh4d.js} +1 -1
- package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
- package/dist/chunks/{token-types-CQtXUVMy.js → token-types-DhYH5YKb.js} +1 -1
- package/dist/chunks/{upload-wbR-NVzq.js → upload-Ufj8vjyn.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CEBaLOKC.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
- package/dist/chunks/{validators-CXTneCA4.js → validators-BtaCFIEB.js} +37 -37
- package/dist/chunks/{zoned-wall-clock-B1n_WjW3.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2400 -1856
- package/dist/data-app-sdk/index.js +20 -20
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +10 -10
- package/dist/format-utils/index.js +257 -256
- package/dist/index.js +214 -215
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
- package/dist/types/index.js +50 -51
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
- package/dist/types/lib/stores/editor-store.d.ts +9 -1
- package/dist/types/lib/stores/table-actions.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +10 -0
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
- package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +539 -22
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +1 -8
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
- package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +8 -1
- package/dist/types/shared/format-utils/raw-temporal.d.ts +16 -0
- package/package.json +2 -2
- package/dist/chunks/bookmark-state-BFY9oNmr.js +0 -111
- package/dist/chunks/document-dashboard-inputs-CkWfDB8c.js +0 -3010
- package/dist/chunks/global-date-filter-utils-D8365uPH.js +0 -12889
- package/dist/chunks/pivot-result-contract-expectations-Bl5suy4-.js +0 -1832
- package/dist/chunks/raw-temporal-presentation-BHm7s-hz.js +0 -540
- package/dist/chunks/resolve-dashboard-input-context-CAMiWvyR.js +0 -5280
- package/dist/chunks/table-settings-Imz0FgWi.js +0 -637
- package/dist/chunks/temporal-input-presentation-uvNK_tM0.js +0 -3228
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import { am as
|
|
2
|
-
import {
|
|
3
|
-
import { aj as
|
|
4
|
-
import "./matrix-operation-contract-
|
|
5
|
-
import { r as
|
|
6
|
-
import { t as
|
|
1
|
+
import { am as Cn, an as In, ao as xn, ap as Dt, aq as Sn, ar as Dn, as as Tn, at as wn, au as Mn, av as Tt, aw as On, ax as Pn, ay as Nn, az as ve, aA as kn, aB as An, aC as _n, g as Rn, aD as En, C as Vn, G as Kn, aE as Ln, aF as Bn } from "./resolve-dashboard-input-context-q_iiNXE1.js";
|
|
2
|
+
import { eb as wt, bh as ce, ej as qn, ek as $n, el as Un, em as zn, R as z, en as Mt, bj as jn, eo as Gn, ep as Pe, ao as Ne, eq as Wn, bl as Hn, er as Qn, es as Yn, M as ke, et as Jn, eu as Xn, S as Zn, ev as er, N as tr, ew as w, aX as nr, ex as Ot, ey as H, ez as rr, eA as ir, eB as tt, eC as ar, eD as nt, eE as or, eF as L, eG as sr, Z as Pt, eH as Nt, eI as kt, v as At, eJ as rt, a5 as j, eK as Ae, eL as it, eM as _e, ef as at, eN as ot, ee as cr, bV as Re, eO as lr, eP as ur, eQ as dr, eR as X, bY as st, eS as fr, ab as _t, ac as Rt, d as mr, b_ as pr, eT as gr, b$ as yr, b3 as Et, eU as hr, eV as br, eW as vr, eX as Fr, b as Vt, ed as Cr, eY as Ir, eZ as xr, e_ as Se, e$ as Sr, f0 as Fe, cR as Kt, f1 as ct, f2 as Dr, cp as Tr, cU as lt, cT as wr, f3 as Mr, dB as Or, dD as Pr, bm as Nr, dG as kr, ad as ut } from "./global-date-filter-utils-BXgCpvQM.js";
|
|
3
|
+
import { aj as Lt, f as Ar, e as _r, ag as Bt, aA as Rr, v as Er, a$ as qt, aY as De, aW as B, aZ as Vr, b0 as Kr } from "./validators-BtaCFIEB.js";
|
|
4
|
+
import "./matrix-operation-contract-BSiGEXVC.js";
|
|
5
|
+
import { r as Lr, C as Br } from "./metric-comparison-95aC0uEO.js";
|
|
6
|
+
import { t as dt } from "./analytics-base-schemas-CB3oFAXk.js";
|
|
7
7
|
import "zod";
|
|
8
|
-
import {
|
|
9
|
-
import { w as ji } from "./pivot-result-contract-expectations-Bl5suy4-.js";
|
|
8
|
+
import { b as G, i as A, aI as qr, aJ as $r, m as Ur, h as zr, d as Te, e as jr, Q as P, ae as Gr, am as Wr, c as Hr, ag as Qr, W as Yr, w as Jr, a4 as Xr } from "./temporal-input-presentation-B77JsAzU.js";
|
|
10
9
|
import "../value-format-preferences/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import { g as
|
|
13
|
-
import { f as Hi, b as Yi } from "./raw-temporal-presentation-BHm7s-hz.js";
|
|
10
|
+
import { y as Zr, z as me } from "./bookmark-state-BusLpkb7.js";
|
|
11
|
+
import { g as ei } from "./_commonjsHelpers-DimLPMtv.js";
|
|
14
12
|
import "./index-CJW5BdWT.js";
|
|
15
13
|
import "./index-CuHybtft.js";
|
|
16
|
-
import { r as
|
|
17
|
-
import { R as
|
|
18
|
-
import { r as
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
return e != null && e.trim() ?
|
|
22
|
-
}
|
|
23
|
-
function
|
|
24
|
-
return !(e != null && e.trim()) ||
|
|
14
|
+
import { r as ti } from "./source-entity-resolution-BXI3nQ5Z.js";
|
|
15
|
+
import { R as ni } from "./matrix-analytical-definition-pU51-JmY.js";
|
|
16
|
+
import { r as $t } from "./applied-constraints-DU-wndZ7.js";
|
|
17
|
+
const Fo = 15, ri = /\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i, ii = /\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i, ai = /\bwhere\b/i;
|
|
18
|
+
function oi(e) {
|
|
19
|
+
return e != null && e.trim() ? ri.test(e) || ii.test(e) : !1;
|
|
20
|
+
}
|
|
21
|
+
function Co(e) {
|
|
22
|
+
return !(e != null && e.trim()) || oi(e) ? null : ai.test(e) ? {
|
|
25
23
|
helper: "{{ filters | and }}",
|
|
26
24
|
description: "For queries with an existing WHERE clause."
|
|
27
25
|
} : {
|
|
@@ -29,7 +27,7 @@ function wo(e) {
|
|
|
29
27
|
description: "For queries without a WHERE clause."
|
|
30
28
|
};
|
|
31
29
|
}
|
|
32
|
-
function
|
|
30
|
+
function si(e, t) {
|
|
33
31
|
if (!(typeof e != "number" || typeof t != "number"))
|
|
34
32
|
return e === t ? t : void 0;
|
|
35
33
|
}
|
|
@@ -61,12 +59,12 @@ function E(e, t) {
|
|
|
61
59
|
suffix: n.suffix,
|
|
62
60
|
negativeInParentheses: n.negativeStyle === "parentheses"
|
|
63
61
|
};
|
|
64
|
-
if (
|
|
62
|
+
if (A(n))
|
|
65
63
|
return {
|
|
66
64
|
type: n.type,
|
|
67
65
|
locale: n.locale,
|
|
68
66
|
currency: n.type === "currency" ? n.currency : void 0,
|
|
69
|
-
decimalPlaces: t != null && t.preserveOmittedProperties ? void 0 :
|
|
67
|
+
decimalPlaces: t != null && t.preserveOmittedProperties ? void 0 : si(
|
|
70
68
|
n.minimumFractionDigits,
|
|
71
69
|
n.maximumFractionDigits
|
|
72
70
|
),
|
|
@@ -83,7 +81,7 @@ function E(e, t) {
|
|
|
83
81
|
};
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
|
-
function
|
|
84
|
+
function Ut(e, t) {
|
|
87
85
|
const n = G(e, t);
|
|
88
86
|
return (n == null ? void 0 : n.type) === "duration" ? {
|
|
89
87
|
style: "duration",
|
|
@@ -97,10 +95,10 @@ function jt(e, t) {
|
|
|
97
95
|
prefix: n.prefix,
|
|
98
96
|
suffix: n.suffix,
|
|
99
97
|
negativeStyle: n.negativeStyle
|
|
100
|
-
} : !n || !
|
|
98
|
+
} : !n || !A(n) ? void 0 : {
|
|
101
99
|
style: n.type === "currency" ? "currency" : n.type === "percent" ? "percent" : n.type === "scientific" ? "scientific" : "decimal",
|
|
102
100
|
currency: n.type === "currency" && n.currency || (t != null && t.preserveOmittedProperties ? void 0 : "USD"),
|
|
103
|
-
locale: n.locale || (t != null && t.preserveOmittedProperties ? void 0 :
|
|
101
|
+
locale: n.locale || (t != null && t.preserveOmittedProperties ? void 0 : qr),
|
|
104
102
|
minimumFractionDigits: n.minimumFractionDigits ?? (t != null && t.preserveOmittedProperties ? void 0 : 0),
|
|
105
103
|
maximumFractionDigits: n.maximumFractionDigits ?? (t != null && t.preserveOmittedProperties ? void 0 : 2),
|
|
106
104
|
useGrouping: typeof n.useGrouping == "boolean" ? n.useGrouping : !0,
|
|
@@ -113,60 +111,60 @@ function jt(e, t) {
|
|
|
113
111
|
suffix: n.suffix
|
|
114
112
|
};
|
|
115
113
|
}
|
|
116
|
-
const
|
|
117
|
-
function
|
|
118
|
-
return e && e > 0 ? e :
|
|
114
|
+
const ft = [10, 20, 50, 100, 500, 1e3], ci = 50;
|
|
115
|
+
function li(e) {
|
|
116
|
+
return e && e > 0 ? e : ci;
|
|
119
117
|
}
|
|
120
|
-
function
|
|
121
|
-
const t =
|
|
122
|
-
return
|
|
118
|
+
function Io(e) {
|
|
119
|
+
const t = li(e), n = [...ft];
|
|
120
|
+
return ft.includes(
|
|
123
121
|
t
|
|
124
|
-
) || (n.push(t), n.sort((
|
|
122
|
+
) || (n.push(t), n.sort((r, i) => r - i)), n;
|
|
125
123
|
}
|
|
126
|
-
function
|
|
124
|
+
function xo(e) {
|
|
127
125
|
var t, n;
|
|
128
|
-
return !!((e.type === "table" || e.type === "detailTable") && e.sql && !
|
|
126
|
+
return !!((e.type === "table" || e.type === "detailTable") && e.sql && !wt(e.config) && !((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) != null && n.forceClientPagination));
|
|
129
127
|
}
|
|
130
|
-
function
|
|
131
|
-
var
|
|
128
|
+
function ui(e, t) {
|
|
129
|
+
var r, i, a, o;
|
|
132
130
|
if (t === "table-print")
|
|
133
131
|
return "disabled";
|
|
134
|
-
if ((
|
|
132
|
+
if ((i = (r = e.preferences) == null ? void 0 : r.tablePrefs) != null && i.forceClientPagination)
|
|
135
133
|
return "client";
|
|
136
|
-
const n =
|
|
137
|
-
return e.sql && !n ? (o = (a = e.preferences) == null ? void 0 : a.tablePrefs) != null && o.enableDevModePagination ? "server" : "client" : n &&
|
|
134
|
+
const n = wt(e.config);
|
|
135
|
+
return e.sql && !n ? (o = (a = e.preferences) == null ? void 0 : a.tablePrefs) != null && o.enableDevModePagination ? "server" : "client" : n && Cn(e) ? "server" : "client";
|
|
138
136
|
}
|
|
139
|
-
const
|
|
137
|
+
const zt = Object.freeze({}), So = {
|
|
140
138
|
access: "session-only",
|
|
141
139
|
printMode: !1,
|
|
142
140
|
baseline: null,
|
|
143
141
|
applied: null,
|
|
144
142
|
appliedBookmark: null,
|
|
145
|
-
tableSettings:
|
|
143
|
+
tableSettings: zt,
|
|
146
144
|
notices: [],
|
|
147
145
|
isFavorite: !1,
|
|
148
146
|
fetchedAt: 0
|
|
149
147
|
};
|
|
150
|
-
function
|
|
148
|
+
function Do(e) {
|
|
151
149
|
return !e.viewer.printMode && e.viewer.access !== "session-only" && !!e.viewer.baseline && !!e.viewerStateClient && !e.isDashboardEditing;
|
|
152
150
|
}
|
|
153
|
-
function
|
|
154
|
-
return e.isDashboardEditing ?
|
|
151
|
+
function di(e) {
|
|
152
|
+
return e.isDashboardEditing ? zt : e.viewer.tableSettings;
|
|
155
153
|
}
|
|
156
|
-
function
|
|
157
|
-
return
|
|
154
|
+
function fi(e, t) {
|
|
155
|
+
return di(e)[t];
|
|
158
156
|
}
|
|
159
|
-
function
|
|
160
|
-
if (!(n.isEditorPreview || e.isDashboardEditing) &&
|
|
161
|
-
return { settings:
|
|
157
|
+
function To(e, t, n) {
|
|
158
|
+
if (!(n.isEditorPreview || e.isDashboardEditing) && Zr(e.dashboard, t))
|
|
159
|
+
return { settings: fi(e, t) };
|
|
162
160
|
}
|
|
163
|
-
function
|
|
161
|
+
function mi(e) {
|
|
164
162
|
var t;
|
|
165
|
-
return
|
|
163
|
+
return In({
|
|
166
164
|
card: e.card,
|
|
167
|
-
paginationMode:
|
|
165
|
+
paginationMode: ui(e.card) === "server" ? "server" : "client",
|
|
168
166
|
result: {
|
|
169
|
-
keys: e.keys ??
|
|
167
|
+
keys: e.keys ?? xn(e.records),
|
|
170
168
|
rows: e.records,
|
|
171
169
|
columns: e.resultColumns,
|
|
172
170
|
columnKeyMap: e.columnKeyMap,
|
|
@@ -176,26 +174,26 @@ function lr(e) {
|
|
|
176
174
|
projection: "export"
|
|
177
175
|
});
|
|
178
176
|
}
|
|
179
|
-
function
|
|
177
|
+
function pi(e) {
|
|
180
178
|
if (e)
|
|
181
179
|
return E(
|
|
182
180
|
G(e, { preserveOmittedProperties: !0 }),
|
|
183
181
|
{ preserveOmittedProperties: !0 }
|
|
184
182
|
);
|
|
185
183
|
}
|
|
186
|
-
function
|
|
184
|
+
function gi(e) {
|
|
187
185
|
if (e.type === "percent") {
|
|
188
|
-
const { multiplyBy: t, percentValueMode: n, ...
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
191
|
-
|
|
186
|
+
const { multiplyBy: t, percentValueMode: n, ...r } = e, i = t === 100 ? "fraction" : t === 1 ? "whole" : t === void 0 ? n : void 0;
|
|
187
|
+
if (i || t === void 0)
|
|
188
|
+
return dt(
|
|
189
|
+
ce({ ...r, ...i ? { percentValueMode: i } : {} }, { preserveOmittedProperties: !0 })
|
|
192
190
|
);
|
|
193
191
|
}
|
|
194
|
-
return
|
|
195
|
-
|
|
192
|
+
return dt(
|
|
193
|
+
ce(e, { preserveOmittedProperties: !0 })
|
|
196
194
|
);
|
|
197
195
|
}
|
|
198
|
-
const pe =
|
|
196
|
+
const pe = pi, wo = gi, yi = () => ({
|
|
199
197
|
urlTemplate: "{value}",
|
|
200
198
|
// Default: use cell value as-is
|
|
201
199
|
labelType: "value",
|
|
@@ -204,14 +202,14 @@ const pe = cr, Ao = ur, dr = () => ({
|
|
|
204
202
|
labelColumn: "",
|
|
205
203
|
openInNewTab: !0
|
|
206
204
|
// Default: open in new tab (current behavior)
|
|
207
|
-
}),
|
|
205
|
+
}), Ee = () => ({
|
|
208
206
|
type: "none",
|
|
209
207
|
inheritMetricFormat: !0,
|
|
210
208
|
textAlign: "left",
|
|
211
|
-
width
|
|
212
|
-
|
|
213
|
-
minWidth:
|
|
214
|
-
maxWidth:
|
|
209
|
+
// The table's one width rule (card appearance P2-21).
|
|
210
|
+
width: Un,
|
|
211
|
+
minWidth: $n,
|
|
212
|
+
maxWidth: qn,
|
|
215
213
|
textOverflow: "ellipsis",
|
|
216
214
|
textWrap: "default",
|
|
217
215
|
numberFormat: {
|
|
@@ -233,12 +231,12 @@ const pe = cr, Ao = ur, dr = () => ({
|
|
|
233
231
|
sourceTimezone: "auto"
|
|
234
232
|
// Default to auto (use explicit timezone if present, otherwise assume UTC)
|
|
235
233
|
},
|
|
236
|
-
linkFormat:
|
|
234
|
+
linkFormat: yi()
|
|
237
235
|
});
|
|
238
|
-
function
|
|
236
|
+
function Mo(e, t, n, r) {
|
|
239
237
|
return t && t !== "auto" ? t : n;
|
|
240
238
|
}
|
|
241
|
-
const
|
|
239
|
+
const Oo = (e) => !e || e === "auto" ? "local time" : {
|
|
242
240
|
"America/New_York": "Eastern Time",
|
|
243
241
|
"America/Chicago": "Central Time",
|
|
244
242
|
"America/Denver": "Mountain Time",
|
|
@@ -249,15 +247,15 @@ const Ro = (e) => !e || e === "auto" ? "local time" : {
|
|
|
249
247
|
"Asia/Shanghai": "China Time",
|
|
250
248
|
UTC: "UTC"
|
|
251
249
|
}[e] || e;
|
|
252
|
-
function
|
|
253
|
-
const n = typeof e.decimalPlaces == "number",
|
|
250
|
+
function jt(e, t) {
|
|
251
|
+
const n = typeof e.decimalPlaces == "number", r = typeof e.minimumFractionDigits == "number" ? e.minimumFractionDigits : n ? e.decimalPlaces : t.min, i = typeof e.maximumFractionDigits == "number" ? e.maximumFractionDigits : n ? e.decimalPlaces : t.max;
|
|
254
252
|
return {
|
|
255
|
-
minimumFractionDigits:
|
|
256
|
-
maximumFractionDigits: Math.max(
|
|
253
|
+
minimumFractionDigits: r,
|
|
254
|
+
maximumFractionDigits: Math.max(r, i)
|
|
257
255
|
};
|
|
258
256
|
}
|
|
259
|
-
function
|
|
260
|
-
const n =
|
|
257
|
+
function le(e, t) {
|
|
258
|
+
const n = jt(e, t), r = typeof e.suffix == "string" && e.suffix.length > 0;
|
|
261
259
|
return {
|
|
262
260
|
style: "decimal",
|
|
263
261
|
locale: e.locale,
|
|
@@ -266,7 +264,7 @@ function ce(e, t) {
|
|
|
266
264
|
maximumFractionDigits: n.maximumFractionDigits,
|
|
267
265
|
useGrouping: e.useGrouping,
|
|
268
266
|
// Preserve legacy behavior: explicit custom suffix should not trigger compacting.
|
|
269
|
-
useSuffix: !!(e.useSuffix && !
|
|
267
|
+
useSuffix: !!(e.useSuffix && !r),
|
|
270
268
|
prefix: e.prefix,
|
|
271
269
|
suffix: e.suffix,
|
|
272
270
|
negativeInParentheses: e.negativeInParentheses,
|
|
@@ -274,48 +272,48 @@ function ce(e, t) {
|
|
|
274
272
|
percentValueMode: e.percentValueMode
|
|
275
273
|
};
|
|
276
274
|
}
|
|
277
|
-
function
|
|
278
|
-
if (t === "auto" && (t =
|
|
279
|
-
const
|
|
275
|
+
function Ve(e, t = "auto", n = {}) {
|
|
276
|
+
if (t === "auto" && (t = Ci(e, n)), (t === "number" || t === "currency" || t === "percent" || t === "scientific") && n.signDisplay && n.signDisplay !== "auto" && Number.isFinite(Number(e))) {
|
|
277
|
+
const i = typeof n.multiplyBy == "number" && Number.isFinite(n.multiplyBy) ? n.multiplyBy : 1, a = Number(e) * i, o = $r(a, n.signDisplay), s = Ve(o.value === a ? e : -Number(e), t, { ...n, signDisplay: void 0 });
|
|
280
278
|
if (!o.plus) return s;
|
|
281
279
|
const l = n.prefix ?? "";
|
|
282
280
|
return l && s.startsWith(l) ? `${l}+${s.slice(l.length)}` : `+${s}`;
|
|
283
281
|
}
|
|
284
282
|
switch (t) {
|
|
285
283
|
case "number":
|
|
286
|
-
return
|
|
284
|
+
return Gt(e, n);
|
|
287
285
|
case "currency":
|
|
288
|
-
return
|
|
286
|
+
return Wt(e, n);
|
|
289
287
|
case "percent":
|
|
290
|
-
return
|
|
288
|
+
return hi(e, n);
|
|
291
289
|
case "date":
|
|
292
|
-
return
|
|
290
|
+
return bi(e, n);
|
|
293
291
|
case "scientific":
|
|
294
|
-
return
|
|
292
|
+
return vi(e, n);
|
|
295
293
|
case "duration":
|
|
296
|
-
return
|
|
294
|
+
return Fi(e, n);
|
|
297
295
|
default:
|
|
298
296
|
return String(e);
|
|
299
297
|
}
|
|
300
298
|
}
|
|
301
|
-
function
|
|
302
|
-
return e < 0 && !!t.prefix && !t.negativeInParentheses ? `-${
|
|
299
|
+
function Gt(e, t = {}) {
|
|
300
|
+
return e < 0 && !!t.prefix && !t.negativeInParentheses ? `-${Te(
|
|
303
301
|
Math.abs(e),
|
|
304
|
-
|
|
302
|
+
le(t, {
|
|
305
303
|
min: 0,
|
|
306
304
|
max: 0
|
|
307
305
|
})
|
|
308
|
-
)}` :
|
|
306
|
+
)}` : Te(
|
|
309
307
|
e,
|
|
310
|
-
|
|
308
|
+
le(t, {
|
|
311
309
|
min: 0,
|
|
312
310
|
max: 0
|
|
313
311
|
})
|
|
314
312
|
);
|
|
315
313
|
}
|
|
316
|
-
function
|
|
317
|
-
return
|
|
318
|
-
...
|
|
314
|
+
function Wt(e, t = {}) {
|
|
315
|
+
return jr(e, {
|
|
316
|
+
...le(t, {
|
|
319
317
|
min: 2,
|
|
320
318
|
max: 2
|
|
321
319
|
}),
|
|
@@ -323,9 +321,9 @@ function Yt(e, t = {}) {
|
|
|
323
321
|
currency: t.currency || "USD"
|
|
324
322
|
});
|
|
325
323
|
}
|
|
326
|
-
function
|
|
327
|
-
const n =
|
|
328
|
-
return
|
|
324
|
+
function hi(e, t = {}) {
|
|
325
|
+
const n = jt(t, { min: 1, max: 1 }), i = typeof t.multiplyBy == "number" && Number.isFinite(t.multiplyBy) ? t.multiplyBy : t.percentValueMode === "whole" ? 1 : 100, a = e * i;
|
|
326
|
+
return Te(a, {
|
|
329
327
|
locale: t.locale,
|
|
330
328
|
minimumFractionDigits: n.minimumFractionDigits,
|
|
331
329
|
maximumFractionDigits: n.maximumFractionDigits,
|
|
@@ -336,25 +334,25 @@ function fr(e, t = {}) {
|
|
|
336
334
|
useSuffix: !1
|
|
337
335
|
});
|
|
338
336
|
}
|
|
339
|
-
function
|
|
337
|
+
function bi(e, t = {}) {
|
|
340
338
|
const { locale: n = "en-US" } = t;
|
|
341
339
|
try {
|
|
342
|
-
const
|
|
343
|
-
return isNaN(
|
|
340
|
+
const r = new Date(e);
|
|
341
|
+
return isNaN(r.getTime()) ? String(e) : new Intl.DateTimeFormat(n, {
|
|
344
342
|
dateStyle: "short"
|
|
345
|
-
}).format(
|
|
343
|
+
}).format(r);
|
|
346
344
|
} catch {
|
|
347
345
|
return String(e);
|
|
348
346
|
}
|
|
349
347
|
}
|
|
350
|
-
function
|
|
351
|
-
return
|
|
348
|
+
function vi(e, t = {}) {
|
|
349
|
+
return zr(
|
|
352
350
|
e,
|
|
353
|
-
|
|
351
|
+
le(t, { min: 2, max: 2 })
|
|
354
352
|
);
|
|
355
353
|
}
|
|
356
|
-
function
|
|
357
|
-
return
|
|
354
|
+
function Fi(e, t = {}) {
|
|
355
|
+
return Ur(e, {
|
|
358
356
|
inputUnit: t.durationInputUnit,
|
|
359
357
|
outputStyle: t.durationDisplayStyle,
|
|
360
358
|
largestUnit: t.durationLargestUnit,
|
|
@@ -365,55 +363,55 @@ function gr(e, t = {}) {
|
|
|
365
363
|
negativeInParentheses: t.negativeInParentheses
|
|
366
364
|
});
|
|
367
365
|
}
|
|
368
|
-
function
|
|
366
|
+
function Ci(e, t) {
|
|
369
367
|
return t.currency ? "currency" : typeof e == "string" && !isNaN(Date.parse(e)) ? "date" : "number";
|
|
370
368
|
}
|
|
371
|
-
function
|
|
372
|
-
return (n) =>
|
|
369
|
+
function Po(e, t = {}) {
|
|
370
|
+
return (n) => Ve(n, e, t);
|
|
373
371
|
}
|
|
374
|
-
function
|
|
372
|
+
function Ii({
|
|
375
373
|
number: e,
|
|
376
374
|
decimalPlaces: t = 0,
|
|
377
375
|
useSuffix: n = !1,
|
|
378
|
-
customSuffix:
|
|
379
|
-
currency:
|
|
376
|
+
customSuffix: r = "",
|
|
377
|
+
currency: i = "",
|
|
380
378
|
locale: a = "en-US"
|
|
381
379
|
}) {
|
|
382
|
-
if (
|
|
383
|
-
const o =
|
|
384
|
-
currency:
|
|
380
|
+
if (i) {
|
|
381
|
+
const o = Wt(e, {
|
|
382
|
+
currency: i,
|
|
385
383
|
decimalPlaces: t,
|
|
386
384
|
locale: a,
|
|
387
|
-
useSuffix: n && !
|
|
385
|
+
useSuffix: n && !r
|
|
388
386
|
});
|
|
389
|
-
return n &&
|
|
387
|
+
return n && r ? `${o}${r}` : o;
|
|
390
388
|
}
|
|
391
|
-
return
|
|
389
|
+
return Gt(e, {
|
|
392
390
|
decimalPlaces: t,
|
|
393
|
-
useSuffix: n && !
|
|
394
|
-
suffix:
|
|
391
|
+
useSuffix: n && !r,
|
|
392
|
+
suffix: r,
|
|
395
393
|
locale: a
|
|
396
394
|
});
|
|
397
395
|
}
|
|
398
|
-
var
|
|
396
|
+
var xi = function e(t, n) {
|
|
399
397
|
if (t === n) return !0;
|
|
400
398
|
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
401
399
|
if (t.constructor !== n.constructor) return !1;
|
|
402
|
-
var
|
|
400
|
+
var r, i, a;
|
|
403
401
|
if (Array.isArray(t)) {
|
|
404
|
-
if (
|
|
405
|
-
for (
|
|
406
|
-
if (!e(t[
|
|
402
|
+
if (r = t.length, r != n.length) return !1;
|
|
403
|
+
for (i = r; i-- !== 0; )
|
|
404
|
+
if (!e(t[i], n[i])) return !1;
|
|
407
405
|
return !0;
|
|
408
406
|
}
|
|
409
407
|
if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
|
|
410
408
|
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
|
|
411
409
|
if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
|
|
412
|
-
if (a = Object.keys(t),
|
|
413
|
-
for (
|
|
414
|
-
if (!Object.prototype.hasOwnProperty.call(n, a[
|
|
415
|
-
for (
|
|
416
|
-
var o = a[
|
|
410
|
+
if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
|
|
411
|
+
for (i = r; i-- !== 0; )
|
|
412
|
+
if (!Object.prototype.hasOwnProperty.call(n, a[i])) return !1;
|
|
413
|
+
for (i = r; i-- !== 0; ) {
|
|
414
|
+
var o = a[i];
|
|
417
415
|
if (!(o === "_owner" && t.$$typeof) && !e(t[o], n[o]))
|
|
418
416
|
return !1;
|
|
419
417
|
}
|
|
@@ -421,55 +419,34 @@ var br = function e(t, n) {
|
|
|
421
419
|
}
|
|
422
420
|
return t !== t && n !== n;
|
|
423
421
|
};
|
|
424
|
-
const ue = /* @__PURE__ */
|
|
425
|
-
function
|
|
426
|
-
if (typeof e == "number")
|
|
427
|
-
return Number.isFinite(e);
|
|
428
|
-
if (typeof e != "string")
|
|
429
|
-
return !1;
|
|
430
|
-
const t = e.trim().replace(/,/g, "");
|
|
431
|
-
return t !== "" && Number.isFinite(Number(t));
|
|
432
|
-
}
|
|
433
|
-
function Fr(e) {
|
|
434
|
-
if (!(e != null && e.length))
|
|
435
|
-
return [];
|
|
436
|
-
const t = /* @__PURE__ */ new Set();
|
|
437
|
-
return e.forEach((n) => {
|
|
438
|
-
Object.keys(n).forEach((i) => t.add(i));
|
|
439
|
-
}), [...t];
|
|
440
|
-
}
|
|
441
|
-
function Cr(e) {
|
|
442
|
-
return Fr(e).filter(
|
|
443
|
-
(n) => e == null ? void 0 : e.some((i) => vr(i[n]))
|
|
444
|
-
);
|
|
445
|
-
}
|
|
446
|
-
function Le(e, t) {
|
|
422
|
+
const ue = /* @__PURE__ */ ei(xi);
|
|
423
|
+
function Ke(e, t) {
|
|
447
424
|
var n;
|
|
448
425
|
if (t.id)
|
|
449
426
|
return (n = e.sql) != null && n.trim() ? { kind: "column", columnKey: t.id } : { kind: "metric", metricId: t.id };
|
|
450
427
|
}
|
|
451
|
-
function
|
|
428
|
+
function Ht(e) {
|
|
452
429
|
const t = e.context.preferences;
|
|
453
430
|
if (!t)
|
|
454
431
|
return e.authoredFormat;
|
|
455
|
-
const n =
|
|
432
|
+
const n = Ke(e.card, e.metric);
|
|
456
433
|
return P(
|
|
457
434
|
e.authoredFormat,
|
|
458
435
|
t,
|
|
459
436
|
n ? e.context.resolveBoundCurrency(n) : void 0
|
|
460
437
|
);
|
|
461
438
|
}
|
|
462
|
-
function
|
|
463
|
-
const t = z(e.card)[e.columnKey], n = (t == null ? void 0 : t.type) === "number" ?
|
|
439
|
+
function Si(e) {
|
|
440
|
+
const t = z(e.card)[e.columnKey], n = (t == null ? void 0 : t.type) === "number" ? Sn(
|
|
464
441
|
{ dataType: "number", format: void 0 },
|
|
465
442
|
t
|
|
466
|
-
) : void 0,
|
|
443
|
+
) : void 0, r = n == null ? void 0 : n.authoredFormat, i = A(r) ? Ht({
|
|
467
444
|
card: e.card,
|
|
468
445
|
metric: {
|
|
469
446
|
id: e.columnKey
|
|
470
447
|
},
|
|
471
448
|
context: e.context,
|
|
472
|
-
authoredFormat:
|
|
449
|
+
authoredFormat: r
|
|
473
450
|
}) : void 0;
|
|
474
451
|
return {
|
|
475
452
|
id: e.columnKey,
|
|
@@ -478,45 +455,45 @@ function Ir(e) {
|
|
|
478
455
|
alias: e.columnKey,
|
|
479
456
|
dataType: "number",
|
|
480
457
|
role: "metric",
|
|
481
|
-
format:
|
|
458
|
+
format: i
|
|
482
459
|
};
|
|
483
460
|
}
|
|
484
|
-
function
|
|
461
|
+
function No(e) {
|
|
485
462
|
const t = new Set(
|
|
486
|
-
|
|
463
|
+
zn(e.records)
|
|
487
464
|
), n = new Set(
|
|
488
465
|
e.renderedMetricKeys || e.resultKeys
|
|
489
|
-
),
|
|
466
|
+
), r = z(e.card);
|
|
490
467
|
return e.resultKeys.filter(
|
|
491
|
-
(
|
|
468
|
+
(i) => {
|
|
492
469
|
var a;
|
|
493
|
-
return n.has(
|
|
470
|
+
return n.has(i) && (t.has(i) || ((a = r[i]) == null ? void 0 : a.type) === "number");
|
|
494
471
|
}
|
|
495
472
|
);
|
|
496
473
|
}
|
|
497
|
-
function
|
|
474
|
+
function ko(e) {
|
|
498
475
|
var a, o;
|
|
499
476
|
const { card: t, context: n } = e;
|
|
500
|
-
if (!(n != null && n.preferences) || !
|
|
477
|
+
if (!(n != null && n.preferences) || !Mt(t.type))
|
|
501
478
|
return t;
|
|
502
|
-
const
|
|
503
|
-
(s) =>
|
|
479
|
+
const r = n.preferences, i = (a = t.sql) != null && a.trim() ? e.resultMetricKeys.map(
|
|
480
|
+
(s) => Si({
|
|
504
481
|
card: t,
|
|
505
482
|
columnKey: s,
|
|
506
483
|
context: n
|
|
507
484
|
})
|
|
508
485
|
) : (((o = t.config) == null ? void 0 : o.metricColumns) || []).map((s) => {
|
|
509
|
-
const l =
|
|
510
|
-
if (!
|
|
486
|
+
const l = Dt(t, s), c = l.authoredFormat;
|
|
487
|
+
if (!A(c))
|
|
511
488
|
return s;
|
|
512
|
-
const u =
|
|
489
|
+
const u = Ke(t, s), d = u ? n.resolveBoundCurrency(u) : void 0;
|
|
513
490
|
return l.source === "inferred" && !d ? s : {
|
|
514
491
|
...s,
|
|
515
492
|
format: l.source === "inferred" ? P(
|
|
516
493
|
c,
|
|
517
|
-
|
|
494
|
+
r,
|
|
518
495
|
d
|
|
519
|
-
) :
|
|
496
|
+
) : Ht({
|
|
520
497
|
card: t,
|
|
521
498
|
metric: s,
|
|
522
499
|
context: n,
|
|
@@ -528,23 +505,23 @@ function Vo(e) {
|
|
|
528
505
|
...t,
|
|
529
506
|
config: {
|
|
530
507
|
...t.config || {},
|
|
531
|
-
metricColumns:
|
|
508
|
+
metricColumns: i
|
|
532
509
|
}
|
|
533
510
|
};
|
|
534
511
|
}
|
|
535
512
|
function ge(e) {
|
|
536
513
|
var l;
|
|
537
|
-
const { card: t, context: n, formatOptions:
|
|
538
|
-
if (!t || !
|
|
539
|
-
return
|
|
540
|
-
if (!
|
|
514
|
+
const { card: t, context: n, formatOptions: r } = e, i = n == null ? void 0 : n.preferences;
|
|
515
|
+
if (!t || !i || !Mt(t.type))
|
|
516
|
+
return r;
|
|
517
|
+
if (!r) {
|
|
541
518
|
const c = e.metrics.filter(
|
|
542
519
|
(d) => !!d
|
|
543
520
|
), u = c.some(
|
|
544
|
-
(d) =>
|
|
521
|
+
(d) => A(d.format)
|
|
545
522
|
);
|
|
546
|
-
return c.length < 2 || !u ?
|
|
547
|
-
P({ type: "number" },
|
|
523
|
+
return c.length < 2 || !u ? r : E(
|
|
524
|
+
P({ type: "number" }, i),
|
|
548
525
|
{ preserveOmittedProperties: !0 }
|
|
549
526
|
);
|
|
550
527
|
}
|
|
@@ -552,36 +529,36 @@ function ge(e) {
|
|
|
552
529
|
const c = e.metrics.filter(
|
|
553
530
|
(d) => !!d
|
|
554
531
|
), u = c.filter(
|
|
555
|
-
(d) =>
|
|
532
|
+
(d) => A(d.format)
|
|
556
533
|
);
|
|
557
534
|
if (u.length === 0)
|
|
558
|
-
return
|
|
535
|
+
return r;
|
|
559
536
|
if (u.length !== c.length)
|
|
560
537
|
return E(
|
|
561
|
-
P({ type: "number" },
|
|
538
|
+
P({ type: "number" }, i),
|
|
562
539
|
{ preserveOmittedProperties: !0 }
|
|
563
540
|
);
|
|
564
541
|
}
|
|
565
|
-
const a =
|
|
542
|
+
const a = ce(r, {
|
|
566
543
|
preserveOmittedProperties: !0
|
|
567
544
|
});
|
|
568
|
-
if (!
|
|
569
|
-
return
|
|
545
|
+
if (!A(a))
|
|
546
|
+
return r;
|
|
570
547
|
const o = e.metrics.flatMap((c) => {
|
|
571
548
|
if (!c)
|
|
572
549
|
return [];
|
|
573
|
-
const u =
|
|
550
|
+
const u = Ke(t, c);
|
|
574
551
|
return [
|
|
575
552
|
P(
|
|
576
553
|
a,
|
|
577
|
-
|
|
554
|
+
i,
|
|
578
555
|
u ? n.resolveBoundCurrency(u) : void 0
|
|
579
556
|
)
|
|
580
557
|
];
|
|
581
558
|
});
|
|
582
559
|
if (o.length === 0)
|
|
583
560
|
return E(
|
|
584
|
-
P(a,
|
|
561
|
+
P(a, i),
|
|
585
562
|
{ preserveOmittedProperties: !0 }
|
|
586
563
|
);
|
|
587
564
|
const [s] = o;
|
|
@@ -592,7 +569,7 @@ function ge(e) {
|
|
|
592
569
|
type: "number",
|
|
593
570
|
currency: void 0
|
|
594
571
|
},
|
|
595
|
-
|
|
572
|
+
i
|
|
596
573
|
);
|
|
597
574
|
return E(c, {
|
|
598
575
|
preserveOmittedProperties: !0
|
|
@@ -602,82 +579,42 @@ function ge(e) {
|
|
|
602
579
|
preserveOmittedProperties: !0
|
|
603
580
|
});
|
|
604
581
|
}
|
|
605
|
-
|
|
606
|
-
"horizontalBar",
|
|
607
|
-
"tornado",
|
|
608
|
-
"pyramid",
|
|
609
|
-
"range"
|
|
610
|
-
]), Sr = /* @__PURE__ */ new Set([
|
|
611
|
-
"tornado",
|
|
612
|
-
"pyramid",
|
|
613
|
-
"range"
|
|
614
|
-
]), Dr = /* @__PURE__ */ new Set([
|
|
615
|
-
"tornado",
|
|
616
|
-
"pyramid",
|
|
617
|
-
"range"
|
|
618
|
-
]);
|
|
619
|
-
function wr(e) {
|
|
620
|
-
const { chartType: t, resultKeys: n, config: i } = e, r = 1 + (i != null && i.enableGrouping && (i.groupKey || n[1]) ? 1 : 0), a = n.slice(r), o = (i == null ? void 0 : i.xMetricKey) ?? a[0], s = (i == null ? void 0 : i.yMetricKey) ?? a[1] ?? a[0], l = t === "bubble" ? (i == null ? void 0 : i.radiusMetricKey) ?? a[2] ?? a[1] ?? a[0] : void 0, c = new Set(n);
|
|
621
|
-
return [o, s, l].filter((u) => !!u).filter((u) => c.has(u));
|
|
622
|
-
}
|
|
623
|
-
function Ko(e) {
|
|
624
|
-
const { chartType: t, resultKeys: n, preferences: i } = e;
|
|
625
|
-
return t === "scatter" || t === "bubble" ? [
|
|
626
|
-
...new Set(
|
|
627
|
-
wr({
|
|
628
|
-
chartType: t,
|
|
629
|
-
resultKeys: n,
|
|
630
|
-
config: i == null ? void 0 : i.bubbleScatterConfig
|
|
631
|
-
})
|
|
632
|
-
)
|
|
633
|
-
] : Dr.has(t || "") ? n.slice(2) : n.length === 1 ? [n[0]] : n.slice(1);
|
|
634
|
-
}
|
|
635
|
-
function te(e, t) {
|
|
636
|
-
var n;
|
|
637
|
-
return ((n = t == null ? void 0 : t.chartOptions) == null ? void 0 : n.indexAxis) === "y" || xr.has(e || "") ? "x" : "y";
|
|
638
|
-
}
|
|
639
|
-
function Lo(e, t) {
|
|
640
|
-
return te(e, t) === "x";
|
|
641
|
-
}
|
|
642
|
-
function Tr(e, t) {
|
|
643
|
-
return te(e, t) === "y" ? t == null ? void 0 : t.yAxisConfig : (t == null ? void 0 : t.xAxisConfig) || (Sr.has(e || "") ? t == null ? void 0 : t.yAxisConfig : void 0);
|
|
644
|
-
}
|
|
645
|
-
function Te(e) {
|
|
582
|
+
function we(e) {
|
|
646
583
|
return e ? Object.entries(e).some(([t, n]) => n == null || n === "" ? !1 : t === "type" ? n !== "auto" : !0) : !1;
|
|
647
584
|
}
|
|
648
585
|
function Qt(e) {
|
|
649
586
|
if (e)
|
|
650
587
|
return e.alias || e.label || e.name;
|
|
651
588
|
}
|
|
652
|
-
function
|
|
653
|
-
var
|
|
654
|
-
return (((
|
|
655
|
-
const a = Qt(
|
|
656
|
-
return t.metricId &&
|
|
589
|
+
function Me(e, t) {
|
|
590
|
+
var r;
|
|
591
|
+
return (((r = e == null ? void 0 : e.config) == null ? void 0 : r.metricColumns) || []).find((i) => {
|
|
592
|
+
const a = Qt(i);
|
|
593
|
+
return t.metricId && i.id === t.metricId || t.metricAlias && a === t.metricAlias || t.metricAlias && i.alias === t.metricAlias || t.columnId && a === t.columnId || t.columnId && i.alias === t.columnId || t.columnId && i.label === t.columnId || t.columnId && i.name === t.columnId;
|
|
657
594
|
});
|
|
658
595
|
}
|
|
659
596
|
function ne(e, t) {
|
|
660
|
-
var
|
|
661
|
-
const n =
|
|
662
|
-
if (!(n && ((
|
|
597
|
+
var r, i;
|
|
598
|
+
const n = jn(e, t);
|
|
599
|
+
if (!(n && ((i = (r = e == null ? void 0 : e.config) == null ? void 0 : r.groupByColumns) != null && i.includes(n)) && !Gn(n)))
|
|
663
600
|
return n;
|
|
664
601
|
}
|
|
665
|
-
function
|
|
666
|
-
return !!e && !(e != null && e.format) &&
|
|
602
|
+
function Di(e) {
|
|
603
|
+
return !!e && !(e != null && e.format) && Lt(e == null ? void 0 : e.dataType) === "number";
|
|
667
604
|
}
|
|
668
|
-
const
|
|
605
|
+
const Ti = {
|
|
669
606
|
style: "decimal"
|
|
670
607
|
};
|
|
671
|
-
function
|
|
608
|
+
function Yt(e) {
|
|
672
609
|
if (!e)
|
|
673
610
|
return;
|
|
674
|
-
const t =
|
|
611
|
+
const t = Ee();
|
|
675
612
|
return {
|
|
676
613
|
...t,
|
|
677
614
|
...e,
|
|
678
615
|
inheritMetricFormat: e.numberFormat ? e.inheritMetricFormat : e.inheritMetricFormat ?? t.inheritMetricFormat,
|
|
679
616
|
numberFormat: {
|
|
680
|
-
...
|
|
617
|
+
...Ti,
|
|
681
618
|
...e.numberFormat
|
|
682
619
|
},
|
|
683
620
|
dateFormat: {
|
|
@@ -690,46 +627,46 @@ function Zt(e) {
|
|
|
690
627
|
}
|
|
691
628
|
};
|
|
692
629
|
}
|
|
693
|
-
function
|
|
630
|
+
function Ao(e) {
|
|
694
631
|
return Object.fromEntries(
|
|
695
632
|
Object.entries(e || {}).map(([t, n]) => [
|
|
696
633
|
t,
|
|
697
|
-
|
|
634
|
+
Yt(n)
|
|
698
635
|
])
|
|
699
636
|
);
|
|
700
637
|
}
|
|
701
|
-
function
|
|
638
|
+
function ie(e) {
|
|
702
639
|
return !!(e && typeof e == "object" && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype);
|
|
703
640
|
}
|
|
704
|
-
function
|
|
705
|
-
if (!
|
|
641
|
+
function Jt(e, t, n) {
|
|
642
|
+
if (!ie(n))
|
|
706
643
|
return n;
|
|
707
|
-
const
|
|
644
|
+
const r = ie(e) ? e : {}, i = ie(t) ? t : {}, a = {};
|
|
708
645
|
for (const o of Object.keys(n)) {
|
|
709
646
|
const s = n[o];
|
|
710
647
|
if (s === void 0)
|
|
711
648
|
continue;
|
|
712
649
|
const l = Object.prototype.hasOwnProperty.call(
|
|
713
|
-
|
|
650
|
+
r,
|
|
714
651
|
o
|
|
715
|
-
), c =
|
|
652
|
+
), c = i[o];
|
|
716
653
|
if (l && ue(s, c)) {
|
|
717
|
-
a[o] =
|
|
654
|
+
a[o] = r[o];
|
|
718
655
|
continue;
|
|
719
656
|
}
|
|
720
657
|
if (!l && ue(s, c))
|
|
721
658
|
continue;
|
|
722
|
-
const u =
|
|
723
|
-
|
|
659
|
+
const u = Jt(
|
|
660
|
+
r[o],
|
|
724
661
|
c,
|
|
725
662
|
s
|
|
726
663
|
);
|
|
727
|
-
|
|
664
|
+
ie(u) && Object.keys(u).length === 0 && !l || (a[o] = u);
|
|
728
665
|
}
|
|
729
666
|
return a;
|
|
730
667
|
}
|
|
731
|
-
function
|
|
732
|
-
let t =
|
|
668
|
+
function _o(e) {
|
|
669
|
+
let t = Jt(
|
|
733
670
|
e.persisted,
|
|
734
671
|
e.baseline,
|
|
735
672
|
e.next
|
|
@@ -737,11 +674,11 @@ function qo(e) {
|
|
|
737
674
|
if (e.enforceDeclaredSqlTemporalFormat && e.next.type === "date" && !e.next.dateFormat.useRelativeTime && e.next.dateFormat.useCustomFormat) {
|
|
738
675
|
const n = e.next.dateFormat.customFormat;
|
|
739
676
|
if (!(n != null && n.trim()))
|
|
740
|
-
throw new
|
|
677
|
+
throw new Gr(
|
|
741
678
|
"invalid_raw_temporal_format",
|
|
742
679
|
"Custom table date formatting requires a non-empty pattern."
|
|
743
680
|
);
|
|
744
|
-
|
|
681
|
+
Wr({
|
|
745
682
|
dialect: "date_fns",
|
|
746
683
|
pattern: n,
|
|
747
684
|
valueKind: e.rawTemporalValueKind
|
|
@@ -767,16 +704,16 @@ function qo(e) {
|
|
|
767
704
|
type: "date"
|
|
768
705
|
} : t;
|
|
769
706
|
}
|
|
770
|
-
function
|
|
771
|
-
const n = e ||
|
|
707
|
+
function wi(e, t) {
|
|
708
|
+
const n = e || Ee(), r = !t;
|
|
772
709
|
return {
|
|
773
710
|
...n,
|
|
774
711
|
type: "number",
|
|
775
712
|
textAlign: n.type === "none" ? "right" : n.textAlign,
|
|
776
713
|
numberFormat: {
|
|
777
714
|
style: "decimal",
|
|
778
|
-
minimumFractionDigits:
|
|
779
|
-
maximumFractionDigits:
|
|
715
|
+
minimumFractionDigits: r ? n.numberFormat.minimumFractionDigits : void 0,
|
|
716
|
+
maximumFractionDigits: r ? n.numberFormat.maximumFractionDigits : void 0,
|
|
780
717
|
useGrouping: n.numberFormat.useGrouping
|
|
781
718
|
}
|
|
782
719
|
};
|
|
@@ -785,123 +722,123 @@ function Ce(e) {
|
|
|
785
722
|
if (e)
|
|
786
723
|
return e.trim().toLowerCase();
|
|
787
724
|
}
|
|
788
|
-
const
|
|
789
|
-
function
|
|
725
|
+
const Xt = /\s*(?:\((?:previous|last year|start|target|comparison)\)|δ)\s*$/i;
|
|
726
|
+
function Mi(e) {
|
|
790
727
|
const t = e == null ? void 0 : e.trim();
|
|
791
|
-
return t ? t.replace(
|
|
728
|
+
return t ? t.replace(Xt, "").trim() || t : void 0;
|
|
792
729
|
}
|
|
793
|
-
function
|
|
730
|
+
function Oi(e) {
|
|
794
731
|
const t = e == null ? void 0 : e.trim();
|
|
795
|
-
return t ?
|
|
732
|
+
return t ? Xt.test(t) : !1;
|
|
796
733
|
}
|
|
797
|
-
function
|
|
734
|
+
function Pi(e, t) {
|
|
798
735
|
return t.metricAlias ? e.find(
|
|
799
|
-
(n) =>
|
|
736
|
+
(n) => Lr(n) === t.metricAlias
|
|
800
737
|
) : t.metricId ? e.find((n) => n.id === t.metricId) : void 0;
|
|
801
738
|
}
|
|
802
|
-
function
|
|
739
|
+
function Ni(e) {
|
|
803
740
|
var b;
|
|
804
741
|
const {
|
|
805
742
|
card: t,
|
|
806
743
|
metricId: n,
|
|
807
|
-
metricAlias:
|
|
808
|
-
datasetIndex:
|
|
744
|
+
metricAlias: r,
|
|
745
|
+
datasetIndex: i,
|
|
809
746
|
datasetLabel: a,
|
|
810
747
|
metricKey: o
|
|
811
748
|
} = e, s = ((b = t == null ? void 0 : t.config) == null ? void 0 : b.metricColumns) || [];
|
|
812
|
-
if (
|
|
813
|
-
return
|
|
814
|
-
metricAlias:
|
|
749
|
+
if (r || n)
|
|
750
|
+
return Pi(s, {
|
|
751
|
+
metricAlias: r,
|
|
815
752
|
metricId: n
|
|
816
753
|
});
|
|
817
754
|
const l = [o, a], c = l.some(
|
|
818
|
-
(
|
|
755
|
+
(p) => Oi(p)
|
|
819
756
|
), u = l.filter(
|
|
820
|
-
(
|
|
757
|
+
(p) => !!p
|
|
821
758
|
);
|
|
822
|
-
for (const
|
|
823
|
-
const v =
|
|
824
|
-
columnId:
|
|
825
|
-
metricAlias:
|
|
759
|
+
for (const p of u) {
|
|
760
|
+
const v = Me(t, {
|
|
761
|
+
columnId: p,
|
|
762
|
+
metricAlias: p
|
|
826
763
|
});
|
|
827
764
|
if (v)
|
|
828
765
|
return v;
|
|
829
766
|
}
|
|
830
|
-
const d = u.map((
|
|
831
|
-
for (const
|
|
832
|
-
const v =
|
|
833
|
-
columnId:
|
|
834
|
-
metricAlias:
|
|
767
|
+
const d = u.map((p) => Ce(p)).filter((p) => !!p), f = u.map((p) => Mi(p)).filter((p) => !!p);
|
|
768
|
+
for (const p of f) {
|
|
769
|
+
const v = Me(t, {
|
|
770
|
+
columnId: p,
|
|
771
|
+
metricAlias: p
|
|
835
772
|
});
|
|
836
773
|
if (v)
|
|
837
774
|
return v;
|
|
838
775
|
}
|
|
839
776
|
if (s.length === 1)
|
|
840
777
|
return s[0];
|
|
841
|
-
if (!c && typeof
|
|
842
|
-
return s[
|
|
843
|
-
const
|
|
778
|
+
if (!c && typeof i == "number" && i >= 0 && i < s.length)
|
|
779
|
+
return s[i];
|
|
780
|
+
const m = f.map((p) => Ce(p)).filter((p) => !!p), g = [
|
|
844
781
|
...d,
|
|
845
|
-
...
|
|
782
|
+
...m
|
|
846
783
|
];
|
|
847
784
|
if (g.length !== 0)
|
|
848
|
-
return s.find((
|
|
785
|
+
return s.find((p) => {
|
|
849
786
|
const v = [
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
Qt(
|
|
787
|
+
p.alias,
|
|
788
|
+
p.label,
|
|
789
|
+
p.name,
|
|
790
|
+
Qt(p)
|
|
854
791
|
].map((x) => Ce(x)).filter((x) => !!x);
|
|
855
792
|
return g.some(
|
|
856
793
|
(x) => v.includes(x)
|
|
857
794
|
);
|
|
858
795
|
});
|
|
859
796
|
}
|
|
860
|
-
function
|
|
797
|
+
function ki(e) {
|
|
861
798
|
const t = G(e == null ? void 0 : e.format);
|
|
862
799
|
return E(t);
|
|
863
800
|
}
|
|
864
|
-
function
|
|
801
|
+
function mt(e, t) {
|
|
865
802
|
if (t)
|
|
866
|
-
return
|
|
803
|
+
return Me(e, {
|
|
867
804
|
columnId: t,
|
|
868
805
|
metricAlias: t
|
|
869
806
|
});
|
|
870
807
|
}
|
|
871
|
-
function
|
|
872
|
-
const t =
|
|
808
|
+
function pt(e) {
|
|
809
|
+
const t = ce(e);
|
|
873
810
|
if (t)
|
|
874
811
|
return JSON.stringify(t);
|
|
875
812
|
}
|
|
876
|
-
function
|
|
877
|
-
const n =
|
|
878
|
-
return !!(n &&
|
|
813
|
+
function Ai(e, t) {
|
|
814
|
+
const n = pt(e), r = pt(t);
|
|
815
|
+
return !!(n && r && n === r);
|
|
879
816
|
}
|
|
880
|
-
function
|
|
817
|
+
function _i(e) {
|
|
881
818
|
if (e.length === 0)
|
|
882
819
|
return;
|
|
883
820
|
const t = e.map(
|
|
884
|
-
(o) =>
|
|
821
|
+
(o) => ki(o)
|
|
885
822
|
);
|
|
886
823
|
if (!t.every(
|
|
887
|
-
(o) =>
|
|
824
|
+
(o) => we(o)
|
|
888
825
|
))
|
|
889
826
|
return;
|
|
890
|
-
const
|
|
891
|
-
return
|
|
892
|
-
(o) =>
|
|
893
|
-
) ?
|
|
827
|
+
const r = t, [i] = r;
|
|
828
|
+
return r.every(
|
|
829
|
+
(o) => Ai(i, o)
|
|
830
|
+
) ? i : void 0;
|
|
894
831
|
}
|
|
895
832
|
function ye(e) {
|
|
896
|
-
if (
|
|
833
|
+
if (we(e.overrideFormatOptions))
|
|
897
834
|
return {
|
|
898
835
|
formatOptions: e.overrideFormatOptions || void 0,
|
|
899
836
|
source: "override"
|
|
900
837
|
};
|
|
901
|
-
const t =
|
|
838
|
+
const t = _i(
|
|
902
839
|
e.metrics || []
|
|
903
840
|
);
|
|
904
|
-
return
|
|
841
|
+
return we(t) ? {
|
|
905
842
|
formatOptions: t,
|
|
906
843
|
source: "metric"
|
|
907
844
|
} : {
|
|
@@ -909,37 +846,37 @@ function ye(e) {
|
|
|
909
846
|
source: "auto"
|
|
910
847
|
};
|
|
911
848
|
}
|
|
912
|
-
function
|
|
849
|
+
function Zt(e) {
|
|
913
850
|
var l, c, u;
|
|
914
|
-
const { card: t, chartType: n, axis:
|
|
851
|
+
const { card: t, chartType: n, axis: r, preferences: i } = e, a = ((l = t == null ? void 0 : t.config) == null ? void 0 : l.metricColumns) || [], o = (i == null ? void 0 : i.datasetOptions) || [];
|
|
915
852
|
if (!a.length)
|
|
916
853
|
return [];
|
|
917
854
|
if (n === "combo")
|
|
918
|
-
return
|
|
919
|
-
const
|
|
920
|
-
return ((
|
|
855
|
+
return r === "x" ? [] : a.filter((d, f) => {
|
|
856
|
+
const m = o.find((b) => b.idx === f);
|
|
857
|
+
return ((m == null ? void 0 : m.yAxisId) === "y2" ? "y2" : "y") === r;
|
|
921
858
|
});
|
|
922
859
|
if (n === "bubble" || n === "scatter") {
|
|
923
|
-
if (
|
|
860
|
+
if (r === "y2")
|
|
924
861
|
return [];
|
|
925
|
-
const d =
|
|
862
|
+
const d = mt(
|
|
926
863
|
t,
|
|
927
|
-
(c =
|
|
928
|
-
) || a[0], f =
|
|
864
|
+
(c = i == null ? void 0 : i.bubbleScatterConfig) == null ? void 0 : c.xMetricKey
|
|
865
|
+
) || a[0], f = mt(
|
|
929
866
|
t,
|
|
930
|
-
(u =
|
|
867
|
+
(u = i == null ? void 0 : i.bubbleScatterConfig) == null ? void 0 : u.yMetricKey
|
|
931
868
|
) || a[1] || a[0];
|
|
932
|
-
return
|
|
869
|
+
return r === "x" ? d ? [d] : [] : f ? [f] : [];
|
|
933
870
|
}
|
|
934
|
-
const s =
|
|
935
|
-
return n === "radar" ?
|
|
871
|
+
const s = Ne(n, i);
|
|
872
|
+
return n === "radar" ? r === "y" ? a : [] : r !== s ? [] : a;
|
|
936
873
|
}
|
|
937
|
-
function
|
|
938
|
-
const { card: t, chartType: n, axis:
|
|
874
|
+
function Le(e) {
|
|
875
|
+
const { card: t, chartType: n, axis: r, preferences: i, axisConfig: a } = e, o = Zt({
|
|
939
876
|
card: t,
|
|
940
877
|
chartType: n,
|
|
941
|
-
axis:
|
|
942
|
-
preferences:
|
|
878
|
+
axis: r,
|
|
879
|
+
preferences: i
|
|
943
880
|
}), s = ye({
|
|
944
881
|
overrideFormatOptions: pe(a == null ? void 0 : a.valueFormat),
|
|
945
882
|
metrics: o
|
|
@@ -954,29 +891,29 @@ function Be(e) {
|
|
|
954
891
|
})
|
|
955
892
|
};
|
|
956
893
|
}
|
|
957
|
-
function
|
|
958
|
-
const { preferences: t, metric: n } = e,
|
|
959
|
-
overrideFormatOptions: pe(
|
|
894
|
+
function Ri(e) {
|
|
895
|
+
const { preferences: t, metric: n } = e, r = t == null ? void 0 : t.tooltipConfig, i = ye({
|
|
896
|
+
overrideFormatOptions: pe(r == null ? void 0 : r.valueFormat),
|
|
960
897
|
metrics: n ? [n] : []
|
|
961
898
|
});
|
|
962
899
|
return {
|
|
963
|
-
...
|
|
900
|
+
...i,
|
|
964
901
|
formatOptions: ge({
|
|
965
902
|
card: e.card,
|
|
966
903
|
metrics: e.metric ? [e.metric] : [],
|
|
967
|
-
formatOptions:
|
|
904
|
+
formatOptions: i.formatOptions,
|
|
968
905
|
context: e.numericPresentation
|
|
969
906
|
})
|
|
970
907
|
};
|
|
971
908
|
}
|
|
972
|
-
function
|
|
973
|
-
return t ===
|
|
909
|
+
function Be(e, t, n) {
|
|
910
|
+
return t === Ne(n, e) ? Wn(n, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
|
|
974
911
|
}
|
|
975
|
-
function
|
|
912
|
+
function qe(e) {
|
|
976
913
|
const { chartType: t, preferences: n } = e;
|
|
977
|
-
return t === "bubble" || t === "scatter" ? "y" :
|
|
914
|
+
return t === "bubble" || t === "scatter" ? "y" : Ne(t, n);
|
|
978
915
|
}
|
|
979
|
-
function
|
|
916
|
+
function en(e) {
|
|
980
917
|
switch (e) {
|
|
981
918
|
case "pie":
|
|
982
919
|
case "doughnut":
|
|
@@ -989,36 +926,36 @@ function nn(e) {
|
|
|
989
926
|
return !0;
|
|
990
927
|
}
|
|
991
928
|
}
|
|
992
|
-
function
|
|
993
|
-
const { card: t, chartType: n, preferences:
|
|
929
|
+
function Ro(e) {
|
|
930
|
+
const { card: t, chartType: n, preferences: r, metric: i } = e, a = Ri({
|
|
994
931
|
card: t,
|
|
995
|
-
preferences:
|
|
996
|
-
metric:
|
|
932
|
+
preferences: r,
|
|
933
|
+
metric: i,
|
|
997
934
|
numericPresentation: e.numericPresentation
|
|
998
935
|
});
|
|
999
936
|
if (a.source === "override")
|
|
1000
937
|
return a;
|
|
1001
|
-
const o = e.axis ||
|
|
938
|
+
const o = e.axis || qe({ chartType: n, preferences: r }), s = Le({
|
|
1002
939
|
card: t,
|
|
1003
940
|
chartType: n,
|
|
1004
941
|
axis: o,
|
|
1005
|
-
preferences:
|
|
1006
|
-
axisConfig:
|
|
942
|
+
preferences: r,
|
|
943
|
+
axisConfig: Be(r, o, n),
|
|
1007
944
|
numericPresentation: e.numericPresentation
|
|
1008
945
|
});
|
|
1009
946
|
return s.source === "override" ? s : a;
|
|
1010
947
|
}
|
|
1011
|
-
function
|
|
1012
|
-
const { card: t, chartType: n, preferences:
|
|
948
|
+
function Eo(e) {
|
|
949
|
+
const { card: t, chartType: n, preferences: r, dataLabelsConfig: i } = e, a = n || (t == null ? void 0 : t.type), o = qe({
|
|
1013
950
|
chartType: a,
|
|
1014
|
-
preferences:
|
|
1015
|
-
}), s =
|
|
951
|
+
preferences: r
|
|
952
|
+
}), s = Zt({
|
|
1016
953
|
card: t,
|
|
1017
954
|
chartType: a,
|
|
1018
955
|
axis: o,
|
|
1019
|
-
preferences:
|
|
956
|
+
preferences: r
|
|
1020
957
|
}), l = ye({
|
|
1021
|
-
overrideFormatOptions: pe(
|
|
958
|
+
overrideFormatOptions: pe(i == null ? void 0 : i.valueFormat),
|
|
1022
959
|
metrics: s
|
|
1023
960
|
}), c = {
|
|
1024
961
|
...l,
|
|
@@ -1029,15 +966,15 @@ function zo(e) {
|
|
|
1029
966
|
context: e.numericPresentation
|
|
1030
967
|
})
|
|
1031
968
|
};
|
|
1032
|
-
if (c.source === "override" || !
|
|
969
|
+
if (c.source === "override" || !en(a))
|
|
1033
970
|
return c;
|
|
1034
|
-
const u =
|
|
971
|
+
const u = Le({
|
|
1035
972
|
card: t,
|
|
1036
973
|
chartType: a,
|
|
1037
974
|
axis: o,
|
|
1038
|
-
preferences:
|
|
1039
|
-
axisConfig:
|
|
1040
|
-
|
|
975
|
+
preferences: r,
|
|
976
|
+
axisConfig: Be(
|
|
977
|
+
r,
|
|
1041
978
|
o,
|
|
1042
979
|
a
|
|
1043
980
|
),
|
|
@@ -1045,31 +982,31 @@ function zo(e) {
|
|
|
1045
982
|
});
|
|
1046
983
|
return u.source === "override" ? u : c;
|
|
1047
984
|
}
|
|
1048
|
-
function
|
|
1049
|
-
const { preferences: t, dataLabelsConfig: n, metric:
|
|
985
|
+
function Ei(e) {
|
|
986
|
+
const { preferences: t, dataLabelsConfig: n, metric: r } = e, i = ye({
|
|
1050
987
|
overrideFormatOptions: pe(n == null ? void 0 : n.valueFormat),
|
|
1051
|
-
metrics:
|
|
988
|
+
metrics: r ? [r] : []
|
|
1052
989
|
});
|
|
1053
990
|
return {
|
|
1054
|
-
...
|
|
991
|
+
...i,
|
|
1055
992
|
formatOptions: ge({
|
|
1056
993
|
card: e.card,
|
|
1057
994
|
metrics: e.metric ? [e.metric] : [],
|
|
1058
|
-
formatOptions:
|
|
995
|
+
formatOptions: i.formatOptions,
|
|
1059
996
|
context: e.numericPresentation
|
|
1060
997
|
})
|
|
1061
998
|
};
|
|
1062
999
|
}
|
|
1063
|
-
function
|
|
1000
|
+
function Vo(e) {
|
|
1064
1001
|
var o, s;
|
|
1065
|
-
const t =
|
|
1002
|
+
const t = Ni({
|
|
1066
1003
|
card: e.card,
|
|
1067
1004
|
metricId: e.metricId,
|
|
1068
1005
|
metricAlias: e.metricAlias,
|
|
1069
1006
|
datasetIndex: e.datasetIndex,
|
|
1070
1007
|
datasetLabel: e.datasetLabel,
|
|
1071
1008
|
metricKey: e.metricKey
|
|
1072
|
-
}), n =
|
|
1009
|
+
}), n = Ei({
|
|
1073
1010
|
card: e.card,
|
|
1074
1011
|
preferences: e.preferences,
|
|
1075
1012
|
dataLabelsConfig: e.dataLabelsConfig,
|
|
@@ -1078,52 +1015,52 @@ function Uo(e) {
|
|
|
1078
1015
|
});
|
|
1079
1016
|
if (n.source === "override")
|
|
1080
1017
|
return n;
|
|
1081
|
-
const
|
|
1082
|
-
if (!
|
|
1018
|
+
const r = (o = e.card) == null ? void 0 : o.type;
|
|
1019
|
+
if (!en(r))
|
|
1083
1020
|
return n;
|
|
1084
|
-
let
|
|
1085
|
-
chartType:
|
|
1021
|
+
let i = qe({
|
|
1022
|
+
chartType: r,
|
|
1086
1023
|
preferences: e.preferences
|
|
1087
1024
|
});
|
|
1088
|
-
if (
|
|
1025
|
+
if (r === "combo" && typeof e.datasetIndex == "number") {
|
|
1089
1026
|
const c = (((s = e.preferences) == null ? void 0 : s.datasetOptions) || []).find(
|
|
1090
1027
|
(u) => u.idx === e.datasetIndex
|
|
1091
1028
|
);
|
|
1092
|
-
|
|
1029
|
+
i = (c == null ? void 0 : c.yAxisId) === "y2" ? "y2" : "y";
|
|
1093
1030
|
}
|
|
1094
|
-
const a =
|
|
1031
|
+
const a = Le({
|
|
1095
1032
|
card: e.card,
|
|
1096
|
-
chartType:
|
|
1097
|
-
axis:
|
|
1033
|
+
chartType: r,
|
|
1034
|
+
axis: i,
|
|
1098
1035
|
preferences: e.preferences,
|
|
1099
|
-
axisConfig:
|
|
1036
|
+
axisConfig: Be(
|
|
1100
1037
|
e.preferences,
|
|
1101
|
-
|
|
1102
|
-
|
|
1038
|
+
i,
|
|
1039
|
+
r
|
|
1103
1040
|
),
|
|
1104
1041
|
numericPresentation: e.numericPresentation
|
|
1105
1042
|
});
|
|
1106
1043
|
return a.source === "override" ? a : n;
|
|
1107
1044
|
}
|
|
1108
|
-
function
|
|
1045
|
+
function Ko(e) {
|
|
1109
1046
|
return (e == null ? void 0 : e.rawValue) === !0;
|
|
1110
1047
|
}
|
|
1111
|
-
function
|
|
1048
|
+
function Vi(e) {
|
|
1112
1049
|
const t = e == null ? void 0 : e.numberFormat;
|
|
1113
1050
|
if (!t)
|
|
1114
1051
|
return;
|
|
1115
1052
|
if (t.style === "duration")
|
|
1116
|
-
return E(
|
|
1053
|
+
return E(Pe(t), {
|
|
1117
1054
|
preserveOmittedProperties: !0
|
|
1118
1055
|
});
|
|
1119
|
-
const n = t.style === "currency" ? "currency" : t.style === "percent" ? "percent" : t.style === "scientific" ? "scientific" : "number",
|
|
1056
|
+
const n = t.style === "currency" ? "currency" : t.style === "percent" ? "percent" : t.style === "scientific" ? "scientific" : "number", r = t.minimumFractionDigits, i = t.maximumFractionDigits;
|
|
1120
1057
|
return {
|
|
1121
1058
|
type: n,
|
|
1122
1059
|
currency: n === "currency" ? t.currency : void 0,
|
|
1123
1060
|
locale: t.locale,
|
|
1124
|
-
decimalPlaces:
|
|
1125
|
-
minimumFractionDigits:
|
|
1126
|
-
maximumFractionDigits:
|
|
1061
|
+
decimalPlaces: r === i ? i : void 0,
|
|
1062
|
+
minimumFractionDigits: r,
|
|
1063
|
+
maximumFractionDigits: i,
|
|
1127
1064
|
useGrouping: t.useGrouping,
|
|
1128
1065
|
percentValueMode: n === "percent" ? t.percentValueMode : void 0,
|
|
1129
1066
|
multiplyBy: t.scale,
|
|
@@ -1133,14 +1070,14 @@ function Br(e) {
|
|
|
1133
1070
|
suffix: t.suffix
|
|
1134
1071
|
};
|
|
1135
1072
|
}
|
|
1136
|
-
function
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1139
|
-
|
|
1073
|
+
function Ki(e, t, n = !1) {
|
|
1074
|
+
const r = n ? { preserveOmittedProperties: !0 } : void 0, i = G(e == null ? void 0 : e.format, r), a = Ut(
|
|
1075
|
+
i,
|
|
1076
|
+
r
|
|
1140
1077
|
);
|
|
1141
1078
|
if (!a)
|
|
1142
1079
|
return;
|
|
1143
|
-
const o = t ||
|
|
1080
|
+
const o = t || Ee(), s = n ? void 0 : o.numberFormat, l = o.type && o.type !== "none";
|
|
1144
1081
|
return {
|
|
1145
1082
|
...o,
|
|
1146
1083
|
type: l ? o.type : "number",
|
|
@@ -1154,13 +1091,13 @@ function qr(e, t, n = !1) {
|
|
|
1154
1091
|
}
|
|
1155
1092
|
};
|
|
1156
1093
|
}
|
|
1157
|
-
function
|
|
1094
|
+
function tn(e) {
|
|
1158
1095
|
var D;
|
|
1159
1096
|
const {
|
|
1160
1097
|
card: t,
|
|
1161
1098
|
columnId: n,
|
|
1162
|
-
persistedSettings:
|
|
1163
|
-
resolvedSettings:
|
|
1099
|
+
persistedSettings: r,
|
|
1100
|
+
resolvedSettings: i,
|
|
1164
1101
|
fallbackSettings: a,
|
|
1165
1102
|
metricId: o,
|
|
1166
1103
|
metricAlias: s,
|
|
@@ -1169,12 +1106,12 @@ function rn(e) {
|
|
|
1169
1106
|
columnKeyMap: u,
|
|
1170
1107
|
valueFormatPreferences: d,
|
|
1171
1108
|
boundCurrency: f,
|
|
1172
|
-
preserveOmittedProperties:
|
|
1173
|
-
} = e, g =
|
|
1109
|
+
preserveOmittedProperties: m
|
|
1110
|
+
} = e, g = r ?? z(t)[n], b = !((D = t == null ? void 0 : t.sql) != null && D.trim()) || Dn(g), p = b ? d : null, v = b ? f : void 0, x = i ?? Yt(g);
|
|
1174
1111
|
if (x && x.inheritMetricFormat !== !0)
|
|
1175
|
-
return
|
|
1112
|
+
return gt(
|
|
1176
1113
|
x,
|
|
1177
|
-
|
|
1114
|
+
p,
|
|
1178
1115
|
v
|
|
1179
1116
|
);
|
|
1180
1117
|
const h = ne(t, {
|
|
@@ -1184,39 +1121,39 @@ function rn(e) {
|
|
|
1184
1121
|
columnKeyMap: u,
|
|
1185
1122
|
fieldId: l,
|
|
1186
1123
|
fieldRole: c
|
|
1187
|
-
}), y =
|
|
1124
|
+
}), y = Ki(
|
|
1188
1125
|
h,
|
|
1189
1126
|
x || a,
|
|
1190
|
-
|
|
1191
|
-
), C = !y &&
|
|
1127
|
+
m ?? !!d
|
|
1128
|
+
), C = !y && p && Di(h) ? wi(
|
|
1192
1129
|
x || a,
|
|
1193
1130
|
v
|
|
1194
1131
|
) : void 0;
|
|
1195
|
-
return
|
|
1132
|
+
return gt(
|
|
1196
1133
|
y || C || x || a,
|
|
1197
|
-
|
|
1134
|
+
p,
|
|
1198
1135
|
v
|
|
1199
1136
|
);
|
|
1200
1137
|
}
|
|
1201
|
-
function
|
|
1138
|
+
function gt(e, t, n) {
|
|
1202
1139
|
if (!e || e.type !== "number" || !t)
|
|
1203
1140
|
return e;
|
|
1204
|
-
const
|
|
1141
|
+
const r = e.numberFormat, i = r ? Pe(r, {
|
|
1205
1142
|
preserveOmittedProperties: !0
|
|
1206
1143
|
}) : { type: "number" };
|
|
1207
|
-
if (!
|
|
1144
|
+
if (!i || !A(i))
|
|
1208
1145
|
return e;
|
|
1209
1146
|
const a = P(
|
|
1210
|
-
|
|
1147
|
+
i,
|
|
1211
1148
|
t,
|
|
1212
1149
|
n
|
|
1213
|
-
), o =
|
|
1150
|
+
), o = Ut(a, {
|
|
1214
1151
|
preserveOmittedProperties: !0
|
|
1215
1152
|
});
|
|
1216
1153
|
return o ? {
|
|
1217
1154
|
...e,
|
|
1218
1155
|
numberFormat: {
|
|
1219
|
-
...
|
|
1156
|
+
...r,
|
|
1220
1157
|
...o
|
|
1221
1158
|
}
|
|
1222
1159
|
} : e;
|
|
@@ -1224,17 +1161,17 @@ function yt(e, t, n) {
|
|
|
1224
1161
|
function de(e) {
|
|
1225
1162
|
if (!e.valueFormatPreferences)
|
|
1226
1163
|
return;
|
|
1227
|
-
const t =
|
|
1164
|
+
const t = tn(e);
|
|
1228
1165
|
if (!t || t.type !== "number")
|
|
1229
1166
|
return;
|
|
1230
|
-
const n =
|
|
1167
|
+
const n = Pe(t.numberFormat, {
|
|
1231
1168
|
preserveOmittedProperties: !0
|
|
1232
1169
|
});
|
|
1233
|
-
if (!(!n || !
|
|
1170
|
+
if (!(!n || !Hr(n)))
|
|
1234
1171
|
return n;
|
|
1235
1172
|
}
|
|
1236
|
-
function
|
|
1237
|
-
var
|
|
1173
|
+
function Li(e) {
|
|
1174
|
+
var r, i;
|
|
1238
1175
|
if (!e.presentation.preferences)
|
|
1239
1176
|
return;
|
|
1240
1177
|
const t = ne(e.card, {
|
|
@@ -1254,7 +1191,7 @@ function $r(e) {
|
|
|
1254
1191
|
columnKeyMap: e.columnKeyMap,
|
|
1255
1192
|
metricAlias: e.metricAlias ?? (t == null ? void 0 : t.alias),
|
|
1256
1193
|
valueFormatPreferences: e.presentation.preferences
|
|
1257
|
-
}), o =
|
|
1194
|
+
}), o = Hn(e.comparisonPrecision) ?? (A(a) ? a.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
|
|
1258
1195
|
return e.comparisonValueKind === "percent_change" ? {
|
|
1259
1196
|
type: "percent",
|
|
1260
1197
|
locale: e.presentation.preferences.locale,
|
|
@@ -1269,10 +1206,10 @@ function $r(e) {
|
|
|
1269
1206
|
suffix: "×"
|
|
1270
1207
|
};
|
|
1271
1208
|
}
|
|
1272
|
-
const n =
|
|
1209
|
+
const n = Tn({
|
|
1273
1210
|
card: e.card,
|
|
1274
1211
|
columnKey: e.columnId,
|
|
1275
|
-
metricId: e.metricId ?? (t && !((
|
|
1212
|
+
metricId: e.metricId ?? (t && !((i = (r = e.card.config) == null ? void 0 : r.groupByColumns) != null && i.includes(t)) ? t.id : void 0)
|
|
1276
1213
|
});
|
|
1277
1214
|
return de({
|
|
1278
1215
|
card: e.card,
|
|
@@ -1287,12 +1224,12 @@ function $r(e) {
|
|
|
1287
1224
|
boundCurrency: n ? e.presentation.resolveBoundCurrency(n) : void 0
|
|
1288
1225
|
});
|
|
1289
1226
|
}
|
|
1290
|
-
function
|
|
1227
|
+
function Bi(e) {
|
|
1291
1228
|
var s, l, c, u, d;
|
|
1292
1229
|
if (e.card.type === "matrixTable" && e.target.kind === "matrix_measure") {
|
|
1293
|
-
const f = e.target,
|
|
1230
|
+
const f = e.target, m = wn(e.card, e.matrixCatalog).find(
|
|
1294
1231
|
(b) => b.measureId === f.measureId
|
|
1295
|
-
), g =
|
|
1232
|
+
), g = m == null ? void 0 : m.canonical;
|
|
1296
1233
|
return g && (g.type === "number" || g.type === "currency") ? P(
|
|
1297
1234
|
g,
|
|
1298
1235
|
e.valueFormatPreferences,
|
|
@@ -1302,86 +1239,86 @@ function zr(e) {
|
|
|
1302
1239
|
if (e.target.kind === "matrix_measure")
|
|
1303
1240
|
return;
|
|
1304
1241
|
if (e.card.type === "kpi") {
|
|
1305
|
-
const f = e.target.kind === "metric" ? e.target.metricId : void 0
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1242
|
+
const f = e.target.kind === "metric" ? e.target.metricId : void 0;
|
|
1243
|
+
if (f && !((l = (s = e.card.config) == null ? void 0 : s.metricColumns) != null && l.some(
|
|
1244
|
+
(b) => b.id === f
|
|
1245
|
+
)))
|
|
1309
1246
|
return;
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1247
|
+
const m = Mn(e.card, {
|
|
1248
|
+
...f ? { column: { kind: "field", fieldId: f } } : {},
|
|
1312
1249
|
resultColumnKey: e.target.kind === "column" ? e.target.columnKey : void 0
|
|
1313
|
-
}),
|
|
1314
|
-
return
|
|
1315
|
-
|
|
1250
|
+
}), g = m.authoredFormat;
|
|
1251
|
+
return m.currencyBindable && g && A(g) ? P(
|
|
1252
|
+
g,
|
|
1316
1253
|
e.valueFormatPreferences,
|
|
1317
1254
|
e.boundCurrency
|
|
1318
1255
|
) : void 0;
|
|
1319
1256
|
}
|
|
1320
|
-
if (!((c = e.card.sql) != null && c.trim()) && !
|
|
1321
|
-
const f = e.target.metricId,
|
|
1322
|
-
(
|
|
1257
|
+
if (!((c = e.card.sql) != null && c.trim()) && !Qn(e.card.type) && e.target.kind === "metric") {
|
|
1258
|
+
const f = e.target.metricId, m = (d = (u = e.card.config) == null ? void 0 : u.metricColumns) == null ? void 0 : d.find(
|
|
1259
|
+
(p) => p.id === f
|
|
1323
1260
|
);
|
|
1324
|
-
if (!
|
|
1261
|
+
if (!m)
|
|
1325
1262
|
return;
|
|
1326
|
-
const g =
|
|
1263
|
+
const g = Dt(
|
|
1327
1264
|
e.card,
|
|
1328
|
-
|
|
1265
|
+
m
|
|
1329
1266
|
), b = g.authoredFormat;
|
|
1330
|
-
return g.currencyBindable && b &&
|
|
1267
|
+
return g.currencyBindable && b && A(b) ? P(
|
|
1331
1268
|
b,
|
|
1332
1269
|
e.valueFormatPreferences,
|
|
1333
1270
|
e.boundCurrency
|
|
1334
1271
|
) : void 0;
|
|
1335
1272
|
}
|
|
1336
|
-
const n = z(e.card),
|
|
1273
|
+
const n = z(e.card), r = e.target.kind === "metric" ? e.target.metricId : void 0, i = e.target.kind === "column" ? [e.target.columnKey] : [
|
|
1337
1274
|
...e.resultColumnKeys || [],
|
|
1338
1275
|
...Object.keys(n),
|
|
1339
1276
|
e.target.metricId
|
|
1340
|
-
], a = e.target.kind === "column" ? e.target.columnKey :
|
|
1277
|
+
], a = e.target.kind === "column" ? e.target.columnKey : i.find(
|
|
1341
1278
|
(f) => {
|
|
1342
|
-
var
|
|
1343
|
-
return ((
|
|
1279
|
+
var m;
|
|
1280
|
+
return ((m = ne(e.card, {
|
|
1344
1281
|
columnId: f
|
|
1345
|
-
})) == null ? void 0 :
|
|
1282
|
+
})) == null ? void 0 : m.id) === r;
|
|
1346
1283
|
}
|
|
1347
|
-
) ||
|
|
1284
|
+
) || r, o = de({
|
|
1348
1285
|
card: e.card,
|
|
1349
1286
|
columnId: a,
|
|
1350
|
-
metricId:
|
|
1287
|
+
metricId: r,
|
|
1351
1288
|
persistedSettings: n[a],
|
|
1352
1289
|
valueFormatPreferences: e.valueFormatPreferences,
|
|
1353
1290
|
boundCurrency: e.boundCurrency
|
|
1354
1291
|
});
|
|
1355
|
-
return
|
|
1292
|
+
return A(o) ? o : void 0;
|
|
1356
1293
|
}
|
|
1357
|
-
function
|
|
1358
|
-
var n,
|
|
1294
|
+
function Lo(e) {
|
|
1295
|
+
var n, r;
|
|
1359
1296
|
const t = e.persistedSettings ?? z(e.card)[e.columnId];
|
|
1360
1297
|
if (!t && !e.resolvedSettings || (t == null ? void 0 : t.inheritMetricFormat) === !0 || ((n = e.resolvedSettings) == null ? void 0 : n.inheritMetricFormat) === !0) {
|
|
1361
|
-
const
|
|
1362
|
-
(
|
|
1298
|
+
const i = G(
|
|
1299
|
+
(r = ne(e.card, {
|
|
1363
1300
|
columnId: e.columnId,
|
|
1364
1301
|
metricId: e.metricId,
|
|
1365
1302
|
metricAlias: e.metricAlias,
|
|
1366
1303
|
columnKeyMap: e.columnKeyMap
|
|
1367
|
-
})) == null ? void 0 :
|
|
1304
|
+
})) == null ? void 0 : r.format,
|
|
1368
1305
|
{ preserveOmittedProperties: !0 }
|
|
1369
1306
|
);
|
|
1370
|
-
if ((
|
|
1371
|
-
return E(
|
|
1307
|
+
if ((i == null ? void 0 : i.type) === "date" || (i == null ? void 0 : i.type) === "duration")
|
|
1308
|
+
return E(i, {
|
|
1372
1309
|
preserveOmittedProperties: !0
|
|
1373
1310
|
});
|
|
1374
1311
|
}
|
|
1375
|
-
return
|
|
1376
|
-
|
|
1312
|
+
return Vi(
|
|
1313
|
+
tn({
|
|
1377
1314
|
...e,
|
|
1378
1315
|
persistedSettings: t
|
|
1379
1316
|
})
|
|
1380
1317
|
);
|
|
1381
1318
|
}
|
|
1382
|
-
function
|
|
1383
|
-
const { value: t, formatOptions: n, preferences:
|
|
1384
|
-
return n != null && n.type && n.type !== "auto" ?
|
|
1319
|
+
function Bo(e) {
|
|
1320
|
+
const { value: t, formatOptions: n, preferences: r } = e;
|
|
1321
|
+
return n != null && n.type && n.type !== "auto" ? Ve(t, n.type, n) : Ii({
|
|
1385
1322
|
number: t,
|
|
1386
1323
|
decimalPlaces: 0,
|
|
1387
1324
|
useSuffix: !1,
|
|
@@ -1390,18 +1327,18 @@ function Wo(e) {
|
|
|
1390
1327
|
currency: ""
|
|
1391
1328
|
});
|
|
1392
1329
|
}
|
|
1393
|
-
function
|
|
1394
|
-
return
|
|
1330
|
+
function qi(e) {
|
|
1331
|
+
return Yn({
|
|
1395
1332
|
...e,
|
|
1396
|
-
activation:
|
|
1333
|
+
activation: ke({
|
|
1397
1334
|
card: e.card,
|
|
1398
1335
|
cardConfig: e.cardConfig
|
|
1399
1336
|
})
|
|
1400
1337
|
});
|
|
1401
1338
|
}
|
|
1402
|
-
function
|
|
1403
|
-
return
|
|
1404
|
-
activation:
|
|
1339
|
+
function qo(e) {
|
|
1340
|
+
return Jn({
|
|
1341
|
+
activation: ke({
|
|
1405
1342
|
card: e.card,
|
|
1406
1343
|
cardConfig: e.cardConfig
|
|
1407
1344
|
}),
|
|
@@ -1409,8 +1346,8 @@ function Ho(e) {
|
|
|
1409
1346
|
expectedResultOwner: e.expectedResultOwner
|
|
1410
1347
|
});
|
|
1411
1348
|
}
|
|
1412
|
-
function
|
|
1413
|
-
const t =
|
|
1349
|
+
function $i(e) {
|
|
1350
|
+
const t = Tt(e.card, e.effectiveCardConfig), n = mi({
|
|
1414
1351
|
card: t,
|
|
1415
1352
|
records: e.rows,
|
|
1416
1353
|
keys: e.rows.length === 0 ? e.resultKeys : void 0,
|
|
@@ -1429,55 +1366,55 @@ function jr(e) {
|
|
|
1429
1366
|
includeHeaders: e.file.includeHeaders,
|
|
1430
1367
|
columnSettings: z(e.card),
|
|
1431
1368
|
visibleColumns: [...n.visibleKeys],
|
|
1432
|
-
columnLabels: Object.fromEntries(n.visibleKeys.map((
|
|
1369
|
+
columnLabels: Object.fromEntries(n.visibleKeys.map((r) => [r, n.labels[r] ?? r]))
|
|
1433
1370
|
}
|
|
1434
1371
|
};
|
|
1435
1372
|
}
|
|
1436
|
-
function
|
|
1373
|
+
function Ui(e) {
|
|
1437
1374
|
var n;
|
|
1438
1375
|
const t = (n = e.preferences) == null ? void 0 : n.comparisonPresentation;
|
|
1439
1376
|
return {
|
|
1440
|
-
...
|
|
1377
|
+
...Br,
|
|
1441
1378
|
...t,
|
|
1442
1379
|
...t != null && t.conditionalLabels ? { conditionalLabels: { ...t.conditionalLabels } } : {},
|
|
1443
1380
|
...t != null && t.colors ? { colors: { ...t.colors } } : {}
|
|
1444
1381
|
};
|
|
1445
1382
|
}
|
|
1446
|
-
function
|
|
1447
|
-
const t =
|
|
1448
|
-
...
|
|
1383
|
+
function zi(e) {
|
|
1384
|
+
const t = Tt(e.card, e.effectiveCardConfig), { cardId: n, ...r } = e.requestPayloadBase, i = e.formatOptions.visibleColumns ?? [], a = [
|
|
1385
|
+
...i,
|
|
1449
1386
|
...Object.keys(e.formatOptions.columnSettings ?? {})
|
|
1450
|
-
], o =
|
|
1387
|
+
], o = On(
|
|
1451
1388
|
e.card,
|
|
1452
|
-
|
|
1389
|
+
i,
|
|
1453
1390
|
e.effectiveCardConfig
|
|
1454
|
-
), s =
|
|
1391
|
+
), s = Pn(
|
|
1455
1392
|
e.card,
|
|
1456
1393
|
e.effectiveCardConfig,
|
|
1457
1394
|
o
|
|
1458
|
-
), l =
|
|
1395
|
+
), l = Nn(
|
|
1459
1396
|
t,
|
|
1460
1397
|
a
|
|
1461
1398
|
), c = new Set(
|
|
1462
1399
|
l.eligibleTargets.map(ve)
|
|
1463
|
-
), u = (h) => c.has(ve(h)) ?
|
|
1464
|
-
bindings:
|
|
1400
|
+
), u = (h) => c.has(ve(h)) ? An({
|
|
1401
|
+
bindings: r.controlBindings,
|
|
1465
1402
|
controls: [
|
|
1466
|
-
...
|
|
1467
|
-
...
|
|
1403
|
+
...r.controlDefinitions ?? [],
|
|
1404
|
+
...r.cardControlDefinitions ?? []
|
|
1468
1405
|
],
|
|
1469
|
-
values:
|
|
1406
|
+
values: r.controlValues,
|
|
1470
1407
|
target: h,
|
|
1471
1408
|
knownTargets: l.knownTargets,
|
|
1472
1409
|
eligibleTargets: l.eligibleTargets
|
|
1473
|
-
}).currency : void 0, d =
|
|
1410
|
+
}).currency : void 0, d = kn({
|
|
1474
1411
|
card: e.card,
|
|
1475
1412
|
comparisonMetadata: e.comparisonMetadata,
|
|
1476
1413
|
columnKeyMap: e.columnKeyMap
|
|
1477
|
-
}), f =
|
|
1414
|
+
}), f = ke({
|
|
1478
1415
|
card: e.card,
|
|
1479
1416
|
cardConfig: e.effectiveCardConfig
|
|
1480
|
-
}),
|
|
1417
|
+
}), m = qi({
|
|
1481
1418
|
card: e.card,
|
|
1482
1419
|
cardConfig: e.effectiveCardConfig,
|
|
1483
1420
|
columns: e.resultColumns,
|
|
@@ -1489,8 +1426,8 @@ function Wr(e) {
|
|
|
1489
1426
|
`${h.role}:${h.id}`,
|
|
1490
1427
|
h
|
|
1491
1428
|
])
|
|
1492
|
-
),
|
|
1493
|
-
if (e.card.type === "detailTable" &&
|
|
1429
|
+
), p = /* @__PURE__ */ new Map();
|
|
1430
|
+
if (e.card.type === "detailTable" && r.resultOwner === "config") {
|
|
1494
1431
|
const h = e.resultColumns || [];
|
|
1495
1432
|
if (h.filter(
|
|
1496
1433
|
(y) => y.rawTemporal
|
|
@@ -1499,9 +1436,9 @@ function Wr(e) {
|
|
|
1499
1436
|
throw new Error(
|
|
1500
1437
|
"Canonical raw temporal export requires an authoritative columnKeyMap."
|
|
1501
1438
|
);
|
|
1502
|
-
const y =
|
|
1439
|
+
const y = Xn({
|
|
1503
1440
|
cardType: e.card.type,
|
|
1504
|
-
resultOwner:
|
|
1441
|
+
resultOwner: r.resultOwner,
|
|
1505
1442
|
effectiveCardConfig: e.effectiveCardConfig,
|
|
1506
1443
|
result: {
|
|
1507
1444
|
records: [],
|
|
@@ -1513,18 +1450,18 @@ function Wr(e) {
|
|
|
1513
1450
|
});
|
|
1514
1451
|
if (y.kind === "invalid") throw y.error;
|
|
1515
1452
|
if (y.kind === "loaded_empty" || y.kind === "loaded_valid")
|
|
1516
|
-
for (const [C,
|
|
1517
|
-
|
|
1453
|
+
for (const [C, M] of y.presentation.byColumnKey)
|
|
1454
|
+
p.set(C, M.format);
|
|
1518
1455
|
}
|
|
1519
|
-
} else if (
|
|
1456
|
+
} else if (r.resultOwner === "freeform" && r.sql.trim() && !r.python.trim())
|
|
1520
1457
|
for (const [h, F] of Object.entries(
|
|
1521
1458
|
z(e.card)
|
|
1522
1459
|
)) {
|
|
1523
1460
|
if (F.type !== "date") continue;
|
|
1524
|
-
const y =
|
|
1525
|
-
y &&
|
|
1461
|
+
const y = Zn(F.dateFormat);
|
|
1462
|
+
y && p.set(
|
|
1526
1463
|
h,
|
|
1527
|
-
|
|
1464
|
+
Qr({
|
|
1528
1465
|
format: y,
|
|
1529
1466
|
preferences: e.reportContext.valueFormat,
|
|
1530
1467
|
calendar: e.reportContext.calendar
|
|
@@ -1534,65 +1471,65 @@ function Wr(e) {
|
|
|
1534
1471
|
const v = [
|
|
1535
1472
|
...new Set(a)
|
|
1536
1473
|
].flatMap((h) => {
|
|
1537
|
-
var
|
|
1538
|
-
if (
|
|
1474
|
+
var $, U, R;
|
|
1475
|
+
if (m.byColumnKey.has(h) || p.has(h))
|
|
1539
1476
|
return [];
|
|
1540
1477
|
const F = d.columnPresentationOwners.get(h), y = {
|
|
1541
|
-
...
|
|
1478
|
+
...er(t, h, {
|
|
1542
1479
|
columnKeyMap: e.columnKeyMap,
|
|
1543
1480
|
resultColumns: e.resultColumns
|
|
1544
1481
|
}),
|
|
1545
1482
|
...F ? { metricId: F.metricId, metricAlias: F.metricAlias } : {}
|
|
1546
|
-
}, C = (
|
|
1547
|
-
ve(
|
|
1548
|
-
),
|
|
1483
|
+
}, C = ($ = t.sql) != null && $.trim() ? void 0 : ne(t, y), M = C ? { kind: "metric", metricId: C.id } : { kind: "column", columnKey: h }, D = c.has(
|
|
1484
|
+
ve(M)
|
|
1485
|
+
), N = u(M), q = z(t)[h], W = {
|
|
1549
1486
|
dashboardId: e.dashboardId,
|
|
1550
1487
|
cardId: t.id
|
|
1551
|
-
},
|
|
1488
|
+
}, _ = { kind: "column", columnKey: h }, O = C && (!q || q.inheritMetricFormat === !0) ? G(C.format, {
|
|
1552
1489
|
preserveOmittedProperties: !0
|
|
1553
1490
|
}) : void 0;
|
|
1554
|
-
if ((
|
|
1491
|
+
if ((O == null ? void 0 : O.type) === "date")
|
|
1555
1492
|
return [
|
|
1556
1493
|
{
|
|
1557
1494
|
scope: W,
|
|
1558
|
-
target:
|
|
1495
|
+
target: _,
|
|
1559
1496
|
format: {
|
|
1560
1497
|
type: "date",
|
|
1561
|
-
locale:
|
|
1562
|
-
...
|
|
1563
|
-
...
|
|
1564
|
-
...
|
|
1498
|
+
locale: O.locale ?? e.reportContext.valueFormat.locale,
|
|
1499
|
+
...O.pattern ? { pattern: O.pattern } : {},
|
|
1500
|
+
...O.timezone ? { timezone: O.timezone } : {},
|
|
1501
|
+
...O.sourceTimezone ? { sourceTimezone: O.sourceTimezone } : {}
|
|
1565
1502
|
}
|
|
1566
1503
|
}
|
|
1567
1504
|
];
|
|
1568
|
-
const
|
|
1505
|
+
const T = (F ? Li({
|
|
1569
1506
|
card: t,
|
|
1570
1507
|
columnId: h,
|
|
1571
1508
|
columnKeyMap: e.columnKeyMap,
|
|
1572
|
-
persistedSettings:
|
|
1509
|
+
persistedSettings: q,
|
|
1573
1510
|
metricId: F.metricId,
|
|
1574
1511
|
metricAlias: F.metricAlias,
|
|
1575
1512
|
comparisonValueKind: F.kind,
|
|
1576
|
-
comparisonPrecision: (
|
|
1513
|
+
comparisonPrecision: (R = (U = t.preferences) == null ? void 0 : U.comparisonPresentation) == null ? void 0 : R.precision,
|
|
1577
1514
|
presentation: {
|
|
1578
1515
|
preferences: e.reportContext.valueFormat,
|
|
1579
1516
|
resolveBoundCurrency: u
|
|
1580
1517
|
}
|
|
1581
|
-
}) : void 0) ?? (D ?
|
|
1518
|
+
}) : void 0) ?? (D ? Bi({
|
|
1582
1519
|
card: t,
|
|
1583
|
-
target:
|
|
1520
|
+
target: M,
|
|
1584
1521
|
resultColumnKeys: a,
|
|
1585
1522
|
valueFormatPreferences: e.reportContext.valueFormat,
|
|
1586
|
-
boundCurrency:
|
|
1523
|
+
boundCurrency: N
|
|
1587
1524
|
}) : void 0) ?? de({
|
|
1588
1525
|
card: t,
|
|
1589
1526
|
...y,
|
|
1590
|
-
persistedSettings:
|
|
1527
|
+
persistedSettings: q,
|
|
1591
1528
|
valueFormatPreferences: e.reportContext.valueFormat
|
|
1592
|
-
}), J = (
|
|
1593
|
-
|
|
1529
|
+
}), J = (T == null ? void 0 : T.type) === "duration" ? T : T ? P(
|
|
1530
|
+
T,
|
|
1594
1531
|
e.reportContext.valueFormat,
|
|
1595
|
-
|
|
1532
|
+
N
|
|
1596
1533
|
) : P(
|
|
1597
1534
|
{
|
|
1598
1535
|
type: "number",
|
|
@@ -1602,11 +1539,11 @@ function Wr(e) {
|
|
|
1602
1539
|
e.reportContext.valueFormat
|
|
1603
1540
|
);
|
|
1604
1541
|
return [
|
|
1605
|
-
J.type === "duration" ? { scope: W, target:
|
|
1542
|
+
J.type === "duration" ? { scope: W, target: _, format: J } : { scope: W, target: _, format: J }
|
|
1606
1543
|
];
|
|
1607
1544
|
});
|
|
1608
1545
|
v.push(
|
|
1609
|
-
...[...
|
|
1546
|
+
...[...m.byColumnKey.values()].map((h) => {
|
|
1610
1547
|
const F = b.get(
|
|
1611
1548
|
`${h.role ?? "groupby"}:${h.fieldId}`
|
|
1612
1549
|
);
|
|
@@ -1620,7 +1557,7 @@ function Wr(e) {
|
|
|
1620
1557
|
cardId: e.card.id
|
|
1621
1558
|
},
|
|
1622
1559
|
target: { kind: "column", columnKey: h.columnKey },
|
|
1623
|
-
format:
|
|
1560
|
+
format: tr(
|
|
1624
1561
|
F,
|
|
1625
1562
|
{
|
|
1626
1563
|
dateStyle: e.reportContext.valueFormat.dateStyle,
|
|
@@ -1631,13 +1568,13 @@ function Wr(e) {
|
|
|
1631
1568
|
};
|
|
1632
1569
|
})
|
|
1633
1570
|
), v.push(
|
|
1634
|
-
...[...
|
|
1571
|
+
...[...p].map(([h, F]) => ({
|
|
1635
1572
|
scope: { dashboardId: e.dashboardId, cardId: e.card.id },
|
|
1636
1573
|
target: { kind: "column", columnKey: h },
|
|
1637
1574
|
format: F
|
|
1638
1575
|
}))
|
|
1639
1576
|
);
|
|
1640
|
-
const x =
|
|
1577
|
+
const x = Yr({
|
|
1641
1578
|
reportContext: e.reportContext,
|
|
1642
1579
|
resolvedFormats: v
|
|
1643
1580
|
});
|
|
@@ -1645,82 +1582,82 @@ function Wr(e) {
|
|
|
1645
1582
|
formatOptions: {
|
|
1646
1583
|
...e.formatOptions,
|
|
1647
1584
|
...o ? { tableTotalsLabelColumnKey: o } : {},
|
|
1648
|
-
comparisonPresentation:
|
|
1585
|
+
comparisonPresentation: Ui(e.card),
|
|
1649
1586
|
presentationExecutionSnapshot: x
|
|
1650
1587
|
},
|
|
1651
1588
|
...s ? { tableTotalsRequest: s } : {}
|
|
1652
1589
|
};
|
|
1653
1590
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const t =
|
|
1591
|
+
function ji(e) {
|
|
1592
|
+
const t = Rn(
|
|
1656
1593
|
e.card,
|
|
1657
1594
|
e.requestPayloadBase
|
|
1658
|
-
), { cardId: n, ...
|
|
1595
|
+
), { cardId: n, ...r } = t.requestPayloadBase, i = zi(e);
|
|
1659
1596
|
return {
|
|
1660
1597
|
type: "card",
|
|
1661
1598
|
dashboardId: e.dashboardId,
|
|
1662
1599
|
cardId: e.card.id,
|
|
1663
1600
|
title: e.title,
|
|
1664
1601
|
connection_id: t.connectionId,
|
|
1665
|
-
...
|
|
1666
|
-
...
|
|
1602
|
+
...r,
|
|
1603
|
+
...i.tableTotalsRequest ? { tableTotalsRequest: i.tableTotalsRequest } : {},
|
|
1667
1604
|
totalRows: e.totalRows,
|
|
1668
1605
|
format: e.format,
|
|
1669
|
-
formatOptions:
|
|
1606
|
+
formatOptions: i.formatOptions
|
|
1670
1607
|
};
|
|
1671
1608
|
}
|
|
1672
|
-
function
|
|
1609
|
+
function $o(e) {
|
|
1673
1610
|
const { card: t, result: n } = e;
|
|
1674
1611
|
if (t.type !== "table" && t.type !== "detailTable")
|
|
1675
1612
|
return { status: "refused", reason: "not_a_table" };
|
|
1676
|
-
const
|
|
1677
|
-
if (
|
|
1613
|
+
const r = n.modelFormats ? Jr(e.effectiveCardConfig ?? t.config, n) : e.effectiveCardConfig;
|
|
1614
|
+
if (_n({ card: t, comparisonMetadata: n.comparisonMetadata }))
|
|
1678
1615
|
return { status: "refused", reason: "comparison_metadata_missing" };
|
|
1679
|
-
const
|
|
1616
|
+
const i = $i({
|
|
1680
1617
|
card: t,
|
|
1681
|
-
effectiveCardConfig:
|
|
1618
|
+
effectiveCardConfig: r,
|
|
1682
1619
|
rows: e.rows,
|
|
1683
1620
|
resultKeys: n.resultColumns.map((a) => a.key),
|
|
1684
1621
|
result: n,
|
|
1685
1622
|
reportContext: e.reportContext,
|
|
1686
1623
|
file: e.file
|
|
1687
1624
|
});
|
|
1688
|
-
return
|
|
1625
|
+
return i ? {
|
|
1689
1626
|
status: "ready",
|
|
1690
|
-
request:
|
|
1627
|
+
request: ji({
|
|
1691
1628
|
card: t,
|
|
1692
1629
|
dashboardId: e.dashboardId,
|
|
1693
1630
|
title: e.title,
|
|
1694
1631
|
reportContext: e.reportContext,
|
|
1695
1632
|
totalRows: n.totalRows,
|
|
1696
1633
|
format: e.file.format,
|
|
1697
|
-
formatOptions:
|
|
1634
|
+
formatOptions: i.formatOptions,
|
|
1698
1635
|
comparisonMetadata: n.comparisonMetadata,
|
|
1699
1636
|
requestPayloadBase: e.query,
|
|
1700
1637
|
resultColumns: [...n.resultColumns],
|
|
1701
1638
|
columnKeyMap: n.columnKeyMap,
|
|
1702
|
-
effectiveCardConfig:
|
|
1639
|
+
effectiveCardConfig: r
|
|
1703
1640
|
})
|
|
1704
1641
|
} : { status: "refused", reason: "columns_unresolved" };
|
|
1705
1642
|
}
|
|
1706
|
-
function
|
|
1707
|
-
if (
|
|
1708
|
-
|
|
1643
|
+
function Gi(e, t, n) {
|
|
1644
|
+
if (Ar(
|
|
1645
|
+
_r(t),
|
|
1709
1646
|
e.aggregateOrigin
|
|
1710
1647
|
))
|
|
1711
1648
|
return { aggregate: void 0, aggregateOrigin: void 0 };
|
|
1712
|
-
const
|
|
1649
|
+
const r = n === "selection" && e.role === "metric" ? t.aggregate : void 0;
|
|
1713
1650
|
return {
|
|
1714
|
-
aggregate: e.aggregate ??
|
|
1715
|
-
aggregateOrigin: e.aggregate ? e.aggregateOrigin :
|
|
1651
|
+
aggregate: e.aggregate ?? r,
|
|
1652
|
+
aggregateOrigin: e.aggregate ? e.aggregateOrigin : r ? t.aggregateOrigin : void 0
|
|
1716
1653
|
};
|
|
1717
1654
|
}
|
|
1718
|
-
function
|
|
1719
|
-
var
|
|
1655
|
+
function Wi(e, t, n) {
|
|
1656
|
+
var r, i, a, o, s, l;
|
|
1720
1657
|
if (n === "domain")
|
|
1721
1658
|
return {
|
|
1722
|
-
filters: (
|
|
1723
|
-
windowTransform: (
|
|
1659
|
+
filters: (r = t.parameters) == null ? void 0 : r.filters,
|
|
1660
|
+
windowTransform: (i = e.parameters) == null ? void 0 : i.windowTransform
|
|
1724
1661
|
};
|
|
1725
1662
|
if (!(!e.parameters && !t.parameters))
|
|
1726
1663
|
return {
|
|
@@ -1728,8 +1665,8 @@ function Jr(e, t, n) {
|
|
|
1728
1665
|
windowTransform: ((s = e.parameters) == null ? void 0 : s.windowTransform) ?? ((l = t.parameters) == null ? void 0 : l.windowTransform)
|
|
1729
1666
|
};
|
|
1730
1667
|
}
|
|
1731
|
-
function
|
|
1732
|
-
const
|
|
1668
|
+
function Uo(e, t, n) {
|
|
1669
|
+
const r = e;
|
|
1733
1670
|
return {
|
|
1734
1671
|
id: e.id,
|
|
1735
1672
|
role: e.role,
|
|
@@ -1737,22 +1674,22 @@ function Jo(e, t, n) {
|
|
|
1737
1674
|
// range bounds). They do not identify or redefine the catalog calculation.
|
|
1738
1675
|
...n === "selection" && e.alias ? { alias: e.alias } : {},
|
|
1739
1676
|
granularity: e.granularity ?? t.granularity,
|
|
1740
|
-
...
|
|
1677
|
+
...Gi(e, t, n),
|
|
1741
1678
|
...e.role === "metric" ? {
|
|
1742
|
-
aliasTemplate:
|
|
1743
|
-
valueAliases:
|
|
1744
|
-
comparison:
|
|
1745
|
-
comparisonPolarity:
|
|
1746
|
-
parameters:
|
|
1747
|
-
|
|
1679
|
+
aliasTemplate: r.aliasTemplate,
|
|
1680
|
+
valueAliases: r.valueAliases,
|
|
1681
|
+
comparison: r.comparison,
|
|
1682
|
+
comparisonPolarity: r.comparisonPolarity,
|
|
1683
|
+
parameters: Wi(
|
|
1684
|
+
r,
|
|
1748
1685
|
t,
|
|
1749
1686
|
"domain"
|
|
1750
1687
|
)
|
|
1751
1688
|
} : {},
|
|
1752
|
-
...
|
|
1689
|
+
...Hi(e)
|
|
1753
1690
|
};
|
|
1754
1691
|
}
|
|
1755
|
-
function
|
|
1692
|
+
function Hi(e) {
|
|
1756
1693
|
const t = {
|
|
1757
1694
|
...e.labelOrigin === "override" ? { label: e.label, labelOrigin: e.labelOrigin } : {},
|
|
1758
1695
|
...e.formatOrigin === "override" ? { format: e.format, formatOrigin: e.formatOrigin } : {}
|
|
@@ -1772,37 +1709,37 @@ function Qr(e) {
|
|
|
1772
1709
|
return t;
|
|
1773
1710
|
}
|
|
1774
1711
|
}
|
|
1775
|
-
const
|
|
1776
|
-
function
|
|
1712
|
+
const Qi = "table";
|
|
1713
|
+
function zo({ preferences: e, ...t }) {
|
|
1777
1714
|
return {
|
|
1778
1715
|
...t,
|
|
1779
|
-
type:
|
|
1716
|
+
type: Qi,
|
|
1780
1717
|
preferences: e ?? { onClickFilter: [{ columnIndex: 0, expression: "" }] },
|
|
1781
1718
|
sql: "",
|
|
1782
1719
|
data: []
|
|
1783
1720
|
};
|
|
1784
1721
|
}
|
|
1785
|
-
function
|
|
1786
|
-
const n = e.sheets ?? [],
|
|
1787
|
-
if (!
|
|
1788
|
-
throw new
|
|
1789
|
-
if (
|
|
1790
|
-
throw new
|
|
1722
|
+
function Yi(e, t) {
|
|
1723
|
+
const n = e.sheets ?? [], r = n.findIndex((o) => o.id === t.sheetId), i = n[r];
|
|
1724
|
+
if (!i)
|
|
1725
|
+
throw new w("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
|
|
1726
|
+
if (nr(i))
|
|
1727
|
+
throw new w(
|
|
1791
1728
|
"sheet_not_a_grid",
|
|
1792
1729
|
"This sheet is a document: it has no grid to arrange.",
|
|
1793
1730
|
"Arrange a grid sheet; Document sheets are laid out in the editor."
|
|
1794
1731
|
);
|
|
1795
|
-
const a =
|
|
1732
|
+
const a = Ot(i, { kind: "arrange", keepOrder: t.keepOrder === !0 });
|
|
1796
1733
|
return {
|
|
1797
|
-
dashboard: { ...e, sheets: n.map((o, s) => s ===
|
|
1798
|
-
clauses: [
|
|
1734
|
+
dashboard: { ...e, sheets: n.map((o, s) => s === r ? a : o) },
|
|
1735
|
+
clauses: [H.arranged(i.title || "the dashboard", t.keepOrder === !0, !(i.frames ?? []).length)]
|
|
1799
1736
|
};
|
|
1800
1737
|
}
|
|
1801
|
-
function
|
|
1738
|
+
function Ji(e) {
|
|
1802
1739
|
return !!(e && Object.prototype.hasOwnProperty.call(e, "calculatedFields"));
|
|
1803
1740
|
}
|
|
1804
|
-
function
|
|
1805
|
-
return
|
|
1741
|
+
function Q(...e) {
|
|
1742
|
+
return rr(e.flatMap((t) => t || []));
|
|
1806
1743
|
}
|
|
1807
1744
|
function Z(e, t) {
|
|
1808
1745
|
return {
|
|
@@ -1810,13 +1747,13 @@ function Z(e, t) {
|
|
|
1810
1747
|
fieldScope: t
|
|
1811
1748
|
};
|
|
1812
1749
|
}
|
|
1813
|
-
function
|
|
1750
|
+
function $e(e) {
|
|
1814
1751
|
return ((e == null ? void 0 : e.calculatedFields) || []).filter((t) => t.fieldScope === "sheet").map((t) => Z(t, "sheet"));
|
|
1815
1752
|
}
|
|
1816
|
-
function
|
|
1753
|
+
function nn(e) {
|
|
1817
1754
|
return ((e == null ? void 0 : e.calculatedFields) || []).filter((t) => !t.fieldScope).map((t) => Z(t, "sheet"));
|
|
1818
1755
|
}
|
|
1819
|
-
function
|
|
1756
|
+
function Xi(e) {
|
|
1820
1757
|
return e ? [
|
|
1821
1758
|
...(e.calculatedFields || []).filter(
|
|
1822
1759
|
(t) => t.fieldScope === "dashboard"
|
|
@@ -1824,33 +1761,33 @@ function ta(e) {
|
|
|
1824
1761
|
...(e.frames || []).flatMap((t) => t.calculatedFields || [])
|
|
1825
1762
|
].map((t) => Z(t, "dashboard")) : [];
|
|
1826
1763
|
}
|
|
1827
|
-
function
|
|
1764
|
+
function Zi(e) {
|
|
1828
1765
|
if (e !== void 0)
|
|
1829
|
-
return
|
|
1766
|
+
return Q(
|
|
1830
1767
|
e.map((t) => Z(t, "dashboard"))
|
|
1831
1768
|
);
|
|
1832
1769
|
}
|
|
1833
|
-
function
|
|
1834
|
-
var
|
|
1835
|
-
const t = [], n = (e.sheets || []).map((
|
|
1770
|
+
function jo(e) {
|
|
1771
|
+
var r;
|
|
1772
|
+
const t = [], n = (e.sheets || []).map((i) => {
|
|
1836
1773
|
var a;
|
|
1837
|
-
return t.push(...
|
|
1838
|
-
...
|
|
1839
|
-
calculatedFields:
|
|
1840
|
-
|
|
1841
|
-
|
|
1774
|
+
return t.push(...Xi(i)), {
|
|
1775
|
+
...i,
|
|
1776
|
+
calculatedFields: Q(
|
|
1777
|
+
$e(i),
|
|
1778
|
+
nn(i)
|
|
1842
1779
|
),
|
|
1843
|
-
frames: (a =
|
|
1780
|
+
frames: (a = i.frames) == null ? void 0 : a.map(
|
|
1844
1781
|
(o) => o.calculatedFields === void 0 ? o : { ...o, calculatedFields: void 0 }
|
|
1845
1782
|
)
|
|
1846
1783
|
};
|
|
1847
1784
|
});
|
|
1848
1785
|
return {
|
|
1849
1786
|
...e,
|
|
1850
|
-
calculatedFields:
|
|
1851
|
-
|
|
1852
|
-
(
|
|
1853
|
-
(
|
|
1787
|
+
calculatedFields: Zi(
|
|
1788
|
+
Q(
|
|
1789
|
+
(r = e.calculatedFields) == null ? void 0 : r.map(
|
|
1790
|
+
(i) => Z(i, "dashboard")
|
|
1854
1791
|
),
|
|
1855
1792
|
t
|
|
1856
1793
|
)
|
|
@@ -1858,127 +1795,131 @@ function Zo(e) {
|
|
|
1858
1795
|
sheets: n
|
|
1859
1796
|
};
|
|
1860
1797
|
}
|
|
1861
|
-
function
|
|
1862
|
-
var
|
|
1863
|
-
if (!((
|
|
1798
|
+
function yt(e, t) {
|
|
1799
|
+
var i;
|
|
1800
|
+
if (!((i = e == null ? void 0 : e.frames) != null && i.length))
|
|
1864
1801
|
return [];
|
|
1865
|
-
const n = t ? e.frames.find((a) => a.id === t) : void 0,
|
|
1802
|
+
const n = t ? e.frames.find((a) => a.id === t) : void 0, r = e.frames.filter(
|
|
1866
1803
|
(a) => !t || a.id !== t
|
|
1867
1804
|
);
|
|
1868
|
-
return
|
|
1805
|
+
return Q(
|
|
1869
1806
|
n == null ? void 0 : n.calculatedFields,
|
|
1870
|
-
...
|
|
1807
|
+
...r.map((a) => a.calculatedFields)
|
|
1871
1808
|
);
|
|
1872
1809
|
}
|
|
1873
|
-
function
|
|
1874
|
-
return e ?
|
|
1810
|
+
function Go(e, t) {
|
|
1811
|
+
return e ? $e(e) : [];
|
|
1875
1812
|
}
|
|
1876
|
-
function
|
|
1813
|
+
function Wo(e, t) {
|
|
1877
1814
|
if (!e)
|
|
1878
1815
|
return [];
|
|
1879
|
-
const n =
|
|
1816
|
+
const n = $e(e), r = nn(e), i = Q(
|
|
1880
1817
|
n,
|
|
1881
|
-
|
|
1818
|
+
r
|
|
1882
1819
|
);
|
|
1883
|
-
return
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
) :
|
|
1820
|
+
return Ji(e) ? i.length === 0 ? [] : r.length === 0 ? i : Q(
|
|
1821
|
+
i,
|
|
1822
|
+
yt(e, t)
|
|
1823
|
+
) : yt(e, t);
|
|
1887
1824
|
}
|
|
1888
|
-
function
|
|
1825
|
+
function ea(e) {
|
|
1889
1826
|
if (e !== void 0)
|
|
1890
|
-
return
|
|
1827
|
+
return Q(
|
|
1891
1828
|
e.map((t) => Z(t, "sheet"))
|
|
1892
1829
|
);
|
|
1893
1830
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const { field: t, sheetFields: n = [], dashboardFields:
|
|
1896
|
-
(l) =>
|
|
1831
|
+
function Ho(e) {
|
|
1832
|
+
const { field: t, sheetFields: n = [], dashboardFields: r = [] } = e, i = (s) => s.find(
|
|
1833
|
+
(l) => ir(l, t, {
|
|
1897
1834
|
allowComparableFallback: !0
|
|
1898
1835
|
})
|
|
1899
1836
|
);
|
|
1900
1837
|
if (t.fieldScope === "sheet")
|
|
1901
|
-
return { scope: "sheet", matchedField:
|
|
1838
|
+
return { scope: "sheet", matchedField: i(n) };
|
|
1902
1839
|
if (t.fieldScope === "dashboard")
|
|
1903
|
-
return { scope: "dashboard", matchedField: r
|
|
1904
|
-
const a =
|
|
1840
|
+
return { scope: "dashboard", matchedField: i(r) };
|
|
1841
|
+
const a = i(n);
|
|
1905
1842
|
if (a)
|
|
1906
1843
|
return { scope: "sheet", matchedField: a };
|
|
1907
|
-
const o = r
|
|
1844
|
+
const o = i(r);
|
|
1908
1845
|
return o ? { scope: "dashboard", matchedField: o } : { scope: "card" };
|
|
1909
1846
|
}
|
|
1910
|
-
function
|
|
1847
|
+
function ta(e, t) {
|
|
1911
1848
|
var x, h, F;
|
|
1912
|
-
const n = (e.sheets ?? []).findIndex((y) => y.id === t.sheetId),
|
|
1913
|
-
if (!(
|
|
1914
|
-
throw new
|
|
1915
|
-
const { frame:
|
|
1849
|
+
const n = (e.sheets ?? []).findIndex((y) => y.id === t.sheetId), r = (x = e.sheets) == null ? void 0 : x[n];
|
|
1850
|
+
if (!(r != null && r.frames))
|
|
1851
|
+
throw new w("sheet_not_found", `No sheet ${t.sheetId} with frames on this dashboard.`);
|
|
1852
|
+
const { frame: i } = t, a = r.frames.findIndex((y) => y.id === i.id);
|
|
1916
1853
|
if (a === -1)
|
|
1917
|
-
throw new
|
|
1918
|
-
const o =
|
|
1919
|
-
const y = c.map((C) => C.id ===
|
|
1920
|
-
return y.some((C) => C.id ===
|
|
1921
|
-
})() : [
|
|
1922
|
-
let
|
|
1923
|
-
const g =
|
|
1854
|
+
throw new w("frame_not_found", `No frame ${i.id} on sheet ${t.sheetId}.`);
|
|
1855
|
+
const o = r.frames[a], s = tt(r), l = (y) => y.calculatedFields === void 0 ? y : { ...y, calculatedFields: void 0 }, c = t.rewrittenFrames, u = c && c.length > 0 ? (() => {
|
|
1856
|
+
const y = c.map((C) => C.id === i.id ? i : C);
|
|
1857
|
+
return y.some((C) => C.id === i.id) ? y : [i, ...y];
|
|
1858
|
+
})() : [i], d = new Map(u.map((y) => [y.id, y])), f = Ot(r, { kind: "frame_updated", frame: i, resizeForNewKind: t.resizeLayouts });
|
|
1859
|
+
let m = /* @__PURE__ */ new Set();
|
|
1860
|
+
const g = ar.produce(e, (y) => {
|
|
1924
1861
|
const C = y.sheets[n];
|
|
1925
|
-
f.layouts !==
|
|
1926
|
-
const
|
|
1927
|
-
return
|
|
1862
|
+
f.layouts !== r.layouts && (C.layouts = nt(f.layouts)), f.customizedBreakpoints !== r.customizedBreakpoints && (C.customizedBreakpoints = f.customizedBreakpoints), t.sheetCalculatedFields !== void 0 && (C.calculatedFields = ea(t.sheetCalculatedFields)), C.frames = C.frames.map((D) => {
|
|
1863
|
+
const N = d.get(D.id);
|
|
1864
|
+
return N ? nt(l(N)) : D.calculatedFields === void 0 ? D : { ...D, calculatedFields: void 0 };
|
|
1928
1865
|
});
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1931
|
-
}), b = g.sheets[n].frames.find((y) => y.id ===
|
|
1932
|
-
...
|
|
1866
|
+
const M = tt(C);
|
|
1867
|
+
m = new Set([...s].filter((D) => !M.has(D))), or(y, m), t.dashboardCalculatedFields && (y.calculatedFields = t.dashboardCalculatedFields);
|
|
1868
|
+
}), b = g.sheets[n].frames.find((y) => y.id === i.id), p = [
|
|
1869
|
+
...m.size ? [{ kind: "cards_removed", cardIds: [...m] }] : [],
|
|
1933
1870
|
{ kind: "frame_committed", sheetId: t.sheetId, before: o, after: b }
|
|
1934
|
-
], v = ((h =
|
|
1935
|
-
return { dashboard: g, runtimeEffects:
|
|
1871
|
+
], v = ((h = i.cards) == null ? void 0 : h.find((y) => y.id === i.activeCardId)) ?? ((F = i.cards) == null ? void 0 : F[0]);
|
|
1872
|
+
return { dashboard: g, runtimeEffects: p, clauses: [H.committed(v == null ? void 0 : v.title)] };
|
|
1873
|
+
}
|
|
1874
|
+
function na(e, t) {
|
|
1875
|
+
const n = { ...e }, r = [];
|
|
1876
|
+
return t.title !== void 0 && t.title !== e.title && (n.title = t.title, r.push(H.plain("dashboard", `renames the dashboard to ${L(t.title)}`))), t.description === null && e.description ? (delete n.description, r.push(H.plain("dashboard", "removes the dashboard's description"))) : typeof t.description == "string" && t.description !== e.description && (n.description = t.description, r.push(H.plain("dashboard", "changes the dashboard's description"))), { dashboard: n, clauses: r.length ? r : [H.plain("dashboard", "changes nothing on the dashboard")] };
|
|
1936
1877
|
}
|
|
1937
|
-
function
|
|
1878
|
+
function ra(e, t, n) {
|
|
1938
1879
|
var a;
|
|
1939
1880
|
if (!e || !t || t.customFilterPreferences) return;
|
|
1940
|
-
const
|
|
1941
|
-
return (t.dateSelectionMode === "day" ?
|
|
1881
|
+
const r = t.defaultDateFilter;
|
|
1882
|
+
return (t.dateSelectionMode === "day" ? lr(r) : t.dateSelectionMode === "months" && (ur(r) || dr(r) && r.unit === "month" && (r.mode === "previous" || r.mode === "this" && !r.toDate && !r.boundary))) && ((a = X(t, n)) == null ? void 0 : a.valueType) === "date" ? !0 : void 0;
|
|
1942
1883
|
}
|
|
1943
|
-
function
|
|
1944
|
-
const t = e.createId ??
|
|
1884
|
+
function Qo(e) {
|
|
1885
|
+
const t = e.createId ?? At, n = t(), r = En({
|
|
1945
1886
|
field: e.field,
|
|
1946
1887
|
dataSource: e.dataSource,
|
|
1947
1888
|
connectionId: e.connectionId,
|
|
1948
1889
|
connectionType: e.connectionType,
|
|
1949
1890
|
filterId: t()
|
|
1950
1891
|
});
|
|
1951
|
-
return
|
|
1952
|
-
filter: e.label ? { ...
|
|
1892
|
+
return ia({
|
|
1893
|
+
filter: e.label ? { ...r, title: e.label } : r,
|
|
1953
1894
|
label: e.label || e.field.label || e.field.name,
|
|
1954
1895
|
scope: e.scope,
|
|
1955
1896
|
existingInputs: e.existingInputs,
|
|
1956
1897
|
createId: () => n
|
|
1957
1898
|
});
|
|
1958
1899
|
}
|
|
1959
|
-
function
|
|
1960
|
-
const t = e.createId ??
|
|
1900
|
+
function ia(e) {
|
|
1901
|
+
const t = e.createId ?? At, n = e.label || e.filter.title || e.filter.column || e.filter.id, r = sr(n, [
|
|
1961
1902
|
...e.existingInputs
|
|
1962
|
-
]),
|
|
1963
|
-
...
|
|
1964
|
-
variableName:
|
|
1903
|
+
]), i = {
|
|
1904
|
+
...Pt(e.filter),
|
|
1905
|
+
variableName: r
|
|
1965
1906
|
};
|
|
1966
1907
|
return {
|
|
1967
1908
|
id: t(),
|
|
1968
1909
|
kind: "filter",
|
|
1969
1910
|
label: n,
|
|
1970
|
-
variableName:
|
|
1911
|
+
variableName: r,
|
|
1971
1912
|
requiredAtExecution: !1,
|
|
1972
1913
|
scope: e.scope,
|
|
1973
1914
|
runtimeScope: "shared",
|
|
1974
|
-
presentation:
|
|
1975
|
-
filter:
|
|
1976
|
-
exports: Nt(
|
|
1915
|
+
presentation: kt(i),
|
|
1916
|
+
filter: i,
|
|
1917
|
+
exports: Nt(i)
|
|
1977
1918
|
};
|
|
1978
1919
|
}
|
|
1979
|
-
function
|
|
1980
|
-
var
|
|
1981
|
-
const
|
|
1920
|
+
function aa(e, t, n, r = { calendar: null }) {
|
|
1921
|
+
var je, Ge, We, He, Qe, Ye, Je, Xe;
|
|
1922
|
+
const i = j(e), a = i.findFilterInput(t), o = (S, I) => ({
|
|
1982
1923
|
ok: !1,
|
|
1983
1924
|
issues: [
|
|
1984
1925
|
{
|
|
@@ -2004,206 +1945,206 @@ function sa(e, t, n, i = { calendar: null }) {
|
|
|
2004
1945
|
if (a.origin !== "embeddedInput")
|
|
2005
1946
|
return o("This filter can not be edited here.");
|
|
2006
1947
|
const s = a.input, l = s.filter;
|
|
2007
|
-
if (((
|
|
1948
|
+
if (((je = n.mapping) == null ? void 0 : je.kind) === "save") {
|
|
2008
1949
|
if (!n.mapping.draft.acceptance.ok)
|
|
2009
1950
|
return { ok: !1, issues: n.mapping.draft.acceptance.issues };
|
|
2010
1951
|
if (n.mapping.draft.inputId !== s.id)
|
|
2011
1952
|
return o("The card mapping was prepared for another filter.");
|
|
2012
1953
|
}
|
|
2013
|
-
const c = n.definition ?
|
|
2014
|
-
if (c.kind === "global-date" && n.scope && !
|
|
1954
|
+
const c = n.definition ? Pt(n.definition) : l;
|
|
1955
|
+
if (c.kind === "global-date" && n.scope && !oa(n.scope))
|
|
2015
1956
|
return o("The Global Date filter applies to regular tabs only.");
|
|
2016
|
-
const u = (
|
|
1957
|
+
const u = (Ge = r.calendar) == null ? void 0 : Ge.tz, d = n.definition !== void 0, f = n.forceSelection !== void 0 || d ? ra(
|
|
2017
1958
|
n.forceSelection ?? s.forceSelection,
|
|
2018
1959
|
c,
|
|
2019
1960
|
u
|
|
2020
|
-
) : s.forceSelection ? !0 : void 0,
|
|
2021
|
-
...
|
|
2022
|
-
...
|
|
2023
|
-
]) : s.variableName, b = d && (l.title || l.column) !== (c.title || c.column),
|
|
2024
|
-
var
|
|
1961
|
+
) : s.forceSelection ? !0 : void 0, m = (Array.isArray(e.inputs) ? e.inputs : []).filter((S) => S.id !== s.id), g = n.variableName !== void 0 ? cr(n.variableName, [
|
|
1962
|
+
...m,
|
|
1963
|
+
...i.inputs.filter((S) => S.input.id !== s.id).map((S) => S.input)
|
|
1964
|
+
]) : s.variableName, b = d && (l.title || l.column) !== (c.title || c.column), p = n.label ?? (b ? c.title || c.column || c.id : void 0), v = d && l.hide !== c.hide, x = d && l.toolbarWidth !== c.toolbarWidth, h = (S) => {
|
|
1965
|
+
var Ze, et;
|
|
2025
1966
|
const I = { ...S };
|
|
2026
|
-
if (
|
|
2027
|
-
const be =
|
|
1967
|
+
if (p !== void 0 && (I.label = p), n.variableName !== void 0 && (I.variableName = g), n.scope && (I.scope = n.scope), v || x) {
|
|
1968
|
+
const be = kt(c);
|
|
2028
1969
|
I.presentation = { ...S.presentation }, v && (I.presentation.placement = be.placement), x && (be.widthPx === void 0 ? delete I.presentation.widthPx : I.presentation.widthPx = be.widthPx);
|
|
2029
1970
|
}
|
|
2030
|
-
return (n.forceSelection !== void 0 || d) && (f ? I.forceSelection = f : delete I.forceSelection), n.requiredAtExecution !== void 0 && (n.requiredAtExecution ? I.requiredAtExecution = !0 : delete I.requiredAtExecution), Ie(I, "optionSource", n.optionSource), Ie(I, "optionDependencies", n.optionDependencies), Ie(I, "optionPopulation", n.optionPopulation), ((
|
|
1971
|
+
return (n.forceSelection !== void 0 || d) && (f ? I.forceSelection = f : delete I.forceSelection), n.requiredAtExecution !== void 0 && (n.requiredAtExecution ? I.requiredAtExecution = !0 : delete I.requiredAtExecution), Ie(I, "optionSource", n.optionSource), Ie(I, "optionDependencies", n.optionDependencies), Ie(I, "optionPopulation", n.optionPopulation), ((Ze = n.mapping) == null ? void 0 : Ze.kind) === "save" && n.mapping.draft.acceptance.ok ? I.application = n.mapping.draft.acceptance.application : ((et = n.mapping) == null ? void 0 : et.kind) === "remove" && delete I.application, I;
|
|
2031
1972
|
}, F = n.label !== void 0 && n.label !== s.label && n.label !== c.title ? n.label : void 0, y = d || n.variableName !== void 0 || F !== void 0, C = (S) => ({
|
|
2032
1973
|
...S,
|
|
2033
1974
|
...n.variableName !== void 0 ? { variableName: g } : {},
|
|
2034
1975
|
...F !== void 0 ? { title: F } : {}
|
|
2035
|
-
}),
|
|
2036
|
-
if (D < 0 || (
|
|
1976
|
+
}), M = Array.isArray(e.inputs) ? [...e.inputs] : [], D = M.findIndex((S) => S.id === s.id), N = M[D];
|
|
1977
|
+
if (D < 0 || (N == null ? void 0 : N.kind) !== "filter" || !N.filter)
|
|
2037
1978
|
return o("This filter can not be edited here.");
|
|
2038
|
-
const
|
|
1979
|
+
const q = h(
|
|
2039
1980
|
y ? {
|
|
2040
|
-
...
|
|
1981
|
+
...N,
|
|
2041
1982
|
filter: C(c)
|
|
2042
|
-
} :
|
|
1983
|
+
} : N
|
|
2043
1984
|
);
|
|
2044
|
-
d && (
|
|
2045
|
-
const W =
|
|
2046
|
-
inputs: [
|
|
1985
|
+
d && (q.exports = Nt(c)), M[D] = q;
|
|
1986
|
+
const W = Re({
|
|
1987
|
+
inputs: [q],
|
|
2047
1988
|
dashboardFilters: []
|
|
2048
1989
|
});
|
|
2049
1990
|
if (!W.ok)
|
|
2050
1991
|
return o(
|
|
2051
|
-
((
|
|
1992
|
+
((We = W.issues[0]) == null ? void 0 : We.message) ?? "These settings could not be saved.",
|
|
2052
1993
|
W.issues[0]
|
|
2053
1994
|
);
|
|
2054
|
-
let
|
|
2055
|
-
const
|
|
2056
|
-
if (!
|
|
1995
|
+
let _ = { ...e, inputs: M };
|
|
1996
|
+
const O = j(_), T = O.findFilterInput({ filterId: c.id });
|
|
1997
|
+
if (!T)
|
|
2057
1998
|
return o(
|
|
2058
|
-
((
|
|
1999
|
+
((He = O.issues[0]) == null ? void 0 : He.message) ?? "These settings could not be saved."
|
|
2059
2000
|
);
|
|
2060
|
-
const J = n.variableName !== void 0 || n.scope !== void 0 ?
|
|
2001
|
+
const J = n.variableName !== void 0 || n.scope !== void 0 ? sa(_, T.input) : void 0;
|
|
2061
2002
|
if (J)
|
|
2062
2003
|
return o(
|
|
2063
2004
|
`Another filter on the same cards is already named "${J}". Choose another name.`
|
|
2064
2005
|
);
|
|
2065
|
-
const
|
|
2066
|
-
id:
|
|
2067
|
-
runtimeScope:
|
|
2006
|
+
const $ = [], U = {
|
|
2007
|
+
id: T.input.id,
|
|
2008
|
+
runtimeScope: T.input.runtimeScope
|
|
2068
2009
|
};
|
|
2069
|
-
let
|
|
2070
|
-
defaultInputValues:
|
|
2010
|
+
let R = {
|
|
2011
|
+
defaultInputValues: _.defaultInputValues,
|
|
2071
2012
|
dashboardInputValues: {}
|
|
2072
2013
|
};
|
|
2073
|
-
const
|
|
2014
|
+
const Fn = ((Qe = n.values) == null ? void 0 : Qe.target) ?? {}, k = ua(
|
|
2074
2015
|
l,
|
|
2075
2016
|
c,
|
|
2076
2017
|
{
|
|
2077
|
-
defaultValueChanged: (
|
|
2078
|
-
selectionIdentityChanged: (
|
|
2079
|
-
...((
|
|
2018
|
+
defaultValueChanged: (Ye = n.values) == null ? void 0 : Ye.defaultChanged,
|
|
2019
|
+
selectionIdentityChanged: (Je = n.values) == null ? void 0 : Je.selectionIdentityChanged,
|
|
2020
|
+
...((Xe = n.values) == null ? void 0 : Xe.defaultComparisonSelection) !== void 0 ? {
|
|
2080
2021
|
defaultComparisonChanged: !0,
|
|
2081
2022
|
defaultComparisonSelection: n.values.defaultComparisonSelection ?? void 0
|
|
2082
2023
|
} : {}
|
|
2083
2024
|
},
|
|
2084
|
-
|
|
2085
|
-
|
|
2025
|
+
Fn,
|
|
2026
|
+
r.calendar ?? void 0
|
|
2086
2027
|
);
|
|
2087
|
-
if (
|
|
2088
|
-
const S =
|
|
2089
|
-
state: { ...
|
|
2090
|
-
input:
|
|
2091
|
-
settings:
|
|
2028
|
+
if (k.defaultValueChanged || k.selectionIdentityChanged || k.defaultComparisonChanged) {
|
|
2029
|
+
const S = rn({
|
|
2030
|
+
state: { ...R, dashboardInputValues: {} },
|
|
2031
|
+
input: U,
|
|
2032
|
+
settings: k
|
|
2092
2033
|
});
|
|
2093
|
-
|
|
2034
|
+
R = { ...R, defaultInputValues: S.defaultInputValues }, k.selectionIdentityChanged && $.push({
|
|
2094
2035
|
kind: "clear",
|
|
2095
|
-
inputId:
|
|
2096
|
-
target:
|
|
2097
|
-
}),
|
|
2036
|
+
inputId: U.id,
|
|
2037
|
+
target: k.target
|
|
2038
|
+
}), k.defaultValueChanged && $.push({
|
|
2098
2039
|
kind: "resetToDefault",
|
|
2099
|
-
inputId:
|
|
2100
|
-
target:
|
|
2101
|
-
...
|
|
2102
|
-
}),
|
|
2040
|
+
inputId: U.id,
|
|
2041
|
+
target: k.target,
|
|
2042
|
+
...k.defaultFilterValue ? { filterValue: k.defaultFilterValue } : {}
|
|
2043
|
+
}), k.defaultComparisonChanged && $.push({
|
|
2103
2044
|
kind: "setDefaultComparison",
|
|
2104
|
-
inputId:
|
|
2105
|
-
target:
|
|
2045
|
+
inputId: U.id,
|
|
2046
|
+
target: k.target
|
|
2106
2047
|
});
|
|
2107
2048
|
}
|
|
2108
|
-
if (n.scope &&
|
|
2109
|
-
const S =
|
|
2110
|
-
|
|
2049
|
+
if (n.scope && T.input.runtimeScope !== "shared") {
|
|
2050
|
+
const S = ca(
|
|
2051
|
+
_,
|
|
2111
2052
|
s,
|
|
2112
|
-
|
|
2113
|
-
|
|
2053
|
+
T.input,
|
|
2054
|
+
R.defaultInputValues
|
|
2114
2055
|
);
|
|
2115
|
-
|
|
2116
|
-
...
|
|
2056
|
+
R = {
|
|
2057
|
+
...R,
|
|
2117
2058
|
defaultInputValues: S.defaultInputValues
|
|
2118
|
-
},
|
|
2059
|
+
}, $.push(
|
|
2119
2060
|
...S.dropped.map((I) => ({
|
|
2120
2061
|
kind: "dropTargetSlot",
|
|
2121
|
-
inputId:
|
|
2062
|
+
inputId: U.id,
|
|
2122
2063
|
target: I
|
|
2123
2064
|
}))
|
|
2124
2065
|
);
|
|
2125
2066
|
}
|
|
2126
|
-
return
|
|
2067
|
+
return _ = la(_, R), {
|
|
2127
2068
|
ok: !0,
|
|
2128
|
-
dashboard:
|
|
2129
|
-
inputId:
|
|
2130
|
-
valueEffects:
|
|
2069
|
+
dashboard: _,
|
|
2070
|
+
inputId: T.input.id,
|
|
2071
|
+
valueEffects: $
|
|
2131
2072
|
};
|
|
2132
2073
|
}
|
|
2133
|
-
function
|
|
2134
|
-
let t =
|
|
2074
|
+
function Yo(e) {
|
|
2075
|
+
let t = rt({
|
|
2135
2076
|
dashboard: e.before,
|
|
2136
2077
|
runtimeValues: e.dashboardInputValues,
|
|
2137
2078
|
calendar: e.calendar
|
|
2138
2079
|
});
|
|
2139
|
-
const n =
|
|
2080
|
+
const n = j(e.after), r = (i) => {
|
|
2140
2081
|
var a;
|
|
2141
|
-
return (a = n.findFilterInput({ inputId:
|
|
2082
|
+
return (a = n.findFilterInput({ inputId: i })) == null ? void 0 : a.input;
|
|
2142
2083
|
};
|
|
2143
|
-
for (const
|
|
2144
|
-
switch (
|
|
2084
|
+
for (const i of e.effects)
|
|
2085
|
+
switch (i.kind) {
|
|
2145
2086
|
case "resetToDefault":
|
|
2146
2087
|
case "clear":
|
|
2147
2088
|
case "setDefaultComparison": {
|
|
2148
|
-
const a = i
|
|
2089
|
+
const a = r(i.inputId);
|
|
2149
2090
|
if (!a) break;
|
|
2150
|
-
t =
|
|
2091
|
+
t = rn({
|
|
2151
2092
|
state: { dashboardInputValues: t },
|
|
2152
2093
|
input: a,
|
|
2153
2094
|
settings: {
|
|
2154
|
-
target:
|
|
2155
|
-
defaultValueChanged:
|
|
2156
|
-
defaultFilterValue:
|
|
2157
|
-
selectionIdentityChanged:
|
|
2158
|
-
defaultComparisonChanged:
|
|
2095
|
+
target: i.target,
|
|
2096
|
+
defaultValueChanged: i.kind === "resetToDefault",
|
|
2097
|
+
defaultFilterValue: i.kind === "resetToDefault" ? i.filterValue : void 0,
|
|
2098
|
+
selectionIdentityChanged: i.kind === "clear",
|
|
2099
|
+
defaultComparisonChanged: i.kind === "setDefaultComparison"
|
|
2159
2100
|
}
|
|
2160
2101
|
}).dashboardInputValues;
|
|
2161
2102
|
break;
|
|
2162
2103
|
}
|
|
2163
2104
|
case "dropTargetSlot": {
|
|
2164
|
-
const a = i
|
|
2105
|
+
const a = r(i.inputId);
|
|
2165
2106
|
if (!a) break;
|
|
2166
|
-
t =
|
|
2107
|
+
t = Ae(
|
|
2167
2108
|
t,
|
|
2168
2109
|
a,
|
|
2169
|
-
|
|
2110
|
+
i.target
|
|
2170
2111
|
);
|
|
2171
2112
|
break;
|
|
2172
2113
|
}
|
|
2173
2114
|
}
|
|
2174
|
-
return
|
|
2115
|
+
return rt({
|
|
2175
2116
|
dashboard: e.after,
|
|
2176
2117
|
runtimeValues: t,
|
|
2177
2118
|
calendar: e.calendar
|
|
2178
2119
|
});
|
|
2179
2120
|
}
|
|
2180
|
-
function
|
|
2121
|
+
function oa(e) {
|
|
2181
2122
|
var t;
|
|
2182
2123
|
return e.kind !== "documentSections" && (e.kind !== "allSheets" || ((t = e.sheetKinds) == null ? void 0 : t.length) === 1 && e.sheetKinds[0] === "dashboard");
|
|
2183
2124
|
}
|
|
2184
2125
|
function Ie(e, t, n) {
|
|
2185
2126
|
n !== void 0 && (n === null ? delete e[t] : e[t] = n);
|
|
2186
2127
|
}
|
|
2187
|
-
function
|
|
2128
|
+
function sa(e, t) {
|
|
2188
2129
|
const n = [
|
|
2189
|
-
...
|
|
2130
|
+
...j(e).inputs.map((i) => i.input),
|
|
2190
2131
|
...(Array.isArray(e.inputs) ? e.inputs : []).filter(
|
|
2191
|
-
(
|
|
2132
|
+
(i) => i.kind === "control"
|
|
2192
2133
|
)
|
|
2193
2134
|
].filter(
|
|
2194
|
-
(
|
|
2135
|
+
(i) => i.id !== t.id && i.variableName === t.variableName
|
|
2195
2136
|
);
|
|
2196
2137
|
if (!n.length) return;
|
|
2197
|
-
const
|
|
2138
|
+
const r = st(e, t);
|
|
2198
2139
|
return n.some(
|
|
2199
|
-
(
|
|
2200
|
-
(a) =>
|
|
2140
|
+
(i) => [...st(e, i)].some(
|
|
2141
|
+
(a) => r.has(a)
|
|
2201
2142
|
)
|
|
2202
2143
|
) ? t.variableName : void 0;
|
|
2203
2144
|
}
|
|
2204
|
-
function
|
|
2145
|
+
function ca(e, t, n, r) {
|
|
2205
2146
|
var u, d;
|
|
2206
|
-
const
|
|
2147
|
+
const i = [], a = _t(e), o = (f) => ht(t, f, a), s = (f) => ht(n, f, a), l = [];
|
|
2207
2148
|
if (n.runtimeScope === "perSheet")
|
|
2208
2149
|
for (const f of a.values())
|
|
2209
2150
|
l.push({ sheetId: f.sheetId, sheetKind: f.sheetKind });
|
|
@@ -2216,65 +2157,65 @@ function ua(e, t, n, i) {
|
|
|
2216
2157
|
});
|
|
2217
2158
|
else if (n.runtimeScope === "perDocumentSection")
|
|
2218
2159
|
for (const f of e.sheets ?? [])
|
|
2219
|
-
for (const
|
|
2160
|
+
for (const m of ((d = f.document) == null ? void 0 : d.sections) ?? [])
|
|
2220
2161
|
l.push({
|
|
2221
2162
|
sheetId: f.id,
|
|
2222
|
-
sectionId:
|
|
2163
|
+
sectionId: m.id,
|
|
2223
2164
|
sheetKind: "document"
|
|
2224
2165
|
});
|
|
2225
|
-
let c =
|
|
2166
|
+
let c = r;
|
|
2226
2167
|
for (const f of l) {
|
|
2227
2168
|
if (s(f)) continue;
|
|
2228
|
-
const
|
|
2229
|
-
if (
|
|
2169
|
+
const m = !!(c && _e(c, n, f));
|
|
2170
|
+
if (m && (c = Ae(c, n, f)), m || o(f)) {
|
|
2230
2171
|
const { sheetKind: g, ...b } = f;
|
|
2231
|
-
|
|
2172
|
+
i.push(b);
|
|
2232
2173
|
}
|
|
2233
2174
|
}
|
|
2234
|
-
return { defaultInputValues: c, dropped:
|
|
2175
|
+
return { defaultInputValues: c, dropped: i };
|
|
2235
2176
|
}
|
|
2236
|
-
function
|
|
2177
|
+
function ht(e, t, n) {
|
|
2237
2178
|
if (e.runtimeScope === "perSheet" && t.sheetId && !t.cardId && !t.sectionId) {
|
|
2238
|
-
const
|
|
2239
|
-
return
|
|
2179
|
+
const r = n.get(t.sheetId);
|
|
2180
|
+
return r ? Rt(e, r) : !1;
|
|
2240
2181
|
}
|
|
2241
|
-
return
|
|
2182
|
+
return mr(e, t);
|
|
2242
2183
|
}
|
|
2243
|
-
function
|
|
2184
|
+
function la(e, t) {
|
|
2244
2185
|
const n = { ...e };
|
|
2245
2186
|
return t.defaultInputValues && Object.keys(t.defaultInputValues).length ? n.defaultInputValues = t.defaultInputValues : e.defaultInputValues !== void 0 && delete n.defaultInputValues, n;
|
|
2246
2187
|
}
|
|
2247
|
-
function
|
|
2248
|
-
const a = !!(n != null && n.defaultValueChanged || n != null && n.selectionIdentityChanged) ||
|
|
2188
|
+
function ua(e, t, n, r, i) {
|
|
2189
|
+
const a = !!(n != null && n.defaultValueChanged || n != null && n.selectionIdentityChanged) || fr(e, t);
|
|
2249
2190
|
return {
|
|
2250
2191
|
...n,
|
|
2251
|
-
target: (n == null ? void 0 : n.target) ??
|
|
2192
|
+
target: (n == null ? void 0 : n.target) ?? r,
|
|
2252
2193
|
defaultValueChanged: a,
|
|
2253
|
-
defaultFilterValue: a ?
|
|
2194
|
+
defaultFilterValue: a ? X(t, i) : void 0
|
|
2254
2195
|
};
|
|
2255
2196
|
}
|
|
2256
|
-
function
|
|
2197
|
+
function rn(e) {
|
|
2257
2198
|
const { settings: t } = e;
|
|
2258
2199
|
if (!t) return e.state;
|
|
2259
2200
|
const n = e.input;
|
|
2260
|
-
let
|
|
2261
|
-
if (t.selectionIdentityChanged && (
|
|
2262
|
-
|
|
2201
|
+
let r = e.state.dashboardInputValues, i = e.state.defaultInputValues;
|
|
2202
|
+
if (t.selectionIdentityChanged && (r = it(
|
|
2203
|
+
r,
|
|
2263
2204
|
n,
|
|
2264
2205
|
t.target,
|
|
2265
2206
|
{ status: "cleared" }
|
|
2266
2207
|
)), t.defaultValueChanged) {
|
|
2267
2208
|
const a = _e(
|
|
2268
|
-
|
|
2209
|
+
i,
|
|
2269
2210
|
n,
|
|
2270
2211
|
t.target
|
|
2271
2212
|
);
|
|
2272
|
-
let o =
|
|
2273
|
-
|
|
2213
|
+
let o = Ae(
|
|
2214
|
+
i || {},
|
|
2274
2215
|
n,
|
|
2275
2216
|
t.target
|
|
2276
2217
|
);
|
|
2277
|
-
t.defaultFilterValue ? o =
|
|
2218
|
+
t.defaultFilterValue ? o = at(
|
|
2278
2219
|
o,
|
|
2279
2220
|
n,
|
|
2280
2221
|
t.target,
|
|
@@ -2286,13 +2227,13 @@ function on(e) {
|
|
|
2286
2227
|
},
|
|
2287
2228
|
...a != null && a.comparisonSelection ? { comparisonSelection: a.comparisonSelection } : {}
|
|
2288
2229
|
}
|
|
2289
|
-
) : a != null && a.comparisonSelection && (o =
|
|
2230
|
+
) : a != null && a.comparisonSelection && (o = at(
|
|
2290
2231
|
o,
|
|
2291
2232
|
n,
|
|
2292
2233
|
t.target,
|
|
2293
2234
|
{ comparisonSelection: a.comparisonSelection }
|
|
2294
|
-
)),
|
|
2295
|
-
|
|
2235
|
+
)), i = Object.keys(o).length ? o : void 0, r = it(
|
|
2236
|
+
r,
|
|
2296
2237
|
n,
|
|
2297
2238
|
t.target,
|
|
2298
2239
|
t.defaultFilterValue ? {
|
|
@@ -2304,75 +2245,75 @@ function on(e) {
|
|
|
2304
2245
|
} : { status: "cleared" }
|
|
2305
2246
|
);
|
|
2306
2247
|
}
|
|
2307
|
-
return t.defaultComparisonChanged && (
|
|
2308
|
-
|
|
2248
|
+
return t.defaultComparisonChanged && (i = ot(
|
|
2249
|
+
i || {},
|
|
2309
2250
|
n,
|
|
2310
2251
|
t.target,
|
|
2311
2252
|
t.defaultComparisonSelection
|
|
2312
|
-
), Object.keys(
|
|
2313
|
-
|
|
2253
|
+
), Object.keys(i).length || (i = void 0), r = ot(
|
|
2254
|
+
r,
|
|
2314
2255
|
n,
|
|
2315
2256
|
t.target,
|
|
2316
2257
|
void 0
|
|
2317
2258
|
)), {
|
|
2318
2259
|
...e.state,
|
|
2319
|
-
dashboardInputValues:
|
|
2320
|
-
defaultInputValues:
|
|
2260
|
+
dashboardInputValues: r,
|
|
2261
|
+
defaultInputValues: i
|
|
2321
2262
|
};
|
|
2322
2263
|
}
|
|
2323
2264
|
const Y = (e) => Array.isArray(e.inputs) ? e.inputs : [];
|
|
2324
2265
|
function he(e, t) {
|
|
2325
|
-
const n = Y(e).find((
|
|
2266
|
+
const n = Y(e).find((r) => r.id === t);
|
|
2326
2267
|
if (!n || n.kind !== "filter")
|
|
2327
|
-
throw new
|
|
2268
|
+
throw new w("filter_not_found", `No filter ${t} on this dashboard.`, "Read the outline again and use its filter ids.");
|
|
2328
2269
|
return n;
|
|
2329
2270
|
}
|
|
2330
|
-
function
|
|
2271
|
+
function an(e, t) {
|
|
2331
2272
|
var n;
|
|
2332
|
-
return (n = me(e).find((
|
|
2273
|
+
return (n = me(e).find((r) => r.cardId === t)) == null ? void 0 : n.card.title;
|
|
2333
2274
|
}
|
|
2334
|
-
function
|
|
2335
|
-
const
|
|
2336
|
-
return
|
|
2275
|
+
function da(e, t, n) {
|
|
2276
|
+
const r = j(e), i = r.findFilterInput({ inputId: t });
|
|
2277
|
+
return i ? r.reachedCards({ inputId: t }).filter(
|
|
2337
2278
|
(a) => ["bound", "automatic", "sql", "relationshipApplied"].includes(
|
|
2338
|
-
|
|
2279
|
+
Vn(i.input, a.card, n).reach
|
|
2339
2280
|
)
|
|
2340
2281
|
).length : 0;
|
|
2341
2282
|
}
|
|
2342
|
-
function
|
|
2343
|
-
const n =
|
|
2344
|
-
return
|
|
2283
|
+
function fa(e, t) {
|
|
2284
|
+
const n = j(e), r = n.findFilterInput({ inputId: t });
|
|
2285
|
+
return r ? n.reachedCards({ inputId: t }).filter((i) => Kn(r.input, i.card) === "relationship").length : 0;
|
|
2345
2286
|
}
|
|
2346
|
-
function
|
|
2287
|
+
function on(e, t) {
|
|
2347
2288
|
if (t.scope.kind === "allSheets") return "every sheet";
|
|
2348
2289
|
if (t.scope.kind !== "sheets") return "its cards";
|
|
2349
|
-
const n = [...
|
|
2350
|
-
return
|
|
2351
|
-
var
|
|
2352
|
-
return ((a = (
|
|
2290
|
+
const n = [..._t(e).values()].filter((r) => Rt(t, r));
|
|
2291
|
+
return Et(n.map((r) => {
|
|
2292
|
+
var i, a;
|
|
2293
|
+
return ((a = (i = e.sheets) == null ? void 0 : i.find((o) => o.id === r.sheetId)) == null ? void 0 : a.title) ?? r.sheetId;
|
|
2353
2294
|
}));
|
|
2354
2295
|
}
|
|
2355
|
-
const
|
|
2296
|
+
const sn = (e) => {
|
|
2356
2297
|
var t;
|
|
2357
2298
|
return ((t = e.filter) == null ? void 0 : t.type) === "single" ? "single select" : "multi select";
|
|
2358
2299
|
};
|
|
2359
|
-
function
|
|
2360
|
-
var t, n,
|
|
2300
|
+
function cn(e) {
|
|
2301
|
+
var t, n, r;
|
|
2361
2302
|
if ((n = (t = e.filter) == null ? void 0 : t.defaultValues) != null && n.length) return `default ${e.filter.defaultValues.join(", ")}`;
|
|
2362
|
-
if ((
|
|
2303
|
+
if ((r = e.filter) != null && r.defaultDateFilter) return "a default period";
|
|
2363
2304
|
}
|
|
2364
|
-
function
|
|
2365
|
-
return
|
|
2366
|
-
}
|
|
2367
|
-
function
|
|
2368
|
-
const { input: n } = t,
|
|
2369
|
-
if (
|
|
2370
|
-
throw new
|
|
2371
|
-
if (
|
|
2372
|
-
throw new
|
|
2373
|
-
const
|
|
2305
|
+
function re(e) {
|
|
2306
|
+
return H.plain("filter", e);
|
|
2307
|
+
}
|
|
2308
|
+
function ma(e, t) {
|
|
2309
|
+
const { input: n } = t, r = Y(e);
|
|
2310
|
+
if (r.some((l) => l.id === n.id))
|
|
2311
|
+
throw new w("filter_id_taken", `A filter with id ${n.id} is already on this dashboard.`);
|
|
2312
|
+
if (j(e).findFilterInput({ filterId: n.filter.id }))
|
|
2313
|
+
throw new w("filter_id_taken", `A filter definition with id ${n.filter.id} is already on this dashboard.`);
|
|
2314
|
+
const i = { ...e, inputs: [...r, n] }, a = da(i, n.id), o = fa(i, n.id), s = [sn(n), cn(n)].filter(Boolean).join(", ");
|
|
2374
2315
|
return {
|
|
2375
|
-
dashboard:
|
|
2316
|
+
dashboard: i,
|
|
2376
2317
|
created: [
|
|
2377
2318
|
{
|
|
2378
2319
|
kind: "filter",
|
|
@@ -2382,89 +2323,89 @@ function ga(e, t) {
|
|
|
2382
2323
|
}
|
|
2383
2324
|
],
|
|
2384
2325
|
clauses: [
|
|
2385
|
-
|
|
2386
|
-
`adds the filter ${
|
|
2326
|
+
re(
|
|
2327
|
+
`adds the filter ${L(n.label)} (${s}) to ${on(i, n)}; it filters ${a} card${a === 1 ? "" : "s"}${o ? ` and may filter ${o} more through the domain's relationships` : ""}`
|
|
2387
2328
|
)
|
|
2388
2329
|
]
|
|
2389
2330
|
};
|
|
2390
2331
|
}
|
|
2391
|
-
function
|
|
2392
|
-
const
|
|
2332
|
+
function pa(e, t, n) {
|
|
2333
|
+
const r = aa(e, { inputId: t.filterId }, t.settings, {
|
|
2393
2334
|
calendar: n.calendar
|
|
2394
2335
|
});
|
|
2395
|
-
if (!
|
|
2396
|
-
const [o] =
|
|
2397
|
-
throw new
|
|
2336
|
+
if (!r.ok) {
|
|
2337
|
+
const [o] = r.issues;
|
|
2338
|
+
throw new w(
|
|
2398
2339
|
(o == null ? void 0 : o.code) === "inputNotFound" ? "filter_not_found" : "filter_invalid",
|
|
2399
2340
|
(o == null ? void 0 : o.message) ?? "These filter settings could not be saved.",
|
|
2400
2341
|
(o == null ? void 0 : o.code) === "inputNotFound" ? "Read the outline again and use its filter ids." : "Change the filter settings and propose again.",
|
|
2401
|
-
{ issues:
|
|
2342
|
+
{ issues: r.issues }
|
|
2402
2343
|
);
|
|
2403
2344
|
}
|
|
2404
|
-
const
|
|
2345
|
+
const i = Y(e).find((o) => o.id === r.inputId), a = Y(r.dashboard).find((o) => o.id === r.inputId);
|
|
2405
2346
|
return {
|
|
2406
|
-
dashboard:
|
|
2407
|
-
runtimeEffects: [{ kind: "filter_value", effects:
|
|
2408
|
-
clauses: [
|
|
2347
|
+
dashboard: r.dashboard,
|
|
2348
|
+
runtimeEffects: [{ kind: "filter_value", effects: r.valueEffects }],
|
|
2349
|
+
clauses: [re(`changes the filter ${L((i == null ? void 0 : i.label) ?? a.label)}: ${ga(r.dashboard, i, a)}`)]
|
|
2409
2350
|
};
|
|
2410
2351
|
}
|
|
2411
|
-
function
|
|
2352
|
+
function ga(e, t, n) {
|
|
2412
2353
|
var o, s, l, c, u, d;
|
|
2413
2354
|
if (!t) return "updates its settings";
|
|
2414
|
-
const
|
|
2415
|
-
t.label !== n.label &&
|
|
2416
|
-
const
|
|
2417
|
-
if (
|
|
2418
|
-
const f =
|
|
2419
|
-
|
|
2355
|
+
const r = [];
|
|
2356
|
+
t.label !== n.label && r.push(`renames it ${L(n.label)}`), (((o = t.filter) == null ? void 0 : o.type) ?? "multiple") !== (((s = n.filter) == null ? void 0 : s.type) ?? "multiple") && r.push(`makes it ${sn(n)}`);
|
|
2357
|
+
const i = JSON.stringify([((l = t.filter) == null ? void 0 : l.defaultValues) ?? null, ((c = t.filter) == null ? void 0 : c.defaultDateFilter) ?? null]), a = JSON.stringify([((u = n.filter) == null ? void 0 : u.defaultValues) ?? null, ((d = n.filter) == null ? void 0 : d.defaultDateFilter) ?? null]);
|
|
2358
|
+
if (i !== a) {
|
|
2359
|
+
const f = cn(n);
|
|
2360
|
+
r.push(f ? `sets its ${f.replace(/^default /, "default to ").replace(/^a default period$/, "default period")}` : "removes its default");
|
|
2420
2361
|
}
|
|
2421
|
-
return JSON.stringify(t.scope) !== JSON.stringify(n.scope) &&
|
|
2362
|
+
return JSON.stringify(t.scope) !== JSON.stringify(n.scope) && r.push(`applies it to ${on(e, n)}`), r.length ? Et(r) : "keeps its settings";
|
|
2422
2363
|
}
|
|
2423
|
-
function
|
|
2364
|
+
function ya(e, t) {
|
|
2424
2365
|
const n = he(e, t);
|
|
2425
2366
|
return {
|
|
2426
2367
|
dashboard: {
|
|
2427
2368
|
...e,
|
|
2428
|
-
inputs: Y(e).filter((
|
|
2429
|
-
defaultInputValues:
|
|
2369
|
+
inputs: Y(e).filter((i) => i.id !== t),
|
|
2370
|
+
defaultInputValues: gr(e.defaultInputValues, t)
|
|
2430
2371
|
},
|
|
2431
2372
|
runtimeEffects: [{ kind: "input_removed", inputId: t }],
|
|
2432
|
-
clauses: [
|
|
2373
|
+
clauses: [re(`removes the filter ${L(n.label)}`)]
|
|
2433
2374
|
};
|
|
2434
2375
|
}
|
|
2435
|
-
function
|
|
2376
|
+
function ha(e, t, n) {
|
|
2436
2377
|
var o;
|
|
2437
2378
|
if (!me(e).some((s) => s.cardId === n))
|
|
2438
|
-
throw new
|
|
2439
|
-
const
|
|
2440
|
-
if (!
|
|
2441
|
-
throw new
|
|
2379
|
+
throw new w("card_not_found", `No card ${n} on this dashboard.`, "Read the outline again and use its card ids.");
|
|
2380
|
+
const r = yr(t.scope, n);
|
|
2381
|
+
if (!r)
|
|
2382
|
+
throw new w(
|
|
2442
2383
|
"filter_invalid",
|
|
2443
2384
|
"This filter applies to Document sections, so it can't leave out one card.",
|
|
2444
2385
|
"Change it in the editor."
|
|
2445
2386
|
);
|
|
2446
|
-
const
|
|
2387
|
+
const i = { ...t, scope: r }, a = Re({ inputs: [i], dashboardFilters: [] });
|
|
2447
2388
|
if (!a.ok)
|
|
2448
|
-
throw new
|
|
2389
|
+
throw new w("filter_invalid", ((o = a.issues[0]) == null ? void 0 : o.message) ?? "This filter could not be saved.", "Change it in the editor.");
|
|
2449
2390
|
return {
|
|
2450
2391
|
...e,
|
|
2451
|
-
inputs: Y(e).map((s) => s.id === t.id ?
|
|
2392
|
+
inputs: Y(e).map((s) => s.id === t.id ? i : s)
|
|
2452
2393
|
};
|
|
2453
2394
|
}
|
|
2454
|
-
function
|
|
2395
|
+
function ln(e, t, n, r, i) {
|
|
2455
2396
|
var u, d;
|
|
2456
2397
|
const a = he(e, t);
|
|
2457
2398
|
if (!me(e).some((f) => f.cardId === n))
|
|
2458
|
-
throw new
|
|
2399
|
+
throw new w("card_not_found", `No card ${n} on this dashboard.`, "Read the outline again and use its card ids.");
|
|
2459
2400
|
const o = [...((u = a.application) == null ? void 0 : u.cards) ?? []], s = o.findIndex((f) => f.cardId === n);
|
|
2460
|
-
s >= 0 ? o[s] =
|
|
2401
|
+
s >= 0 ? o[s] = r : o.push(r);
|
|
2461
2402
|
const l = {
|
|
2462
2403
|
...a,
|
|
2463
|
-
...
|
|
2404
|
+
...i ? { scope: i } : {},
|
|
2464
2405
|
application: { ...a.application ?? { kind: "cardMappings" }, cards: o }
|
|
2465
|
-
}, c =
|
|
2406
|
+
}, c = Re({ inputs: [l], dashboardFilters: [] });
|
|
2466
2407
|
if (!c.ok)
|
|
2467
|
-
throw new
|
|
2408
|
+
throw new w(
|
|
2468
2409
|
"filter_invalid",
|
|
2469
2410
|
((d = c.issues[0]) == null ? void 0 : d.message) ?? "This filter mapping could not be saved.",
|
|
2470
2411
|
"Change the mapping and propose again."
|
|
@@ -2474,7 +2415,7 @@ function dn(e, t, n, i, r) {
|
|
|
2474
2415
|
inputs: Y(e).map((f) => f.id === t ? l : f)
|
|
2475
2416
|
};
|
|
2476
2417
|
}
|
|
2477
|
-
function
|
|
2418
|
+
function ba(e) {
|
|
2478
2419
|
switch (e.kind) {
|
|
2479
2420
|
case "field":
|
|
2480
2421
|
return `by ${e.field.name}`;
|
|
@@ -2484,80 +2425,83 @@ function Fa(e) {
|
|
|
2484
2425
|
return String(e.kind);
|
|
2485
2426
|
}
|
|
2486
2427
|
}
|
|
2487
|
-
function
|
|
2488
|
-
const n = he(e, t.filterId),
|
|
2428
|
+
function va(e, t) {
|
|
2429
|
+
const n = he(e, t.filterId), r = { ...t.binding, kind: "bound", cardId: t.cardId }, i = pr(n.scope, t.cardId), a = i !== n.scope;
|
|
2489
2430
|
return {
|
|
2490
|
-
dashboard:
|
|
2431
|
+
dashboard: ln(e, t.filterId, t.cardId, r, a ? i : void 0),
|
|
2491
2432
|
clauses: [
|
|
2492
|
-
|
|
2493
|
-
`makes ${
|
|
2433
|
+
re(
|
|
2434
|
+
`makes ${L(n.label)} filter ${L(an(e, t.cardId))} ${ba(r.target)}${a ? ", which it used to leave out" : ""}`
|
|
2494
2435
|
)
|
|
2495
2436
|
]
|
|
2496
2437
|
};
|
|
2497
2438
|
}
|
|
2498
|
-
function
|
|
2499
|
-
var
|
|
2439
|
+
function Fa(e, t) {
|
|
2440
|
+
var i;
|
|
2500
2441
|
const n = he(e, t.filterId);
|
|
2501
2442
|
return {
|
|
2502
|
-
dashboard: ((
|
|
2503
|
-
clauses: [
|
|
2443
|
+
dashboard: ((i = n.filter) == null ? void 0 : i.kind) === "global-date" ? ha(e, n, t.cardId) : ln(e, t.filterId, t.cardId, { kind: "excluded", cardId: t.cardId }),
|
|
2444
|
+
clauses: [re(`stops ${L(n.label)} from filtering ${L(an(e, t.cardId))}`)]
|
|
2504
2445
|
};
|
|
2505
2446
|
}
|
|
2506
|
-
function
|
|
2507
|
-
let
|
|
2508
|
-
const
|
|
2509
|
-
|
|
2510
|
-
|
|
2447
|
+
function Jo(e, t, n) {
|
|
2448
|
+
let r = e;
|
|
2449
|
+
const i = [], a = [], o = [];
|
|
2450
|
+
let s = !1;
|
|
2451
|
+
for (const [l, c] of t.entries()) {
|
|
2452
|
+
let u;
|
|
2511
2453
|
try {
|
|
2512
|
-
|
|
2513
|
-
} catch (
|
|
2514
|
-
if (!(
|
|
2454
|
+
u = Ca(r, c, n);
|
|
2455
|
+
} catch (d) {
|
|
2456
|
+
if (!(d instanceof w)) throw d;
|
|
2515
2457
|
return {
|
|
2516
2458
|
ok: !1,
|
|
2517
2459
|
failedAt: {
|
|
2518
|
-
index:
|
|
2519
|
-
op:
|
|
2520
|
-
code:
|
|
2521
|
-
message:
|
|
2522
|
-
...
|
|
2523
|
-
...
|
|
2460
|
+
index: l,
|
|
2461
|
+
op: c.op,
|
|
2462
|
+
code: d.code,
|
|
2463
|
+
message: d.message,
|
|
2464
|
+
...d.fix ? { fix: d.fix } : {},
|
|
2465
|
+
...d.details ? { details: d.details } : {}
|
|
2524
2466
|
}
|
|
2525
2467
|
};
|
|
2526
2468
|
}
|
|
2527
|
-
|
|
2469
|
+
r = u.dashboard, i.push(...u.created ?? []), a.push(...u.runtimeEffects ?? []), o.push({ index: l, changeIndex: c.changeIndex, clauses: u.clauses }), s || (s = u.detached === !0);
|
|
2528
2470
|
}
|
|
2529
|
-
return { ok: !0, dashboard:
|
|
2471
|
+
return { ok: !0, dashboard: r, created: i, descriptions: Ia(o), runtimeEffects: a, detaches: s };
|
|
2530
2472
|
}
|
|
2531
|
-
function
|
|
2473
|
+
function Ca(e, t, n) {
|
|
2532
2474
|
switch (t.op) {
|
|
2533
2475
|
case "card.add":
|
|
2534
|
-
return
|
|
2476
|
+
return vr(e, t);
|
|
2535
2477
|
case "card.remove":
|
|
2536
|
-
return
|
|
2478
|
+
return br(e, t.cardId);
|
|
2537
2479
|
case "card.update":
|
|
2538
|
-
return
|
|
2480
|
+
return hr(e, t.cardId, t.update);
|
|
2539
2481
|
case "layout.arrange":
|
|
2540
|
-
return
|
|
2482
|
+
return Yi(e, t);
|
|
2541
2483
|
case "frame.commit":
|
|
2542
|
-
return
|
|
2484
|
+
return ta(e, t.commit);
|
|
2543
2485
|
case "filter.add":
|
|
2544
|
-
return
|
|
2486
|
+
return ma(e, t);
|
|
2545
2487
|
case "filter.update":
|
|
2546
|
-
return
|
|
2488
|
+
return pa(e, t, n);
|
|
2547
2489
|
case "filter.remove":
|
|
2548
|
-
return
|
|
2490
|
+
return ya(e, t.filterId);
|
|
2549
2491
|
case "filter.bind":
|
|
2550
|
-
return
|
|
2492
|
+
return va(e, t);
|
|
2551
2493
|
case "filter.exclude":
|
|
2552
|
-
return
|
|
2494
|
+
return Fa(e, t);
|
|
2495
|
+
case "dashboard.update":
|
|
2496
|
+
return na(e, t);
|
|
2553
2497
|
}
|
|
2554
2498
|
}
|
|
2555
|
-
function
|
|
2499
|
+
function Ia(e) {
|
|
2556
2500
|
const t = [];
|
|
2557
2501
|
for (const n of e) {
|
|
2558
|
-
const
|
|
2559
|
-
if (
|
|
2560
|
-
|
|
2502
|
+
const r = n.changeIndex === void 0 ? void 0 : t.find((i) => i.changeIndex === n.changeIndex);
|
|
2503
|
+
if (r) {
|
|
2504
|
+
r.operations.push(n.index), r.clauses.push(...n.clauses);
|
|
2561
2505
|
continue;
|
|
2562
2506
|
}
|
|
2563
2507
|
t.push({
|
|
@@ -2567,23 +2511,23 @@ function Sa(e) {
|
|
|
2567
2511
|
clauses: [...n.clauses]
|
|
2568
2512
|
});
|
|
2569
2513
|
}
|
|
2570
|
-
return t.map(({ clauses: n, ...
|
|
2571
|
-
...
|
|
2572
|
-
sentence:
|
|
2514
|
+
return t.map(({ clauses: n, ...r }) => ({
|
|
2515
|
+
...r,
|
|
2516
|
+
sentence: Fr(xa(n))
|
|
2573
2517
|
}));
|
|
2574
2518
|
}
|
|
2575
|
-
function
|
|
2519
|
+
function xa(e) {
|
|
2576
2520
|
let t = !1;
|
|
2577
2521
|
return e.filter((n) => n.kind !== "detached" ? !0 : t ? !1 : (t = !0, !0));
|
|
2578
2522
|
}
|
|
2579
|
-
function
|
|
2523
|
+
function bt(e) {
|
|
2580
2524
|
return Object.fromEntries(
|
|
2581
2525
|
Object.entries(e).filter(
|
|
2582
2526
|
(t) => typeof t[1] == "string" && t[1].length > 0
|
|
2583
2527
|
)
|
|
2584
2528
|
);
|
|
2585
2529
|
}
|
|
2586
|
-
function
|
|
2530
|
+
function te(e) {
|
|
2587
2531
|
return e.kind === "semantic" ? [
|
|
2588
2532
|
e.kind,
|
|
2589
2533
|
e.domainId,
|
|
@@ -2598,18 +2542,18 @@ function ee(e) {
|
|
|
2598
2542
|
e.tableName
|
|
2599
2543
|
].join(":");
|
|
2600
2544
|
}
|
|
2601
|
-
function
|
|
2545
|
+
function Sa(e, t) {
|
|
2602
2546
|
if (e.kind === "semantic")
|
|
2603
2547
|
return {
|
|
2604
2548
|
status: "ready",
|
|
2605
|
-
request:
|
|
2549
|
+
request: bt({
|
|
2606
2550
|
connection_id: e.connectionId,
|
|
2607
2551
|
domain_id: e.domainId,
|
|
2608
|
-
dataset_id:
|
|
2552
|
+
dataset_id: Rr(e),
|
|
2609
2553
|
dataset_name: e.datasetName
|
|
2610
2554
|
})
|
|
2611
2555
|
};
|
|
2612
|
-
const n =
|
|
2556
|
+
const n = ti({
|
|
2613
2557
|
source: e,
|
|
2614
2558
|
capabilities: t
|
|
2615
2559
|
});
|
|
@@ -2621,7 +2565,7 @@ function wa(e, t) {
|
|
|
2621
2565
|
message: `Source is missing required field-metadata coordinates: ${n.missing.join(", ")}.`
|
|
2622
2566
|
} : {
|
|
2623
2567
|
status: "ready",
|
|
2624
|
-
request:
|
|
2568
|
+
request: bt({
|
|
2625
2569
|
connection_id: e.connectionId,
|
|
2626
2570
|
datamodel_id: "",
|
|
2627
2571
|
database_name: n.coordinates.databaseName,
|
|
@@ -2630,14 +2574,14 @@ function wa(e, t) {
|
|
|
2630
2574
|
})
|
|
2631
2575
|
};
|
|
2632
2576
|
}
|
|
2633
|
-
function
|
|
2577
|
+
function Xo(e, t = /* @__PURE__ */ new Map()) {
|
|
2634
2578
|
const n = /* @__PURE__ */ new Map();
|
|
2635
|
-
for (const { card:
|
|
2636
|
-
const
|
|
2579
|
+
for (const { card: r } of e) {
|
|
2580
|
+
const i = Vt(r), a = i.kind === "config" ? i.executableSources : i.kind === "sql" ? i.pinnedCatalogSources.map((o) => o.source) : [];
|
|
2637
2581
|
for (const o of a) {
|
|
2638
|
-
const s =
|
|
2582
|
+
const s = te(o);
|
|
2639
2583
|
if (!n.has(s)) {
|
|
2640
|
-
const l =
|
|
2584
|
+
const l = Sa(
|
|
2641
2585
|
o,
|
|
2642
2586
|
o.connectionId ? t.get(o.connectionId) : void 0
|
|
2643
2587
|
);
|
|
@@ -2651,14 +2595,14 @@ function as(e, t = /* @__PURE__ */ new Map()) {
|
|
|
2651
2595
|
}
|
|
2652
2596
|
return Array.from(n.values());
|
|
2653
2597
|
}
|
|
2654
|
-
function
|
|
2598
|
+
function Da(e, t) {
|
|
2655
2599
|
if (e.kind !== "semantic" || !e.connectionId) return;
|
|
2656
|
-
const n = (t.qualifiedEntityName || "").split(".").map((
|
|
2657
|
-
if (
|
|
2600
|
+
const n = (t.qualifiedEntityName || "").split(".").map((i) => i.trim()).filter(Boolean), r = n.at(-1);
|
|
2601
|
+
if (r)
|
|
2658
2602
|
return {
|
|
2659
2603
|
kind: "physical",
|
|
2660
2604
|
connectionId: e.connectionId,
|
|
2661
|
-
tableName:
|
|
2605
|
+
tableName: r,
|
|
2662
2606
|
...n.length > 1 ? { schemaName: n.at(-2) } : {},
|
|
2663
2607
|
...n.length > 2 ? { databaseName: n.at(-3) } : {}
|
|
2664
2608
|
};
|
|
@@ -2667,44 +2611,44 @@ function oe(e, t) {
|
|
|
2667
2611
|
let n = e.get(t);
|
|
2668
2612
|
return n || (n = { fields: /* @__PURE__ */ new Map(), fieldConflicts: /* @__PURE__ */ new Set() }, e.set(t, n)), n;
|
|
2669
2613
|
}
|
|
2670
|
-
function
|
|
2614
|
+
function un(e, t) {
|
|
2671
2615
|
e.sourceLabel === void 0 ? e.sourceLabel = t : e.sourceLabel !== t && (e.sourceLabelConflict = !0);
|
|
2672
2616
|
}
|
|
2673
|
-
function
|
|
2674
|
-
for (const
|
|
2675
|
-
const
|
|
2676
|
-
if (!
|
|
2677
|
-
const a =
|
|
2617
|
+
function Oe(e, t, n) {
|
|
2618
|
+
for (const r of t) {
|
|
2619
|
+
const i = r == null ? void 0 : r.trim();
|
|
2620
|
+
if (!i) continue;
|
|
2621
|
+
const a = Bt(i), o = e.fields.get(a);
|
|
2678
2622
|
o === void 0 ? e.fields.set(a, n) : o !== n && e.fieldConflicts.add(a);
|
|
2679
2623
|
}
|
|
2680
2624
|
}
|
|
2681
|
-
function
|
|
2682
|
-
t.sourceLabel &&
|
|
2683
|
-
for (const [n,
|
|
2684
|
-
|
|
2625
|
+
function dn(e, t) {
|
|
2626
|
+
t.sourceLabel && un(e, t.sourceLabel), t.sourceLabelConflict && (e.sourceLabelConflict = !0);
|
|
2627
|
+
for (const [n, r] of t.fields)
|
|
2628
|
+
Oe(e, [n], r);
|
|
2685
2629
|
for (const n of t.fieldConflicts ?? [])
|
|
2686
2630
|
e.fieldConflicts.add(n);
|
|
2687
2631
|
}
|
|
2688
|
-
function
|
|
2632
|
+
function fn(e) {
|
|
2689
2633
|
return e.kind === "semantic" && (e.label || e.datasetName || "").trim() || void 0;
|
|
2690
2634
|
}
|
|
2691
|
-
function
|
|
2692
|
-
var
|
|
2635
|
+
function Zo(e, t) {
|
|
2636
|
+
var r, i;
|
|
2693
2637
|
const n = /* @__PURE__ */ new Map();
|
|
2694
2638
|
for (const [a, o] of e) {
|
|
2695
2639
|
if (o.status !== "ready") continue;
|
|
2696
|
-
const s = t == null ? void 0 : t.get(a), l = s ?
|
|
2640
|
+
const s = t == null ? void 0 : t.get(a), l = s ? fn(s) : void 0;
|
|
2697
2641
|
for (const c of o.columns) {
|
|
2698
|
-
const u = (
|
|
2699
|
-
f && l &&
|
|
2700
|
-
oe(n,
|
|
2642
|
+
const u = (r = c.column_name) == null ? void 0 : r.trim(), d = (i = c.label) == null ? void 0 : i.trim(), f = s ? Da(s, c) : void 0;
|
|
2643
|
+
f && l && un(
|
|
2644
|
+
oe(n, te(f)),
|
|
2701
2645
|
l
|
|
2702
|
-
), !(!u || !d || d === u) && (
|
|
2646
|
+
), !(!u || !d || d === u) && (Oe(
|
|
2703
2647
|
oe(n, a),
|
|
2704
2648
|
[u, c.sourceField],
|
|
2705
2649
|
d
|
|
2706
|
-
), f &&
|
|
2707
|
-
oe(n,
|
|
2650
|
+
), f && Oe(
|
|
2651
|
+
oe(n, te(f)),
|
|
2708
2652
|
[c.sourceField, u],
|
|
2709
2653
|
d
|
|
2710
2654
|
));
|
|
@@ -2712,84 +2656,84 @@ function os(e, t) {
|
|
|
2712
2656
|
}
|
|
2713
2657
|
return n;
|
|
2714
2658
|
}
|
|
2715
|
-
function
|
|
2659
|
+
function es(...e) {
|
|
2716
2660
|
const t = /* @__PURE__ */ new Map();
|
|
2717
2661
|
for (const n of e)
|
|
2718
|
-
for (const [
|
|
2719
|
-
|
|
2662
|
+
for (const [r, i] of n ?? [])
|
|
2663
|
+
dn(oe(t, r), i);
|
|
2720
2664
|
return t;
|
|
2721
2665
|
}
|
|
2722
2666
|
function Ue(e) {
|
|
2723
2667
|
return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
|
|
2724
2668
|
}
|
|
2725
|
-
function
|
|
2669
|
+
function Ta(e) {
|
|
2726
2670
|
return e.split(":").slice(2).filter(Boolean).join(".");
|
|
2727
2671
|
}
|
|
2728
|
-
function
|
|
2729
|
-
const n =
|
|
2730
|
-
if (t.kind !== "physical") return
|
|
2731
|
-
const
|
|
2672
|
+
function mn(e, t) {
|
|
2673
|
+
const n = te(t), r = e.get(n);
|
|
2674
|
+
if (t.kind !== "physical") return r;
|
|
2675
|
+
const i = `physical:${t.connectionId}:`, a = Ue(t), o = {
|
|
2732
2676
|
fields: /* @__PURE__ */ new Map(),
|
|
2733
2677
|
fieldConflicts: /* @__PURE__ */ new Set()
|
|
2734
2678
|
};
|
|
2735
2679
|
let s = !1;
|
|
2736
2680
|
for (const [l, c] of e)
|
|
2737
|
-
l.startsWith(
|
|
2681
|
+
l.startsWith(i) && (l !== n && !ni(a, Ta(l)) || (dn(o, c), s = !0));
|
|
2738
2682
|
return s ? o : void 0;
|
|
2739
2683
|
}
|
|
2740
|
-
function
|
|
2741
|
-
var
|
|
2684
|
+
function wa(e, t) {
|
|
2685
|
+
var i;
|
|
2742
2686
|
if (!e) return;
|
|
2743
|
-
const n =
|
|
2744
|
-
return
|
|
2687
|
+
const n = Bt(t.name), r = mn(e, t.source);
|
|
2688
|
+
return r && !((i = r.fieldConflicts) != null && i.has(n)) ? r.fields.get(n) : void 0;
|
|
2745
2689
|
}
|
|
2746
|
-
function
|
|
2690
|
+
function Ma(e, t) {
|
|
2747
2691
|
if (t.kind === "semantic")
|
|
2748
|
-
return
|
|
2749
|
-
const n = e ?
|
|
2692
|
+
return fn(t) || t.datasetId || "Dataset";
|
|
2693
|
+
const n = e ? mn(e, t) : void 0;
|
|
2750
2694
|
return n != null && n.sourceLabel && !n.sourceLabelConflict ? n.sourceLabel : Ue(t);
|
|
2751
2695
|
}
|
|
2752
|
-
function
|
|
2753
|
-
const n =
|
|
2696
|
+
function ts(e, t) {
|
|
2697
|
+
const n = wa(e, t);
|
|
2754
2698
|
return {
|
|
2755
2699
|
name: t.name,
|
|
2756
2700
|
...n ? { label: n } : {},
|
|
2757
|
-
entityName:
|
|
2701
|
+
entityName: Ma(e, t.source),
|
|
2758
2702
|
...t.source.kind === "physical" ? { qualifiedEntityName: Ue(t.source) } : {},
|
|
2759
2703
|
dataType: t.dataType
|
|
2760
2704
|
};
|
|
2761
2705
|
}
|
|
2762
|
-
function
|
|
2763
|
-
var
|
|
2764
|
-
const n = (
|
|
2765
|
-
if (!(!n ||
|
|
2706
|
+
function Oa(e, t) {
|
|
2707
|
+
var i, a;
|
|
2708
|
+
const n = (i = t.column_name) == null ? void 0 : i.trim(), r = Lt(t.data_type);
|
|
2709
|
+
if (!(!n || r === "unknown"))
|
|
2766
2710
|
return {
|
|
2767
2711
|
kind: "field",
|
|
2768
2712
|
field: {
|
|
2769
2713
|
name: n,
|
|
2770
2714
|
source: { ...e },
|
|
2771
|
-
dataType:
|
|
2715
|
+
dataType: r,
|
|
2772
2716
|
...(a = t.sourceField) != null && a.trim() ? { sourceField: t.sourceField.trim() } : {}
|
|
2773
2717
|
}
|
|
2774
2718
|
};
|
|
2775
2719
|
}
|
|
2776
|
-
function
|
|
2720
|
+
function ns(e) {
|
|
2777
2721
|
const t = {};
|
|
2778
2722
|
for (const { card: n } of e.cards) {
|
|
2779
|
-
const
|
|
2780
|
-
if (!
|
|
2723
|
+
const r = Vt(n), i = r.kind === "config" ? r.executableSources : r.kind === "sql" ? r.pinnedCatalogSources.map((s) => s.source) : [];
|
|
2724
|
+
if (!i.length) continue;
|
|
2781
2725
|
const a = [];
|
|
2782
2726
|
let o;
|
|
2783
|
-
for (const s of
|
|
2727
|
+
for (const s of i) {
|
|
2784
2728
|
const l = e.metadataBySourceKey.get(
|
|
2785
|
-
|
|
2729
|
+
te(s)
|
|
2786
2730
|
);
|
|
2787
2731
|
if (!l || l.status === "unavailable") {
|
|
2788
2732
|
o = (l == null ? void 0 : l.status) === "unavailable" ? l.message : "Field metadata is not available yet.";
|
|
2789
2733
|
break;
|
|
2790
2734
|
}
|
|
2791
2735
|
for (const c of l.columns) {
|
|
2792
|
-
const u =
|
|
2736
|
+
const u = Oa(s, c);
|
|
2793
2737
|
u && a.push(u);
|
|
2794
2738
|
}
|
|
2795
2739
|
}
|
|
@@ -2797,111 +2741,111 @@ function cs(e) {
|
|
|
2797
2741
|
}
|
|
2798
2742
|
return t;
|
|
2799
2743
|
}
|
|
2800
|
-
function
|
|
2801
|
-
const { dashboard: t, target: n, calendar:
|
|
2744
|
+
function rs(e) {
|
|
2745
|
+
const { dashboard: t, target: n, calendar: r } = e, i = gn(n), a = pn(t, n, r);
|
|
2802
2746
|
return {
|
|
2803
2747
|
value: a,
|
|
2804
|
-
mode:
|
|
2805
|
-
|
|
2748
|
+
mode: Ln(
|
|
2749
|
+
Bn(a == null ? void 0 : a.operation) ? a.operation : i.operation
|
|
2806
2750
|
)
|
|
2807
2751
|
};
|
|
2808
2752
|
}
|
|
2809
|
-
function
|
|
2810
|
-
var
|
|
2753
|
+
function pn(e, t, n) {
|
|
2754
|
+
var r;
|
|
2811
2755
|
switch (t.kind) {
|
|
2812
2756
|
case "dashboardInput": {
|
|
2813
|
-
const
|
|
2757
|
+
const i = Ir({
|
|
2814
2758
|
dashboard: e,
|
|
2815
2759
|
input: t.input,
|
|
2816
2760
|
target: t.scope,
|
|
2817
2761
|
calendar: n
|
|
2818
2762
|
});
|
|
2819
|
-
return (
|
|
2763
|
+
return (i == null ? void 0 : i.status) === "set" && i.value.kind === "filter" ? i.value.filterValue : void 0;
|
|
2820
2764
|
}
|
|
2821
2765
|
case "dashboardFilter": {
|
|
2822
|
-
const
|
|
2766
|
+
const i = (r = e.defaultFilterValues) == null ? void 0 : r.find(
|
|
2823
2767
|
(a) => a.filterId === t.filter.id
|
|
2824
2768
|
);
|
|
2825
|
-
return
|
|
2769
|
+
return i ? Cr({
|
|
2826
2770
|
filterDefinitions: [t.filter],
|
|
2827
|
-
filterValues: [
|
|
2828
|
-
})[0] :
|
|
2771
|
+
filterValues: [i]
|
|
2772
|
+
})[0] : X(t.filter, n);
|
|
2829
2773
|
}
|
|
2830
2774
|
case "definition":
|
|
2831
|
-
return
|
|
2775
|
+
return X(t.filter, n);
|
|
2832
2776
|
}
|
|
2833
2777
|
}
|
|
2834
|
-
function
|
|
2778
|
+
function gn(e) {
|
|
2835
2779
|
return e.kind === "dashboardInput" ? e.input.filter : e.filter;
|
|
2836
2780
|
}
|
|
2837
|
-
function
|
|
2781
|
+
function is(e) {
|
|
2838
2782
|
var a;
|
|
2839
|
-
const { dashboard: t, filter: n, input:
|
|
2840
|
-
return
|
|
2783
|
+
const { dashboard: t, filter: n, input: r, scope: i } = e;
|
|
2784
|
+
return r && (t.inputs || []).some((o) => o.id === r.id) ? { kind: "dashboardInput", input: r, scope: i } : ((a = j(t).findFilterInput({ filterId: n.id })) == null ? void 0 : a.origin) === "toolbarFilter" ? { kind: "dashboardFilter", filter: n } : { kind: "definition", filter: n };
|
|
2841
2785
|
}
|
|
2842
|
-
function
|
|
2843
|
-
const { dashboard: t, target: n, calendar:
|
|
2786
|
+
function as(e) {
|
|
2787
|
+
const { dashboard: t, target: n, calendar: r } = e, i = gn(n), a = xr(i), o = Pa(t, n);
|
|
2844
2788
|
if (!o) return a;
|
|
2845
2789
|
if (o === "cleared")
|
|
2846
2790
|
return {
|
|
2847
|
-
operation:
|
|
2791
|
+
operation: i.operation,
|
|
2848
2792
|
defaultValues: void 0,
|
|
2849
2793
|
defaultDateFilter: void 0
|
|
2850
2794
|
};
|
|
2851
|
-
const s =
|
|
2852
|
-
if (!s || Na(s,
|
|
2795
|
+
const s = pn(t, n, r);
|
|
2796
|
+
if (!s || Na(s, X(i, r)))
|
|
2853
2797
|
return a;
|
|
2854
2798
|
if (s.valueType === "date") {
|
|
2855
|
-
const l =
|
|
2799
|
+
const l = Er(
|
|
2856
2800
|
"relativeMeta" in s ? s.relativeMeta : void 0
|
|
2857
|
-
) ??
|
|
2801
|
+
) ?? ka(i, s, r);
|
|
2858
2802
|
return l ? {
|
|
2859
2803
|
operation: s.operation,
|
|
2860
|
-
defaultValues:
|
|
2804
|
+
defaultValues: i.defaultValues,
|
|
2861
2805
|
defaultDateFilter: l
|
|
2862
2806
|
} : a;
|
|
2863
2807
|
}
|
|
2864
2808
|
return {
|
|
2865
2809
|
operation: s.operation,
|
|
2866
2810
|
defaultValues: s.values,
|
|
2867
|
-
defaultDateFilter:
|
|
2811
|
+
defaultDateFilter: i.defaultDateFilter
|
|
2868
2812
|
};
|
|
2869
2813
|
}
|
|
2870
|
-
function
|
|
2814
|
+
function Pa(e, t) {
|
|
2871
2815
|
var n;
|
|
2872
2816
|
if (t.kind === "dashboardInput") {
|
|
2873
|
-
const
|
|
2817
|
+
const r = _e(
|
|
2874
2818
|
e.defaultInputValues,
|
|
2875
2819
|
t.input,
|
|
2876
2820
|
t.scope
|
|
2877
2821
|
);
|
|
2878
|
-
return (
|
|
2822
|
+
return (r == null ? void 0 : r.status) === "set" || (r == null ? void 0 : r.status) === "cleared" ? r.status : void 0;
|
|
2879
2823
|
}
|
|
2880
2824
|
if (t.kind === "dashboardFilter")
|
|
2881
2825
|
return (n = e.defaultFilterValues) != null && n.some(
|
|
2882
|
-
(
|
|
2826
|
+
(r) => r.filterId === t.filter.id
|
|
2883
2827
|
) ? "set" : void 0;
|
|
2884
2828
|
}
|
|
2885
2829
|
function Na(e, t) {
|
|
2886
|
-
return !!(t && e.operation === t.operation && Se(
|
|
2830
|
+
return !!(t && e.operation === t.operation && Se(vt(e), vt(t)) && Se(
|
|
2887
2831
|
"relativeMeta" in e ? e.relativeMeta : void 0,
|
|
2888
2832
|
"relativeMeta" in t ? t.relativeMeta : void 0
|
|
2889
2833
|
));
|
|
2890
2834
|
}
|
|
2891
|
-
function
|
|
2835
|
+
function vt(e) {
|
|
2892
2836
|
return e.values.map(
|
|
2893
2837
|
(t) => t instanceof Date ? t.getTime() : t
|
|
2894
2838
|
);
|
|
2895
2839
|
}
|
|
2896
|
-
function
|
|
2897
|
-
const
|
|
2898
|
-
if (!
|
|
2840
|
+
function ka(e, t, n) {
|
|
2841
|
+
const r = Sr(n == null ? void 0 : n.tz), i = Fe(t.values[0], r);
|
|
2842
|
+
if (!i) return;
|
|
2899
2843
|
const [a, o, s] = new Intl.DateTimeFormat("en-CA", {
|
|
2900
|
-
timeZone:
|
|
2844
|
+
timeZone: r,
|
|
2901
2845
|
year: "numeric",
|
|
2902
2846
|
month: "2-digit",
|
|
2903
2847
|
day: "2-digit"
|
|
2904
|
-
}).format(
|
|
2848
|
+
}).format(i).split("-").map(Number), l = [
|
|
2905
2849
|
{
|
|
2906
2850
|
mode: "fixed",
|
|
2907
2851
|
unit: "day",
|
|
@@ -2911,30 +2855,30 @@ function Ra(e, t, n) {
|
|
|
2911
2855
|
], c = t.values.map(
|
|
2912
2856
|
(u) => {
|
|
2913
2857
|
var d;
|
|
2914
|
-
return (d = Fe(u,
|
|
2858
|
+
return (d = Fe(u, r)) == null ? void 0 : d.getTime();
|
|
2915
2859
|
}
|
|
2916
2860
|
);
|
|
2917
2861
|
return l.find((u) => {
|
|
2918
|
-
const d =
|
|
2862
|
+
const d = X(
|
|
2919
2863
|
{ ...e, defaultDateFilter: u },
|
|
2920
2864
|
n
|
|
2921
2865
|
);
|
|
2922
2866
|
return (d == null ? void 0 : d.operation) === t.operation && Se(
|
|
2923
2867
|
d.values.map(
|
|
2924
2868
|
(f) => {
|
|
2925
|
-
var
|
|
2926
|
-
return (
|
|
2869
|
+
var m;
|
|
2870
|
+
return (m = Fe(f, r)) == null ? void 0 : m.getTime();
|
|
2927
2871
|
}
|
|
2928
2872
|
),
|
|
2929
2873
|
c
|
|
2930
2874
|
);
|
|
2931
2875
|
});
|
|
2932
2876
|
}
|
|
2933
|
-
function
|
|
2877
|
+
function Aa(e) {
|
|
2934
2878
|
const t = G(e.format);
|
|
2935
2879
|
if ((t == null ? void 0 : t.type) === "temporal_bucket") {
|
|
2936
2880
|
if (!e.granularity) return {};
|
|
2937
|
-
const n =
|
|
2881
|
+
const n = Xr(
|
|
2938
2882
|
t,
|
|
2939
2883
|
e.granularity
|
|
2940
2884
|
);
|
|
@@ -2951,34 +2895,34 @@ function _a(e) {
|
|
|
2951
2895
|
...t ? { format: t } : {}
|
|
2952
2896
|
};
|
|
2953
2897
|
}
|
|
2954
|
-
function
|
|
2955
|
-
var
|
|
2956
|
-
const n = ((
|
|
2898
|
+
function _a(e, t) {
|
|
2899
|
+
var i, a;
|
|
2900
|
+
const n = ((i = e.nativeDataType) == null ? void 0 : i.trim()) || ((a = e.native_data_type) == null ? void 0 : a.trim());
|
|
2957
2901
|
return n || ((e.dataTypeProvenance || t) === "physical" ? e.data_type : void 0);
|
|
2958
2902
|
}
|
|
2959
|
-
function
|
|
2903
|
+
function yn(e) {
|
|
2960
2904
|
const t = (e.label ?? "").trim();
|
|
2961
2905
|
return t ? e.derivedLabel === void 0 ? !0 : t !== e.derivedLabel.trim() : !1;
|
|
2962
2906
|
}
|
|
2963
|
-
function
|
|
2964
|
-
return
|
|
2907
|
+
function ze(e) {
|
|
2908
|
+
return yn(e) ? e.label.trim() : e.name || (e.label ?? "").trim();
|
|
2965
2909
|
}
|
|
2966
|
-
function
|
|
2967
|
-
return
|
|
2910
|
+
function Ft(e) {
|
|
2911
|
+
return ze(e).toLowerCase().trim();
|
|
2968
2912
|
}
|
|
2969
|
-
function
|
|
2970
|
-
return
|
|
2913
|
+
function Ra(e, t) {
|
|
2914
|
+
return Ft(e).localeCompare(Ft(t), void 0, {
|
|
2971
2915
|
numeric: !0,
|
|
2972
2916
|
sensitivity: "base"
|
|
2973
2917
|
});
|
|
2974
2918
|
}
|
|
2975
|
-
function
|
|
2919
|
+
function ee(e) {
|
|
2976
2920
|
return String(e ?? "").toLowerCase().replace(/[\s_\-.]+/g, "");
|
|
2977
2921
|
}
|
|
2978
|
-
function
|
|
2979
|
-
const n =
|
|
2922
|
+
function os(e, t) {
|
|
2923
|
+
const n = ee(t);
|
|
2980
2924
|
return n ? [
|
|
2981
|
-
|
|
2925
|
+
ze(e),
|
|
2982
2926
|
e.label,
|
|
2983
2927
|
e.name,
|
|
2984
2928
|
e.description,
|
|
@@ -2987,38 +2931,38 @@ function ms(e, t) {
|
|
|
2987
2931
|
e.entityName && e.name ? `${e.entityName}.${e.name}` : "",
|
|
2988
2932
|
e.dataType
|
|
2989
2933
|
].some(
|
|
2990
|
-
(
|
|
2934
|
+
(i) => !!i && ee(i).includes(n)
|
|
2991
2935
|
) : !0;
|
|
2992
2936
|
}
|
|
2993
|
-
function
|
|
2994
|
-
const n =
|
|
2937
|
+
function Ct(e, t) {
|
|
2938
|
+
const n = ee(t);
|
|
2995
2939
|
if (!n) return 0;
|
|
2996
|
-
const
|
|
2997
|
-
return
|
|
2940
|
+
const r = ee(ze(e));
|
|
2941
|
+
return r.startsWith(n) ? 0 : r.includes(n) ? 1 : [e.label, e.name].filter(Boolean).map(ee).some((a) => a.includes(n)) ? 2 : 3;
|
|
2998
2942
|
}
|
|
2999
|
-
function
|
|
3000
|
-
return
|
|
2943
|
+
function ss(e, t, n) {
|
|
2944
|
+
return Ct(e, n) - Ct(t, n) || Ra(e, t);
|
|
3001
2945
|
}
|
|
3002
|
-
function
|
|
2946
|
+
function Ea(e, t) {
|
|
3003
2947
|
var a;
|
|
3004
|
-
const n = e.type === "dataset" ? (a = t.find((o) => o.entityName)) == null ? void 0 : a.entityName : void 0,
|
|
2948
|
+
const n = e.type === "dataset" ? (a = t.find((o) => o.entityName)) == null ? void 0 : a.entityName : void 0, r = n || e.name, i = ct(
|
|
3005
2949
|
e.type === "dataset" && n ? { ...e, name: n } : e
|
|
3006
2950
|
);
|
|
3007
2951
|
return {
|
|
3008
2952
|
entityId: e.id || e.name,
|
|
3009
2953
|
entityType: e.type,
|
|
3010
|
-
entityName:
|
|
2954
|
+
entityName: r,
|
|
3011
2955
|
label: e.label,
|
|
3012
2956
|
description: e.description,
|
|
3013
|
-
qualifiedEntityName:
|
|
2957
|
+
qualifiedEntityName: i,
|
|
3014
2958
|
columns: t.map((o) => {
|
|
3015
|
-
var
|
|
3016
|
-
const s = e.type === "dataset" ? o.entityName ||
|
|
2959
|
+
var m;
|
|
2960
|
+
const s = e.type === "dataset" ? o.entityName || r : e.name, l = o.qualifiedEntityName || (e.type === "dataset" && s ? ct({ ...e, name: s }) : i), c = _a(
|
|
3017
2961
|
o,
|
|
3018
2962
|
e.type === "dataset" ? "semantic" : "physical"
|
|
3019
|
-
), u = (
|
|
2963
|
+
), u = (m = o.label) != null && m.trim() ? o.label : void 0, d = u ? void 0 : Dr(o.column_name);
|
|
3020
2964
|
return {
|
|
3021
|
-
id:
|
|
2965
|
+
id: Tr(s, o.column_name),
|
|
3022
2966
|
name: o.column_name,
|
|
3023
2967
|
qualifiedFieldName: o.qualifiedFieldName || o.column_name,
|
|
3024
2968
|
dataType: o.data_type,
|
|
@@ -3042,23 +2986,23 @@ function Ka(e, t) {
|
|
|
3042
2986
|
aggregateOrigin: o.aggregateOrigin,
|
|
3043
2987
|
labelOrigin: o.labelOrigin,
|
|
3044
2988
|
formatOrigin: o.formatOrigin,
|
|
3045
|
-
...
|
|
2989
|
+
...Aa(o),
|
|
3046
2990
|
aggregate: o.aggregate
|
|
3047
2991
|
};
|
|
3048
2992
|
})
|
|
3049
2993
|
};
|
|
3050
2994
|
}
|
|
3051
|
-
function
|
|
2995
|
+
function Va(e) {
|
|
3052
2996
|
return e.map((t) => ({
|
|
3053
2997
|
...t,
|
|
3054
|
-
id:
|
|
2998
|
+
id: Kt({ ...t }),
|
|
3055
2999
|
fieldScope: "domain"
|
|
3056
3000
|
}));
|
|
3057
3001
|
}
|
|
3058
|
-
function
|
|
3002
|
+
function Ka(e) {
|
|
3059
3003
|
return e.flatMap(
|
|
3060
3004
|
(t) => t.columns.map((n) => {
|
|
3061
|
-
const
|
|
3005
|
+
const r = yn(n) ? n.label : void 0, i = r ? void 0 : n.derivedLabel ?? Mr(n.name), a = r ?? i ?? n.name;
|
|
3062
3006
|
return {
|
|
3063
3007
|
...n,
|
|
3064
3008
|
id: n.id || `${t.entityId}-${n.name}`,
|
|
@@ -3067,7 +3011,7 @@ function Ba(e) {
|
|
|
3067
3011
|
dataType: n.dataType,
|
|
3068
3012
|
qualifiedEntityName: n.qualifiedEntityName || t.qualifiedEntityName,
|
|
3069
3013
|
label: a,
|
|
3070
|
-
...
|
|
3014
|
+
...i !== void 0 ? { derivedLabel: i } : {},
|
|
3071
3015
|
description: n.description,
|
|
3072
3016
|
entityId: n.entityId || t.entityId,
|
|
3073
3017
|
entityName: n.entityName || t.entityName,
|
|
@@ -3076,56 +3020,56 @@ function Ba(e) {
|
|
|
3076
3020
|
})
|
|
3077
3021
|
);
|
|
3078
3022
|
}
|
|
3079
|
-
function
|
|
3080
|
-
const t = e.map((
|
|
3081
|
-
var
|
|
3082
|
-
return ((
|
|
3083
|
-
}), n =
|
|
3023
|
+
function cs(e) {
|
|
3024
|
+
const t = e.map((r) => Ea(r.target, r.columns || [])).filter((r) => {
|
|
3025
|
+
var i;
|
|
3026
|
+
return ((i = r == null ? void 0 : r.columns) == null ? void 0 : i.length) > 0;
|
|
3027
|
+
}), n = Va(e.flatMap((r) => r.calculatedFields || []));
|
|
3084
3028
|
if (n.length > 0) {
|
|
3085
|
-
const
|
|
3086
|
-
n.forEach((
|
|
3087
|
-
const a =
|
|
3088
|
-
|
|
3029
|
+
const r = /* @__PURE__ */ new Map();
|
|
3030
|
+
n.forEach((i) => {
|
|
3031
|
+
const a = Kt(i);
|
|
3032
|
+
r.has(a) || r.set(a, i);
|
|
3089
3033
|
}), t.unshift({
|
|
3090
|
-
entityId:
|
|
3034
|
+
entityId: wr,
|
|
3091
3035
|
entityType: "dataset",
|
|
3092
|
-
entityName:
|
|
3036
|
+
entityName: lt,
|
|
3093
3037
|
label: "Calculated Fields",
|
|
3094
3038
|
description: "Domain-level calculated metrics and dimensions",
|
|
3095
|
-
qualifiedEntityName:
|
|
3096
|
-
columns: Array.from(
|
|
3039
|
+
qualifiedEntityName: lt,
|
|
3040
|
+
columns: Array.from(r.values())
|
|
3097
3041
|
});
|
|
3098
3042
|
}
|
|
3099
|
-
return { columnGroups: t, columns:
|
|
3043
|
+
return { columnGroups: t, columns: Ka(t) };
|
|
3100
3044
|
}
|
|
3101
|
-
function
|
|
3102
|
-
var
|
|
3103
|
-
const n = (
|
|
3045
|
+
function La(e, t) {
|
|
3046
|
+
var i;
|
|
3047
|
+
const n = (i = t.columnKeyMap) == null ? void 0 : i.byRole;
|
|
3104
3048
|
if (!n) return;
|
|
3105
|
-
const
|
|
3049
|
+
const r = Object.values(n).flatMap((a) => {
|
|
3106
3050
|
const o = a == null ? void 0 : a[e];
|
|
3107
3051
|
return o ? [o] : [];
|
|
3108
3052
|
});
|
|
3109
|
-
if (
|
|
3110
|
-
return
|
|
3053
|
+
if (r.length === 1)
|
|
3054
|
+
return r[0].outputKey ?? r[0].rawKey;
|
|
3111
3055
|
}
|
|
3112
|
-
function
|
|
3113
|
-
var
|
|
3114
|
-
const n = (
|
|
3115
|
-
const a =
|
|
3056
|
+
function Ba(e, t) {
|
|
3057
|
+
var r;
|
|
3058
|
+
const n = (r = t.resultColumns) == null ? void 0 : r.find((i) => {
|
|
3059
|
+
const a = i.pivotIdentity;
|
|
3116
3060
|
return (a == null ? void 0 : a.metricId) === e.metricId && a.members.length === e.members.length && a.members.every(
|
|
3117
3061
|
(o, s) => o.fieldId === e.members[s].fieldId && o.value === e.members[s].value
|
|
3118
3062
|
);
|
|
3119
3063
|
});
|
|
3120
3064
|
return n == null ? void 0 : n.key;
|
|
3121
3065
|
}
|
|
3122
|
-
function
|
|
3066
|
+
function It(e, t) {
|
|
3123
3067
|
var n;
|
|
3124
3068
|
switch (e.kind) {
|
|
3125
3069
|
case "field":
|
|
3126
|
-
return
|
|
3070
|
+
return La(e.fieldId, t);
|
|
3127
3071
|
case "pivot":
|
|
3128
|
-
return
|
|
3072
|
+
return Ba(e, t);
|
|
3129
3073
|
case "result":
|
|
3130
3074
|
return !t.keys || t.keys.includes(e.key) ? e.key : void 0;
|
|
3131
3075
|
case "sqlKpiValue":
|
|
@@ -3136,74 +3080,74 @@ function xt(e, t) {
|
|
|
3136
3080
|
return;
|
|
3137
3081
|
}
|
|
3138
3082
|
}
|
|
3139
|
-
function
|
|
3083
|
+
function ls(e, t) {
|
|
3140
3084
|
return e.flatMap((n) => {
|
|
3141
3085
|
var s, l;
|
|
3142
|
-
const
|
|
3143
|
-
if (
|
|
3144
|
-
const
|
|
3145
|
-
const u =
|
|
3086
|
+
const r = It(n.condition.column, t);
|
|
3087
|
+
if (r === void 0) return [];
|
|
3088
|
+
const i = (s = n.target.columns) == null ? void 0 : s.flatMap((c) => {
|
|
3089
|
+
const u = It(c, t);
|
|
3146
3090
|
return u === void 0 ? [] : [u];
|
|
3147
3091
|
});
|
|
3148
|
-
if ((l = n.target.columns) != null && l.length && !(
|
|
3092
|
+
if ((l = n.target.columns) != null && l.length && !(i != null && i.length)) return [];
|
|
3149
3093
|
const { columns: a, ...o } = n.target;
|
|
3150
3094
|
return [
|
|
3151
3095
|
{
|
|
3152
3096
|
...n,
|
|
3153
|
-
condition: { ...n.condition, column:
|
|
3154
|
-
target:
|
|
3097
|
+
condition: { ...n.condition, column: r },
|
|
3098
|
+
target: i ? { ...o, columns: i } : o
|
|
3155
3099
|
}
|
|
3156
3100
|
];
|
|
3157
3101
|
});
|
|
3158
3102
|
}
|
|
3159
|
-
function
|
|
3103
|
+
function us(e, t, n) {
|
|
3160
3104
|
var o, s, l, c, u;
|
|
3161
|
-
const
|
|
3162
|
-
if (
|
|
3105
|
+
const r = Or(e);
|
|
3106
|
+
if (r.includes("matrixMeasure"))
|
|
3163
3107
|
return (s = (o = e.config) == null ? void 0 : o.matrix) != null && s.spec.measures.some((d) => d.id === t) ? { kind: "matrixMeasure", measureId: t } : void 0;
|
|
3164
|
-
if (
|
|
3165
|
-
if (
|
|
3108
|
+
if (r.includes("sqlKpiValue")) return { kind: "sqlKpiValue" };
|
|
3109
|
+
if (r.includes("result"))
|
|
3166
3110
|
return !n.keys || n.keys.includes(t) ? { kind: "result", key: t } : void 0;
|
|
3167
|
-
const
|
|
3168
|
-
if (
|
|
3111
|
+
const i = r.includes("pivot") ? (c = (l = n.resultColumns) == null ? void 0 : l.find((d) => d.key === t)) == null ? void 0 : c.pivotIdentity : void 0;
|
|
3112
|
+
if (i)
|
|
3169
3113
|
return {
|
|
3170
3114
|
kind: "pivot",
|
|
3171
|
-
metricId:
|
|
3172
|
-
members:
|
|
3115
|
+
metricId: i.metricId,
|
|
3116
|
+
members: i.members.map((d) => ({ fieldId: d.fieldId, value: d.value }))
|
|
3173
3117
|
};
|
|
3174
|
-
if (!
|
|
3118
|
+
if (!r.includes("field")) return;
|
|
3175
3119
|
const a = Object.values(((u = n.columnKeyMap) == null ? void 0 : u.byRole) ?? {}).flatMap(
|
|
3176
3120
|
(d) => Object.entries(d ?? {}).flatMap(
|
|
3177
|
-
([f,
|
|
3121
|
+
([f, m]) => (m.outputKey ?? m.rawKey) === t ? [f] : []
|
|
3178
3122
|
)
|
|
3179
3123
|
);
|
|
3180
3124
|
return a.length === 1 ? { kind: "field", fieldId: a[0] } : void 0;
|
|
3181
3125
|
}
|
|
3182
3126
|
function fe(e, t) {
|
|
3183
3127
|
const n = (a) => {
|
|
3184
|
-
if (
|
|
3185
|
-
const o = typeof a == "string" ?
|
|
3128
|
+
if (B(a)) return a.value;
|
|
3129
|
+
const o = typeof a == "string" ? Vr(a.trim()) ?? K(a) : K(a);
|
|
3186
3130
|
if (o === null) return null;
|
|
3187
3131
|
try {
|
|
3188
|
-
return
|
|
3132
|
+
return Kr(String(o));
|
|
3189
3133
|
} catch {
|
|
3190
3134
|
return null;
|
|
3191
3135
|
}
|
|
3192
|
-
},
|
|
3193
|
-
return
|
|
3194
|
-
}
|
|
3195
|
-
function
|
|
3196
|
-
const
|
|
3197
|
-
if (
|
|
3198
|
-
if (typeof
|
|
3199
|
-
const g =
|
|
3136
|
+
}, r = n(e), i = n(t);
|
|
3137
|
+
return r === null || i === null ? null : qt(r, i);
|
|
3138
|
+
}
|
|
3139
|
+
function xt(e, t, n) {
|
|
3140
|
+
const r = qa(e);
|
|
3141
|
+
if (r === null) return null;
|
|
3142
|
+
if (typeof r == "number" && typeof t == "number" && typeof n == "number") {
|
|
3143
|
+
const g = Ua(r, t, n);
|
|
3200
3144
|
return { ratio: g, midpointComparison: Math.sign(g - 0.5) };
|
|
3201
3145
|
}
|
|
3202
3146
|
if ([t, n].some((g) => typeof g == "number" && !Number.isFinite(g))) return null;
|
|
3203
|
-
const
|
|
3204
|
-
const b = typeof g == "number" ? De(String(g)) : g.value, [
|
|
3205
|
-
return { coefficient:
|
|
3206
|
-
}), a = Math.max(...
|
|
3147
|
+
const i = [r, t, n].map((g) => {
|
|
3148
|
+
const b = typeof g == "number" ? De(String(g)) : g.value, [p, v = ""] = b.split(".");
|
|
3149
|
+
return { coefficient: p + v, scale: v.length };
|
|
3150
|
+
}), a = Math.max(...i.map((g) => g.scale)), [o, s, l] = i.map(
|
|
3207
3151
|
(g) => BigInt(g.coefficient) * 10n ** BigInt(a - g.scale)
|
|
3208
3152
|
), c = l - s, u = o - s;
|
|
3209
3153
|
if (c <= 0n)
|
|
@@ -3214,13 +3158,13 @@ function St(e, t, n) {
|
|
|
3214
3158
|
const d = u * 2n - c, f = d < 0n ? -1 : d > 0n ? 1 : 0;
|
|
3215
3159
|
return { ratio: u <= 0n ? 0 : u >= c ? 1 : Number(u * 1000000000n / c) / 1e9, midpointComparison: f };
|
|
3216
3160
|
}
|
|
3217
|
-
function
|
|
3161
|
+
function ds(e) {
|
|
3218
3162
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
3219
3163
|
}
|
|
3220
|
-
function
|
|
3164
|
+
function fs(e) {
|
|
3221
3165
|
return e.enabled !== !1;
|
|
3222
3166
|
}
|
|
3223
|
-
function
|
|
3167
|
+
function ms(e) {
|
|
3224
3168
|
return e.kind === "topBottom" || e.kind === "colorScale" && e.range === "auto" || e.kind === "dataBar" && e.range === "auto";
|
|
3225
3169
|
}
|
|
3226
3170
|
function K(e) {
|
|
@@ -3232,30 +3176,30 @@ function K(e) {
|
|
|
3232
3176
|
}
|
|
3233
3177
|
return null;
|
|
3234
3178
|
}
|
|
3235
|
-
function
|
|
3236
|
-
return
|
|
3179
|
+
function qa(e) {
|
|
3180
|
+
return B(e) ? e : K(e);
|
|
3237
3181
|
}
|
|
3238
|
-
function
|
|
3182
|
+
function ps(e) {
|
|
3239
3183
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
3240
|
-
for (const
|
|
3241
|
-
|
|
3184
|
+
for (const r of e)
|
|
3185
|
+
B(r) ? n.add(r.value) : t.add(r);
|
|
3242
3186
|
return {
|
|
3243
|
-
has: (
|
|
3187
|
+
has: (r) => B(r) ? n.has(r.value) : t.has(r)
|
|
3244
3188
|
};
|
|
3245
3189
|
}
|
|
3246
|
-
function
|
|
3247
|
-
return typeof e == "number" && typeof t == "number" ? Math.sign(e - t) :
|
|
3190
|
+
function St(e, t) {
|
|
3191
|
+
return typeof e == "number" && typeof t == "number" ? Math.sign(e - t) : qt(
|
|
3248
3192
|
typeof e == "number" ? De(String(e)) : e.value,
|
|
3249
3193
|
typeof t == "number" ? De(String(t)) : t.value
|
|
3250
3194
|
);
|
|
3251
3195
|
}
|
|
3252
|
-
function
|
|
3196
|
+
function $a(e) {
|
|
3253
3197
|
return e == null || e === "";
|
|
3254
3198
|
}
|
|
3255
|
-
function
|
|
3199
|
+
function Ua(e, t, n) {
|
|
3256
3200
|
return !Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) ? 0 : n === t ? e >= n ? 1 : 0 : Math.max(0, Math.min(1, (e - t) / (n - t)));
|
|
3257
3201
|
}
|
|
3258
|
-
function
|
|
3202
|
+
function za(e) {
|
|
3259
3203
|
switch (e) {
|
|
3260
3204
|
case "bold":
|
|
3261
3205
|
return 700;
|
|
@@ -3269,28 +3213,28 @@ function Ga(e) {
|
|
|
3269
3213
|
return;
|
|
3270
3214
|
}
|
|
3271
3215
|
}
|
|
3272
|
-
function
|
|
3273
|
-
return e ?
|
|
3274
|
-
fontWeight:
|
|
3216
|
+
function ja(e) {
|
|
3217
|
+
return e ? bn({
|
|
3218
|
+
fontWeight: za(e.fontWeight),
|
|
3275
3219
|
fontStyle: e.italic ? "italic" : void 0,
|
|
3276
3220
|
color: e.textColor,
|
|
3277
3221
|
backgroundColor: e.backgroundColor,
|
|
3278
3222
|
textDecoration: e.textDecoration
|
|
3279
3223
|
}) : {};
|
|
3280
3224
|
}
|
|
3281
|
-
function
|
|
3225
|
+
function hn(...e) {
|
|
3282
3226
|
return Object.assign(
|
|
3283
3227
|
{},
|
|
3284
|
-
...e.filter((t) => !!t).map(
|
|
3228
|
+
...e.filter((t) => !!t).map(bn)
|
|
3285
3229
|
);
|
|
3286
3230
|
}
|
|
3287
|
-
function
|
|
3231
|
+
function bn(e) {
|
|
3288
3232
|
return Object.fromEntries(
|
|
3289
3233
|
Object.entries(e).filter(([, t]) => t !== void 0)
|
|
3290
3234
|
);
|
|
3291
3235
|
}
|
|
3292
|
-
function
|
|
3293
|
-
if (
|
|
3236
|
+
function Ga(e, t, n) {
|
|
3237
|
+
if (B(e) || B(n)) {
|
|
3294
3238
|
const s = fe(e, n);
|
|
3295
3239
|
if (s === null) return t === "neq";
|
|
3296
3240
|
switch (t) {
|
|
@@ -3308,7 +3252,7 @@ function Ha(e, t, n) {
|
|
|
3308
3252
|
return s <= 0;
|
|
3309
3253
|
}
|
|
3310
3254
|
}
|
|
3311
|
-
const
|
|
3255
|
+
const r = K(e), i = K(n), a = r ?? String(e ?? ""), o = i ?? String(n ?? "");
|
|
3312
3256
|
switch (t) {
|
|
3313
3257
|
case "eq":
|
|
3314
3258
|
return a === o;
|
|
@@ -3324,34 +3268,34 @@ function Ha(e, t, n) {
|
|
|
3324
3268
|
return a <= o;
|
|
3325
3269
|
}
|
|
3326
3270
|
}
|
|
3327
|
-
function
|
|
3271
|
+
function Wa(e, t, n, r) {
|
|
3328
3272
|
var a;
|
|
3329
|
-
const
|
|
3273
|
+
const i = t[e.column];
|
|
3330
3274
|
switch (e.kind) {
|
|
3331
3275
|
case "comparison":
|
|
3332
|
-
return
|
|
3276
|
+
return Ga(i, e.operator, e.value);
|
|
3333
3277
|
case "between": {
|
|
3334
|
-
if ([
|
|
3335
|
-
const c = fe(
|
|
3278
|
+
if ([i, e.min, e.max].some(B)) {
|
|
3279
|
+
const c = fe(i, e.min), u = fe(i, e.max);
|
|
3336
3280
|
return c === null || u === null ? !1 : e.inclusive === !1 ? c > 0 && u < 0 : c >= 0 && u <= 0;
|
|
3337
3281
|
}
|
|
3338
|
-
const o = K(
|
|
3282
|
+
const o = K(i), s = K(e.min), l = K(e.max);
|
|
3339
3283
|
return o === null || s === null || l === null ? !1 : e.inclusive === !1 ? o > s && o < l : o >= s && o <= l;
|
|
3340
3284
|
}
|
|
3341
3285
|
case "blank":
|
|
3342
|
-
return
|
|
3286
|
+
return $a(i) === e.isBlank;
|
|
3343
3287
|
case "contains": {
|
|
3344
|
-
const o =
|
|
3288
|
+
const o = B(i) ? i.value : String(i ?? ""), s = e.value, l = e.caseSensitive ? o : o.toLocaleLowerCase(), c = e.caseSensitive ? s : s.toLocaleLowerCase();
|
|
3345
3289
|
return e.exact ? l === c : l.includes(c);
|
|
3346
3290
|
}
|
|
3347
3291
|
case "topBottom":
|
|
3348
|
-
return ((a = n.topBottom[
|
|
3292
|
+
return ((a = n.topBottom[r]) == null ? void 0 : a.has(i)) ?? !1;
|
|
3349
3293
|
case "colorScale":
|
|
3350
3294
|
case "dataBar":
|
|
3351
|
-
return !n.unavailableRuleIds.has(
|
|
3295
|
+
return !n.unavailableRuleIds.has(r);
|
|
3352
3296
|
}
|
|
3353
3297
|
}
|
|
3354
|
-
function
|
|
3298
|
+
function Ha(e, t) {
|
|
3355
3299
|
var n;
|
|
3356
3300
|
return !((n = e.target.tableParts) != null && n.length) || e.target.tableParts.includes(t);
|
|
3357
3301
|
}
|
|
@@ -3359,25 +3303,25 @@ function Qa(e, t) {
|
|
|
3359
3303
|
const n = e.target.columns;
|
|
3360
3304
|
return e.target.level === "row" ? !(n != null && n.length) || n.includes(t) : n != null && n.length ? n.includes(t) : t === e.condition.column;
|
|
3361
3305
|
}
|
|
3362
|
-
function
|
|
3363
|
-
var
|
|
3306
|
+
function Ya(e, t, n) {
|
|
3307
|
+
var r, i;
|
|
3364
3308
|
if (e.condition.kind === "colorScale") {
|
|
3365
3309
|
const a = n.numericRanges[e.id];
|
|
3366
3310
|
if (!a) return {};
|
|
3367
|
-
const o = t[e.condition.column], s =
|
|
3311
|
+
const o = t[e.condition.column], s = xt(
|
|
3368
3312
|
o,
|
|
3369
3313
|
a.min,
|
|
3370
3314
|
a.max
|
|
3371
3315
|
);
|
|
3372
3316
|
if (!s)
|
|
3373
3317
|
return {};
|
|
3374
|
-
const l = a.mid, c = l !== void 0 &&
|
|
3318
|
+
const l = a.mid, c = l !== void 0 && B(o) ? fe(o, l) : l === void 0 ? null : Math.sign(K(o) - l);
|
|
3375
3319
|
return { cellStyle: { backgroundColor: l !== void 0 && e.condition.colors.mid ? c < 0 ? e.condition.colors.min : c === 0 ? e.condition.colors.mid : e.condition.colors.max : s.midpointComparison < 0 ? e.condition.colors.min : e.condition.colors.max } };
|
|
3376
3320
|
}
|
|
3377
3321
|
if (e.condition.kind === "dataBar") {
|
|
3378
3322
|
const a = n.numericRanges[e.id];
|
|
3379
3323
|
if (!a) return {};
|
|
3380
|
-
const o = e.condition.range === "auto" &&
|
|
3324
|
+
const o = e.condition.range === "auto" && St(a.min, 0) > 0 && St(a.max, 0) > 0 ? 0 : a.min, s = xt(
|
|
3381
3325
|
t[e.condition.column],
|
|
3382
3326
|
o,
|
|
3383
3327
|
a.max
|
|
@@ -3392,130 +3336,57 @@ function Za(e, t, n) {
|
|
|
3392
3336
|
} : {};
|
|
3393
3337
|
}
|
|
3394
3338
|
return {
|
|
3395
|
-
cellStyle:
|
|
3396
|
-
|
|
3397
|
-
(
|
|
3339
|
+
cellStyle: hn(
|
|
3340
|
+
ja(e.style),
|
|
3341
|
+
(r = e.style) != null && r.textColor ? { color: e.style.textColor } : void 0
|
|
3398
3342
|
),
|
|
3399
|
-
overlay: (
|
|
3343
|
+
overlay: (i = e.style) != null && i.icon ? {
|
|
3400
3344
|
kind: "icon",
|
|
3401
3345
|
icon: e.style.icon
|
|
3402
3346
|
} : void 0
|
|
3403
3347
|
};
|
|
3404
3348
|
}
|
|
3405
|
-
function
|
|
3349
|
+
function Ja(e) {
|
|
3406
3350
|
const t = {
|
|
3407
3351
|
matchedRuleIds: []
|
|
3408
3352
|
};
|
|
3409
3353
|
for (const n of e.rules) {
|
|
3410
|
-
if (n.target.matrix !== void 0 || n.enabled === !1 || !
|
|
3354
|
+
if (n.target.matrix !== void 0 || n.enabled === !1 || !Ha(n, e.tablePart) || !Qa(n, e.columnKey) || !Wa(n.condition, e.row, e.range, n.id))
|
|
3411
3355
|
continue;
|
|
3412
|
-
const
|
|
3413
|
-
t[
|
|
3414
|
-
t[
|
|
3415
|
-
|
|
3416
|
-
),
|
|
3356
|
+
const r = Ya(n, e.row, e.range), i = n.target.level === "row" ? "rowStyle" : "cellStyle";
|
|
3357
|
+
t[i] = hn(
|
|
3358
|
+
t[i],
|
|
3359
|
+
r.cellStyle
|
|
3360
|
+
), r.overlay && (t.overlay = r.overlay), t.matchedRuleIds.push(n.id);
|
|
3417
3361
|
}
|
|
3418
3362
|
return t;
|
|
3419
3363
|
}
|
|
3420
|
-
function Pe(e) {
|
|
3421
|
-
switch (e.kind) {
|
|
3422
|
-
case "field":
|
|
3423
|
-
return `field:${e.fieldId}`;
|
|
3424
|
-
case "result":
|
|
3425
|
-
return `result:${e.key}`;
|
|
3426
|
-
case "sqlKpiValue":
|
|
3427
|
-
return "sqlKpiValue";
|
|
3428
|
-
case "matrixMeasure":
|
|
3429
|
-
return `matrixMeasure:${e.measureId}`;
|
|
3430
|
-
case "matrixLevel":
|
|
3431
|
-
return `matrixLevel:${e.levelId}`;
|
|
3432
|
-
case "pivot":
|
|
3433
|
-
return `pivot:${JSON.stringify([e.metricId, e.members.map((t) => [t.fieldId, t.value])])}`;
|
|
3434
|
-
}
|
|
3435
|
-
}
|
|
3436
|
-
function wt(e) {
|
|
3437
|
-
if (e === "sqlKpiValue") return { kind: "sqlKpiValue" };
|
|
3438
|
-
const t = e.indexOf(":");
|
|
3439
|
-
if (t <= 0) return;
|
|
3440
|
-
const n = e.slice(0, t), i = e.slice(t + 1);
|
|
3441
|
-
if (i)
|
|
3442
|
-
switch (n) {
|
|
3443
|
-
case "field":
|
|
3444
|
-
return { kind: "field", fieldId: i };
|
|
3445
|
-
case "result":
|
|
3446
|
-
return { kind: "result", key: i };
|
|
3447
|
-
case "matrixMeasure":
|
|
3448
|
-
return { kind: "matrixMeasure", measureId: i };
|
|
3449
|
-
case "matrixLevel":
|
|
3450
|
-
return { kind: "matrixLevel", levelId: i };
|
|
3451
|
-
case "pivot":
|
|
3452
|
-
try {
|
|
3453
|
-
const [r, a] = JSON.parse(i);
|
|
3454
|
-
return typeof r != "string" || !Array.isArray(a) ? void 0 : { kind: "pivot", metricId: r, members: a.map(([o, s]) => ({ fieldId: o, value: s })) };
|
|
3455
|
-
} catch {
|
|
3456
|
-
return;
|
|
3457
|
-
}
|
|
3458
|
-
default:
|
|
3459
|
-
return;
|
|
3460
|
-
}
|
|
3461
|
-
}
|
|
3462
|
-
function Ge(e, t) {
|
|
3463
|
-
const { columns: n, ...i } = e.target;
|
|
3464
|
-
return {
|
|
3465
|
-
...e,
|
|
3466
|
-
condition: { ...e.condition, column: t(e.condition.column) },
|
|
3467
|
-
target: n ? { ...i, columns: n.map(t) } : i
|
|
3468
|
-
};
|
|
3469
|
-
}
|
|
3470
|
-
function Is(e) {
|
|
3471
|
-
return e.map((t) => Ge(t, Pe));
|
|
3472
|
-
}
|
|
3473
|
-
function xs(e) {
|
|
3474
|
-
return e.flatMap((t) => {
|
|
3475
|
-
var s;
|
|
3476
|
-
const n = wt(t.condition.column);
|
|
3477
|
-
if (!n) return [];
|
|
3478
|
-
const i = Ge(t, (l) => wt(l) ?? null), r = (s = i.target.columns) == null ? void 0 : s.filter((l) => l !== null), { columns: a, ...o } = i.target;
|
|
3479
|
-
return [
|
|
3480
|
-
{
|
|
3481
|
-
...i,
|
|
3482
|
-
condition: { ...i.condition, column: n },
|
|
3483
|
-
target: r ? { ...o, columns: r } : o
|
|
3484
|
-
}
|
|
3485
|
-
];
|
|
3486
|
-
});
|
|
3487
|
-
}
|
|
3488
3364
|
const ae = Object.freeze({}), xe = "value";
|
|
3489
|
-
function
|
|
3365
|
+
function Xa() {
|
|
3490
3366
|
return { numericRanges: {}, topBottom: {}, unavailableRuleIds: /* @__PURE__ */ new Set() };
|
|
3491
3367
|
}
|
|
3492
|
-
function
|
|
3493
|
-
var
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
}
|
|
3498
|
-
function Ss(e, t, n) {
|
|
3499
|
-
const i = Di(e);
|
|
3500
|
-
if (!i.length) return ae;
|
|
3501
|
-
const r = to(e, n);
|
|
3368
|
+
function gs(e, t) {
|
|
3369
|
+
var l;
|
|
3370
|
+
const n = Pr(e);
|
|
3371
|
+
if (!n.length) return ae;
|
|
3372
|
+
const r = (l = Nr(e)) == null ? void 0 : l.value;
|
|
3502
3373
|
if (!r) return ae;
|
|
3503
|
-
const
|
|
3504
|
-
if (!
|
|
3505
|
-
const
|
|
3506
|
-
rules:
|
|
3374
|
+
const i = (c) => ut(c) === ut(r), a = n.filter((c) => i(c.condition.column)).map((c) => kr(c, (u) => i(u) ? xe : ""));
|
|
3375
|
+
if (!a.length) return ae;
|
|
3376
|
+
const o = Ja({
|
|
3377
|
+
rules: a,
|
|
3507
3378
|
row: { [xe]: t },
|
|
3508
3379
|
columnKey: xe,
|
|
3509
|
-
range:
|
|
3380
|
+
range: Xa(),
|
|
3510
3381
|
tablePart: "body"
|
|
3511
|
-
}),
|
|
3512
|
-
return
|
|
3382
|
+
}), s = { ...o.rowStyle, ...o.cellStyle };
|
|
3383
|
+
return s.color || s.backgroundColor ? { ...s.color ? { color: s.color } : {}, ...s.backgroundColor ? { backgroundColor: s.backgroundColor } : {} } : ae;
|
|
3513
3384
|
}
|
|
3514
|
-
function
|
|
3385
|
+
function ys(e, t) {
|
|
3515
3386
|
const n = e.answers.relationshipIds;
|
|
3516
|
-
return !n || !t ? !n && !t : n.length === t.length && n.every((
|
|
3387
|
+
return !n || !t ? !n && !t : n.length === t.length && n.every((r, i) => t[i] === r);
|
|
3517
3388
|
}
|
|
3518
|
-
const
|
|
3389
|
+
const Za = /* @__PURE__ */ new Set([
|
|
3519
3390
|
"dataset_not_reachable",
|
|
3520
3391
|
"field_not_resolvable",
|
|
3521
3392
|
"missing_metadata",
|
|
@@ -3527,15 +3398,15 @@ const no = /* @__PURE__ */ new Set([
|
|
|
3527
3398
|
function V(e) {
|
|
3528
3399
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
3529
3400
|
}
|
|
3530
|
-
function
|
|
3401
|
+
function eo(e) {
|
|
3531
3402
|
if (V(e))
|
|
3532
3403
|
switch (e.status) {
|
|
3533
3404
|
case "applied": {
|
|
3534
|
-
const t =
|
|
3405
|
+
const t = $t(e.route);
|
|
3535
3406
|
return t ? { status: "applied", route: t } : void 0;
|
|
3536
3407
|
}
|
|
3537
3408
|
case "skipped":
|
|
3538
|
-
return typeof e.reason == "string" &&
|
|
3409
|
+
return typeof e.reason == "string" && Za.has(e.reason) ? { status: "skipped", reason: e.reason } : void 0;
|
|
3539
3410
|
case "needsPath":
|
|
3540
3411
|
return { status: "needsPath" };
|
|
3541
3412
|
case "blocked":
|
|
@@ -3548,25 +3419,25 @@ function io(e) {
|
|
|
3548
3419
|
return;
|
|
3549
3420
|
}
|
|
3550
3421
|
}
|
|
3551
|
-
function
|
|
3422
|
+
function vn(e) {
|
|
3552
3423
|
if (e !== void 0)
|
|
3553
3424
|
return Array.isArray(e) && e.length > 0 && e.every((t) => typeof t == "string" && t.length > 0) ? e : null;
|
|
3554
3425
|
}
|
|
3555
|
-
function
|
|
3426
|
+
function to(e) {
|
|
3556
3427
|
if (!V(e)) return;
|
|
3557
|
-
const t =
|
|
3558
|
-
if (!(!t || !V(n) || n.kind !== "relationship" || !V(n.field) || typeof n.field.name != "string" || !V(n.field.source) || n.field.source.kind !== "semantic" || !
|
|
3428
|
+
const t = $t(e.route), n = e.target;
|
|
3429
|
+
if (!(!t || !V(n) || n.kind !== "relationship" || !V(n.field) || typeof n.field.name != "string" || !V(n.field.source) || n.field.source.kind !== "semantic" || !vn(n.relationshipIds)))
|
|
3559
3430
|
return { route: t, target: n };
|
|
3560
3431
|
}
|
|
3561
|
-
function
|
|
3432
|
+
function hs(e) {
|
|
3562
3433
|
if (!V(e) || !Array.isArray(e.previews)) return { previews: [] };
|
|
3563
3434
|
const t = [];
|
|
3564
|
-
for (const
|
|
3565
|
-
if (!V(
|
|
3566
|
-
const
|
|
3567
|
-
|
|
3568
|
-
cardId:
|
|
3569
|
-
answers:
|
|
3435
|
+
for (const r of e.previews) {
|
|
3436
|
+
if (!V(r) || typeof r.cardId != "string" || !r.cardId || !V(r.answers)) continue;
|
|
3437
|
+
const i = vn(r.answers.relationshipIds), a = eo(r.outcome), o = Array.isArray(r.paths) ? r.paths.map(to) : [];
|
|
3438
|
+
i === null || !a || !o.every(Boolean) || a.status === "needsPath" && o.length < 2 || t.push({
|
|
3439
|
+
cardId: r.cardId,
|
|
3440
|
+
answers: i ? { relationshipIds: i } : {},
|
|
3570
3441
|
outcome: a,
|
|
3571
3442
|
paths: o
|
|
3572
3443
|
});
|
|
@@ -3575,18 +3446,18 @@ function ws(e) {
|
|
|
3575
3446
|
return { previews: t, ...n ? { manageRelationships: n } : {} };
|
|
3576
3447
|
}
|
|
3577
3448
|
const se = (e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.name) || "";
|
|
3578
|
-
function
|
|
3449
|
+
function no(e) {
|
|
3579
3450
|
return !e || /s$/i.test(e) ? e : /[^aeiou]y$/i.test(e) ? `${e.slice(0, -1)}ies` : `${e}s`;
|
|
3580
3451
|
}
|
|
3581
|
-
function
|
|
3452
|
+
function bs(e) {
|
|
3582
3453
|
if (e.direction === "to_many") {
|
|
3583
3454
|
const n = se(e.matchingDataset ?? e.datasets[e.datasets.length - 1]);
|
|
3584
|
-
return `${e.base ?
|
|
3455
|
+
return `${e.base ? no(se(e.base)) : "Rows"} with at least one matching ${n}`;
|
|
3585
3456
|
}
|
|
3586
3457
|
return `through ${(e.datasets.length > 1 ? e.datasets.slice(0, -1) : e.datasets).map(se).join(", ")}`;
|
|
3587
3458
|
}
|
|
3588
|
-
const
|
|
3589
|
-
function
|
|
3459
|
+
const vs = "The relationship this card used changed; choose it again";
|
|
3460
|
+
function Fs(e, t) {
|
|
3590
3461
|
switch (e) {
|
|
3591
3462
|
case "relationship_missing":
|
|
3592
3463
|
return t ? `Not related to ${se(t)}` : "Not related to this card";
|
|
@@ -3604,135 +3475,122 @@ function Ms(e, t) {
|
|
|
3604
3475
|
}
|
|
3605
3476
|
}
|
|
3606
3477
|
export {
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
Jr as n,
|
|
3726
|
-
Jo as o,
|
|
3727
|
-
Qr as p,
|
|
3728
|
-
Ka as q,
|
|
3729
|
-
us as r,
|
|
3730
|
-
La as s,
|
|
3731
|
-
Ba as t,
|
|
3732
|
-
gs as u,
|
|
3733
|
-
xt as v,
|
|
3734
|
-
ys as w,
|
|
3735
|
-
hs as x,
|
|
3736
|
-
Xa as y,
|
|
3737
|
-
Pe as z
|
|
3478
|
+
Le as $,
|
|
3479
|
+
ys as A,
|
|
3480
|
+
hs as B,
|
|
3481
|
+
no as C,
|
|
3482
|
+
Fo as D,
|
|
3483
|
+
bs as E,
|
|
3484
|
+
Fs as F,
|
|
3485
|
+
ze as G,
|
|
3486
|
+
Bi as H,
|
|
3487
|
+
pi as I,
|
|
3488
|
+
gi as J,
|
|
3489
|
+
pe as K,
|
|
3490
|
+
wo as L,
|
|
3491
|
+
Ho as M,
|
|
3492
|
+
Qi as N,
|
|
3493
|
+
Go as O,
|
|
3494
|
+
Q as P,
|
|
3495
|
+
So as Q,
|
|
3496
|
+
vs as R,
|
|
3497
|
+
ue as S,
|
|
3498
|
+
Zi as T,
|
|
3499
|
+
ea as U,
|
|
3500
|
+
jo as V,
|
|
3501
|
+
Yo as W,
|
|
3502
|
+
fi as X,
|
|
3503
|
+
ui as Y,
|
|
3504
|
+
di as Z,
|
|
3505
|
+
qo as _,
|
|
3506
|
+
Jo as a,
|
|
3507
|
+
Do as a$,
|
|
3508
|
+
Po as a0,
|
|
3509
|
+
Eo as a1,
|
|
3510
|
+
Ko as a2,
|
|
3511
|
+
Vo as a3,
|
|
3512
|
+
Ve as a4,
|
|
3513
|
+
Ni as a5,
|
|
3514
|
+
Ro as a6,
|
|
3515
|
+
Lo as a7,
|
|
3516
|
+
Ii as a8,
|
|
3517
|
+
Ri as a9,
|
|
3518
|
+
de as aA,
|
|
3519
|
+
ne as aB,
|
|
3520
|
+
xo as aC,
|
|
3521
|
+
_o as aD,
|
|
3522
|
+
ra as aE,
|
|
3523
|
+
os as aF,
|
|
3524
|
+
yn as aG,
|
|
3525
|
+
ts as aH,
|
|
3526
|
+
Ma as aI,
|
|
3527
|
+
te as aJ,
|
|
3528
|
+
Ue as aK,
|
|
3529
|
+
Xo as aL,
|
|
3530
|
+
ns as aM,
|
|
3531
|
+
Zo as aN,
|
|
3532
|
+
Sa as aO,
|
|
3533
|
+
_a as aP,
|
|
3534
|
+
as as aQ,
|
|
3535
|
+
is as aR,
|
|
3536
|
+
es as aS,
|
|
3537
|
+
wa as aT,
|
|
3538
|
+
Wo as aU,
|
|
3539
|
+
Ji as aV,
|
|
3540
|
+
Pi as aW,
|
|
3541
|
+
ss as aX,
|
|
3542
|
+
Ct as aY,
|
|
3543
|
+
Aa as aZ,
|
|
3544
|
+
ee as a_,
|
|
3545
|
+
Ei as aa,
|
|
3546
|
+
Bo as ab,
|
|
3547
|
+
E as ac,
|
|
3548
|
+
Me as ad,
|
|
3549
|
+
ki as ae,
|
|
3550
|
+
No as af,
|
|
3551
|
+
ko as ag,
|
|
3552
|
+
Ao as ah,
|
|
3553
|
+
tn as ai,
|
|
3554
|
+
ds as aj,
|
|
3555
|
+
hn as ak,
|
|
3556
|
+
ja as al,
|
|
3557
|
+
fs as am,
|
|
3558
|
+
ms as an,
|
|
3559
|
+
qa as ao,
|
|
3560
|
+
St as ap,
|
|
3561
|
+
ps as aq,
|
|
3562
|
+
To as ar,
|
|
3563
|
+
qi as as,
|
|
3564
|
+
li as at,
|
|
3565
|
+
Io as au,
|
|
3566
|
+
Ut as av,
|
|
3567
|
+
yi as aw,
|
|
3568
|
+
Ee as ax,
|
|
3569
|
+
Mo as ay,
|
|
3570
|
+
Oo as az,
|
|
3571
|
+
Qo as b,
|
|
3572
|
+
zo as c,
|
|
3573
|
+
Oa as d,
|
|
3574
|
+
ia as e,
|
|
3575
|
+
aa as f,
|
|
3576
|
+
Co as g,
|
|
3577
|
+
oi as h,
|
|
3578
|
+
$i as i,
|
|
3579
|
+
zi as j,
|
|
3580
|
+
ji as k,
|
|
3581
|
+
$o as l,
|
|
3582
|
+
Gi as m,
|
|
3583
|
+
Wi as n,
|
|
3584
|
+
Uo as o,
|
|
3585
|
+
Hi as p,
|
|
3586
|
+
Ea as q,
|
|
3587
|
+
rs as r,
|
|
3588
|
+
Va as s,
|
|
3589
|
+
Ka as t,
|
|
3590
|
+
cs as u,
|
|
3591
|
+
It as v,
|
|
3592
|
+
ls as w,
|
|
3593
|
+
us as x,
|
|
3594
|
+
Ja as y,
|
|
3595
|
+
gs as z
|
|
3738
3596
|
};
|