react-semaphor 0.1.590 → 0.1.591
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +254 -236
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{aggregate-measure-field-BrkXsSJp.js → aggregate-measure-field-DHlDj0Pc.js} +2 -2
- package/dist/chunks/{assistant-chat-C_6dBLUk.js → assistant-chat-Cazikwyh.js} +13 -13
- package/dist/chunks/{bookmark-impact-DkZABEd3.js → bookmark-impact-rWjQgk8h.js} +2 -2
- package/dist/chunks/{bookmark-state-Bn7k3ttp.js → bookmark-state-Bt_eQEqt.js} +569 -537
- package/dist/chunks/{card-filter-builder-6vflbF9O.js → card-filter-builder-DFR-6Jpm.js} +929 -910
- package/dist/chunks/{comparison-window-caption-fqijZdVd.js → comparison-window-caption-CFaw-kIV.js} +6 -6
- package/dist/chunks/{dashboard-DpgRl65K.js → dashboard-DCh9hKnJ.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BLbhONJz.js → dashboard-briefing-launcher-ob8G1b58.js} +91 -91
- package/dist/chunks/{dashboard-controls-kCTYEEsq.js → dashboard-controls-Nszg0k1A.js} +64 -64
- package/dist/chunks/{dashboard-json-CNIFresY.js → dashboard-json-BpwnG23b.js} +4 -4
- package/dist/chunks/{dates-BoeweqEo.js → dates-BOLBSBpn.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-D0eWTlPL.js → edit-dashboard-visual-BvM7br5P.js} +5501 -5475
- package/dist/chunks/filter-line-CYT7KIXb.js +133 -0
- package/dist/chunks/{filter-reach-copy-eMhDPTYH.js → filter-reach-copy-By3r7O3G.js} +11 -11
- package/dist/chunks/filter-value-text-CFiIZWJP.js +153 -0
- package/dist/chunks/{index-D8LFjI8j.js → index-CsQYlwhU.js} +5 -5
- package/dist/chunks/{layout-grid-BG__sPkb.js → layout-grid-DoFIfQGd.js} +1 -1
- package/dist/chunks/{list-filter-Cb8i7N8f.js → list-filter-BeTQxjNy.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-D9Ll_9R-.js → matrix-analytical-definition-CyWOwLmE.js} +17 -17
- package/dist/chunks/{matrix-member-presentation-DVBJR0MA.js → matrix-member-presentation-Bj2YcHAP.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-JSmproo9.js → matrix-operation-contract-CAanJeCj.js} +60 -60
- package/dist/chunks/{metric-comparison-xE_J6hkg.js → metric-comparison-BeKnUD08.js} +27 -31
- package/dist/chunks/{paintbrush-C310xSuR.js → paintbrush-KeaU1L1a.js} +1 -1
- package/dist/chunks/{palette-Ci5P91Zb.js → palette-BcFJLeXB.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-D-DfPAjb.js → pivot-header-presentation-gUxhdIdr.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-DbBahmgc.js → pivot-result-contract-expectations-BkMRCjzf.js} +111 -111
- package/dist/chunks/{pivot-result-identity-CUsMt_4r.js → pivot-result-identity-BKUjYO1u.js} +1 -1
- package/dist/chunks/raw-temporal-value-BzdgeDa7.js +454 -0
- package/dist/chunks/{report-preferences-dialog-dUlVLgEk.js → report-preferences-dialog-ChXt8wCt.js} +13 -13
- package/dist/chunks/{report-runtime-context-CrOgmuxO.js → report-runtime-context-g4Zp_TU9.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-NurwNg4I.js → resolve-dashboard-input-context-BlyFX8He.js} +5053 -4955
- package/dist/chunks/{save-BhhXfp4s.js → save-C9CZAk6V.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-CPp--vXU.js → saved-dashboard-context-BPSdH2jW.js} +7 -7
- package/dist/chunks/{selection-filter-compiler-CHG-8xnW.js → selection-filter-compiler-BclSpK3P.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-CXojR95M.js → semaphor-ready-indicator-BZUMCHRU.js} +28962 -28917
- package/dist/chunks/{shelf-drop-preview-context-BDScAUdq.js → shelf-drop-preview-context-yJheoeTC.js} +5 -5
- package/dist/chunks/{stored-dashboard-KkH4zOhq.js → stored-dashboard-CxQl9g0l.js} +653 -657
- package/dist/chunks/{style-sheet-parts-CmXmKqGw.js → style-sheet-parts-DM_Mw_sm.js} +45 -42
- package/dist/chunks/{table-export-sheet-ClSgERQC.js → table-export-sheet-h7wm5TwP.js} +1 -1
- package/dist/chunks/{token-types-DTocOcwt.js → token-types-BB2ImFx6.js} +1 -1
- package/dist/chunks/{upload-DDYc1Qjj.js → upload-CMTCg47S.js} +1 -1
- package/dist/chunks/{validators-CrYXNnNE.js → validators-BlEWWX9O.js} +576 -562
- package/dist/chunks/{variable-draft-Bi3RlULA.js → variable-draft-OpYyaVCW.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1602 -1555
- package/dist/format-utils/index.js +14 -14
- package/dist/index.js +18 -18
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +7 -5
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/dashboard-date-comparison-plan.d.ts +0 -1
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +2 -1
- package/dist/types/shared/analytics-protocol/relative-date/sentence.d.ts +81 -0
- package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +0 -9
- package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +23 -2
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +20 -0
- package/dist/types/shared/dashboard-authoring/card-formats/detail-date-display.d.ts +84 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +36 -36
- package/dist/types/shared/dashboard-authoring/filter-model/date-filter-default.d.ts +37 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/format-utils/filter-line.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/filter-line-Dza3ee4w.js +0 -131
- package/dist/chunks/filter-value-text-DQw4v3nC.js +0 -146
- package/dist/chunks/raw-temporal-value-BnGCWJAL.js +0 -322
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a7 as G, f as Pe, r as Le, k as qe } from "./validators-BlEWWX9O.js";
|
|
2
2
|
import { z as l } from "zod";
|
|
3
|
-
import { Q as B, F as
|
|
4
|
-
import { D as
|
|
3
|
+
import { Q as B, F as Be, r as je } from "./matrix-operation-contract-CAanJeCj.js";
|
|
4
|
+
import { D as Ue, C as ze, a as j, r as We, e as Qe } from "./metric-comparison-BeKnUD08.js";
|
|
5
5
|
import "./analytics-base-schemas-8wz9vqn_.js";
|
|
6
|
-
import { a as
|
|
7
|
-
import { r as
|
|
6
|
+
import { a as N } from "./applied-constraints-DU-wndZ7.js";
|
|
7
|
+
import { r as Ge } from "./pivot-result-identity-BKUjYO1u.js";
|
|
8
8
|
const ne = 8, re = 6, V = Object.freeze([]);
|
|
9
|
-
function
|
|
9
|
+
function Ye(e) {
|
|
10
10
|
switch (e.type) {
|
|
11
11
|
case "table":
|
|
12
12
|
case "chart":
|
|
@@ -17,7 +17,7 @@ function We(e) {
|
|
|
17
17
|
return V;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Je(e, t) {
|
|
21
21
|
switch (e.type) {
|
|
22
22
|
case "table":
|
|
23
23
|
case "chart": {
|
|
@@ -28,7 +28,7 @@ function Qe(e, t) {
|
|
|
28
28
|
case "kpi": {
|
|
29
29
|
if (!Array.isArray(e.cards)) return e;
|
|
30
30
|
const n = e.cards.map(t);
|
|
31
|
-
return n.every((r,
|
|
31
|
+
return n.every((r, s) => r === e.cards[s]) ? e : { ...e, cards: n };
|
|
32
32
|
}
|
|
33
33
|
default:
|
|
34
34
|
return e;
|
|
@@ -38,66 +38,66 @@ function _(e) {
|
|
|
38
38
|
var n;
|
|
39
39
|
const t = [];
|
|
40
40
|
for (const r of e.sheets || []) {
|
|
41
|
-
const
|
|
42
|
-
for (const
|
|
43
|
-
t.push({ kind: "sheetCard", sheetId:
|
|
44
|
-
for (const
|
|
45
|
-
for (const i of
|
|
41
|
+
const s = r.id;
|
|
42
|
+
for (const a of r.cards || [])
|
|
43
|
+
t.push({ kind: "sheetCard", sheetId: s, cardId: a.id, card: a });
|
|
44
|
+
for (const a of r.frames || [])
|
|
45
|
+
for (const i of a.cards || [])
|
|
46
46
|
t.push({
|
|
47
47
|
kind: "frameCard",
|
|
48
|
-
sheetId:
|
|
49
|
-
frameId:
|
|
48
|
+
sheetId: s,
|
|
49
|
+
frameId: a.id,
|
|
50
50
|
cardId: i.id,
|
|
51
51
|
card: i
|
|
52
52
|
});
|
|
53
|
-
for (const
|
|
54
|
-
for (const i of
|
|
53
|
+
for (const a of ((n = r.document) == null ? void 0 : n.sections) || [])
|
|
54
|
+
for (const i of Ye(a))
|
|
55
55
|
t.push({
|
|
56
56
|
kind: "documentSectionCard",
|
|
57
|
-
sheetId:
|
|
58
|
-
sectionId:
|
|
57
|
+
sheetId: s,
|
|
58
|
+
sectionId: a.id,
|
|
59
59
|
cardId: i.id,
|
|
60
60
|
card: i
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
return t;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function nn(e, t, n) {
|
|
66
66
|
let r = !1;
|
|
67
|
-
const
|
|
68
|
-
if (r || !t) return
|
|
69
|
-
const
|
|
67
|
+
const s = He(e, (i) => i.id !== n.id ? i : (r = !0, i === n ? i : n));
|
|
68
|
+
if (r || !t) return s;
|
|
69
|
+
const a = (s.sheets || []).map(
|
|
70
70
|
(i) => i.id === t && i.kind !== "document" ? { ...i, cards: [...i.cards ?? [], n] } : i
|
|
71
71
|
);
|
|
72
|
-
return { ...
|
|
72
|
+
return { ...s, sheets: a };
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const n = (
|
|
76
|
-
const i =
|
|
77
|
-
return i.every((o, c) => o ===
|
|
78
|
-
}, r = (e.sheets || []).map((
|
|
74
|
+
function He(e, t) {
|
|
75
|
+
const n = (s, a) => {
|
|
76
|
+
const i = s.map((o) => t(o, a(o)));
|
|
77
|
+
return i.every((o, c) => o === s[c]) ? s : i;
|
|
78
|
+
}, r = (e.sheets || []).map((s) => {
|
|
79
79
|
var f, y, h;
|
|
80
|
-
const
|
|
80
|
+
const a = s.id, i = s.cards && n(s.cards, (p) => ({ kind: "sheetCard", sheetId: a, cardId: p.id, card: p })), o = (f = s.frames) == null ? void 0 : f.map((p) => {
|
|
81
81
|
if (!p.cards) return p;
|
|
82
|
-
const I = n(p.cards, (g) => ({ kind: "frameCard", sheetId:
|
|
82
|
+
const I = n(p.cards, (g) => ({ kind: "frameCard", sheetId: a, frameId: p.id, cardId: g.id, card: g }));
|
|
83
83
|
return I === p.cards ? p : { ...p, cards: I };
|
|
84
|
-
}), c = (h = (y =
|
|
85
|
-
(p) =>
|
|
86
|
-
), u = !!o && o.some((p, I) => p !==
|
|
87
|
-
return i ===
|
|
88
|
-
...
|
|
89
|
-
...i ===
|
|
84
|
+
}), c = (h = (y = s.document) == null ? void 0 : y.sections) == null ? void 0 : h.map(
|
|
85
|
+
(p) => Je(p, (I) => t(I, { kind: "documentSectionCard", sheetId: a, sectionId: p.id, cardId: I.id, card: I }))
|
|
86
|
+
), u = !!o && o.some((p, I) => p !== s.frames[I]), d = !!c && c.some((p, I) => p !== s.document.sections[I]);
|
|
87
|
+
return i === s.cards && !u && !d ? s : {
|
|
88
|
+
...s,
|
|
89
|
+
...i === s.cards ? {} : { cards: i },
|
|
90
90
|
...u ? { frames: o } : {},
|
|
91
|
-
...d ? { document: { ...
|
|
91
|
+
...d ? { document: { ...s.document, sections: c } } : {}
|
|
92
92
|
};
|
|
93
93
|
});
|
|
94
|
-
return r.every((
|
|
94
|
+
return r.every((s, a) => s === e.sheets[a]) ? e : { ...e, sheets: r };
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function $(e) {
|
|
97
97
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
if (
|
|
99
|
+
function rn(e) {
|
|
100
|
+
if (!$(e))
|
|
101
101
|
return [{ path: "", message: "must be an object." }];
|
|
102
102
|
const t = [];
|
|
103
103
|
e.title !== void 0 && typeof e.title != "string" && t.push({ path: "title", message: "must be a string." });
|
|
@@ -109,23 +109,23 @@ function en(e) {
|
|
|
109
109
|
path: "cards",
|
|
110
110
|
message: `must hold 1 to ${ne} KPI cards.`
|
|
111
111
|
});
|
|
112
|
-
const
|
|
113
|
-
n.forEach((
|
|
114
|
-
if (
|
|
112
|
+
const s = /* @__PURE__ */ new Set();
|
|
113
|
+
n.forEach((a, i) => {
|
|
114
|
+
if (!$(a)) {
|
|
115
115
|
t.push({ path: `cards[${i}]`, message: "must be a card." });
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
typeof
|
|
118
|
+
typeof a.id != "string" || !a.id ? t.push({
|
|
119
119
|
path: `cards[${i}].id`,
|
|
120
120
|
message: "must be a non-empty string."
|
|
121
|
-
}) :
|
|
121
|
+
}) : s.has(a.id) ? t.push({
|
|
122
122
|
path: `cards[${i}].id`,
|
|
123
|
-
message: `duplicates card id '${
|
|
124
|
-
}) :
|
|
123
|
+
message: `duplicates card id '${a.id}'.`
|
|
124
|
+
}) : s.add(a.id), a.type !== "kpi" && t.push({ path: `cards[${i}].type`, message: "must be 'kpi'." });
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
const r = e.kpi;
|
|
128
|
-
return
|
|
128
|
+
return $(r) ? (r.layout !== "tiles" && r.layout !== "lines" ? t.push({
|
|
129
129
|
path: "kpi.layout",
|
|
130
130
|
message: "must be 'tiles' or 'lines'."
|
|
131
131
|
}) : r.layout === "tiles" && Array.isArray(n) && n.length > re && t.push({
|
|
@@ -137,7 +137,7 @@ const Ie = "dashboardInput";
|
|
|
137
137
|
function se(e) {
|
|
138
138
|
return e === "label" || e === "value" || e === "start" || e === "end" || e === "range";
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function Xe(e) {
|
|
141
141
|
return e === "generatedAt" || e === "pageNumber" || e === "pageCount";
|
|
142
142
|
}
|
|
143
143
|
function v(e) {
|
|
@@ -152,18 +152,18 @@ function v(e) {
|
|
|
152
152
|
...t.export ? { export: t.export } : {}
|
|
153
153
|
};
|
|
154
154
|
if (t.source === "documentMeta")
|
|
155
|
-
return
|
|
155
|
+
return Xe(t.key) ? { source: "documentMeta", key: t.key } : void 0;
|
|
156
156
|
if (t.source === "data")
|
|
157
157
|
return typeof t.variableId == "string" && typeof t.export == "string" ? { source: "data", variableId: t.variableId, export: t.export } : void 0;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function sn(e, t) {
|
|
160
160
|
const n = v(e), r = v(t);
|
|
161
|
-
return !n || !r ? JSON.stringify(e) === JSON.stringify(t) : [.../* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(r)])].every((
|
|
161
|
+
return !n || !r ? JSON.stringify(e) === JSON.stringify(t) : [.../* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(r)])].every((a) => n[a] === r[a]);
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ze(e) {
|
|
164
164
|
return x(e) ? e.type === "variable" ? e.ref === void 0 ? [] : [e.ref] : e.type === "when" && x(e.test) && e.test.ref !== void 0 ? [e.test.ref] : [] : [];
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function et(e, t) {
|
|
167
167
|
if (!x(e)) return e;
|
|
168
168
|
if (e.type === "variable" && e.ref !== void 0) {
|
|
169
169
|
const n = t(e.ref);
|
|
@@ -181,73 +181,73 @@ function x(e) {
|
|
|
181
181
|
function ae(e) {
|
|
182
182
|
return !!e && typeof e == "object" && e.source === Ie;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function an(e) {
|
|
185
185
|
return U(e);
|
|
186
186
|
}
|
|
187
187
|
function U(e) {
|
|
188
188
|
if (!e || typeof e != "object") return e;
|
|
189
189
|
if (Array.isArray(e)) {
|
|
190
|
-
let
|
|
190
|
+
let a = !1;
|
|
191
191
|
const i = e.map((o) => {
|
|
192
192
|
const c = U(o);
|
|
193
|
-
return c !== o && (
|
|
193
|
+
return c !== o && (a = !0), c;
|
|
194
194
|
});
|
|
195
|
-
return
|
|
195
|
+
return a ? i : e;
|
|
196
196
|
}
|
|
197
197
|
const t = e;
|
|
198
198
|
let n;
|
|
199
|
-
const r = (
|
|
200
|
-
i !== t[
|
|
201
|
-
},
|
|
199
|
+
const r = (a, i) => {
|
|
200
|
+
i !== t[a] && (n ?? (n = { ...t }), n[a] = i);
|
|
201
|
+
}, s = et(
|
|
202
202
|
t,
|
|
203
|
-
(
|
|
203
|
+
(a) => ae(a) ? v(a) ?? a : a
|
|
204
204
|
);
|
|
205
|
-
if (
|
|
206
|
-
const
|
|
205
|
+
if (s !== t && (s.ref !== t.ref && r("ref", s.ref), s.test !== t.test && r("test", s.test)), t.inputAliases && typeof t.inputAliases == "object") {
|
|
206
|
+
const a = t.inputAliases;
|
|
207
207
|
let i = !1;
|
|
208
208
|
const o = Object.fromEntries(
|
|
209
|
-
Object.entries(
|
|
209
|
+
Object.entries(a).map(([c, u]) => ae(u) ? (i = !0, [c, v(u) ?? u]) : [c, u])
|
|
210
210
|
);
|
|
211
211
|
i && r("inputAliases", o);
|
|
212
212
|
}
|
|
213
|
-
for (const [
|
|
214
|
-
|
|
213
|
+
for (const [a, i] of Object.entries(t))
|
|
214
|
+
a === "ref" && t.type === "variable" || a === "test" && t.type === "when" || a === "inputAliases" || r(a, U(i));
|
|
215
215
|
return n ?? e;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function on(e) {
|
|
218
218
|
return b(e);
|
|
219
219
|
}
|
|
220
220
|
function b(e) {
|
|
221
221
|
const t = [];
|
|
222
222
|
for (const n of Array.isArray(e) ? e : [])
|
|
223
223
|
if (!(!n || typeof n != "object")) {
|
|
224
|
-
for (const r of
|
|
225
|
-
const
|
|
226
|
-
|
|
224
|
+
for (const r of Ze(n)) {
|
|
225
|
+
const s = v(r);
|
|
226
|
+
s && t.push(s);
|
|
227
227
|
}
|
|
228
228
|
n.type === "link" && t.push(...b(n.children), ...b(Array.isArray(n.url) ? n.url : [])), n.type === "when" && t.push(...b(n.then), ...b(n.else));
|
|
229
229
|
}
|
|
230
230
|
return t;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function tt(e) {
|
|
233
233
|
var r;
|
|
234
234
|
const t = (r = e.preferences) == null ? void 0 : r.textVisualOptions, n = t == null ? void 0 : t.richContent;
|
|
235
235
|
return n && Array.isArray(n.blocks) ? n.blocks.flatMap(
|
|
236
|
-
(
|
|
236
|
+
(s) => (s == null ? void 0 : s.type) === "list" ? (Array.isArray(s.items) ? s.items : []).flatMap((a) => b(a)) : b(s == null ? void 0 : s.children)
|
|
237
237
|
) : b(t == null ? void 0 : t.content);
|
|
238
238
|
}
|
|
239
239
|
function be(e, t) {
|
|
240
|
-
var
|
|
240
|
+
var s;
|
|
241
241
|
const n = [], r = { kind: "document", sheetId: e };
|
|
242
|
-
for (const
|
|
243
|
-
for (const i of ((
|
|
242
|
+
for (const a of ["header", "footer"])
|
|
243
|
+
for (const i of ((s = t[a]) == null ? void 0 : s.blocks) ?? [])
|
|
244
244
|
if (i.type === "text")
|
|
245
245
|
for (const o of b(i.content))
|
|
246
|
-
n.push({ ref: o, place: r, where: { kind:
|
|
247
|
-
for (const
|
|
248
|
-
if (
|
|
249
|
-
for (const i of b(
|
|
250
|
-
n.push({ ref: i, place: r, where: { kind: "section", sectionId:
|
|
246
|
+
n.push({ ref: o, place: r, where: { kind: a, blockId: i.id } });
|
|
247
|
+
for (const a of t.sections ?? [])
|
|
248
|
+
if (a.type === "text")
|
|
249
|
+
for (const i of b(a.content))
|
|
250
|
+
n.push({ ref: i, place: r, where: { kind: "section", sectionId: a.id } });
|
|
251
251
|
return n;
|
|
252
252
|
}
|
|
253
253
|
const ie = /* @__PURE__ */ new WeakMap();
|
|
@@ -260,11 +260,11 @@ function Se(e) {
|
|
|
260
260
|
r.document && n.push(...be(r.id, r.document));
|
|
261
261
|
continue;
|
|
262
262
|
}
|
|
263
|
-
const
|
|
264
|
-
for (const i of
|
|
263
|
+
const s = { kind: "sheet", sheetId: r.id }, a = [...r.cards ?? [], ...(r.frames ?? []).flatMap((i) => i.cards ?? [])];
|
|
264
|
+
for (const i of a)
|
|
265
265
|
if (i.type === "text")
|
|
266
|
-
for (const o of
|
|
267
|
-
n.push({ ref: o, place:
|
|
266
|
+
for (const o of tt(i))
|
|
267
|
+
n.push({ ref: o, place: s, where: { kind: "card", cardId: i.id } });
|
|
268
268
|
}
|
|
269
269
|
return ie.set(e, n), n;
|
|
270
270
|
}
|
|
@@ -275,19 +275,19 @@ function ge(e, t) {
|
|
|
275
275
|
const n = Se(e);
|
|
276
276
|
return t ? n.filter((r) => Ce(r.place, t)) : [...n];
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function nt(e, t) {
|
|
279
279
|
const n = [];
|
|
280
|
-
for (const { ref: r, place:
|
|
281
|
-
r.source !== "data" || r.variableId !== t || n.some((
|
|
280
|
+
for (const { ref: r, place: s } of Se(e))
|
|
281
|
+
r.source !== "data" || r.variableId !== t || n.some((a) => Ce(a, s)) || n.push(s);
|
|
282
282
|
return n;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function cn(e, t) {
|
|
285
285
|
const n = /* @__PURE__ */ new Set();
|
|
286
286
|
for (const { ref: r } of ge(e, t))
|
|
287
287
|
r.source === "data" && n.add(r.variableId);
|
|
288
288
|
return [...n];
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function un(e, t) {
|
|
291
291
|
const n = be("", e).filter(
|
|
292
292
|
({ ref: r }) => r.source === "input" && r.inputId === t
|
|
293
293
|
);
|
|
@@ -300,7 +300,7 @@ function an(e, t) {
|
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
302
|
function ke(e, t) {
|
|
303
|
-
const n =
|
|
303
|
+
const n = nt(e, t);
|
|
304
304
|
return n.length ? n.map((r) => ({
|
|
305
305
|
sheetId: r.sheetId,
|
|
306
306
|
cardId: t,
|
|
@@ -309,12 +309,12 @@ function ke(e, t) {
|
|
|
309
309
|
}
|
|
310
310
|
function C(e, t) {
|
|
311
311
|
var r;
|
|
312
|
-
if (!
|
|
312
|
+
if (!it(e, t))
|
|
313
313
|
return !1;
|
|
314
314
|
const n = e.scope;
|
|
315
315
|
switch (n.kind) {
|
|
316
316
|
case "allSheets":
|
|
317
|
-
return ((r = n.sheetKinds) != null && r.length ? t.sheetKind ? n.sheetKinds.includes(t.sheetKind) : !1 : !!t.sheetId || !!t.cardId) && !
|
|
317
|
+
return ((r = n.sheetKinds) != null && r.length ? t.sheetKind ? n.sheetKinds.includes(t.sheetKind) : !1 : !!t.sheetId || !!t.cardId) && !at(n.exceptSheetIds, t) && !ue(n.exceptCardIds, t);
|
|
318
318
|
case "sheets":
|
|
319
319
|
return !!t.sheetId && n.sheetIds.includes(t.sheetId) && !ue(n.exceptCardIds, t);
|
|
320
320
|
case "cards":
|
|
@@ -325,7 +325,7 @@ function C(e, t) {
|
|
|
325
325
|
return !1;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function dn(e, t) {
|
|
329
329
|
if (C(e, {
|
|
330
330
|
sheetId: t.sheetId,
|
|
331
331
|
sheetKind: t.sheetKind
|
|
@@ -348,33 +348,33 @@ function on(e, t) {
|
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
const oe = /* @__PURE__ */ new WeakMap();
|
|
351
|
-
function
|
|
351
|
+
function rt(e) {
|
|
352
352
|
const t = oe.get(e);
|
|
353
353
|
if (t) return t;
|
|
354
354
|
const n = /* @__PURE__ */ new Map();
|
|
355
|
-
for (const
|
|
356
|
-
const i = n.get(
|
|
357
|
-
i.add(
|
|
355
|
+
for (const a of _(e)) {
|
|
356
|
+
const i = n.get(a.sheetId) ?? /* @__PURE__ */ new Set();
|
|
357
|
+
i.add(a.cardId), n.set(a.sheetId, i);
|
|
358
358
|
}
|
|
359
359
|
const r = /* @__PURE__ */ new Map();
|
|
360
|
-
for (const { ref:
|
|
361
|
-
if (
|
|
360
|
+
for (const { ref: a, place: i } of ge(e)) {
|
|
361
|
+
if (a.source !== "data") continue;
|
|
362
362
|
const o = r.get(i.sheetId) ?? /* @__PURE__ */ new Set();
|
|
363
|
-
o.add(
|
|
363
|
+
o.add(a.variableId), r.set(i.sheetId, o);
|
|
364
364
|
}
|
|
365
|
-
const
|
|
366
|
-
for (const
|
|
367
|
-
|
|
368
|
-
sheetId:
|
|
369
|
-
sheetKind:
|
|
370
|
-
cardIds: n.get(
|
|
371
|
-
variableIds: r.get(
|
|
365
|
+
const s = /* @__PURE__ */ new Map();
|
|
366
|
+
for (const a of e.sheets ?? [])
|
|
367
|
+
s.set(a.id, {
|
|
368
|
+
sheetId: a.id,
|
|
369
|
+
sheetKind: a.kind === "document" ? "document" : "dashboard",
|
|
370
|
+
cardIds: n.get(a.id) ?? /* @__PURE__ */ new Set(),
|
|
371
|
+
variableIds: r.get(a.id) ?? /* @__PURE__ */ new Set()
|
|
372
372
|
});
|
|
373
|
-
return oe.set(e,
|
|
373
|
+
return oe.set(e, s), s;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
var
|
|
377
|
-
const n = /* @__PURE__ */ new Set(), r =
|
|
375
|
+
function ln(e, t) {
|
|
376
|
+
var s, a;
|
|
377
|
+
const n = /* @__PURE__ */ new Set(), r = rt(e);
|
|
378
378
|
for (const i of r.values())
|
|
379
379
|
C(t, {
|
|
380
380
|
sheetId: i.sheetId,
|
|
@@ -385,7 +385,7 @@ function cn(e, t) {
|
|
|
385
385
|
sheetId: i.sheetId,
|
|
386
386
|
cardId: i.cardId,
|
|
387
387
|
...i.kind === "documentSectionCard" ? { sectionId: i.sectionId } : {},
|
|
388
|
-
sheetKind: ((
|
|
388
|
+
sheetKind: ((s = r.get(i.sheetId)) == null ? void 0 : s.sheetKind) ?? "dashboard"
|
|
389
389
|
}) && n.add(`card:${i.cardId}`);
|
|
390
390
|
for (const i of e.variables ?? [])
|
|
391
391
|
ke(e, i.id).some(
|
|
@@ -393,7 +393,7 @@ function cn(e, t) {
|
|
|
393
393
|
) && n.add(`card:${i.id}`);
|
|
394
394
|
for (const i of e.sheets ?? [])
|
|
395
395
|
if (i.kind === "document")
|
|
396
|
-
for (const o of ((
|
|
396
|
+
for (const o of ((a = i.document) == null ? void 0 : a.sections) ?? [])
|
|
397
397
|
C(t, {
|
|
398
398
|
sheetId: i.id,
|
|
399
399
|
sectionId: o.id,
|
|
@@ -401,11 +401,11 @@ function cn(e, t) {
|
|
|
401
401
|
}) && n.add(`section:${o.id}`);
|
|
402
402
|
return n;
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function fn(e) {
|
|
405
405
|
return e.kind === "filter" && e.scope.kind === "cards";
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
var
|
|
407
|
+
function mn(e, t) {
|
|
408
|
+
var a, i, o;
|
|
409
409
|
const n = (c) => {
|
|
410
410
|
var u, d;
|
|
411
411
|
return ce(c, t.removedSheetIds, t.renamedSheetIds, !1, (u = t.copiedTab) == null ? void 0 : u.sheetIds, (d = t.copiedTab) == null ? void 0 : d.mode);
|
|
@@ -420,28 +420,28 @@ function dn(e, t) {
|
|
|
420
420
|
(d = t.copiedTab) == null ? void 0 : d.mode
|
|
421
421
|
);
|
|
422
422
|
};
|
|
423
|
-
let
|
|
423
|
+
let s;
|
|
424
424
|
switch (e.kind) {
|
|
425
425
|
case "allSheets":
|
|
426
|
-
|
|
426
|
+
s = {
|
|
427
427
|
...e,
|
|
428
428
|
...e.exceptSheetIds ? { exceptSheetIds: n(e.exceptSheetIds) } : {},
|
|
429
429
|
...e.exceptCardIds ? { exceptCardIds: r(e.exceptCardIds) } : {}
|
|
430
430
|
};
|
|
431
431
|
break;
|
|
432
432
|
case "sheets":
|
|
433
|
-
|
|
433
|
+
s = {
|
|
434
434
|
...e,
|
|
435
435
|
sheetIds: n(e.sheetIds),
|
|
436
436
|
...e.exceptCardIds ? { exceptCardIds: r(e.exceptCardIds) } : {}
|
|
437
437
|
};
|
|
438
438
|
break;
|
|
439
439
|
case "cards":
|
|
440
|
-
|
|
440
|
+
s = { ...e, cardIds: r(e.cardIds) };
|
|
441
441
|
break;
|
|
442
442
|
case "documentSections": {
|
|
443
|
-
if ((
|
|
444
|
-
|
|
443
|
+
if ((a = t.removedSheetIds) != null && a.has(e.sheetId)) {
|
|
444
|
+
s = { ...e, sectionIds: [] };
|
|
445
445
|
break;
|
|
446
446
|
}
|
|
447
447
|
const c = {
|
|
@@ -449,7 +449,7 @@ function dn(e, t) {
|
|
|
449
449
|
sheetId: ((i = t.renamedSheetIds) == null ? void 0 : i.get(e.sheetId)) ?? e.sheetId,
|
|
450
450
|
sectionIds: (o = t.renamedSectionIds) != null && o.size ? e.sectionIds.map((d) => t.renamedSectionIds.get(d) ?? d) : e.sectionIds
|
|
451
451
|
}, u = t.copiedTab;
|
|
452
|
-
|
|
452
|
+
s = (u == null ? void 0 : u.mode) === "replace" && u.sheetIds.has(c.sheetId) ? {
|
|
453
453
|
...c,
|
|
454
454
|
sheetId: u.sheetIds.get(c.sheetId),
|
|
455
455
|
sectionIds: c.sectionIds.map((d) => u.sectionIds.get(d) ?? d)
|
|
@@ -459,25 +459,25 @@ function dn(e, t) {
|
|
|
459
459
|
default:
|
|
460
460
|
return e;
|
|
461
461
|
}
|
|
462
|
-
return
|
|
462
|
+
return st(e, s) ? e : s;
|
|
463
463
|
}
|
|
464
|
-
function ce(e, t, n, r,
|
|
464
|
+
function ce(e, t, n, r, s, a) {
|
|
465
465
|
let i = e;
|
|
466
|
-
return t != null && t.size && (i = i.filter((o) => !t.has(o))), r && (i = i.filter((o) => n == null ? void 0 : n.has(o))), n != null && n.size && (i = i.map((o) => n.get(o) ?? o)),
|
|
466
|
+
return t != null && t.size && (i = i.filter((o) => !t.has(o))), r && (i = i.filter((o) => n == null ? void 0 : n.has(o))), n != null && n.size && (i = i.map((o) => n.get(o) ?? o)), s != null && s.size && (i = a === "extend" ? [.../* @__PURE__ */ new Set([...i, ...i.flatMap((o) => s.has(o) ? [s.get(o)] : [])])] : i.map((o) => s.get(o) ?? o)), i;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function st(e, t) {
|
|
469
469
|
return JSON.stringify(e) === JSON.stringify(t);
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function at(e, t) {
|
|
472
472
|
return !!t.sheetId && !!(e != null && e.includes(t.sheetId));
|
|
473
473
|
}
|
|
474
474
|
function ue(e, t) {
|
|
475
475
|
return !!t.cardId && !!(e != null && e.includes(t.cardId));
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function it(e, t) {
|
|
478
478
|
return t.sheetKind !== "document" || !e.compatibility || e.compatibility.source === "documentInput" ? !0 : e.compatibility.source === "cardInlineFilter" || e.compatibility.source === "cardControl" ? !!t.cardId && e.compatibility.cardId === t.cardId : !1;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function pn(e, t, n) {
|
|
481
481
|
switch (e.kind) {
|
|
482
482
|
case "sheets":
|
|
483
483
|
return e.sheetIds.length > 0 && e.sheetIds.every((r) => r === t);
|
|
@@ -489,32 +489,32 @@ function ln(e, t, n) {
|
|
|
489
489
|
return !1;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function hn(e) {
|
|
493
493
|
return e.kind === "sheets" && e.sheetIds.length === 0 || e.kind === "cards" && e.cardIds.length === 0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function ot(e) {
|
|
496
496
|
return e.kind === "allSheets" || e.kind === "sheets" ? e.exceptCardIds ?? [] : [];
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function yn(e) {
|
|
499
499
|
return e.kind === "allSheets" ? e.exceptSheetIds ?? [] : [];
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
var
|
|
503
|
-
if (e.kind !== "allSheets" && e.kind !== "sheets" || !((
|
|
504
|
-
const n = e.exceptCardIds.filter((i) => i !== t), { exceptCardIds: r, ...
|
|
505
|
-
return n.length ? { ...
|
|
501
|
+
function In(e, t) {
|
|
502
|
+
var a;
|
|
503
|
+
if (e.kind !== "allSheets" && e.kind !== "sheets" || !((a = e.exceptCardIds) != null && a.includes(t))) return e;
|
|
504
|
+
const n = e.exceptCardIds.filter((i) => i !== t), { exceptCardIds: r, ...s } = e;
|
|
505
|
+
return n.length ? { ...s, exceptCardIds: n } : s;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function bn(e, t, n) {
|
|
508
508
|
var o;
|
|
509
509
|
if (t.kind !== "allSheets" && t.kind !== "sheets") return t;
|
|
510
|
-
const r =
|
|
510
|
+
const r = ot(e), s = e.kind === "sheets" ? e.sheetIds.filter((c) => n.has(c)) : e.kind === "allSheets" && de(e) ? [...n].filter((c) => {
|
|
511
511
|
var u;
|
|
512
512
|
return !((u = e.exceptSheetIds) != null && u.includes(c));
|
|
513
|
-
}) : [],
|
|
513
|
+
}) : [], a = [...n].filter((c) => !s.includes(c));
|
|
514
514
|
if (t.kind === "sheets")
|
|
515
515
|
return {
|
|
516
516
|
...t,
|
|
517
|
-
sheetIds: [.../* @__PURE__ */ new Set([...t.sheetIds, ...
|
|
517
|
+
sheetIds: [.../* @__PURE__ */ new Set([...t.sheetIds, ...s])],
|
|
518
518
|
...r.length ? { exceptCardIds: [...r] } : {}
|
|
519
519
|
};
|
|
520
520
|
const i = e.kind === "allSheets" ? ((o = e.exceptSheetIds) == null ? void 0 : o.filter((c) => n.has(c))) ?? [] : [];
|
|
@@ -523,9 +523,9 @@ function hn(e, t, n) {
|
|
|
523
523
|
...e.kind === "allSheets" && de(e) ? {
|
|
524
524
|
...e.sheetKinds ? { sheetKinds: e.sheetKinds } : {},
|
|
525
525
|
...i.length ? { exceptSheetIds: i } : {}
|
|
526
|
-
} :
|
|
526
|
+
} : s.length ? {
|
|
527
527
|
sheetKinds: ["dashboard", "document"],
|
|
528
|
-
...
|
|
528
|
+
...a.length ? { exceptSheetIds: a } : {}
|
|
529
529
|
} : {},
|
|
530
530
|
...r.length ? { exceptCardIds: [...r] } : {}
|
|
531
531
|
};
|
|
@@ -534,7 +534,7 @@ function de(e) {
|
|
|
534
534
|
var t;
|
|
535
535
|
return e.kind === "allSheets" && (!((t = e.sheetKinds) != null && t.length) || e.sheetKinds.includes("document"));
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function Sn(e, t) {
|
|
538
538
|
switch (e.kind) {
|
|
539
539
|
case "allSheets":
|
|
540
540
|
case "sheets": {
|
|
@@ -547,51 +547,51 @@ function yn(e, t) {
|
|
|
547
547
|
return;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
function
|
|
550
|
+
const ct = 6;
|
|
551
|
+
function Cn(e) {
|
|
552
552
|
if (!(e === void 0 || !Number.isFinite(e)) && Number.isInteger(e))
|
|
553
|
-
return Math.max(0, Math.min(
|
|
553
|
+
return Math.max(0, Math.min(ct, e));
|
|
554
554
|
}
|
|
555
555
|
function we(e) {
|
|
556
556
|
var t;
|
|
557
557
|
return ((t = e == null ? void 0 : e.comparison) == null ? void 0 : t.mode) === "explicit" ? e.comparison.spec : void 0;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function ut(e) {
|
|
560
560
|
var t;
|
|
561
561
|
return ((t = we(e)) == null ? void 0 : t.kind) || "none";
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function gn(e) {
|
|
564
564
|
const t = we(e);
|
|
565
565
|
return (t == null ? void 0 : t.kind) === "target" ? t.targetValue : void 0;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
return (e == null ? void 0 : e.semanticComparisonPolarity) || (e == null ? void 0 : e.comparisonPolarity) ||
|
|
567
|
+
function kn(e) {
|
|
568
|
+
return (e == null ? void 0 : e.semanticComparisonPolarity) || (e == null ? void 0 : e.comparisonPolarity) || Ue;
|
|
569
569
|
}
|
|
570
570
|
function Y(e, t) {
|
|
571
571
|
const n = Object.entries(e || {}).filter(
|
|
572
|
-
([
|
|
572
|
+
([a, i]) => i.output.outputId === a
|
|
573
573
|
);
|
|
574
574
|
if (!t.name) return;
|
|
575
575
|
const r = j({
|
|
576
576
|
...t,
|
|
577
577
|
name: t.name
|
|
578
|
-
}),
|
|
579
|
-
([,
|
|
578
|
+
}), s = n.filter(
|
|
579
|
+
([, a]) => a.output.metricAlias === r
|
|
580
580
|
);
|
|
581
|
-
return
|
|
581
|
+
return s.length === 1 ? s[0][1] : void 0;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function wn(e, t) {
|
|
584
584
|
const n = Y(e, t);
|
|
585
585
|
return {
|
|
586
|
-
comparisonKind: (n == null ? void 0 : n.type) ??
|
|
586
|
+
comparisonKind: (n == null ? void 0 : n.type) ?? ut(t),
|
|
587
587
|
metadata: n
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
function
|
|
591
|
-
return (e == null ? void 0 : e.showComparison) ??
|
|
590
|
+
function An(e) {
|
|
591
|
+
return (e == null ? void 0 : e.showComparison) ?? ze.showComparison;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
594
|
-
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(),
|
|
593
|
+
function vn(e) {
|
|
594
|
+
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
595
595
|
return Object.entries(e || {}).forEach(([c, u]) => {
|
|
596
596
|
const d = u.output;
|
|
597
597
|
d.outputId === c && (t.add(d.currentColumnKey), n.add(d.currentColumnKey), d.availability.status === "available" && (d.comparisonColumnKey && (r.add(d.comparisonColumnKey), o.set(
|
|
@@ -600,96 +600,120 @@ function kn(e) {
|
|
|
600
600
|
metricName: u.displayName || d.metricId,
|
|
601
601
|
comparisonLabel: u.displayLabel || "Comparison"
|
|
602
602
|
}
|
|
603
|
-
)), d.deltaColumnKey && (t.add(d.deltaColumnKey),
|
|
603
|
+
)), d.deltaColumnKey && (t.add(d.deltaColumnKey), s.add(d.deltaColumnKey)), d.percentChangeColumnKey && (t.add(d.percentChangeColumnKey), a.add(d.percentChangeColumnKey)), d.ratioColumnKey && (t.add(d.ratioColumnKey), i.add(d.ratioColumnKey)), d.rowStatusColumnKey && (t.add(d.rowStatusColumnKey), n.add(d.rowStatusColumnKey)), d.currentBucketColumnKey && (t.add(d.currentBucketColumnKey), n.add(d.currentBucketColumnKey)), d.comparisonSourceBucketColumnKey && (t.add(d.comparisonSourceBucketColumnKey), n.add(d.comparisonSourceBucketColumnKey))));
|
|
604
604
|
}), {
|
|
605
605
|
internalKeys: t,
|
|
606
606
|
bookkeepingKeys: n,
|
|
607
607
|
comparisonColumnKeys: r,
|
|
608
|
-
deltaColumnKeys:
|
|
609
|
-
percentChangeColumnKeys:
|
|
608
|
+
deltaColumnKeys: s,
|
|
609
|
+
percentChangeColumnKeys: a,
|
|
610
610
|
ratioColumnKeys: i,
|
|
611
611
|
comparisonSeriesLabels: o
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
|
-
const
|
|
614
|
+
const dt = "SEMAPHOR_CALCULATED_FIELD";
|
|
615
615
|
function J(e, t, n) {
|
|
616
616
|
if (n && (t === "groupby" || t === "pivotby"))
|
|
617
617
|
return n;
|
|
618
618
|
if (t === "metric" && e.name === "*" && !e.expression)
|
|
619
619
|
return e.alias || "count";
|
|
620
620
|
if (e.alias) return e.alias;
|
|
621
|
-
const r = e.entityName && e.entityName !==
|
|
621
|
+
const r = e.entityName && e.entityName !== dt ? e.entityName : void 0;
|
|
622
622
|
if (e.role === "metric") {
|
|
623
|
-
let
|
|
623
|
+
let s = e.aggregate || "metric";
|
|
624
624
|
if (e.expression) {
|
|
625
|
-
const
|
|
625
|
+
const a = e.expression.match(
|
|
626
626
|
/^(COUNT|SUM|AVG|MIN|MAX|MEDIAN|DISTINCT)\s*\(/i
|
|
627
627
|
);
|
|
628
|
-
|
|
628
|
+
s = a ? a[1].toLowerCase() : "expr";
|
|
629
629
|
} else
|
|
630
|
-
|
|
631
|
-
return r && r !== e.name ? `${r}_${e.name}_${
|
|
630
|
+
s = s.toLowerCase();
|
|
631
|
+
return r && r !== e.name ? `${r}_${e.name}_${s}` : `${e.name}_${s}`;
|
|
632
632
|
}
|
|
633
633
|
return r && r !== e.name ? `${r}_${e.name}` : e.name;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function Ae(e) {
|
|
636
636
|
return J(e, "detail");
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function lt(e) {
|
|
639
639
|
const t = e.label;
|
|
640
640
|
return t && e.labelCount === 1 && (t === e.rawKey || !e.rawKeys.has(t)) ? t : e.rawKey;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function Tn(e) {
|
|
643
643
|
const t = [
|
|
644
|
-
...(e.groupByColumns ?? []).map((
|
|
645
|
-
...(e.metricColumns ?? []).map((
|
|
646
|
-
...(e.pivotByColumns ?? []).map((
|
|
647
|
-
...(e.detailColumns ?? []).map((
|
|
648
|
-
], n = new Map(
|
|
649
|
-
|
|
650
|
-
|
|
644
|
+
...(e.groupByColumns ?? []).map((o) => ({ field: o, role: "groupby" })),
|
|
645
|
+
...(e.metricColumns ?? []).map((o) => ({ field: o, role: "metric" })),
|
|
646
|
+
...(e.pivotByColumns ?? []).map((o) => ({ field: o, role: "pivotby" })),
|
|
647
|
+
...(e.detailColumns ?? []).map((o) => ({ field: o, role: "detail" }))
|
|
648
|
+
], n = ve(e.detailColumns ?? []), r = new Map((e.detailColumns ?? []).map((o, c) => [o, c])), s = new Map(
|
|
649
|
+
t.map(({ field: o, role: c }) => [
|
|
650
|
+
o,
|
|
651
|
+
c === "detail" ? n[r.get(o)] : J(o, c)
|
|
652
|
+
])
|
|
653
|
+
), a = new Set(s.values()), i = /* @__PURE__ */ new Map();
|
|
654
|
+
for (const { field: o } of t)
|
|
655
|
+
o.label && i.set(o.label, (i.get(o.label) ?? 0) + 1);
|
|
651
656
|
return new Map(
|
|
652
|
-
t.map(({ field:
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
label:
|
|
656
|
-
labelCount:
|
|
657
|
-
rawKey:
|
|
658
|
-
rawKeys:
|
|
657
|
+
t.map(({ field: o }) => [
|
|
658
|
+
o,
|
|
659
|
+
lt({
|
|
660
|
+
label: o.label,
|
|
661
|
+
labelCount: o.label ? i.get(o.label) ?? 0 : 0,
|
|
662
|
+
rawKey: s.get(o),
|
|
663
|
+
rawKeys: a
|
|
659
664
|
})
|
|
660
665
|
])
|
|
661
666
|
);
|
|
662
667
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
return
|
|
668
|
+
function ve(e) {
|
|
669
|
+
const t = e.map((s) => Ae(s)), n = new Set(t), r = /* @__PURE__ */ new Map();
|
|
670
|
+
return t.forEach((s, a) => {
|
|
671
|
+
r.has(s) || r.set(s, a);
|
|
672
|
+
}), t.map((s, a) => {
|
|
673
|
+
if (r.get(s) === a) return s;
|
|
674
|
+
let i = 2;
|
|
675
|
+
for (; n.has(`${s}_${i}`); ) i += 1;
|
|
676
|
+
return n.add(`${s}_${i}`), `${s}_${i}`;
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
function En(e) {
|
|
680
|
+
const t = e.detailColumns;
|
|
681
|
+
if (!t || t.length < 2) return e;
|
|
682
|
+
const n = ve(t);
|
|
683
|
+
let r = !1;
|
|
684
|
+
const s = t.map((a, i) => Ae(a) === n[i] ? a : (r = !0, { ...a, alias: n[i] }));
|
|
685
|
+
return r ? { ...e, detailColumns: s } : e;
|
|
666
686
|
}
|
|
667
|
-
const
|
|
668
|
-
function
|
|
669
|
-
|
|
687
|
+
const Te = "text", M = 100, ft = 10, S = "value", Ee = ["previous", "change", "percentChange"];
|
|
688
|
+
function mt(e) {
|
|
689
|
+
return Ee.includes(e);
|
|
690
|
+
}
|
|
691
|
+
const pt = ["up", "down", "flat"];
|
|
692
|
+
function Kn(e, t, n) {
|
|
693
|
+
const { signWords: r, absolute: s, percent: a, ...i } = t ?? {};
|
|
670
694
|
return e !== "change" && e !== "percentChange" ? i : {
|
|
671
695
|
...i,
|
|
672
|
-
...(n == null ? void 0 : n.signWords) === void 0 ? { signWords:
|
|
696
|
+
...(n == null ? void 0 : n.signWords) === void 0 ? { signWords: pt } : {},
|
|
673
697
|
...(n == null ? void 0 : n.absolute) === void 0 ? { absolute: !0 } : {},
|
|
674
698
|
...e === "percentChange" && (n == null ? void 0 : n.percent) === void 0 ? { percent: !0 } : {}
|
|
675
699
|
};
|
|
676
700
|
}
|
|
677
701
|
function H(e) {
|
|
678
|
-
var r,
|
|
702
|
+
var r, s, a, i;
|
|
679
703
|
if (e.get.kind !== "aggregate" || (r = e.query.sql) != null && r.trim()) return;
|
|
680
|
-
const t = (i = (
|
|
704
|
+
const t = (i = (a = (s = e.query.config) == null ? void 0 : s.metricColumns) == null ? void 0 : a[0]) == null ? void 0 : i.comparison;
|
|
681
705
|
if ((t == null ? void 0 : t.mode) !== "explicit") return;
|
|
682
706
|
const n = t.spec;
|
|
683
707
|
return n.kind === "previous_period" || n.kind === "previous_year" ? n : void 0;
|
|
684
708
|
}
|
|
685
709
|
function le(e, t) {
|
|
686
710
|
if (t === "preview" && e.get.kind !== "aggregate")
|
|
687
|
-
return
|
|
711
|
+
return M + 1;
|
|
688
712
|
switch (e.get.kind) {
|
|
689
713
|
case "only":
|
|
690
714
|
return 2;
|
|
691
715
|
case "list":
|
|
692
|
-
return
|
|
716
|
+
return M + 1;
|
|
693
717
|
default:
|
|
694
718
|
return 1;
|
|
695
719
|
}
|
|
@@ -698,14 +722,14 @@ const fe = {
|
|
|
698
722
|
answer: /* @__PURE__ */ new WeakMap(),
|
|
699
723
|
preview: /* @__PURE__ */ new WeakMap()
|
|
700
724
|
};
|
|
701
|
-
function
|
|
702
|
-
var
|
|
725
|
+
function ht(e, t = "answer") {
|
|
726
|
+
var a;
|
|
703
727
|
const n = fe[t].get(e);
|
|
704
728
|
if (n) return n;
|
|
705
|
-
const { query: r } = e,
|
|
729
|
+
const { query: r } = e, s = {
|
|
706
730
|
id: e.id,
|
|
707
731
|
title: e.name,
|
|
708
|
-
type:
|
|
732
|
+
type: Te,
|
|
709
733
|
respondsToSelections: !1,
|
|
710
734
|
dataVariableId: e.id,
|
|
711
735
|
// The viewer's dashboard comparison never changes a variable: its own
|
|
@@ -714,18 +738,18 @@ function ft(e, t = "answer") {
|
|
|
714
738
|
...r.connectionId ? { connectionId: r.connectionId } : {},
|
|
715
739
|
...r.dataSource ? { dataSource: r.dataSource } : {},
|
|
716
740
|
...r.calculatedFields ? { calculatedFields: r.calculatedFields } : {},
|
|
717
|
-
...(
|
|
741
|
+
...(a = r.sql) != null && a.trim() ? { sql: r.sql, config: { rowLimit: le(e, t) } } : { config: { ...r.config, rowLimit: le(e, t) } }
|
|
718
742
|
};
|
|
719
|
-
return fe[t].set(e,
|
|
743
|
+
return fe[t].set(e, s), s;
|
|
720
744
|
}
|
|
721
|
-
function
|
|
722
|
-
return e.type ===
|
|
745
|
+
function Dn(e) {
|
|
746
|
+
return e.type === Te && typeof e.dataVariableId == "string" && e.dataVariableId.length > 0;
|
|
723
747
|
}
|
|
724
|
-
function
|
|
748
|
+
function Nn(e, t, n) {
|
|
725
749
|
var r;
|
|
726
750
|
if (n === S && ((r = e.query.sql) != null && r.trim())) {
|
|
727
|
-
const
|
|
728
|
-
return
|
|
751
|
+
const s = Object.keys(t)[0];
|
|
752
|
+
return s === void 0 ? void 0 : t[s];
|
|
729
753
|
}
|
|
730
754
|
return n in t ? t[n] : void 0;
|
|
731
755
|
}
|
|
@@ -733,69 +757,69 @@ function z(e) {
|
|
|
733
757
|
const t = G(e);
|
|
734
758
|
return t === "string" || t === "unknown" ? "text" : t;
|
|
735
759
|
}
|
|
736
|
-
function
|
|
760
|
+
function yt(e) {
|
|
737
761
|
return typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : "text";
|
|
738
762
|
}
|
|
739
|
-
function
|
|
763
|
+
function It(e, t, n, r) {
|
|
740
764
|
var i, o;
|
|
741
|
-
const
|
|
765
|
+
const s = Ge(r, e.id, t);
|
|
742
766
|
return [
|
|
743
|
-
|
|
744
|
-
|
|
767
|
+
s == null ? void 0 : s.outputKey,
|
|
768
|
+
s == null ? void 0 : s.rawKey,
|
|
745
769
|
t === "metric" ? ((o = (i = r == null ? void 0 : r.byMetricAlias) == null ? void 0 : i[j(e)]) == null ? void 0 : o.outputKey) ?? j(e) : void 0,
|
|
746
770
|
J(e, t === "metric" ? "metric" : "groupby"),
|
|
747
771
|
e.label,
|
|
748
772
|
e.name
|
|
749
773
|
].find((c) => !!c && n.has(c));
|
|
750
774
|
}
|
|
751
|
-
function
|
|
775
|
+
function On(e, t) {
|
|
752
776
|
var r;
|
|
753
777
|
if (e.get.kind === "aggregate")
|
|
754
|
-
return H(e) ? [S, ...
|
|
778
|
+
return H(e) ? [S, ...Ee] : [S];
|
|
755
779
|
if (e.get.kind === "list") return [S];
|
|
756
780
|
if ((r = e.query.sql) != null && r.trim()) return [...t ?? []];
|
|
757
781
|
const n = e.query.config;
|
|
758
|
-
return
|
|
759
|
-
...((n == null ? void 0 : n.groupByColumns) ?? []).map((
|
|
760
|
-
...((n == null ? void 0 : n.metricColumns) ?? []).map((
|
|
782
|
+
return bt([
|
|
783
|
+
...((n == null ? void 0 : n.groupByColumns) ?? []).map((s) => s.name),
|
|
784
|
+
...((n == null ? void 0 : n.metricColumns) ?? []).map((s) => s.name)
|
|
761
785
|
]);
|
|
762
786
|
}
|
|
763
|
-
function
|
|
764
|
-
var
|
|
787
|
+
function xn(e, t) {
|
|
788
|
+
var a, i, o, c;
|
|
765
789
|
if (e.get.kind === "list") return "list";
|
|
766
|
-
if ((
|
|
790
|
+
if ((a = e.query.sql) != null && a.trim()) return;
|
|
767
791
|
const n = e.query.config, r = (u, d) => {
|
|
768
792
|
if (!u) return;
|
|
769
793
|
const f = d === "metric" ? B(u) : u.dataType;
|
|
770
794
|
return G(f) === "unknown" ? void 0 : z(f);
|
|
771
795
|
};
|
|
772
796
|
if (e.get.kind === "aggregate")
|
|
773
|
-
return
|
|
774
|
-
const
|
|
775
|
-
return
|
|
797
|
+
return mt(t) && H(e) ? "number" : t === S ? r((i = n == null ? void 0 : n.metricColumns) == null ? void 0 : i[0], "metric") : void 0;
|
|
798
|
+
const s = (o = n == null ? void 0 : n.groupByColumns) == null ? void 0 : o.find((u) => u.name === t);
|
|
799
|
+
return s ? r(s, "groupby") : r((c = n == null ? void 0 : n.metricColumns) == null ? void 0 : c.find((u) => u.name === t), "metric");
|
|
776
800
|
}
|
|
777
|
-
function
|
|
801
|
+
function bt(e) {
|
|
778
802
|
return [...new Set(e)];
|
|
779
803
|
}
|
|
780
|
-
function
|
|
804
|
+
function St(e, t, n) {
|
|
781
805
|
var p, I, g;
|
|
782
|
-
const r = t[0] ?? {},
|
|
806
|
+
const r = t[0] ?? {}, s = new Set(
|
|
783
807
|
(p = n.columns) != null && p.length ? n.columns.map((m) => m.key) : Object.keys(r)
|
|
784
|
-
),
|
|
808
|
+
), a = new Map(
|
|
785
809
|
(n.columns ?? []).map((m) => [m.key, m.dataType])
|
|
786
|
-
), i = (m, k) =>
|
|
810
|
+
), i = (m, k) => a.has(m) ? z(a.get(m)) : k !== void 0 ? z(k) : yt(r[m]);
|
|
787
811
|
if ((I = e.query.sql) != null && I.trim())
|
|
788
|
-
return [...
|
|
789
|
-
const o = e.query.config ?? {}, c = [], u =
|
|
790
|
-
if (c.some((
|
|
791
|
-
const K =
|
|
812
|
+
return [...s].map((m) => ({ part: m, key: m, type: i(m, void 0) }));
|
|
813
|
+
const o = e.query.config ?? {}, c = [], u = s.size === 1 ? [...s][0] : void 0, d = e.get.kind === "aggregate" || e.get.kind === "list", f = (m, k, te) => {
|
|
814
|
+
if (c.some(($e) => $e.part === te)) return;
|
|
815
|
+
const K = It(m, k, s, n.columnKeyMap) ?? (d ? u : void 0);
|
|
792
816
|
if (!K) return;
|
|
793
|
-
const
|
|
794
|
-
c.push({ part: te, key: K, type:
|
|
817
|
+
const Ve = k === "metric" ? i(K, B(m)) : i(K, m.dataType);
|
|
818
|
+
c.push({ part: te, key: K, type: Ve });
|
|
795
819
|
}, y = o.metricColumns ?? [];
|
|
796
820
|
if (e.get.kind === "aggregate") {
|
|
797
821
|
const m = y[0] ? (g = Y(n.comparisonMetadata, y[0])) == null ? void 0 : g.output.currentColumnKey : void 0;
|
|
798
|
-
return m &&
|
|
822
|
+
return m && s.has(m) ? c.push({ part: S, key: m, type: i(m, B(y[0])) }) : y[0] && f(y[0], "metric", S), c;
|
|
799
823
|
}
|
|
800
824
|
const h = o.groupByColumns ?? [];
|
|
801
825
|
if (e.get.kind === "list")
|
|
@@ -810,9 +834,9 @@ function W(e, t) {
|
|
|
810
834
|
function w(e) {
|
|
811
835
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
812
836
|
}
|
|
813
|
-
function
|
|
837
|
+
function Mn(e) {
|
|
814
838
|
if (!w(e)) return {};
|
|
815
|
-
const t = w(e.data) ? e.data : e, n =
|
|
839
|
+
const t = w(e.data) ? e.data : e, n = N(e).length ? N(e) : N(t), r = w(t.metadata) ? t.metadata : void 0;
|
|
816
840
|
return {
|
|
817
841
|
...t.records !== void 0 ? { records: t.records } : {},
|
|
818
842
|
...Array.isArray(t.columns) ? { columns: t.columns } : {},
|
|
@@ -822,55 +846,55 @@ function On(e) {
|
|
|
822
846
|
...typeof t.error == "string" && t.error ? { error: t.error } : {}
|
|
823
847
|
};
|
|
824
848
|
}
|
|
825
|
-
function
|
|
849
|
+
function Rn(e, t, n = "answer") {
|
|
826
850
|
var d;
|
|
827
851
|
const r = (Array.isArray(t.records) ? t.records : []).filter(
|
|
828
852
|
(f) => !!f && typeof f == "object"
|
|
829
|
-
),
|
|
830
|
-
if (!r.length) return { status: "none", why: "noRows", filterReach:
|
|
831
|
-
const i =
|
|
853
|
+
), s = N(t), a = n === "preview" ? { matched: r.length > M ? "beyondCap" : r.length } : {};
|
|
854
|
+
if (!r.length) return { status: "none", why: "noRows", filterReach: s, ...a };
|
|
855
|
+
const i = St(e, r, t);
|
|
832
856
|
if (e.get.kind === "list") {
|
|
833
|
-
const f = i[0], y = r.length >
|
|
834
|
-
if (!h.length && !y) return { status: "none", why: "noRows", filterReach:
|
|
835
|
-
const p = Math.max(1, e.get.limit ??
|
|
857
|
+
const f = i[0], y = r.length > M, h = f ? r.map((I) => W(I[f.key], f.type)).filter((I) => I.value !== null) : [];
|
|
858
|
+
if (!h.length && !y) return { status: "none", why: "noRows", filterReach: s, ...a };
|
|
859
|
+
const p = Math.max(1, e.get.limit ?? ft);
|
|
836
860
|
return {
|
|
837
861
|
status: "listed",
|
|
838
862
|
items: h.slice(0, p),
|
|
839
863
|
more: y ? "beyondCap" : Math.max(0, h.length - p),
|
|
840
|
-
filterReach:
|
|
841
|
-
...
|
|
864
|
+
filterReach: s,
|
|
865
|
+
...a
|
|
842
866
|
};
|
|
843
867
|
}
|
|
844
868
|
if (e.get.kind === "only" && r.length > 1)
|
|
845
|
-
return { status: "none", why: "moreThanOne", filterReach:
|
|
869
|
+
return { status: "none", why: "moreThanOne", filterReach: s, ...a };
|
|
846
870
|
const o = r[0], c = Object.fromEntries(
|
|
847
871
|
i.map((f) => [f.part, W(o[f.key], f.type)])
|
|
848
872
|
);
|
|
849
873
|
if (e.get.kind === "aggregate" && ((d = c[S]) == null ? void 0 : d.value) == null)
|
|
850
|
-
return { status: "none", why: "noRows", filterReach:
|
|
851
|
-
const u = H(e) ?
|
|
874
|
+
return { status: "none", why: "noRows", filterReach: s, ...a };
|
|
875
|
+
const u = H(e) ? Ct(e, o, t) : void 0;
|
|
852
876
|
return {
|
|
853
877
|
status: "answered",
|
|
854
878
|
parts: u && "parts" in u ? { ...c, ...u.parts } : c,
|
|
855
|
-
filterReach:
|
|
879
|
+
filterReach: s,
|
|
856
880
|
...u && "unavailable" in u ? { comparisonUnavailable: u.unavailable } : {},
|
|
857
|
-
...
|
|
881
|
+
...a
|
|
858
882
|
};
|
|
859
883
|
}
|
|
860
|
-
function
|
|
884
|
+
function Ct(e, t, n) {
|
|
861
885
|
var o, c;
|
|
862
|
-
const r = (c = (o = e.query.config) == null ? void 0 : o.metricColumns) == null ? void 0 : c[0],
|
|
863
|
-
if (!
|
|
864
|
-
return { unavailable: (
|
|
886
|
+
const r = (c = (o = e.query.config) == null ? void 0 : o.metricColumns) == null ? void 0 : c[0], s = r ? Y(n.comparisonMetadata, r) : void 0, a = s == null ? void 0 : s.output;
|
|
887
|
+
if (!a || a.availability.status !== "available" || !a.comparisonColumnKey)
|
|
888
|
+
return { unavailable: (a == null ? void 0 : a.availability.status) === "unavailable" ? a.availability.reason : "temporal_binding_missing" };
|
|
865
889
|
const i = (u) => {
|
|
866
890
|
const d = t[u], f = typeof d == "string" && d.trim() !== "" ? Number(d) : d;
|
|
867
891
|
return W(typeof f == "number" && !Number.isFinite(f) ? null : f, "number");
|
|
868
892
|
};
|
|
869
893
|
return {
|
|
870
894
|
parts: {
|
|
871
|
-
previous: i(
|
|
872
|
-
change: i(
|
|
873
|
-
percentChange: i(
|
|
895
|
+
previous: i(a.comparisonColumnKey),
|
|
896
|
+
change: i(a.deltaColumnKey ?? ""),
|
|
897
|
+
percentChange: i(a.percentChangeColumnKey ?? "")
|
|
874
898
|
}
|
|
875
899
|
};
|
|
876
900
|
}
|
|
@@ -880,40 +904,40 @@ function X(e) {
|
|
|
880
904
|
if (t) return t;
|
|
881
905
|
const n = new Map(
|
|
882
906
|
(e.sheets ?? []).map(
|
|
883
|
-
(
|
|
907
|
+
(a) => [a.id, a.kind === "document" ? "document" : "dashboard"]
|
|
884
908
|
)
|
|
885
909
|
), r = [
|
|
886
910
|
..._(e).map(
|
|
887
|
-
(
|
|
911
|
+
(a) => ({
|
|
888
912
|
kind: "card",
|
|
889
|
-
id:
|
|
890
|
-
card:
|
|
891
|
-
sheetId:
|
|
892
|
-
sheetKind: n.get(
|
|
893
|
-
...
|
|
913
|
+
id: a.cardId,
|
|
914
|
+
card: a.card,
|
|
915
|
+
sheetId: a.sheetId,
|
|
916
|
+
sheetKind: n.get(a.sheetId) ?? "dashboard",
|
|
917
|
+
...a.kind === "documentSectionCard" ? { sectionId: a.sectionId } : {}
|
|
894
918
|
})
|
|
895
919
|
),
|
|
896
920
|
...(e.variables ?? []).map(
|
|
897
|
-
(
|
|
921
|
+
(a) => ({
|
|
898
922
|
kind: "variable",
|
|
899
|
-
id:
|
|
900
|
-
variable:
|
|
901
|
-
card:
|
|
923
|
+
id: a.id,
|
|
924
|
+
variable: a,
|
|
925
|
+
card: ht(a)
|
|
902
926
|
})
|
|
903
927
|
)
|
|
904
|
-
],
|
|
905
|
-
return me.set(e,
|
|
928
|
+
], s = { targets: r, byId: new Map(r.map((a) => [a.id, a])) };
|
|
929
|
+
return me.set(e, s), s;
|
|
906
930
|
}
|
|
907
|
-
function
|
|
931
|
+
function gt(e) {
|
|
908
932
|
return X(e).targets;
|
|
909
933
|
}
|
|
910
|
-
function
|
|
934
|
+
function _n(e, t) {
|
|
911
935
|
return X(e).byId.get(t);
|
|
912
936
|
}
|
|
913
|
-
function
|
|
937
|
+
function kt(e, t) {
|
|
914
938
|
return X(e).byId.has(t);
|
|
915
939
|
}
|
|
916
|
-
function
|
|
940
|
+
function wt(e, t) {
|
|
917
941
|
return t.kind === "card" ? [
|
|
918
942
|
{
|
|
919
943
|
sheetId: t.sheetId,
|
|
@@ -923,18 +947,18 @@ function Ct(e, t) {
|
|
|
923
947
|
}
|
|
924
948
|
] : ke(e, t.id);
|
|
925
949
|
}
|
|
926
|
-
function
|
|
927
|
-
return
|
|
950
|
+
function At(e, t, n) {
|
|
951
|
+
return wt(e, n).some(
|
|
928
952
|
(r) => C(t, r)
|
|
929
953
|
);
|
|
930
954
|
}
|
|
931
|
-
function
|
|
932
|
-
return
|
|
933
|
-
(n) => n.kind === "variable" &&
|
|
955
|
+
function Fn(e, t) {
|
|
956
|
+
return gt(e).filter(
|
|
957
|
+
(n) => n.kind === "variable" && At(e, t, n)
|
|
934
958
|
);
|
|
935
959
|
}
|
|
936
|
-
const
|
|
937
|
-
function
|
|
960
|
+
const vt = ["new", "edit", "delete", "create", "update", "remove"];
|
|
961
|
+
function Ke(e, t) {
|
|
938
962
|
return (e.sheets || []).flatMap(
|
|
939
963
|
(n) => _({ sheets: [n] }).filter(t).map((r) => ({
|
|
940
964
|
card: r.card,
|
|
@@ -947,22 +971,22 @@ function Te(e, t) {
|
|
|
947
971
|
);
|
|
948
972
|
}
|
|
949
973
|
function T(e) {
|
|
950
|
-
return
|
|
974
|
+
return Ke(e, (t) => t.kind !== "documentSectionCard");
|
|
951
975
|
}
|
|
952
|
-
function
|
|
976
|
+
function Vn(e) {
|
|
953
977
|
return [
|
|
954
978
|
...T(e),
|
|
955
|
-
...
|
|
979
|
+
...Ke(e, (t) => t.kind === "documentSectionCard")
|
|
956
980
|
];
|
|
957
981
|
}
|
|
958
|
-
function
|
|
982
|
+
function $n(e) {
|
|
959
983
|
return T(e).map((t) => t.card);
|
|
960
984
|
}
|
|
961
|
-
function
|
|
962
|
-
return n && t === n ? !0 : !
|
|
985
|
+
function Pn(e, t, n) {
|
|
986
|
+
return n && t === n ? !0 : !kt(e, t);
|
|
963
987
|
}
|
|
964
|
-
function
|
|
965
|
-
return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ?
|
|
988
|
+
function Ln(e) {
|
|
989
|
+
return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? vt.includes(e.toLowerCase()) ? {
|
|
966
990
|
isValid: !1,
|
|
967
991
|
error: `"${e}" is a reserved keyword and cannot be used`
|
|
968
992
|
} : { isValid: !0 } : {
|
|
@@ -973,27 +997,27 @@ function Vn(e) {
|
|
|
973
997
|
error: "Card ID can only contain letters, numbers, hyphens, and underscores"
|
|
974
998
|
};
|
|
975
999
|
}
|
|
976
|
-
function
|
|
1000
|
+
function qn(e, t) {
|
|
977
1001
|
var n;
|
|
978
|
-
return (n =
|
|
1002
|
+
return (n = Tt(e, t)) == null ? void 0 : n.card;
|
|
979
1003
|
}
|
|
980
|
-
function
|
|
1004
|
+
function Tt(e, t) {
|
|
981
1005
|
for (const n of T(e))
|
|
982
1006
|
if (n.card.id === t)
|
|
983
1007
|
return n;
|
|
984
1008
|
}
|
|
985
|
-
function
|
|
1009
|
+
function Bn(e, t) {
|
|
986
1010
|
for (const n of e.sheets || [])
|
|
987
1011
|
for (const r of n.frames || [])
|
|
988
|
-
for (const
|
|
989
|
-
if (
|
|
990
|
-
return { card:
|
|
1012
|
+
for (const s of r.cards || [])
|
|
1013
|
+
if (s.id === t)
|
|
1014
|
+
return { card: s, sheet: n };
|
|
991
1015
|
}
|
|
992
|
-
const
|
|
1016
|
+
const R = {
|
|
993
1017
|
includeMetricFilterDatasets: !0,
|
|
994
1018
|
preferQualifiedIdentity: !1
|
|
995
1019
|
};
|
|
996
|
-
function
|
|
1020
|
+
function De(e) {
|
|
997
1021
|
if (!e) return;
|
|
998
1022
|
if (e.kind === "semantic")
|
|
999
1023
|
return { entityName: e.datasetName, entityId: e.datasetId, label: e.label };
|
|
@@ -1004,12 +1028,12 @@ function Ee(e) {
|
|
|
1004
1028
|
label: e.label
|
|
1005
1029
|
};
|
|
1006
1030
|
}
|
|
1007
|
-
function
|
|
1031
|
+
function Et(e) {
|
|
1008
1032
|
var n;
|
|
1009
|
-
const t =
|
|
1033
|
+
const t = De(e.source);
|
|
1010
1034
|
return t ? `${(n = e.source) == null ? void 0 : n.kind}:${t.qualifiedEntityName || t.entityName}` : "";
|
|
1011
1035
|
}
|
|
1012
|
-
function
|
|
1036
|
+
function Kt(e) {
|
|
1013
1037
|
return [
|
|
1014
1038
|
e.id,
|
|
1015
1039
|
e.qualifiedEntityName,
|
|
@@ -1019,36 +1043,36 @@ function vt(e) {
|
|
|
1019
1043
|
e.name,
|
|
1020
1044
|
// Source-only fields from different datasets can otherwise share a key
|
|
1021
1045
|
// and the second dataset would be silently dropped.
|
|
1022
|
-
|
|
1046
|
+
Et(e)
|
|
1023
1047
|
].join("|");
|
|
1024
1048
|
}
|
|
1025
|
-
function
|
|
1049
|
+
function Dt(e) {
|
|
1026
1050
|
return [e.entityName, e.qualifiedEntityName || "", e.entityId || ""].join("|");
|
|
1027
1051
|
}
|
|
1028
|
-
function
|
|
1052
|
+
function jn(e) {
|
|
1029
1053
|
return e.entityName || e.qualifiedEntityName || "";
|
|
1030
1054
|
}
|
|
1031
|
-
function
|
|
1055
|
+
function Nt(e) {
|
|
1032
1056
|
var t, n;
|
|
1033
1057
|
return !!(e.expression || e.derivedField || (n = (t = e.calculatedFormula) == null ? void 0 : t.inputFields) != null && n.length);
|
|
1034
1058
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return
|
|
1059
|
+
function Ot(e) {
|
|
1060
|
+
return Pe(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Nt(e);
|
|
1037
1061
|
}
|
|
1038
|
-
function
|
|
1039
|
-
const n =
|
|
1062
|
+
function P(e, t) {
|
|
1063
|
+
const n = Dt(t);
|
|
1040
1064
|
e.found.has(n) || e.found.set(n, t);
|
|
1041
1065
|
}
|
|
1042
1066
|
function E(e, t) {
|
|
1043
1067
|
var u, d, f;
|
|
1044
1068
|
if (!e) return;
|
|
1045
|
-
const n =
|
|
1069
|
+
const n = Kt(e);
|
|
1046
1070
|
if (t.visitedFields.has(n)) return;
|
|
1047
1071
|
t.visitedFields.add(n);
|
|
1048
|
-
const r =
|
|
1072
|
+
const r = Ot(e);
|
|
1049
1073
|
if (!r) {
|
|
1050
|
-
const y = !e.entityName && !e.qualifiedEntityName ?
|
|
1051
|
-
|
|
1074
|
+
const y = !e.entityName && !e.qualifiedEntityName ? De(e.source) : void 0;
|
|
1075
|
+
P(
|
|
1052
1076
|
t,
|
|
1053
1077
|
y || {
|
|
1054
1078
|
// May be empty for qualified-only metadata; identity then comes from
|
|
@@ -1061,15 +1085,15 @@ function E(e, t) {
|
|
|
1061
1085
|
);
|
|
1062
1086
|
}
|
|
1063
1087
|
t.includeMetricFilterDatasets && "parameters" in e && ((u = e.parameters) != null && u.filters) && Z(e.parameters.filters, t);
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1088
|
+
const s = (d = e.calculatedFormula) == null ? void 0 : d.inputFields, a = !!(s && s.length > 0);
|
|
1089
|
+
a && s.forEach((y) => E(y, t));
|
|
1066
1090
|
let i = !1, o = !1;
|
|
1067
|
-
const c =
|
|
1091
|
+
const c = a || (f = e.derivedField) == null ? void 0 : f.inputs;
|
|
1068
1092
|
if (c && Object.keys(c).length > 0)
|
|
1069
1093
|
for (const y of Object.values(c)) {
|
|
1070
1094
|
const h = y.field.source;
|
|
1071
1095
|
if (!h) {
|
|
1072
|
-
|
|
1096
|
+
a || (o = !0);
|
|
1073
1097
|
continue;
|
|
1074
1098
|
}
|
|
1075
1099
|
if (h.kind === "sql") {
|
|
@@ -1077,14 +1101,14 @@ function E(e, t) {
|
|
|
1077
1101
|
continue;
|
|
1078
1102
|
}
|
|
1079
1103
|
if (h.kind === "semantic")
|
|
1080
|
-
|
|
1104
|
+
P(t, {
|
|
1081
1105
|
entityName: h.datasetName,
|
|
1082
1106
|
entityId: h.datasetId,
|
|
1083
1107
|
label: h.label
|
|
1084
1108
|
});
|
|
1085
1109
|
else {
|
|
1086
1110
|
const p = [h.databaseName, h.schemaName, h.tableName].filter((I) => !!(I && I.trim())).join(".");
|
|
1087
|
-
|
|
1111
|
+
P(t, {
|
|
1088
1112
|
entityName: h.tableName,
|
|
1089
1113
|
qualifiedEntityName: p.includes(".") ? p : void 0,
|
|
1090
1114
|
label: h.label
|
|
@@ -1092,7 +1116,7 @@ function E(e, t) {
|
|
|
1092
1116
|
}
|
|
1093
1117
|
i = !0;
|
|
1094
1118
|
}
|
|
1095
|
-
o && (t.complete = !1), r && !
|
|
1119
|
+
o && (t.complete = !1), r && !a && !i && (t.complete = !1);
|
|
1096
1120
|
}
|
|
1097
1121
|
function Z(e, t) {
|
|
1098
1122
|
if (e && !t.visitedGroups.has(e.id)) {
|
|
@@ -1117,49 +1141,49 @@ function ee(e, t) {
|
|
|
1117
1141
|
const n = (r = e.qualifiedEntityName) != null && r.includes(".") ? e.qualifiedEntityName : void 0;
|
|
1118
1142
|
return t === "qualifiedOnly" ? n : t === "preferQualified" ? n || e.entityName || void 0 : e.entityName || void 0;
|
|
1119
1143
|
}
|
|
1120
|
-
function
|
|
1144
|
+
function Un(e) {
|
|
1121
1145
|
const t = F(!1);
|
|
1122
1146
|
return E(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
|
|
1123
1147
|
}
|
|
1124
|
-
function
|
|
1125
|
-
const
|
|
1148
|
+
function Ne(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = R) {
|
|
1149
|
+
const a = { ...R, ...s }, i = F(a.includeMetricFilterDatasets, n, r);
|
|
1126
1150
|
E(e, i), i.found.forEach((o) => {
|
|
1127
|
-
const c = ee(o,
|
|
1151
|
+
const c = ee(o, a.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
1128
1152
|
c && t.add(c);
|
|
1129
1153
|
});
|
|
1130
1154
|
}
|
|
1131
|
-
function
|
|
1132
|
-
|
|
1155
|
+
function zn(e, t) {
|
|
1156
|
+
Ne(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
|
|
1133
1157
|
preferQualifiedIdentity: !0
|
|
1134
1158
|
});
|
|
1135
1159
|
}
|
|
1136
|
-
function
|
|
1137
|
-
const
|
|
1138
|
-
E(e,
|
|
1139
|
-
const i = ee(
|
|
1160
|
+
function Wn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
1161
|
+
const s = F(!0, n, r);
|
|
1162
|
+
E(e, s), s.found.forEach((a) => {
|
|
1163
|
+
const i = ee(a, "qualifiedOnly");
|
|
1140
1164
|
i && t.add(i);
|
|
1141
1165
|
});
|
|
1142
1166
|
}
|
|
1143
|
-
function
|
|
1144
|
-
|
|
1167
|
+
function Qn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
1168
|
+
Ne(e, t, n, r, {
|
|
1145
1169
|
includeMetricFilterDatasets: !1
|
|
1146
1170
|
});
|
|
1147
1171
|
}
|
|
1148
|
-
function
|
|
1149
|
-
const
|
|
1172
|
+
function Gn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = R) {
|
|
1173
|
+
const a = { ...R, ...s }, i = F(a.includeMetricFilterDatasets, n, r);
|
|
1150
1174
|
Z(e, i), i.found.forEach((o) => {
|
|
1151
|
-
const c = ee(o,
|
|
1175
|
+
const c = ee(o, a.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
1152
1176
|
c && t.add(c);
|
|
1153
1177
|
});
|
|
1154
1178
|
}
|
|
1155
|
-
function
|
|
1179
|
+
function Yn(e, t) {
|
|
1156
1180
|
return t != null && t[e] ? t[e] : (e.includes(".") ? e.slice(e.lastIndexOf(".") + 1) : e).replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (r) => r.toUpperCase());
|
|
1157
1181
|
}
|
|
1158
|
-
const
|
|
1182
|
+
const Jn = {
|
|
1159
1183
|
database: null,
|
|
1160
1184
|
schema: null,
|
|
1161
1185
|
table: null
|
|
1162
|
-
},
|
|
1186
|
+
}, Hn = "__card_default__", xt = {
|
|
1163
1187
|
date: /* @__PURE__ */ new Set([
|
|
1164
1188
|
"between",
|
|
1165
1189
|
"not between",
|
|
@@ -1198,14 +1222,14 @@ const Qn = {
|
|
|
1198
1222
|
]),
|
|
1199
1223
|
boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
|
|
1200
1224
|
};
|
|
1201
|
-
function
|
|
1225
|
+
function Mt(e) {
|
|
1202
1226
|
const t = G(e);
|
|
1203
1227
|
return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
|
|
1204
1228
|
}
|
|
1205
|
-
function
|
|
1206
|
-
return typeof t != "string" ? !1 :
|
|
1229
|
+
function Xn(e, t) {
|
|
1230
|
+
return typeof t != "string" ? !1 : xt[Mt(e)].has(t);
|
|
1207
1231
|
}
|
|
1208
|
-
const
|
|
1232
|
+
const Rt = /* @__PURE__ */ new Set([
|
|
1209
1233
|
"=",
|
|
1210
1234
|
">",
|
|
1211
1235
|
"<",
|
|
@@ -1221,47 +1245,53 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
1221
1245
|
"is null",
|
|
1222
1246
|
"is not null"
|
|
1223
1247
|
]);
|
|
1224
|
-
function
|
|
1248
|
+
function _t(e, t) {
|
|
1225
1249
|
return t === "number" ? typeof e == "number" && Number.isFinite(e) : t === "boolean" ? typeof e == "boolean" : t === "date" ? e instanceof Date || typeof e == "string" && e.trim().length > 0 : typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
1226
1250
|
}
|
|
1227
|
-
function
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1251
|
+
function Ft(e, t, n, r) {
|
|
1252
|
+
const s = Le(e.relativeMeta);
|
|
1253
|
+
if (s && We(s).dataAnchored) {
|
|
1230
1254
|
r.push(
|
|
1231
1255
|
`${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
|
|
1232
1256
|
);
|
|
1233
1257
|
return;
|
|
1234
1258
|
}
|
|
1235
|
-
|
|
1259
|
+
if (s && !qe(String(e.operation), s)) {
|
|
1260
|
+
r.push(
|
|
1261
|
+
`${n}.relativeMeta runs only under between, not between, before, after, on or before, or on or after.`
|
|
1262
|
+
);
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
Vt(e.operation, e.values, t, `${n}.values`, r);
|
|
1236
1266
|
}
|
|
1237
|
-
function
|
|
1267
|
+
function Vt(e, t, n, r, s) {
|
|
1238
1268
|
if (e === "is null" || e === "is not null") {
|
|
1239
|
-
t.length !== 0 &&
|
|
1269
|
+
t.length !== 0 && s.push(`${r} must be empty for null filter operations.`);
|
|
1240
1270
|
return;
|
|
1241
1271
|
}
|
|
1242
1272
|
if (e === "between" || e === "not between") {
|
|
1243
1273
|
if (t.length !== 2) {
|
|
1244
|
-
|
|
1274
|
+
s.push(
|
|
1245
1275
|
`${r} must contain exactly two values for between operations.`
|
|
1246
1276
|
);
|
|
1247
1277
|
return;
|
|
1248
1278
|
}
|
|
1249
1279
|
} else if (e === "in" || e === "not in") {
|
|
1250
1280
|
if (t.length === 0) {
|
|
1251
|
-
|
|
1281
|
+
s.push(
|
|
1252
1282
|
`${r} must contain at least one value for set operations.`
|
|
1253
1283
|
);
|
|
1254
1284
|
return;
|
|
1255
1285
|
}
|
|
1256
1286
|
} else if (t.length !== 1) {
|
|
1257
|
-
|
|
1287
|
+
s.push(
|
|
1258
1288
|
`${r} must contain exactly one value for '${String(e)}' operations.`
|
|
1259
1289
|
);
|
|
1260
1290
|
return;
|
|
1261
1291
|
}
|
|
1262
|
-
for (const
|
|
1263
|
-
if (!
|
|
1264
|
-
|
|
1292
|
+
for (const a of t)
|
|
1293
|
+
if (!_t(a, n)) {
|
|
1294
|
+
s.push(
|
|
1265
1295
|
`${r} contains a value that is incompatible with valueType '${n}'.`
|
|
1266
1296
|
);
|
|
1267
1297
|
return;
|
|
@@ -1275,11 +1305,11 @@ const Q = {
|
|
|
1275
1305
|
tableSettingsMaxBytes: 65536,
|
|
1276
1306
|
rememberedTableSettingsMaxBytes: 262144,
|
|
1277
1307
|
bookmarkStateMaxBytes: 65536
|
|
1278
|
-
},
|
|
1279
|
-
function
|
|
1308
|
+
}, Oe = 1;
|
|
1309
|
+
function Zn(e) {
|
|
1280
1310
|
return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
|
|
1281
1311
|
}
|
|
1282
|
-
function
|
|
1312
|
+
function $t(e) {
|
|
1283
1313
|
const t = encodeURIComponent;
|
|
1284
1314
|
switch (e.kind) {
|
|
1285
1315
|
case "dimension":
|
|
@@ -1292,7 +1322,7 @@ function _t(e) {
|
|
|
1292
1322
|
return `result:${t(e.key)}`;
|
|
1293
1323
|
}
|
|
1294
1324
|
}
|
|
1295
|
-
function
|
|
1325
|
+
function D(e) {
|
|
1296
1326
|
if (e)
|
|
1297
1327
|
try {
|
|
1298
1328
|
return decodeURIComponent(e);
|
|
@@ -1300,26 +1330,26 @@ function N(e) {
|
|
|
1300
1330
|
return;
|
|
1301
1331
|
}
|
|
1302
1332
|
}
|
|
1303
|
-
function
|
|
1333
|
+
function Pt(e) {
|
|
1304
1334
|
if (typeof e != "string") return;
|
|
1305
1335
|
const t = e.split(":");
|
|
1306
1336
|
let n;
|
|
1307
1337
|
if (t[0] === "dim" && t.length === 3) {
|
|
1308
|
-
const r = t[1],
|
|
1309
|
-
(r === "detail" || r === "groupby") &&
|
|
1338
|
+
const r = t[1], s = D(t[2]);
|
|
1339
|
+
(r === "detail" || r === "groupby") && s && (n = { kind: "dimension", role: r, fieldId: s });
|
|
1310
1340
|
} else if (t[0] === "metric" && t.length === 3) {
|
|
1311
|
-
const r =
|
|
1312
|
-
r &&
|
|
1341
|
+
const r = D(t[1]), s = D(t[2]);
|
|
1342
|
+
r && s && (n = { kind: "metric", metricId: r, metricAlias: s });
|
|
1313
1343
|
} else if (t[0] === "result" && t.length === 2) {
|
|
1314
|
-
const r =
|
|
1344
|
+
const r = D(t[1]);
|
|
1315
1345
|
r && (n = { kind: "result", key: r });
|
|
1316
1346
|
}
|
|
1317
|
-
return n &&
|
|
1347
|
+
return n && $t(n) === e ? n : void 0;
|
|
1318
1348
|
}
|
|
1319
|
-
function
|
|
1320
|
-
return typeof e == "string" &&
|
|
1349
|
+
function O(e) {
|
|
1350
|
+
return typeof e == "string" && Pt(e) !== void 0;
|
|
1321
1351
|
}
|
|
1322
|
-
const pe = l.array(l.string()).max(2e3),
|
|
1352
|
+
const pe = l.array(l.string()).max(2e3), Lt = l.object({
|
|
1323
1353
|
order: pe.optional(),
|
|
1324
1354
|
hidden: pe.optional(),
|
|
1325
1355
|
labels: l.record(l.string(), l.string().max(Q.columnLabelMaxChars)).optional(),
|
|
@@ -1337,82 +1367,82 @@ const pe = l.array(l.string()).max(2e3), Vt = l.object({
|
|
|
1337
1367
|
function he(e) {
|
|
1338
1368
|
const t = /* @__PURE__ */ new Set(), n = [];
|
|
1339
1369
|
for (const r of e)
|
|
1340
|
-
!
|
|
1370
|
+
!O(r) || t.has(r) || (t.add(r), n.push(r));
|
|
1341
1371
|
return n;
|
|
1342
1372
|
}
|
|
1343
|
-
function
|
|
1373
|
+
function xe(e) {
|
|
1344
1374
|
if (!e) return;
|
|
1345
1375
|
const t = e.order ? he(e.order) : void 0, n = e.hidden ? he(e.hidden) : void 0, r = Object.entries(e.labels ?? {}).flatMap(
|
|
1346
1376
|
([c, u]) => {
|
|
1347
1377
|
const d = typeof u == "string" ? u.trim() : "";
|
|
1348
|
-
return
|
|
1378
|
+
return O(c) && d ? [
|
|
1349
1379
|
[
|
|
1350
1380
|
c,
|
|
1351
1381
|
d.slice(0, Q.columnLabelMaxChars)
|
|
1352
1382
|
]
|
|
1353
1383
|
] : [];
|
|
1354
1384
|
}
|
|
1355
|
-
),
|
|
1356
|
-
([c]) =>
|
|
1385
|
+
), s = /* @__PURE__ */ new Set(), a = e.sort ? e.sort.filter((c) => !O(c.columnId) || s.has(c.columnId) ? !1 : (s.add(c.columnId), !0)) : void 0, i = Object.entries(e.widths ?? {}).filter(
|
|
1386
|
+
([c]) => O(c)
|
|
1357
1387
|
), o = {};
|
|
1358
|
-
return t != null && t.length && (o.order = t), n != null && n.length && (o.hidden = n), r.length && (o.labels = Object.fromEntries(r)),
|
|
1388
|
+
return t != null && t.length && (o.order = t), n != null && n.length && (o.hidden = n), r.length && (o.labels = Object.fromEntries(r)), a && (o.sort = a.map(({ columnId: c, direction: u }) => ({
|
|
1359
1389
|
columnId: c,
|
|
1360
1390
|
direction: u
|
|
1361
1391
|
}))), i.length && (o.widths = Object.fromEntries(i)), Object.keys(o).length ? o : void 0;
|
|
1362
1392
|
}
|
|
1363
|
-
function
|
|
1393
|
+
function er(e) {
|
|
1364
1394
|
var t, n;
|
|
1365
1395
|
return !!((t = e == null ? void 0 : e.order) != null && t.length) || !!((n = e == null ? void 0 : e.hidden) != null && n.length) || Object.keys((e == null ? void 0 : e.labels) ?? {}).length > 0 || Object.keys((e == null ? void 0 : e.widths) ?? {}).length > 0;
|
|
1366
1396
|
}
|
|
1367
|
-
function
|
|
1368
|
-
return
|
|
1397
|
+
function Me(e) {
|
|
1398
|
+
return xe(e) === void 0;
|
|
1369
1399
|
}
|
|
1370
|
-
function
|
|
1371
|
-
if (t !==
|
|
1400
|
+
function Re(e, t) {
|
|
1401
|
+
if (t !== Oe)
|
|
1372
1402
|
return {
|
|
1373
1403
|
ok: !1,
|
|
1374
1404
|
error: `Unsupported table settings version ${t}.`
|
|
1375
1405
|
};
|
|
1376
|
-
const n =
|
|
1406
|
+
const n = Lt.safeParse(e);
|
|
1377
1407
|
return n.success ? {
|
|
1378
1408
|
ok: !0,
|
|
1379
|
-
value:
|
|
1409
|
+
value: xe(n.data) ?? {}
|
|
1380
1410
|
} : { ok: !1, error: "Table settings are invalid." };
|
|
1381
1411
|
}
|
|
1382
|
-
function
|
|
1412
|
+
function tr(e, t, n) {
|
|
1383
1413
|
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
1384
1414
|
const r = {};
|
|
1385
|
-
for (const [
|
|
1415
|
+
for (const [s, a] of Object.entries(
|
|
1386
1416
|
e
|
|
1387
1417
|
)) {
|
|
1388
|
-
if (!n.has(
|
|
1389
|
-
const i =
|
|
1390
|
-
i.ok && !
|
|
1418
|
+
if (!n.has(s)) continue;
|
|
1419
|
+
const i = Re(a, t);
|
|
1420
|
+
i.ok && !Me(i.value) && (r[s] = i.value);
|
|
1391
1421
|
}
|
|
1392
1422
|
return r;
|
|
1393
1423
|
}
|
|
1394
|
-
const
|
|
1424
|
+
const qt = /* @__PURE__ */ new Set([
|
|
1395
1425
|
"table",
|
|
1396
1426
|
"detailTable"
|
|
1397
1427
|
]);
|
|
1398
|
-
function
|
|
1399
|
-
return
|
|
1428
|
+
function _e(e) {
|
|
1429
|
+
return qt.has(e.type);
|
|
1400
1430
|
}
|
|
1401
|
-
function
|
|
1431
|
+
function Bt(e) {
|
|
1402
1432
|
var t, n;
|
|
1403
|
-
return
|
|
1433
|
+
return _e(e) && ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.allowViewerColumnCustomization) !== !1;
|
|
1404
1434
|
}
|
|
1405
|
-
function
|
|
1435
|
+
function nr(e) {
|
|
1406
1436
|
return new Set(
|
|
1407
|
-
T(e).filter(({ card: t }) =>
|
|
1437
|
+
T(e).filter(({ card: t }) => _e(t)).map(({ card: t }) => t.id)
|
|
1408
1438
|
);
|
|
1409
1439
|
}
|
|
1410
|
-
function
|
|
1440
|
+
function rr(e) {
|
|
1411
1441
|
return new Set(
|
|
1412
|
-
T(e).filter(({ card: t }) =>
|
|
1442
|
+
T(e).filter(({ card: t }) => Bt(t)).map(({ card: t }) => t.id)
|
|
1413
1443
|
);
|
|
1414
1444
|
}
|
|
1415
|
-
const
|
|
1445
|
+
const L = 1, sr = ["PRIVATE", "TEAM", "DASHBOARD"], jt = l.object({
|
|
1416
1446
|
filterId: l.string().min(1),
|
|
1417
1447
|
name: l.string(),
|
|
1418
1448
|
operation: l.string(),
|
|
@@ -1420,22 +1450,22 @@ const $ = 1, tr = ["PRIVATE", "TEAM", "DASHBOARD"], $t = l.object({
|
|
|
1420
1450
|
values: l.array(l.unknown())
|
|
1421
1451
|
}).passthrough().superRefine((e, t) => {
|
|
1422
1452
|
const n = [];
|
|
1423
|
-
|
|
1453
|
+
Rt.has(e.operation) ? Ft(e, e.valueType, "filterValue", n) : n.push("filterValue.operation must be a valid filter operation.");
|
|
1424
1454
|
for (const r of n) t.addIssue({ code: "custom", message: r });
|
|
1425
1455
|
}), q = l.unknown().superRefine((e, t) => {
|
|
1426
|
-
for (const n of
|
|
1456
|
+
for (const n of Qe(e).errors)
|
|
1427
1457
|
t.addIssue({ code: "custom", message: n.message });
|
|
1428
|
-
}),
|
|
1429
|
-
l.object({ kind: l.literal("filter"), filterValue:
|
|
1458
|
+
}), Ut = l.discriminatedUnion("kind", [
|
|
1459
|
+
l.object({ kind: l.literal("filter"), filterValue: jt }).strict(),
|
|
1430
1460
|
l.object({ kind: l.literal("control"), value: l.unknown() }).strict(),
|
|
1431
1461
|
l.object({
|
|
1432
1462
|
kind: l.literal("selection"),
|
|
1433
|
-
selection:
|
|
1463
|
+
selection: Be
|
|
1434
1464
|
}).strict()
|
|
1435
|
-
]),
|
|
1465
|
+
]), zt = l.union([
|
|
1436
1466
|
l.object({
|
|
1437
1467
|
status: l.literal("set"),
|
|
1438
|
-
value:
|
|
1468
|
+
value: Ut,
|
|
1439
1469
|
comparisonSelection: q.optional()
|
|
1440
1470
|
}).strict(),
|
|
1441
1471
|
l.object({
|
|
@@ -1443,7 +1473,7 @@ const $ = 1, tr = ["PRIVATE", "TEAM", "DASHBOARD"], $t = l.object({
|
|
|
1443
1473
|
comparisonSelection: q.optional()
|
|
1444
1474
|
}).strict(),
|
|
1445
1475
|
l.object({ comparisonSelection: q }).strict()
|
|
1446
|
-
]),
|
|
1476
|
+
]), Fe = ["bySheetId", "byCardId", "byDocumentSectionId"], Wt = /* @__PURE__ */ new Set(["version", "selectedSheetId", "inputs", "tableSettings"]), Qt = /* @__PURE__ */ new Set(["shared", ...Fe]), A = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
1447
1477
|
function ye(e, t, n) {
|
|
1448
1478
|
if (e === void 0) return;
|
|
1449
1479
|
if (!A(e)) {
|
|
@@ -1451,31 +1481,31 @@ function ye(e, t, n) {
|
|
|
1451
1481
|
return;
|
|
1452
1482
|
}
|
|
1453
1483
|
const r = {};
|
|
1454
|
-
for (const [
|
|
1455
|
-
const i =
|
|
1456
|
-
i != null && i.success ? r[
|
|
1457
|
-
target:
|
|
1458
|
-
id:
|
|
1484
|
+
for (const [s, a] of Object.entries(e)) {
|
|
1485
|
+
const i = s ? zt.safeParse(a) : void 0;
|
|
1486
|
+
i != null && i.success ? r[s] = i.data : t.push({
|
|
1487
|
+
target: je(s) ? "selection" : "input",
|
|
1488
|
+
id: s
|
|
1459
1489
|
});
|
|
1460
1490
|
}
|
|
1461
1491
|
return Object.keys(r).length ? r : void 0;
|
|
1462
1492
|
}
|
|
1463
|
-
function
|
|
1464
|
-
if (t !==
|
|
1493
|
+
function Gt(e, t) {
|
|
1494
|
+
if (t !== L)
|
|
1465
1495
|
return { ok: !1, error: `Unsupported bookmark version ${t}.` };
|
|
1466
|
-
if (!A(e) || e.version !==
|
|
1496
|
+
if (!A(e) || e.version !== L)
|
|
1467
1497
|
return { ok: !1, error: "The bookmark state is invalid." };
|
|
1468
|
-
const n = [], r = Object.keys(e).filter((o) => !
|
|
1469
|
-
let
|
|
1470
|
-
typeof e.selectedSheetId == "string" && e.selectedSheetId ?
|
|
1471
|
-
const
|
|
1498
|
+
const n = [], r = Object.keys(e).filter((o) => !Wt.has(o));
|
|
1499
|
+
let s;
|
|
1500
|
+
typeof e.selectedSheetId == "string" && e.selectedSheetId ? s = e.selectedSheetId : e.selectedSheetId !== void 0 && n.push({ target: "sheet", id: String(e.selectedSheetId) });
|
|
1501
|
+
const a = {};
|
|
1472
1502
|
if (A(e.inputs)) {
|
|
1473
1503
|
r.push(
|
|
1474
|
-
...Object.keys(e.inputs).filter((c) => !
|
|
1504
|
+
...Object.keys(e.inputs).filter((c) => !Qt.has(c)).map((c) => `inputs.${c}`)
|
|
1475
1505
|
);
|
|
1476
1506
|
const o = ye(e.inputs.shared, n, "shared");
|
|
1477
|
-
o && (
|
|
1478
|
-
for (const c of
|
|
1507
|
+
o && (a.shared = o);
|
|
1508
|
+
for (const c of Fe) {
|
|
1479
1509
|
const u = e.inputs[c];
|
|
1480
1510
|
if (u === void 0) continue;
|
|
1481
1511
|
if (!A(u)) {
|
|
@@ -1487,140 +1517,142 @@ function zt(e, t) {
|
|
|
1487
1517
|
const h = ye(y, n, `${c}.${f}`);
|
|
1488
1518
|
h && (d[f] = h);
|
|
1489
1519
|
}
|
|
1490
|
-
Object.keys(d).length && (
|
|
1520
|
+
Object.keys(d).length && (a[c] = d);
|
|
1491
1521
|
}
|
|
1492
1522
|
} else e.inputs !== void 0 && r.push("inputs");
|
|
1493
1523
|
const i = {};
|
|
1494
1524
|
if (A(e.tableSettings))
|
|
1495
1525
|
for (const [o, c] of Object.entries(e.tableSettings)) {
|
|
1496
|
-
const u = o ?
|
|
1497
|
-
u != null && u.ok ?
|
|
1526
|
+
const u = o ? Re(c, Oe) : void 0;
|
|
1527
|
+
u != null && u.ok ? Me(u.value) || (i[o] = u.value) : n.push({ target: "card", id: o });
|
|
1498
1528
|
}
|
|
1499
1529
|
else e.tableSettings !== void 0 && r.push("tableSettings");
|
|
1500
1530
|
return {
|
|
1501
1531
|
ok: !0,
|
|
1502
1532
|
value: {
|
|
1503
|
-
version:
|
|
1504
|
-
...
|
|
1505
|
-
...Object.keys(
|
|
1533
|
+
version: L,
|
|
1534
|
+
...s ? { selectedSheetId: s } : {},
|
|
1535
|
+
...Object.keys(a).length ? { inputs: a } : {},
|
|
1506
1536
|
...Object.keys(i).length ? { tableSettings: i } : {}
|
|
1507
1537
|
},
|
|
1508
1538
|
issues: n,
|
|
1509
1539
|
unknownKeys: r
|
|
1510
1540
|
};
|
|
1511
1541
|
}
|
|
1512
|
-
function
|
|
1513
|
-
const n =
|
|
1542
|
+
function ar(e, t) {
|
|
1543
|
+
const n = Gt(e, t);
|
|
1514
1544
|
return n.ok ? n.issues.some((r) => r.target === "card") ? { ok: !1, error: "The bookmark table settings are invalid." } : n.issues.length || n.unknownKeys.length ? { ok: !1, error: "The bookmark state is invalid." } : { ok: !0, value: n.value } : n;
|
|
1515
1545
|
}
|
|
1516
1546
|
export {
|
|
1517
|
-
|
|
1547
|
+
re as $,
|
|
1518
1548
|
_ as A,
|
|
1519
|
-
|
|
1520
|
-
|
|
1549
|
+
L as B,
|
|
1550
|
+
Hn as C,
|
|
1521
1551
|
C as D,
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1552
|
+
Jn as E,
|
|
1553
|
+
fn as F,
|
|
1554
|
+
_n as G,
|
|
1555
|
+
Tn as H,
|
|
1556
|
+
Ye as I,
|
|
1557
|
+
Tt as J,
|
|
1558
|
+
ot as K,
|
|
1559
|
+
gt as L,
|
|
1560
|
+
yn as M,
|
|
1531
1561
|
de as N,
|
|
1532
|
-
|
|
1533
|
-
|
|
1562
|
+
rt as O,
|
|
1563
|
+
dn as P,
|
|
1534
1564
|
ge as Q,
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1565
|
+
bn as R,
|
|
1566
|
+
On as S,
|
|
1567
|
+
Cn as T,
|
|
1538
1568
|
J as U,
|
|
1539
1569
|
Q as V,
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1570
|
+
Ae as W,
|
|
1571
|
+
lt as X,
|
|
1572
|
+
ve as Y,
|
|
1573
|
+
En as Z,
|
|
1574
|
+
ne as _,
|
|
1575
|
+
jn as a,
|
|
1576
|
+
Je as a0,
|
|
1577
|
+
nn as a1,
|
|
1578
|
+
He as a2,
|
|
1579
|
+
rn as a3,
|
|
1550
1580
|
ln as a4,
|
|
1551
|
-
|
|
1581
|
+
mn as a5,
|
|
1552
1582
|
pn as a6,
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
Dn as
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1583
|
+
hn as a7,
|
|
1584
|
+
In as a8,
|
|
1585
|
+
Sn as a9,
|
|
1586
|
+
Rt as aA,
|
|
1587
|
+
Ft as aB,
|
|
1588
|
+
$n as aC,
|
|
1589
|
+
an as aD,
|
|
1590
|
+
et as aE,
|
|
1591
|
+
v as aF,
|
|
1592
|
+
Y as aG,
|
|
1593
|
+
wn as aH,
|
|
1594
|
+
vn as aI,
|
|
1595
|
+
An as aJ,
|
|
1596
|
+
T as aK,
|
|
1597
|
+
ut as aL,
|
|
1598
|
+
kn as aM,
|
|
1599
|
+
se as aN,
|
|
1600
|
+
gn as aO,
|
|
1601
|
+
Vn as aP,
|
|
1602
|
+
Xe as aQ,
|
|
1603
|
+
Pn as aR,
|
|
1604
|
+
Ln as aS,
|
|
1605
|
+
Bn as aT,
|
|
1606
|
+
sn as aU,
|
|
1607
|
+
Te as aa,
|
|
1608
|
+
M as ab,
|
|
1609
|
+
ft as ac,
|
|
1610
|
+
S as ad,
|
|
1611
|
+
Ee as ae,
|
|
1612
|
+
mt as af,
|
|
1613
|
+
pt as ag,
|
|
1614
|
+
Kn as ah,
|
|
1615
|
+
H as ai,
|
|
1616
|
+
ht as aj,
|
|
1617
|
+
Dn as ak,
|
|
1618
|
+
Nn as al,
|
|
1619
|
+
xn as am,
|
|
1620
|
+
Mn as an,
|
|
1621
|
+
Rn as ao,
|
|
1622
|
+
on as ap,
|
|
1623
|
+
nt as aq,
|
|
1624
|
+
cn as ar,
|
|
1625
|
+
un as as,
|
|
1626
|
+
ke as at,
|
|
1627
|
+
kt as au,
|
|
1628
|
+
wt as av,
|
|
1629
|
+
At as aw,
|
|
1630
|
+
Fn as ax,
|
|
1631
|
+
Mt as ay,
|
|
1632
|
+
Xn as az,
|
|
1633
|
+
zn as b,
|
|
1634
|
+
Ne as c,
|
|
1635
|
+
De as d,
|
|
1636
|
+
Wn as e,
|
|
1637
|
+
Qn as f,
|
|
1638
|
+
Gn as g,
|
|
1639
|
+
Yn as h,
|
|
1640
|
+
Gt as i,
|
|
1641
|
+
Oe as j,
|
|
1642
|
+
Pt as k,
|
|
1643
|
+
er as l,
|
|
1644
|
+
Zn as m,
|
|
1645
|
+
xe as n,
|
|
1646
|
+
Me as o,
|
|
1647
|
+
ar as p,
|
|
1648
|
+
Re as q,
|
|
1649
|
+
Un as r,
|
|
1650
|
+
tr as s,
|
|
1651
|
+
$t as t,
|
|
1652
|
+
_e as u,
|
|
1653
|
+
Bt as v,
|
|
1654
|
+
nr as w,
|
|
1655
|
+
rr as x,
|
|
1656
|
+
sr as y,
|
|
1657
|
+
qn as z
|
|
1626
1658
|
};
|