react-semaphor 0.1.572 → 0.1.574
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/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +62 -59
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{model-change-T1cRkh3m.js → add-to-dashboard-B6Ah8Lub.js} +121 -84
- package/dist/chunks/{assistant-chat-DF1-q82n.js → assistant-chat-D95DtCj7.js} +2411 -2313
- package/dist/chunks/{bookmark-impact-fdj8fY9i.js → bookmark-impact-DUWw3wlA.js} +1 -1
- package/dist/chunks/{card-filter-builder-BFT21WI-.js → card-filter-builder-B3bEPylu.js} +54 -54
- package/dist/chunks/{dashboard-jUhZ7T4f.js → dashboard-DdALjmc3.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DDXzTYuA.js → dashboard-briefing-launcher-D2vevpyl.js} +82 -82
- package/dist/chunks/{dashboard-controls-BwKQEoGp.js → dashboard-controls-DxrsGK9A.js} +7 -7
- package/dist/chunks/{dashboard-json-B3fR1_Oc.js → dashboard-json-rwds0HjB.js} +1 -1
- package/dist/chunks/{dates-DKkSDWHe.js → dates-DlYMDaF2.js} +4 -4
- package/dist/chunks/{edit-dashboard-visual-DGZABdS-.js → edit-dashboard-visual-BCDz5HOb.js} +1354 -1317
- package/dist/chunks/{filter-reach-copy-CWHV7GSb.js → filter-reach-copy-BTAXnbwQ.js} +2 -2
- package/dist/chunks/{index-CeeY4wjE.js → index-8BxDk8EP.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-R3EGbxfu.js → report-preferences-dialog-D9nBczmk.js} +7 -7
- package/dist/chunks/{resolve-dashboard-input-context-CBQF3obr.js → resolve-dashboard-input-context-DBFuNhZo.js} +3961 -3923
- package/dist/chunks/{saved-dashboard-context-_-7LKeK1.js → saved-dashboard-context-AChHk4tw.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-CEbA4CFb.js → semaphor-ready-indicator-BdOAS4Uw.js} +23554 -23073
- package/dist/chunks/{shelf-drop-preview-context-UqUUVSJq.js → shelf-drop-preview-context-B1goDUYE.js} +2 -2
- package/dist/chunks/{stored-dashboard-Bk3iCXtp.js → stored-dashboard-rpLzf4mk.js} +112 -112
- package/dist/chunks/{variable-draft-ggS3X7FG.js → variable-draft-DPSMDwqt.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +1381 -1368
- package/dist/index.js +11 -11
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/dashboard/summary-card.d.ts +5 -0
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +12 -0
- package/dist/types/lib/types/explorer-types.d.ts +6 -0
- package/dist/types/shared/assistant-protocol/model-change.d.ts +52 -1
- package/dist/types/shared/assistant-protocol/parts.d.ts +49 -2
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +38 -0
- package/dist/types/shared/usage-events/attribution.d.ts +46 -0
- package/dist/types/shared/usage-events/catalog.d.ts +15 -0
- package/dist/types/shared/usage-events/index.d.ts +6 -0
- package/dist/types/usage-events.d.ts +2 -0
- package/dist/usage-events/index.js +32 -0
- package/package.json +5 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
var _s = Object.defineProperty;
|
|
2
2
|
var Cs = (e, a, t) => a in e ? _s(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
3
|
var lt = (e, a, t) => Cs(e, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
-
import { _ as $s, $ as ws, a0 as xs, a1 as Ss, a2 as ks, a3 as qa, a4 as $e, a5 as Ts, a6 as he, a7 as Ee, a8 as la, a9 as ot, aa as Na, ab as Q, ac as G, ad as qe, ae as
|
|
5
|
-
import {
|
|
6
|
-
import { K as
|
|
7
|
-
import { ae as
|
|
8
|
-
import { L as
|
|
9
|
-
import { r as
|
|
10
|
-
import { aF as
|
|
11
|
-
import { f as
|
|
12
|
-
import { p as
|
|
13
|
-
import { r as Ha, D as Ia, f as
|
|
14
|
-
import { N as
|
|
15
|
-
import { a7 as Ya, r as Ja, aN as
|
|
4
|
+
import { _ as $s, $ as ws, a0 as xs, a1 as Ss, a2 as ks, a3 as qa, a4 as $e, a5 as Ts, a6 as he, a7 as Ee, a8 as la, a9 as ot, aa as Na, ab as Q, ac as G, ad as qe, ae as Rs, af as Fs, ag as At, ah as As, ai as Ds, aj as Os, ak as Es, al as qs, am as Pa, an as Ns, ao as Ps, ap as Ls, aq as Ms, ar as Bs, as as Vs, at as js, au as ca, av as La, aw as ua, ax as Ce, ay as be, az as Ne, aA as Ks, aB as Ws, aC as Us, o as Xe, aD as Gs, aE as Qs, aF as _t, aG as Ze, aH as Hs, aI as zs, aJ as Ma, aK as Dt, aL as Ct, aM as Ys, aN as Js, aO as Xs, aP as ie, aQ as Ba, aR as Va, aS as ct, aT as Zs, aU as eo, aV as fa, aW as $t, aX as to, aY as ma, aZ as ao, a_ as ha, a$ as pa, b0 as et, b1 as ga, b2 as Ae, b3 as so, b4 as He, m as oo, b5 as ja, b6 as no, b7 as io, b8 as ro, b9 as Ka, a as lo, ba as co, bb as uo, bc as fo, bd as mo, be as ho, bf as po, bg as go, bh as bo, bi as yo, bj as vo, bk as Io, bl as ba, bm as _o, bn as Co, bo as $o, bp as wo, bq as xo, br as So, bs as ko, bt as To, bu as Ro, bv as Fo, bw as Ao, bx as Do } from "../chunks/resolve-dashboard-input-context-DBFuNhZo.js";
|
|
5
|
+
import { dB as Br, bP as Vr, dd as jr, de as Kr, dt as Wr, ds as Ur, dm as Gr, eq as Qr, du as Hr, dv as zr, cT as Yr, cU as Jr, cV as Xr, cQ as Zr, cR as ed, cS as td, cM as ad, cN as sd, cP as od, cO as nd, cW as id, dS as rd, df as dd, cb as ld, dW as cd, ca as ud, d7 as fd, dD as md, ck as hd, es as pd, eu as gd, c1 as bd, dV as yd, dG as vd, dX as Id, eN as _d, eR as Cd, dq as $d, dr as wd, ch as xd, bL as Sd, eI as kd, dF as Td, cn as Rd, dM as Fd, cg as Ad, eY as Dd, eZ as Od, ef as Ed, dE as qd, eA as Nd, f1 as Pd, cE as Ld, eS as Md, dl as Bd, ci as Vd, e3 as jd, e4 as Kd, cX as Wd, cF as Ud, dU as Gd, bF as Qd, ed as Hd, dI as zd, eB as Yd, bG as Jd, bO as Xd, d_ as Zd, cz as el, e$ as tl, eg as al, dL as sl, ee as ol, d6 as nl, d5 as il, cf as rl, dT as dl, bZ as ll, c3 as cl, dR as ul, cw as fl, bD as ml, eT as hl, co as pl, e9 as gl, bH as bl, eh as yl, eJ as vl, dz as Il, dA as _l, f2 as Cl, f3 as $l, f5 as wl, b_ as xl, b$ as Sl, c0 as kl, cj as Tl, cl as Rl, e_ as Fl, en as Al, da as Dl, f as Ol, cL as El, c8 as ql, ct as Nl, b as Pl, cI as Ll, db as Ml, bR as Bl, bS as Vl, dK as jl, c7 as Kl, e0 as Wl, cp as Ul, by as Gl, cc as Ql, dn as Hl, bV as zl, dy as Yl, c2 as Jl, d1 as Xl, f4 as Zl, bM as ec, d3 as tc, e1 as ac, d4 as sc, e5 as oc, ew as nc, ev as ic, dO as rc, cB as dc, cs as lc, cu as cc, l as uc, cv as fc, el as mc, dw as hc, dJ as pc, bz as gc, bA as bc, bB as yc, bI as vc, eP as Ic, eK as _c, dC as Cc, eL as $c, cy as wc, cd as xc, cH as Sc, dx as kc, ek as Tc, d8 as Rc, d9 as Fc, bQ as Ac, f0 as Dc, dH as Oc, ei as Ec, dc as qc, ez as Nc, J as Pc, eO as Lc, c6 as Mc, eU as Bc, eV as Vc, dj as jc, cK as Kc, bU as Wc, dN as Uc, bC as Gc, cC as Qc, cD as Hc, ce as zc, cZ as Yc, bY as Jc, c4 as Xc, c5 as Zc, dg as eu, dh as tu, c9 as au, bJ as su, bX as ou, c$ as nu, et as iu, ep as ru, eW as du, d0 as lu, c_ as cu, bT as uu, er as fu, cA as mu, eo as hu, cJ as pu, e2 as gu, di as bu, cx as yu, dp as vu, bE as Iu, bW as _u, dP as Cu, ey as $u, d$ as wu, cG as xu, d2 as Su, bN as ku, dQ as Tu, dZ as Ru, dY as Fu, em as Au, ex as Du, cm as Ou, cr as Eu, bK as qu, eQ as Nu, eM as Pu, eX as Lu, cY as Mu, ej as Bu, ec as Vu, dk as ju, eb as Ku, eD as Wu, e8 as Uu, ea as Gu, cq as Qu, e6 as Hu, e7 as zu, eC as Yu, eE as Ju, eF as Xu, eG as Zu, eH as ef } from "../chunks/resolve-dashboard-input-context-DBFuNhZo.js";
|
|
6
|
+
import { K as Oo, L as Wa, G as Ua, M as Eo, N as qo, O as Ot, P as Ga, Q as Qa, A as we, R as No, S as Po, H as Lo, T as Mo } from "../chunks/bookmark-state-BEl_G9vr.js";
|
|
7
|
+
import { ae as af, ay as sf, Y as of, Z as nf, a8 as rf, ac as df, a9 as lf, aa as cf, ab as uf, af as ff, aw as mf, aq as hf, D as pf, au as gf, F as bf, a1 as yf, I as vf, ax as If, a4 as _f, a5 as Cf, as as $f, ad as wf, a2 as xf, ao as Sf, at as kf, av as Tf, ap as Rf, ar as Ff, a0 as Af, _ as Df, ah as Of, am as Ef, W as qf, X as Nf, U as Pf, a3 as Lf, an as Mf, az as Bf, ai as Vf, ag as jf, aj as Kf, ak as Wf, al as Uf, a7 as Gf, a6 as Qf, $ as Hf } from "../chunks/bookmark-state-BEl_G9vr.js";
|
|
8
|
+
import { L as Yf, G as Jf, H as Xf, g as Zf, F as em, q as tm, A as am, D as sm, u as om, v as nm, E as im, C as rm, s as dm, t as lm, p as cm, B as um, I as fm, w as mm, y as hm, x as pm, z as gm } from "../chunks/stored-dashboard-rpLzf4mk.js";
|
|
9
|
+
import { r as Bo, a4 as ya, aC as Vo } from "../chunks/temporal-input-presentation-CqbJjIuu.js";
|
|
10
|
+
import { aF as ym, aE as vm, az as Im, aD as _m, aG as Cm, at as $m } from "../chunks/temporal-input-presentation-CqbJjIuu.js";
|
|
11
|
+
import { f as jo, w as Ko, D as va, r as Wo } from "../chunks/metric-comparison-n9NsIa-2.js";
|
|
12
|
+
import { p as Uo } from "../chunks/report-runtime-context-BhPzLTbS.js";
|
|
13
|
+
import { r as Ha, D as Ia, f as Go, h as za, i as Qo, j as Ho, k as zo, e as wt, l as Yo, v as Jo } from "../chunks/filter-reach-copy-BTAXnbwQ.js";
|
|
14
|
+
import { N as xm, R as Sm, n as km, q as Tm, u as Rm, t as Fm, F as Am, B as Dm, m as Om, p as Em, I as qm, O as Nm, P as Pm, C as Lm, K as Mm, E as Bm, w as Vm, x as jm, z as Km, o as Wm, y as Um, Q as Gm, M as Qm, L as Hm, G as zm, H as Ym, s as Jm, J as Xm, A as Zm } from "../chunks/filter-reach-copy-BTAXnbwQ.js";
|
|
15
|
+
import { a7 as Ya, r as Ja, aN as Xo, a_ as Pe, aL as Zo, aQ as en, aK as tn, aE as an, aM as sn, a5 as on } from "../chunks/validators-B8fpdinG.js";
|
|
16
16
|
import "../chunks/schema-C9NPiIru.js";
|
|
17
|
-
import { i as Xa, C as je, D as
|
|
17
|
+
import { i as Xa, C as je, D as nn, e as rn, b as dn } from "../chunks/edit-9df1zOWe.js";
|
|
18
18
|
import "../chunks/matrix-operation-contract-DCVinw1o.js";
|
|
19
|
-
import { A as Me, B as ze, z as
|
|
20
|
-
import { y as _a, C as
|
|
19
|
+
import { A as Me, B as ze, z as ln, f as cn, y as Et, t as xe, e as un } from "../chunks/analytics-base-schemas-BaIQrEzX.js";
|
|
20
|
+
import { y as _a, C as fn } from "../chunks/matrix-analytical-definition-dkS8szLM.js";
|
|
21
21
|
import "zod";
|
|
22
22
|
import "../value-format-preferences/index.js";
|
|
23
|
-
import { C as
|
|
24
|
-
import { r as
|
|
23
|
+
import { C as th, a as ah, S as sh } from "../chunks/pickers-DkqmtnTL.js";
|
|
24
|
+
import { r as mn } from "../chunks/index-CV_Kzou0.js";
|
|
25
25
|
import "../chunks/context-R31TSL5V.js";
|
|
26
|
-
import { v as Ye, a as
|
|
27
|
-
import { S as
|
|
28
|
-
import { r as
|
|
29
|
-
import { b as
|
|
30
|
-
import { r as ye, b as
|
|
31
|
-
import { n as
|
|
32
|
-
import { e as
|
|
33
|
-
const
|
|
26
|
+
import { v as Ye, a as hn, i as Ca, o as ut, d as pn, b as gn, c as bn } from "../chunks/variable-draft-DPSMDwqt.js";
|
|
27
|
+
import { S as nh, f as ih, g as rh, e as dh, n as lh } from "../chunks/variable-draft-DPSMDwqt.js";
|
|
28
|
+
import { r as uh, a as fh } from "../chunks/dates-DlYMDaF2.js";
|
|
29
|
+
import { b as hh, d as ph } from "../chunks/bookmark-impact-DUWw3wlA.js";
|
|
30
|
+
import { r as ye, b as yn, s as vn, a as In } from "../chunks/resolver-DG_tfEpt.js";
|
|
31
|
+
import { n as _n, r as Cn } from "../chunks/index-BVKzKl5d.js";
|
|
32
|
+
import { e as bh } from "../chunks/brand-BoUV0iHF.js";
|
|
33
|
+
const Sr = [
|
|
34
34
|
"cardType",
|
|
35
35
|
"sql",
|
|
36
36
|
"python",
|
|
@@ -46,7 +46,7 @@ const xr = [
|
|
|
46
46
|
"globalDateComparison",
|
|
47
47
|
"calendarContext",
|
|
48
48
|
"sqlRowLimit"
|
|
49
|
-
],
|
|
49
|
+
], kr = [
|
|
50
50
|
"cardId",
|
|
51
51
|
"cardTitle",
|
|
52
52
|
"cache_config",
|
|
@@ -70,10 +70,10 @@ function ve(e) {
|
|
|
70
70
|
function Ke(e) {
|
|
71
71
|
return typeof e == "string" ? e : "";
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function $n(e, a = {}) {
|
|
74
74
|
const t = ve(e), s = qt(a), n = {};
|
|
75
75
|
if (t.calendarContext !== void 0) {
|
|
76
|
-
const i =
|
|
76
|
+
const i = Uo(t.calendarContext);
|
|
77
77
|
if (!i.ok)
|
|
78
78
|
throw new ce(
|
|
79
79
|
`${s}calendarContext: ${i.issues.map((d) => d.message).join("; ")}`,
|
|
@@ -90,20 +90,20 @@ function Cn(e, a = {}) {
|
|
|
90
90
|
o.issues
|
|
91
91
|
);
|
|
92
92
|
if (t.resolvedPrimaryDateField && (n.resolvedPrimaryDateField = t.resolvedPrimaryDateField), t.globalDateComparison !== void 0) {
|
|
93
|
-
const i =
|
|
93
|
+
const i = jo(t.globalDateComparison);
|
|
94
94
|
if (!i.ok)
|
|
95
95
|
throw new ce(
|
|
96
96
|
`${s}Invalid globalDateComparison: ${i.errors.map((d) => `${d.path}: ${d.message}`).join("; ")}`,
|
|
97
97
|
"globalDateComparison",
|
|
98
98
|
i.errors
|
|
99
99
|
);
|
|
100
|
-
n.globalDateComparison =
|
|
100
|
+
n.globalDateComparison = Ko(
|
|
101
101
|
t.globalDateComparison
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
104
|
return n;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Tr(e, a = {}) {
|
|
107
107
|
const t = ve(e), s = qt(a), n = {};
|
|
108
108
|
if (t.pagination !== void 0) {
|
|
109
109
|
const o = ve(t.pagination), i = o.page, d = o.pageSize;
|
|
@@ -135,7 +135,7 @@ function kr(e, a = {}) {
|
|
|
135
135
|
}
|
|
136
136
|
return n;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Rr(e, a = {}) {
|
|
139
139
|
const t = ve(e), s = qt(a), n = (x) => new ce(`${s}${x} is required`, x), o = Ke(t.connection_id).trim();
|
|
140
140
|
if (!o) throw n("connection_id");
|
|
141
141
|
const i = Ke(t.cardType).trim();
|
|
@@ -146,19 +146,19 @@ function Tr(e, a = {}) {
|
|
|
146
146
|
const l = ve(t.cardConfig), c = Ke(t.sql), h = Ke(t.python), p = !!a.configOptional || Object.keys(l).length > 0;
|
|
147
147
|
if (d === "config" && !p) throw n("cardConfig");
|
|
148
148
|
if (d === "freeform" && !c.trim()) throw n("sql");
|
|
149
|
-
const
|
|
149
|
+
const v = xs({
|
|
150
150
|
hasExecutableConfig: p,
|
|
151
151
|
sql: c,
|
|
152
152
|
normalizedPython: h
|
|
153
153
|
});
|
|
154
|
-
if (d !==
|
|
154
|
+
if (d !== v)
|
|
155
155
|
throw new ce(
|
|
156
|
-
`${s}resultOwner must match the normalized execution owner "${
|
|
156
|
+
`${s}resultOwner must match the normalized execution owner "${v}"`,
|
|
157
157
|
"resultOwner"
|
|
158
158
|
);
|
|
159
159
|
if (d === "none") throw n("cardConfig");
|
|
160
|
-
const
|
|
161
|
-
if (Object.keys(
|
|
160
|
+
const I = ve(t.cardDataSource);
|
|
161
|
+
if (Object.keys(I).length === 0) throw n("cardDataSource");
|
|
162
162
|
const w = Ss({
|
|
163
163
|
controlValues: t.controlValues,
|
|
164
164
|
controlDefinitions: t.controlDefinitions,
|
|
@@ -172,17 +172,17 @@ function Tr(e, a = {}) {
|
|
|
172
172
|
python: h,
|
|
173
173
|
resultOwner: d,
|
|
174
174
|
cardConfig: l,
|
|
175
|
-
cardDataSource:
|
|
175
|
+
cardDataSource: I,
|
|
176
176
|
active_filters: Array.isArray(t.active_filters) ? t.active_filters : [],
|
|
177
177
|
controlValues: w.controlValues,
|
|
178
178
|
controlDefinitions: w.controlDefinitions,
|
|
179
179
|
cardControlDefinitions: w.cardControlDefinitions,
|
|
180
180
|
controlBindings: w.controlBindings,
|
|
181
|
-
|
|
181
|
+
...$n(t, a),
|
|
182
182
|
...typeof t.sqlRowLimit == "number" && Number.isInteger(t.sqlRowLimit) && t.sqlRowLimit > 0 ? { sqlRowLimit: t.sqlRowLimit } : {}
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
const ft = ["#14b8a6", "#5eead4", "#374151", "#6b7280", "#d1d5db"],
|
|
185
|
+
const ft = ["#14b8a6", "#5eead4", "#374151", "#6b7280", "#d1d5db"], wn = ["spacing", "canvasPadding", "canvas", "cardCorners", "chartColors"], Za = ["light", "dark"];
|
|
186
186
|
function Fr(e) {
|
|
187
187
|
const a = [], t = ht(e.globalStyle) ? e.globalStyle : {}, s = ht(t.default) ? t.default : {}, n = ht(t.dark) ? t.dark : {}, o = (p) => ye(n, p) ?? ye(s, p), i = {}, d = o(["gridLayout", "margin"]);
|
|
188
188
|
Array.isArray(d) && typeof d[1] == "number" && (i.spacing = De("spacing", d[1], a), i.canvasPadding = De("canvasPadding", d[1], a));
|
|
@@ -193,34 +193,34 @@ function Fr(e) {
|
|
|
193
193
|
const h = o(["chart", "options", "borderRadius"]);
|
|
194
194
|
typeof h == "number" && (i.barCorners = De("barCorners", h, a));
|
|
195
195
|
for (const p of Za) {
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const w =
|
|
196
|
+
const v = p === "light" ? ye(s, ["canvasTheme"]) : o(["canvasTheme"]), I = kn(v, a);
|
|
197
|
+
I !== void 0 && (i.canvas = { ...i.canvas, [p]: I });
|
|
198
|
+
const w = Sn(s, n, p);
|
|
199
199
|
if (w) {
|
|
200
|
-
const x = w.filter(Xa).map((
|
|
200
|
+
const x = w.filter(Xa).map((E) => E.toLowerCase());
|
|
201
201
|
x.length < w.length && a.push({ field: "chartColors", kind: "dropped_colour", detail: `${p}: ${w.length - x.length} colours that aren't hex` }), x.length >= je.min && (i.chartColors = { ...i.chartColors, [p]: x.slice(0, je.max) }), x.length > je.max && a.push({ field: "chartColors", kind: "clamped", detail: `${p}: kept the first ${je.max} colours` });
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
return { style:
|
|
204
|
+
return { style: xn(i, e.organizationAppearance, a), notes: a };
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
const s =
|
|
206
|
+
function xn(e, a, t) {
|
|
207
|
+
const s = yn({ organizationAppearance: a ? _n(a).spec : null }), n = { ...e };
|
|
208
208
|
for (const o of Object.keys(e)) {
|
|
209
|
-
const i =
|
|
209
|
+
const i = In[o], d = o === "canvas" || o === "chartColors";
|
|
210
210
|
for (const l of Za) {
|
|
211
|
-
const c =
|
|
211
|
+
const c = vn(n, o, l);
|
|
212
212
|
if (c === void 0) continue;
|
|
213
|
-
const h =
|
|
213
|
+
const h = wn.includes(o) && ye(Cn(a, l), i) !== void 0, p = JSON.stringify(ye(s.schemes[l], i)) === JSON.stringify(c);
|
|
214
214
|
if (!(!h && !p))
|
|
215
215
|
if ((d || l === "light") && t.push({ field: o, kind: h ? "brand_wins" : "equal_to_inherited", detail: d ? l : `${JSON.stringify(c)}` }), d) {
|
|
216
|
-
const
|
|
217
|
-
delete
|
|
216
|
+
const v = { ...n[o] };
|
|
217
|
+
delete v[l], Object.keys(v).length > 0 ? n[o] = v : delete n[o];
|
|
218
218
|
} else l === "light" && delete n[o];
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
return Object.keys(n).length > 0 ? n : void 0;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function Sn(e, a, t) {
|
|
224
224
|
const s = ye(e, ["chart", "dataset", "backgroundColor"]), n = ye(a, ["chart", "dataset", "backgroundColor"]), o = mt(ft, s);
|
|
225
225
|
if (t === "light") return Array.isArray(s) ? o : void 0;
|
|
226
226
|
const i = mt(o, mt(ft, n));
|
|
@@ -232,7 +232,7 @@ function mt(e, a) {
|
|
|
232
232
|
const t = Math.max(e.length, a.length);
|
|
233
233
|
return Array.from({ length: t }, (s, n) => a[n] !== void 0 ? String(a[n]) : e[n]);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function kn(e, a) {
|
|
236
236
|
if (!(e == null || e === "")) {
|
|
237
237
|
if (e === "muted") return "muted";
|
|
238
238
|
if (e === "clear") return "background";
|
|
@@ -241,7 +241,7 @@ function Sn(e, a) {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
function De(e, a, t) {
|
|
244
|
-
const { min: s, max: n } =
|
|
244
|
+
const { min: s, max: n } = nn[e], o = Math.min(n, Math.max(s, Math.round(a)));
|
|
245
245
|
return o !== a && t.push({ field: e, kind: "clamped", detail: `${a} → ${o}` }), o;
|
|
246
246
|
}
|
|
247
247
|
function ht(e) {
|
|
@@ -258,21 +258,21 @@ const pt = {
|
|
|
258
258
|
chartColors: (e, a) => a.chartColors = e,
|
|
259
259
|
barCorners: (e, a) => a.barCorners = e
|
|
260
260
|
};
|
|
261
|
-
function
|
|
261
|
+
function Tn(e) {
|
|
262
262
|
var t;
|
|
263
263
|
const a = {};
|
|
264
264
|
for (const [s, n] of Object.entries(e ?? {}))
|
|
265
265
|
n !== void 0 && ((t = pt[s]) == null || t.call(pt, n, a));
|
|
266
266
|
return a;
|
|
267
267
|
}
|
|
268
|
-
const
|
|
268
|
+
const Rn = {
|
|
269
269
|
global_date: "The date filter for the whole report can't be changed through the MCP. Change it in the editor; removing or excluding it works.",
|
|
270
270
|
not_semantic: "This filter reads a database table, not a dataset, so it can't be changed through the MCP. Change it in the editor; removing or excluding it works.",
|
|
271
271
|
scope_not_expressible: "This filter applies to chosen cards rather than whole sheets, so it can't be changed through the MCP. Change it in the editor; removing or excluding it works."
|
|
272
272
|
};
|
|
273
273
|
function Fn(e, a, t = {}) {
|
|
274
274
|
var d;
|
|
275
|
-
const s = $e(e), n =
|
|
275
|
+
const s = $e(e), n = Oo(a.scope), o = new Set(Wa(e).map((l) => l.id)), i = {
|
|
276
276
|
reaches: [],
|
|
277
277
|
excluded: [
|
|
278
278
|
.../* @__PURE__ */ new Set([
|
|
@@ -292,11 +292,11 @@ function Fn(e, a, t = {}) {
|
|
|
292
292
|
}
|
|
293
293
|
for (const l of s.reachedCards({ inputId: a.id })) {
|
|
294
294
|
const c = Ee(a, l.card, t), h = c.reach, p = () => {
|
|
295
|
-
const
|
|
295
|
+
const v = he(l.card);
|
|
296
296
|
return {
|
|
297
297
|
cardId: l.cardId,
|
|
298
298
|
title: l.card.title ?? "",
|
|
299
|
-
...(
|
|
299
|
+
...(v == null ? void 0 : v.kind) === "semantic" ? { datasetName: v.datasetName } : {}
|
|
300
300
|
};
|
|
301
301
|
};
|
|
302
302
|
switch (h) {
|
|
@@ -322,15 +322,15 @@ function Fn(e, a, t = {}) {
|
|
|
322
322
|
he(l.card) && i.notReached.push({ ...p(), ...c.reason ? { reason: c.reason } : {} });
|
|
323
323
|
break;
|
|
324
324
|
default: {
|
|
325
|
-
const
|
|
326
|
-
throw new Error(`Unhandled filter reach ${String(
|
|
325
|
+
const v = h;
|
|
326
|
+
throw new Error(`Unhandled filter reach ${String(v)}`);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
for (const l of s.reachedVariables({ inputId: a.id })) {
|
|
331
331
|
const c = Ua(e, l.variableId);
|
|
332
332
|
if ((c == null ? void 0 : c.kind) !== "variable") continue;
|
|
333
|
-
const h = Ee(a, c.card, t), p = he(c.card),
|
|
333
|
+
const h = Ee(a, c.card, t), p = he(c.card), v = { cardId: c.id, title: c.variable.name, ...(p == null ? void 0 : p.kind) === "semantic" ? { datasetName: p.datasetName } : {} };
|
|
334
334
|
switch (h.reach) {
|
|
335
335
|
case "bound":
|
|
336
336
|
case "automatic":
|
|
@@ -343,7 +343,7 @@ function Fn(e, a, t = {}) {
|
|
|
343
343
|
(i.blocked ?? (i.blocked = [])).push({ cardId: c.id, title: c.variable.name, reason: h.reach });
|
|
344
344
|
break;
|
|
345
345
|
case "relationship":
|
|
346
|
-
(i.relationshipPending ?? (i.relationshipPending = [])).push(
|
|
346
|
+
(i.relationshipPending ?? (i.relationshipPending = [])).push(v);
|
|
347
347
|
break;
|
|
348
348
|
case "sqlTemplate":
|
|
349
349
|
(i.sqlPending ?? (i.sqlPending = [])).push({ cardId: c.id, title: c.variable.name });
|
|
@@ -351,22 +351,22 @@ function Fn(e, a, t = {}) {
|
|
|
351
351
|
case "excluded":
|
|
352
352
|
break;
|
|
353
353
|
case "notApplicable":
|
|
354
|
-
i.notReached.push({ ...
|
|
354
|
+
i.notReached.push({ ...v, ...h.reason ? { reason: h.reason } : {} });
|
|
355
355
|
break;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
return i;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function An(e, a) {
|
|
361
361
|
var n;
|
|
362
362
|
const t = a.scope;
|
|
363
363
|
if (t.kind === "allSheets") {
|
|
364
364
|
if ((n = t.sheetKinds) != null && n.length && !t.sheetKinds.includes("dashboard")) return;
|
|
365
|
-
const o =
|
|
365
|
+
const o = Eo(t);
|
|
366
366
|
return {
|
|
367
367
|
sheetIds: "all",
|
|
368
368
|
...o.length ? { exceptSheetIds: [...o] } : {},
|
|
369
|
-
...
|
|
369
|
+
...qo(t) ? { includesDocumentSheets: !0 } : {}
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
if (t.kind !== "sheets") return;
|
|
@@ -381,13 +381,13 @@ function es(e, a) {
|
|
|
381
381
|
return e ?? { tz: "UTC", weekStart: 1, anchor: { iso: a ?? "1970-01-01T00:00:00.000Z" } };
|
|
382
382
|
}
|
|
383
383
|
function ts(e, a, t, s) {
|
|
384
|
-
var
|
|
385
|
-
const { input: n } = a, o = Fn(e, n, s), i = (
|
|
384
|
+
var E, _, S;
|
|
385
|
+
const { input: n } = a, o = Fn(e, n, s), i = (y, D) => ({
|
|
386
386
|
filterId: n.id,
|
|
387
387
|
label: n.label,
|
|
388
388
|
editable: !1,
|
|
389
|
-
kind:
|
|
390
|
-
notEditable: { reason:
|
|
389
|
+
kind: D,
|
|
390
|
+
notEditable: { reason: y, message: Rn[y] },
|
|
391
391
|
reaches: o.reaches,
|
|
392
392
|
excluded: o.excluded,
|
|
393
393
|
...o.blocked ? { blocked: o.blocked } : {},
|
|
@@ -395,15 +395,15 @@ function ts(e, a, t, s) {
|
|
|
395
395
|
...o.sqlPending ? { sqlPending: o.sqlPending } : {}
|
|
396
396
|
});
|
|
397
397
|
if (n.filter.kind === "global-date") return i("global_date", "global_date");
|
|
398
|
-
const d = ks(n.filter).filter((
|
|
398
|
+
const d = ks(n.filter).filter((y) => y.kind === "semantic");
|
|
399
399
|
if (d.length !== 1 || d[0].kind !== "semantic") return i("not_semantic", "field");
|
|
400
|
-
const l =
|
|
400
|
+
const l = An(e, n);
|
|
401
401
|
if (!l || a.origin !== "embeddedInput") return i("scope_not_expressible", "field");
|
|
402
|
-
const c = ((
|
|
402
|
+
const c = ((E = n.filter.fieldMeta) == null ? void 0 : E.name) ?? ((_ = n.filter.column) == null ? void 0 : _.split(".").pop()) ?? "", h = Ha({
|
|
403
403
|
dashboard: e,
|
|
404
404
|
target: { kind: "dashboardInput", input: n, scope: {} },
|
|
405
405
|
calendar: es(t, void 0)
|
|
406
|
-
}).value, p = Ya(n.filter.dataType),
|
|
406
|
+
}).value, p = Ya(n.filter.dataType), v = p || (S = h == null ? void 0 : h.values) == null ? void 0 : S.filter((y) => ["string", "number", "boolean"].includes(typeof y)), I = Ja(h && "relativeMeta" in h ? h.relativeMeta : void 0), w = p ? I : void 0, x = w ? Xo(
|
|
407
407
|
w,
|
|
408
408
|
{ use: "filterDefault", columnHasTime: qa(n.filter) === "datetime" },
|
|
409
409
|
"defaultPeriod"
|
|
@@ -416,7 +416,7 @@ function ts(e, a, t, s) {
|
|
|
416
416
|
datasetName: d[0].datasetName,
|
|
417
417
|
field: c,
|
|
418
418
|
selection: n.filter.type === "single" ? "single" : "multiple",
|
|
419
|
-
...
|
|
419
|
+
...v != null && v.length ? { defaultValues: v } : {},
|
|
420
420
|
...w ? { defaultPeriod: w } : {},
|
|
421
421
|
...x ? { defaultPeriodReadOnly: x } : {},
|
|
422
422
|
...p ? { datePicker: n.filter.dateSelectionMode === "day" ? "day" : n.filter.dateSelectionMode === "months" ? "month" : "range" } : {},
|
|
@@ -455,7 +455,7 @@ function ns(e) {
|
|
|
455
455
|
field: s
|
|
456
456
|
}));
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function Dn(e) {
|
|
459
459
|
const a = os(e), t = /* @__PURE__ */ new Map();
|
|
460
460
|
for (const { field: s } of ns(e)) {
|
|
461
461
|
const n = ss(s, a);
|
|
@@ -463,14 +463,14 @@ function An(e) {
|
|
|
463
463
|
}
|
|
464
464
|
return [...t.values()];
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function On(e, a, t) {
|
|
467
467
|
if (!t) return;
|
|
468
468
|
const s = la(a), n = ns(e).find((d) => la(d.ref) === s);
|
|
469
469
|
if (!n) return;
|
|
470
470
|
const o = ss(n.field, os(e)), i = o ? t[Nt(o)] : void 0;
|
|
471
471
|
return i ? ot(i, n.field.name, o.datasetName) : void 0;
|
|
472
472
|
}
|
|
473
|
-
const xt = ["orientation", "stack", "donut", "totals", "dataLabels", "legend", "axes", "comparisonDisplay", "inheritComparison"],
|
|
473
|
+
const xt = ["orientation", "stack", "donut", "totals", "dataLabels", "legend", "axes", "comparisonDisplay", "inheritComparison", "band"], En = {
|
|
474
474
|
orientation: "orientation",
|
|
475
475
|
stack: "stacking",
|
|
476
476
|
donut: "donut hole",
|
|
@@ -479,72 +479,80 @@ const xt = ["orientation", "stack", "donut", "totals", "dataLabels", "legend", "
|
|
|
479
479
|
legend: "legend",
|
|
480
480
|
axes: "axes",
|
|
481
481
|
comparisonDisplay: "comparison display",
|
|
482
|
-
inheritComparison: "dashboard comparison"
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
482
|
+
inheritComparison: "dashboard comparison",
|
|
483
|
+
band: "band under its value"
|
|
484
|
+
}, qn = { x: "xAxisConfig", y: "yAxisConfig" }, gt = { x: "horizontal", y: "vertical" };
|
|
485
|
+
function Nn(e) {
|
|
486
|
+
const a = `${e.sql ? "SQL " : ""}${Es(e.type)}`;
|
|
486
487
|
return `${/^[aeiou]/i.test(a) ? "an" : "a"} ${a}`;
|
|
487
488
|
}
|
|
488
|
-
function
|
|
489
|
+
function Pn(e, a, t) {
|
|
489
490
|
const s = Object.fromEntries(Object.entries(a).filter(([n, o]) => o !== void 0 && !t.includes(n)));
|
|
490
491
|
return Object.keys(s).length ? { op: "card.update", cardId: e.cardRef, ...s } : void 0;
|
|
491
492
|
}
|
|
492
|
-
function
|
|
493
|
-
var
|
|
494
|
-
const o = xt.filter((
|
|
493
|
+
function Ln(e, a, t, s, n) {
|
|
494
|
+
var I, w, x, E, _, S, y, D, $, N;
|
|
495
|
+
const o = xt.filter((g) => t[g] !== void 0);
|
|
495
496
|
if (!o.length) return {};
|
|
496
|
-
const i = xt.filter((
|
|
497
|
-
for (const
|
|
497
|
+
const i = xt.filter((g) => a.settings.has(g)), d = o.filter((g) => !a.settings.has(g));
|
|
498
|
+
for (const g of d)
|
|
498
499
|
n.push(
|
|
499
500
|
Q("setting_not_for_card", {
|
|
500
|
-
message: `${G(e.title)} is ${
|
|
501
|
-
path: `${s.path}.${
|
|
502
|
-
fix: i.length ? `Leave out ${
|
|
501
|
+
message: `${G(e.title)} is ${Nn(a)}, which has no ${En[g]}.`,
|
|
502
|
+
path: `${s.path}.${g}`,
|
|
503
|
+
fix: i.length ? `Leave out ${g}; this card takes ${i.join(", ")}.` : `Leave out ${g}.`,
|
|
503
504
|
allowed: i,
|
|
504
|
-
suggestedChange:
|
|
505
|
+
suggestedChange: Pn(s, t, d)
|
|
505
506
|
})
|
|
506
507
|
);
|
|
507
508
|
if (d.length) return {};
|
|
508
|
-
const l = {}, c = ((
|
|
509
|
+
const l = {}, c = ((I = qe(e)) == null ? void 0 : I.properties) ?? {}, h = {
|
|
509
510
|
...c,
|
|
510
511
|
...t.orientation !== void 0 ? { orientation: t.orientation } : {},
|
|
511
512
|
...t.stack !== void 0 ? { stack: t.stack } : {},
|
|
512
513
|
...t.donut !== void 0 ? { donut: t.donut } : {}
|
|
513
514
|
};
|
|
514
|
-
["orientation", "stack", "donut"].some((
|
|
515
|
-
const p = l.variant ?
|
|
516
|
-
if (t.totals && t.totals.row !== (((w =
|
|
517
|
-
const
|
|
518
|
-
t.dataLabels.show !== As(p) && (
|
|
519
|
-
const
|
|
520
|
-
if (
|
|
521
|
-
const
|
|
522
|
-
|
|
515
|
+
["orientation", "stack", "donut"].some((g) => h[g] !== c[g]) && (l.variant = Rs(a.type, h));
|
|
516
|
+
const p = l.variant ? Fs(e, l.variant) : e, v = At(p);
|
|
517
|
+
if (t.totals && t.totals.row !== (((w = v.totals) == null ? void 0 : w.row) ?? !1) && (l.totals = { row: t.totals.row }), t.dataLabels) {
|
|
518
|
+
const g = {};
|
|
519
|
+
t.dataLabels.show !== As(p) && (g.show = t.dataLabels.show);
|
|
520
|
+
const k = t.dataLabels.format;
|
|
521
|
+
if (k === null && ((x = v.dataLabels) != null && x.format) && (g.format = null), k) {
|
|
522
|
+
const T = Mn(e, a, k, `${s.path}.dataLabels.format`, n);
|
|
523
|
+
T && !Pe(T, (E = v.dataLabels) == null ? void 0 : E.format) && (g.format = T);
|
|
523
524
|
}
|
|
524
|
-
Object.keys(
|
|
525
|
+
Object.keys(g).length && (l.dataLabels = g);
|
|
525
526
|
}
|
|
526
527
|
if (t.legend) {
|
|
527
|
-
const
|
|
528
|
-
t.legend.show !== ((_ =
|
|
528
|
+
const g = {};
|
|
529
|
+
t.legend.show !== ((_ = v.legend) == null ? void 0 : _.show) && (g.show = t.legend.show), t.legend.position !== void 0 && t.legend.position !== ((S = v.legend) == null ? void 0 : S.position) && (g.position = t.legend.position), Object.keys(g).length && (l.legend = g);
|
|
529
530
|
}
|
|
530
531
|
if (t.axes) {
|
|
531
|
-
const
|
|
532
|
-
for (const
|
|
533
|
-
const
|
|
534
|
-
if (!
|
|
535
|
-
const
|
|
536
|
-
|
|
532
|
+
const g = Ds(p.type, p.preferences), k = {};
|
|
533
|
+
for (const T of ["x", "y"]) {
|
|
534
|
+
const L = t.axes[T];
|
|
535
|
+
if (!L) continue;
|
|
536
|
+
const V = Bn(e, T, L, ((y = v.axes) == null ? void 0 : y[T]) ?? {}, T === g, `${s.path}.axes.${T}`, n);
|
|
537
|
+
V && (k[qn[T]] = V);
|
|
537
538
|
}
|
|
538
|
-
Object.keys(
|
|
539
|
+
Object.keys(k).length && (l.axes = k);
|
|
539
540
|
}
|
|
540
541
|
if (t.comparisonDisplay) {
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
return t.inheritComparison !== void 0 && t.inheritComparison !== ((($ = e.preferences) == null ? void 0 : $.inheritGlobalComparison) !== !1) && (l.inheritComparison = t.inheritComparison),
|
|
542
|
+
const g = (D = e.preferences) == null ? void 0 : D.comparisonPresentation, k = {}, { show: T, mode: L, precision: V } = t.comparisonDisplay;
|
|
543
|
+
T !== void 0 && T !== ((g == null ? void 0 : g.showComparison) ?? !0) && (k.show = T), L !== void 0 && L !== ((g == null ? void 0 : g.displayMode) ?? "difference") && (k.mode = L), V !== void 0 && V !== ((g == null ? void 0 : g.precision) ?? null) && (k.precision = V), Object.keys(k).length && (l.comparisonDisplay = k);
|
|
544
|
+
}
|
|
545
|
+
return t.inheritComparison !== void 0 && t.inheritComparison !== ((($ = e.preferences) == null ? void 0 : $.inheritGlobalComparison) !== !1) && (l.inheritComparison = t.inheritComparison), t.band !== void 0 && (t.band === "trend" && !Os(e.config) ? n.push(
|
|
546
|
+
Q("value_invalid", {
|
|
547
|
+
message: `${G(e.title)} has no Trend By date, so it has no trend to show.`,
|
|
548
|
+
path: `${s.path}.band`,
|
|
549
|
+
fix: "Add a Trend By date to show a trend: a dateField with a timeGrain in its query.",
|
|
550
|
+
allowed: ["automatic", "none"]
|
|
551
|
+
})
|
|
552
|
+
) : t.band !== (((N = e.config) == null ? void 0 : N.kpiBand) ?? "automatic") && (l.band = t.band === "automatic" ? null : t.band)), l;
|
|
545
553
|
}
|
|
546
|
-
function
|
|
547
|
-
const o = String(t.type), i =
|
|
554
|
+
function Mn(e, a, t, s, n) {
|
|
555
|
+
const o = String(t.type), i = qs("cartesian", "number"), d = Me(o), l = d == null ? void 0 : d.safeParse(t);
|
|
548
556
|
if (!i.includes(o) || !(l != null && l.success)) {
|
|
549
557
|
const h = l && !l.success ? l.error.issues[0] : void 0;
|
|
550
558
|
n.push(
|
|
@@ -564,7 +572,7 @@ function Ln(e, a, t, s, n) {
|
|
|
564
572
|
}
|
|
565
573
|
return l.data;
|
|
566
574
|
}
|
|
567
|
-
function
|
|
575
|
+
function Bn(e, a, t, s, n, o, i) {
|
|
568
576
|
const d = {};
|
|
569
577
|
t.title !== void 0 && (t.title !== null && !t.title.trim() ? i.push(Q("value_invalid", { message: "An axis title can't be empty.", path: `${o}.title`, fix: "Send a title, or null for none." })) : (t.title ?? void 0) !== s.title && (d.title = t.title));
|
|
570
578
|
const l = ["min", "max"].filter((c) => t[c] !== void 0 && t[c] !== null);
|
|
@@ -581,13 +589,13 @@ function Mn(e, a, t, s, n, o, i) {
|
|
|
581
589
|
}
|
|
582
590
|
if (n) {
|
|
583
591
|
for (const p of ["min", "max"]) {
|
|
584
|
-
const
|
|
585
|
-
if (
|
|
586
|
-
if (
|
|
592
|
+
const v = t[p];
|
|
593
|
+
if (v !== void 0) {
|
|
594
|
+
if (v !== null && !Number.isFinite(v)) {
|
|
587
595
|
i.push(Q("value_invalid", { message: `An axis ${p} must be a number.`, path: `${o}.${p}` }));
|
|
588
596
|
return;
|
|
589
597
|
}
|
|
590
|
-
(
|
|
598
|
+
(v ?? void 0) !== s[p] && (d[p] = v);
|
|
591
599
|
}
|
|
592
600
|
}
|
|
593
601
|
const c = t.min !== void 0 ? t.min : s.min, h = t.max !== void 0 ? t.max : s.max;
|
|
@@ -620,14 +628,14 @@ function St(e, a, t, s) {
|
|
|
620
628
|
const { [s]: n, ...o } = t;
|
|
621
629
|
return Object.keys(o).length ? { op: "card.update", cardId: e.cardRef, columns: { [a]: o } } : void 0;
|
|
622
630
|
}
|
|
623
|
-
function
|
|
631
|
+
function Vn(e, a, t) {
|
|
624
632
|
const { hidden: s, width: n, ...o } = t;
|
|
625
633
|
return Object.keys(o).length ? { op: "card.update", cardId: e.cardRef, columns: { [a]: o } } : void 0;
|
|
626
634
|
}
|
|
627
635
|
function We(e, a, t) {
|
|
628
636
|
return { op: "card.update", cardId: e.cardRef, columns: { [a]: { format: t } } };
|
|
629
637
|
}
|
|
630
|
-
function
|
|
638
|
+
function jn(e, a, t, s, n, o, i) {
|
|
631
639
|
var c;
|
|
632
640
|
const d = n.label;
|
|
633
641
|
if (d === void 0 || d === t.label) return;
|
|
@@ -644,7 +652,7 @@ function Vn(e, a, t, s, n, o, i) {
|
|
|
644
652
|
return;
|
|
645
653
|
}
|
|
646
654
|
if (d === null) {
|
|
647
|
-
const h = ((c =
|
|
655
|
+
const h = ((c = On(e, t.ref, o.catalogs)) == null ? void 0 : c.label) || t.field || t.label;
|
|
648
656
|
return t.labelInherited && t.label === h ? void 0 : { key: t.labelKey, label: h, origin: "semantic" };
|
|
649
657
|
}
|
|
650
658
|
if (!d.trim()) {
|
|
@@ -653,70 +661,70 @@ function Vn(e, a, t, s, n, o, i) {
|
|
|
653
661
|
}
|
|
654
662
|
return { key: t.labelKey, label: d };
|
|
655
663
|
}
|
|
656
|
-
function
|
|
657
|
-
var
|
|
664
|
+
function Kn(e, a, t, s, n, o, i) {
|
|
665
|
+
var g, k;
|
|
658
666
|
const d = `${Se(o.path, s)}.format`;
|
|
659
667
|
if (!a.settings.has("columns.format")) {
|
|
660
668
|
i.push(Q("setting_not_for_card", { message: `${G(e.title)} takes no column formats.`, path: d }));
|
|
661
669
|
return;
|
|
662
670
|
}
|
|
663
|
-
const l = t.ref, c = ((
|
|
671
|
+
const l = t.ref, c = ((g = o.modelFormats) == null ? void 0 : g.status) === "read" ? o.modelFormats.formats : void 0, h = l.kind === "matrixLevel" ? c == null ? void 0 : c[l.levelId] : l.kind === "matrixMeasure" ? c == null ? void 0 : c[l.measureId] : void 0, p = Bo({
|
|
664
672
|
card: e,
|
|
665
673
|
column: l,
|
|
666
674
|
...c ? { modelFormats: c } : {},
|
|
667
675
|
...h ? { catalogFormat: h } : {}
|
|
668
|
-
}),
|
|
669
|
-
if (n === null) return
|
|
670
|
-
if (
|
|
671
|
-
const
|
|
676
|
+
}), v = p.source === "override" ? p.format : void 0;
|
|
677
|
+
if (n === null) return v ? null : void 0;
|
|
678
|
+
if (v && Pe(n, v)) return;
|
|
679
|
+
const I = Vs(e, a, t, o.sqlResultColumns), w = I.value, x = js(I);
|
|
672
680
|
if (x.length === 0) {
|
|
673
681
|
i.push($a(e, s, d, t, w));
|
|
674
682
|
return;
|
|
675
683
|
}
|
|
676
|
-
const
|
|
677
|
-
if (
|
|
678
|
-
const
|
|
684
|
+
const E = !("type" in n) || n.type === void 0;
|
|
685
|
+
if (E && !p.format) {
|
|
686
|
+
const T = x[0];
|
|
679
687
|
i.push(
|
|
680
688
|
Q("format_invalid", {
|
|
681
689
|
// Unavailable is not "none": say which, so the agent knows the column may have a model format (ledger P2-20).
|
|
682
|
-
message: ((
|
|
690
|
+
message: ((k = o.modelFormats) == null ? void 0 : k.status) === "unavailable" ? `${s} on ${G(e.title)} may follow its model's format, which couldn't be read; state the whole format with its type.` : `${s} on ${G(e.title)} has no format to change; state the whole format with its type.`,
|
|
683
691
|
path: d,
|
|
684
692
|
fix: "Add `type` to the format.",
|
|
685
|
-
allowed: ze(
|
|
686
|
-
suggestedChange: We(o, s, { type:
|
|
693
|
+
allowed: ze(T),
|
|
694
|
+
suggestedChange: We(o, s, { type: T, ...n })
|
|
687
695
|
})
|
|
688
696
|
);
|
|
689
697
|
return;
|
|
690
698
|
}
|
|
691
|
-
const _ =
|
|
692
|
-
if (!x.includes(
|
|
699
|
+
const _ = E ? { ...p.format, ...n } : n, S = String(_.type);
|
|
700
|
+
if (!x.includes(S)) {
|
|
693
701
|
i.push(
|
|
694
|
-
|
|
695
|
-
message: w === "result" ? `${s} on ${G(e.title)} comes straight from the query, so it can't take a ${
|
|
702
|
+
S === "string" ? $a(e, s, `${d}.type`, t, "text") : Q("format_invalid", {
|
|
703
|
+
message: w === "result" ? `${s} on ${G(e.title)} comes straight from the query, so it can't take a ${S.replace("_", " ")} format.` : `${s} on ${G(e.title)} is ${is(t)}, so it can't take a ${S.replace("_", " ")} format.`,
|
|
696
704
|
path: `${d}.type`,
|
|
697
705
|
allowed: [...x]
|
|
698
706
|
})
|
|
699
707
|
);
|
|
700
708
|
return;
|
|
701
709
|
}
|
|
702
|
-
const
|
|
703
|
-
if (!
|
|
704
|
-
const
|
|
710
|
+
const y = Me(S), D = y == null ? void 0 : y.safeParse(_);
|
|
711
|
+
if (!y || !(D != null && D.success)) {
|
|
712
|
+
const T = D && !D.success ? D.error.issues[0] : void 0;
|
|
705
713
|
i.push(
|
|
706
714
|
Q("format_invalid", {
|
|
707
|
-
message:
|
|
715
|
+
message: y ? (T == null ? void 0 : T.code) === "unrecognized_keys" ? `A ${S} format has no ${T.keys.join(", ")}.` : `That format for ${s} isn't valid: ${(T == null ? void 0 : T.message) ?? "invalid"}.` : `${JSON.stringify(S)} isn't a format type.`,
|
|
708
716
|
path: d,
|
|
709
|
-
fix:
|
|
710
|
-
allowed:
|
|
717
|
+
fix: Qn(S),
|
|
718
|
+
allowed: y ? ze(S) : [...ln],
|
|
711
719
|
...p.format ? { suggestedChange: We(o, s, p.format) } : {}
|
|
712
720
|
})
|
|
713
721
|
);
|
|
714
722
|
return;
|
|
715
723
|
}
|
|
716
|
-
const $ =
|
|
724
|
+
const $ = D.data;
|
|
717
725
|
if ($.type === "temporal_bucket" && t.granularity && !ya($, t.granularity).ok) {
|
|
718
|
-
const L =
|
|
719
|
-
(
|
|
726
|
+
const L = cn.filter(
|
|
727
|
+
(V) => ya({ presentation: { mode: "preset", preset: V } }, t.granularity).ok
|
|
720
728
|
);
|
|
721
729
|
i.push(
|
|
722
730
|
Q("date_finer_than_grain", {
|
|
@@ -729,14 +737,14 @@ function jn(e, a, t, s, n, o, i) {
|
|
|
729
737
|
return;
|
|
730
738
|
}
|
|
731
739
|
if ($.type === "date") {
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
734
|
-
const K = Object.fromEntries(Object.entries($).filter(([B]) => !
|
|
740
|
+
const T = n, L = p.format ?? {}, V = Object.keys(T).filter((K) => !ca.includes(K) && !Pe(T[K], L[K]));
|
|
741
|
+
if (V.length) {
|
|
742
|
+
const K = Object.fromEntries(Object.entries($).filter(([B]) => !V.includes(B)));
|
|
735
743
|
i.push(
|
|
736
744
|
Q("format_invalid", {
|
|
737
|
-
message: `A date format set here takes a pattern or a preset; it doesn't set ${
|
|
745
|
+
message: `A date format set here takes a pattern or a preset; it doesn't set ${V.join(", ")}.`,
|
|
738
746
|
path: d,
|
|
739
|
-
fix: `Leave out ${
|
|
747
|
+
fix: `Leave out ${V.join(", ")}.`,
|
|
740
748
|
allowed: ca.filter((B) => B !== "type"),
|
|
741
749
|
suggestedChange: We(o, s, K)
|
|
742
750
|
})
|
|
@@ -744,22 +752,22 @@ function jn(e, a, t, s, n, o, i) {
|
|
|
744
752
|
return;
|
|
745
753
|
}
|
|
746
754
|
}
|
|
747
|
-
const
|
|
748
|
-
if (!
|
|
755
|
+
const N = Pa(I, $);
|
|
756
|
+
if (!N.ok) {
|
|
749
757
|
i.push(
|
|
750
758
|
Q("format_invalid", {
|
|
751
|
-
message: `${G(e.title)} can't draw that format on ${s}: ${
|
|
759
|
+
message: `${G(e.title)} can't draw that format on ${s}: ${N.reason}.`,
|
|
752
760
|
path: d,
|
|
753
761
|
fix: "Change the format to one the column can show.",
|
|
754
|
-
allowed: ze(
|
|
762
|
+
allowed: ze(S)
|
|
755
763
|
})
|
|
756
764
|
);
|
|
757
765
|
return;
|
|
758
766
|
}
|
|
759
|
-
return
|
|
767
|
+
return v && Pe(v, $) ? void 0 : $;
|
|
760
768
|
}
|
|
761
|
-
function
|
|
762
|
-
var x,
|
|
769
|
+
function Wn(e, a, t, s, n, o, i) {
|
|
770
|
+
var x, E;
|
|
763
771
|
const d = n.polarity;
|
|
764
772
|
if (d === void 0) return;
|
|
765
773
|
const l = `${Se(o.path, s)}.polarity`, c = t.ref;
|
|
@@ -774,8 +782,8 @@ function Kn(e, a, t, s, n, o, i) {
|
|
|
774
782
|
);
|
|
775
783
|
return;
|
|
776
784
|
}
|
|
777
|
-
const p = c.kind === "field" ? (
|
|
778
|
-
if (d === null) return
|
|
785
|
+
const p = c.kind === "field" ? (E = (x = e.config) == null ? void 0 : x.metricColumns) == null ? void 0 : E.find((_) => _.id === c.fieldId) : void 0, v = c.kind === "sqlKpiValue" ? La(e) : void 0, I = c.kind === "sqlKpiValue" ? (v == null ? void 0 : v.source) === "sql" && v.polarity !== va ? v.polarity : void 0 : p == null ? void 0 : p.comparisonPolarity, w = p == null ? void 0 : p.semanticComparisonPolarity;
|
|
786
|
+
if (d === null) return I ? null : void 0;
|
|
779
787
|
if (w && d !== w) {
|
|
780
788
|
i.push(
|
|
781
789
|
Q("polarity_set_by_model", {
|
|
@@ -788,84 +796,84 @@ function Kn(e, a, t, s, n, o, i) {
|
|
|
788
796
|
);
|
|
789
797
|
return;
|
|
790
798
|
}
|
|
791
|
-
return d === (w ??
|
|
799
|
+
return d === (w ?? I ?? va) ? void 0 : d;
|
|
792
800
|
}
|
|
793
|
-
function
|
|
794
|
-
var h, p,
|
|
801
|
+
function Un(e, a, t, s, n, o, i, d) {
|
|
802
|
+
var h, p, v;
|
|
795
803
|
if (n.hidden === void 0 && n.width === void 0) return {};
|
|
796
804
|
const l = Se(i.path, s);
|
|
797
805
|
if (!a.settings.has("columns.hidden") || t.resultKey === void 0) {
|
|
798
|
-
const
|
|
806
|
+
const I = a.pivoted && t.role === "measure";
|
|
799
807
|
return d.push(
|
|
800
808
|
Q("setting_not_for_card", {
|
|
801
|
-
message:
|
|
809
|
+
message: I ? `${s} on ${G(e.title)} has a column for each pivot value; hide or size them in the editor.` : `${G(e.title)} has no hidden columns or column widths; those are for tables.`,
|
|
802
810
|
path: `${l}.${n.hidden !== void 0 ? "hidden" : "width"}`,
|
|
803
|
-
allowed:
|
|
804
|
-
suggestedChange:
|
|
811
|
+
allowed: I ? ["label", "format"] : ["label", "format"].filter((w) => a.settings.has(`columns.${w}`)),
|
|
812
|
+
suggestedChange: Vn(i, s, n)
|
|
805
813
|
})
|
|
806
814
|
), {};
|
|
807
815
|
}
|
|
808
816
|
const c = {};
|
|
809
817
|
if (n.hidden !== void 0 && n.hidden !== ((o == null ? void 0 : o.hidden) === !0) && (c.hidden = n.hidden), n.width !== void 0 && n.width !== ((o == null ? void 0 : o.width) ?? null)) {
|
|
810
|
-
const { minSize:
|
|
811
|
-
n.width !== null && (!Number.isFinite(n.width) || n.width <
|
|
818
|
+
const { minSize: I, maxSize: w } = Bs((v = (p = (h = e.preferences) == null ? void 0 : h.tablePrefs) == null ? void 0 : p.columnSettingsMap) == null ? void 0 : v[t.resultKey]);
|
|
819
|
+
n.width !== null && (!Number.isFinite(n.width) || n.width < I || n.width > w) ? d.push(
|
|
812
820
|
Q("value_invalid", {
|
|
813
|
-
message: `${s} on ${G(e.title)} can be ${
|
|
821
|
+
message: `${s} on ${G(e.title)} can be ${I} to ${w} pixels wide.`,
|
|
814
822
|
path: `${l}.width`,
|
|
815
|
-
fix: `Send a width from ${
|
|
823
|
+
fix: `Send a width from ${I} to ${w} pixels, or null for automatic.`
|
|
816
824
|
})
|
|
817
825
|
) : c.width = n.width;
|
|
818
826
|
}
|
|
819
827
|
return c;
|
|
820
828
|
}
|
|
821
|
-
function
|
|
822
|
-
var
|
|
823
|
-
const { columns: s = {}, ...n } = a.settings ?? {}, o = [], i = xt.some((
|
|
829
|
+
function Gn(e, a, t) {
|
|
830
|
+
var E, _, S, y;
|
|
831
|
+
const { columns: s = {}, ...n } = a.settings ?? {}, o = [], i = xt.some((D) => n[D] !== void 0), d = !!((_ = (E = a.highlights) == null ? void 0 : E.add) != null && _.length || (y = (S = a.highlights) == null ? void 0 : S.remove) != null && y.length);
|
|
824
832
|
if (!Object.keys(s).length && !i && !d) return { ok: !0, labels: [], settings: null, warnings: [] };
|
|
825
|
-
const l =
|
|
833
|
+
const l = Ns(e);
|
|
826
834
|
if (!l)
|
|
827
835
|
return {
|
|
828
836
|
ok: !1,
|
|
829
837
|
problems: [Q("setting_not_for_card", { message: `${G(e.title)} takes no card settings through this tool.`, path: t.path })]
|
|
830
838
|
};
|
|
831
|
-
const c =
|
|
832
|
-
for (const [
|
|
833
|
-
const
|
|
834
|
-
if (!
|
|
835
|
-
o.push(
|
|
839
|
+
const c = Ln(e, l, n, t, o), h = Ps(e, l, t.sqlResultColumns), p = d ? Ls(e, l, h, a.highlights, t, o) : void 0, v = At(e), I = [], w = [];
|
|
840
|
+
for (const [D, $] of Object.entries(s)) {
|
|
841
|
+
const N = Ms(h, D, { path: Se(t.path, D), cardTitle: G(e.title) });
|
|
842
|
+
if (!N.ok) {
|
|
843
|
+
o.push(N.problem);
|
|
836
844
|
continue;
|
|
837
845
|
}
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
846
|
+
const g = N.column;
|
|
847
|
+
if (g.sqlName === "inferred") {
|
|
840
848
|
o.push(
|
|
841
849
|
Q("columns_unavailable", {
|
|
842
|
-
message: `${G(e.title)}'s columns weren't read from its query, so ${
|
|
843
|
-
path: Se(t.path,
|
|
850
|
+
message: `${G(e.title)}'s columns weren't read from its query, so ${D} can't be checked.`,
|
|
851
|
+
path: Se(t.path, D),
|
|
844
852
|
fix: "Check that the card runs and returns rows, then propose again."
|
|
845
853
|
})
|
|
846
854
|
);
|
|
847
855
|
continue;
|
|
848
856
|
}
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
const
|
|
852
|
-
column:
|
|
853
|
-
...
|
|
857
|
+
const k = jn(e, l, g, D, $, t, o);
|
|
858
|
+
k && I.push(k);
|
|
859
|
+
const T = Un(e, l, g, D, $, v.columns[g.name], t, o), L = $.format !== void 0 ? Kn(e, l, g, D, $.format, t, o) : void 0, V = Wn(e, l, g, D, $, t, o), K = {
|
|
860
|
+
column: g.ref,
|
|
861
|
+
...T,
|
|
854
862
|
...L !== void 0 ? { format: L } : {},
|
|
855
|
-
...
|
|
863
|
+
...V !== void 0 ? { polarity: V } : {}
|
|
856
864
|
};
|
|
857
865
|
Object.keys(K).length > 1 && w.push(K);
|
|
858
866
|
}
|
|
859
867
|
if (o.length) return { ok: !1, problems: o };
|
|
860
868
|
const x = { ...c, ...w.length ? { columns: w } : {}, ...p ? { highlights: p } : {} };
|
|
861
|
-
return { ok: !0, labels:
|
|
869
|
+
return { ok: !0, labels: I, settings: Object.keys(x).length ? x : null, warnings: [] };
|
|
862
870
|
}
|
|
863
|
-
function
|
|
871
|
+
function Qn(e) {
|
|
864
872
|
const a = Me(e), t = a && a === Me("number") ? ua.number : e === "temporal_bucket" || e === "date" ? ua[e] : void 0;
|
|
865
873
|
return t ? `Send a stored format: ${t}.` : "Send the format in the stored shape the outline shows.";
|
|
866
874
|
}
|
|
867
|
-
function
|
|
868
|
-
var _,
|
|
875
|
+
function Hn(e, a, t, s, n) {
|
|
876
|
+
var _, S, y, D, $, N;
|
|
869
877
|
const o = Ce(e, { sql: !0, calculations: !1 });
|
|
870
878
|
if (!o.editable) return [o.message];
|
|
871
879
|
const i = o.query, d = a;
|
|
@@ -879,45 +887,45 @@ function Qn(e, a, t, s, n) {
|
|
|
879
887
|
config: s.config
|
|
880
888
|
}, { sql: !0, calculations: !1 }) : void 0;
|
|
881
889
|
if (l && !l.editable) return ["the compiled query"];
|
|
882
|
-
const c = l != null && l.editable ? l.query : void 0, h = String(d.datasetName ?? ""), p = [],
|
|
883
|
-
const L =
|
|
884
|
-
(L.length !==
|
|
890
|
+
const c = l != null && l.editable ? l.query : void 0, h = String(d.datasetName ?? ""), p = [], v = (g) => be(g, h), I = (g, k, T) => {
|
|
891
|
+
const L = k ?? [], V = T ?? [];
|
|
892
|
+
(L.length !== V.length || L.some((K, B) => v(K) !== v(V[B]))) && p.push(g);
|
|
885
893
|
};
|
|
886
|
-
for (const
|
|
887
|
-
if (
|
|
888
|
-
const
|
|
889
|
-
|
|
894
|
+
for (const g of ["domainId", "datasetName"]) d[g] !== i[g] && p.push(g);
|
|
895
|
+
if (I("measures", d.measures, i.measures), I("columns", d.columns, i.columns), t || o.matrix) {
|
|
896
|
+
const g = (T) => new Set(((T == null ? void 0 : T.columns) ?? []).map(v)), k = (T, L) => (T ?? []).filter((V) => !g(L).has(v(V)));
|
|
897
|
+
I("dimensions", k(d.dimensions, t), k(i.dimensions, o.matrix)), I("matrix.columns", t == null ? void 0 : t.columns, (_ = o.matrix) == null ? void 0 : _.columns);
|
|
890
898
|
} else
|
|
891
|
-
|
|
899
|
+
I("dimensions", d.dimensions, i.dimensions);
|
|
892
900
|
const w = d.timeWindow !== void 0 && !d.timeGrain, x = w && i.timeWindow === void 0 ? void 0 : w && d.dateField === void 0 ? c == null ? void 0 : c.dateField : d.dateField;
|
|
893
|
-
x !== void 0 && (i.dateField === void 0 ||
|
|
894
|
-
const
|
|
895
|
-
(d.measures ?? []).forEach((
|
|
896
|
-
const
|
|
897
|
-
|
|
901
|
+
x !== void 0 && (i.dateField === void 0 || v(x) !== v(i.dateField)) && p.push("dateField"), d.timeGrain !== void 0 && d.timeGrain !== i.timeGrain && p.push("timeGrain");
|
|
902
|
+
const E = (S = e.config) != null && S.matrix ? e.config.matrix.spec.measures.map((g) => g.kind === "aggregate" ? { aggregate: g.aggregate } : {}) : ((y = e.config) == null ? void 0 : y.metricColumns) ?? [];
|
|
903
|
+
(d.measures ?? []).forEach((g, k) => {
|
|
904
|
+
const T = g && typeof g == "object" ? g.aggregate : void 0;
|
|
905
|
+
T && _a(E[k] ?? {}) !== T && p.push(`the aggregate of measures[${k}]`);
|
|
898
906
|
});
|
|
899
|
-
for (const { key:
|
|
900
|
-
|
|
907
|
+
for (const { key: g, label: k } of Ne(a))
|
|
908
|
+
Ks(e, g) !== k && p.push(`the label "${k}"`);
|
|
901
909
|
if (!n || n.aspects.includes("filters")) {
|
|
902
|
-
const
|
|
903
|
-
let
|
|
904
|
-
const
|
|
910
|
+
const g = d.filters ?? [];
|
|
911
|
+
let k = i.filters ?? [];
|
|
912
|
+
const T = d.timeWindow, L = i.timeWindow, V = (K, B) => {
|
|
905
913
|
const se = (oe) => JSON.stringify((oe ?? []).map(String));
|
|
906
|
-
return
|
|
914
|
+
return v(K.field) === v(B.field) && K.operator === B.operator && (K.scope ?? "row") === (B.scope ?? "row") && (typeof K.field == "object" ? K.field.aggregate : void 0) === (typeof B.field == "object" ? B.field.aggregate : void 0) && (K.values === void 0 || se(K.values) === se(B.values));
|
|
907
915
|
};
|
|
908
|
-
if (
|
|
916
|
+
if (T && !L) {
|
|
909
917
|
const K = ((c == null ? void 0 : c.filters) ?? []).filter(
|
|
910
|
-
(B) => !(c != null && c.timeWindow) && !
|
|
918
|
+
(B) => !(c != null && c.timeWindow) && !g.some((se) => V(se, B))
|
|
911
919
|
);
|
|
912
|
-
(!K.length || K.some((B) => !
|
|
913
|
-
} else
|
|
914
|
-
(
|
|
920
|
+
(!K.length || K.some((B) => !k.some((se) => V(B, se)))) && p.push("timeWindow"), k = k.filter((B) => !K.some((se) => V(se, B)));
|
|
921
|
+
} else T ? Zo(d.timeWindow, i.timeWindow) || p.push("timeWindow") : L && p.push("timeWindow");
|
|
922
|
+
(g.length !== k.length || g.some((K, B) => !V(K, k[B]))) && p.push("filters");
|
|
915
923
|
}
|
|
916
924
|
if (d.orderBy !== void 0) {
|
|
917
|
-
const
|
|
918
|
-
(!
|
|
925
|
+
const g = d.orderBy, k = ($ = (D = e.config) == null ? void 0 : D.sortByColumns) == null ? void 0 : $[0], T = k && Ws(e.config ?? {}, k), L = g.field && typeof g.field == "object" ? g.field.aggregate : void 0;
|
|
926
|
+
(!k || !T || k.direction !== g.direction || v(g.field) !== Us(T.name, Na(T)) || L !== void 0 && _a(T) !== L) && p.push("orderBy");
|
|
919
927
|
}
|
|
920
|
-
return d.limit !== void 0 && ((
|
|
928
|
+
return d.limit !== void 0 && ((N = e.config) == null ? void 0 : N.rowLimit) !== d.limit && p.push("limit"), p;
|
|
921
929
|
}
|
|
922
930
|
function kt(e) {
|
|
923
931
|
const a = Wa({ variables: [e] })[0];
|
|
@@ -932,7 +940,7 @@ function Je(e, a) {
|
|
|
932
940
|
const t = e.variables ?? [];
|
|
933
941
|
return t.find((s) => s.name === a) ?? t.find((s) => s.id === a);
|
|
934
942
|
}
|
|
935
|
-
function
|
|
943
|
+
function zn(e, a, t, s) {
|
|
936
944
|
var i;
|
|
937
945
|
const n = Je(e, a);
|
|
938
946
|
n || s.problem(ls(e, a, t));
|
|
@@ -965,7 +973,7 @@ function cs(e, a) {
|
|
|
965
973
|
}));
|
|
966
974
|
}
|
|
967
975
|
async function wa(e, a, t) {
|
|
968
|
-
var
|
|
976
|
+
var y, D;
|
|
969
977
|
const { problem: s, need: n, services: o } = t, { path: i, query: d } = e, l = ds(e.get), c = {
|
|
970
978
|
id: e.id,
|
|
971
979
|
name: e.name,
|
|
@@ -981,7 +989,7 @@ async function wa(e, a, t) {
|
|
|
981
989
|
message: "A SQL variable takes the only row or the first row of its result.",
|
|
982
990
|
path: `${i}.get`,
|
|
983
991
|
fix: 'Send get: "only" or "first", or write the aggregate or the list in the SQL itself.'
|
|
984
|
-
}),
|
|
992
|
+
}), S(Ye({ ...c, mode: "sql", connectionId: d.connectionId, sql: d.sql, get: l.kind }, a));
|
|
985
993
|
const h = await o.loadCardSource({ domainId: d.domainId, datasetName: d.datasetName });
|
|
986
994
|
h != null && h.dataSource || s({
|
|
987
995
|
code: "variable_source_unreachable",
|
|
@@ -991,63 +999,63 @@ async function wa(e, a, t) {
|
|
|
991
999
|
});
|
|
992
1000
|
const p = h.fields;
|
|
993
1001
|
for (const $ of Ma({ ...d, measures: d.measures ?? [] })) s({ ...$, path: `${i}.${$.path}` });
|
|
994
|
-
const
|
|
995
|
-
const
|
|
996
|
-
|
|
1002
|
+
const v = ($, N) => {
|
|
1003
|
+
const g = Ct($), k = Ys($, d.datasetName);
|
|
1004
|
+
k.toLowerCase() !== d.datasetName.toLowerCase() && s({
|
|
997
1005
|
code: "field_not_found",
|
|
998
|
-
message: `A variable reads one dataset: "${
|
|
999
|
-
path:
|
|
1000
|
-
fix: `Name a field of ${d.datasetName}, or set datasetName to ${
|
|
1006
|
+
message: `A variable reads one dataset: "${g}" names ${k}, not ${d.datasetName}.`,
|
|
1007
|
+
path: N,
|
|
1008
|
+
fix: `Name a field of ${d.datasetName}, or set datasetName to ${k} and read its field.`
|
|
1001
1009
|
});
|
|
1002
|
-
const
|
|
1003
|
-
return
|
|
1010
|
+
const T = ot(p, g, d.datasetName);
|
|
1011
|
+
return T || s({
|
|
1004
1012
|
code: "field_not_found",
|
|
1005
|
-
message: `"${
|
|
1006
|
-
path:
|
|
1013
|
+
message: `"${g}" isn't a field of ${d.datasetName}.`,
|
|
1014
|
+
path: N,
|
|
1007
1015
|
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
1008
1016
|
details: { available: p.slice(0, 20).map((L) => L.name) }
|
|
1009
|
-
}),
|
|
1010
|
-
},
|
|
1017
|
+
}), T;
|
|
1018
|
+
}, I = d.measures ?? [], w = d.dimensions ?? [], x = {
|
|
1011
1019
|
...c,
|
|
1012
1020
|
mode: "data",
|
|
1013
1021
|
dataSource: h.dataSource,
|
|
1014
1022
|
connectionId: h.connectionId,
|
|
1015
1023
|
get: "only",
|
|
1016
|
-
...(
|
|
1024
|
+
...(y = d.filters) != null && y.length ? { conditions: await Jn(d, o, i, t.refuseAll) } : {}
|
|
1017
1025
|
};
|
|
1018
1026
|
if (l.kind === "aggregate") {
|
|
1019
|
-
(
|
|
1027
|
+
(I.length !== 1 || w.length) && s({
|
|
1020
1028
|
code: "invalid_change",
|
|
1021
1029
|
message: "An aggregate reads one measure and no dimension.",
|
|
1022
1030
|
path: `${i}.query`,
|
|
1023
1031
|
fix: `Send measures: [{ name, aggregate }] alone; for one field's value use get: "only", "first" or "list" with dimensions: [field].`
|
|
1024
1032
|
}), d.orderBy && s({ code: "invalid_change", message: "An aggregate is one value, so it has no order.", path: `${i}.query.orderBy`, fix: "Leave out orderBy." });
|
|
1025
|
-
const $ =
|
|
1026
|
-
if (!Ca(
|
|
1027
|
-
const L =
|
|
1033
|
+
const $ = v(I[0], `${i}.query.measures[0]`), N = typeof I[0] == "string" ? void 0 : I[0].aggregate, g = hn($).filter((L) => Ca(L.value)), k = N ?? (ut($) ? "calculation" : pn($));
|
|
1034
|
+
if (!Ca(k) || !g.some((L) => L.value === k)) {
|
|
1035
|
+
const L = g.map((V) => V.value);
|
|
1028
1036
|
s({
|
|
1029
1037
|
code: "invalid_change",
|
|
1030
|
-
message:
|
|
1038
|
+
message: N ? `${N} isn't an aggregate ${$.label || $.name} takes.` : `${$.label || $.name} needs its aggregate.`,
|
|
1031
1039
|
path: `${i}.query.measures[0]`,
|
|
1032
1040
|
fix: ut($) ? `${$.label || $.name} aggregates itself: send it without an aggregate.` : `Send { name: "${$.name}", aggregate } with one of: ${L.join(", ")}.`,
|
|
1033
1041
|
allowed: L
|
|
1034
1042
|
});
|
|
1035
1043
|
}
|
|
1036
|
-
const
|
|
1037
|
-
return
|
|
1044
|
+
const T = Yn(I[0], { ...x, field: $, get: k }, `${i}.query.measures[0].comparison`, s);
|
|
1045
|
+
return S(Ye({ ...x, field: $, get: k, ...T ? { comparison: T } : {} }, a));
|
|
1038
1046
|
}
|
|
1039
|
-
(w.length !== 1 ||
|
|
1047
|
+
(w.length !== 1 || I.length) && s({
|
|
1040
1048
|
code: "invalid_change",
|
|
1041
1049
|
message: `The ${l.kind === "only" ? "only value" : l.kind === "first" ? "first value" : "list"} reads one dimension; a measure's one value is get: "aggregate".`,
|
|
1042
1050
|
path: `${i}.query`,
|
|
1043
1051
|
fix: "Send dimensions: [field] and no measures; order the first value or the list with orderBy."
|
|
1044
1052
|
});
|
|
1045
|
-
const
|
|
1046
|
-
ut(
|
|
1053
|
+
const E = v(w[0], `${i}.query.dimensions[0]`);
|
|
1054
|
+
ut(E) && s({
|
|
1047
1055
|
code: "invalid_change",
|
|
1048
|
-
message: `${
|
|
1056
|
+
message: `${E.label || E.name} is an aggregate calculation, so it has one value, not rows.`,
|
|
1049
1057
|
path: `${i}.query.dimensions[0]`,
|
|
1050
|
-
fix: `Send get: "aggregate" with measures: ["${
|
|
1058
|
+
fix: `Send get: "aggregate" with measures: ["${E.name}"].`
|
|
1051
1059
|
}), l.kind === "only" && d.orderBy && s({ code: "invalid_change", message: "The only value has no order: it shows when exactly one row matches.", path: `${i}.query.orderBy`, fix: 'Leave out orderBy, or send get: "first" to take the first by this order.' });
|
|
1052
1060
|
let _;
|
|
1053
1061
|
if (d.orderBy && l.kind !== "only") {
|
|
@@ -1057,28 +1065,28 @@ async function wa(e, a, t) {
|
|
|
1057
1065
|
message: "The order names a field, not an aggregate: the first value is ordered by the latest (desc) or earliest (asc) of that field per value.",
|
|
1058
1066
|
path: `${i}.query.orderBy.field`,
|
|
1059
1067
|
fix: 'Send orderBy: { field: "<field>", direction }.'
|
|
1060
|
-
}), _ =
|
|
1068
|
+
}), _ = v($, `${i}.query.orderBy.field`);
|
|
1061
1069
|
}
|
|
1062
|
-
return
|
|
1070
|
+
return S(
|
|
1063
1071
|
Ye(
|
|
1064
1072
|
{
|
|
1065
1073
|
...x,
|
|
1066
|
-
field:
|
|
1074
|
+
field: E,
|
|
1067
1075
|
get: l.kind,
|
|
1068
1076
|
..._ ? { sortField: _ } : {},
|
|
1069
|
-
sortDirection: ((
|
|
1077
|
+
sortDirection: ((D = d.orderBy) == null ? void 0 : D.direction) ?? "asc",
|
|
1070
1078
|
...l.kind === "list" && l.limit ? { listLimit: l.limit } : {},
|
|
1071
1079
|
...l.kind === "list" && l.separator !== void 0 ? { listSeparator: l.separator } : {}
|
|
1072
1080
|
},
|
|
1073
1081
|
a
|
|
1074
1082
|
)
|
|
1075
1083
|
);
|
|
1076
|
-
function
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1084
|
+
function S($) {
|
|
1085
|
+
const N = { ...$, name: e.name }, g = Dt(N, a);
|
|
1086
|
+
return g.length && t.refuseAll(cs(g, i)), N;
|
|
1079
1087
|
}
|
|
1080
1088
|
}
|
|
1081
|
-
function
|
|
1089
|
+
function Yn(e, a, t, s) {
|
|
1082
1090
|
var o, i;
|
|
1083
1091
|
const n = typeof e == "string" ? void 0 : e.comparison;
|
|
1084
1092
|
if (!(!n || n.kind === "inherit" || n.kind === "off"))
|
|
@@ -1087,14 +1095,14 @@ function zn(e, a, t, s) {
|
|
|
1087
1095
|
message: "A variable compares with an earlier period, not a target.",
|
|
1088
1096
|
path: t,
|
|
1089
1097
|
fix: "Send comparison: { kind: 'previous_period' } or { kind: 'previous_year' }; put a target in the words, or on a KPI card."
|
|
1090
|
-
}),
|
|
1098
|
+
}), bn(a) || s({
|
|
1091
1099
|
code: "invalid_change",
|
|
1092
1100
|
message: `${((o = a.field) == null ? void 0 : o.label) || ((i = a.field) == null ? void 0 : i.name)} with ${String(a.get)} isn't a number, so it has no comparison.`,
|
|
1093
1101
|
path: t,
|
|
1094
1102
|
fix: "Compare a count, or a numeric field's total, average, lowest or highest; leave comparison out here."
|
|
1095
|
-
}),
|
|
1103
|
+
}), Js(n);
|
|
1096
1104
|
}
|
|
1097
|
-
async function
|
|
1105
|
+
async function Jn(e, a, t, s) {
|
|
1098
1106
|
var o;
|
|
1099
1107
|
const n = await a.compileCardQuery({
|
|
1100
1108
|
query: { domainId: e.domainId, datasetName: e.datasetName, measures: ["__count"], filters: e.filters },
|
|
@@ -1102,8 +1110,8 @@ async function Yn(e, a, t, s) {
|
|
|
1102
1110
|
});
|
|
1103
1111
|
return n.ok ? ((o = n.part.config) == null ? void 0 : o.filters) ?? null : s(n.problems.map((i) => ({ ...i, path: i.path ? `${t}.query.${i.path}` : `${t}.query.filters` })));
|
|
1104
1112
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const o = ds(a), i =
|
|
1113
|
+
function Xn(e, a, t, s, n) {
|
|
1114
|
+
const o = ds(a), i = gn(e);
|
|
1107
1115
|
o.kind === "aggregate" && e.get.kind !== "aggregate" && s.problem({ code: "invalid_change", message: `${e.name} reads a field's rows; an aggregate needs its measure.`, path: `${n}.get`, fix: 'Send query with measures: [{ name, aggregate }] and get: "aggregate".' }), o.kind !== "aggregate" && e.get.kind === "aggregate" && s.problem({ code: "invalid_change", message: `${e.name} is an aggregate; a value, the first or a list reads a dimension.`, path: `${n}.get`, fix: "Send query with dimensions: [field] and the get." }), i.mode === "sql" && o.kind !== "only" && o.kind !== "first" && s.problem({ code: "invalid_change", message: "A SQL variable takes the only row or the first row of its result.", path: `${n}.get`, fix: 'Send get: "only" or "first", or write the list in the SQL itself.' });
|
|
1108
1116
|
const d = Ye(
|
|
1109
1117
|
{
|
|
@@ -1116,7 +1124,7 @@ function Jn(e, a, t, s, n) {
|
|
|
1116
1124
|
);
|
|
1117
1125
|
return { query: d.query, get: d.get };
|
|
1118
1126
|
}
|
|
1119
|
-
function
|
|
1127
|
+
function Zn(e, a) {
|
|
1120
1128
|
const t = Qa(e).filter(({ ref: i }) => i.source === "data" && i.variableId === a), s = (i) => {
|
|
1121
1129
|
var d;
|
|
1122
1130
|
return `"${((d = (e.sheets ?? []).find((l) => l.id === i)) == null ? void 0 : d.title) ?? i}"`;
|
|
@@ -1132,7 +1140,7 @@ function Xn(e, a) {
|
|
|
1132
1140
|
)
|
|
1133
1141
|
].join(", "), places: t };
|
|
1134
1142
|
}
|
|
1135
|
-
function
|
|
1143
|
+
function ei(e, a, t, s, n) {
|
|
1136
1144
|
const { problem: o } = n;
|
|
1137
1145
|
(!Xe(t) || !t.document) && o({
|
|
1138
1146
|
code: "invalid_change",
|
|
@@ -1143,47 +1151,47 @@ function Zn(e, a, t, s, n) {
|
|
|
1143
1151
|
const i = t.document, d = e.target;
|
|
1144
1152
|
let l, c;
|
|
1145
1153
|
if ("sectionId" in d) {
|
|
1146
|
-
const x = i.sections.find((
|
|
1154
|
+
const x = i.sections.find((E) => E.id === d.sectionId);
|
|
1147
1155
|
x || o({ code: "invalid_change", message: `No section ${d.sectionId} on "${t.title}".`, path: `${s}.target.sectionId`, fix: "Use a section id from the outline's textSections." }), x.type !== "text" && o({ code: "invalid_change", message: `Section ${d.sectionId} is a ${x.type} section, not text.`, path: `${s}.target.sectionId`, fix: "Name one of the outline's textSections." }), l = x.content, c = x.style;
|
|
1148
1156
|
} else {
|
|
1149
|
-
const { region: x, role:
|
|
1150
|
-
Ia[x].includes(
|
|
1157
|
+
const { region: x, role: E } = d;
|
|
1158
|
+
Ia[x].includes(E) || o({
|
|
1151
1159
|
code: "invalid_change",
|
|
1152
|
-
message: `The ${x} has ${x === "header" ? "a title and a metadata line" : "a note and a page info line"}, not a ${
|
|
1160
|
+
message: `The ${x} has ${x === "header" ? "a title and a metadata line" : "a note and a page info line"}, not a ${E} line.`,
|
|
1153
1161
|
path: `${s}.target.role`,
|
|
1154
|
-
fix: `Send role: ${Ia[x].map((
|
|
1155
|
-
}), e.style !== void 0 && !
|
|
1162
|
+
fix: `Send role: ${Ia[x].map((S) => `"${S}"`).join(" or ")}.`
|
|
1163
|
+
}), e.style !== void 0 && !Gs(E) && o({
|
|
1156
1164
|
code: "invalid_change",
|
|
1157
|
-
message: `The footer's ${
|
|
1165
|
+
message: `The footer's ${E === "pageInfo" ? "page info" : E} line has no size or alignment; only the header's title and metadata lines and text sections do.`,
|
|
1158
1166
|
path: `${s}.style`,
|
|
1159
1167
|
fix: "Leave style out for a footer line."
|
|
1160
1168
|
});
|
|
1161
|
-
const _ = i[x] ?
|
|
1169
|
+
const _ = i[x] ? Go(i[x].blocks, E) : void 0;
|
|
1162
1170
|
l = (_ == null ? void 0 : _.content) ?? [], c = _ == null ? void 0 : _.style;
|
|
1163
1171
|
}
|
|
1164
|
-
const h = e.style !== void 0 ?
|
|
1165
|
-
let
|
|
1172
|
+
const h = e.style !== void 0 ? Qs(e.style) : void 0, p = !h || Object.entries(h).every(([x, E]) => (c == null ? void 0 : c[x]) === E);
|
|
1173
|
+
let v;
|
|
1166
1174
|
if (e.text !== void 0) {
|
|
1167
|
-
const x = { kind: "document", sheetId: t.id },
|
|
1168
|
-
if (JSON.stringify(
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1172
|
-
JSON.stringify(Ze(
|
|
1175
|
+
const x = { kind: "document", sheetId: t.id }, E = { catalog: _t({ dashboard: a, place: x }), inputs: a.inputs, variables: a.variables }, _ = JSON.stringify(Ze(l, E));
|
|
1176
|
+
if (JSON.stringify(Hs(e.text)) !== _) {
|
|
1177
|
+
const S = zs(e.text, l, { dashboard: a, place: x, path: `${s}.text`, links: !0 });
|
|
1178
|
+
S.ok || n.refuseAll(S.problems);
|
|
1179
|
+
const y = S.content;
|
|
1180
|
+
JSON.stringify(Ze(y, E)) !== _ && (v = y);
|
|
1173
1181
|
}
|
|
1174
1182
|
}
|
|
1175
|
-
const
|
|
1176
|
-
...
|
|
1183
|
+
const I = {
|
|
1184
|
+
...v !== void 0 ? { content: v } : {},
|
|
1177
1185
|
...h !== void 0 && !p ? { style: h } : {}
|
|
1178
1186
|
};
|
|
1179
|
-
return { edit: "sectionId" in d ? { type: "updateText", sectionId: d.sectionId, ...
|
|
1187
|
+
return { edit: "sectionId" in d ? { type: "updateText", sectionId: d.sectionId, ...I } : { type: "updateRegionText", region: d.region, role: d.role, ...I }, unchanged: v === void 0 && p };
|
|
1180
1188
|
}
|
|
1181
1189
|
class me extends Error {
|
|
1182
1190
|
}
|
|
1183
1191
|
const xa = "A text card takes title, description and text.", bt = (e) => e.cards.some((a) => {
|
|
1184
1192
|
var t, s;
|
|
1185
1193
|
return ((t = a.customCardPreferences) == null ? void 0 : t.visualType) === "multiple" || !!((s = a.customCardPreferences) != null && s.dataInputCardIds);
|
|
1186
|
-
}), Tt = (e) => (e ?? "").trim().toLowerCase(), tt =
|
|
1194
|
+
}), Tt = (e) => (e ?? "").trim().toLowerCase(), tt = so, Sa = { measures: ro, records: io, sql: no }, Ue = {
|
|
1187
1195
|
measures: "a measures query (measures, with optional dimensions)",
|
|
1188
1196
|
records: "a records query (columns)",
|
|
1189
1197
|
sql: "a SQL query"
|
|
@@ -1191,14 +1199,14 @@ const xa = "A text card takes title, description and text.", bt = (e) => e.cards
|
|
|
1191
1199
|
function us(e, a) {
|
|
1192
1200
|
return a.path.reduce((t, s) => typeof s == "number" ? `${t}[${s}]` : `${t}.${s}`, e);
|
|
1193
1201
|
}
|
|
1194
|
-
const
|
|
1195
|
-
async function
|
|
1196
|
-
return fs(e, a, t, { limit:
|
|
1202
|
+
const ti = { max: Io, what: "A proposal", fix: "Split the changes into several proposals." };
|
|
1203
|
+
async function Ar(e, a, t) {
|
|
1204
|
+
return fs(e, a, t, { limit: ti });
|
|
1197
1205
|
}
|
|
1198
1206
|
async function fs(e, a, t, s) {
|
|
1199
1207
|
var Gt, Qt, Ht, zt, Yt, Jt, Xt, Zt, ea, ta, aa, sa, oa, na, ia, ra;
|
|
1200
|
-
const n = [], o = [], i = [], d = [], l = /* @__PURE__ */ new Set(), c = [], h = /* @__PURE__ */ new Map(), p = { calendar: t.calendar },
|
|
1201
|
-
let
|
|
1208
|
+
const n = [], o = [], i = [], d = [], l = /* @__PURE__ */ new Set(), c = [], h = /* @__PURE__ */ new Map(), p = { calendar: t.calendar }, v = t.relationshipReach ? { relationshipReach: t.relationshipReach } : {};
|
|
1209
|
+
let I = e, w, x = 0, E = 0;
|
|
1202
1210
|
const { limit: _ } = s;
|
|
1203
1211
|
if (a.length > _.max)
|
|
1204
1212
|
return {
|
|
@@ -1212,64 +1220,64 @@ async function fs(e, a, t, s) {
|
|
|
1212
1220
|
}
|
|
1213
1221
|
]
|
|
1214
1222
|
};
|
|
1215
|
-
const
|
|
1223
|
+
const S = [];
|
|
1216
1224
|
if (a.forEach((m, r) => {
|
|
1217
|
-
const u =
|
|
1225
|
+
const u = Xs.safeParse(m);
|
|
1218
1226
|
if (u.success) {
|
|
1219
|
-
|
|
1227
|
+
S.push(u.data);
|
|
1220
1228
|
return;
|
|
1221
1229
|
}
|
|
1222
1230
|
for (const f of u.error.issues) {
|
|
1223
|
-
const
|
|
1231
|
+
const b = en(f.message);
|
|
1224
1232
|
n.push({
|
|
1225
1233
|
code: "invalid_change",
|
|
1226
|
-
message: (
|
|
1234
|
+
message: (b == null ? void 0 : b.message) ?? f.message,
|
|
1227
1235
|
path: us(`changes[${r}]`, f),
|
|
1228
|
-
fix: (
|
|
1236
|
+
fix: (b == null ? void 0 : b.fix) ?? "Send the change in the shape the tool schema gives."
|
|
1229
1237
|
});
|
|
1230
1238
|
}
|
|
1231
1239
|
}), n.length) return { ok: !1, problems: n };
|
|
1232
|
-
const
|
|
1240
|
+
const y = (m) => {
|
|
1233
1241
|
throw n.push(m), new me();
|
|
1234
|
-
},
|
|
1235
|
-
t.capabilities.sql ||
|
|
1242
|
+
}, D = (m) => {
|
|
1243
|
+
t.capabilities.sql || y({
|
|
1236
1244
|
code: "capability_required",
|
|
1237
1245
|
message: "This change creates, reads or changes a SQL card or variable, which needs SQL access.",
|
|
1238
1246
|
path: m,
|
|
1239
1247
|
fix: "Use a measures or records query (a semantic dataset for a variable), or ask an administrator for SQL access."
|
|
1240
1248
|
}), l.add("sql");
|
|
1241
1249
|
}, $ = (m, r) => {
|
|
1242
|
-
const u = wt(
|
|
1243
|
-
u.ok ? (
|
|
1244
|
-
},
|
|
1245
|
-
var X, Y,
|
|
1246
|
-
const { cardId: r, index: u, path: f } = m, { settings:
|
|
1247
|
-
if (!
|
|
1248
|
-
const
|
|
1249
|
-
if (P && !((
|
|
1250
|
-
for (const H of
|
|
1250
|
+
const u = wt(I, [m], p);
|
|
1251
|
+
u.ok ? (I = u.dashboard, i.push(m)) : y({ code: "invalid_change", message: u.failedAt.message, path: r, ...u.failedAt.fix ? { fix: u.failedAt.fix } : {} });
|
|
1252
|
+
}, N = async (m) => {
|
|
1253
|
+
var X, Y, j, ne, fe;
|
|
1254
|
+
const { cardId: r, index: u, path: f } = m, { settings: b = {}, highlights: C } = m.request, O = b.columns && Object.keys(b.columns).length ? b.columns : void 0, F = Object.entries(b).some(([H, de]) => H !== "columns" && de !== void 0), A = !!((X = C == null ? void 0 : C.add) != null && X.length);
|
|
1255
|
+
if (!O && !F && !A && !((Y = C == null ? void 0 : C.remove) != null && Y.length)) return null;
|
|
1256
|
+
const R = ie(I, r).card, P = Object.values(O ?? {}).some((H) => H.label === null), q = Object.values(O ?? {}).some((H) => H.format !== void 0 && H.format !== null), M = {};
|
|
1257
|
+
if (P && !((j = R.sql) != null && j.trim()))
|
|
1258
|
+
for (const H of Dn(R)) {
|
|
1251
1259
|
const de = await t.loadCardSource(H);
|
|
1252
1260
|
de && (M[Nt(H)] = de.fields);
|
|
1253
1261
|
}
|
|
1254
1262
|
let U;
|
|
1255
|
-
if (
|
|
1256
|
-
const H = t.readModelFormats ? await t.readModelFormats({ card:
|
|
1263
|
+
if (q && !((ne = R.sql) != null && ne.trim())) {
|
|
1264
|
+
const H = t.readModelFormats ? await t.readModelFormats({ card: R }) : null;
|
|
1257
1265
|
U = H ? { status: "read", formats: H } : { status: "unavailable" };
|
|
1258
1266
|
}
|
|
1259
1267
|
let z;
|
|
1260
|
-
if ((
|
|
1261
|
-
const H = t.readSqlResultColumns ? await t.readSqlResultColumns({ cardId: r, dashboard:
|
|
1262
|
-
H ||
|
|
1268
|
+
if ((O || A) && ((fe = R.sql) != null && fe.trim()) && R.type !== "kpi") {
|
|
1269
|
+
const H = t.readSqlResultColumns ? await t.readSqlResultColumns({ cardId: r, dashboard: I }) : null;
|
|
1270
|
+
H || y({
|
|
1263
1271
|
code: "columns_unavailable",
|
|
1264
|
-
message:
|
|
1265
|
-
path:
|
|
1272
|
+
message: O ? `"${R.title || "Untitled"}" couldn't be run to read its columns, so their names can't be checked.` : `"${R.title || "Untitled"}" couldn't be run to read its columns, so the highlight's column can't be checked.`,
|
|
1273
|
+
path: O ? `${f}.columns` : `${f}.column`,
|
|
1266
1274
|
fix: "Check that the card runs and returns rows, then propose again."
|
|
1267
1275
|
}), z = H;
|
|
1268
1276
|
}
|
|
1269
|
-
const W =
|
|
1270
|
-
|
|
1277
|
+
const W = Gn(
|
|
1278
|
+
R,
|
|
1271
1279
|
{
|
|
1272
|
-
settings: { ...
|
|
1280
|
+
settings: { ...b, ...O ? { columns: O } : { columns: void 0 } },
|
|
1273
1281
|
...C ? { highlights: C } : {}
|
|
1274
1282
|
},
|
|
1275
1283
|
{
|
|
@@ -1284,21 +1292,21 @@ async function fs(e, a, t, s) {
|
|
|
1284
1292
|
if (!W.ok)
|
|
1285
1293
|
throw n.push(...W.problems), new me();
|
|
1286
1294
|
for (const H of W.labels) {
|
|
1287
|
-
const de = m.queryLabels.find((
|
|
1288
|
-
de &&
|
|
1295
|
+
const de = m.queryLabels.find((Fe) => He(Fe.key, H.key) && Fe.label !== H.label);
|
|
1296
|
+
de && y({
|
|
1289
1297
|
code: "value_invalid",
|
|
1290
|
-
message: `Two labels are stated for one column of "${
|
|
1298
|
+
message: `Two labels are stated for one column of "${R.title || "Untitled"}": "${de.label}" in the query and "${H.label}" in columns.`,
|
|
1291
1299
|
path: `${f}.columns`,
|
|
1292
1300
|
fix: "State the label once."
|
|
1293
1301
|
});
|
|
1294
1302
|
}
|
|
1295
|
-
return o.push(...W.warnings), W.labels.length && pa(
|
|
1296
|
-
},
|
|
1297
|
-
var
|
|
1298
|
-
const u = ie(
|
|
1299
|
-
u ||
|
|
1303
|
+
return o.push(...W.warnings), W.labels.length && pa(R, W.labels).changed.length && $({ op: "card.update", cardId: r, update: { kind: "relabel", labels: W.labels }, changeIndex: u }, `${f}.columns`), W.settings && $({ op: "card.update", cardId: r, update: { kind: "settings", settings: W.settings }, changeIndex: u }, O ? `${f}.columns` : f), W.settings;
|
|
1304
|
+
}, g = (m, r) => {
|
|
1305
|
+
var b;
|
|
1306
|
+
const u = ie(I, m);
|
|
1307
|
+
u || y({ code: "card_not_editable", message: "Cards in Document sections are changed in the editor.", path: `${r}.cardId`, fix: "Tell the user to change it in the editor.", details: { reason: "document_section" } });
|
|
1300
1308
|
const f = Ce(u.card, { sql: !0 });
|
|
1301
|
-
return ((
|
|
1309
|
+
return ((b = f.source) == null ? void 0 : b.kind) === "sql" && D(`${r}.cardId`), f.editable || y({
|
|
1302
1310
|
code: "card_not_editable",
|
|
1303
1311
|
message: f.message,
|
|
1304
1312
|
path: `${r}.cardId`,
|
|
@@ -1310,26 +1318,26 @@ async function fs(e, a, t, s) {
|
|
|
1310
1318
|
path: r,
|
|
1311
1319
|
details: { cardIds: [m] }
|
|
1312
1320
|
}), { card: u.card, read: f };
|
|
1313
|
-
},
|
|
1314
|
-
var
|
|
1315
|
-
const f = Ka("metric", ((
|
|
1316
|
-
return r.map(({ index: C, calculations:
|
|
1317
|
-
...
|
|
1321
|
+
}, k = /* @__PURE__ */ new Map(), T = (m, r, u) => {
|
|
1322
|
+
var b;
|
|
1323
|
+
const f = Ka("metric", ((b = m.config) == null ? void 0 : b.metricColumns) ?? []);
|
|
1324
|
+
return r.map(({ index: C, calculations: O }) => ({
|
|
1325
|
+
...O,
|
|
1318
1326
|
measure: f[C] ?? { role: "metric", field: "", ordinal: C },
|
|
1319
1327
|
path: `${u}.query.measures[${C}]`
|
|
1320
1328
|
}));
|
|
1321
1329
|
}, L = async (m) => {
|
|
1322
|
-
const r = ie(
|
|
1323
|
-
var
|
|
1324
|
-
return ((
|
|
1325
|
-
}),
|
|
1330
|
+
const r = ie(I, m.cardId).card, u = T(r, m.stated, m.path), f = u.some((O) => {
|
|
1331
|
+
var F, A;
|
|
1332
|
+
return ((F = O.comparison) == null ? void 0 : F.kind) === "previous_period" || ((A = O.comparison) == null ? void 0 : A.kind) === "previous_year";
|
|
1333
|
+
}), b = f && t.readComparisonDates ? await t.readComparisonDates({ card: r, dashboard: I }) : ka(r), C = fa({ card: r, stated: u, context: { path: m.path, cardRef: m.cardRef, dates: b } });
|
|
1326
1334
|
if (!C.ok)
|
|
1327
1335
|
throw n.push(...C.problems), new me();
|
|
1328
|
-
return o.push(...C.warnings), f &&
|
|
1336
|
+
return o.push(...C.warnings), f && k.set(m.cardId, m.path), C.update ? ($(
|
|
1329
1337
|
{ op: "card.update", cardId: m.cardId, update: { kind: "calculations", calculations: C.update }, changeIndex: m.index },
|
|
1330
1338
|
`${m.path}.query`
|
|
1331
1339
|
), !0) : !1;
|
|
1332
|
-
},
|
|
1340
|
+
}, V = (m) => ({
|
|
1333
1341
|
columns: m.columns,
|
|
1334
1342
|
orientation: m.orientation,
|
|
1335
1343
|
stack: m.stack,
|
|
@@ -1339,62 +1347,63 @@ async function fs(e, a, t, s) {
|
|
|
1339
1347
|
legend: m.legend,
|
|
1340
1348
|
axes: m.axes,
|
|
1341
1349
|
comparisonDisplay: m.comparisonDisplay,
|
|
1342
|
-
inheritComparison: m.inheritComparison
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
C.
|
|
1350
|
+
inheritComparison: m.inheritComparison,
|
|
1351
|
+
band: m.band
|
|
1352
|
+
}), K = (m) => Object.entries(V(m)).filter(([, r]) => r !== void 0).map(([r]) => r), B = (m) => (n.push(...m.slice(0, -1)), y(m[m.length - 1])), se = (m, r, u, f) => {
|
|
1353
|
+
const { card: b } = r, C = [...m.type ? ["type"] : [], ...m.query ? ["query"] : [], ...m.matrix ? ["matrix"] : [], ...K(m)];
|
|
1354
|
+
C.length && y({
|
|
1346
1355
|
code: "invalid_change",
|
|
1347
|
-
message: `"${
|
|
1356
|
+
message: `"${b.title}" is a text card, so it takes no ${et(C)}.`,
|
|
1348
1357
|
path: f,
|
|
1349
1358
|
fix: "Change a card to or from text in the editor, or add a new card and remove this one."
|
|
1350
1359
|
});
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1360
|
+
const O = ja(b, { inputs: I.inputs, variables: I.variables });
|
|
1361
|
+
O.editable || y({ code: "card_not_editable", message: O.message, path: `${f}.cardId`, fix: "Tell the user to change it in the editor.", details: { reason: "text" } });
|
|
1362
|
+
const F = O.editable && (O.form === "legacy_html" || O.form === "legacy_runs");
|
|
1363
|
+
F && m.description !== void 0 && m.text === void 0 && y({
|
|
1355
1364
|
code: "invalid_change",
|
|
1356
|
-
message: `"${
|
|
1365
|
+
message: `"${b.title}" keeps its words in its description, so a description change would replace them.`,
|
|
1357
1366
|
path: `${f}.description`,
|
|
1358
1367
|
fix: "Send the words in text with it: they are stored as rich text, and the description becomes the subtitle."
|
|
1359
|
-
}), d.push({ ref: m.cardId, kind: "card", id:
|
|
1360
|
-
let
|
|
1368
|
+
}), d.push({ ref: m.cardId, kind: "card", id: b.id, title: m.title ?? b.title ?? "", changeIndex: u });
|
|
1369
|
+
let A = !1, R = !1;
|
|
1361
1370
|
if (m.text !== void 0) {
|
|
1362
1371
|
const M = ga({
|
|
1363
1372
|
text: m.text,
|
|
1364
|
-
card:
|
|
1373
|
+
card: b,
|
|
1365
1374
|
// Any variable the catalog offers where the card sits (DV-D13).
|
|
1366
|
-
context: { dashboard:
|
|
1375
|
+
context: { dashboard: I, place: { kind: "sheet", sheetId: r.sheet.id, cardId: b.id } },
|
|
1367
1376
|
path: `${f}.text`,
|
|
1368
|
-
storeAsRichText:
|
|
1377
|
+
storeAsRichText: F && m.description !== void 0
|
|
1369
1378
|
});
|
|
1370
|
-
M.ok || B(M.problems), M.ok && !M.unchanged && ($({ op: "card.update", cardId:
|
|
1379
|
+
M.ok || B(M.problems), M.ok && !M.unchanged && ($({ op: "card.update", cardId: b.id, update: { kind: "text", richContent: M.richContent, clearsLegacy: M.clearsLegacy }, changeIndex: u }, f), A = !0, R = M.clearsLegacy);
|
|
1371
1380
|
}
|
|
1372
|
-
const P = m.title !== void 0 && m.title !==
|
|
1373
|
-
(P ||
|
|
1381
|
+
const P = m.title !== void 0 && m.title !== b.title, q = m.description !== void 0 && (F ? R : (m.description ?? void 0) !== (b.description ?? void 0));
|
|
1382
|
+
(P || q) && ($(
|
|
1374
1383
|
{
|
|
1375
1384
|
op: "card.update",
|
|
1376
|
-
cardId:
|
|
1377
|
-
update: { kind: "rename", ...P ? { title: m.title } : {}, ...
|
|
1385
|
+
cardId: b.id,
|
|
1386
|
+
update: { kind: "rename", ...P ? { title: m.title } : {}, ...q ? { description: m.description } : {} },
|
|
1378
1387
|
changeIndex: u
|
|
1379
1388
|
},
|
|
1380
1389
|
f
|
|
1381
|
-
),
|
|
1390
|
+
), A = !0), A && r.frame.visualId && o.push({
|
|
1382
1391
|
code: "detaches_linked_visual",
|
|
1383
|
-
message: `"${
|
|
1392
|
+
message: `"${b.title}" will stop following its library visual and become local to this dashboard.`,
|
|
1384
1393
|
path: f,
|
|
1385
|
-
details: { cardIds: [
|
|
1394
|
+
details: { cardIds: [b.id] }
|
|
1386
1395
|
});
|
|
1387
1396
|
}, oe = (m, r) => {
|
|
1388
1397
|
if (m.startsWith("$")) {
|
|
1389
1398
|
const u = h.get(m);
|
|
1390
|
-
return (!u || u.kind !== "card") &&
|
|
1399
|
+
return (!u || u.kind !== "card") && y({
|
|
1391
1400
|
code: "handle_unknown",
|
|
1392
1401
|
message: `${m} isn't a card handle defined earlier in this list.`,
|
|
1393
1402
|
path: r,
|
|
1394
1403
|
fix: "Define the handle with an earlier card.add, or use the card id from the outline."
|
|
1395
1404
|
}), u.id;
|
|
1396
1405
|
}
|
|
1397
|
-
return we(
|
|
1406
|
+
return we(I).some((u) => u.cardId === m) || y({
|
|
1398
1407
|
code: "card_not_found",
|
|
1399
1408
|
message: `There's no card ${m} on this dashboard.`,
|
|
1400
1409
|
path: r,
|
|
@@ -1403,88 +1412,88 @@ async function fs(e, a, t, s) {
|
|
|
1403
1412
|
}, te = (m, r) => {
|
|
1404
1413
|
if (m.startsWith("$")) {
|
|
1405
1414
|
const f = h.get(m);
|
|
1406
|
-
return (!f || f.kind !== "filter") &&
|
|
1415
|
+
return (!f || f.kind !== "filter") && y({
|
|
1407
1416
|
code: "handle_unknown",
|
|
1408
1417
|
message: `${m} isn't a filter handle defined earlier in this list.`,
|
|
1409
1418
|
path: r,
|
|
1410
1419
|
fix: "Define the handle with an earlier filter.add, or use the filter id from the outline."
|
|
1411
1420
|
}), f.id;
|
|
1412
1421
|
}
|
|
1413
|
-
return (Array.isArray(
|
|
1422
|
+
return (Array.isArray(I.inputs) ? I.inputs : []).some((f) => f.id === m && f.kind === "filter") || y({
|
|
1414
1423
|
code: "filter_not_found",
|
|
1415
1424
|
message: `There's no filter ${m} on this dashboard.`,
|
|
1416
1425
|
path: r,
|
|
1417
1426
|
fix: "Read the outline again and use its filter ids."
|
|
1418
1427
|
}), m;
|
|
1419
1428
|
}, Bt = (m, r) => {
|
|
1420
|
-
const u = m.startsWith("$") ? void 0 : Je(
|
|
1429
|
+
const u = m.startsWith("$") ? void 0 : Je(I, m);
|
|
1421
1430
|
return u ? u.id : oe(m, r);
|
|
1422
|
-
}, Te = { services: t, problem:
|
|
1431
|
+
}, Te = { services: t, problem: y, refuseAll: B, need: D }, nt = () => (I.sheets ?? []).filter((m) => !Xe(m)), Be = () => nt().map((m) => ({ sheetId: m.id, title: m.title ?? "" })), it = (m, r, u) => {
|
|
1423
1432
|
let f = m;
|
|
1424
1433
|
if (m.startsWith("$")) {
|
|
1425
1434
|
const C = h.get(m);
|
|
1426
|
-
(!C || C.kind !== "sheet") &&
|
|
1435
|
+
(!C || C.kind !== "sheet") && y({
|
|
1427
1436
|
code: "handle_unknown",
|
|
1428
1437
|
message: `${m} isn't a sheet handle defined earlier in this list.`,
|
|
1429
1438
|
path: r,
|
|
1430
1439
|
fix: "Define the handle with an earlier sheet.add, or use the sheet id from the outline."
|
|
1431
1440
|
}), f = C.id;
|
|
1432
1441
|
}
|
|
1433
|
-
const
|
|
1434
|
-
return
|
|
1435
|
-
},
|
|
1436
|
-
var
|
|
1437
|
-
for (const
|
|
1438
|
-
const
|
|
1439
|
-
if (
|
|
1442
|
+
const b = (I.sheets ?? []).find((C) => C.id === f);
|
|
1443
|
+
return b || y({ code: "sheet_not_found", message: `There's no sheet ${f} on this dashboard.`, path: r, fix: "Read the outline again and use its sheet ids.", details: { sheets: Be() } }), u.grid && Xe(b) && y({ code: "sheet_not_a_grid", message: `"${b.title}" is a Document sheet.`, path: r, fix: "Add the card to a grid sheet; Document sheets are changed in the editor.", details: { sheets: Be() } }), b;
|
|
1444
|
+
}, Re = (m, r) => it(m, r, { grid: !0 }), Vt = (m, r) => m.map((u, f) => Re(u, `${r}.sheetIds[${f}]`).id), jt = (m, r, u, f) => {
|
|
1445
|
+
var F;
|
|
1446
|
+
for (const A of Ma(r, u)) y({ ...A, path: `${f}.${A.path}` });
|
|
1447
|
+
const b = Ae[m], C = tt(r), O = r.dateField;
|
|
1448
|
+
if (O && typeof O != "string" && O.label && !r.timeGrain && y({
|
|
1440
1449
|
code: "invalid_change",
|
|
1441
1450
|
message: "A label names a column, and the date field is a column only when the card groups by it.",
|
|
1442
1451
|
path: `${f}.query.dateField.label`,
|
|
1443
1452
|
fix: "Send timeGrain to group by the date, or leave the label out."
|
|
1444
|
-
}), !
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1453
|
+
}), !b.forms.includes(C)) {
|
|
1454
|
+
const A = Object.keys(Ae).filter((R) => Ae[R].forms.includes(C));
|
|
1455
|
+
y({
|
|
1447
1456
|
code: "type_not_supported",
|
|
1448
|
-
message: `A ${m.replace(/_/g, " ")} card takes ${
|
|
1457
|
+
message: `A ${m.replace(/_/g, " ")} card takes ${b.forms.map((R) => Ue[R]).join(" or ")}, not ${Ue[C]}.`,
|
|
1449
1458
|
path: `${f}.query`,
|
|
1450
|
-
fix: `Send ${
|
|
1459
|
+
fix: `Send ${b.forms.map((R) => Ue[R]).join(" or ")}, or use a type this query fits: ${A.join(", ")}.`
|
|
1451
1460
|
});
|
|
1452
1461
|
}
|
|
1453
1462
|
if (C === "measures") {
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1463
|
+
const A = r, R = A.measures.length;
|
|
1464
|
+
b.measures && (R < b.measures.min || b.measures.max !== void 0 && R > b.measures.max) && y({
|
|
1456
1465
|
code: "type_not_supported",
|
|
1457
|
-
message: `A ${m.replace(/_/g, " ")} card shows exactly ${
|
|
1466
|
+
message: `A ${m.replace(/_/g, " ")} card shows exactly ${b.measures.max} measure.`,
|
|
1458
1467
|
path: `${f}.query.measures`,
|
|
1459
1468
|
fix: "Send one measure, or use a table or chart for several."
|
|
1460
|
-
}), !
|
|
1469
|
+
}), !b.dimensions && ((F = A.dimensions) != null && F.length) && y({
|
|
1461
1470
|
code: "type_not_supported",
|
|
1462
1471
|
message: `A ${m.replace(/_/g, " ")} card shows one number, so it has no dimensions.`,
|
|
1463
1472
|
path: `${f}.query.dimensions`,
|
|
1464
1473
|
fix: "Remove the dimensions, or use a table or chart."
|
|
1465
|
-
}), m === "matrix" && (
|
|
1474
|
+
}), m === "matrix" && (A.orderBy || A.limit) && y({
|
|
1466
1475
|
code: "type_not_supported",
|
|
1467
1476
|
message: "A Matrix's sorting and top N are set in the editor.",
|
|
1468
1477
|
path: `${f}.query`,
|
|
1469
1478
|
fix: "Leave out orderBy and limit for a Matrix."
|
|
1470
1479
|
});
|
|
1471
1480
|
}
|
|
1472
|
-
if (
|
|
1481
|
+
if (b.matrixColumns && !u && y({
|
|
1473
1482
|
code: "type_not_supported",
|
|
1474
1483
|
message: "A Matrix needs matrix.columns: the query fields that run across the top.",
|
|
1475
1484
|
path: `${f}.matrix`,
|
|
1476
1485
|
fix: "Send matrix: { columns: [...] } naming dimensions or the date field of the query (an empty list puts nothing across the top)."
|
|
1477
|
-
}), !
|
|
1478
|
-
const
|
|
1479
|
-
P.length && u.columns.length >= P.length && P.every((M) => u.columns.some((U) => be(U,
|
|
1486
|
+
}), !b.matrixColumns && u && y({ code: "type_not_supported", message: "matrix.columns is only for Matrix cards.", path: `${f}.matrix`, fix: 'Leave out matrix, or use type "matrix".' }), u && C === "measures") {
|
|
1487
|
+
const A = r, R = A.datasetName, P = [...A.dimensions ?? [], ...A.timeGrain && A.dateField ? [A.dateField] : []];
|
|
1488
|
+
P.length && u.columns.length >= P.length && P.every((M) => u.columns.some((U) => be(U, R) === be(M, R))) && y({
|
|
1480
1489
|
code: "type_not_supported",
|
|
1481
1490
|
message: "A Matrix needs at least one field down the side.",
|
|
1482
1491
|
path: `${f}.matrix.columns`,
|
|
1483
1492
|
fix: "Leave one dimension or the date field out of matrix.columns."
|
|
1484
1493
|
});
|
|
1485
|
-
const
|
|
1494
|
+
const q = new Set([...A.dimensions ?? [], ...A.dateField ? [A.dateField] : []].map((M) => be(M, R)));
|
|
1486
1495
|
u.columns.forEach((M, U) => {
|
|
1487
|
-
|
|
1496
|
+
q.has(be(M, R)) || y({
|
|
1488
1497
|
code: "type_not_supported",
|
|
1489
1498
|
message: `"${Ct(M)}" isn't one of the query's dimensions or its date field.`,
|
|
1490
1499
|
path: `${f}.matrix.columns[${U}]`,
|
|
@@ -1492,158 +1501,158 @@ async function fs(e, a, t, s) {
|
|
|
1492
1501
|
});
|
|
1493
1502
|
});
|
|
1494
1503
|
}
|
|
1495
|
-
}, Kt = (m, r) =>
|
|
1504
|
+
}, Kt = (m, r) => y({
|
|
1496
1505
|
code: m.code === "query_not_kept" ? "card_not_editable" : "invalid_change",
|
|
1497
1506
|
message: m.message,
|
|
1498
1507
|
path: `${r}.query`,
|
|
1499
1508
|
fix: m.code === "query_not_kept" ? "Tell the user to make this change in the editor." : "Read the outline again and propose again.",
|
|
1500
1509
|
details: { reason: "not_expressible", ..."parts" in m ? { parts: m.parts } : {} }
|
|
1501
|
-
}), Wt = (m, r, u, f,
|
|
1502
|
-
const
|
|
1503
|
-
if (!
|
|
1504
|
-
const
|
|
1505
|
-
if (
|
|
1506
|
-
|
|
1510
|
+
}), Wt = (m, r, u, f, b, C, O) => {
|
|
1511
|
+
const F = Hn(m, r, u, C, O);
|
|
1512
|
+
if (!F.length) return;
|
|
1513
|
+
const A = r;
|
|
1514
|
+
if (F.length === 1 && F[0] === "dateField" && A.dateField && !A.timeGrain && !A.timeWindow) {
|
|
1515
|
+
y({
|
|
1507
1516
|
code: "value_invalid",
|
|
1508
|
-
message: `A dateField on its own doesn't change "${
|
|
1517
|
+
message: `A dateField on its own doesn't change "${b}": it needs timeGrain to group by the date (a KPI's Trend By) or a timeWindow to filter by it.`,
|
|
1509
1518
|
path: `${f}.query.dateField`,
|
|
1510
1519
|
fix: 'Add timeGrain (for example "month") or a timeWindow, or leave out dateField.'
|
|
1511
1520
|
});
|
|
1512
1521
|
return;
|
|
1513
1522
|
}
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1523
|
+
const R = F.join(", ");
|
|
1524
|
+
y({
|
|
1516
1525
|
code: "card_not_editable",
|
|
1517
|
-
message:
|
|
1526
|
+
message: O ? `As changed, "${b}" wouldn't hold ${R} as asked, so make this change in the editor.` : `"${b}" can't be built holding ${R} as asked.`,
|
|
1518
1527
|
path: `${f}.query`,
|
|
1519
|
-
fix:
|
|
1520
|
-
details: { reason: "not_expressible", detail: `doesn't hold: ${
|
|
1528
|
+
fix: O ? "Tell the user to make this change in the editor." : `Leave out ${R}; the rest of the card can be added.`,
|
|
1529
|
+
details: { reason: "not_expressible", detail: `doesn't hold: ${R}` }
|
|
1521
1530
|
});
|
|
1522
|
-
}, Ut = async (m, r, u, f,
|
|
1531
|
+
}, Ut = async (m, r, u, f, b = !1) => {
|
|
1523
1532
|
const C = ct(m);
|
|
1524
1533
|
if ("sql" in r)
|
|
1525
|
-
return
|
|
1526
|
-
const
|
|
1527
|
-
if (!
|
|
1528
|
-
throw n.push(...
|
|
1529
|
-
o.push(...
|
|
1530
|
-
const
|
|
1531
|
-
|
|
1532
|
-
let
|
|
1533
|
-
const P =
|
|
1534
|
+
return D(`${f}.query`), { type: C, source: { kind: "sql", connectionId: r.connectionId, sql: r.sql } };
|
|
1535
|
+
const O = C === "matrixTable" || C === "detailTable" ? "table" : C, F = await t.compileCardQuery({ query: r, chartType: O });
|
|
1536
|
+
if (!F.ok)
|
|
1537
|
+
throw n.push(...F.problems.map((q) => ({ ...q, path: q.path ? `${f}.query.${q.path}` : `${f}.query` }))), new me();
|
|
1538
|
+
o.push(...F.warnings.map((q) => ({ ...q, path: q.path ?? `${f}.query` })));
|
|
1539
|
+
const A = !b && "timeWindow" in r && r.timeWindow ? ci(F.part.config) : void 0;
|
|
1540
|
+
A && "timeWindow" in r && r.timeWindow && hs(r.timeWindow, { use: "cardFilter", columnHasTime: co(A) }, `${f}.query.timeWindow`, y);
|
|
1541
|
+
let R = { ...F.part, type: C };
|
|
1542
|
+
const P = R.config ?? {};
|
|
1534
1543
|
if (C === "detailTable") {
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1544
|
+
const q = uo(fo("table", "detailTable", P)) ?? {};
|
|
1545
|
+
R = { ...R, config: si(q) };
|
|
1537
1546
|
}
|
|
1538
|
-
return C === "matrixTable" && (
|
|
1539
|
-
}, vs = async (m, r, u, f,
|
|
1540
|
-
var
|
|
1547
|
+
return C === "matrixTable" && (R = await vs(R, P, r, u, f)), oi(R, Ne(r));
|
|
1548
|
+
}, vs = async (m, r, u, f, b) => {
|
|
1549
|
+
var q;
|
|
1541
1550
|
const C = await t.loadCardSource({ domainId: u.domainId, datasetName: u.datasetName });
|
|
1542
|
-
if (C ||
|
|
1543
|
-
const
|
|
1544
|
-
(
|
|
1551
|
+
if (C || y({ code: "field_not_found", message: `The dataset "${u.datasetName}" isn't available.`, path: `${b}.query.datasetName`, fix: "Find datasets with semaphor_list_datasets." }), m.source.kind !== "semantic") throw new me();
|
|
1552
|
+
const O = { id: "scratch", title: "", type: "table", dataSource: m.source.dataSource, config: r }, F = ho(O, "matrixTable", { catalog: C.fields, createId: t.newId }), A = F.status === "changed" ? (q = F.card.config) == null ? void 0 : q.matrix : void 0;
|
|
1553
|
+
(F.status !== "changed" || F.leftOut.length || !A) && y({
|
|
1545
1554
|
code: "type_not_supported",
|
|
1546
|
-
message:
|
|
1547
|
-
path: `${
|
|
1555
|
+
message: F.status === "changed" && F.leftOut.length ? `These fields can't run in a Matrix: ${F.leftOut.join(", ")}.` : "This query can't be shown as a Matrix.",
|
|
1556
|
+
path: `${b}.query`,
|
|
1548
1557
|
fix: "Use plain dataset fields for a Matrix, or use a table."
|
|
1549
1558
|
});
|
|
1550
|
-
let
|
|
1559
|
+
let R = A;
|
|
1551
1560
|
const P = u.datasetName;
|
|
1552
1561
|
for (const [M, U] of f.columns.entries()) {
|
|
1553
|
-
const z = [...
|
|
1554
|
-
(W) =>
|
|
1562
|
+
const z = [...R.spec.rows, ...R.spec.columns].find(
|
|
1563
|
+
(W) => po(W.field) === be(U, P)
|
|
1555
1564
|
);
|
|
1556
|
-
z ||
|
|
1565
|
+
z || y({ code: "type_not_supported", message: `"${Ct(U)}" isn't a level of this Matrix.`, path: `${b}.matrix.columns[${M}]`, fix: "Name dimensions or the date field of the query in matrix.columns." }), R = go(R, bo(R.spec, z.id, "columns")).config;
|
|
1557
1566
|
}
|
|
1558
|
-
return { ...m, config: { matrix:
|
|
1567
|
+
return { ...m, config: { matrix: R } };
|
|
1559
1568
|
}, rt = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map();
|
|
1560
|
-
for (const [m, r] of
|
|
1569
|
+
for (const [m, r] of S.entries()) {
|
|
1561
1570
|
const u = `changes[${m}]`;
|
|
1562
1571
|
try {
|
|
1563
1572
|
switch (r.op) {
|
|
1564
1573
|
case "card.add": {
|
|
1565
1574
|
const f = r.position && typeof r.position == "object" ? (() => {
|
|
1566
|
-
const Y = oe(r.position.after, `${u}.position.after`),
|
|
1575
|
+
const Y = oe(r.position.after, `${u}.position.after`), j = we(I).find(
|
|
1567
1576
|
(ne) => ne.cardId === Y && ne.kind === "frameCard"
|
|
1568
1577
|
);
|
|
1569
|
-
return !
|
|
1578
|
+
return !j || j.kind !== "frameCard" ? y({
|
|
1570
1579
|
code: "card_not_found",
|
|
1571
1580
|
message: `${r.position.after} isn't a card on a grid sheet.`,
|
|
1572
1581
|
path: `${u}.position.after`,
|
|
1573
1582
|
fix: "Use a cardId from semaphor_get_dashboard_details on the same sheet, or a handle from this proposal."
|
|
1574
|
-
}) : (r.sheetId &&
|
|
1583
|
+
}) : (r.sheetId && Re(r.sheetId, `${u}.sheetId`).id !== j.sheetId && y({
|
|
1575
1584
|
code: "invalid_change",
|
|
1576
1585
|
message: `position.after names a card on another sheet than ${r.sheetId}.`,
|
|
1577
1586
|
path: `${u}.position.after`,
|
|
1578
1587
|
fix: "Leave out sheetId, or name the card's sheet."
|
|
1579
|
-
}), { sheetId:
|
|
1580
|
-
})() : void 0,
|
|
1588
|
+
}), { sheetId: j.sheetId, frameId: j.frameId });
|
|
1589
|
+
})() : void 0, b = f ? Re(f.sheetId, `${u}.position.after`) : r.sheetId ? Re(r.sheetId, `${u}.sheetId`) : (() => {
|
|
1581
1590
|
const Y = nt();
|
|
1582
|
-
return Y.length !== 1 &&
|
|
1591
|
+
return Y.length !== 1 && y({
|
|
1583
1592
|
code: Y.length ? "sheet_required" : "sheet_not_a_grid",
|
|
1584
1593
|
message: Y.length ? "This dashboard has several grid sheets; say which one gets the card." : "This dashboard has no grid sheet to add a card to.",
|
|
1585
1594
|
path: `${u}.sheetId`,
|
|
1586
1595
|
fix: Y.length ? "Send sheetId: one of details.sheets." : "Add a sheet with sheet.add earlier in this list.",
|
|
1587
1596
|
details: { sheets: Be() }
|
|
1588
1597
|
}), Y[0];
|
|
1589
|
-
})(), C = f ? { after: f.frameId } : typeof r.position == "string" ? r.position : void 0,
|
|
1590
|
-
const
|
|
1591
|
-
return h.has(
|
|
1598
|
+
})(), C = f ? { after: f.frameId } : typeof r.position == "string" ? r.position : void 0, O = C || r.width ? { ...C ? { position: C } : {}, ...r.width ? { width: r.width } : {} } : void 0, F = (Y) => {
|
|
1599
|
+
const j = r.handle ?? `$card_${++x}`;
|
|
1600
|
+
return h.has(j) && y({ code: "invalid_change", message: `The handle ${j} is defined twice.`, path: `${u}.handle`, fix: "Give each new card, filter or sheet its own handle." }), h.set(j, { kind: "card", id: Y.id, title: r.title }), d.push({ ref: j, kind: "card", id: Y.id, title: r.title, changeIndex: m }), j;
|
|
1592
1601
|
};
|
|
1593
1602
|
if (r.type === "text") {
|
|
1594
1603
|
const Y = [...r.query ? ["query"] : [], ...r.matrix ? ["matrix"] : [], ...K(r)];
|
|
1595
|
-
Y.length &&
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1598
|
-
const ne =
|
|
1604
|
+
Y.length && y({ code: "invalid_change", message: `A text card takes no ${et(Y)}.`, path: u, fix: xa }), r.text === void 0 && y({ code: "invalid_change", message: "A text card needs its words in text.", path: `${u}.text`, fix: xa });
|
|
1605
|
+
const j = ga({ text: r.text, context: { dashboard: I, place: { kind: "sheet", sheetId: b.id } }, path: `${u}.text` });
|
|
1606
|
+
j.ok || B(j.problems);
|
|
1607
|
+
const ne = Ho({
|
|
1599
1608
|
id: t.newId(),
|
|
1600
1609
|
title: r.title,
|
|
1601
1610
|
...r.description ? { description: r.description } : {},
|
|
1602
|
-
richContent:
|
|
1611
|
+
richContent: j.ok && !j.unchanged ? j.richContent : { version: 1, blocks: [{ type: "paragraph", children: [] }] }
|
|
1603
1612
|
});
|
|
1604
|
-
$({ op: "card.add", sheetId:
|
|
1613
|
+
$({ op: "card.add", sheetId: b.id, frame: { id: t.newId(), cards: [ne], activeCardId: ne.id }, ...O ? { placement: O } : {}, changeIndex: m }, u), F(ne);
|
|
1605
1614
|
break;
|
|
1606
1615
|
}
|
|
1607
|
-
(r.text !== void 0 || !r.query) &&
|
|
1616
|
+
(r.text !== void 0 || !r.query) && y({
|
|
1608
1617
|
code: "invalid_change",
|
|
1609
1618
|
message: r.text !== void 0 ? `A ${r.type} card takes a query, not text.` : `A ${r.type} card needs a query.`,
|
|
1610
1619
|
path: r.text !== void 0 ? `${u}.text` : `${u}.query`,
|
|
1611
1620
|
fix: "Send query; text is for type text."
|
|
1612
1621
|
});
|
|
1613
|
-
const
|
|
1614
|
-
jt(P,
|
|
1615
|
-
const
|
|
1616
|
-
...
|
|
1617
|
-
type:
|
|
1618
|
-
}, U = ha(M,
|
|
1619
|
-
U.ok ||
|
|
1622
|
+
const A = yt(r.query), R = A.query, P = r.type;
|
|
1623
|
+
jt(P, R, r.matrix, u);
|
|
1624
|
+
const q = await Ut(P, R, r.matrix, u), M = {
|
|
1625
|
+
...zo({ id: t.newId(), title: r.title, ...r.description ? { description: r.description } : {} }),
|
|
1626
|
+
type: q.type
|
|
1627
|
+
}, U = ha(M, q);
|
|
1628
|
+
U.ok || y({ code: "invalid_change", message: U.message, path: u });
|
|
1620
1629
|
const z = U.ok ? U.card : M;
|
|
1621
|
-
Wt(z,
|
|
1630
|
+
Wt(z, R, r.matrix, u, r.title, q);
|
|
1622
1631
|
const W = { id: t.newId(), cards: [z], activeCardId: z.id };
|
|
1623
|
-
$({ op: "card.add", sheetId:
|
|
1624
|
-
const X =
|
|
1625
|
-
c.push(z.id), await L({ cardId: z.id, cardRef: X, stated:
|
|
1632
|
+
$({ op: "card.add", sheetId: b.id, frame: W, ...O ? { placement: O } : {}, changeIndex: m }, u);
|
|
1633
|
+
const X = F(z);
|
|
1634
|
+
c.push(z.id), await L({ cardId: z.id, cardRef: X, stated: A.calculations, index: m, path: u }), await N({
|
|
1626
1635
|
cardId: z.id,
|
|
1627
1636
|
cardRef: X,
|
|
1628
|
-
request: { settings:
|
|
1629
|
-
queryLabels: "sql" in
|
|
1637
|
+
request: { settings: V(r) },
|
|
1638
|
+
queryLabels: "sql" in R ? [] : Ne(R),
|
|
1630
1639
|
index: m,
|
|
1631
1640
|
path: u
|
|
1632
1641
|
});
|
|
1633
1642
|
break;
|
|
1634
1643
|
}
|
|
1635
1644
|
case "card.update": {
|
|
1636
|
-
const f = oe(r.cardId, `${u}.cardId`),
|
|
1637
|
-
if ((
|
|
1638
|
-
se(r,
|
|
1645
|
+
const f = oe(r.cardId, `${u}.cardId`), b = ie(I, f);
|
|
1646
|
+
if ((b == null ? void 0 : b.card.type) === "text") {
|
|
1647
|
+
se(r, b, m, u);
|
|
1639
1648
|
break;
|
|
1640
1649
|
}
|
|
1641
|
-
r.text !== void 0 &&
|
|
1642
|
-
const { card: C, read:
|
|
1643
|
-
let
|
|
1644
|
-
const
|
|
1645
|
-
if (
|
|
1646
|
-
const
|
|
1650
|
+
r.text !== void 0 && y({ code: "invalid_change", message: `"${(b == null ? void 0 : b.card.title) ?? f}" isn't a text card, so it takes no text.`, path: `${u}.text`, fix: "Change its query; text is for text cards." });
|
|
1651
|
+
const { card: C, read: O } = g(f, u);
|
|
1652
|
+
let F = !1, A = [];
|
|
1653
|
+
const R = r.type && r.type !== ((Gt = qe(C)) == null ? void 0 : Gt.type) ? ct(r.type) : void 0;
|
|
1654
|
+
if (R && R !== C.type) {
|
|
1655
|
+
const q = O.editable ? O.source : void 0, M = Zs(C, R), U = M && q && q.kind === "semantic" ? (Qt = await t.loadCardSource({ domainId: q.domainId, datasetName: q.datasetName })) == null ? void 0 : Qt.fields : void 0, z = [], W = eo(C, R, {
|
|
1647
1656
|
...U ? { catalog: U } : {},
|
|
1648
1657
|
...M && !U ? { catalogLoading: !0 } : {},
|
|
1649
1658
|
createId: () => {
|
|
@@ -1651,7 +1660,7 @@ async function fs(e, a, t, s) {
|
|
|
1651
1660
|
return z.push(X), X;
|
|
1652
1661
|
}
|
|
1653
1662
|
});
|
|
1654
|
-
if (W.status === "refused" &&
|
|
1663
|
+
if (W.status === "refused" && y({ code: "type_not_supported", message: "The card's dataset fields couldn't be loaded for a change to or from a Matrix.", path: `${u}.type`, fix: "Send a complete query with the type change." }), W.status === "changed") {
|
|
1655
1664
|
const X = [...W.leftOut, ...W.droppedPreferences];
|
|
1656
1665
|
X.length && o.push({
|
|
1657
1666
|
code: "type_change_drops",
|
|
@@ -1659,39 +1668,39 @@ async function fs(e, a, t, s) {
|
|
|
1659
1668
|
path: `${u}.type`,
|
|
1660
1669
|
details: { dropped: X }
|
|
1661
1670
|
}), $(
|
|
1662
|
-
{ op: "card.update", cardId: f, update: { kind: "retype", type:
|
|
1671
|
+
{ op: "card.update", cardId: f, update: { kind: "retype", type: R, ...U ? { catalog: U } : {}, newIds: z }, changeIndex: m },
|
|
1663
1672
|
`${u}.type`
|
|
1664
|
-
),
|
|
1673
|
+
), F = !0;
|
|
1665
1674
|
}
|
|
1666
1675
|
}
|
|
1667
1676
|
const P = r.query ? yt(r.query) : void 0;
|
|
1668
1677
|
if (r.query || r.matrix) {
|
|
1669
|
-
const
|
|
1678
|
+
const q = ie(I, f).card, M = Ce(q, { sql: !0, calculations: !1 }), U = M.editable ? yt(M.query).query : void 0, z = U, W = di(z, (P == null ? void 0 : P.query) ?? {}, `${u}.query`, (le) => {
|
|
1670
1679
|
if (le.code === "query_form_mismatch" && (P != null && P.calculations.length)) {
|
|
1671
|
-
const pe =
|
|
1680
|
+
const pe = T(q, P.calculations, u), _e = fa({ card: q, stated: pe, context: { path: u, cardRef: r.cardId, dates: ka(q) } });
|
|
1672
1681
|
if (!_e.ok)
|
|
1673
1682
|
throw n.push(..._e.problems), new me();
|
|
1674
1683
|
}
|
|
1675
|
-
return
|
|
1684
|
+
return y(le);
|
|
1676
1685
|
});
|
|
1677
|
-
|
|
1678
|
-
const X = ((Ht = qe(
|
|
1686
|
+
A = ri((P == null ? void 0 : P.query) ?? {}, W);
|
|
1687
|
+
const X = ((Ht = qe(q)) == null ? void 0 : Ht.type) ?? $t(q.type), Y = r.matrix ?? (M.editable ? M.matrix : void 0);
|
|
1679
1688
|
jt(X, W, Y, u);
|
|
1680
|
-
const
|
|
1689
|
+
const j = M.editable && U ? to(U, W, M.matrix, Y) : void 0, ne = !j || j.aspects.length > 0, fe = j && !("sql" in W) ? Ne(W).filter((le) => !ma(j, le.key.role)) : [], H = ao(q, j, fe.map((le) => le.key.role));
|
|
1681
1690
|
H && Kt(H, u);
|
|
1682
1691
|
let de = W;
|
|
1683
|
-
if (
|
|
1692
|
+
if (j && !("sql" in W) && W.orderBy && !j.aspects.includes("order") && ["metric", "group_by", "detail"].some((le) => ma(j, le))) {
|
|
1684
1693
|
const { orderBy: le, ...pe } = W;
|
|
1685
1694
|
de = pe;
|
|
1686
1695
|
}
|
|
1687
|
-
let
|
|
1696
|
+
let Fe;
|
|
1688
1697
|
if (ne) {
|
|
1689
|
-
const le = !!(z && ms(z, (P == null ? void 0 : P.query) ?? {}) && (
|
|
1690
|
-
|
|
1691
|
-
const da =
|
|
1698
|
+
const le = !!(z && ms(z, (P == null ? void 0 : P.query) ?? {}) && (j != null && j.keptWindow)), pe = await Ut(X, de, Y, u, le), _e = pe.type === ct(X) ? { ...pe, type: q.type } : pe;
|
|
1699
|
+
Fe = _e;
|
|
1700
|
+
const da = j ? { ..._e, change: j } : _e, ge = ha(q, da);
|
|
1692
1701
|
if (ge.ok || Kt(ge, u), ge.ok && ge.droppedBindings.length && o.push({
|
|
1693
1702
|
code: "control_binding_dropped",
|
|
1694
|
-
message: `"${
|
|
1703
|
+
message: `"${q.title}" loses the controls bound to the levels or measures this change removes; they stop changing this card.`,
|
|
1695
1704
|
path: `${u}.query`,
|
|
1696
1705
|
fix: "Keep those fields in the query, or tell the user the controls no longer apply to this card.",
|
|
1697
1706
|
details: { controlIds: ge.droppedBindings }
|
|
@@ -1699,16 +1708,16 @@ async function fs(e, a, t, s) {
|
|
|
1699
1708
|
for (const Ve of ge.keptLabels)
|
|
1700
1709
|
o.push({
|
|
1701
1710
|
code: "label_kept_after_change",
|
|
1702
|
-
message: `"${
|
|
1711
|
+
message: `"${q.title}" keeps the label "${Ve.label}" on ${Ve.field}, whose aggregate or time grain changed.`,
|
|
1703
1712
|
path: `${u}.query`,
|
|
1704
1713
|
fix: "State a new label on the field ref if the old one no longer fits.",
|
|
1705
1714
|
details: { columns: [{ label: Ve.label, field: Ve.field }] }
|
|
1706
1715
|
});
|
|
1707
|
-
$({ op: "card.update", cardId: f, update: { kind: "requery", query: da }, changeIndex: m }, `${u}.query`),
|
|
1716
|
+
$({ op: "card.update", cardId: f, update: { kind: "requery", query: da }, changeIndex: m }, `${u}.query`), F = !0;
|
|
1708
1717
|
}
|
|
1709
|
-
fe.length && pa(ie(
|
|
1718
|
+
fe.length && pa(ie(I, f).card, fe).changed.length && $({ op: "card.update", cardId: f, update: { kind: "relabel", labels: fe }, changeIndex: m }, `${u}.query`), (ne || fe.length) && Wt(ie(I, f).card, de, Y, u, q.title ?? "", Fe, j);
|
|
1710
1719
|
}
|
|
1711
|
-
(r.query ||
|
|
1720
|
+
(r.query || R) && await L({ cardId: f, cardRef: r.cardId, stated: (P == null ? void 0 : P.calculations) ?? [], index: m, path: u }) && (F = !0), (r.title !== void 0 || r.description !== void 0) && $(
|
|
1712
1721
|
{
|
|
1713
1722
|
op: "card.update",
|
|
1714
1723
|
cardId: f,
|
|
@@ -1720,173 +1729,173 @@ async function fs(e, a, t, s) {
|
|
|
1720
1729
|
changeIndex: m
|
|
1721
1730
|
},
|
|
1722
1731
|
u
|
|
1723
|
-
), await
|
|
1732
|
+
), await N({
|
|
1724
1733
|
cardId: f,
|
|
1725
1734
|
cardRef: r.cardId,
|
|
1726
|
-
request: { settings:
|
|
1727
|
-
queryLabels:
|
|
1735
|
+
request: { settings: V(r) },
|
|
1736
|
+
queryLabels: A,
|
|
1728
1737
|
index: m,
|
|
1729
1738
|
path: u
|
|
1730
|
-
}),
|
|
1739
|
+
}), F && !c.includes(f) && c.push(f), d.push({ ref: r.cardId, kind: "card", id: f, title: C.title ?? "", changeIndex: m });
|
|
1731
1740
|
break;
|
|
1732
1741
|
}
|
|
1733
1742
|
case "card.remove": {
|
|
1734
|
-
const f = oe(r.cardId, `${u}.cardId`),
|
|
1735
|
-
|
|
1743
|
+
const f = oe(r.cardId, `${u}.cardId`), b = ie(I, f);
|
|
1744
|
+
b || y({ code: "card_not_editable", message: "Cards in Document sections are removed in the editor.", path: `${u}.cardId`, fix: "Tell the user to remove it in the editor.", details: { reason: "document_section" } }), bt(b.frame) && b.frame.cards.length > 1 && y({ code: "card_not_editable", message: "This card is an input of a custom visual; remove it in the editor.", path: `${u}.cardId`, fix: "Tell the user to remove it in the editor.", details: { reason: "custom" } }), b.frame.visualId && b.frame.cards.length > 1 && o.push({
|
|
1736
1745
|
code: "detaches_linked_visual",
|
|
1737
|
-
message: `Removing "${
|
|
1746
|
+
message: `Removing "${b.card.title}" makes the rest of its tile local to this dashboard; it stops following its library visual.`,
|
|
1738
1747
|
path: u,
|
|
1739
|
-
details: { cardIds:
|
|
1740
|
-
}), $({ op: "card.remove", cardId: f, changeIndex: m }, u), d.push({ ref: r.cardId, kind: "card", id: f, title:
|
|
1748
|
+
details: { cardIds: b.frame.cards.filter((C) => C.id !== f).map((C) => C.id) }
|
|
1749
|
+
}), $({ op: "card.remove", cardId: f, changeIndex: m }, u), d.push({ ref: r.cardId, kind: "card", id: f, title: b.card.title ?? "", changeIndex: m });
|
|
1741
1750
|
break;
|
|
1742
1751
|
}
|
|
1743
1752
|
case "filter.add": {
|
|
1744
1753
|
const f = await t.loadCardSource({ domainId: r.domainId, datasetName: r.datasetName });
|
|
1745
|
-
f ||
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1754
|
+
f || y({ code: "field_not_found", message: `The dataset "${r.datasetName}" isn't available in this domain.`, path: `${u}.datasetName`, fix: "Find datasets with semaphor_list_datasets." });
|
|
1755
|
+
const b = ot(f.fields, r.field, r.datasetName);
|
|
1756
|
+
b || y({
|
|
1748
1757
|
code: "field_not_found",
|
|
1749
1758
|
message: `"${r.field}" isn't a field of ${r.datasetName}.`,
|
|
1750
1759
|
path: `${u}.field`,
|
|
1751
1760
|
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
1752
1761
|
details: { available: f.fields.slice(0, 20).map((P) => P.name) }
|
|
1753
1762
|
});
|
|
1754
|
-
const C = r.sheetIds ? Vt(r.sheetIds, u) : void 0,
|
|
1755
|
-
field:
|
|
1763
|
+
const C = r.sheetIds ? Vt(r.sheetIds, u) : void 0, O = Ta(C), F = Qo({
|
|
1764
|
+
field: b,
|
|
1756
1765
|
dataSource: f.dataSource,
|
|
1757
1766
|
connectionId: f.connectionId,
|
|
1758
1767
|
connectionType: f.connectionType,
|
|
1759
|
-
scope:
|
|
1760
|
-
dashboard:
|
|
1768
|
+
scope: O,
|
|
1769
|
+
dashboard: I,
|
|
1761
1770
|
createId: t.newId,
|
|
1762
1771
|
label: r.label
|
|
1763
|
-
}),
|
|
1764
|
-
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1772
|
+
}), A = { ...F.filter };
|
|
1773
|
+
A.dateSelectionMode || (A.type = r.selection ?? "multiple"), r.defaultValues && (A.defaultValues = r.defaultValues), r.defaultPeriod && (A.defaultDateFilter = Ra(r.defaultPeriod, b, `${u}.defaultPeriod`, y)), $({ op: "filter.add", input: { ...F, filter: A }, changeIndex: m }, u), rt.set(F.id, { sheetIds: C ?? "all", changeIndex: m }), (r.defaultValues !== void 0 || r.defaultPeriod !== void 0) && dt.set(F.id, { values: r.defaultValues, period: r.defaultPeriod, changeIndex: m });
|
|
1774
|
+
const R = r.handle;
|
|
1775
|
+
R && (h.has(R) && y({ code: "invalid_change", message: `The handle ${R} is defined twice.`, path: `${u}.handle`, fix: "Give each new card, filter or sheet its own handle." }), h.set(R, { kind: "filter", id: F.id, title: r.label })), d.push({ ref: R ?? F.id, kind: "filter", id: F.id, title: r.label, changeIndex: m });
|
|
1767
1776
|
break;
|
|
1768
1777
|
}
|
|
1769
1778
|
case "filter.update": {
|
|
1770
|
-
const f = te(r.filterId, `${u}.filterId`),
|
|
1771
|
-
|
|
1779
|
+
const f = te(r.filterId, `${u}.filterId`), b = Le(I, f, void 0, v);
|
|
1780
|
+
b != null && b.editable || y({
|
|
1772
1781
|
code: "filter_not_editable",
|
|
1773
|
-
message:
|
|
1782
|
+
message: b && !b.editable ? b.notEditable.message : "This filter can't be changed through the MCP.",
|
|
1774
1783
|
path: `${u}.filterId`,
|
|
1775
1784
|
fix: "Tell the user to change it in the editor; removing or excluding it works."
|
|
1776
1785
|
});
|
|
1777
|
-
const C = (
|
|
1786
|
+
const C = (I.inputs ?? []).find((P) => P.id === f);
|
|
1778
1787
|
if ((C == null ? void 0 : C.kind) !== "filter" || !C.filter) throw new me();
|
|
1779
|
-
const
|
|
1780
|
-
let
|
|
1781
|
-
r.selection && (
|
|
1788
|
+
const O = { ...C.filter };
|
|
1789
|
+
let F = !1;
|
|
1790
|
+
r.selection && (O.type = r.selection), r.defaultValues !== void 0 && (F = !0, r.defaultValues === null ? delete O.defaultValues : O.defaultValues = r.defaultValues), r.defaultPeriod !== void 0 && (F = !0, r.defaultPeriod === null ? delete O.defaultDateFilter : O.defaultDateFilter = Ra(
|
|
1782
1791
|
r.defaultPeriod,
|
|
1783
|
-
{ dataType:
|
|
1792
|
+
{ dataType: O.dataType },
|
|
1784
1793
|
`${u}.defaultPeriod`,
|
|
1785
|
-
|
|
1794
|
+
y
|
|
1786
1795
|
));
|
|
1787
|
-
const
|
|
1796
|
+
const A = r.sheetIds === void 0 ? void 0 : r.sheetIds ? Vt(r.sheetIds, u) : "all", R = {
|
|
1788
1797
|
...r.label !== void 0 ? { label: r.label } : {},
|
|
1789
|
-
...r.selection !== void 0 ||
|
|
1798
|
+
...r.selection !== void 0 || F ? { definition: O } : {},
|
|
1790
1799
|
// A change of sheets states the sheets; what else the scope says (the cards it leaves out,
|
|
1791
1800
|
// whether it covers Document sheets) stays.
|
|
1792
|
-
...
|
|
1801
|
+
...A ? { scope: No(
|
|
1793
1802
|
C.scope,
|
|
1794
|
-
Ta(
|
|
1795
|
-
new Set([...Ot(
|
|
1803
|
+
Ta(A === "all" ? void 0 : A),
|
|
1804
|
+
new Set([...Ot(I).values()].filter((P) => P.sheetKind === "document").map((P) => P.sheetId))
|
|
1796
1805
|
) } : {},
|
|
1797
|
-
...
|
|
1806
|
+
...F ? { values: { defaultChanged: !0, target: {} } } : {}
|
|
1798
1807
|
};
|
|
1799
|
-
$({ op: "filter.update", filterId: f, settings:
|
|
1808
|
+
$({ op: "filter.update", filterId: f, settings: R, changeIndex: m }, u), A && rt.set(f, { sheetIds: A, changeIndex: m }), F && dt.set(f, { values: r.defaultValues, period: r.defaultPeriod, changeIndex: m }), d.push({ ref: r.filterId, kind: "filter", id: f, title: C.label, changeIndex: m });
|
|
1800
1809
|
break;
|
|
1801
1810
|
}
|
|
1802
1811
|
case "filter.remove": {
|
|
1803
|
-
const f = te(r.filterId, `${u}.filterId`),
|
|
1804
|
-
$({ op: "filter.remove", filterId: f, changeIndex: m }, u), d.push({ ref: r.filterId, kind: "filter", id: f, title:
|
|
1812
|
+
const f = te(r.filterId, `${u}.filterId`), b = ((zt = (I.inputs ?? []).find((C) => C.id === f)) == null ? void 0 : zt.label) ?? "";
|
|
1813
|
+
$({ op: "filter.remove", filterId: f, changeIndex: m }, u), d.push({ ref: r.filterId, kind: "filter", id: f, title: b, changeIndex: m });
|
|
1805
1814
|
break;
|
|
1806
1815
|
}
|
|
1807
1816
|
case "filter.bind": {
|
|
1808
|
-
const f = te(r.filterId, `${u}.filterId`),
|
|
1809
|
-
|
|
1817
|
+
const f = te(r.filterId, `${u}.filterId`), b = Le(I, f, void 0, v);
|
|
1818
|
+
b != null && b.editable || y({
|
|
1810
1819
|
code: "filter_not_editable",
|
|
1811
|
-
message:
|
|
1820
|
+
message: b && !b.editable ? b.notEditable.message : "This filter can't be changed through the MCP.",
|
|
1812
1821
|
path: `${u}.filterId`,
|
|
1813
1822
|
fix: "Tell the user to change it in the editor; removing or excluding it works."
|
|
1814
1823
|
});
|
|
1815
|
-
const C = Bt(r.cardId, `${u}.cardId`),
|
|
1816
|
-
$({ op: "filter.bind", filterId: f, cardId: C, binding: { kind: "bound", cardId: C, bindingId: t.newId(), target:
|
|
1824
|
+
const C = Bt(r.cardId, `${u}.cardId`), O = Ua(I, C).card, F = await ui(O, r.field, t, `${u}.field`, y);
|
|
1825
|
+
$({ op: "filter.bind", filterId: f, cardId: C, binding: { kind: "bound", cardId: C, bindingId: t.newId(), target: F }, changeIndex: m }, u), d.push({ ref: r.filterId, kind: "filter", id: f, title: b.label, changeIndex: m });
|
|
1817
1826
|
break;
|
|
1818
1827
|
}
|
|
1819
1828
|
case "layout.arrange": {
|
|
1820
|
-
const f = r.sheetId ?
|
|
1821
|
-
const
|
|
1822
|
-
return
|
|
1823
|
-
code:
|
|
1824
|
-
message:
|
|
1829
|
+
const f = r.sheetId ? Re(r.sheetId, `${u}.sheetId`) : (() => {
|
|
1830
|
+
const b = nt();
|
|
1831
|
+
return b.length !== 1 && y({
|
|
1832
|
+
code: b.length ? "sheet_required" : "sheet_not_a_grid",
|
|
1833
|
+
message: b.length ? "This dashboard has several grid sheets; say which one to arrange." : "This dashboard has no grid sheet to arrange.",
|
|
1825
1834
|
path: `${u}.sheetId`,
|
|
1826
|
-
fix:
|
|
1835
|
+
fix: b.length ? "Send sheetId: one of details.sheets." : "Add a sheet with sheet.add earlier in this list.",
|
|
1827
1836
|
details: { sheets: Be() }
|
|
1828
|
-
}),
|
|
1837
|
+
}), b[0];
|
|
1829
1838
|
})();
|
|
1830
1839
|
$({ op: "layout.arrange", sheetId: f.id, ...r.keepOrder ? { keepOrder: !0 } : {}, changeIndex: m }, u);
|
|
1831
1840
|
break;
|
|
1832
1841
|
}
|
|
1833
1842
|
case "layout.tabs": {
|
|
1834
|
-
const f = r.cardIds.map((
|
|
1835
|
-
new Set(f).size !== f.length &&
|
|
1836
|
-
const C = f.map((
|
|
1837
|
-
C.some((
|
|
1838
|
-
const
|
|
1839
|
-
d.push({ ref: r.cardIds[0], kind: "card", id:
|
|
1840
|
-
const
|
|
1841
|
-
if (f.every((
|
|
1842
|
-
const P = [...new Map(C.map((
|
|
1843
|
+
const f = r.cardIds.map((q, M) => oe(q, `${u}.cardIds[${M}]`)), b = (q, M, U = `${u}.cardIds`) => y({ code: "layout_invalid", message: q, path: U, fix: M });
|
|
1844
|
+
new Set(f).size !== f.length && b("Each card is named once in tabs.", "Name two or more different cards, each once.");
|
|
1845
|
+
const C = f.map((q, M) => ie(I, q) ?? b("A Document section's card can't be a tab.", "Name cards on a grid sheet.", `${u}.cardIds[${M}]`)), O = C[0].sheet;
|
|
1846
|
+
C.some((q) => q.sheet.id !== O.id) && b("Tabs are cards on one sheet.", "Name cards on one sheet; a card moves to another sheet in the editor."), C.some((q) => bt(q.frame) && q.frame.cards.length > 1) && b("A custom visual's inputs stay in its spot.", "Name cards that aren't a custom visual's inputs, or arrange them in the editor.");
|
|
1847
|
+
const F = C[0].frame, A = C[0].card;
|
|
1848
|
+
d.push({ ref: r.cardIds[0], kind: "card", id: A.id, title: A.title ?? "", changeIndex: m });
|
|
1849
|
+
const R = Ba(F);
|
|
1850
|
+
if (f.every((q, M) => R[M] === q)) break;
|
|
1851
|
+
const P = [...new Map(C.map((q) => [q.frame.id, q.frame])).values()].filter((q) => q.visualId);
|
|
1843
1852
|
P.length && o.push({
|
|
1844
1853
|
code: "detaches_linked_visual",
|
|
1845
1854
|
message: "Moving these cards makes the tiles they leave or join local to this dashboard; they stop following their library visuals.",
|
|
1846
1855
|
path: u,
|
|
1847
|
-
details: { cardIds: P.flatMap((
|
|
1848
|
-
}),
|
|
1856
|
+
details: { cardIds: P.flatMap((q) => q.cards.map((M) => M.id)) }
|
|
1857
|
+
}), A.type === "kpi" && C.slice(1).some((q) => q.card.type === "text") && o.push({
|
|
1849
1858
|
code: "tabs_show_as_kpi_info",
|
|
1850
|
-
message: `A text card in ${Va(
|
|
1859
|
+
message: `A text card in ${Va(A.title)}'s spot shows as the KPI's info, not as a tab.`,
|
|
1851
1860
|
path: u,
|
|
1852
1861
|
fix: "Put another card first if the text should be a tab of its own."
|
|
1853
|
-
}), $({ op: "layout.tabs", sheetId:
|
|
1862
|
+
}), $({ op: "layout.tabs", sheetId: O.id, cardIds: f, changeIndex: m }, u);
|
|
1854
1863
|
break;
|
|
1855
1864
|
}
|
|
1856
1865
|
case "layout.untab": {
|
|
1857
|
-
const f = oe(r.cardId, `${u}.cardId`),
|
|
1858
|
-
if (
|
|
1859
|
-
|
|
1866
|
+
const f = oe(r.cardId, `${u}.cardId`), b = ie(I, f);
|
|
1867
|
+
if (b || y({ code: "layout_invalid", message: "A Document section's card has no spot of its own.", path: `${u}.cardId`, fix: "Name a card on a grid sheet." }), bt(b.frame) && b.frame.cards.length > 1 && y({ code: "layout_invalid", message: "A custom visual's inputs stay in its spot.", path: `${u}.cardId`, fix: "Arrange a custom visual in the editor." }), d.push({ ref: r.cardId, kind: "card", id: f, title: b.card.title ?? "", changeIndex: m }), b.frame.cards.length < 2) break;
|
|
1868
|
+
b.frame.visualId && o.push({
|
|
1860
1869
|
code: "detaches_linked_visual",
|
|
1861
|
-
message: `Taking "${
|
|
1870
|
+
message: `Taking "${b.card.title}" out of its tabs makes them local to this dashboard; they stop following their library visual.`,
|
|
1862
1871
|
path: u,
|
|
1863
|
-
details: { cardIds:
|
|
1872
|
+
details: { cardIds: b.frame.cards.map((C) => C.id) }
|
|
1864
1873
|
}), $({ op: "layout.untab", cardId: f, newFrameId: t.newId(), changeIndex: m }, u);
|
|
1865
1874
|
break;
|
|
1866
1875
|
}
|
|
1867
1876
|
case "filter.exclude": {
|
|
1868
|
-
const f = te(r.filterId, `${u}.filterId`),
|
|
1869
|
-
$({ op: "filter.exclude", filterId: f, cardId:
|
|
1877
|
+
const f = te(r.filterId, `${u}.filterId`), b = Bt(r.cardId, `${u}.cardId`), C = ((Yt = (I.inputs ?? []).find((O) => O.id === f)) == null ? void 0 : Yt.label) ?? "";
|
|
1878
|
+
$({ op: "filter.exclude", filterId: f, cardId: b, changeIndex: m }, u), d.push({ ref: r.filterId, kind: "filter", id: f, title: C, changeIndex: m });
|
|
1870
1879
|
break;
|
|
1871
1880
|
}
|
|
1872
1881
|
case "highlight.add":
|
|
1873
1882
|
case "highlight.remove": {
|
|
1874
|
-
const f = oe(r.cardId, `${u}.cardId`), { card:
|
|
1883
|
+
const f = oe(r.cardId, `${u}.cardId`), { card: b } = g(f, u), { op: C, cardId: O, ...F } = r, A = await N({
|
|
1875
1884
|
cardId: f,
|
|
1876
1885
|
cardRef: r.cardId,
|
|
1877
|
-
request: { highlights: r.op === "highlight.add" ? { add: [
|
|
1886
|
+
request: { highlights: r.op === "highlight.add" ? { add: [F] } : { remove: [r.ruleId] } },
|
|
1878
1887
|
queryLabels: [],
|
|
1879
1888
|
index: m,
|
|
1880
1889
|
path: u
|
|
1881
|
-
}),
|
|
1882
|
-
d.push({ ref: r.cardId, kind: "card", id: f, title:
|
|
1890
|
+
}), R = (Xt = (Jt = A == null ? void 0 : A.highlights) == null ? void 0 : Jt.add) == null ? void 0 : Xt[0];
|
|
1891
|
+
d.push({ ref: r.cardId, kind: "card", id: f, title: b.title ?? "", changeIndex: m, ...R ? { ruleId: R.id } : {} });
|
|
1883
1892
|
break;
|
|
1884
1893
|
}
|
|
1885
1894
|
case "sheet.add": {
|
|
1886
1895
|
const f = t.newId();
|
|
1887
1896
|
$({ op: "sheet.add", sheet: { id: f, title: r.title }, changeIndex: m }, u);
|
|
1888
|
-
const
|
|
1889
|
-
h.has(
|
|
1897
|
+
const b = r.handle ?? `$sheet_${++E}`;
|
|
1898
|
+
h.has(b) && y({ code: "invalid_change", message: `The handle ${b} is defined twice.`, path: `${u}.handle`, fix: "Give each new card, filter or sheet its own handle." }), h.set(b, { kind: "sheet", id: f, title: r.title }), d.push({ ref: b, kind: "sheet", id: f, title: r.title, changeIndex: m });
|
|
1890
1899
|
break;
|
|
1891
1900
|
}
|
|
1892
1901
|
case "sheet.update": {
|
|
@@ -1895,12 +1904,12 @@ async function fs(e, a, t, s) {
|
|
|
1895
1904
|
break;
|
|
1896
1905
|
}
|
|
1897
1906
|
case "dashboard.update": {
|
|
1898
|
-
const f = r.title !== void 0 && r.title !==
|
|
1899
|
-
(f !== void 0 ||
|
|
1907
|
+
const f = r.title !== void 0 && r.title !== I.title ? r.title : void 0, b = r.description === null ? I.description ? null : void 0 : r.description !== I.description ? r.description : void 0;
|
|
1908
|
+
(f !== void 0 || b !== void 0) && $(
|
|
1900
1909
|
{
|
|
1901
1910
|
op: "dashboard.update",
|
|
1902
1911
|
...f !== void 0 ? { title: f } : {},
|
|
1903
|
-
...
|
|
1912
|
+
...b !== void 0 ? { description: b } : {},
|
|
1904
1913
|
changeIndex: m
|
|
1905
1914
|
},
|
|
1906
1915
|
u
|
|
@@ -1908,19 +1917,19 @@ async function fs(e, a, t, s) {
|
|
|
1908
1917
|
break;
|
|
1909
1918
|
}
|
|
1910
1919
|
case "dashboard.style": {
|
|
1911
|
-
const { op: f, ...
|
|
1920
|
+
const { op: f, ...b } = r;
|
|
1912
1921
|
w ?? (w = t.readOrganizationAppearance ? t.readOrganizationAppearance() : Promise.resolve(null));
|
|
1913
|
-
const { style: C, organizationAppearance:
|
|
1914
|
-
if (
|
|
1915
|
-
|
|
1922
|
+
const { style: C, organizationAppearance: O } = za(I, await w), F = rn({ style: C, edit: b, layers: { organizationAppearance: O } });
|
|
1923
|
+
if (F.ok)
|
|
1924
|
+
F.sentences.length && $({ op: "dashboard.style", style: F.style, sentences: F.sentences, changeIndex: m }, u);
|
|
1916
1925
|
else {
|
|
1917
|
-
const { refusal:
|
|
1918
|
-
|
|
1926
|
+
const { refusal: A } = F;
|
|
1927
|
+
y({ code: A.code, message: A.message, path: A.field === "edit" ? u : `${u}.${A.field}`, fix: A.fix });
|
|
1919
1928
|
}
|
|
1920
1929
|
break;
|
|
1921
1930
|
}
|
|
1922
1931
|
case "variable.add": {
|
|
1923
|
-
Je(
|
|
1932
|
+
Je(I, r.name) && y({ code: "variable_name_taken", message: `A variable named ${r.name} is already on this dashboard.`, path: `${u}.name`, fix: "Choose another name, or change it with variable.update." });
|
|
1924
1933
|
const f = await wa(
|
|
1925
1934
|
{
|
|
1926
1935
|
id: t.newId(),
|
|
@@ -1932,24 +1941,24 @@ async function fs(e, a, t, s) {
|
|
|
1932
1941
|
...r.emptyText ? { emptyText: r.emptyText } : {},
|
|
1933
1942
|
path: u
|
|
1934
1943
|
},
|
|
1935
|
-
|
|
1944
|
+
I,
|
|
1936
1945
|
Te
|
|
1937
1946
|
);
|
|
1938
1947
|
$({ op: "variable.add", variable: f, changeIndex: m }, u), d.push({ ref: r.name, kind: "variable", id: f.id, title: f.name, changeIndex: m });
|
|
1939
1948
|
break;
|
|
1940
1949
|
}
|
|
1941
1950
|
case "variable.update": {
|
|
1942
|
-
const f =
|
|
1951
|
+
const f = zn(I, r.name, `${u}.name`, Te), b = r.rename ?? f.name, C = {
|
|
1943
1952
|
...r.rename !== void 0 ? { name: r.rename } : {},
|
|
1944
1953
|
...r.label !== void 0 ? { label: r.label } : {},
|
|
1945
1954
|
...r.presentation !== void 0 ? { presentation: r.presentation } : {},
|
|
1946
1955
|
...r.emptyText !== void 0 ? { emptyText: r.emptyText } : {}
|
|
1947
|
-
},
|
|
1956
|
+
}, O = { ...I, variables: (I.variables ?? []).filter((R) => R.id !== f.id) };
|
|
1948
1957
|
if (r.query) {
|
|
1949
|
-
const
|
|
1958
|
+
const R = await wa(
|
|
1950
1959
|
{
|
|
1951
1960
|
id: f.id,
|
|
1952
|
-
name:
|
|
1961
|
+
name: b,
|
|
1953
1962
|
label: r.label === null ? void 0 : r.label ?? f.label,
|
|
1954
1963
|
query: r.query,
|
|
1955
1964
|
get: r.get ?? f.get,
|
|
@@ -1957,36 +1966,36 @@ async function fs(e, a, t, s) {
|
|
|
1957
1966
|
emptyText: r.emptyText === null ? void 0 : r.emptyText ?? f.emptyText,
|
|
1958
1967
|
path: u
|
|
1959
1968
|
},
|
|
1960
|
-
|
|
1969
|
+
O,
|
|
1961
1970
|
Te
|
|
1962
1971
|
);
|
|
1963
|
-
C.query =
|
|
1972
|
+
C.query = R.query, C.get = R.get;
|
|
1964
1973
|
} else if (r.get !== void 0) {
|
|
1965
|
-
const
|
|
1966
|
-
C.query =
|
|
1974
|
+
const R = Xn(f, r.get, O, Te, u);
|
|
1975
|
+
C.query = R.query, C.get = R.get;
|
|
1967
1976
|
}
|
|
1968
|
-
Object.keys(C).length ||
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1977
|
+
Object.keys(C).length || y({ code: "invalid_change", message: `variable.update on ${f.name} changes nothing.`, path: u, fix: "Send rename, label, query, get, presentation or emptyText." });
|
|
1978
|
+
const F = { ...f, ...Object.fromEntries(Object.entries(C).map(([R, P]) => [R, P ?? void 0])), id: f.id }, A = Dt(F, { ...O, variables: [...O.variables, F] });
|
|
1979
|
+
A.length && B(cs(A, u)), $({ op: "variable.update", variableId: f.id, patch: C, changeIndex: m }, u), d.push({ ref: r.name, kind: "variable", id: f.id, title: b, changeIndex: m });
|
|
1971
1980
|
break;
|
|
1972
1981
|
}
|
|
1973
1982
|
case "variable.remove": {
|
|
1974
|
-
const f = Je(
|
|
1975
|
-
f ||
|
|
1976
|
-
const
|
|
1977
|
-
C.places.length &&
|
|
1983
|
+
const f = Je(I, r.name);
|
|
1984
|
+
f || y(ls(I, r.name, `${u}.name`));
|
|
1985
|
+
const b = f, C = Zn(I, b.id);
|
|
1986
|
+
C.places.length && y({
|
|
1978
1987
|
code: "variable_in_use",
|
|
1979
|
-
message: `${
|
|
1988
|
+
message: `${b.name} is shown in ${C.words}.`,
|
|
1980
1989
|
path: `${u}.name`,
|
|
1981
1990
|
fix: "Remove its chips first (card.update with text, or document.text.update), or ask the user whether the chips should read as missing.",
|
|
1982
1991
|
details: { places: C.places }
|
|
1983
|
-
}), $({ op: "variable.remove", variableId:
|
|
1992
|
+
}), $({ op: "variable.remove", variableId: b.id, changeIndex: m }, u), d.push({ ref: r.name, kind: "variable", id: b.id, title: b.name, changeIndex: m });
|
|
1984
1993
|
break;
|
|
1985
1994
|
}
|
|
1986
1995
|
case "document.text.update": {
|
|
1987
|
-
const f = it(r.sheetId, `${u}.sheetId`, { grid: !1 }), { edit:
|
|
1996
|
+
const f = it(r.sheetId, `${u}.sheetId`, { grid: !1 }), { edit: b, unchanged: C } = ei(r, I, f, u, Te);
|
|
1988
1997
|
if (d.push({ ref: r.sheetId, kind: "sheet", id: f.id, title: f.title ?? "", changeIndex: m }), C) break;
|
|
1989
|
-
$({ op: "document.text", sheetId: f.id, edit:
|
|
1998
|
+
$({ op: "document.text", sheetId: f.id, edit: b, changeIndex: m }, u);
|
|
1990
1999
|
break;
|
|
1991
2000
|
}
|
|
1992
2001
|
default: {
|
|
@@ -2015,67 +2024,67 @@ async function fs(e, a, t, s) {
|
|
|
2015
2024
|
for (const m of c) {
|
|
2016
2025
|
const r = ie(ae.dashboard, m);
|
|
2017
2026
|
if (!r) continue;
|
|
2018
|
-
const u = ((ea = i.find((
|
|
2019
|
-
f.editable && ("sql" in f.query ? !!f.query.sql : "measures" in f.query ? f.query.measures.length > 0 : f.query.columns.length > 0) && ((aa = Ae[
|
|
2027
|
+
const u = ((ea = i.find((O) => Pt(O) === m)) == null ? void 0 : ea.changeIndex) ?? 0, f = Ce(r.card, { sql: !0 }), b = ((ta = qe(r.card)) == null ? void 0 : ta.type) ?? $t(r.card.type);
|
|
2028
|
+
f.editable && ("sql" in f.query ? !!f.query.sql : "measures" in f.query ? f.query.measures.length > 0 : f.query.columns.length > 0) && ((aa = Ae[b]) == null ? void 0 : aa.forms.includes(tt(f.query))) || n.push({
|
|
2020
2029
|
code: "type_not_supported",
|
|
2021
|
-
message: `As changed, "${r.card.title}" would have no query a ${
|
|
2030
|
+
message: `As changed, "${r.card.title}" would have no query a ${b.replace(/_/g, " ")} can run.`,
|
|
2022
2031
|
path: `changes[${u}]`,
|
|
2023
|
-
fix: `Send a complete query with the type change: ${((sa = Ae[
|
|
2032
|
+
fix: `Send a complete query with the type change: ${((sa = Ae[b]) == null ? void 0 : sa.forms.map((O) => Ue[O]).join(" or ")) ?? "a measures query"}.`
|
|
2024
2033
|
});
|
|
2025
2034
|
}
|
|
2026
|
-
if (n.push(...
|
|
2035
|
+
if (n.push(...ni(e, ae.dashboard, i, rt, v)), n.push(...ii(ae.dashboard, dt, t.calendar)), n.length) return { ok: !1, problems: n };
|
|
2027
2036
|
for (const m of i) {
|
|
2028
2037
|
if (m.op !== "filter.add" && !(m.op === "filter.update" && m.settings.scope)) continue;
|
|
2029
|
-
const r = m.op === "filter.add" ? m.input.id : m.filterId, u = Le(ae.dashboard, r, void 0,
|
|
2038
|
+
const r = m.op === "filter.add" ? m.input.id : m.filterId, u = Le(ae.dashboard, r, void 0, v);
|
|
2030
2039
|
if (!(u != null && u.editable)) continue;
|
|
2031
|
-
const f = async (
|
|
2032
|
-
const
|
|
2033
|
-
for (const
|
|
2034
|
-
const P =
|
|
2040
|
+
const f = async (F) => {
|
|
2041
|
+
const A = [];
|
|
2042
|
+
for (const R of F) {
|
|
2043
|
+
const P = R.datasetName ? await t.findRelationshipFields({
|
|
2035
2044
|
domainId: u.domainId,
|
|
2036
2045
|
fromDataset: u.datasetName,
|
|
2037
2046
|
field: u.field,
|
|
2038
|
-
toDataset:
|
|
2047
|
+
toDataset: R.datasetName
|
|
2039
2048
|
}) : [];
|
|
2040
|
-
|
|
2049
|
+
A.push({ ...R, suggestedFields: P });
|
|
2041
2050
|
}
|
|
2042
|
-
return
|
|
2043
|
-
},
|
|
2051
|
+
return A;
|
|
2052
|
+
}, b = (F) => F.map((A) => `"${A.title}"`).join(", "), C = u.notReached.filter((F) => F.reason === "sql_no_filter_reference"), O = u.notReached.filter((F) => F.reason !== "sql_no_filter_reference");
|
|
2044
2053
|
if (C.length && o.push({
|
|
2045
2054
|
code: "filter_not_reaching_cards",
|
|
2046
|
-
message: `"${u.label}" doesn't reach ${C.length} SQL card${C.length === 1 ? "" : "s"} whose SQL doesn't use dashboard filters: ${
|
|
2055
|
+
message: `"${u.label}" doesn't reach ${C.length} SQL card${C.length === 1 ? "" : "s"} whose SQL doesn't use dashboard filters: ${b(C)}.`,
|
|
2047
2056
|
path: `changes[${m.changeIndex ?? 0}]`,
|
|
2048
2057
|
fix: "To filter a SQL card, add {{ filters | where }} to its SQL (or {{ filters | and }} after an existing WHERE) with card.update, or leave it unfiltered.",
|
|
2049
2058
|
details: { cards: C }
|
|
2050
|
-
}),
|
|
2051
|
-
const
|
|
2059
|
+
}), O.length) {
|
|
2060
|
+
const F = await f(O);
|
|
2052
2061
|
o.push({
|
|
2053
2062
|
code: "filter_not_reaching_cards",
|
|
2054
|
-
message: `"${u.label}" doesn't reach ${
|
|
2063
|
+
message: `"${u.label}" doesn't reach ${F.length} card${F.length === 1 ? "" : "s"} on its sheets: ${b(F)}.`,
|
|
2055
2064
|
path: `changes[${m.changeIndex ?? 0}]`,
|
|
2056
2065
|
fix: "Add filter.bind with one of the suggested fields to reach a card, or leave it unfiltered.",
|
|
2057
|
-
details: { cards:
|
|
2066
|
+
details: { cards: F }
|
|
2058
2067
|
});
|
|
2059
2068
|
}
|
|
2060
2069
|
if ((oa = u.sqlPending) != null && oa.length && o.push({
|
|
2061
2070
|
code: "filter_reach_through_sql",
|
|
2062
|
-
message: `"${u.label}" may reach ${u.sqlPending.length} SQL card${u.sqlPending.length === 1 ? "" : "s"} as ${u.sqlPending.length === 1 ? "its" : "their"} SQL decides: ${
|
|
2071
|
+
message: `"${u.label}" may reach ${u.sqlPending.length} SQL card${u.sqlPending.length === 1 ? "" : "s"} as ${u.sqlPending.length === 1 ? "its" : "their"} SQL decides: ${b(u.sqlPending)}.`,
|
|
2063
2072
|
path: `changes[${m.changeIndex ?? 0}]`,
|
|
2064
2073
|
fix: "Read the card's SQL to tell the user whether it uses this filter.",
|
|
2065
2074
|
details: { cards: u.sqlPending }
|
|
2066
2075
|
}), (na = u.relationshipPending) != null && na.length) {
|
|
2067
|
-
const
|
|
2076
|
+
const F = await f(u.relationshipPending);
|
|
2068
2077
|
o.push({
|
|
2069
2078
|
code: "filter_reach_through_relationships",
|
|
2070
|
-
message: `"${u.label}" may reach ${
|
|
2079
|
+
message: `"${u.label}" may reach ${F.length} card${F.length === 1 ? "" : "s"} on its sheets through the domain's relationships: ${b(F)}. Whether it applies is decided when each card runs.`,
|
|
2071
2080
|
path: `changes[${m.changeIndex ?? 0}]`,
|
|
2072
2081
|
fix: "Add filter.bind with one of the suggested fields to make it certain, or leave it to the relationships.",
|
|
2073
|
-
details: { cards:
|
|
2082
|
+
details: { cards: F }
|
|
2074
2083
|
});
|
|
2075
2084
|
}
|
|
2076
2085
|
}
|
|
2077
2086
|
if (t.readComparisonDates)
|
|
2078
|
-
for (const [m, r] of
|
|
2087
|
+
for (const [m, r] of k) {
|
|
2079
2088
|
const u = (ia = ie(ae.dashboard, m)) == null ? void 0 : ia.card;
|
|
2080
2089
|
if (!u) continue;
|
|
2081
2090
|
const f = await t.readComparisonDates({ card: u, dashboard: ae.dashboard });
|
|
@@ -2086,7 +2095,7 @@ async function fs(e, a, t, s) {
|
|
|
2086
2095
|
fix: "Add a timeWindow on that date, or a dashboard date filter that reaches the card."
|
|
2087
2096
|
});
|
|
2088
2097
|
}
|
|
2089
|
-
const Is =
|
|
2098
|
+
const Is = ai(ae.dashboard, i, ae.descriptions, v);
|
|
2090
2099
|
return {
|
|
2091
2100
|
ok: !0,
|
|
2092
2101
|
operations: i,
|
|
@@ -2100,7 +2109,7 @@ async function fs(e, a, t, s) {
|
|
|
2100
2109
|
warnings: o
|
|
2101
2110
|
};
|
|
2102
2111
|
}
|
|
2103
|
-
function
|
|
2112
|
+
function ai(e, a, t, s) {
|
|
2104
2113
|
const n = a.filter((l) => l.op === "card.add");
|
|
2105
2114
|
if (!n.length) return [...t];
|
|
2106
2115
|
const o = as(e, void 0, s);
|
|
@@ -2110,24 +2119,24 @@ function ti(e, a, t, s) {
|
|
|
2110
2119
|
const c = Pt(l);
|
|
2111
2120
|
if (!c || l.changeIndex === void 0) continue;
|
|
2112
2121
|
const h = o.filter((_) => _.reaches.includes(c)).map((_) => _.label), p = (_) => o.filter(
|
|
2113
|
-
(
|
|
2114
|
-
var
|
|
2115
|
-
return "notReached" in
|
|
2122
|
+
(S) => {
|
|
2123
|
+
var y;
|
|
2124
|
+
return "notReached" in S && ((y = S.notReached) == null ? void 0 : y.some((D) => D.cardId === c && D.reason === "sql_no_filter_reference" === _));
|
|
2116
2125
|
}
|
|
2117
|
-
).map((
|
|
2118
|
-
var
|
|
2119
|
-
return (
|
|
2126
|
+
).map((S) => S.label), v = p(!1), I = p(!0), w = o.filter((_) => {
|
|
2127
|
+
var S;
|
|
2128
|
+
return (S = _.relationshipPending) == null ? void 0 : S.some((y) => y.cardId === c);
|
|
2120
2129
|
}).map((_) => _.label), x = o.filter((_) => {
|
|
2121
|
-
var
|
|
2122
|
-
return (
|
|
2123
|
-
}).map((_) => _.label),
|
|
2130
|
+
var S;
|
|
2131
|
+
return (S = _.sqlPending) == null ? void 0 : S.some((y) => y.cardId === c);
|
|
2132
|
+
}).map((_) => _.label), E = [
|
|
2124
2133
|
...h.length ? [`The dashboard's ${i(h)} filter${h.length === 1 ? " applies" : "s apply"} to it.`] : [],
|
|
2125
|
-
...
|
|
2126
|
-
...
|
|
2134
|
+
...v.length ? [`${i(v)} ${v.length === 1 ? "doesn't" : "don't"} reach it.`] : [],
|
|
2135
|
+
...I.length ? [`${i(I)} ${I.length === 1 ? "doesn't" : "don't"} reach it: its SQL doesn't use dashboard filters.`] : [],
|
|
2127
2136
|
...w.length ? [`${i(w)} may reach it through the domain's relationships.`] : [],
|
|
2128
2137
|
...x.length ? [`${i(x)} may apply through its SQL.`] : []
|
|
2129
2138
|
];
|
|
2130
|
-
|
|
2139
|
+
E.length && d.set(l.changeIndex, E.join(" "));
|
|
2131
2140
|
}
|
|
2132
2141
|
return t.map((l) => {
|
|
2133
2142
|
const c = l.changeIndex === void 0 ? void 0 : d.get(l.changeIndex);
|
|
@@ -2139,25 +2148,25 @@ function Pt(e) {
|
|
|
2139
2148
|
if (e.op === "card.update" || e.op === "card.remove") return e.cardId;
|
|
2140
2149
|
if (e.op === "card.add") return (a = e.frame.cards[0]) == null ? void 0 : a.id;
|
|
2141
2150
|
}
|
|
2142
|
-
function
|
|
2151
|
+
function si(e) {
|
|
2143
2152
|
return Object.fromEntries(
|
|
2144
|
-
|
|
2153
|
+
mo.flatMap((a) => e[a] === void 0 ? [] : [[a, e[a]]])
|
|
2145
2154
|
);
|
|
2146
2155
|
}
|
|
2147
|
-
function
|
|
2156
|
+
function oi(e, a) {
|
|
2148
2157
|
if (!a.length || !e.config) return e;
|
|
2149
2158
|
const t = { ...e.config }, s = [];
|
|
2150
2159
|
if (t.matrix) {
|
|
2151
|
-
const o = t.matrix, i =
|
|
2160
|
+
const o = t.matrix, i = yo(o), d = [...o.spec.rows, ...o.spec.columns], l = { ...o.presentation.levelLabels }, c = { ...o.presentation.measureLabels };
|
|
2152
2161
|
for (const { key: h, label: p } of a) {
|
|
2153
2162
|
if (h.role === "metric") {
|
|
2154
|
-
const
|
|
2155
|
-
if (
|
|
2156
|
-
c[o.spec.measures[
|
|
2163
|
+
const v = i.measures.findIndex((I) => He(I, h));
|
|
2164
|
+
if (v < 0) continue;
|
|
2165
|
+
c[o.spec.measures[v].id] = p;
|
|
2157
2166
|
} else {
|
|
2158
|
-
const
|
|
2159
|
-
if (
|
|
2160
|
-
l[d[
|
|
2167
|
+
const v = i.levels.findIndex((I) => He(I, h));
|
|
2168
|
+
if (v < 0) continue;
|
|
2169
|
+
l[d[v].id] = p;
|
|
2161
2170
|
}
|
|
2162
2171
|
s.push(h);
|
|
2163
2172
|
}
|
|
@@ -2166,62 +2175,62 @@ function si(e, a) {
|
|
|
2166
2175
|
const n = { metric: "metricColumns", group_by: "groupByColumns", detail: "detailColumns" };
|
|
2167
2176
|
for (const { key: o, label: i } of a) {
|
|
2168
2177
|
const d = [...t[n[o.role]] ?? []], l = Ka(o.role, d).findIndex((c) => He(c, o));
|
|
2169
|
-
l < 0 || (d[l] =
|
|
2178
|
+
l < 0 || (d[l] = fn(d[l], i), t[n[o.role]] = d, s.push(o));
|
|
2170
2179
|
}
|
|
2171
2180
|
return { ...e, config: t, statedLabels: s };
|
|
2172
2181
|
}
|
|
2173
|
-
function
|
|
2174
|
-
var
|
|
2182
|
+
function ni(e, a, t, s, n) {
|
|
2183
|
+
var E;
|
|
2175
2184
|
const o = [], i = new Map(we(a).map((_) => [_.cardId, _])), d = Ot(a), l = $e(a), c = (_) => {
|
|
2176
|
-
var
|
|
2177
|
-
return ((
|
|
2178
|
-
}, h = (_,
|
|
2179
|
-
var
|
|
2180
|
-
return ((
|
|
2181
|
-
}, p = (_,
|
|
2182
|
-
const
|
|
2183
|
-
if (
|
|
2185
|
+
var S, y;
|
|
2186
|
+
return ((y = (S = a.sheets) == null ? void 0 : S.find((D) => D.id === _)) == null ? void 0 : y.title) ?? _;
|
|
2187
|
+
}, h = (_, S) => {
|
|
2188
|
+
var y;
|
|
2189
|
+
return ((y = [...t].reverse().find((D) => Pt(D) === S || "filterId" in D && D.filterId === _)) == null ? void 0 : y.changeIndex) ?? 0;
|
|
2190
|
+
}, p = (_, S) => {
|
|
2191
|
+
const y = l.findFilterInput({ inputId: _ }).input, D = i.get(S), $ = `"${D.card.title ?? ""}"`, N = `"${y.label}"`;
|
|
2192
|
+
if (D.kind === "documentSectionCard")
|
|
2184
2193
|
return {
|
|
2185
2194
|
reason: "document_section",
|
|
2186
2195
|
message: `${$} is in a Document section, which takes only the filters its Document sheet shows.`,
|
|
2187
2196
|
fix: "Tell the user to change where the filter shows in the editor."
|
|
2188
2197
|
};
|
|
2189
|
-
const
|
|
2190
|
-
if (
|
|
2198
|
+
const g = d.get(D.sheetId);
|
|
2199
|
+
if (g && !Ga(y, g))
|
|
2191
2200
|
return {
|
|
2192
2201
|
reason: "outside_sheets",
|
|
2193
|
-
message: `${
|
|
2202
|
+
message: `${N} isn't shown on "${c(D.sheetId)}", so it can't filter ${$}.`,
|
|
2194
2203
|
fix: "Show it on that sheet first with filter.update sheetIds (null for every sheet), in the same proposal."
|
|
2195
2204
|
};
|
|
2196
|
-
const
|
|
2197
|
-
switch (
|
|
2205
|
+
const k = vo(y, D.card);
|
|
2206
|
+
switch (k.status) {
|
|
2198
2207
|
case "incompatible":
|
|
2199
|
-
return { reason: "incompatible_field", message: `${$} can't take ${
|
|
2208
|
+
return { reason: "incompatible_field", message: `${$} can't take ${N}'s values on that field: their types differ.`, fix: "Bind a field of the same type (filter.bind)." };
|
|
2200
2209
|
case "stale":
|
|
2201
2210
|
return {
|
|
2202
2211
|
reason: "field_not_on_card",
|
|
2203
|
-
message: `${$} doesn't have the field ${
|
|
2212
|
+
message: `${$} doesn't have the field ${N} is bound to.`,
|
|
2204
2213
|
fix: "Bind a field the card has (filter.bind), or exclude the card (filter.exclude), in the same proposal."
|
|
2205
2214
|
};
|
|
2206
2215
|
case "ambiguous":
|
|
2207
2216
|
return {
|
|
2208
2217
|
reason: "ambiguous_field",
|
|
2209
|
-
message: `${$} has more than one field ${
|
|
2218
|
+
message: `${$} has more than one field ${N} could filter.`,
|
|
2210
2219
|
fix: "Bind the field it should use (filter.bind), or exclude the card (filter.exclude), in the same proposal."
|
|
2211
2220
|
};
|
|
2212
2221
|
case "relationship": {
|
|
2213
|
-
const
|
|
2214
|
-
return
|
|
2222
|
+
const T = Ee(y, D.card, n);
|
|
2223
|
+
return T.reach === "blocked" ? {
|
|
2215
2224
|
reason: "relationship_route_changed",
|
|
2216
|
-
message: `The relationships ${$} used for ${
|
|
2225
|
+
message: `The relationships ${$} used for ${N} changed in the domain.`,
|
|
2217
2226
|
fix: "Tell the user to choose the relationship again in the filter's Cards tab."
|
|
2218
|
-
} :
|
|
2227
|
+
} : T.reason === "relationship_ambiguous" ? {
|
|
2219
2228
|
reason: "relationship_ambiguous",
|
|
2220
|
-
message: `${
|
|
2229
|
+
message: `${N} connects to ${$} through more than one path.`,
|
|
2221
2230
|
fix: "Tell the user to choose a path in the filter's Cards tab, or bind a field the card has (filter.bind)."
|
|
2222
2231
|
} : {
|
|
2223
2232
|
reason: "relationship_pending",
|
|
2224
|
-
message: `${
|
|
2233
|
+
message: `${N} may reach ${$} through the domain's relationships; whether it applies is decided when the card runs.`,
|
|
2225
2234
|
fix: "Bind a field the card has (filter.bind) to make it certain, or leave it to the relationships."
|
|
2226
2235
|
};
|
|
2227
2236
|
}
|
|
@@ -2232,22 +2241,22 @@ function oi(e, a, t, s, n) {
|
|
|
2232
2241
|
case "automatic":
|
|
2233
2242
|
case "passthrough":
|
|
2234
2243
|
case "notApplicable":
|
|
2235
|
-
return { reason: "filter_settings_override", message: `${
|
|
2244
|
+
return { reason: "filter_settings_override", message: `${N} still wouldn't filter ${$}: its settings leave that card out.`, fix: "Tell the user to change the filter's settings in the editor." };
|
|
2236
2245
|
default: {
|
|
2237
|
-
const
|
|
2238
|
-
throw new Error(`Unhandled filter card target ${String(
|
|
2246
|
+
const T = k;
|
|
2247
|
+
throw new Error(`Unhandled filter card target ${String(T.status)}`);
|
|
2239
2248
|
}
|
|
2240
2249
|
}
|
|
2241
|
-
},
|
|
2250
|
+
}, v = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Map();
|
|
2242
2251
|
for (const _ of t)
|
|
2243
|
-
(_.op === "filter.bind" || _.op === "filter.exclude") &&
|
|
2244
|
-
for (const _ of
|
|
2245
|
-
const
|
|
2246
|
-
if (!
|
|
2247
|
-
const
|
|
2248
|
-
if (_.op === "filter.bind" ?
|
|
2249
|
-
|
|
2250
|
-
const $ = _.op === "filter.bind" ? p(_.filterId, _.cardId) : { reason: "filter_settings_override", message: `"${
|
|
2252
|
+
(_.op === "filter.bind" || _.op === "filter.exclude") && I.set(`${_.filterId}|${_.cardId}`, _);
|
|
2253
|
+
for (const _ of I.values()) {
|
|
2254
|
+
const S = Le(a, _.filterId, void 0, n), y = i.get(_.cardId);
|
|
2255
|
+
if (!S || !y) continue;
|
|
2256
|
+
const D = S.reaches.includes(_.cardId);
|
|
2257
|
+
if (_.op === "filter.bind" ? D : !D) continue;
|
|
2258
|
+
v.add(`${_.filterId}|${_.cardId}`);
|
|
2259
|
+
const $ = _.op === "filter.bind" ? p(_.filterId, _.cardId) : { reason: "filter_settings_override", message: `"${S.label}" would still filter "${y.card.title ?? ""}".`, fix: "Tell the user to change the filter's settings in the editor." };
|
|
2251
2260
|
o.push({
|
|
2252
2261
|
code: "filter_not_editable",
|
|
2253
2262
|
message: $.message,
|
|
@@ -2256,61 +2265,61 @@ function oi(e, a, t, s, n) {
|
|
|
2256
2265
|
details: { reason: $.reason, cardId: _.cardId }
|
|
2257
2266
|
});
|
|
2258
2267
|
}
|
|
2259
|
-
for (const [_,
|
|
2260
|
-
const
|
|
2261
|
-
if (!
|
|
2262
|
-
const
|
|
2263
|
-
var
|
|
2264
|
-
return ((
|
|
2265
|
-
})), $ =
|
|
2266
|
-
Pe($ === "all" || !$ ? $ : [...$].sort(),
|
|
2268
|
+
for (const [_, S] of s) {
|
|
2269
|
+
const y = Le(a, _, void 0, n);
|
|
2270
|
+
if (!y) continue;
|
|
2271
|
+
const D = y.editable && ((E = y.exceptSheetIds) == null ? void 0 : E.some((g) => {
|
|
2272
|
+
var k;
|
|
2273
|
+
return ((k = d.get(g)) == null ? void 0 : k.sheetKind) === "dashboard";
|
|
2274
|
+
})), $ = y.editable && !D ? y.sheetIds : void 0, N = S.sheetIds === "all" ? "all" : [...S.sheetIds].sort();
|
|
2275
|
+
Pe($ === "all" || !$ ? $ : [...$].sort(), N) || o.push({
|
|
2267
2276
|
code: "filter_not_editable",
|
|
2268
|
-
message: `"${
|
|
2269
|
-
path: `changes[${
|
|
2277
|
+
message: `"${y.label}" wouldn't show on the sheets asked for. Change where it shows in the editor.`,
|
|
2278
|
+
path: `changes[${S.changeIndex}].sheetIds`,
|
|
2270
2279
|
fix: "Tell the user to change the filter's sheets in the editor.",
|
|
2271
2280
|
details: { reason: "filter_settings_override", ...$ ? { sheetIds: $ } : {} }
|
|
2272
2281
|
});
|
|
2273
2282
|
}
|
|
2274
2283
|
const w = $e(e), x = (_) => _ === "blocked" || _ === "ambiguous";
|
|
2275
2284
|
for (const _ of l.inputs) {
|
|
2276
|
-
const
|
|
2277
|
-
for (const
|
|
2278
|
-
if (
|
|
2279
|
-
const
|
|
2280
|
-
if (
|
|
2281
|
-
const
|
|
2285
|
+
const S = _.input.id;
|
|
2286
|
+
for (const y of l.reachedCards({ inputId: S })) {
|
|
2287
|
+
if (v.has(`${S}|${y.cardId}`) || !x(Ee(_.input, y.card, n).reach)) continue;
|
|
2288
|
+
const D = w.findFilterInput({ inputId: S }), $ = D && w.reachedCards({ inputId: S }).find((g) => g.cardId === y.cardId);
|
|
2289
|
+
if (D && $ && x(Ee(D.input, $.card, n).reach)) continue;
|
|
2290
|
+
const N = p(S, y.cardId);
|
|
2282
2291
|
o.push({
|
|
2283
2292
|
code: "invalid_change",
|
|
2284
|
-
message: `${
|
|
2285
|
-
path: `changes[${h(
|
|
2286
|
-
fix:
|
|
2287
|
-
details: { reason:
|
|
2293
|
+
message: `${N.message} The card would stop showing data while "${_.input.label}" has a value.`,
|
|
2294
|
+
path: `changes[${h(S, y.cardId)}]`,
|
|
2295
|
+
fix: N.fix,
|
|
2296
|
+
details: { reason: N.reason, filterId: S, cardId: y.cardId }
|
|
2288
2297
|
});
|
|
2289
2298
|
}
|
|
2290
2299
|
}
|
|
2291
2300
|
return o;
|
|
2292
2301
|
}
|
|
2293
|
-
function
|
|
2302
|
+
function ii(e, a, t) {
|
|
2294
2303
|
const s = [], n = $e(e);
|
|
2295
2304
|
for (const [o, i] of a) {
|
|
2296
2305
|
const d = n.findFilterInput({ inputId: o });
|
|
2297
2306
|
if (!d) continue;
|
|
2298
|
-
const l = Ha({ dashboard: e, target: { kind: "dashboardInput", input: d.input, scope: {} }, calendar: t }).value, c = d.input.filter.dateSelectionMode, h = c === "day" ? "its date picker takes one day" : void 0, p = (
|
|
2307
|
+
const l = Ha({ dashboard: e, target: { kind: "dashboardInput", input: d.input, scope: {} }, calendar: t }).value, c = d.input.filter.dateSelectionMode, h = c === "day" ? "its date picker takes one day" : void 0, p = (v, I) => s.push({
|
|
2299
2308
|
code: "filter_not_editable",
|
|
2300
|
-
message:
|
|
2309
|
+
message: v,
|
|
2301
2310
|
path: `changes[${i.changeIndex}]`,
|
|
2302
|
-
fix:
|
|
2311
|
+
fix: I,
|
|
2303
2312
|
details: { reason: "default_not_applied", ...c ? { datePicker: c } : {} }
|
|
2304
2313
|
});
|
|
2305
2314
|
if (i.period) {
|
|
2306
|
-
const
|
|
2307
|
-
(!
|
|
2315
|
+
const v = Ja(l && "relativeMeta" in l ? l.relativeMeta : void 0);
|
|
2316
|
+
(!v || tn(i.period) || !an(v, i.period)) && p(
|
|
2308
2317
|
`"${d.input.label}" wouldn't load with that default${h ? `: ${h}` : ""}.`,
|
|
2309
2318
|
h ? "Ask for a default the picker can take, or tell the user to make it a date range in the editor." : "Tell the user to change the filter's default in the editor."
|
|
2310
2319
|
);
|
|
2311
2320
|
} else if (i.values) {
|
|
2312
|
-
const
|
|
2313
|
-
(!l ||
|
|
2321
|
+
const v = (I) => JSON.stringify((I ?? []).map(String).sort());
|
|
2322
|
+
(!l || v(l.values) !== v(i.values)) && p(`"${d.input.label}" wouldn't load with those values.`, "Tell the user to change the filter's default in the editor.");
|
|
2314
2323
|
} else
|
|
2315
2324
|
(Ya(d.input.filter.dataType) ? i.period === null : i.values === null) && l && p(`"${d.input.label}" would still load with a default.`, "Tell the user to change the filter's default in the editor.");
|
|
2316
2325
|
}
|
|
@@ -2328,10 +2337,10 @@ function yt(e) {
|
|
|
2328
2337
|
}
|
|
2329
2338
|
function ka(e) {
|
|
2330
2339
|
var t, s;
|
|
2331
|
-
const a = (s = (t = e.config) == null ? void 0 : t.groupByColumns) == null ? void 0 : s.find((n) =>
|
|
2340
|
+
const a = (s = (t = e.config) == null ? void 0 : t.groupByColumns) == null ? void 0 : s.find((n) => lo(n.dataType || "") === "date");
|
|
2332
2341
|
return { comparisonDate: a ? { name: a.name, label: a.label || a.name } : null, dateWindow: "unknown" };
|
|
2333
2342
|
}
|
|
2334
|
-
function
|
|
2343
|
+
function ri(e, a) {
|
|
2335
2344
|
if ("sql" in a) return [];
|
|
2336
2345
|
const t = e, s = (...o) => new Set(o.flatMap((i) => Array.isArray(i) ? i : i ? [i] : []).map((i) => be(i, a.datasetName))), n = {
|
|
2337
2346
|
metric: s(t.measures),
|
|
@@ -2340,11 +2349,11 @@ function ii(e, a) {
|
|
|
2340
2349
|
};
|
|
2341
2350
|
return Ne(a).filter((o) => n[o.key.role].has(o.key.field));
|
|
2342
2351
|
}
|
|
2343
|
-
function
|
|
2352
|
+
function di(e, a, t, s) {
|
|
2344
2353
|
const n = Object.fromEntries(Object.entries(a).filter(([, p]) => p != null)), o = tt(n), i = tt(e), d = (p) => Sa[p].safeParse(n);
|
|
2345
2354
|
if (!e || o && o !== i) {
|
|
2346
|
-
const p = o ?? i,
|
|
2347
|
-
return
|
|
2355
|
+
const p = o ?? i, v = p ? d(p) : void 0;
|
|
2356
|
+
return v != null && v.success ? v.data : s({
|
|
2348
2357
|
code: e ? "query_form_mismatch" : "type_not_supported",
|
|
2349
2358
|
message: e ? "This patch changes the query's form (measures, records or SQL) without a complete query." : "This card's current query can't be patched; send a complete query.",
|
|
2350
2359
|
path: t,
|
|
@@ -2352,8 +2361,8 @@ function ri(e, a, t, s) {
|
|
|
2352
2361
|
});
|
|
2353
2362
|
}
|
|
2354
2363
|
const l = { ...e };
|
|
2355
|
-
for (const [p,
|
|
2356
|
-
|
|
2364
|
+
for (const [p, v] of Object.entries(a))
|
|
2365
|
+
v !== void 0 && (v === null ? delete l[p] : l[p] = v);
|
|
2357
2366
|
const c = ms(e, a);
|
|
2358
2367
|
c && delete l.timeWindow;
|
|
2359
2368
|
const h = Sa[i].safeParse(l);
|
|
@@ -2375,11 +2384,11 @@ function ms(e, a) {
|
|
|
2375
2384
|
function Ta(e) {
|
|
2376
2385
|
return e ? { kind: "sheets", sheetIds: e } : { kind: "allSheets", sheetKinds: ["dashboard"] };
|
|
2377
2386
|
}
|
|
2378
|
-
function
|
|
2379
|
-
return ["date", "datetime", "timestamp"].some((i) => Tt(a.dataType).includes(i)) || s({ code: "invalid_change", message: "defaultPeriod is for date filters.", path: t, fix: "Use defaultValues for this field." }), hs(e, { use: "filterDefault", columnHasTime:
|
|
2387
|
+
function Ra(e, a, t, s) {
|
|
2388
|
+
return ["date", "datetime", "timestamp"].some((i) => Tt(a.dataType).includes(i)) || s({ code: "invalid_change", message: "defaultPeriod is for date filters.", path: t, fix: "Use defaultValues for this field." }), hs(e, { use: "filterDefault", columnHasTime: li(a) }, t, s);
|
|
2380
2389
|
}
|
|
2381
2390
|
function hs(e, a, t, s) {
|
|
2382
|
-
const n =
|
|
2391
|
+
const n = sn(e, a);
|
|
2383
2392
|
return n.ok ? n.window : s({
|
|
2384
2393
|
code: "invalid_change",
|
|
2385
2394
|
message: n.refusal.message,
|
|
@@ -2387,15 +2396,15 @@ function hs(e, a, t, s) {
|
|
|
2387
2396
|
path: n.refusal.path ? `${t}.${n.refusal.path}` : t
|
|
2388
2397
|
});
|
|
2389
2398
|
}
|
|
2390
|
-
function
|
|
2399
|
+
function li(e) {
|
|
2391
2400
|
return qa({ dataType: e.dataType }) === "datetime";
|
|
2392
2401
|
}
|
|
2393
|
-
function
|
|
2402
|
+
function ci(e) {
|
|
2394
2403
|
var a, t, s;
|
|
2395
2404
|
return (s = (t = (a = e == null ? void 0 : e.filters) == null ? void 0 : a.conditions) == null ? void 0 : t.find((n) => n.relativeMeta)) == null ? void 0 : s.field;
|
|
2396
2405
|
}
|
|
2397
|
-
async function
|
|
2398
|
-
const o =
|
|
2406
|
+
async function ui(e, a, t, s, n) {
|
|
2407
|
+
const o = oo(e), i = o.kind === "config" ? o.executableSources : o.kind === "sql" ? o.pinnedCatalogSources.map((w) => w.source) : [], d = he(e), l = typeof a == "string" ? (d == null ? void 0 : d.kind) === "semantic" ? d.datasetName : void 0 : a.datasetName, c = i.find((w) => w.kind === "semantic" && Tt(w.datasetName) === Tt(l));
|
|
2399
2408
|
if (!c || c.kind !== "semantic")
|
|
2400
2409
|
return n({
|
|
2401
2410
|
code: "field_not_found",
|
|
@@ -2403,8 +2412,8 @@ async function ci(e, a, t, s, n) {
|
|
|
2403
2412
|
path: s,
|
|
2404
2413
|
fix: "Name a field of the card's own dataset, or { name, datasetName } for a dataset its query joins."
|
|
2405
2414
|
});
|
|
2406
|
-
const h = await t.loadCardSource({ domainId: c.domainId, datasetName: c.datasetName }), p = typeof a == "string" ? a : a.name,
|
|
2407
|
-
return
|
|
2415
|
+
const h = await t.loadCardSource({ domainId: c.domainId, datasetName: c.datasetName }), p = typeof a == "string" ? a : a.name, v = h ? ot(h.fields, p, c.datasetName) : void 0, I = v ? Yo(c, { column_name: v.name, data_type: v.dataType, ...v.sourceField ? { sourceField: v.sourceField } : {} }) : void 0;
|
|
2416
|
+
return I || n({
|
|
2408
2417
|
code: "field_not_found",
|
|
2409
2418
|
message: `"${p}" isn't a field of ${c.datasetName}.`,
|
|
2410
2419
|
path: s,
|
|
@@ -2412,12 +2421,12 @@ async function ci(e, a, t, s, n) {
|
|
|
2412
2421
|
details: { available: ((h == null ? void 0 : h.fields) ?? []).slice(0, 20).map((w) => w.name) }
|
|
2413
2422
|
});
|
|
2414
2423
|
}
|
|
2415
|
-
const
|
|
2424
|
+
const fi = {
|
|
2416
2425
|
max: ba,
|
|
2417
2426
|
what: "A proposal that creates a dashboard",
|
|
2418
2427
|
fix: `Create with the first ${ba}, then change the new dashboard in a second proposal.`
|
|
2419
2428
|
};
|
|
2420
|
-
async function
|
|
2429
|
+
async function Dr(e, a) {
|
|
2421
2430
|
const t = (d) => d && typeof d == "object" ? d.op : void 0, s = e.changes.flatMap(
|
|
2422
2431
|
(d, l) => t(d) === "dashboard.update" ? [
|
|
2423
2432
|
{
|
|
@@ -2429,12 +2438,12 @@ async function Ar(e, a) {
|
|
|
2429
2438
|
] : []
|
|
2430
2439
|
);
|
|
2431
2440
|
if (s.length) return { ok: !1, problems: s };
|
|
2432
|
-
const n =
|
|
2441
|
+
const n = hi(e, a), o = await fs(n, e.changes, a, { limit: fi });
|
|
2433
2442
|
if (!o.ok) return o;
|
|
2434
|
-
const i =
|
|
2435
|
-
return { ...i, seed: n, sentence:
|
|
2443
|
+
const i = mi(o, e.changes);
|
|
2444
|
+
return { ...i, seed: n, sentence: pi(i.dashboard) };
|
|
2436
2445
|
}
|
|
2437
|
-
function
|
|
2446
|
+
function mi(e, a) {
|
|
2438
2447
|
if (a.some((o) => {
|
|
2439
2448
|
if (!o || typeof o != "object") return !1;
|
|
2440
2449
|
const { op: i } = o;
|
|
@@ -2451,7 +2460,7 @@ function fi(e, a) {
|
|
|
2451
2460
|
descriptions: [...e.descriptions, ...n.descriptions]
|
|
2452
2461
|
};
|
|
2453
2462
|
}
|
|
2454
|
-
function
|
|
2463
|
+
function hi(e, a) {
|
|
2455
2464
|
const t = e.changes.some((s) => s && typeof s == "object" && s.op === "sheet.add");
|
|
2456
2465
|
return {
|
|
2457
2466
|
id: e.dashboardId,
|
|
@@ -2463,71 +2472,71 @@ function mi(e, a) {
|
|
|
2463
2472
|
};
|
|
2464
2473
|
}
|
|
2465
2474
|
const vt = (e, a) => `${e} ${a}${e === 1 ? "" : "s"}`;
|
|
2466
|
-
function
|
|
2475
|
+
function pi(e) {
|
|
2467
2476
|
const a = e.sheets ?? [], t = a.reduce((o, i) => o + (i.frames ?? []).reduce((d, l) => {
|
|
2468
2477
|
var c;
|
|
2469
2478
|
return d + (((c = l.cards) == null ? void 0 : c.length) ?? 0);
|
|
2470
2479
|
}, 0), 0), s = (e.inputs ?? []).filter((o) => o.kind === "filter").length, n = [vt(a.length, "sheet"), vt(t, "card"), ...s ? [vt(s, "filter")] : []];
|
|
2471
2480
|
return `Creates a private dashboard ${Va(e.title)} with ${et(n)}.`;
|
|
2472
2481
|
}
|
|
2473
|
-
const
|
|
2474
|
-
function
|
|
2475
|
-
var $,
|
|
2476
|
-
const t = ($ = a.sheetIds) != null && $.length ? new Set(a.sheetIds) : void 0, s = (
|
|
2477
|
-
(
|
|
2478
|
-
), i = o.length > (a.maxQueryCards ??
|
|
2479
|
-
(e.sheets ?? []).flatMap((
|
|
2480
|
-
), l = /* @__PURE__ */ new Map(), c = (
|
|
2481
|
-
(
|
|
2482
|
+
const gi = 50;
|
|
2483
|
+
function Or(e, a) {
|
|
2484
|
+
var $, N;
|
|
2485
|
+
const t = ($ = a.sheetIds) != null && $.length ? new Set(a.sheetIds) : void 0, s = (N = a.cardIds) != null && N.length ? new Set(a.cardIds) : void 0, n = (e.sheets ?? []).filter((g) => !t || t.has(g.id)), o = we(e).filter(
|
|
2486
|
+
(g) => (!t || t.has(g.sheetId)) && (!s || s.has(g.cardId))
|
|
2487
|
+
), i = o.length > (a.maxQueryCards ?? gi), d = new Map(
|
|
2488
|
+
(e.sheets ?? []).flatMap((g) => (g.frames ?? []).map((k) => [k.id, k]))
|
|
2489
|
+
), l = /* @__PURE__ */ new Map(), c = (g) => {
|
|
2490
|
+
(g == null ? void 0 : g.kind) === "semantic" && l.set(`${g.domainId}|${g.datasetName}`, { domainId: g.domainId, datasetName: g.datasetName });
|
|
2482
2491
|
}, h = new Map(
|
|
2483
|
-
(e.sheets ?? []).map((
|
|
2484
|
-
), p = (
|
|
2485
|
-
if (
|
|
2486
|
-
const
|
|
2487
|
-
return
|
|
2488
|
-
}, x = n.map((
|
|
2489
|
-
sheetId:
|
|
2490
|
-
title:
|
|
2491
|
-
kind:
|
|
2492
|
-
...
|
|
2493
|
-
cards: o.filter((
|
|
2492
|
+
(e.sheets ?? []).map((g) => [g.id, _t({ dashboard: e, place: { kind: g.kind === "document" ? "document" : "sheet", sheetId: g.id } })])
|
|
2493
|
+
), p = (g) => ({ catalog: g, inputs: e.inputs, variables: e.variables }), v = (g) => p(h.get(g)), I = /* @__PURE__ */ new Map(), w = (g, k) => {
|
|
2494
|
+
if (g.kind === "document") return v(g.id);
|
|
2495
|
+
const T = _t({ dashboard: e, place: { kind: "sheet", sheetId: g.id, cardId: k } });
|
|
2496
|
+
return I.set(`${g.id}:${k}`, T), p(T);
|
|
2497
|
+
}, x = n.map((g) => ({
|
|
2498
|
+
sheetId: g.id,
|
|
2499
|
+
title: g.title ?? "",
|
|
2500
|
+
kind: g.kind === "document" ? "document" : "dashboard",
|
|
2501
|
+
...g.kind === "document" ? yi(g, v(g.id)) : { layout: _i(g) },
|
|
2502
|
+
cards: o.filter((k) => k.sheetId === g.id).map((k) => {
|
|
2494
2503
|
var oe;
|
|
2495
|
-
const
|
|
2496
|
-
if (
|
|
2497
|
-
const te = he(
|
|
2504
|
+
const T = k.card, L = k.kind === "frameCard" ? (oe = d.get(k.frameId)) == null ? void 0 : oe.visualId : void 0, V = L ? { linkedVisualId: L } : {}, K = { cardId: k.cardId, title: T.title ?? "" };
|
|
2505
|
+
if (k.kind !== "frameCard") {
|
|
2506
|
+
const te = he(T);
|
|
2498
2507
|
return c(te), {
|
|
2499
2508
|
...K,
|
|
2500
|
-
...Ge(
|
|
2509
|
+
...Ge(T),
|
|
2501
2510
|
...te ? { source: te } : {},
|
|
2502
2511
|
editable: !1,
|
|
2503
|
-
notEditable:
|
|
2512
|
+
notEditable: k.kind === "documentSectionCard" ? { reason: "document_section", message: "Cards in Document sections can't be changed through the MCP yet. Change them in the editor." } : {
|
|
2504
2513
|
reason: "not_expressible",
|
|
2505
2514
|
message: "This card isn't in a tile, so it can't be changed through the MCP. Change it in the editor.",
|
|
2506
2515
|
detail: "a card outside a tile"
|
|
2507
2516
|
}
|
|
2508
2517
|
};
|
|
2509
2518
|
}
|
|
2510
|
-
if (
|
|
2511
|
-
const te = ja(
|
|
2512
|
-
return te.editable ? { ...K, type: "text", ...
|
|
2519
|
+
if (T.type === "text") {
|
|
2520
|
+
const te = ja(T, w(g, T.id));
|
|
2521
|
+
return te.editable ? { ...K, type: "text", ...V, editable: !0, text: te.text, ...te.editorOnly.length ? { editorOnly: te.editorOnly } : {} } : { ...K, ...Ge(T), ...V, editable: !1, notEditable: { reason: "text", message: te.message } };
|
|
2513
2522
|
}
|
|
2514
|
-
const B = Ce(
|
|
2523
|
+
const B = Ce(T, { sql: a.sql });
|
|
2515
2524
|
if (c(B.source), !B.editable)
|
|
2516
2525
|
return {
|
|
2517
2526
|
...K,
|
|
2518
|
-
...Ge(
|
|
2527
|
+
...Ge(T),
|
|
2519
2528
|
...B.source ? { source: B.source } : {},
|
|
2520
|
-
...
|
|
2529
|
+
...V,
|
|
2521
2530
|
editable: !1,
|
|
2522
2531
|
notEditable: { reason: B.reason, message: B.message, ...B.detail ? { detail: B.detail } : {} }
|
|
2523
2532
|
};
|
|
2524
|
-
const se = i ? void 0 : At(
|
|
2533
|
+
const se = i ? void 0 : At(T);
|
|
2525
2534
|
return {
|
|
2526
2535
|
...K,
|
|
2527
|
-
...Ge(
|
|
2536
|
+
...Ge(T),
|
|
2528
2537
|
type: B.type,
|
|
2529
2538
|
source: B.source,
|
|
2530
|
-
...
|
|
2539
|
+
...V,
|
|
2531
2540
|
editable: !0,
|
|
2532
2541
|
...i ? {} : {
|
|
2533
2542
|
query: B.query,
|
|
@@ -2537,30 +2546,30 @@ function Dr(e, a) {
|
|
|
2537
2546
|
...se
|
|
2538
2547
|
};
|
|
2539
2548
|
})
|
|
2540
|
-
})),
|
|
2549
|
+
})), E = as(e, es(a.calendar, a.updatedAt), {
|
|
2541
2550
|
...a.relationshipReach ? { relationshipReach: a.relationshipReach } : {}
|
|
2542
2551
|
});
|
|
2543
|
-
for (const
|
|
2544
|
-
|
|
2545
|
-
const _ =
|
|
2546
|
-
for (const
|
|
2547
|
-
const
|
|
2548
|
-
(
|
|
2549
|
-
}
|
|
2550
|
-
const
|
|
2551
|
-
var
|
|
2552
|
-
return ((
|
|
2553
|
-
}).map((
|
|
2554
|
-
(
|
|
2555
|
-
var
|
|
2556
|
-
return (
|
|
2557
|
-
var L,
|
|
2558
|
-
return
|
|
2552
|
+
for (const g of E)
|
|
2553
|
+
g.editable && l.set(`${g.domainId}|${g.datasetName}`, { domainId: g.domainId, datasetName: g.datasetName });
|
|
2554
|
+
const _ = vi(e, a, new Map([...h, ...I]));
|
|
2555
|
+
for (const g of e.variables ?? []) {
|
|
2556
|
+
const k = kt(g);
|
|
2557
|
+
(k == null ? void 0 : k.kind) === "semantic" && l.set(`${k.domainId}|${k.datasetName}`, { domainId: k.domainId, datasetName: k.datasetName });
|
|
2558
|
+
}
|
|
2559
|
+
const S = (e.variables ?? []).filter((g) => {
|
|
2560
|
+
var k;
|
|
2561
|
+
return ((k = kt(g)) == null ? void 0 : k.kind) === "physical";
|
|
2562
|
+
}).map((g) => g.name), y = (e.sheets ?? []).some(
|
|
2563
|
+
(g) => {
|
|
2564
|
+
var k;
|
|
2565
|
+
return (k = g.document) == null ? void 0 : k.sections.some((T) => {
|
|
2566
|
+
var L, V;
|
|
2567
|
+
return T.type === "text" && (((L = T.style) == null ? void 0 : L.fontWeight) || ((V = T.style) == null ? void 0 : V.color));
|
|
2559
2568
|
});
|
|
2560
2569
|
}
|
|
2561
|
-
),
|
|
2562
|
-
...
|
|
2563
|
-
...
|
|
2570
|
+
), D = [
|
|
2571
|
+
...S.length ? [`a variable on a table or view source (${S.join(", ")}): changed in the editor`] : [],
|
|
2572
|
+
...y ? ["a Document text section's weight or color: changed in the editor"] : [],
|
|
2564
2573
|
// No change creates a calculated field (DV-D13, ledger AR-27): the parity backlog names it.
|
|
2565
2574
|
"creating a calculated field: use one the domain has, or a SQL variable"
|
|
2566
2575
|
];
|
|
@@ -2573,39 +2582,39 @@ function Dr(e, a) {
|
|
|
2573
2582
|
access: a.access,
|
|
2574
2583
|
datasets: [...l.values()],
|
|
2575
2584
|
sheets: x,
|
|
2576
|
-
filters:
|
|
2585
|
+
filters: E,
|
|
2577
2586
|
variables: _,
|
|
2578
|
-
style:
|
|
2579
|
-
editorOnly:
|
|
2587
|
+
style: bi(e, a),
|
|
2588
|
+
editorOnly: D,
|
|
2580
2589
|
...i ? { truncated: !0 } : {}
|
|
2581
2590
|
};
|
|
2582
2591
|
}
|
|
2583
|
-
function
|
|
2592
|
+
function bi(e, a) {
|
|
2584
2593
|
const { style: t, organizationAppearance: s } = za(e, a.organizationAppearance);
|
|
2585
|
-
return { set:
|
|
2594
|
+
return { set: Tn(t), shows: dn({ organizationAppearance: s, dashboardStyle: t }, "light").shows };
|
|
2586
2595
|
}
|
|
2587
|
-
function
|
|
2588
|
-
const t =
|
|
2596
|
+
function Fa(e, a) {
|
|
2597
|
+
const t = Co(a);
|
|
2589
2598
|
return t ? { ...e, style: t } : e;
|
|
2590
2599
|
}
|
|
2591
|
-
function
|
|
2600
|
+
function yi(e, a) {
|
|
2592
2601
|
const t = e.document;
|
|
2593
2602
|
if (!t) return {};
|
|
2594
2603
|
const s = (n) => {
|
|
2595
2604
|
var o;
|
|
2596
2605
|
return (((o = t[n]) == null ? void 0 : o.blocks) ?? []).flatMap(
|
|
2597
|
-
(i) => i.type === "text" && i.role ? [
|
|
2606
|
+
(i) => i.type === "text" && i.role ? [Fa({ role: i.role, text: Ze(i.content, { ...a, documentInputs: t.inputs }) }, i.style)] : []
|
|
2598
2607
|
);
|
|
2599
2608
|
};
|
|
2600
2609
|
return {
|
|
2601
2610
|
header: s("header"),
|
|
2602
2611
|
footer: s("footer"),
|
|
2603
2612
|
textSections: t.sections.flatMap(
|
|
2604
|
-
(n) => n.type === "text" ? [
|
|
2613
|
+
(n) => n.type === "text" ? [Fa({ sectionId: n.id, text: Ze(n.content, { ...a, documentInputs: t.inputs }) }, n.style)] : []
|
|
2605
2614
|
)
|
|
2606
2615
|
};
|
|
2607
2616
|
}
|
|
2608
|
-
function
|
|
2617
|
+
function vi(e, a, t) {
|
|
2609
2618
|
const s = Qa(e), n = (c) => s.filter(({ ref: h }) => c(h)).map(({ place: h, where: p }) => ({
|
|
2610
2619
|
sheetId: h.sheetId,
|
|
2611
2620
|
where: p.kind,
|
|
@@ -2626,19 +2635,19 @@ function yi(e, a, t) {
|
|
|
2626
2635
|
})), d = [...o.values()].filter((c) => c.kind === "report").map((c) => ({
|
|
2627
2636
|
name: c.name,
|
|
2628
2637
|
kind: "report",
|
|
2629
|
-
words:
|
|
2638
|
+
words: Ii[c.reportKey],
|
|
2630
2639
|
parts: [],
|
|
2631
2640
|
usedIn: n((h) => h.source === "documentMeta" && h.key === c.reportKey),
|
|
2632
2641
|
editable: !1
|
|
2633
2642
|
})), l = (e.variables ?? []).map((c) => {
|
|
2634
|
-
const h = rs(c, { sql: a.sql }), p = Dt(c, e)[0],
|
|
2643
|
+
const h = rs(c, { sql: a.sql }), p = Dt(c, e)[0], v = _o(c.presentation);
|
|
2635
2644
|
return {
|
|
2636
2645
|
name: c.name,
|
|
2637
2646
|
kind: "data",
|
|
2638
|
-
words:
|
|
2639
|
-
parts:
|
|
2640
|
-
...
|
|
2641
|
-
usedIn: n((
|
|
2647
|
+
words: Jo(c),
|
|
2648
|
+
parts: Po(c),
|
|
2649
|
+
...v ? { presentation: v } : {},
|
|
2650
|
+
usedIn: n((I) => I.source === "data" && I.variableId === c.id),
|
|
2642
2651
|
editable: h.editable,
|
|
2643
2652
|
...h.editable ? {} : { notEditable: { reason: h.reason, message: h.message } },
|
|
2644
2653
|
...p ? { broken: `${p.message} ${p.fix}` } : {}
|
|
@@ -2646,7 +2655,7 @@ function yi(e, a, t) {
|
|
|
2646
2655
|
});
|
|
2647
2656
|
return [...i, ...d, ...l];
|
|
2648
2657
|
}
|
|
2649
|
-
const
|
|
2658
|
+
const Ii = {
|
|
2650
2659
|
generatedAt: "When the report was generated",
|
|
2651
2660
|
pageNumber: "The page number (Documents)",
|
|
2652
2661
|
pageCount: "The page count (Documents)"
|
|
@@ -2655,9 +2664,9 @@ function Ge(e) {
|
|
|
2655
2664
|
const a = qe(e);
|
|
2656
2665
|
return a ? { type: a.type, ...a.properties } : { type: $t(e.type) };
|
|
2657
2666
|
}
|
|
2658
|
-
function
|
|
2667
|
+
function _i(e) {
|
|
2659
2668
|
const a = new Map((e.frames ?? []).map((t) => [t.id, t]));
|
|
2660
|
-
return
|
|
2669
|
+
return mn(e).rows.map((t) => ({
|
|
2661
2670
|
tiles: t.tiles.map((s) => {
|
|
2662
2671
|
const n = a.get(s.frameId);
|
|
2663
2672
|
return { cardIds: n ? Ba(n) : [], width: s.width };
|
|
@@ -2670,13 +2679,13 @@ function Z(e) {
|
|
|
2670
2679
|
function ue(e, a) {
|
|
2671
2680
|
return Z(e) && Object.prototype.hasOwnProperty.call(e, a) && e[a] !== void 0;
|
|
2672
2681
|
}
|
|
2673
|
-
const re = ue,
|
|
2674
|
-
function
|
|
2682
|
+
const re = ue, Ci = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns", "sortByColumns"], $i = ["xAxisConfig", "yAxisConfig", "secondaryYAxisConfig", "tooltipConfig", "dataLabelsConfig"], wi = '`format` on the matching column in `config.metricColumns`, `groupByColumns` or `detailColumns`; for a SQL or Python card, `preferences.sqlColumns["<column>"].format`', Qe = "`preferences.conditionalFormatting`, with columns named by card column id";
|
|
2683
|
+
function xi(e) {
|
|
2675
2684
|
return Me(String(e.type)) ?? Et;
|
|
2676
2685
|
}
|
|
2677
2686
|
function Oe(e, a, t) {
|
|
2678
2687
|
if (t === void 0) return;
|
|
2679
|
-
const s = Z(t) ?
|
|
2688
|
+
const s = Z(t) ? xi(t).safeParse(t) : Et.safeParse(t);
|
|
2680
2689
|
if (!s.success)
|
|
2681
2690
|
for (const n of s.error.issues) {
|
|
2682
2691
|
const o = n.code === "unrecognized_keys" ? n.keys : [n.path.length ? String(n.path[n.path.length - 1]) : "type"];
|
|
@@ -2697,27 +2706,27 @@ function It(e, a, t) {
|
|
|
2697
2706
|
}
|
|
2698
2707
|
function ps(e, a) {
|
|
2699
2708
|
const t = [], s = e.config;
|
|
2700
|
-
for (const w of
|
|
2709
|
+
for (const w of Ci) {
|
|
2701
2710
|
const x = s == null ? void 0 : s[w];
|
|
2702
|
-
Array.isArray(x) && x.forEach((
|
|
2711
|
+
Array.isArray(x) && x.forEach((E, _) => It(t, `${a}.config.${w}[${_}]`, E));
|
|
2703
2712
|
}
|
|
2704
2713
|
const n = Z(s == null ? void 0 : s.matrix) ? s.matrix : void 0, o = Z(n == null ? void 0 : n.presentation) ? n.presentation : void 0;
|
|
2705
2714
|
for (const w of ["measureFormats", "levelFormats"]) {
|
|
2706
2715
|
const x = o == null ? void 0 : o[w];
|
|
2707
|
-
if (Z(x)) for (const [
|
|
2716
|
+
if (Z(x)) for (const [E, _] of Object.entries(x)) Oe(t, `${a}.config.matrix.presentation.${w}.${E}`, _);
|
|
2708
2717
|
}
|
|
2709
2718
|
re(o, "conditionalFormatting") && t.push({ path: `${a}.config.matrix.presentation.conditionalFormatting`, field: "conditionalFormatting", replacement: Qe });
|
|
2710
2719
|
const i = e.interactionConfig, d = i == null ? void 0 : i.drillHierarchies;
|
|
2711
2720
|
Array.isArray(d) && d.forEach((w, x) => {
|
|
2712
|
-
Z(w) && (It(t, `${a}.interactionConfig.drillHierarchies[${x}].baseField`, w.baseField), Array.isArray(w.steps) && w.steps.forEach((
|
|
2713
|
-
Z(
|
|
2721
|
+
Z(w) && (It(t, `${a}.interactionConfig.drillHierarchies[${x}].baseField`, w.baseField), Array.isArray(w.steps) && w.steps.forEach((E, _) => {
|
|
2722
|
+
Z(E) && It(t, `${a}.interactionConfig.drillHierarchies[${x}].steps[${_}].field`, E.field);
|
|
2714
2723
|
}));
|
|
2715
2724
|
});
|
|
2716
2725
|
const l = e.preferences;
|
|
2717
2726
|
if (!l) return t;
|
|
2718
2727
|
const c = `${a}.preferences`;
|
|
2719
2728
|
if (re(l, "formatNumber")) {
|
|
2720
|
-
const w = l.formatNumber, x = Z(w) && Object.keys(w).every((
|
|
2729
|
+
const w = l.formatNumber, x = Z(w) && Object.keys(w).every((E) => E === "colorRanges");
|
|
2721
2730
|
t.push(
|
|
2722
2731
|
x ? { path: `${c}.formatNumber.colorRanges`, field: "colorRanges", replacement: `${Qe} (a rule on the KPI's value)` } : { path: `${c}.formatNumber`, field: "formatNumber", replacement: "`format` on each measure in `config.metricColumns`; for a SQL KPI, `preferences.sqlKpiValue.format`" }
|
|
2723
2732
|
);
|
|
@@ -2727,30 +2736,30 @@ function ps(e, a) {
|
|
|
2727
2736
|
re(h, "formatOptions") && t.push({ path: `${c}.kpiVisualOptions.formatOptions`, field: "formatOptions", replacement: "`format` on each measure in `config.metricColumns`; for a SQL KPI, `preferences.sqlKpiValue.format`" }), re(h, "queryComparisonPolarity") && t.push({ path: `${c}.kpiVisualOptions.queryComparisonPolarity`, field: "queryComparisonPolarity", replacement: "`preferences.sqlKpiValue.comparisonPolarity`" });
|
|
2728
2737
|
const p = l.tablePrefs;
|
|
2729
2738
|
re(p, "conditionalFormatting") && t.push({ path: `${c}.tablePrefs.conditionalFormatting`, field: "conditionalFormatting", replacement: Qe });
|
|
2730
|
-
const
|
|
2731
|
-
if (Z(
|
|
2732
|
-
for (const [w, x] of Object.entries(
|
|
2739
|
+
const v = p == null ? void 0 : p.columnSettingsMap;
|
|
2740
|
+
if (Z(v))
|
|
2741
|
+
for (const [w, x] of Object.entries(v)) {
|
|
2733
2742
|
if (!Z(x)) continue;
|
|
2734
|
-
const
|
|
2743
|
+
const E = `${c}.tablePrefs.columnSettingsMap.${w}`;
|
|
2735
2744
|
for (const _ of ["numberFormat", "dateFormat", "inheritMetricFormat"])
|
|
2736
|
-
re(x, _) && t.push({ path: `${
|
|
2737
|
-
re(x, "colorRanges") && t.push({ path: `${
|
|
2745
|
+
re(x, _) && t.push({ path: `${E}.${_}`, field: _, replacement: _ === "inheritMetricFormat" ? "nothing: a column follows its `format`" : wi });
|
|
2746
|
+
re(x, "colorRanges") && t.push({ path: `${E}.colorRanges`, field: "colorRanges", replacement: Qe });
|
|
2738
2747
|
}
|
|
2739
|
-
for (const w of
|
|
2748
|
+
for (const w of $i) {
|
|
2740
2749
|
const x = l[w];
|
|
2741
2750
|
if (Z(x)) {
|
|
2742
|
-
for (const
|
|
2743
|
-
re(x,
|
|
2751
|
+
for (const E of ["formatMode", "mode", "formatOptions"])
|
|
2752
|
+
re(x, E) && t.push({ path: `${c}.${w}.${E}`, field: E, replacement: `\`preferences.${w}.valueFormat\` (absent means the column's format)` });
|
|
2744
2753
|
w === "dataLabelsConfig" && re(x, "format") && t.push({ path: `${c}.${w}.format`, field: "format", replacement: "`preferences.dataLabelsConfig.valueFormat`" }), Oe(t, `${c}.${w}.valueFormat`, x.valueFormat);
|
|
2745
2754
|
}
|
|
2746
2755
|
}
|
|
2747
|
-
const
|
|
2748
|
-
if (Z(
|
|
2749
|
-
for (const [w, x] of Object.entries(
|
|
2756
|
+
const I = l.sqlColumns;
|
|
2757
|
+
if (Z(I))
|
|
2758
|
+
for (const [w, x] of Object.entries(I))
|
|
2750
2759
|
Z(x) && Oe(t, `${c}.sqlColumns.${w}.format`, x.format);
|
|
2751
2760
|
return Z(l.sqlKpiValue) && Oe(t, `${c}.sqlKpiValue.format`, l.sqlKpiValue.format), t;
|
|
2752
2761
|
}
|
|
2753
|
-
function
|
|
2762
|
+
function Si(e) {
|
|
2754
2763
|
const a = `sheets[id=${e.sheetId}]`;
|
|
2755
2764
|
switch (e.kind) {
|
|
2756
2765
|
case "sheetCard":
|
|
@@ -2766,20 +2775,20 @@ function gs(e) {
|
|
|
2766
2775
|
if (Array.isArray(e.sheets))
|
|
2767
2776
|
return we(e).map((t) => ({
|
|
2768
2777
|
card: t.card,
|
|
2769
|
-
at:
|
|
2778
|
+
at: Si(t)
|
|
2770
2779
|
}));
|
|
2771
2780
|
const a = e;
|
|
2772
2781
|
return Array.isArray(a.cards) ? a.cards.map((t) => ({ card: t, at: `cards[id=${t.id}]` })) : [];
|
|
2773
2782
|
}
|
|
2774
|
-
function
|
|
2783
|
+
function Er(e) {
|
|
2775
2784
|
return gs(e).flatMap(({ card: a, at: t }) => ps(a, t));
|
|
2776
2785
|
}
|
|
2777
|
-
function
|
|
2786
|
+
function ki(e, a) {
|
|
2778
2787
|
var o;
|
|
2779
2788
|
const t = (o = e.preferences) == null ? void 0 : o.conditionalFormatting;
|
|
2780
2789
|
if (t === void 0) return [];
|
|
2781
|
-
const s = `${a}.preferences.conditionalFormatting`, n =
|
|
2782
|
-
return n.success ?
|
|
2790
|
+
const s = `${a}.preferences.conditionalFormatting`, n = $o.safeParse(t);
|
|
2791
|
+
return n.success ? wo(e).map((i) => ({
|
|
2783
2792
|
code: "invalid_conditional_formatting",
|
|
2784
2793
|
path: `${s}.rules[id=${i.ruleId}].${i.path}`,
|
|
2785
2794
|
message: i.message
|
|
@@ -2789,14 +2798,14 @@ function Si(e, a) {
|
|
|
2789
2798
|
message: i.message
|
|
2790
2799
|
}));
|
|
2791
2800
|
}
|
|
2792
|
-
function
|
|
2801
|
+
function qr(e) {
|
|
2793
2802
|
return gs(e).flatMap(({ card: a, at: t }) => [
|
|
2794
2803
|
...ps(a, t).map((s) => ({
|
|
2795
2804
|
code: "retired_presentation_field",
|
|
2796
2805
|
path: s.path,
|
|
2797
2806
|
message: `\`${s.field}\` is retired: use ${s.replacement}.`
|
|
2798
2807
|
})),
|
|
2799
|
-
...
|
|
2808
|
+
...ki(a, t)
|
|
2800
2809
|
]);
|
|
2801
2810
|
}
|
|
2802
2811
|
const Lt = [
|
|
@@ -2805,7 +2814,7 @@ const Lt = [
|
|
|
2805
2814
|
"detailColumns",
|
|
2806
2815
|
"pivotByColumns",
|
|
2807
2816
|
"sortByColumns"
|
|
2808
|
-
],
|
|
2817
|
+
], Ti = [
|
|
2809
2818
|
"xAxisConfig",
|
|
2810
2819
|
"yAxisConfig",
|
|
2811
2820
|
"secondaryYAxisConfig",
|
|
@@ -2825,17 +2834,17 @@ function Ie(e, a) {
|
|
|
2825
2834
|
return bs(t(e), t(a));
|
|
2826
2835
|
}
|
|
2827
2836
|
function at(e) {
|
|
2828
|
-
const a =
|
|
2837
|
+
const a = on(e);
|
|
2829
2838
|
return a === "date" || a === "datetime";
|
|
2830
2839
|
}
|
|
2831
2840
|
function ys(e) {
|
|
2832
2841
|
var a, t;
|
|
2833
2842
|
return !!((a = e.sql) != null && a.trim() || (t = e.python) != null && t.trim());
|
|
2834
2843
|
}
|
|
2835
|
-
function
|
|
2836
|
-
return e.type === "kpi" &&
|
|
2844
|
+
function Ri(e) {
|
|
2845
|
+
return e.type === "kpi" && Do(e);
|
|
2837
2846
|
}
|
|
2838
|
-
function
|
|
2847
|
+
function Rt(e) {
|
|
2839
2848
|
return e.type === "table" || e.type === "detailTable";
|
|
2840
2849
|
}
|
|
2841
2850
|
function ee(e, a) {
|
|
@@ -2866,9 +2875,9 @@ function Mt(e) {
|
|
|
2866
2875
|
if (!J(e)) return;
|
|
2867
2876
|
if (e.type === "temporal_bucket") return xe(e);
|
|
2868
2877
|
const a = xe(e);
|
|
2869
|
-
return (a == null ? void 0 : a.type) === "currency" && a.currency === void 0 &&
|
|
2878
|
+
return (a == null ? void 0 : a.type) === "currency" && a.currency === void 0 && Vo(e) ? { ...a, currency: "USD" } : a;
|
|
2870
2879
|
}
|
|
2871
|
-
function
|
|
2880
|
+
function Ft(e, a, t) {
|
|
2872
2881
|
if (!(!ue(a, "dateFormat") && !ue(a, "customFormat"))) {
|
|
2873
2882
|
if (at(a.dataType) && a.format == null && a.dateFormat != null) {
|
|
2874
2883
|
const s = Fo({
|
|
@@ -2887,7 +2896,7 @@ function Rt(e, a, t) {
|
|
|
2887
2896
|
ke(a, ["dateFormat", "customFormat"]) && e.changes.push({ path: `${t}.dateFormat`, action: "removed" });
|
|
2888
2897
|
}
|
|
2889
2898
|
}
|
|
2890
|
-
function
|
|
2899
|
+
function Ai(e, a, t) {
|
|
2891
2900
|
if (!ue(a, "dateFormat") && !ue(a, "customFormat")) return;
|
|
2892
2901
|
const s = a.dateFormat === "custom" ? a.customFormat : a.dateFormat;
|
|
2893
2902
|
e.card.type === "detailTable" && at(a.dataType) && !a.format && typeof s == "string" && s.trim() ? (a.format = { type: "date", pattern: s }, a.formatOrigin = "override", e.changes.push({
|
|
@@ -2900,14 +2909,14 @@ function Ri(e, a, t) {
|
|
|
2900
2909
|
detail: "A detail date pattern on a column that has a format of its own."
|
|
2901
2910
|
}), ke(a, ["dateFormat", "customFormat"]) && e.changes.push({ path: `${t}.dateFormat`, action: "removed" });
|
|
2902
2911
|
}
|
|
2903
|
-
function
|
|
2912
|
+
function Di(e, a, t, s) {
|
|
2904
2913
|
if (a.format !== void 0) {
|
|
2905
2914
|
const n = Mt(a.format);
|
|
2906
2915
|
n ? Ie(n, a.format) || (a.format = n, e.changes.push({ path: `${s}.format`, action: "cleaned" })) : (delete a.format, e.changes.push({ path: `${s}.format`, action: "removed" }));
|
|
2907
2916
|
}
|
|
2908
|
-
t === "groupByColumns" || t === "pivotByColumns" ?
|
|
2917
|
+
t === "groupByColumns" || t === "pivotByColumns" ? Ft(e, a, s) : t === "detailColumns" ? Ai(e, a, s) : ke(a, ["dateFormat", "customFormat"]) && e.changes.push({ path: `${s}.dateFormat`, action: "removed" });
|
|
2909
2918
|
}
|
|
2910
|
-
function
|
|
2919
|
+
function Oi(e, a) {
|
|
2911
2920
|
for (const t of Lt)
|
|
2912
2921
|
ee(e.card, t).forEach((s, n) => {
|
|
2913
2922
|
var i;
|
|
@@ -2919,31 +2928,31 @@ function Di(e, a) {
|
|
|
2919
2928
|
});
|
|
2920
2929
|
});
|
|
2921
2930
|
}
|
|
2922
|
-
function
|
|
2931
|
+
function Ei(e) {
|
|
2923
2932
|
var t;
|
|
2924
2933
|
const a = (t = e.card.interactionConfig) == null ? void 0 : t.drillHierarchies;
|
|
2925
2934
|
Array.isArray(a) && a.forEach((s, n) => {
|
|
2926
2935
|
if (!J(s)) return;
|
|
2927
2936
|
const o = `interactionConfig.drillHierarchies[${n}]`;
|
|
2928
|
-
J(s.baseField) &&
|
|
2937
|
+
J(s.baseField) && Ft(e, s.baseField, `${o}.baseField`), Array.isArray(s.steps) && s.steps.forEach((i, d) => {
|
|
2929
2938
|
if (J(i) && J(i.field)) {
|
|
2930
2939
|
const l = i.field, c = `${o}.steps[${d}].field`;
|
|
2931
2940
|
if (l.format !== void 0) {
|
|
2932
2941
|
const h = Mt(l.format);
|
|
2933
2942
|
h && !Ie(h, l.format) && (l.format = h, e.changes.push({ path: `${c}.format`, action: "cleaned" }));
|
|
2934
2943
|
}
|
|
2935
|
-
|
|
2944
|
+
Ft(e, l, c);
|
|
2936
2945
|
}
|
|
2937
2946
|
});
|
|
2938
2947
|
});
|
|
2939
2948
|
}
|
|
2940
|
-
const
|
|
2949
|
+
const qi = [
|
|
2941
2950
|
"numberFormat",
|
|
2942
2951
|
"dateFormat",
|
|
2943
2952
|
"inheritMetricFormat",
|
|
2944
2953
|
"colorRanges"
|
|
2945
2954
|
];
|
|
2946
|
-
function
|
|
2955
|
+
function Ni(e, a) {
|
|
2947
2956
|
const t = (n) => n == null ? void 0 : n.trim().toLowerCase(), s = t(a);
|
|
2948
2957
|
return [
|
|
2949
2958
|
e.id,
|
|
@@ -2951,32 +2960,32 @@ function qi(e, a) {
|
|
|
2951
2960
|
e.name,
|
|
2952
2961
|
e.qualifiedFieldName,
|
|
2953
2962
|
e.label,
|
|
2954
|
-
e.role === "metric" ?
|
|
2963
|
+
e.role === "metric" ? Wo(e) : void 0
|
|
2955
2964
|
].some((n) => n !== void 0 && t(n) === s);
|
|
2956
2965
|
}
|
|
2957
2966
|
function Aa(e, a) {
|
|
2958
|
-
const t =
|
|
2967
|
+
const t = Ao(e, { columnId: a });
|
|
2959
2968
|
if (t) return t;
|
|
2960
2969
|
const s = [
|
|
2961
2970
|
...ee(e, "detailColumns"),
|
|
2962
2971
|
...ee(e, "metricColumns"),
|
|
2963
2972
|
...ee(e, "groupByColumns")
|
|
2964
|
-
].filter((n) =>
|
|
2973
|
+
].filter((n) => Ni(n, a));
|
|
2965
2974
|
return s.length === 1 ? s[0] : void 0;
|
|
2966
2975
|
}
|
|
2967
|
-
function
|
|
2976
|
+
function Pi(e) {
|
|
2968
2977
|
return e.type === "number" && J(e.numberFormat) && e.inheritMetricFormat !== !0;
|
|
2969
2978
|
}
|
|
2970
|
-
function
|
|
2979
|
+
function Li(e, a) {
|
|
2971
2980
|
var t;
|
|
2972
|
-
return at(a.dataType) ? ee(e, "detailColumns").includes(a) ? e.type === "detailTable" :
|
|
2981
|
+
return at(a.dataType) ? ee(e, "detailColumns").includes(a) ? e.type === "detailTable" : un(a.granularity) || ((t = a.format) == null ? void 0 : t.type) === "temporal_bucket" || a.semanticTemporalPresentation != null : !1;
|
|
2973
2982
|
}
|
|
2974
2983
|
function Da(e, a, t, s) {
|
|
2975
2984
|
var i;
|
|
2976
2985
|
const n = (i = e.card).preferences ?? (i.preferences = {}), o = n.sqlColumns ?? (n.sqlColumns = {});
|
|
2977
2986
|
o[a] = { ...o[a], format: t }, e.changes.push({ path: s, action: "moved", to: `preferences.sqlColumns[${JSON.stringify(a)}].format` });
|
|
2978
2987
|
}
|
|
2979
|
-
function
|
|
2988
|
+
function Mi(e) {
|
|
2980
2989
|
const [a, ...t] = e;
|
|
2981
2990
|
if (!a) return;
|
|
2982
2991
|
const s = Object.fromEntries(
|
|
@@ -2984,8 +2993,8 @@ function Li(e) {
|
|
|
2984
2993
|
);
|
|
2985
2994
|
return Et.safeParse(s).success ? s : void 0;
|
|
2986
2995
|
}
|
|
2987
|
-
function
|
|
2988
|
-
const t = e.card, s =
|
|
2996
|
+
function Bi(e, a) {
|
|
2997
|
+
const t = e.card, s = Lo({
|
|
2989
2998
|
groupByColumns: ee(t, "groupByColumns"),
|
|
2990
2999
|
metricColumns: ee(t, "metricColumns"),
|
|
2991
3000
|
pivotByColumns: ee(t, "pivotByColumns"),
|
|
@@ -3002,10 +3011,10 @@ function Mi(e, a) {
|
|
|
3002
3011
|
});
|
|
3003
3012
|
}
|
|
3004
3013
|
}
|
|
3005
|
-
function
|
|
3014
|
+
function Vi(e, a) {
|
|
3006
3015
|
var o;
|
|
3007
3016
|
if (!a.length) return;
|
|
3008
|
-
const t = ee(e.card, "metricColumns"), s = t.length === 1 ? t[0] : void 0, n = s && !s.format ?
|
|
3017
|
+
const t = ee(e.card, "metricColumns"), s = t.length === 1 ? t[0] : void 0, n = s && !s.format ? Mi(a.map((i) => i.format)) : void 0;
|
|
3009
3018
|
s && n && st(e, s, n, a[0].from);
|
|
3010
3019
|
for (const i of a)
|
|
3011
3020
|
if (!(s != null && s.format && Ie(i.format, s.format))) {
|
|
@@ -3030,69 +3039,69 @@ function Bi(e, a) {
|
|
|
3030
3039
|
);
|
|
3031
3040
|
}
|
|
3032
3041
|
}
|
|
3033
|
-
function
|
|
3042
|
+
function ji(e) {
|
|
3034
3043
|
var l;
|
|
3035
3044
|
const a = (l = e.card.preferences) == null ? void 0 : l.tablePrefs, t = a == null ? void 0 : a.columnSettingsMap;
|
|
3036
3045
|
if (!J(t)) return;
|
|
3037
3046
|
const s = e.card, n = ys(s), o = ee(s, "pivotByColumns").length > 0, i = /* @__PURE__ */ new Map(), d = [];
|
|
3038
3047
|
for (const [c, h] of Object.entries(t)) {
|
|
3039
3048
|
if (!J(h)) continue;
|
|
3040
|
-
const p = h,
|
|
3041
|
-
if (
|
|
3042
|
-
const
|
|
3043
|
-
if (
|
|
3044
|
-
Da(e, c,
|
|
3045
|
-
else if (
|
|
3046
|
-
const w = Aa(s, c), x = { key: c, format:
|
|
3049
|
+
const p = h, v = `preferences.tablePrefs.columnSettingsMap[${JSON.stringify(c)}]`;
|
|
3050
|
+
if (Pi(p)) {
|
|
3051
|
+
const I = xo(p.numberFormat);
|
|
3052
|
+
if (I && n)
|
|
3053
|
+
Da(e, c, I, `${v}.numberFormat`);
|
|
3054
|
+
else if (I && Rt(s)) {
|
|
3055
|
+
const w = Aa(s, c), x = { key: c, format: I, from: `${v}.numberFormat` };
|
|
3047
3056
|
w ? i.set(w, [...i.get(w) ?? [], x]) : o ? d.push(x) : e.unconverted.push({
|
|
3048
3057
|
path: x.from,
|
|
3049
3058
|
reason: "unmatched_column_setting",
|
|
3050
3059
|
detail: `"${c}" names no card column.`
|
|
3051
3060
|
});
|
|
3052
|
-
} else
|
|
3061
|
+
} else I && s.type !== "matrixTable" && s.type !== "kpi" && ee(s, "metricColumns").some(
|
|
3053
3062
|
(x) => x.comparison != null
|
|
3054
3063
|
) && e.unconverted.push({
|
|
3055
|
-
path: `${
|
|
3064
|
+
path: `${v}.numberFormat`,
|
|
3056
3065
|
reason: "chart_comparison_column_setting",
|
|
3057
3066
|
detail: `"${c}" formats this chart's comparison tooltip only.`
|
|
3058
3067
|
});
|
|
3059
3068
|
}
|
|
3060
3069
|
if (J(p.dateFormat)) {
|
|
3061
|
-
const
|
|
3062
|
-
if (
|
|
3063
|
-
Da(e, c,
|
|
3064
|
-
else if (
|
|
3070
|
+
const I = p.type === "date";
|
|
3071
|
+
if (I && n)
|
|
3072
|
+
Da(e, c, So(p.dateFormat), `${v}.dateFormat`);
|
|
3073
|
+
else if (I && Rt(s)) {
|
|
3065
3074
|
const w = Aa(s, c);
|
|
3066
|
-
(!w || !
|
|
3067
|
-
path: `${
|
|
3075
|
+
(!w || !Li(s, w)) && e.unconverted.push({
|
|
3076
|
+
path: `${v}.dateFormat`,
|
|
3068
3077
|
reason: "config_column_date_setting",
|
|
3069
3078
|
detail: `"${c}"'s download formats its dates with this setting.`
|
|
3070
3079
|
});
|
|
3071
3080
|
}
|
|
3072
3081
|
}
|
|
3073
|
-
for (const
|
|
3074
|
-
Object.prototype.hasOwnProperty.call(p,
|
|
3082
|
+
for (const I of qi)
|
|
3083
|
+
Object.prototype.hasOwnProperty.call(p, I) && (delete p[I], e.changes.push({ path: `${v}.${I}`, action: "removed" }));
|
|
3075
3084
|
}
|
|
3076
|
-
|
|
3085
|
+
Bi(e, i), Vi(e, d);
|
|
3077
3086
|
}
|
|
3078
|
-
function
|
|
3087
|
+
function Ki(e) {
|
|
3079
3088
|
return Object.keys(e).some(
|
|
3080
3089
|
(a) => a !== "enabled" && a !== "colorRanges" && e[a] !== void 0
|
|
3081
3090
|
);
|
|
3082
3091
|
}
|
|
3083
|
-
function
|
|
3092
|
+
function Wi(e) {
|
|
3084
3093
|
return (e == null ? void 0 : e.enabled) === !1 || (e == null ? void 0 : e.enabled) === "false";
|
|
3085
3094
|
}
|
|
3086
|
-
function
|
|
3095
|
+
function Ui(e) {
|
|
3087
3096
|
const a = e.card, t = a.preferences;
|
|
3088
3097
|
if (!t) return;
|
|
3089
|
-
const s = t.kpiVisualOptions, n = J(s == null ? void 0 : s.formatOptions) ? s.formatOptions : void 0, o = t, i = J(o.formatNumber) ? o.formatNumber : void 0, d = n ? xe(
|
|
3098
|
+
const s = t.kpiVisualOptions, n = J(s == null ? void 0 : s.formatOptions) ? s.formatOptions : void 0, o = t, i = J(o.formatNumber) ? o.formatNumber : void 0, d = n ? xe(ko(n)) : void 0, l = i && Ki(i) ? xe(To(i)) : void 0;
|
|
3090
3099
|
if (a.type === "kpi") {
|
|
3091
|
-
if (
|
|
3100
|
+
if (Wi(i) && e.unconverted.push({
|
|
3092
3101
|
path: "preferences.formatNumber.enabled",
|
|
3093
3102
|
reason: "raw_display",
|
|
3094
3103
|
detail: "Formatting is switched off on this KPI."
|
|
3095
|
-
}),
|
|
3104
|
+
}), Ri(a)) {
|
|
3096
3105
|
const c = d ?? l, h = s == null ? void 0 : s.queryComparisonPolarity;
|
|
3097
3106
|
(c || h) && (t.sqlKpiValue = {
|
|
3098
3107
|
...t.sqlKpiValue,
|
|
@@ -3107,14 +3116,14 @@ function Wi(e) {
|
|
|
3107
3116
|
ee(a, "metricColumns").forEach((h) => {
|
|
3108
3117
|
d ? st(e, h, d, "preferences.kpiVisualOptions.formatOptions") : l && !h.format && st(e, h, l, "preferences.formatNumber");
|
|
3109
3118
|
});
|
|
3110
|
-
|
|
3119
|
+
Gi(e, i);
|
|
3111
3120
|
} else if (l) {
|
|
3112
3121
|
const c = ee(a, "metricColumns");
|
|
3113
3122
|
ys(a) ? e.unconverted.push({
|
|
3114
3123
|
path: "preferences.formatNumber",
|
|
3115
3124
|
reason: "sql_card_wide_format",
|
|
3116
3125
|
detail: "A card-wide number format on a SQL or Python card."
|
|
3117
|
-
}) : !
|
|
3126
|
+
}) : !Rt(a) && a.type !== "matrixTable" && c.some((h) => !h.format) && e.unconverted.push({
|
|
3118
3127
|
path: "preferences.formatNumber",
|
|
3119
3128
|
reason: "chart_card_wide_format",
|
|
3120
3129
|
detail: "A card-wide number format on a chart measure without a format of its own."
|
|
@@ -3128,11 +3137,11 @@ function Wi(e) {
|
|
|
3128
3137
|
for (const c of ["numberAxisFormat", "columnSettings"])
|
|
3129
3138
|
ke(t, [c]) && e.changes.push({ path: `preferences.${c}`, action: "removed" });
|
|
3130
3139
|
}
|
|
3131
|
-
function
|
|
3140
|
+
function Gi(e, a) {
|
|
3132
3141
|
var o;
|
|
3133
3142
|
const t = a == null ? void 0 : a.decimalPlaces, s = e.card.preferences;
|
|
3134
3143
|
if (typeof t != "number" || ((o = s.comparisonPresentation) == null ? void 0 : o.precision) !== void 0) return;
|
|
3135
|
-
const n =
|
|
3144
|
+
const n = Mo(t);
|
|
3136
3145
|
n !== void 0 && (s.comparisonPresentation = {
|
|
3137
3146
|
...s.comparisonPresentation,
|
|
3138
3147
|
precision: n
|
|
@@ -3142,24 +3151,24 @@ function Ui(e, a) {
|
|
|
3142
3151
|
to: "preferences.comparisonPresentation.precision"
|
|
3143
3152
|
}));
|
|
3144
3153
|
}
|
|
3145
|
-
const
|
|
3146
|
-
function
|
|
3154
|
+
const Qi = /* @__PURE__ */ new Set(["number", "currency", "percent", "scientific", "date", "duration"]);
|
|
3155
|
+
function Hi(e) {
|
|
3147
3156
|
const a = e.card.preferences;
|
|
3148
3157
|
if (a)
|
|
3149
|
-
for (const t of
|
|
3158
|
+
for (const t of Ti) {
|
|
3150
3159
|
const s = a[t];
|
|
3151
3160
|
if (!J(s)) continue;
|
|
3152
3161
|
const n = `preferences.${t}`, o = J(s.formatOptions) ? s.formatOptions : void 0, i = t === "dataLabelsConfig" && typeof s.format == "string" ? s.format : void 0, d = s.formatMode === "override" || s.formatMode === "inherit" ? s.formatMode : s.mode === "override" || s.mode === "inherit" ? s.mode : void 0, l = d ?? (i === "none" ? "raw" : i && i !== "auto" || o ? "override" : "inherit");
|
|
3153
3162
|
if (l === "raw" || d === void 0 && i === "none")
|
|
3154
3163
|
e.unconverted.push({ path: `${n}.format`, reason: "raw_display", detail: "Data labels show raw values." });
|
|
3155
3164
|
else if (l === "override") {
|
|
3156
|
-
const c = o && o.type ? o : i &&
|
|
3165
|
+
const c = o && o.type ? o : i && Qi.has(i) ? { ...o, type: i } : o, h = c ? xe(Ro(c, { preserveOmittedProperties: !0 })) : void 0;
|
|
3157
3166
|
h && (s.valueFormat = h, e.changes.push({ path: `${n}.formatOptions`, action: "moved", to: `${n}.valueFormat` }));
|
|
3158
3167
|
}
|
|
3159
3168
|
ke(s, ["formatMode", "mode", "formatOptions", ...t === "dataLabelsConfig" ? ["format"] : []]) && e.changes.push({ path: `${n}.formatMode`, action: "removed" });
|
|
3160
3169
|
}
|
|
3161
3170
|
}
|
|
3162
|
-
function
|
|
3171
|
+
function zi(e) {
|
|
3163
3172
|
var s;
|
|
3164
3173
|
const a = (s = e.card.config) == null ? void 0 : s.matrix, t = J(a) && J(a.presentation) ? a.presentation : void 0;
|
|
3165
3174
|
if (t)
|
|
@@ -3172,27 +3181,27 @@ function Hi(e) {
|
|
|
3172
3181
|
}
|
|
3173
3182
|
}
|
|
3174
3183
|
}
|
|
3175
|
-
function
|
|
3184
|
+
function Yi(e, a = {}) {
|
|
3176
3185
|
const t = { card: structuredClone(e), changes: [], unconverted: [] };
|
|
3177
3186
|
for (const s of Lt)
|
|
3178
3187
|
ee(t.card, s).forEach((n, o) => {
|
|
3179
|
-
J(n) &&
|
|
3188
|
+
J(n) && Di(t, n, s, `config.${s}[${o}]`);
|
|
3180
3189
|
});
|
|
3181
|
-
return
|
|
3190
|
+
return Ei(t), ji(t), Ui(t), Hi(t), zi(t), Oi(t, a), t.changes.length === 0 && t.unconverted.length === 0 ? { card: e, changes: [], unconverted: [] } : t;
|
|
3182
3191
|
}
|
|
3183
|
-
const
|
|
3184
|
-
function
|
|
3192
|
+
const Ji = "__semaphor_unassigned_trigger__", Xi = "__NULL__";
|
|
3193
|
+
function Zi(e) {
|
|
3185
3194
|
var a, t;
|
|
3186
3195
|
return !!((a = e.sql) != null && a.trim() || (t = e.python) != null && t.trim());
|
|
3187
3196
|
}
|
|
3188
|
-
function
|
|
3197
|
+
function er(e) {
|
|
3189
3198
|
const a = e.config;
|
|
3190
3199
|
return a ? e.type === "detailTable" ? a.detailColumns ?? [] : [...a.detailColumns ?? [], ...a.metricColumns ?? [], ...a.groupByColumns ?? []] : [];
|
|
3191
3200
|
}
|
|
3192
3201
|
function Oa(e) {
|
|
3193
3202
|
return [e.id, e.alias, e.name, e.qualifiedFieldName, e.label];
|
|
3194
3203
|
}
|
|
3195
|
-
function
|
|
3204
|
+
function tr(e, a) {
|
|
3196
3205
|
var c, h;
|
|
3197
3206
|
const t = ((c = e.config) == null ? void 0 : c.metricColumns) ?? [], s = ((h = e.config) == null ? void 0 : h.pivotByColumns) ?? [];
|
|
3198
3207
|
if (t.length !== 1 || s.length !== 1) return { reason: "pivot_key_form" };
|
|
@@ -3201,61 +3210,61 @@ function er(e, a) {
|
|
|
3201
3210
|
ref: {
|
|
3202
3211
|
kind: "pivot",
|
|
3203
3212
|
metricId: n.id,
|
|
3204
|
-
members: [{ fieldId: o.id, value: a ===
|
|
3213
|
+
members: [{ fieldId: o.id, value: a === Xi ? null : a }]
|
|
3205
3214
|
}
|
|
3206
3215
|
};
|
|
3207
3216
|
}
|
|
3208
|
-
function
|
|
3217
|
+
function ar(e, a) {
|
|
3209
3218
|
var i, d;
|
|
3210
|
-
if (a ===
|
|
3211
|
-
if (
|
|
3212
|
-
const t =
|
|
3213
|
-
return o.length === 1 ? { ref: { kind: "field", fieldId: o[0] } } : o.length > 1 ? { reason: "ambiguous_column" } : (d = (i = e.config) == null ? void 0 : i.pivotByColumns) != null && d.length ?
|
|
3219
|
+
if (a === Ji) return { reason: "unassigned_trigger" };
|
|
3220
|
+
if (Zi(e)) return { ref: { kind: "result", key: a } };
|
|
3221
|
+
const t = er(e), s = t.filter((l) => Oa(l).includes(a)), n = s.length ? s : t.filter((l) => Oa(l).some((c) => (c == null ? void 0 : c.trim().toLowerCase()) === a.trim().toLowerCase())), o = [...new Set(n.map((l) => l.id))];
|
|
3222
|
+
return o.length === 1 ? { ref: { kind: "field", fieldId: o[0] } } : o.length > 1 ? { reason: "ambiguous_column" } : (d = (i = e.config) == null ? void 0 : i.pivotByColumns) != null && d.length ? tr(e, a) : { reason: "no_matching_column" };
|
|
3214
3223
|
}
|
|
3215
3224
|
function Ea(e, a, t, s, n) {
|
|
3216
|
-
const o = (
|
|
3217
|
-
s.push({ ruleId: e.id, name: e.name, enabled: e.enabled !== !1, path: `${t}.${
|
|
3225
|
+
const o = (g, k, T) => {
|
|
3226
|
+
s.push({ ruleId: e.id, name: e.name, enabled: e.enabled !== !1, path: `${t}.${g}`, reference: k, reason: T });
|
|
3218
3227
|
}, i = e.condition.columnId ?? "", d = a(i);
|
|
3219
3228
|
if (!("ref" in d)) return o("condition.columnId", i, d.reason);
|
|
3220
3229
|
const l = e.target.level, c = l === "row" ? e.target.applyToColumnIds : e.target.columnIds;
|
|
3221
3230
|
if (l === "cell" && !(c != null && c.length) && e.enabled !== !1)
|
|
3222
3231
|
return o("target.columnIds", "", "every_column");
|
|
3223
3232
|
const h = [];
|
|
3224
|
-
for (const [
|
|
3225
|
-
const
|
|
3226
|
-
if (!("ref" in
|
|
3227
|
-
return o(`target.${l === "row" ? "applyToColumnIds" : "columnIds"}[${
|
|
3228
|
-
h.push(
|
|
3233
|
+
for (const [g, k] of (c ?? []).entries()) {
|
|
3234
|
+
const T = a(k);
|
|
3235
|
+
if (!("ref" in T))
|
|
3236
|
+
return o(`target.${l === "row" ? "applyToColumnIds" : "columnIds"}[${g}]`, k, T.reason);
|
|
3237
|
+
h.push(T.ref);
|
|
3229
3238
|
}
|
|
3230
3239
|
const {
|
|
3231
3240
|
columnIds: p,
|
|
3232
|
-
applyToColumnIds:
|
|
3233
|
-
conditionColumnId:
|
|
3241
|
+
applyToColumnIds: v,
|
|
3242
|
+
conditionColumnId: I,
|
|
3234
3243
|
matrix: w,
|
|
3235
3244
|
rowRoles: x,
|
|
3236
|
-
depth:
|
|
3245
|
+
depth: E,
|
|
3237
3246
|
includeTotals: _,
|
|
3238
|
-
includeSubtotals:
|
|
3239
|
-
...
|
|
3240
|
-
} = e.target, { columnId:
|
|
3241
|
-
...
|
|
3247
|
+
includeSubtotals: S,
|
|
3248
|
+
...y
|
|
3249
|
+
} = e.target, { columnId: D, ...$ } = e.condition, N = {
|
|
3250
|
+
...y,
|
|
3242
3251
|
...h.length ? { columns: h } : {},
|
|
3243
3252
|
// The Matrix scope means something only on a Matrix card.
|
|
3244
3253
|
...n ? {
|
|
3245
3254
|
...w !== void 0 ? { matrix: w } : {},
|
|
3246
3255
|
...x !== void 0 ? { rowRoles: x } : {},
|
|
3247
|
-
...
|
|
3256
|
+
...E !== void 0 ? { depth: E } : {},
|
|
3248
3257
|
..._ !== void 0 ? { includeTotals: _ } : {},
|
|
3249
|
-
...
|
|
3258
|
+
...S !== void 0 ? { includeSubtotals: S } : {}
|
|
3250
3259
|
} : {}
|
|
3251
3260
|
};
|
|
3252
3261
|
return {
|
|
3253
3262
|
...e,
|
|
3254
3263
|
condition: { ...$, column: d.ref },
|
|
3255
|
-
target:
|
|
3264
|
+
target: N
|
|
3256
3265
|
};
|
|
3257
3266
|
}
|
|
3258
|
-
function
|
|
3267
|
+
function sr(e, a) {
|
|
3259
3268
|
var n;
|
|
3260
3269
|
const t = (n = La(e)) == null ? void 0 : n.value;
|
|
3261
3270
|
if (!t) return [];
|
|
@@ -3264,540 +3273,544 @@ function ar(e, a) {
|
|
|
3264
3273
|
if (!o || typeof o != "object") return [];
|
|
3265
3274
|
const { start: d, end: l, color: c } = o, h = s(d), p = s(l);
|
|
3266
3275
|
if (Number.isNaN(h) || Number.isNaN(p) || h > p || h === 1 / 0 || p === -1 / 0) return [];
|
|
3267
|
-
const
|
|
3276
|
+
const v = h === -1 / 0 ? void 0 : h, I = p === 1 / 0 ? void 0 : p, w = v !== void 0 && I !== void 0 ? { kind: "between", column: t, min: v, max: I, inclusive: !0 } : v !== void 0 ? { kind: "comparison", column: t, operator: "gte", value: v } : I !== void 0 ? { kind: "comparison", column: t, operator: "lte", value: I } : { kind: "blank", column: t, isBlank: !1 }, x = typeof c == "string" ? c : "";
|
|
3268
3277
|
return [{ id: `kpi-color-range-${i + 1}`, condition: w, target: { level: "cell" }, style: { textColor: x } }];
|
|
3269
3278
|
}).reverse();
|
|
3270
3279
|
}
|
|
3271
|
-
function
|
|
3272
|
-
var h, p,
|
|
3280
|
+
function or(e) {
|
|
3281
|
+
var h, p, v, I, w, x, E;
|
|
3273
3282
|
const a = structuredClone(e), t = [], s = [], n = [], o = (_) => {
|
|
3274
|
-
t.some((
|
|
3283
|
+
t.some((S) => S.from.startsWith(_)) || t.push({ ruleId: "", action: "removed", from: _ });
|
|
3275
3284
|
}, i = (h = a.preferences) == null ? void 0 : h.tablePrefs;
|
|
3276
3285
|
if (i && ue(i, "conditionalFormatting")) {
|
|
3277
|
-
const _ = i.conditionalFormatting,
|
|
3278
|
-
((_ == null ? void 0 : _.rules) ?? []).forEach((
|
|
3279
|
-
var
|
|
3280
|
-
if (!
|
|
3281
|
-
t.push({ ruleId:
|
|
3286
|
+
const _ = i.conditionalFormatting, S = "preferences.tablePrefs.conditionalFormatting", y = a.type === "table" || a.type === "detailTable";
|
|
3287
|
+
((_ == null ? void 0 : _.rules) ?? []).forEach((D, $) => {
|
|
3288
|
+
var g;
|
|
3289
|
+
if (!y || ((g = D.target) == null ? void 0 : g.matrix) !== void 0) {
|
|
3290
|
+
t.push({ ruleId: D.id, action: "removed", from: `${S}.rules[${$}]` });
|
|
3282
3291
|
return;
|
|
3283
3292
|
}
|
|
3284
|
-
const
|
|
3285
|
-
|
|
3286
|
-
}), delete i.conditionalFormatting, s.some((
|
|
3293
|
+
const N = Ea(D, (k) => ar(a, k), `${S}.rules[${$}]`, s, !1);
|
|
3294
|
+
N && (n.push(N), t.push({ ruleId: D.id, action: "moved", from: `${S}.rules[${$}]` }));
|
|
3295
|
+
}), delete i.conditionalFormatting, s.some((D) => D.path.startsWith(S)) || o(S);
|
|
3287
3296
|
}
|
|
3288
|
-
const d = (
|
|
3297
|
+
const d = (v = (p = a.config) == null ? void 0 : p.matrix) == null ? void 0 : v.presentation;
|
|
3289
3298
|
if (d && ue(d, "conditionalFormatting")) {
|
|
3290
|
-
const _ = d.conditionalFormatting,
|
|
3291
|
-
((_ == null ? void 0 : _.rules) ?? []).forEach((
|
|
3292
|
-
const
|
|
3293
|
-
|
|
3294
|
-
(
|
|
3295
|
-
`${
|
|
3299
|
+
const _ = d.conditionalFormatting, S = "config.matrix.presentation.conditionalFormatting", y = new Set((w = (I = a.config) == null ? void 0 : I.matrix) == null ? void 0 : w.spec.measures.map((D) => D.id));
|
|
3300
|
+
((_ == null ? void 0 : _.rules) ?? []).forEach((D, $) => {
|
|
3301
|
+
const N = Ea(
|
|
3302
|
+
D,
|
|
3303
|
+
(g) => y.has(g) ? { ref: { kind: "matrixMeasure", measureId: g } } : { reason: "no_matching_column" },
|
|
3304
|
+
`${S}.rules[${$}]`,
|
|
3296
3305
|
s,
|
|
3297
3306
|
!0
|
|
3298
3307
|
);
|
|
3299
|
-
|
|
3300
|
-
}), delete d.conditionalFormatting, s.some((
|
|
3308
|
+
N && (n.push(N), t.push({ ruleId: D.id, action: "moved", from: `${S}.rules[${$}]` }));
|
|
3309
|
+
}), delete d.conditionalFormatting, s.some((D) => D.path.startsWith(S)) || o(S);
|
|
3301
3310
|
}
|
|
3302
3311
|
const l = a.preferences, c = l == null ? void 0 : l.formatNumber;
|
|
3303
3312
|
if (c && ue(c, "colorRanges")) {
|
|
3304
3313
|
const _ = Array.isArray(c.colorRanges) ? c.colorRanges : [];
|
|
3305
3314
|
if (a.type === "kpi") {
|
|
3306
|
-
const
|
|
3307
|
-
n.push(...
|
|
3315
|
+
const S = sr(a, _);
|
|
3316
|
+
n.push(...S), S.forEach((y) => t.push({ ruleId: y.id, action: "moved", from: "preferences.formatNumber.colorRanges" }));
|
|
3308
3317
|
}
|
|
3309
|
-
delete c.colorRanges, Object.keys(c).length === 0 && delete l.formatNumber, t.some((
|
|
3318
|
+
delete c.colorRanges, Object.keys(c).length === 0 && delete l.formatNumber, t.some((S) => S.from === "preferences.formatNumber.colorRanges") || t.push({ ruleId: "", action: "removed", from: "preferences.formatNumber.colorRanges" });
|
|
3310
3319
|
}
|
|
3311
3320
|
if (!t.length && !s.length) return { card: e, changes: [], unresolved: [] };
|
|
3312
3321
|
if (n.length) {
|
|
3313
|
-
const _ = ((
|
|
3322
|
+
const _ = ((E = (x = a.preferences) == null ? void 0 : x.conditionalFormatting) == null ? void 0 : E.rules) ?? [], S = new Set(_.map((y) => y.id));
|
|
3314
3323
|
a.preferences = {
|
|
3315
3324
|
...a.preferences,
|
|
3316
3325
|
conditionalFormatting: {
|
|
3317
3326
|
version: 1,
|
|
3318
|
-
rules: [..._, ...n.filter((
|
|
3327
|
+
rules: [..._, ...n.filter((y) => !S.has(y.id))]
|
|
3319
3328
|
}
|
|
3320
3329
|
};
|
|
3321
3330
|
}
|
|
3322
3331
|
return { card: a, changes: t, unresolved: s };
|
|
3323
3332
|
}
|
|
3324
|
-
function
|
|
3325
|
-
const { only: t, ...s } = a, n = t === "rules" ? void 0 :
|
|
3333
|
+
function Nr(e, a = {}) {
|
|
3334
|
+
const { only: t, ...s } = a, n = t === "rules" ? void 0 : Yi(e, s), o = t === "formats" ? void 0 : or((n == null ? void 0 : n.card) ?? e);
|
|
3326
3335
|
return { card: (o == null ? void 0 : o.card) ?? (n == null ? void 0 : n.card) ?? e, formats: n, rules: o };
|
|
3327
3336
|
}
|
|
3328
|
-
function
|
|
3337
|
+
function nr(e) {
|
|
3329
3338
|
if (e.op === "dashboard.update" || e.op === "dashboard.style" || e.op === "sheet.update") return !0;
|
|
3330
3339
|
if (e.op !== "card.update") return !1;
|
|
3331
3340
|
switch (e.update.kind) {
|
|
3332
3341
|
case "relabel":
|
|
3333
3342
|
return !0;
|
|
3334
3343
|
case "settings":
|
|
3335
|
-
return e.update.settings.totals === void 0 && e.update.settings.inheritComparison === void 0;
|
|
3344
|
+
return e.update.settings.totals === void 0 && e.update.settings.inheritComparison === void 0 && e.update.settings.band !== "trend";
|
|
3336
3345
|
default:
|
|
3337
3346
|
return !1;
|
|
3338
3347
|
}
|
|
3339
3348
|
}
|
|
3340
|
-
function
|
|
3341
|
-
return e.impact.length || e.detaches ? "needed" : e.operations.length > 0 && e.operations.every(
|
|
3349
|
+
function Pr(e) {
|
|
3350
|
+
return e.impact.length || e.detaches ? "needed" : e.operations.length > 0 && e.operations.every(nr) ? "not_needed" : "needed";
|
|
3342
3351
|
}
|
|
3343
3352
|
export {
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3353
|
+
Br as AGGREGATES,
|
|
3354
|
+
Vr as AUTOMATIC_TEMPORAL_BUCKET_FORMAT,
|
|
3355
|
+
jr as CALCULATED_FIELDS_GROUP_ID,
|
|
3356
|
+
Kr as CALCULATED_FIELDS_GROUP_NAME,
|
|
3357
|
+
Wr as CARD_CONFIG_KEY_CLASSES,
|
|
3358
|
+
Ur as CARD_KEY_CLASSES,
|
|
3359
|
+
mo as CARD_QUERY_CONFIG_KEYS,
|
|
3360
|
+
kr as CARD_QUERY_REQUEST_DESCRIPTIVE_FIELDS,
|
|
3361
|
+
Sr as CARD_QUERY_REQUEST_EXECUTED_FIELDS,
|
|
3362
|
+
th as CARD_SURFACES,
|
|
3363
|
+
Gr as CARD_TYPES,
|
|
3355
3364
|
Ae as CARD_TYPE_RULES,
|
|
3356
3365
|
je as CHART_COLORS_BOUNDS,
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3366
|
+
Qr as CHIP_VALUE_COLUMN,
|
|
3367
|
+
Hr as COLUMN_KEY_CLASSES,
|
|
3368
|
+
zr as COLUMN_PRESENTATION_KEYS,
|
|
3369
|
+
af as COMPARISON_SIGN_WORDS,
|
|
3370
|
+
Yr as CONTROL_BINDING_MAPPING_MISSING_ERROR_CODE,
|
|
3371
|
+
Jr as CONTROL_BINDING_TARGET_INVALID_ERROR_CODE,
|
|
3372
|
+
Xr as CONTROL_BINDING_VALUE_INVALID_ERROR_CODE,
|
|
3373
|
+
Zr as CONTROL_CONTEXT_UNSUPPORTED_ERROR_CODE,
|
|
3374
|
+
ed as CONTROL_DEFINITION_DUPLICATE_ERROR_CODE,
|
|
3375
|
+
td as CONTROL_DEFINITION_INVALID_ERROR_CODE,
|
|
3376
|
+
ad as CONTROL_PLACEHOLDER_QUOTED_ERROR_CODE,
|
|
3377
|
+
sd as CONTROL_REFERENCE_MISSING_ERROR_CODE,
|
|
3378
|
+
od as CONTROL_VALUE_INVALID_ERROR_CODE,
|
|
3379
|
+
nd as CONTROL_VALUE_MISSING_ERROR_CODE,
|
|
3380
|
+
ah as CORNER_STEPS,
|
|
3372
3381
|
ce as CardQueryRequestError,
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3382
|
+
id as ControlResolutionError,
|
|
3383
|
+
rd as DASHBOARD_CHANGE_OPS,
|
|
3384
|
+
dd as DASHBOARD_DEFAULT_OPTION_DEPENDENCIES,
|
|
3385
|
+
sf as DASHBOARD_FILTER_OPERATIONS,
|
|
3386
|
+
ld as DASHBOARD_INPUT_RUNTIME_SCOPE_KINDS,
|
|
3387
|
+
nn as DASHBOARD_STYLE_NUMBER_BOUNDS,
|
|
3388
|
+
of as DOCUMENT_KPI_SECTION_MAX_CARDS,
|
|
3389
|
+
nf as DOCUMENT_KPI_SECTION_MAX_TILES,
|
|
3390
|
+
cd as DYNAMIC_TEXT_MESSAGE,
|
|
3391
|
+
ud as DashboardFilterMappingContractError,
|
|
3392
|
+
fd as ExecutionControlContractError,
|
|
3393
|
+
md as FILTER_OPERATORS,
|
|
3385
3394
|
ua as FORMAT_WORDS,
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3395
|
+
hd as FilterModelError,
|
|
3396
|
+
pd as KPI_MEASURES_SHOWN,
|
|
3397
|
+
gd as KPI_TREND_PERIODS,
|
|
3398
|
+
bd as LEGACY_TABLE_CARD_TYPES,
|
|
3399
|
+
Yf as LEGACY_TABLE_ROUTING_ID_NAMESPACE,
|
|
3390
3400
|
ba as MAX_CREATE_CHANGES,
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3401
|
+
yd as MAX_NEXT_STEP_CHARS,
|
|
3402
|
+
Io as MAX_PROPOSED_CHANGES,
|
|
3403
|
+
vd as MAX_QUERY_LIMIT,
|
|
3404
|
+
Id as MAX_TEXT_WORDS,
|
|
3405
|
+
_d as MEASURE_CALCULATION_SUMMARIES,
|
|
3406
|
+
xm as NEW_CARD_TYPE,
|
|
3407
|
+
Cd as PUBLIC_TRANSFORM_KIND,
|
|
3408
|
+
$d as QUERY_ASPECTS,
|
|
3409
|
+
wd as QUERY_CONFIG_KEY_ASPECTS,
|
|
3410
|
+
Sm as RELATIONSHIP_ROUTE_CHANGED_MESSAGE,
|
|
3411
|
+
xd as RESERVED_VARIABLE_NAMES,
|
|
3412
|
+
Sd as SEMAPHOR_CARTESIAN_CHART_TYPES,
|
|
3413
|
+
kd as SETTINGS_BY_KIND,
|
|
3414
|
+
nh as SHELF_FIELD_KEYS,
|
|
3415
|
+
sh as SPACING_STEPS,
|
|
3416
|
+
Td as TIME_GRAINS,
|
|
3417
|
+
Rd as TOOLBAR_FILTER_REACH_FIELDS,
|
|
3418
|
+
rf as VARIABLE_CARD_TYPE,
|
|
3419
|
+
df as VARIABLE_COMPARISON_PARTS,
|
|
3420
|
+
Fd as VARIABLE_GETS,
|
|
3421
|
+
lf as VARIABLE_LIST_CAP,
|
|
3422
|
+
cf as VARIABLE_LIST_SHOWN,
|
|
3423
|
+
Ad as VARIABLE_NAME_PATTERN,
|
|
3424
|
+
uf as VARIABLE_VALUE_PART,
|
|
3425
|
+
Dd as WINDOW_ERROR_CODES,
|
|
3426
|
+
Od as WINDOW_WARNING_CODES,
|
|
3427
|
+
Ed as acceptedColumnRefKinds,
|
|
3428
|
+
qd as analyticsFilterSchema,
|
|
3429
|
+
Jf as applyCardReferenceRemapping,
|
|
3430
|
+
Nd as applyCardSettings,
|
|
3420
3431
|
wt as applyDashboardOperations,
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3432
|
+
Pd as applyFilterApplicability,
|
|
3433
|
+
km as applyFilterSettingsChange,
|
|
3434
|
+
Xf as applyGroupByOverride,
|
|
3435
|
+
Ld as applyLinkedClickToFilterOverrides,
|
|
3436
|
+
Md as applyMeasureCalculations,
|
|
3437
|
+
Bd as applyOptionDependencyOverride,
|
|
3438
|
+
Vd as applyVariableChange,
|
|
3439
|
+
jd as blockClause,
|
|
3440
|
+
Kd as blockSentence,
|
|
3441
|
+
hh as bookmarkImpactSentence,
|
|
3442
|
+
Tm as buildCardExportFormatOptions,
|
|
3443
|
+
Zf as buildCardExportQueryContext,
|
|
3444
|
+
Rm as buildCardExportRequest,
|
|
3445
|
+
Fm as buildCardExportRequestFromOptions,
|
|
3446
|
+
Am as buildColumnCatalog,
|
|
3447
|
+
Wd as buildControlDefinitionIndex,
|
|
3448
|
+
oo as buildDashboardCardSourceIndex,
|
|
3449
|
+
Dm as buildEntityColumnGroup,
|
|
3450
|
+
Om as buildFilterInputFromDefinition,
|
|
3451
|
+
Qo as buildFilterInputFromField,
|
|
3452
|
+
Ud as buildLinkedClickToFilterOverrides,
|
|
3453
|
+
Gd as buildProposeChangeInputSchema,
|
|
3454
|
+
Qd as buildSavedEditorCard,
|
|
3455
|
+
Em as buildTableExportFormatOptions,
|
|
3456
|
+
qm as cardColumnRefForKey,
|
|
3457
|
+
Hd as cardColumnRefSchema,
|
|
3458
|
+
$o as cardConditionalFormattingSchema,
|
|
3459
|
+
zd as cardQueryPatchSchema,
|
|
3460
|
+
Ns as cardSettingsKind,
|
|
3461
|
+
Es as cardTypeSentenceName,
|
|
3462
|
+
Yd as carryColumnSettings,
|
|
3463
|
+
ho as changeCardType,
|
|
3464
|
+
Jd as changeMatrixEditor,
|
|
3465
|
+
wo as checkConditionalRuleColumns,
|
|
3455
3466
|
Dt as checkDataVariable,
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3467
|
+
Xd as checkDetailDateFormat,
|
|
3468
|
+
qr as checkPresentationStores,
|
|
3469
|
+
Zd as chipOverVariable,
|
|
3470
|
+
el as clickToFilterSettingsSchema,
|
|
3471
|
+
tl as collectJoinPlanIdentifiers,
|
|
3461
3472
|
Qa as collectVariableReferences,
|
|
3462
3473
|
Na as columnDataset,
|
|
3463
|
-
|
|
3474
|
+
po as columnFieldKey,
|
|
3464
3475
|
Ka as columnKeys,
|
|
3465
|
-
|
|
3476
|
+
al as columnRefIssue,
|
|
3466
3477
|
la as columnRefKey,
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3478
|
+
sl as columnSettingsInputSchema,
|
|
3479
|
+
ff as comparisonPartPresentation,
|
|
3480
|
+
em as composeCardReferenceRemapping,
|
|
3481
|
+
ol as conditionalRuleSchema,
|
|
3482
|
+
Pr as confirmClassFor,
|
|
3483
|
+
nl as controlBindingExecutionSchema,
|
|
3484
|
+
il as controlDefinitionExecutionSchema,
|
|
3485
|
+
ao as controlRefusal,
|
|
3475
3486
|
Fr as convertLegacyStyle,
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3487
|
+
rl as createDashboardFilterBindingId,
|
|
3488
|
+
ym as createMatrixAuthoringDraft,
|
|
3489
|
+
vm as createMatrixConfig,
|
|
3490
|
+
zo as createNewCard,
|
|
3491
|
+
dl as createTargetSchema,
|
|
3492
|
+
Ho as createTextCard,
|
|
3493
|
+
ll as dashboardCardFilterSourceInventoryContains,
|
|
3494
|
+
Xs as dashboardChangeSchema,
|
|
3495
|
+
cl as dashboardFilterTargetMatchesLogicalValue,
|
|
3496
|
+
mf as dashboardFilterValueTypeForDataType,
|
|
3497
|
+
qo as dashboardInputScopeIncludesDocumentSheets,
|
|
3498
|
+
Tn as dashboardStyleAsEdit,
|
|
3499
|
+
ul as dashboardStyleChangeSchema,
|
|
3489
3500
|
za as dashboardStyleLayers,
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3501
|
+
fl as defaultClickToFilterSettings,
|
|
3502
|
+
pn as defaultVariableGet,
|
|
3503
|
+
ih as defaultVariableName,
|
|
3504
|
+
ph as describeBookmarkImpact,
|
|
3505
|
+
ml as describeDashboardFilterCardReach,
|
|
3495
3506
|
Ee as describeDashboardFilterCardReachDetail,
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3507
|
+
hl as describeMeasureCalculations,
|
|
3508
|
+
to as describeQueryChange,
|
|
3509
|
+
Nm as describeRelationshipRoute,
|
|
3510
|
+
Pm as describeRelationshipSkip,
|
|
3511
|
+
hf as documentInputTextUsage,
|
|
3512
|
+
pf as doesDashboardInputApplyToTarget,
|
|
3513
|
+
gf as doesDashboardInputReachFilterTarget,
|
|
3514
|
+
bf as doesDashboardInputSurviveCarriedContext,
|
|
3515
|
+
pl as doesToolbarFilterReachTab,
|
|
3516
|
+
Lm as domainCalculatedFields,
|
|
3517
|
+
rh as draftBlocker,
|
|
3518
|
+
gn as draftFromVariable,
|
|
3519
|
+
gl as drawsDetailDatesInBrowser,
|
|
3520
|
+
bl as dropMatrixEditorField,
|
|
3521
|
+
bh as editBrandStyle,
|
|
3522
|
+
rn as editDashboardStyle,
|
|
3523
|
+
yl as evaluateConditionalRules,
|
|
3524
|
+
vl as explicitComparisonSchema,
|
|
3525
|
+
Us as fieldIdentityKey,
|
|
3526
|
+
Il as fieldRef,
|
|
3527
|
+
_l as fieldRefSchema,
|
|
3528
|
+
Cl as filterApplicabilityContextForCard,
|
|
3529
|
+
Mm as filterReachPreviewAnswers,
|
|
3530
|
+
$l as filterValueReachForCard,
|
|
3531
|
+
wl as filterValueSemanticDataset,
|
|
3521
3532
|
ot as findCatalogField,
|
|
3522
|
-
|
|
3523
|
-
|
|
3533
|
+
xl as findDashboardCardExecutableSource,
|
|
3534
|
+
Sl as findDashboardCardPinnedCatalogSource,
|
|
3524
3535
|
Ua as findDashboardFilterTarget,
|
|
3525
|
-
|
|
3536
|
+
kl as findDashboardSqlPinnedCatalogSource,
|
|
3526
3537
|
ps as findRetiredCardPresentationFields,
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3538
|
+
Er as findRetiredPresentationFields,
|
|
3539
|
+
Ws as findSortedColumn,
|
|
3540
|
+
Bm as flattenEntityColumns,
|
|
3541
|
+
Tl as foldPrototypeDocumentInputs,
|
|
3542
|
+
Rl as formatFilterModelIssues,
|
|
3532
3543
|
ws as formatResolvedPrimaryDateFieldIssues,
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3544
|
+
Fl as formatSkippedFilterWarnings,
|
|
3545
|
+
Al as fromEditableRules,
|
|
3546
|
+
Vm as getCalculatedFieldAggregateOverrides,
|
|
3547
|
+
Dl as getCalculatedFieldNamespace,
|
|
3548
|
+
jm as getCalculatedFieldParameters,
|
|
3549
|
+
Km as getCalculatedFieldShelfOverrides,
|
|
3550
|
+
Ol as getCardDefinition,
|
|
3551
|
+
Wm as getClickContextFromTable,
|
|
3552
|
+
El as getColumnCatalogFieldId,
|
|
3553
|
+
ql as getDashboardFilterSubscriptionHint,
|
|
3554
|
+
Nl as getDashboardGlobalDateFilter,
|
|
3555
|
+
yf as getDocumentKpiSectionShapeIssues,
|
|
3556
|
+
vf as getDocumentSectionCards,
|
|
3557
|
+
Um as getDomainCalculatedSelectionOverrides,
|
|
3558
|
+
Pl as getFieldAggregationOptions,
|
|
3559
|
+
Ll as getMatrixBindingTargets,
|
|
3560
|
+
Im as getMatrixLevelLabel,
|
|
3561
|
+
_m as getMatrixMeasureLabel,
|
|
3562
|
+
Ml as getStableDomainCalculatedFieldId,
|
|
3563
|
+
Bl as getTemporalBucketAuthoringOptions,
|
|
3564
|
+
Vl as getTemporalBucketAuthoringSelection,
|
|
3565
|
+
jl as handleSchema,
|
|
3566
|
+
Kl as hasDashboardFilterSubscription,
|
|
3556
3567
|
ue as hasStoredKey,
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3568
|
+
Wl as hasTextCardRichWords,
|
|
3569
|
+
Ul as hasToolbarFilterReachField,
|
|
3570
|
+
tm as hostFilterValueFor,
|
|
3571
|
+
am as hostFilterValuesToSlots,
|
|
3572
|
+
Gl as inspectMatrixCardConfig,
|
|
3573
|
+
sm as isAdHocFilterValueOnTab,
|
|
3563
3574
|
Ca as isAggregateGet,
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3575
|
+
Ql as isAllowedDashboardInputScopeCombination,
|
|
3576
|
+
Hl as isCardType,
|
|
3577
|
+
If as isDashboardFilterOperationCompatible,
|
|
3567
3578
|
Ga as isDashboardInputOnTab,
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3579
|
+
_f as isDashboardInputOwnedBySheet,
|
|
3580
|
+
Cf as isDashboardInputScopeEmpty,
|
|
3581
|
+
$f as isDashboardTargetIdTaken,
|
|
3582
|
+
zl as isDatabaseEntityReference,
|
|
3583
|
+
Yl as isGroupedDate,
|
|
3584
|
+
Jl as isLegacyTableCard,
|
|
3585
|
+
Xl as isPresentationCurrencyBinding,
|
|
3586
|
+
Zl as isSemanticAutoJoinCard,
|
|
3587
|
+
ec as isSemaphorCartesianChartType,
|
|
3588
|
+
Do as isSqlKpi,
|
|
3589
|
+
tc as isStructuralControlBinding,
|
|
3590
|
+
ac as isTextCardRichContent,
|
|
3591
|
+
sc as isValidControlOptionPresentation,
|
|
3592
|
+
wf as isVariableComparisonPart,
|
|
3593
|
+
oc as isWhenRun,
|
|
3594
|
+
nc as kpiSegmentMetricId,
|
|
3595
|
+
ic as kpiShowsTrend,
|
|
3596
|
+
Os as kpiTrendBy,
|
|
3597
|
+
Ks as labelAt,
|
|
3598
|
+
rc as layoutArrangeSchema,
|
|
3599
|
+
om as legacyTableRoutingIds,
|
|
3600
|
+
nm as legacyTableRoutingTarget,
|
|
3601
|
+
dc as linkedClickToFilterOverridesSchema,
|
|
3602
|
+
im as listAdHocFilterValuesOnTab,
|
|
3590
3603
|
we as listDashboardCardLocations,
|
|
3591
|
-
|
|
3592
|
-
|
|
3604
|
+
lc as listDashboardFilterDefinitions,
|
|
3605
|
+
cc as listDashboardFilterInputsOnTab,
|
|
3593
3606
|
Wa as listDashboardFilterTargets,
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3607
|
+
xf as listDashboardInputReachKeys,
|
|
3608
|
+
Oo as listDashboardInputScopeExceptedCardIds,
|
|
3609
|
+
Eo as listDashboardInputScopeExceptedSheetIds,
|
|
3610
|
+
uc as listDashboardInputsTolerantly,
|
|
3598
3611
|
Ot as listDashboardTabTargets,
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3612
|
+
Sf as listDataVariablePlaces,
|
|
3613
|
+
rm as listFilterInputValueTargets,
|
|
3614
|
+
kf as listFilterTargetScopeTargets,
|
|
3615
|
+
Tf as listReachedVariableTargets,
|
|
3616
|
+
Rf as listReferencedDataVariableIds,
|
|
3617
|
+
fc as listStoredFilterDefinitions,
|
|
3618
|
+
Ff as listVariableScopeTargets,
|
|
3619
|
+
Af as mapDashboardCards,
|
|
3620
|
+
Df as mapDocumentSectionCards,
|
|
3621
|
+
mc as mapRuleColumns,
|
|
3622
|
+
hc as matchColumns,
|
|
3623
|
+
dm as matrixCatalogSources,
|
|
3624
|
+
yo as matrixColumnKeys,
|
|
3625
|
+
pc as matrixColumnsSchema,
|
|
3626
|
+
gc as matrixDefinitionFieldRefs,
|
|
3627
|
+
bc as matrixDefinitionFields,
|
|
3628
|
+
yc as matrixDefinitionSources,
|
|
3629
|
+
vc as matrixEditorCatalogFromFields,
|
|
3630
|
+
lm as matrixExecutionSources,
|
|
3631
|
+
Ic as measureCalculationOptions,
|
|
3632
|
+
_c as measureComparisonSchema,
|
|
3633
|
+
Cc as measureRefSchema,
|
|
3634
|
+
$c as measureTransformSchema,
|
|
3635
|
+
Cm as mergeMatrixSorts,
|
|
3636
|
+
ro as metricCardQuerySchema,
|
|
3637
|
+
bo as moveMatrixLevel,
|
|
3638
|
+
dh as newVariableDraft,
|
|
3639
|
+
lh as newVariableId,
|
|
3640
|
+
wc as normalizeClickToFilterSettings,
|
|
3641
|
+
xc as normalizeDashboardInputs,
|
|
3642
|
+
Sc as normalizeLegacyLinkedTargetOverrides,
|
|
3643
|
+
kc as occurrenceKeys,
|
|
3631
3644
|
es as outlineCalendar,
|
|
3632
|
-
|
|
3645
|
+
Or as outlineDashboard,
|
|
3633
3646
|
Le as outlineFilter,
|
|
3634
3647
|
as as outlineFilters,
|
|
3635
3648
|
ut as ownsItsAggregate,
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3649
|
+
Rr as parseCardQueryRequest,
|
|
3650
|
+
$n as parseCardQueryRequestContext,
|
|
3651
|
+
Tr as parseCardQueryRequestExtras,
|
|
3652
|
+
Tc as parseColumnRefKey,
|
|
3653
|
+
Gm as parseDashboardStyle,
|
|
3654
|
+
Rc as parseExecutionControlBindingsShallow,
|
|
3642
3655
|
Ss as parseExecutionControlContext,
|
|
3643
|
-
|
|
3656
|
+
Fc as parseExecutionControlContract,
|
|
3644
3657
|
pa as planCardLabels,
|
|
3645
3658
|
ha as planCardRequery,
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3659
|
+
Qm as pluralDatasetLabel,
|
|
3660
|
+
cm as prepareLoadedDashboard,
|
|
3661
|
+
Ac as previewTemporalBucketAuthoringFormat,
|
|
3662
|
+
Of as projectDataVariableToCard,
|
|
3663
|
+
Dc as pruneUnrelatedCalculatedFilters,
|
|
3664
|
+
so as queryForm,
|
|
3665
|
+
Oc as queryMeasureSchema,
|
|
3666
|
+
Ec as readCardConditionalRules,
|
|
3654
3667
|
Ce as readCardQuery,
|
|
3655
3668
|
At as readCardSettings,
|
|
3656
3669
|
he as readCardSource,
|
|
3657
3670
|
qe as readCardTypeProperties,
|
|
3658
|
-
|
|
3671
|
+
uh as readComparisonDates,
|
|
3659
3672
|
$e as readDashboardFilterModel,
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3673
|
+
fh as readDefaultComparisonDates,
|
|
3674
|
+
qc as readExactDomainCalculatedFieldReference,
|
|
3675
|
+
Hm as readFilterReachResponse,
|
|
3676
|
+
um as readFilterValueList,
|
|
3677
|
+
Nc as readKpiFigure,
|
|
3678
|
+
Pc as readMatrixCardConfig,
|
|
3679
|
+
Lc as readMeasureCalculations,
|
|
3680
|
+
Mc as readSqlFilterUse,
|
|
3681
|
+
Bc as readStoredTransform,
|
|
3669
3682
|
ja as readTextCardWords,
|
|
3670
3683
|
Ze as readTextWords,
|
|
3671
|
-
|
|
3672
|
-
|
|
3684
|
+
Vc as readTransform,
|
|
3685
|
+
Ef as readVariableAnswer,
|
|
3673
3686
|
rs as readVariableEditability,
|
|
3674
3687
|
kt as readVariableSource,
|
|
3675
|
-
|
|
3676
|
-
|
|
3688
|
+
_o as readablePresentation,
|
|
3689
|
+
jc as rebindDashboardOptionDependencyInputId,
|
|
3677
3690
|
ma as rebuildsRole,
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3691
|
+
Kc as reconcileMatrixSpecStructure,
|
|
3692
|
+
Wc as reconcileTemporalBucketAuthoringFormat,
|
|
3693
|
+
io as recordsCardQuerySchema,
|
|
3694
|
+
Ys as refDataset,
|
|
3682
3695
|
be as refKey,
|
|
3683
3696
|
Ct as refName,
|
|
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
|
-
|
|
3697
|
+
Uc as relationshipAddSchema,
|
|
3698
|
+
Gc as relationshipRouteTarget,
|
|
3699
|
+
Qc as remapClickToFilterReferences,
|
|
3700
|
+
Hc as remapLinkedClickToFilterOverrides,
|
|
3701
|
+
zc as requireNormalizedDashboardInputs,
|
|
3702
|
+
Yc as resolveBindingControlValue,
|
|
3703
|
+
qf as resolveCanonicalDetailResultRawKey,
|
|
3704
|
+
Nf as resolveCanonicalResultOutputKey,
|
|
3705
|
+
Lo as resolveCanonicalResultOutputKeys,
|
|
3706
|
+
Pf as resolveCanonicalResultRawKey,
|
|
3707
|
+
zm as resolveCardColumnRef,
|
|
3708
|
+
Gn as resolveCardSettings,
|
|
3709
|
+
Ym as resolveConditionalRules,
|
|
3710
|
+
Ar as resolveDashboardChanges,
|
|
3711
|
+
Dr as resolveDashboardCreate,
|
|
3712
|
+
Jc as resolveDashboardEntitySource,
|
|
3713
|
+
Xc as resolveDashboardFilterAutomaticTarget,
|
|
3714
|
+
Zc as resolveDashboardFilterInheritedTarget,
|
|
3715
|
+
eu as resolveDashboardOptionDependencies,
|
|
3716
|
+
tu as resolveDashboardOptionPopulation,
|
|
3717
|
+
au as resolveDashboardSqlFilterTarget,
|
|
3718
|
+
dn as resolveDashboardStyle,
|
|
3719
|
+
su as resolveDetailTableRawTemporalPresentation,
|
|
3720
|
+
ou as resolveFieldSelectedSource,
|
|
3721
|
+
nu as resolveGroupByFieldTarget,
|
|
3722
|
+
iu as resolveKpiLayout,
|
|
3710
3723
|
La as resolveKpiShape,
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3724
|
+
ru as resolveKpiValueStyle,
|
|
3725
|
+
fm as resolveMatrixControlBindings,
|
|
3726
|
+
$m as resolveMatrixDefinition,
|
|
3714
3727
|
fa as resolveMeasureCalculations,
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3728
|
+
du as resolveMeasureTransform,
|
|
3729
|
+
lu as resolveMetricFieldTarget,
|
|
3730
|
+
cu as resolveScalarMappedValue,
|
|
3731
|
+
uu as resolveTemporalBucketAuthoringFormat,
|
|
3719
3732
|
xs as resolveTemporalResultOwner,
|
|
3720
3733
|
ga as resolveTextCardWords,
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3734
|
+
fu as resolveValueStyle,
|
|
3735
|
+
mu as respondsToSelectionsSchema,
|
|
3736
|
+
hu as retainConditionalRules,
|
|
3737
|
+
pu as retainedMatrixPath,
|
|
3738
|
+
Lf as rewriteDashboardInputScopeIds,
|
|
3739
|
+
mm as routeLegacyTableCard,
|
|
3740
|
+
hm as routeLegacyTableCards,
|
|
3741
|
+
pm as routeLegacyTableFrame,
|
|
3729
3742
|
He as sameColumnKey,
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3743
|
+
gu as sanitizeTextCardUrl,
|
|
3744
|
+
bu as selectDashboardOptionDependencyInputIds,
|
|
3745
|
+
yu as selectionFieldFromExplorerField,
|
|
3746
|
+
Jm as selectionTupleFromClickContext,
|
|
3747
|
+
Xm as setMeasureCalculations,
|
|
3748
|
+
vu as settableCardType,
|
|
3749
|
+
Iu as sharedCardPreferences,
|
|
3750
|
+
_u as sharedTableDialect,
|
|
3751
|
+
Cu as sheetChangeSchemas,
|
|
3752
|
+
no as sqlCardQuerySchema,
|
|
3753
|
+
$u as sqlKpiResultKeys,
|
|
3741
3754
|
Ne as statedLabelsOf,
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3755
|
+
Rs as storedCardTypeFor,
|
|
3756
|
+
wu as storedRunPresentation,
|
|
3757
|
+
Mf as storedTextRefs,
|
|
3758
|
+
xu as stripInstanceTargetsForLibrarySave,
|
|
3759
|
+
Su as structuralControlOverride,
|
|
3747
3760
|
ts as summarizeFilter,
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3761
|
+
ku as supportsCanonicalDashboardTemporalResult,
|
|
3762
|
+
Tu as tabChangeSchemas,
|
|
3763
|
+
Ru as textCardExcerpt,
|
|
3764
|
+
Fu as textCardWordingClauses,
|
|
3752
3765
|
_t as textCatalogAt,
|
|
3753
3766
|
ct as toChartType,
|
|
3754
|
-
|
|
3755
|
-
|
|
3767
|
+
Au as toEditableRules,
|
|
3768
|
+
Du as toFiniteKpiNumber,
|
|
3756
3769
|
$t as toPublicCardType,
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3770
|
+
Js as toStoredComparison,
|
|
3771
|
+
Ou as toolbarFilterInputFields,
|
|
3772
|
+
Eu as toolbarFilterScope,
|
|
3773
|
+
qu as transformComparisonDocument,
|
|
3774
|
+
Nu as transformGroupings,
|
|
3775
|
+
Pu as transformOrderSchema,
|
|
3776
|
+
go as updateMatrixConfig,
|
|
3777
|
+
Yi as upgradeCardFormats,
|
|
3778
|
+
Nr as upgradeCardPresentation,
|
|
3779
|
+
or as upgradeConditionalFormatting,
|
|
3780
|
+
gm as upgradeToStoredDashboard,
|
|
3781
|
+
Lu as validateAndResolveWindowTransforms,
|
|
3782
|
+
Mu as validateControlValue,
|
|
3783
|
+
Bf as validateDashboardFilterValues,
|
|
3771
3784
|
$s as validateResolvedPrimaryDateFieldShape,
|
|
3772
|
-
|
|
3773
|
-
|
|
3785
|
+
Vf as variableCardKeepsComparison,
|
|
3786
|
+
jf as variableComparison,
|
|
3774
3787
|
Ye as variableFromDraft,
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3788
|
+
hn as variableGetOptions,
|
|
3789
|
+
Kf as variablePartCell,
|
|
3790
|
+
Wf as variablePartType,
|
|
3791
|
+
Po as variableParts,
|
|
3792
|
+
Uf as variableQueryResponseOf,
|
|
3793
|
+
Zm as variableSourceWords,
|
|
3794
|
+
bn as variableTakesComparison,
|
|
3795
|
+
Jo as variableWords,
|
|
3796
|
+
Bu as withCardConditionalRules,
|
|
3797
|
+
Vu as withCardConfigSqlDatePatterns,
|
|
3798
|
+
Gf as withCardExcludedFromScope,
|
|
3799
|
+
Qf as withCardIncludedInScope,
|
|
3800
|
+
ju as withDashboardOptionDependencyOverride,
|
|
3801
|
+
Ku as withDetailSqlDatePattern,
|
|
3802
|
+
Hf as withDraftCard,
|
|
3803
|
+
Wu as withFormatOverride,
|
|
3804
|
+
Uu as withSqlDatePattern,
|
|
3805
|
+
No as withUnstatedScopeParts,
|
|
3806
|
+
Gu as withoutSqlDatePattern,
|
|
3807
|
+
Qu as withoutToolbarFilterReachFields,
|
|
3808
|
+
Hu as wordingBlocks,
|
|
3809
|
+
zu as wordingClauses,
|
|
3810
|
+
Yu as writeColumnFormat,
|
|
3811
|
+
Ju as writeColumnPolarity,
|
|
3812
|
+
Xu as writeComparisonDisplay,
|
|
3813
|
+
Zu as writeComparisonPresentation,
|
|
3814
|
+
ef as writeInheritComparison,
|
|
3815
|
+
zs as writeTextWords
|
|
3803
3816
|
};
|