react-semaphor 0.1.587 → 0.1.588
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 +341 -338
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-DhP8wVtM.js → add-to-dashboard-C86FsM8D.js} +1 -1
- package/dist/chunks/{aggregate-measure-field-DsFXETpI.js → aggregate-measure-field-BrkXsSJp.js} +2 -2
- package/dist/chunks/{analytics-base-schemas-BaIQrEzX.js → analytics-base-schemas-8wz9vqn_.js} +173 -165
- package/dist/chunks/{assistant-chat-pfJK-T0b.js → assistant-chat-BeM6joPc.js} +19 -18
- package/dist/chunks/{bookmark-impact-BSpGQL1M.js → bookmark-impact-B7pbMx2e.js} +2 -2
- package/dist/chunks/{bookmark-state-CL4WEpgB.js → bookmark-state-Bn7k3ttp.js} +5 -5
- package/dist/chunks/{card-filter-builder-C8PbhHjq.js → card-filter-builder-DmodrhyI.js} +81 -81
- package/dist/chunks/{comparison-window-caption-CoART8BC.js → comparison-window-caption-fqijZdVd.js} +451 -395
- package/dist/chunks/{context-BTLBjQNh.js → context-CVXTFljo.js} +1 -1
- package/dist/chunks/{dashboard-CVj1oMoW.js → dashboard-Tu5wT0Cw.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-TqA58rKz.js → dashboard-briefing-launcher-D8jMxIJo.js} +249 -265
- package/dist/chunks/{dashboard-controls-DQ8FsxAz.js → dashboard-controls-uzeAIEkM.js} +65 -65
- package/dist/chunks/{dashboard-json-DM88pmk2.js → dashboard-json-i5rpFNCg.js} +5 -5
- package/dist/chunks/dates-BunbHJH0.js +115 -0
- package/dist/chunks/{edit-dashboard-visual-BpRnU_6G.js → edit-dashboard-visual-BpEK_Sls.js} +2357 -2344
- package/dist/chunks/{filter-line-Cu2u1K36.js → filter-line-Dza3ee4w.js} +5 -5
- package/dist/chunks/{filter-reach-copy-0Xp97cLk.js → filter-reach-copy-D5AmDHda.js} +944 -942
- package/dist/chunks/{filter-value-text-xefXzZlf.js → filter-value-text-DQw4v3nC.js} +6 -6
- package/dist/chunks/{index-D_QSeVKy.js → index-dGxJTaP1.js} +39 -39
- package/dist/chunks/{layout-grid-9nSS2SL-.js → layout-grid-XCYphks2.js} +1 -1
- package/dist/chunks/{list-filter-CfMPI6v4.js → list-filter-DGV3fqqv.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-DOVSFFuf.js → matrix-analytical-definition-SN0JUJVk.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-BKDyxJho.js → matrix-member-presentation-DVBJR0MA.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-BM5TveR3.js → matrix-operation-contract-JSmproo9.js} +15 -15
- package/dist/chunks/{metric-comparison-ZmurmEIs.js → metric-comparison-xE_J6hkg.js} +2 -2
- package/dist/chunks/{paintbrush-LzAje2ff.js → paintbrush-DEEZXhDj.js} +1 -1
- package/dist/chunks/{palette-DicJG0TC.js → palette-Bgy0H-Nt.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-CdeTU96P.js → pivot-header-presentation-D-DfPAjb.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-Bx_BCu-7.js → pivot-result-contract-expectations-DbBahmgc.js} +545 -536
- package/dist/chunks/{pivot-result-identity-Bvs6Uq3v.js → pivot-result-identity-CUsMt_4r.js} +1 -1
- package/dist/chunks/{raw-temporal-value-DH-feMc2.js → raw-temporal-value-BnGCWJAL.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CXKmWyLm.js → report-preferences-dialog-CTM0xfd0.js} +14 -14
- package/dist/chunks/{report-runtime-context-NlOXwyRB.js → report-runtime-context-CrOgmuxO.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-zEXuitoF.js → resolve-dashboard-input-context-DFBIngUZ.js} +5617 -5485
- package/dist/chunks/{save-0wu1Z1U7.js → save-xnRCvMeA.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-Cll5LipJ.js → saved-dashboard-context-DKMTP9ib.js} +17 -17
- package/dist/chunks/selection-filter-compiler-DkIjp1yH.js +131 -0
- package/dist/chunks/{semaphor-ready-indicator-Bnj3H0Dm.js → semaphor-ready-indicator-zU9reNmX.js} +45952 -45617
- package/dist/chunks/{shelf-drop-preview-context-B8rmn6BD.js → shelf-drop-preview-context-R9sf4oDX.js} +6 -6
- package/dist/chunks/{stored-dashboard-CURqJgoa.js → stored-dashboard-CksluF2S.js} +1539 -1404
- package/dist/chunks/{style-sheet-parts-_dGSFzDi.js → style-sheet-parts-D7NbsFL0.js} +3 -3
- package/dist/chunks/{table-export-sheet-Dmtqi5NV.js → table-export-sheet-ClSgERQC.js} +1 -1
- package/dist/chunks/{token-types-DEe_FP4l.js → token-types-DTocOcwt.js} +1 -1
- package/dist/chunks/{upload-CtyOkU_B.js → upload-BXGgYS4g.js} +1 -1
- package/dist/chunks/{validators-CJ8Jh0E8.js → validators-CrYXNnNE.js} +51 -49
- package/dist/chunks/{variable-draft-DIv-9y6Q.js → variable-draft-rbtGPvmX.js} +16 -14
- package/dist/chunks/visual-choice-DDfHfHvY.js +172 -0
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +821 -791
- package/dist/format-utils/index.js +162 -158
- package/dist/index.js +21 -21
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +39 -2
- package/dist/types/lib/dashboard-view-state/date-zoom.d.ts +65 -0
- package/dist/types/lib/dashboard-view-state/grain-pick.d.ts +38 -0
- package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
- package/dist/types/lib/formatters/grouped-temporal-presentation.d.ts +6 -2
- package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-table.d.ts +2 -2
- package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -1
- package/dist/types/lib/query-context/build-card-query-context.d.ts +15 -1
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +3 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +14 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +7 -1
- package/dist/types/lib/types/explorer-types.d.ts +13 -0
- package/dist/types/lib/utils/card-config-utils.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +32 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/automatic-grain.d.ts +77 -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 +13 -8
- package/dist/types/shared/dashboard-authoring/control-value-resolution.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/kpi-trend-rule.d.ts +6 -29
- package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +40 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +11 -0
- package/dist/types/shared/usage-events/details.d.ts +2 -2
- package/dist/usage-events/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/dates-5z3b9Loo.js +0 -136
- package/dist/chunks/selection-filter-compiler-BReJy-uv.js +0 -92
- package/dist/chunks/visual-choice-BBPizkRo.js +0 -206
package/dist/chunks/{comparison-window-caption-CoART8BC.js → comparison-window-caption-fqijZdVd.js}
RENAMED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h as Y, e as st, p as it, k as
|
|
3
|
-
import { aU as j, a5 as
|
|
4
|
-
import "./matrix-operation-contract-
|
|
5
|
-
import "./analytics-base-schemas-
|
|
6
|
-
import { readPdfCapacityFacts as dt, PDF_SAFETY_LIMIT_EXCEEDED as se, PDF_CAPACITY as k, PDF_NUMBER_COLUMN_TOO_WIDE as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
function
|
|
1
|
+
import { aF as Ge, i as qe, k as U, n as Xe, T as $e, aG as ae, aH as Pe, aI as Ye, aJ as Ie, aK as De, am as Le, f as Me, as as We, ax as Ze, at as Je, a as Qe, b as B, a7 as de, a5 as et, an as tt, q as fe, t as rt, Z as pe, $ as nt, a1 as ot, a8 as at, aL as I, aM as K } from "./pivot-result-contract-expectations-DbBahmgc.js";
|
|
2
|
+
import { h as Y, e as st, p as it, k as lt } from "./export-file-format-C-tJsxsf.js";
|
|
3
|
+
import { aU as j, a5 as ct, m as q, aT as ut, r as mt } from "./validators-CrYXNnNE.js";
|
|
4
|
+
import "./matrix-operation-contract-JSmproo9.js";
|
|
5
|
+
import "./analytics-base-schemas-8wz9vqn_.js";
|
|
6
|
+
import { readPdfCapacityFacts as dt, PDF_SAFETY_LIMIT_EXCEEDED as se, PDF_CAPACITY as k, PDF_NUMBER_COLUMN_TOO_WIDE as ke, getUtf8ByteLength as ft, FAST_PDF_POLICY as pt, isPdfCapacityRefusalCode as ht } from "../pdf-export-policy/index.js";
|
|
7
|
+
import { w as bt, v as yt } from "./raw-temporal-value-BnGCWJAL.js";
|
|
8
|
+
import { p as gt } from "./pivot-header-presentation-D-DfPAjb.js";
|
|
9
|
+
import { c as wt, b as he } from "./pivot-result-identity-CUsMt_4r.js";
|
|
10
|
+
function xt(e, t, r) {
|
|
11
11
|
const n = {
|
|
12
12
|
...t,
|
|
13
13
|
locale: t.locale ?? r
|
|
14
14
|
};
|
|
15
15
|
if (n.type === "number")
|
|
16
16
|
return U(e, n);
|
|
17
|
-
const { prefix: o, suffix:
|
|
17
|
+
const { prefix: o, suffix: s, ...c } = n;
|
|
18
18
|
return `${o ?? ""}${U(e, {
|
|
19
|
-
...
|
|
19
|
+
...c,
|
|
20
20
|
negativeStyle: n.type === "currency" ? n.negativeStyle : "minus"
|
|
21
|
-
})}${
|
|
21
|
+
})}${s ?? ""}`;
|
|
22
22
|
}
|
|
23
23
|
function Q(e, t, r) {
|
|
24
|
-
return e === null ? { value: e, text: null } : !t || !
|
|
24
|
+
return e === null ? { value: e, text: null } : !t || !qe(t) && t.type !== "duration" ? {
|
|
25
25
|
value: e,
|
|
26
26
|
text: U(e, { type: "number", locale: r })
|
|
27
27
|
} : t.type === "duration" ? {
|
|
28
28
|
value: e,
|
|
29
|
-
text:
|
|
29
|
+
text: Xe(e, {
|
|
30
30
|
inputUnit: t.inputUnit,
|
|
31
31
|
outputStyle: t.outputStyle,
|
|
32
32
|
largestUnit: t.largestUnit,
|
|
@@ -36,7 +36,7 @@ function Q(e, t, r) {
|
|
|
36
36
|
suffix: t.suffix,
|
|
37
37
|
negativeInParentheses: t.negativeStyle === "parentheses"
|
|
38
38
|
})
|
|
39
|
-
} : { value: e, text:
|
|
39
|
+
} : { value: e, text: xt(e, t, r) };
|
|
40
40
|
}
|
|
41
41
|
function be(e, t, r, n) {
|
|
42
42
|
return e === null ? { value: e, text: null } : n === "percent" ? {
|
|
@@ -81,7 +81,7 @@ function Fr(e, t) {
|
|
|
81
81
|
};
|
|
82
82
|
return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference = Q(
|
|
83
83
|
e.delta,
|
|
84
|
-
|
|
84
|
+
Ge(t.metricFormat),
|
|
85
85
|
t.locale
|
|
86
86
|
)), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = be(
|
|
87
87
|
e.percentChange,
|
|
@@ -95,19 +95,19 @@ function Fr(e, t) {
|
|
|
95
95
|
"ratio"
|
|
96
96
|
)), r;
|
|
97
97
|
}
|
|
98
|
-
const
|
|
99
|
-
function
|
|
98
|
+
const vt = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
|
|
99
|
+
function Ct(e) {
|
|
100
100
|
const { presentation: t } = e;
|
|
101
|
-
return e.formattedValues ? (t == null ? void 0 : t.kind) === "text" || (t == null ? void 0 : t.kind) === "measure" && t.format.type === "duration" ? "text" : (t == null ? void 0 : t.kind) === "temporal_bucket" ?
|
|
101
|
+
return e.formattedValues ? (t == null ? void 0 : t.kind) === "text" || (t == null ? void 0 : t.kind) === "measure" && t.format.type === "duration" ? "text" : (t == null ? void 0 : t.kind) === "temporal_bucket" ? vt.has(t.grain) ? "date" : "text" : (t == null ? void 0 : t.kind) === "datetime" ? "date" : e.dataType === "number" ? "number" : e.dataType === "boolean" ? "boolean" : e.dataType === "unknown" ? "by_value" : "text" : "by_value";
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const t = (o,
|
|
103
|
+
function _t(e) {
|
|
104
|
+
const t = (o, s) => Number.isInteger(o) ? Math.min(20, Math.max(0, o)) : s, r = t(e.minimumFractionDigits, 0), n = Math.max(r, t(e.maximumFractionDigits, 2));
|
|
105
105
|
return n === 0 ? "" : `.${"0".repeat(n)}`;
|
|
106
106
|
}
|
|
107
107
|
function ee(e) {
|
|
108
108
|
return `"${e.replace(/"/g, "")}"`;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Tt(e) {
|
|
111
111
|
let t;
|
|
112
112
|
try {
|
|
113
113
|
t = new Intl.NumberFormat(e.locale ?? "en-US", {
|
|
@@ -117,33 +117,33 @@ function _t(e) {
|
|
|
117
117
|
} catch {
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
const r = t.findIndex((
|
|
120
|
+
const r = t.findIndex((s) => s.type === "currency"), n = t.findIndex((s) => s.type === "integer");
|
|
121
121
|
if (r < 0 || n < 0) return;
|
|
122
|
-
const o = (
|
|
122
|
+
const o = (s, c) => t.slice(s, c).filter((l) => l.type === "literal").map((l) => l.value.replace(/\s/g, " ")).join("");
|
|
123
123
|
return r < n ? { side: "before", text: t[r].value + o(r + 1, n) } : {
|
|
124
124
|
side: "after",
|
|
125
125
|
text: o(n + 1, r) + t[r].value
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const t =
|
|
128
|
+
function Et(e) {
|
|
129
|
+
const t = _t(e);
|
|
130
130
|
let r;
|
|
131
131
|
if (e.type === "scientific")
|
|
132
132
|
r = `0${t}E+00`;
|
|
133
133
|
else {
|
|
134
134
|
const n = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
|
|
135
135
|
if (e.type === "currency") {
|
|
136
|
-
const o =
|
|
136
|
+
const o = Tt(e);
|
|
137
137
|
r = o ? o.side === "before" ? `${ee(o.text)}${n}` : `${n}${ee(o.text)}` : n;
|
|
138
138
|
} else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${ee("%")}` : `${n}%` : r = n;
|
|
139
139
|
}
|
|
140
140
|
return e.negativeStyle === "parentheses" ? `${r};(${r})` : r;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function St(e, t) {
|
|
143
143
|
if (!e.formattedValues) return;
|
|
144
144
|
const { presentation: r } = e;
|
|
145
145
|
if (t === "number" || t === "by_value")
|
|
146
|
-
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 :
|
|
146
|
+
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Et(r.format);
|
|
147
147
|
if (t === "date") {
|
|
148
148
|
if ((r == null ? void 0 : r.kind) === "temporal_bucket")
|
|
149
149
|
return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
|
|
@@ -152,7 +152,7 @@ function Et(e, t) {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
function ge(e) {
|
|
155
|
-
const t =
|
|
155
|
+
const t = Ct(e), r = St(e, t);
|
|
156
156
|
return Object.freeze({
|
|
157
157
|
key: e.key,
|
|
158
158
|
label: e.label,
|
|
@@ -160,9 +160,9 @@ function ge(e) {
|
|
|
160
160
|
...r === void 0 ? {} : { numberFormat: r }
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
const Ft = 15,
|
|
164
|
-
function
|
|
165
|
-
return
|
|
163
|
+
const Ft = 15, $t = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
164
|
+
function Ae(e) {
|
|
165
|
+
return $t.test(e) ? e : void 0;
|
|
166
166
|
}
|
|
167
167
|
function we(e) {
|
|
168
168
|
const r = e.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
|
|
@@ -170,7 +170,7 @@ function we(e) {
|
|
|
170
170
|
const n = Number(e);
|
|
171
171
|
return Number.isFinite(n) && (n !== 0 || r.length === 0);
|
|
172
172
|
}
|
|
173
|
-
const Pt = Date.UTC(1900, 2, 1),
|
|
173
|
+
const Pt = Date.UTC(1900, 2, 1), It = Date.UTC(1e4, 0, 1), Dt = Date.UTC(1899, 11, 30), Lt = 864e5;
|
|
174
174
|
function Mt(e) {
|
|
175
175
|
const t = Date.UTC(
|
|
176
176
|
e.year,
|
|
@@ -180,8 +180,8 @@ function Mt(e) {
|
|
|
180
180
|
e.minute,
|
|
181
181
|
e.second
|
|
182
182
|
);
|
|
183
|
-
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < Pt || t >=
|
|
184
|
-
return (t -
|
|
183
|
+
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < Pt || t >= It))
|
|
184
|
+
return (t - Dt) / Lt;
|
|
185
185
|
}
|
|
186
186
|
function xe(e, t, r) {
|
|
187
187
|
if (typeof e == "number")
|
|
@@ -189,7 +189,7 @@ function xe(e, t, r) {
|
|
|
189
189
|
if (j(e))
|
|
190
190
|
return we(e.value) ? { kind: "number", text: t, value: e } : void 0;
|
|
191
191
|
if (r && typeof e == "string") {
|
|
192
|
-
const n =
|
|
192
|
+
const n = Ae(e);
|
|
193
193
|
return n !== void 0 && we(n) ? { kind: "number", text: t, value: n } : void 0;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
@@ -201,8 +201,8 @@ function H(e) {
|
|
|
201
201
|
case "text":
|
|
202
202
|
return o;
|
|
203
203
|
case "date": {
|
|
204
|
-
const
|
|
205
|
-
return
|
|
204
|
+
const s = e.wallClock ? Mt(e.wallClock) : void 0;
|
|
205
|
+
return s === void 0 ? o : { kind: "date", text: r, serial: s };
|
|
206
206
|
}
|
|
207
207
|
case "number":
|
|
208
208
|
return xe(t, r, !0) ?? o;
|
|
@@ -212,14 +212,14 @@ function H(e) {
|
|
|
212
212
|
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : xe(t, r, !1) ?? o;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function $r(e) {
|
|
216
216
|
return e.kind === "empty" ? "" : e.text;
|
|
217
217
|
}
|
|
218
218
|
const Pr = {
|
|
219
219
|
rowLabels: "tabular",
|
|
220
220
|
subtotals: "after"
|
|
221
221
|
};
|
|
222
|
-
function
|
|
222
|
+
function Ir(e, t) {
|
|
223
223
|
const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, n = e.totals.rows;
|
|
224
224
|
return {
|
|
225
225
|
...e,
|
|
@@ -229,79 +229,79 @@ function $r(e, t) {
|
|
|
229
229
|
rows: {
|
|
230
230
|
...n,
|
|
231
231
|
levels: Object.fromEntries(
|
|
232
|
-
Object.entries(n.levels).map(([o,
|
|
232
|
+
Object.entries(n.levels).map(([o, s]) => [
|
|
233
233
|
o,
|
|
234
|
-
{ ...
|
|
234
|
+
{ ...s, position: t.subtotals }
|
|
235
235
|
])
|
|
236
236
|
)
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
function
|
|
241
|
+
const kt = 2;
|
|
242
|
+
function At(e) {
|
|
243
243
|
return typeof e == "number" ? Number.isInteger(e) : j(e) ? !e.value.includes(".") : !0;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Nt(e, t, r) {
|
|
246
246
|
const n = e.descriptors.measures.filter(
|
|
247
|
-
(
|
|
247
|
+
(c) => r.measureFormats[c.id] === void 0 && c.semanticFormat === void 0 && ct(c.column.dataType) === "number"
|
|
248
248
|
);
|
|
249
249
|
if (n.length === 0) return r;
|
|
250
250
|
const o = /* @__PURE__ */ new Set();
|
|
251
|
-
e.columns.forEach((
|
|
252
|
-
if (!(
|
|
251
|
+
e.columns.forEach((c, l) => {
|
|
252
|
+
if (!(c.kind !== "measure" || o.has(c.measureId)))
|
|
253
253
|
for (const f of t) {
|
|
254
|
-
const
|
|
255
|
-
if ((
|
|
256
|
-
o.add(
|
|
254
|
+
const d = f.values[l];
|
|
255
|
+
if ((d == null ? void 0 : d.kind) === "value" && !At(d.value)) {
|
|
256
|
+
o.add(c.measureId);
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
});
|
|
261
|
-
const
|
|
262
|
-
for (const { id:
|
|
263
|
-
const
|
|
264
|
-
|
|
261
|
+
const s = { ...r.measureFormats };
|
|
262
|
+
for (const { id: c } of n) {
|
|
263
|
+
const l = o.has(c) ? kt : 0;
|
|
264
|
+
s[c] = {
|
|
265
265
|
type: "number",
|
|
266
|
-
minimumFractionDigits:
|
|
267
|
-
maximumFractionDigits:
|
|
266
|
+
minimumFractionDigits: l,
|
|
267
|
+
maximumFractionDigits: l,
|
|
268
268
|
useGrouping: !0
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
return { ...r, measureFormats:
|
|
271
|
+
return { ...r, measureFormats: s };
|
|
272
272
|
}
|
|
273
273
|
function z(e) {
|
|
274
274
|
return q(e.slice(0, -1));
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Ot(e, t) {
|
|
277
277
|
return t.length > e.length && q(t.slice(0, e.length)) === q(e);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Rt(e) {
|
|
280
280
|
return e.map((t, r) => {
|
|
281
281
|
if (r === 0 || t.kind !== "layout") return !1;
|
|
282
282
|
const n = e[r - 1];
|
|
283
283
|
if (n.kind !== "layout") return !1;
|
|
284
|
-
if (t.role !== "member" ||
|
|
284
|
+
if (t.role !== "member" || Ot(n.rowPath, t.rowPath)) return !0;
|
|
285
285
|
const o = e[r - 2];
|
|
286
286
|
return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || z(o.rowPath) !== z(n.rowPath)) && t.rowPath.length === n.rowPath.length && z(t.rowPath) === z(n.rowPath);
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
289
|
+
const Ut = "pdf-group-continuation";
|
|
290
|
+
function Ne(e, t, r) {
|
|
291
291
|
return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || j(t.value)) ? e : Y(e);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
const n =
|
|
293
|
+
function Kt(e, t, r) {
|
|
294
|
+
const n = $e(e.descriptors, t.presentation, r), o = e.columns.map((u) => {
|
|
295
295
|
var a;
|
|
296
296
|
return u.kind === "measure" && ((a = n.measureSemantics.get(u.measureId)) == null ? void 0 : a.isNumeric) === !0;
|
|
297
|
-
}),
|
|
297
|
+
}), s = (u) => ae([u], n.levels), c = (u, a, m) => Pe(u, a, t.presentation.totals[m], n.levels), l = e.columns.map((u) => {
|
|
298
298
|
if (u.kind !== "measure") return u.label;
|
|
299
|
-
const a = u.columnPath.map(
|
|
300
|
-
return u.role !== "member" && a.push(
|
|
299
|
+
const a = u.columnPath.map(s);
|
|
300
|
+
return u.role !== "member" && a.push(c(u.columnPath, u.role, "columns")), [...a, u.label].join(" / ");
|
|
301
301
|
}), f = Math.min(t.spec.columns.length, Math.max(
|
|
302
302
|
0,
|
|
303
303
|
...e.columns.map((u) => u.kind === "measure" ? u.columnPath.length + (u.role !== "member" ? 1 : 0) : 0)
|
|
304
|
-
)),
|
|
304
|
+
)), d = Array.from({ length: f + 1 }, (u, a) => e.columns.map((m) => a === f ? m.label : m.kind !== "measure" ? "" : a < m.columnPath.length ? s(m.columnPath[a]) : a === m.columnPath.length && m.role !== "member" ? c(m.columnPath, m.role, "columns") : "")), b = (u, a) => Ye({
|
|
305
305
|
path: u.rowPath,
|
|
306
306
|
role: u.kind === "layout" ? u.role : "member",
|
|
307
307
|
levelCount: Math.max(1, t.spec.rows.length),
|
|
@@ -310,26 +310,26 @@ function Ut(e, t, r) {
|
|
|
310
310
|
}), w = (u, a) => {
|
|
311
311
|
if (u.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
|
|
312
312
|
if (u.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
313
|
-
const m =
|
|
314
|
-
return e.columns.map((
|
|
315
|
-
if (
|
|
316
|
-
return `${" ".repeat(Math.max(0, u.rowPath.length - 1))}${
|
|
317
|
-
if (
|
|
318
|
-
const x = t.spec.rows.findIndex((
|
|
319
|
-
return v != null && v.visible ? v.total ?
|
|
313
|
+
const m = b(u, a);
|
|
314
|
+
return e.columns.map((y, p) => {
|
|
315
|
+
if (y.kind === "hierarchy")
|
|
316
|
+
return `${" ".repeat(Math.max(0, u.rowPath.length - 1))}${c(u.rowPath, u.role, "rows")}`;
|
|
317
|
+
if (y.kind === "level") {
|
|
318
|
+
const x = t.spec.rows.findIndex(($) => $.id === y.levelId), v = m[x];
|
|
319
|
+
return v != null && v.visible ? v.total ? c(u.rowPath, u.role, "rows") : ae(v.path, n.levels) : "";
|
|
320
320
|
}
|
|
321
|
-
const C = u.values[
|
|
321
|
+
const C = u.values[p], g = n.measures.get(y.measureId);
|
|
322
322
|
if (C.kind === "value" && !g)
|
|
323
323
|
throw new Error("Matrix value is missing its measure descriptor.");
|
|
324
324
|
return Ie(C, g, t.presentation.absence);
|
|
325
325
|
});
|
|
326
|
-
}, T = (u, a) => w(u, a).map((m,
|
|
327
|
-
const
|
|
328
|
-
return
|
|
326
|
+
}, T = (u, a) => w(u, a).map((m, y) => {
|
|
327
|
+
const p = e.columns[y];
|
|
328
|
+
return p.kind === "measure" ? Ne(m, u.values[y], n.measureSemantics.get(p.measureId)) : Y(m);
|
|
329
329
|
});
|
|
330
330
|
return {
|
|
331
|
-
headers:
|
|
332
|
-
headerBands:
|
|
331
|
+
headers: l,
|
|
332
|
+
headerBands: d,
|
|
333
333
|
numericColumns: o,
|
|
334
334
|
/** The card's prepared formats this presentation formats with (the Excel form reads its measure formats). */
|
|
335
335
|
formatting: n,
|
|
@@ -342,14 +342,14 @@ function Ut(e, t, r) {
|
|
|
342
342
|
* above and below it.
|
|
343
343
|
*/
|
|
344
344
|
continuedColumns: (u, a) => {
|
|
345
|
-
const m = (
|
|
345
|
+
const m = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
|
|
346
346
|
if (!m(u) || !m(a)) return [];
|
|
347
|
-
const
|
|
348
|
-
return e.columns.flatMap((
|
|
347
|
+
const y = b(u, a);
|
|
348
|
+
return e.columns.flatMap((p, C) => {
|
|
349
349
|
var x;
|
|
350
|
-
if (
|
|
351
|
-
const g = t.spec.rows.findIndex((v) => v.id ===
|
|
352
|
-
return g < u.rowPath.length && ((x =
|
|
350
|
+
if (p.kind !== "level") return [];
|
|
351
|
+
const g = t.spec.rows.findIndex((v) => v.id === p.levelId);
|
|
352
|
+
return g < u.rowPath.length && ((x = y[g]) == null ? void 0 : x.visible) === !1 ? [C] : [];
|
|
353
353
|
});
|
|
354
354
|
},
|
|
355
355
|
csvRow: (u) => T(u),
|
|
@@ -360,80 +360,80 @@ function Ut(e, t, r) {
|
|
|
360
360
|
* formatter state or an earlier worker. Without it, the first row prints
|
|
361
361
|
* its labels.
|
|
362
362
|
*/
|
|
363
|
-
csvRows: (u, a) => u.map((m,
|
|
363
|
+
csvRows: (u, a) => u.map((m, y) => T(m, y ? u[y - 1] : a ?? void 0))
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Dr(e) {
|
|
367
367
|
return e.columns.map((t) => Y(t.label));
|
|
368
368
|
}
|
|
369
369
|
function Lr(e, t, r) {
|
|
370
|
-
return
|
|
371
|
-
const
|
|
372
|
-
return
|
|
370
|
+
return jt(e, t, r).map((n, o) => {
|
|
371
|
+
const s = t.columns[o];
|
|
372
|
+
return s.kind === "measure" ? Ne(n, e.values[o], r.measureSemantics.get(s.measureId)) : Y(n);
|
|
373
373
|
});
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function jt(e, t, r) {
|
|
376
376
|
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
377
377
|
if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
378
378
|
const n = [...e.rowPath, ...e.columnPath];
|
|
379
|
-
return t.columns.map((o,
|
|
379
|
+
return t.columns.map((o, s) => {
|
|
380
380
|
if (o.kind === "measure") {
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
383
|
-
return Ie(
|
|
381
|
+
const l = e.values[s], f = r.measures.get(o.measureId);
|
|
382
|
+
if (l.kind === "value" && !f) throw new Error("Matrix value is missing its measure descriptor.");
|
|
383
|
+
return Ie(l, f, r.absence);
|
|
384
384
|
}
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
387
|
-
return ae([
|
|
385
|
+
const c = o.kind === "level" ? n.find((l) => l.levelId === o.levelId) : void 0;
|
|
386
|
+
if (!c) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
387
|
+
return ae([c], r.levels);
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
const t =
|
|
392
|
-
index:
|
|
393
|
-
columnId: `matrix:${
|
|
394
|
-
label: t.headers[
|
|
395
|
-
isNumeric: t.numericColumns[
|
|
396
|
-
})), n = (
|
|
397
|
-
text:
|
|
390
|
+
function Vt(e) {
|
|
391
|
+
const t = Kt(e.layout, e.request, e.report), r = e.layout.columns.map((c, l) => ({
|
|
392
|
+
index: l,
|
|
393
|
+
columnId: `matrix:${l}`,
|
|
394
|
+
label: t.headers[l],
|
|
395
|
+
isNumeric: t.numericColumns[l]
|
|
396
|
+
})), n = (c, l, f) => ({
|
|
397
|
+
text: c,
|
|
398
398
|
colspan: 1,
|
|
399
399
|
rowspan: 1,
|
|
400
|
-
columnId: r[
|
|
400
|
+
columnId: r[l].columnId,
|
|
401
401
|
isHeader: f,
|
|
402
|
-
isNumeric: r[
|
|
403
|
-
className: r[
|
|
404
|
-
}), o = [],
|
|
405
|
-
e.request.spec.columns.length &&
|
|
402
|
+
isNumeric: r[l].isNumeric,
|
|
403
|
+
className: r[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
|
|
404
|
+
}), o = [], s = e.layout.columns.findIndex((c) => c.kind === "measure");
|
|
405
|
+
e.request.spec.columns.length && s >= 0 && o.push({
|
|
406
406
|
repeatHeader: !0,
|
|
407
407
|
headerType: "pivot-axis",
|
|
408
408
|
headerRowIndex: 0,
|
|
409
409
|
cells: [
|
|
410
|
-
...
|
|
410
|
+
...s ? [{ ...n("", 0, !0), colspan: s }] : [],
|
|
411
411
|
{
|
|
412
|
-
...n(e.request.spec.columns.map((
|
|
413
|
-
colspan: e.layout.columns.length -
|
|
412
|
+
...n(e.request.spec.columns.map((c) => De(c, e.request.presentation)).join(" / "), s, !0),
|
|
413
|
+
colspan: e.layout.columns.length - s,
|
|
414
414
|
isNumeric: !1,
|
|
415
415
|
className: ""
|
|
416
416
|
}
|
|
417
417
|
]
|
|
418
418
|
});
|
|
419
|
-
for (const [
|
|
419
|
+
for (const [c, l] of t.headerBands.entries())
|
|
420
420
|
o.push({
|
|
421
421
|
repeatHeader: !0,
|
|
422
|
-
headerType:
|
|
422
|
+
headerType: c === t.headerBands.length - 1 ? "metrics" : "pivot-level",
|
|
423
423
|
headerRowIndex: o.length,
|
|
424
|
-
cells:
|
|
424
|
+
cells: l.map((f, d) => n(f, d, !0))
|
|
425
425
|
});
|
|
426
426
|
return {
|
|
427
427
|
headers: o,
|
|
428
|
-
rows: e.rows.map((
|
|
429
|
-
const f = new Set(t.continuedColumns(
|
|
428
|
+
rows: e.rows.map((c, l) => {
|
|
429
|
+
const f = new Set(t.continuedColumns(c, e.rows[l - 1]));
|
|
430
430
|
return {
|
|
431
|
-
index:
|
|
432
|
-
type:
|
|
433
|
-
subtotalLevel: String(
|
|
431
|
+
index: l,
|
|
432
|
+
type: c.kind === "layout" && c.role !== "member" ? "subtotal" : "data",
|
|
433
|
+
subtotalLevel: String(c.rowPath.length),
|
|
434
434
|
// A tabular layout prints each label once unless it repeats them; the
|
|
435
435
|
// blank cell continues its group, so a grid draws no rule above it.
|
|
436
|
-
cells: t.row(
|
|
436
|
+
cells: t.row(c, e.rows[l - 1]).map((d, b) => f.has(b) ? { ...n(d, b, !1), className: Ut } : n(d, b, !1))
|
|
437
437
|
};
|
|
438
438
|
}),
|
|
439
439
|
grandTotal: null,
|
|
@@ -442,50 +442,50 @@ function jt(e) {
|
|
|
442
442
|
tableType: "pivot",
|
|
443
443
|
totalRows: e.rows.length,
|
|
444
444
|
totalColumns: r.length,
|
|
445
|
-
rowLevels: e.layout.columns.filter((
|
|
445
|
+
rowLevels: e.layout.columns.filter((c) => c.kind !== "measure").length,
|
|
446
446
|
pivotLevels: e.request.spec.columns.length,
|
|
447
447
|
hasGrandTotal: !1,
|
|
448
|
-
columnOrder: r.map((
|
|
448
|
+
columnOrder: r.map((c) => c.columnId),
|
|
449
449
|
columns: r
|
|
450
450
|
}
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
|
-
function
|
|
454
|
-
const { levels: n } =
|
|
455
|
-
if (
|
|
456
|
-
const w = o ? `${
|
|
457
|
-
let T =
|
|
458
|
-
return T < 0 && (T =
|
|
453
|
+
function Bt(e, t, r) {
|
|
454
|
+
const { levels: n } = $e(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, s = [], c = [], l = e.columns.map((d, b) => {
|
|
455
|
+
if (d.kind !== "measure") return null;
|
|
456
|
+
const w = o ? `${d.role}:${q(d.columnPath)}` : `measure:${b}`;
|
|
457
|
+
let T = s.indexOf(w);
|
|
458
|
+
return T < 0 && (T = s.push(w) - 1, c.push(o ? Pe(d.columnPath, d.role, t.presentation.totals.columns, n) : d.label)), T;
|
|
459
459
|
}), f = t.spec.columns[t.spec.columns.length - 1];
|
|
460
460
|
return {
|
|
461
|
-
columnGroups:
|
|
462
|
-
groupLabels:
|
|
461
|
+
columnGroups: l,
|
|
462
|
+
groupLabels: c,
|
|
463
463
|
/** What bands name their groups by: the innermost column level, or "Measures". */
|
|
464
|
-
groupLevelLabel: f ?
|
|
464
|
+
groupLevelLabel: f ? De(f, t.presentation) : "Measures"
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
467
|
function Mr(e) {
|
|
468
468
|
const { layout: t, rows: r, report: n } = e, o = {
|
|
469
469
|
...e.request,
|
|
470
|
-
presentation:
|
|
471
|
-
},
|
|
472
|
-
...
|
|
473
|
-
rows:
|
|
474
|
-
metadata: { ...
|
|
470
|
+
presentation: Nt(t, r, e.request.presentation)
|
|
471
|
+
}, s = Vt({ layout: t, rows: r, request: o, report: n }), c = Rt(r), l = Bt(t, o, n), f = {
|
|
472
|
+
...s,
|
|
473
|
+
rows: s.rows.map((d, b) => ({ ...d, keepWithPrevious: c[b] })),
|
|
474
|
+
metadata: { ...s.metadata, ...l }
|
|
475
475
|
};
|
|
476
|
-
return { request: o, table: f, ...
|
|
476
|
+
return { request: o, table: f, ...l };
|
|
477
477
|
}
|
|
478
|
-
const
|
|
479
|
-
function
|
|
478
|
+
const F = (e) => e.toLocaleString("en-US"), G = (e) => `${F(Math.ceil(e / 1048576))} MB`, te = "export the data as CSV or Excel";
|
|
479
|
+
function kr(e) {
|
|
480
480
|
const t = dt(e.facts), r = e.dataExport ? `Add a filter to narrow it, or ${te}.` : "Add a filter to narrow it, then export again.";
|
|
481
481
|
switch (e.code) {
|
|
482
482
|
case "PDF_ROW_LIMIT_EXCEEDED": {
|
|
483
483
|
const n = e.subject ?? "This table", o = t.rowLimit ?? k.maxTableRows;
|
|
484
|
-
return t.rowCount !== void 0 ? `${n} has ${
|
|
484
|
+
return t.rowCount !== void 0 ? `${n} has ${F(t.rowCount)} rows. A PDF holds up to ${F(o)} rows per table. ${r}` : `${n} has more than ${F(o)} rows, the most a PDF holds per table. ${r}`;
|
|
485
485
|
}
|
|
486
486
|
case "PDF_PAGE_LIMIT_EXCEEDED": {
|
|
487
487
|
const n = e.subject ?? "This PDF", o = t.pageLimit ?? k.maxPages;
|
|
488
|
-
return t.pageCount !== void 0 ? `${n} is ${
|
|
488
|
+
return t.pageCount !== void 0 ? `${n} is ${F(t.pageCount)} pages. A PDF holds up to ${F(o)}. ${r}` : `${n} is longer than ${F(o)} pages, the most a PDF holds. ${r}`;
|
|
489
489
|
}
|
|
490
490
|
case "PDF_SIZE_LIMIT_EXCEEDED": {
|
|
491
491
|
const n = e.subject ?? "This PDF", o = t.byteLimit ?? k.maxFileBytes;
|
|
@@ -493,21 +493,21 @@ function Dr(e) {
|
|
|
493
493
|
}
|
|
494
494
|
case "PDF_CAPTURE_TOO_TALL":
|
|
495
495
|
return `${e.subject ?? "This dashboard"} is too long to print as one PDF. Print one sheet or fewer cards${e.dataExport ? `, or ${te}` : ""}.`;
|
|
496
|
-
case
|
|
496
|
+
case ke:
|
|
497
497
|
return `A number in this table is too wide for its column in a PDF. Use landscape or fewer columns${e.dataExport ? `, or ${te}` : ""}.`;
|
|
498
498
|
case se:
|
|
499
|
-
return `This PDF is over what a PDF holds: ${
|
|
499
|
+
return `This PDF is over what a PDF holds: ${F(k.maxTableRows)} rows per table, ${F(
|
|
500
500
|
k.maxPages
|
|
501
501
|
)} pages and ${G(k.maxFileBytes)}. ${r}`;
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
class
|
|
504
|
+
class Ht extends Error {
|
|
505
505
|
constructor(t, r = se) {
|
|
506
506
|
super(t), this.code = r;
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
return ht(e) || e === se || e ===
|
|
509
|
+
function zt(e) {
|
|
510
|
+
return ht(e) || e === se || e === ke;
|
|
511
511
|
}
|
|
512
512
|
function ve(e) {
|
|
513
513
|
if (!e || typeof e != "object")
|
|
@@ -517,21 +517,21 @@ function ve(e) {
|
|
|
517
517
|
if (typeof o == "string" && o.trim())
|
|
518
518
|
return o.trim();
|
|
519
519
|
}
|
|
520
|
-
async function
|
|
520
|
+
async function Gt(e) {
|
|
521
521
|
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
|
|
522
522
|
try {
|
|
523
523
|
if (r.includes("application/json")) {
|
|
524
|
-
const o = await e.json(),
|
|
525
|
-
return { message: ve(o) || t, code:
|
|
524
|
+
const o = await e.json(), s = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
|
|
525
|
+
return { message: ve(o) || t, code: s };
|
|
526
526
|
}
|
|
527
527
|
const n = await e.text();
|
|
528
528
|
if (!n.trim())
|
|
529
529
|
return { message: t };
|
|
530
530
|
try {
|
|
531
|
-
const o = JSON.parse(n),
|
|
531
|
+
const o = JSON.parse(n), s = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
|
|
532
532
|
return {
|
|
533
533
|
message: ve(o) || n.trim(),
|
|
534
|
-
code:
|
|
534
|
+
code: s
|
|
535
535
|
};
|
|
536
536
|
} catch {
|
|
537
537
|
return { message: n.trim() };
|
|
@@ -540,7 +540,7 @@ async function zt(e) {
|
|
|
540
540
|
return { message: t };
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
async function
|
|
543
|
+
async function Ar(e) {
|
|
544
544
|
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
545
545
|
if (ft(e.serializedPayload) > pt.maxRequestBytes)
|
|
546
546
|
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
@@ -551,8 +551,8 @@ async function kr(e) {
|
|
|
551
551
|
signal: e.signal
|
|
552
552
|
});
|
|
553
553
|
if (!t.ok) {
|
|
554
|
-
const n = await
|
|
555
|
-
throw
|
|
554
|
+
const n = await Gt(t);
|
|
555
|
+
throw zt(n.code) ? new Ht(n.message, n.code) : new Error(n.message);
|
|
556
556
|
}
|
|
557
557
|
const r = await t.json();
|
|
558
558
|
if (r != null && r.error) throw new Error(r.error);
|
|
@@ -560,7 +560,7 @@ async function kr(e) {
|
|
|
560
560
|
throw new Error("Fast-path PDF response missing download URL");
|
|
561
561
|
return r;
|
|
562
562
|
}
|
|
563
|
-
const
|
|
563
|
+
const Nr = 1, Oe = ["loading", "measuring", "checking", "laidOut"], qt = [
|
|
564
564
|
// Already emitted before these contracts; names kept.
|
|
565
565
|
"document_matrix_too_large",
|
|
566
566
|
"document_matrix_unavailable",
|
|
@@ -580,20 +580,20 @@ const Ar = 1, Ae = ["loading", "measuring", "checking", "laidOut"], Gt = [
|
|
|
580
580
|
// PDF capacity contract PC-D3: more pages than one PDF holds.
|
|
581
581
|
"document_page_limit_exceeded"
|
|
582
582
|
];
|
|
583
|
-
function
|
|
584
|
-
return
|
|
583
|
+
function Or(e) {
|
|
584
|
+
return qt.includes(e);
|
|
585
585
|
}
|
|
586
|
-
const
|
|
586
|
+
const Xt = 64, Yt = 120, Wt = 3, Zt = 80, Jt = [...Oe, "noPageStack", "unknown"];
|
|
587
587
|
function re(e, t) {
|
|
588
588
|
return typeof e != "string" ? void 0 : e.trim().slice(0, t).trim() || void 0;
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function S(e, t) {
|
|
591
591
|
return typeof e == "number" && Number.isInteger(e) && e >= t ? e : void 0;
|
|
592
592
|
}
|
|
593
593
|
function ne(e, t) {
|
|
594
594
|
return t.includes(e) ? e : void 0;
|
|
595
595
|
}
|
|
596
|
-
function
|
|
596
|
+
function Qt(e) {
|
|
597
597
|
let t = e;
|
|
598
598
|
if (typeof e == "string")
|
|
599
599
|
try {
|
|
@@ -602,29 +602,29 @@ function Zt(e) {
|
|
|
602
602
|
return {};
|
|
603
603
|
}
|
|
604
604
|
if (!t || typeof t != "object" || Array.isArray(t)) return {};
|
|
605
|
-
const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((
|
|
606
|
-
sectionId: re(r.sectionId,
|
|
607
|
-
sectionTitle: re(r.sectionTitle,
|
|
608
|
-
pageNumber:
|
|
609
|
-
rowCount:
|
|
610
|
-
rowLimit:
|
|
605
|
+
const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((s) => re(s, Zt)).filter((s) => s !== void 0).slice(0, Wt) : [], o = {
|
|
606
|
+
sectionId: re(r.sectionId, Xt),
|
|
607
|
+
sectionTitle: re(r.sectionTitle, Yt),
|
|
608
|
+
pageNumber: S(r.pageNumber, 1),
|
|
609
|
+
rowCount: S(r.rowCount, 0),
|
|
610
|
+
rowLimit: S(r.rowLimit, 1),
|
|
611
611
|
inputLabels: n.length ? n : void 0,
|
|
612
612
|
overflowAxis: ne(r.overflowAxis, ["height", "width"]),
|
|
613
|
-
overflowPx:
|
|
613
|
+
overflowPx: S(r.overflowPx, 0),
|
|
614
614
|
matrixLimit: ne(r.matrixLimit, ["rows", "bytes"]),
|
|
615
615
|
layoutStage: ne(r.layoutStage, Jt),
|
|
616
|
-
loadingSectionCount:
|
|
617
|
-
measuredRowCount:
|
|
618
|
-
totalRowCount:
|
|
619
|
-
pageCount:
|
|
620
|
-
pageLimit:
|
|
616
|
+
loadingSectionCount: S(r.loadingSectionCount, 0),
|
|
617
|
+
measuredRowCount: S(r.measuredRowCount, 0),
|
|
618
|
+
totalRowCount: S(r.totalRowCount, 0),
|
|
619
|
+
pageCount: S(r.pageCount, 0),
|
|
620
|
+
pageLimit: S(r.pageLimit, 1)
|
|
621
621
|
};
|
|
622
622
|
return Object.fromEntries(
|
|
623
|
-
Object.entries(o).filter(([,
|
|
623
|
+
Object.entries(o).filter(([, s]) => s !== void 0)
|
|
624
624
|
);
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
const t =
|
|
626
|
+
function Rr(e) {
|
|
627
|
+
const t = Qt(e.facts), r = t.sectionTitle ? `Section "${t.sectionTitle}"` : t.sectionId ? `Section ${t.sectionId}` : "A section", n = t.pageNumber !== void 0 ? ` on page ${t.pageNumber}` : "";
|
|
628
628
|
switch (e.code) {
|
|
629
629
|
case "document_section_setup":
|
|
630
630
|
return `${r} is not set up to print.`;
|
|
@@ -664,13 +664,13 @@ function Or(e) {
|
|
|
664
664
|
].join("");
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
-
function
|
|
668
|
-
return
|
|
667
|
+
function er(e) {
|
|
668
|
+
return Oe.includes(e);
|
|
669
669
|
}
|
|
670
670
|
function oe(e) {
|
|
671
671
|
return typeof e == "number" && Number.isInteger(e) && e >= 0;
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function Ur(e) {
|
|
674
674
|
let t = e;
|
|
675
675
|
if (typeof e == "string")
|
|
676
676
|
try {
|
|
@@ -679,28 +679,81 @@ function Rr(e) {
|
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
681
681
|
if (!t || typeof t != "object" || Array.isArray(t)) return;
|
|
682
|
-
const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount:
|
|
683
|
-
if (!(!
|
|
684
|
-
return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount:
|
|
682
|
+
const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: s } = t;
|
|
683
|
+
if (!(!er(r) || !oe(n) || o !== null && !oe(o) || s !== null && !oe(s)))
|
|
684
|
+
return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: s };
|
|
685
|
+
}
|
|
686
|
+
function Kr(e, t, r) {
|
|
687
|
+
const n = t.from > e.start ? t.from : e.start, o = t.to && t.to < e.end ? t.to : e.end, s = o > r ? "running" : n > e.start ? "start" : o < e.end ? "end" : void 0;
|
|
688
|
+
return { start: n, end: o, ...s ? { partial: s } : {} };
|
|
689
|
+
}
|
|
690
|
+
function jr(e, t, r) {
|
|
691
|
+
switch (t) {
|
|
692
|
+
case "running":
|
|
693
|
+
return `${e} (so far)`;
|
|
694
|
+
case "start":
|
|
695
|
+
return r ? `${e} (from ${r.start})` : `${e} (partial)`;
|
|
696
|
+
case "end":
|
|
697
|
+
return r ? `${e} (to ${r.end})` : `${e} (partial)`;
|
|
698
|
+
default:
|
|
699
|
+
return e;
|
|
700
|
+
}
|
|
685
701
|
}
|
|
686
|
-
function
|
|
702
|
+
function Vr(e, t, r) {
|
|
703
|
+
const n = Date.parse(e.startInclusive), o = Date.parse(e.endExclusive);
|
|
704
|
+
if (!Number.isFinite(n) || !Number.isFinite(o)) return;
|
|
705
|
+
if (t.granularity === "hour" || t.granularity === "minute" || t.granularity === "second") {
|
|
706
|
+
const f = (d) => {
|
|
707
|
+
try {
|
|
708
|
+
return new Intl.DateTimeFormat((r == null ? void 0 : r.locale) ?? "en-US", {
|
|
709
|
+
timeStyle: (r == null ? void 0 : r.dateTime.timeStyle) ?? "short",
|
|
710
|
+
timeZone: t.calendar.tz
|
|
711
|
+
}).format(new Date(d));
|
|
712
|
+
} catch {
|
|
713
|
+
return new Date(d).toISOString();
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
return { start: f(n), end: f(o) };
|
|
717
|
+
}
|
|
718
|
+
const s = { kind: "temporal_bucket", granularity: "day", calendar: t.calendar };
|
|
719
|
+
let c;
|
|
720
|
+
try {
|
|
721
|
+
c = Le({
|
|
722
|
+
metadata: s,
|
|
723
|
+
locale: (r == null ? void 0 : r.locale) ?? "en-US",
|
|
724
|
+
...r ? { styles: { dateStyle: r.dateStyle, dateTime: r.dateTime } } : {}
|
|
725
|
+
});
|
|
726
|
+
} catch {
|
|
727
|
+
c = void 0;
|
|
728
|
+
}
|
|
729
|
+
const l = (f) => {
|
|
730
|
+
const d = bt(new Date(f), t.calendar.tz), b = `${String(d.year).padStart(4, "0")}-${String(d.month).padStart(2, "0")}-${String(d.day).padStart(2, "0")}`;
|
|
731
|
+
try {
|
|
732
|
+
return c ? Me({ value: b, metadata: s, format: c.format }) : b;
|
|
733
|
+
} catch {
|
|
734
|
+
return b;
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
return { start: l(n), end: l(o - 1) };
|
|
738
|
+
}
|
|
739
|
+
function tr(e, t) {
|
|
687
740
|
return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === void 0;
|
|
688
741
|
}
|
|
689
|
-
function
|
|
742
|
+
function Re(e) {
|
|
690
743
|
return new Map(
|
|
691
744
|
e.presentationExecutionSnapshot.resolvedFormats.flatMap(
|
|
692
|
-
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" &&
|
|
745
|
+
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" && tr(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
|
|
693
746
|
)
|
|
694
747
|
);
|
|
695
748
|
}
|
|
696
|
-
function
|
|
749
|
+
function Ue(e) {
|
|
697
750
|
const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
|
|
698
751
|
return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
|
|
699
752
|
}
|
|
700
|
-
function
|
|
701
|
-
return e.formatting.useFormattedValues !== !1 &&
|
|
753
|
+
function Br(e) {
|
|
754
|
+
return e.formatting.useFormattedValues !== !1 && Ue(e.queryPayload) && Re(e.formatting).size > 0;
|
|
702
755
|
}
|
|
703
|
-
function
|
|
756
|
+
function rr(e, t) {
|
|
704
757
|
return e.map((r, n) => {
|
|
705
758
|
if (!Object.prototype.hasOwnProperty.call(r, t) || r[t] === void 0)
|
|
706
759
|
throw new Error(
|
|
@@ -710,52 +763,52 @@ function tr(e, t) {
|
|
|
710
763
|
return o === null || typeof o == "string" ? o : String(o);
|
|
711
764
|
});
|
|
712
765
|
}
|
|
713
|
-
function
|
|
766
|
+
function nr(e) {
|
|
714
767
|
if (e.formatting.useFormattedValues === !1)
|
|
715
768
|
return {
|
|
716
769
|
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
717
770
|
byColumnKey: /* @__PURE__ */ new Map()
|
|
718
771
|
};
|
|
719
|
-
const t =
|
|
772
|
+
const t = Re(e.formatting), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
|
|
720
773
|
if (t.size === 0)
|
|
721
774
|
return { activatedColumnKeys: r, byColumnKey: n };
|
|
722
775
|
const o = new Map(
|
|
723
|
-
e.columns.flatMap((
|
|
724
|
-
const f =
|
|
725
|
-
return f ? [[f,
|
|
776
|
+
e.columns.flatMap((l) => {
|
|
777
|
+
const f = l.key || l.field;
|
|
778
|
+
return f ? [[f, l]] : [];
|
|
726
779
|
})
|
|
727
|
-
),
|
|
728
|
-
for (const [
|
|
729
|
-
const
|
|
730
|
-
let
|
|
731
|
-
if (
|
|
732
|
-
|
|
780
|
+
), s = Ue(e.queryPayload), c = /* @__PURE__ */ new Map();
|
|
781
|
+
for (const [l, f] of t) {
|
|
782
|
+
const d = o.get(l);
|
|
783
|
+
let b;
|
|
784
|
+
if (d != null && d.rawTemporal)
|
|
785
|
+
b = yt(d, {
|
|
733
786
|
metadataRequired: !0
|
|
734
|
-
}), r.add(
|
|
735
|
-
else if (
|
|
736
|
-
r.add(
|
|
737
|
-
const w =
|
|
738
|
-
columnKey:
|
|
739
|
-
values:
|
|
787
|
+
}), r.add(l);
|
|
788
|
+
else if (s) {
|
|
789
|
+
r.add(l);
|
|
790
|
+
const w = We({
|
|
791
|
+
columnKey: l,
|
|
792
|
+
values: rr(e.records, l)
|
|
740
793
|
});
|
|
741
|
-
|
|
794
|
+
c.set(l, w), w.status === "classified" && (b = w.metadata);
|
|
742
795
|
} else
|
|
743
796
|
continue;
|
|
744
|
-
|
|
745
|
-
metadata:
|
|
797
|
+
b && n.set(l, {
|
|
798
|
+
metadata: b,
|
|
746
799
|
format: f,
|
|
747
|
-
formatValue:
|
|
800
|
+
formatValue: Ze({ metadata: b, format: f })
|
|
748
801
|
});
|
|
749
802
|
}
|
|
750
803
|
return {
|
|
751
804
|
activatedColumnKeys: r,
|
|
752
805
|
byColumnKey: n,
|
|
753
|
-
...
|
|
754
|
-
sqlChunkEvidence:
|
|
806
|
+
...s ? {
|
|
807
|
+
sqlChunkEvidence: Je(c)
|
|
755
808
|
} : {}
|
|
756
809
|
};
|
|
757
810
|
}
|
|
758
|
-
function
|
|
811
|
+
function or(e) {
|
|
759
812
|
if (!e.resolution.activatedColumnKeys.has(e.columnKey))
|
|
760
813
|
return;
|
|
761
814
|
if (e.value === void 0)
|
|
@@ -774,7 +827,7 @@ function Ce(e, t) {
|
|
|
774
827
|
const r = e.byColumnKey.get(t);
|
|
775
828
|
return r ? r.metadata.valueKind === "date" : void 0;
|
|
776
829
|
}
|
|
777
|
-
const
|
|
830
|
+
const ar = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), sr = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, ir = /^\d{4}-\d{2}-\d{2}$/, Ke = "MM/dd/yyyy";
|
|
778
831
|
function X(e) {
|
|
779
832
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
780
833
|
}
|
|
@@ -791,12 +844,12 @@ function Te(e, t) {
|
|
|
791
844
|
return X(r.dateFormat) ? r.dateFormat : {};
|
|
792
845
|
}
|
|
793
846
|
function Ee(e) {
|
|
794
|
-
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format ||
|
|
847
|
+
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || Ke;
|
|
795
848
|
}
|
|
796
|
-
function
|
|
849
|
+
function Se(e, t) {
|
|
797
850
|
return e && e !== "auto" ? e : t;
|
|
798
851
|
}
|
|
799
|
-
function
|
|
852
|
+
function lr(e) {
|
|
800
853
|
return !/[HhKkmsSa]/.test(e.replace(/'[^']*'/g, ""));
|
|
801
854
|
}
|
|
802
855
|
function cr(e) {
|
|
@@ -805,8 +858,8 @@ function cr(e) {
|
|
|
805
858
|
const t = Number(e);
|
|
806
859
|
return Number.isFinite(t) ? t : null;
|
|
807
860
|
}
|
|
808
|
-
function
|
|
809
|
-
const t =
|
|
861
|
+
function ur(e) {
|
|
862
|
+
const t = Ae(e);
|
|
810
863
|
if (t !== void 0)
|
|
811
864
|
try {
|
|
812
865
|
return ut(t, /[.eE]/.test(t) ? "decimal" : "integer");
|
|
@@ -814,42 +867,42 @@ function lr(e) {
|
|
|
814
867
|
return;
|
|
815
868
|
}
|
|
816
869
|
}
|
|
817
|
-
function
|
|
870
|
+
function mr(e) {
|
|
818
871
|
return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
|
|
819
872
|
}
|
|
820
|
-
function
|
|
821
|
-
const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope,
|
|
822
|
-
function
|
|
823
|
-
var
|
|
824
|
-
if ((
|
|
825
|
-
const m = a.columns.map(R).filter((
|
|
873
|
+
function Hr(e) {
|
|
874
|
+
const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, s = (a) => Qe({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } }), c = (a) => et({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } });
|
|
875
|
+
function l(a) {
|
|
876
|
+
var y;
|
|
877
|
+
if ((y = t.visibleColumns) != null && y.length) return t.visibleColumns;
|
|
878
|
+
const m = a.columns.map(R).filter((p) => !!p);
|
|
826
879
|
return m.length > 0 ? m : a.records[0] ? Object.keys(a.records[0]) : [];
|
|
827
880
|
}
|
|
828
881
|
function f(a, m) {
|
|
829
|
-
return t.columnLabels && Object.prototype.hasOwnProperty.call(t.columnLabels, a) && t.columnLabels[a] || void 0 ||
|
|
882
|
+
return t.columnLabels && Object.prototype.hasOwnProperty.call(t.columnLabels, a) && t.columnLabels[a] || void 0 || d(m) || (m == null ? void 0 : m.label) || (m == null ? void 0 : m.headerName) || a;
|
|
830
883
|
}
|
|
831
|
-
function
|
|
832
|
-
const
|
|
833
|
-
if (!
|
|
834
|
-
const
|
|
835
|
-
return
|
|
836
|
-
members:
|
|
884
|
+
function d(a, m) {
|
|
885
|
+
const y = a == null ? void 0 : a.pivotIdentity;
|
|
886
|
+
if (!y || !y.members || y.members.length === 0) return;
|
|
887
|
+
const p = he({ identity: y, columnKey: (a == null ? void 0 : a.key) || (a == null ? void 0 : a.field) || "" });
|
|
888
|
+
return gt({
|
|
889
|
+
members: p,
|
|
837
890
|
metricLabel: (a == null ? void 0 : a.label) || (a == null ? void 0 : a.headerName),
|
|
838
891
|
mode: n ? "formatted" : "canonical",
|
|
839
892
|
resolveTemporalFormat: (C) => {
|
|
840
|
-
const g =
|
|
893
|
+
const g = p.find((v) => v.fieldId === C);
|
|
841
894
|
if (!(g != null && g.temporalBucket)) return;
|
|
842
895
|
const x = de({
|
|
843
896
|
snapshot: t.presentationExecutionSnapshot,
|
|
844
897
|
scope: o,
|
|
845
898
|
target: { kind: "field", fieldId: C, role: "pivotby" }
|
|
846
899
|
});
|
|
847
|
-
return x ?
|
|
900
|
+
return x ? b(g.temporalBucket, x) : void 0;
|
|
848
901
|
}
|
|
849
902
|
}).flattenedLabel;
|
|
850
903
|
}
|
|
851
|
-
function
|
|
852
|
-
return
|
|
904
|
+
function b(a, m) {
|
|
905
|
+
return Le({
|
|
853
906
|
metadata: a,
|
|
854
907
|
cardFormat: m,
|
|
855
908
|
locale: m.locale,
|
|
@@ -857,152 +910,152 @@ function Kr(e) {
|
|
|
857
910
|
}).format;
|
|
858
911
|
}
|
|
859
912
|
function w(a, m) {
|
|
860
|
-
const { records:
|
|
861
|
-
(
|
|
913
|
+
const { records: y, columns: p } = a, C = X(r.cardConfig) ? r.cardConfig : void 0, g = C == null ? void 0 : C.pivotByColumns, x = Array.isArray(g) ? g.flatMap(
|
|
914
|
+
(i) => X(i) && typeof i.id == "string" && i.id ? [i.id] : []
|
|
862
915
|
) : [];
|
|
863
|
-
|
|
864
|
-
|
|
916
|
+
wt(
|
|
917
|
+
p.map((i) => ({ key: R(i) || "<unknown>", pivotIdentity: i.pivotIdentity })),
|
|
865
918
|
{ expectedPivotFieldIds: x }
|
|
866
919
|
);
|
|
867
|
-
const v =
|
|
868
|
-
|
|
869
|
-
const
|
|
870
|
-
return
|
|
920
|
+
const v = l(a), $ = new Map(
|
|
921
|
+
p.flatMap((i) => {
|
|
922
|
+
const h = R(i);
|
|
923
|
+
return h ? [[h, i]] : [];
|
|
871
924
|
})
|
|
872
|
-
),
|
|
873
|
-
records:
|
|
874
|
-
columns:
|
|
925
|
+
), Be = new Map(a.resultColumns.map((i) => [i.key, i.dataType])), L = nr({
|
|
926
|
+
records: y,
|
|
927
|
+
columns: p,
|
|
875
928
|
formatting: t,
|
|
876
929
|
queryPayload: r
|
|
877
930
|
}), W = new Map(
|
|
878
|
-
|
|
879
|
-
const
|
|
880
|
-
return
|
|
931
|
+
p.flatMap((i) => {
|
|
932
|
+
const h = R(i);
|
|
933
|
+
return h && i.temporalBucket ? [[h, i.temporalBucket]] : [];
|
|
881
934
|
})
|
|
882
|
-
),
|
|
883
|
-
for (const
|
|
884
|
-
const
|
|
935
|
+
), le = /* @__PURE__ */ new Map();
|
|
936
|
+
for (const i of v) {
|
|
937
|
+
const h = de({
|
|
885
938
|
snapshot: t.presentationExecutionSnapshot,
|
|
886
939
|
scope: o,
|
|
887
|
-
target: { kind: "column", columnKey:
|
|
888
|
-
}), _ = W.get(
|
|
940
|
+
target: { kind: "column", columnKey: i }
|
|
941
|
+
}), _ = W.get(i);
|
|
889
942
|
if (n) {
|
|
890
|
-
if (
|
|
891
|
-
if (_ && !
|
|
943
|
+
if (h && !_) throw new Error(`Missing temporal bucket metadata for column "${i}"`);
|
|
944
|
+
if (_ && !h) throw new Error(`Missing resolved temporal presentation for column "${i}"`);
|
|
892
945
|
}
|
|
893
|
-
|
|
946
|
+
h && _ && le.set(i, b(_, h));
|
|
894
947
|
}
|
|
895
|
-
const
|
|
896
|
-
const
|
|
948
|
+
const Z = v.map((i) => {
|
|
949
|
+
const h = Be.get(i), _ = h && ar.has(h) ? h : "unknown", E = n ? T(i, L, W) : void 0, D = f(i, $.get(i)), A = n && L.activatedColumnKeys.has(i) && Ce(L, i) === void 0;
|
|
897
950
|
return {
|
|
898
|
-
key:
|
|
899
|
-
label:
|
|
951
|
+
key: i,
|
|
952
|
+
label: D,
|
|
900
953
|
dataType: _,
|
|
901
954
|
...E ? { presentation: E } : {},
|
|
902
|
-
xlsx: ge({ key:
|
|
955
|
+
xlsx: ge({ key: i, label: D, formattedValues: n, dataType: _, presentation: E }),
|
|
903
956
|
...A ? { xlsxPending: !0 } : {}
|
|
904
957
|
};
|
|
905
958
|
});
|
|
906
|
-
function
|
|
907
|
-
if (!n) return { text: _e(
|
|
908
|
-
const
|
|
909
|
-
if (
|
|
910
|
-
const A = W.get(
|
|
959
|
+
function He(i, h, _, E) {
|
|
960
|
+
if (!n) return { text: _e(i), value: i };
|
|
961
|
+
const D = or({ value: i, columnKey: h, rowIndex: _, resolution: L });
|
|
962
|
+
if (D !== void 0) return { text: D.text, value: i, ...D.wallClock ? { wallClock: D.wallClock } : {} };
|
|
963
|
+
const A = W.get(h);
|
|
911
964
|
if (A) {
|
|
912
|
-
const
|
|
913
|
-
if (
|
|
914
|
-
if (
|
|
915
|
-
throw new Error(`Canonical temporal column "${
|
|
916
|
-
const N =
|
|
965
|
+
const P = le.get(h);
|
|
966
|
+
if (!P) throw new Error(`Missing resolved temporal presentation for column "${h}"`);
|
|
967
|
+
if (i != null && typeof i != "string")
|
|
968
|
+
throw new Error(`Canonical temporal column "${h}" must contain a string or null`);
|
|
969
|
+
const N = i ?? null, O = tt(N, A);
|
|
917
970
|
return {
|
|
918
|
-
text:
|
|
919
|
-
value:
|
|
971
|
+
text: Me({ value: N, metadata: A, format: P }),
|
|
972
|
+
value: i,
|
|
920
973
|
...O ? { wallClock: O } : {}
|
|
921
974
|
};
|
|
922
975
|
}
|
|
923
|
-
if (
|
|
924
|
-
const
|
|
925
|
-
if (
|
|
976
|
+
if (i == null) return { text: "", value: i };
|
|
977
|
+
const J = c(h);
|
|
978
|
+
if (J && typeof i == "number" && Number.isFinite(i))
|
|
926
979
|
return {
|
|
927
980
|
text: fe(
|
|
928
|
-
new Date(
|
|
929
|
-
|
|
930
|
-
|
|
981
|
+
new Date(i).toISOString(),
|
|
982
|
+
J.pattern || Ke,
|
|
983
|
+
Se(J.timezone, t.timezone),
|
|
931
984
|
"UTC"
|
|
932
985
|
),
|
|
933
|
-
value:
|
|
986
|
+
value: i
|
|
934
987
|
};
|
|
935
|
-
const
|
|
936
|
-
if (typeof
|
|
937
|
-
return { text:
|
|
938
|
-
if (j(
|
|
939
|
-
return { text:
|
|
940
|
-
const V = Te(t,
|
|
941
|
-
if (V && (
|
|
942
|
-
const
|
|
988
|
+
const M = s(h);
|
|
989
|
+
if (typeof i == "number")
|
|
990
|
+
return { text: M ? B(i, M) : String(i), value: i };
|
|
991
|
+
if (j(i))
|
|
992
|
+
return { text: M ? B(i, M) : i.value, value: i };
|
|
993
|
+
const V = Te(t, h);
|
|
994
|
+
if (V && (i instanceof Date || typeof i == "string" && sr.test(i))) {
|
|
995
|
+
const P = i instanceof Date ? i.toISOString() : i, N = typeof i == "string" && ir.test(i), O = N ? "UTC" : Se(V.timezone, t.timezone), ue = N ? "UTC" : V.sourceTimezone || "auto", me = rt(P, O, ue);
|
|
943
996
|
return {
|
|
944
|
-
text: fe(
|
|
945
|
-
value:
|
|
997
|
+
text: fe(P, Ee(V), O, ue),
|
|
998
|
+
value: i,
|
|
946
999
|
...me ? { wallClock: me } : {}
|
|
947
1000
|
};
|
|
948
1001
|
}
|
|
949
|
-
if (typeof
|
|
950
|
-
const
|
|
951
|
-
if (
|
|
1002
|
+
if (typeof i == "string" && M && E.dataType === "number") {
|
|
1003
|
+
const P = ur(i);
|
|
1004
|
+
if (P) return { text: B(P, M), value: i };
|
|
952
1005
|
}
|
|
953
|
-
return { text: _e(
|
|
1006
|
+
return { text: _e(i), value: i };
|
|
954
1007
|
}
|
|
955
|
-
const
|
|
956
|
-
(
|
|
957
|
-
const E =
|
|
1008
|
+
const ze = y.map(
|
|
1009
|
+
(i, h) => Z.map((_) => {
|
|
1010
|
+
const E = He(i[_.key], _.key, h, _);
|
|
958
1011
|
return H({ value: E.value, text: E.text, column: _.xlsx, wallClock: E.wallClock });
|
|
959
1012
|
})
|
|
960
|
-
),
|
|
961
|
-
if (
|
|
962
|
-
for (const
|
|
963
|
-
const
|
|
964
|
-
|
|
1013
|
+
), ce = (m == null ? void 0 : m.withHeader) !== !1 && t.includeHeaders;
|
|
1014
|
+
if (ce)
|
|
1015
|
+
for (const i of v) {
|
|
1016
|
+
const h = $.get(i);
|
|
1017
|
+
h != null && h.pivotIdentity && he({ identity: h.pivotIdentity, columnKey: R(h) || i });
|
|
965
1018
|
}
|
|
966
1019
|
return {
|
|
967
|
-
...
|
|
968
|
-
columns:
|
|
969
|
-
rows:
|
|
970
|
-
...
|
|
1020
|
+
...ce ? { header: Z.map((i) => i.label) } : {},
|
|
1021
|
+
columns: Z,
|
|
1022
|
+
rows: ze,
|
|
1023
|
+
...L.sqlChunkEvidence ? { rawTemporalClassification: L.sqlChunkEvidence } : {}
|
|
971
1024
|
};
|
|
972
1025
|
}
|
|
973
|
-
function T(a, m,
|
|
1026
|
+
function T(a, m, y) {
|
|
974
1027
|
if (m.activatedColumnKeys.has(a)) {
|
|
975
1028
|
const x = Ce(m, a);
|
|
976
1029
|
return x === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: x };
|
|
977
1030
|
}
|
|
978
|
-
const
|
|
979
|
-
if (
|
|
980
|
-
if (
|
|
1031
|
+
const p = y.get(a);
|
|
1032
|
+
if (p) return { kind: "temporal_bucket", grain: mr(p) };
|
|
1033
|
+
if (c(a)) return { kind: "text" };
|
|
981
1034
|
const C = Te(t, a);
|
|
982
|
-
if (C) return { kind: "datetime", dateOnly:
|
|
983
|
-
const g =
|
|
1035
|
+
if (C) return { kind: "datetime", dateOnly: lr(Ee(C)) };
|
|
1036
|
+
const g = s(a);
|
|
984
1037
|
return g ? { kind: "measure", format: g } : void 0;
|
|
985
1038
|
}
|
|
986
1039
|
function u(a, m) {
|
|
987
1040
|
if (!Number.isInteger(m) || m < 0)
|
|
988
1041
|
throw new Error("totalRows must be a non-negative integer");
|
|
989
|
-
return m === 0 ? void 0 : (t.visibleColumns ?? Object.keys(a)).map((
|
|
990
|
-
const g = Object.prototype.hasOwnProperty.call(a,
|
|
991
|
-
key:
|
|
992
|
-
label:
|
|
1042
|
+
return m === 0 ? void 0 : (t.visibleColumns ?? Object.keys(a)).map((p) => {
|
|
1043
|
+
const g = Object.prototype.hasOwnProperty.call(a, p) ? a[p] : p === t.tableTotalsLabelColumnKey ? "Total" : null, x = n ? s(p) : void 0, v = ge({
|
|
1044
|
+
key: p,
|
|
1045
|
+
label: p,
|
|
993
1046
|
formattedValues: n,
|
|
994
1047
|
dataType: "unknown",
|
|
995
1048
|
...x ? { presentation: { kind: "measure", format: x } } : {}
|
|
996
1049
|
});
|
|
997
1050
|
if (g == null) return { kind: "empty" };
|
|
998
1051
|
if (!n) return H({ value: g, text: String(g), column: v });
|
|
999
|
-
const
|
|
1000
|
-
return H(x &&
|
|
1052
|
+
const $ = x ? cr(g) : null;
|
|
1053
|
+
return H(x && $ !== null ? { value: $, text: B($, x), column: v } : { value: g, text: String(g), column: v });
|
|
1001
1054
|
});
|
|
1002
1055
|
}
|
|
1003
1056
|
return { format: w, totals: u };
|
|
1004
1057
|
}
|
|
1005
|
-
const
|
|
1058
|
+
const dr = /* @__PURE__ */ new Set([
|
|
1006
1059
|
"scope",
|
|
1007
1060
|
"useFormattedValues",
|
|
1008
1061
|
"timezone",
|
|
@@ -1020,14 +1073,14 @@ const mr = /* @__PURE__ */ new Set([
|
|
|
1020
1073
|
function ie(e) {
|
|
1021
1074
|
return e !== null && typeof e == "object" && !Array.isArray(e);
|
|
1022
1075
|
}
|
|
1023
|
-
function
|
|
1076
|
+
function Fe(e, t) {
|
|
1024
1077
|
if (e !== void 0) {
|
|
1025
1078
|
if (!ie(e))
|
|
1026
1079
|
throw new Error(`formatting.${t} must be an object`);
|
|
1027
1080
|
return e;
|
|
1028
1081
|
}
|
|
1029
1082
|
}
|
|
1030
|
-
function
|
|
1083
|
+
function zr(e) {
|
|
1031
1084
|
if (!ie(e))
|
|
1032
1085
|
throw new Error("formatting must be an object");
|
|
1033
1086
|
const t = ["reportContext", "resolvedFormats"].find(
|
|
@@ -1037,7 +1090,7 @@ function jr(e) {
|
|
|
1037
1090
|
throw new pe(
|
|
1038
1091
|
`formatting.${t} is retired; formatting.presentationExecutionSnapshot is authoritative.`
|
|
1039
1092
|
);
|
|
1040
|
-
const r = Object.keys(e).find((a) => !
|
|
1093
|
+
const r = Object.keys(e).find((a) => !dr.has(a));
|
|
1041
1094
|
if (r)
|
|
1042
1095
|
throw new Error(`formatting contains unknown property "${r}"`);
|
|
1043
1096
|
const n = typeof e.timezone == "string" ? e.timezone.trim() : "";
|
|
@@ -1046,28 +1099,28 @@ function jr(e) {
|
|
|
1046
1099
|
const o = st(e.delimiter);
|
|
1047
1100
|
if (!o)
|
|
1048
1101
|
throw new Error("formatting.delimiter must be a comma, semicolon or tab");
|
|
1049
|
-
const
|
|
1050
|
-
if (!
|
|
1102
|
+
const s = it(e.csvEncoding);
|
|
1103
|
+
if (!s)
|
|
1051
1104
|
throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
|
|
1052
1105
|
if (typeof e.includeHeaders != "boolean")
|
|
1053
1106
|
throw new Error("formatting.includeHeaders must be a boolean");
|
|
1054
1107
|
if (e.useFormattedValues !== void 0 && typeof e.useFormattedValues != "boolean")
|
|
1055
1108
|
throw new Error("formatting.useFormattedValues must be a boolean");
|
|
1056
|
-
const
|
|
1057
|
-
if (e.fileFormat !== void 0 && !
|
|
1109
|
+
const c = e.fileFormat === void 0 ? void 0 : lt(e.fileFormat);
|
|
1110
|
+
if (e.fileFormat !== void 0 && !c)
|
|
1058
1111
|
throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
|
|
1059
1112
|
if (e.title !== void 0 && typeof e.title != "string")
|
|
1060
1113
|
throw new Error("formatting.title must be a string");
|
|
1061
|
-
const
|
|
1062
|
-
if (e.visibleColumns !== void 0 && !
|
|
1114
|
+
const l = e.visibleColumns === void 0 ? void 0 : Array.isArray(e.visibleColumns) && e.visibleColumns.every((a) => typeof a == "string") ? e.visibleColumns : void 0;
|
|
1115
|
+
if (e.visibleColumns !== void 0 && !l)
|
|
1063
1116
|
throw new Error("formatting.visibleColumns must be an array of strings");
|
|
1064
|
-
const f =
|
|
1117
|
+
const f = Fe(e.columnLabels, "columnLabels");
|
|
1065
1118
|
if (f && Object.values(f).some((a) => typeof a != "string"))
|
|
1066
1119
|
throw new Error("formatting.columnLabels values must be strings");
|
|
1067
|
-
const
|
|
1068
|
-
if (
|
|
1120
|
+
const d = Fe(e.columnSettings, "columnSettings"), b = e.tableTotalsLabelColumnKey === void 0 ? void 0 : typeof e.tableTotalsLabelColumnKey == "string" && e.tableTotalsLabelColumnKey.trim() ? e.tableTotalsLabelColumnKey : null;
|
|
1121
|
+
if (b === null)
|
|
1069
1122
|
throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
|
|
1070
|
-
if (
|
|
1123
|
+
if (b && !(l != null && l.includes(b)))
|
|
1071
1124
|
throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
|
|
1072
1125
|
const w = nt(e.scope, "formatting.scope");
|
|
1073
1126
|
if (!w.cardId || w.attachmentIndex !== void 0)
|
|
@@ -1081,7 +1134,7 @@ function jr(e) {
|
|
|
1081
1134
|
at({
|
|
1082
1135
|
snapshot: u,
|
|
1083
1136
|
expectedScope: { dashboardId: w.dashboardId, cardId: w.cardId },
|
|
1084
|
-
visibleColumns:
|
|
1137
|
+
visibleColumns: l,
|
|
1085
1138
|
useFormattedValues: T
|
|
1086
1139
|
});
|
|
1087
1140
|
} catch (a) {
|
|
@@ -1095,17 +1148,17 @@ function jr(e) {
|
|
|
1095
1148
|
timezone: n,
|
|
1096
1149
|
presentationExecutionSnapshot: u,
|
|
1097
1150
|
delimiter: o,
|
|
1098
|
-
csvEncoding:
|
|
1151
|
+
csvEncoding: s,
|
|
1099
1152
|
includeHeaders: e.includeHeaders,
|
|
1100
|
-
...
|
|
1101
|
-
...
|
|
1153
|
+
...d ? { columnSettings: d } : {},
|
|
1154
|
+
...l ? { visibleColumns: l } : {},
|
|
1102
1155
|
...f ? { columnLabels: f } : {},
|
|
1103
|
-
...
|
|
1104
|
-
...
|
|
1156
|
+
...b ? { tableTotalsLabelColumnKey: b } : {},
|
|
1157
|
+
...c ? { fileFormat: c } : {},
|
|
1105
1158
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1106
1159
|
};
|
|
1107
1160
|
}
|
|
1108
|
-
function
|
|
1161
|
+
function Gr(e) {
|
|
1109
1162
|
const t = e.formatOptions, r = (n) => ie(n) ? n : void 0;
|
|
1110
1163
|
return {
|
|
1111
1164
|
scope: { dashboardId: e.dashboardId, cardId: e.cardId },
|
|
@@ -1123,25 +1176,25 @@ function Vr(e) {
|
|
|
1123
1176
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1124
1177
|
};
|
|
1125
1178
|
}
|
|
1126
|
-
function
|
|
1127
|
-
return ((e == null ? void 0 : e.filterValues) ?? []).filter(
|
|
1179
|
+
function qr(e) {
|
|
1180
|
+
return ((e == null ? void 0 : e.filterValues) ?? []).filter(fr).map(pr);
|
|
1128
1181
|
}
|
|
1129
|
-
function
|
|
1182
|
+
function fr(e) {
|
|
1130
1183
|
return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
|
|
1131
1184
|
}
|
|
1132
|
-
function
|
|
1185
|
+
function pr(e) {
|
|
1133
1186
|
if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
|
|
1134
1187
|
const { relativeMeta: t, ...r } = e, n = mt(t);
|
|
1135
1188
|
return n ? { ...r, relativeMeta: n } : r;
|
|
1136
1189
|
}
|
|
1137
|
-
const
|
|
1190
|
+
const hr = /* @__PURE__ */ new Set([
|
|
1138
1191
|
"day",
|
|
1139
1192
|
"week",
|
|
1140
1193
|
"month",
|
|
1141
1194
|
"quarter",
|
|
1142
1195
|
"year"
|
|
1143
1196
|
]);
|
|
1144
|
-
function
|
|
1197
|
+
function br(e, t) {
|
|
1145
1198
|
try {
|
|
1146
1199
|
const r = K(e), n = I(r, t, "yyyy-MM-dd");
|
|
1147
1200
|
if (I(r, t, "HH:mm:ss.SSS") !== "00:00:00.000")
|
|
@@ -1149,14 +1202,14 @@ function hr(e, t) {
|
|
|
1149
1202
|
date: n,
|
|
1150
1203
|
time: I(r, t, "h:mm a")
|
|
1151
1204
|
};
|
|
1152
|
-
const [o,
|
|
1153
|
-
return
|
|
1205
|
+
const [o, s, c] = n.split("-").map(Number), l = new Date(Date.UTC(o, s - 1, c));
|
|
1206
|
+
return l.setUTCDate(l.getUTCDate() - 1), { date: I(l, "UTC", "yyyy-MM-dd") };
|
|
1154
1207
|
} catch {
|
|
1155
1208
|
return;
|
|
1156
1209
|
}
|
|
1157
1210
|
}
|
|
1158
|
-
function
|
|
1159
|
-
const n =
|
|
1211
|
+
function je(e, t, r) {
|
|
1212
|
+
const n = br(e.end, t);
|
|
1160
1213
|
if (n)
|
|
1161
1214
|
return {
|
|
1162
1215
|
start: I(
|
|
@@ -1172,18 +1225,18 @@ function Ue(e, t, r) {
|
|
|
1172
1225
|
...n.time ? { endTime: n.time } : {}
|
|
1173
1226
|
};
|
|
1174
1227
|
}
|
|
1175
|
-
function
|
|
1176
|
-
return !!(e &&
|
|
1228
|
+
function Ve(e) {
|
|
1229
|
+
return !!(e && hr.has(e));
|
|
1177
1230
|
}
|
|
1178
|
-
function
|
|
1179
|
-
if (
|
|
1231
|
+
function Xr(e, t, r, n = !1) {
|
|
1232
|
+
if (Ve(r))
|
|
1180
1233
|
try {
|
|
1181
|
-
const
|
|
1182
|
-
if (
|
|
1183
|
-
return
|
|
1234
|
+
const s = je(e, t, !1);
|
|
1235
|
+
if (s && s.start === s.endDate)
|
|
1236
|
+
return s.endTime ? `${s.endDate} until ${s.endTime}` : s.endDate;
|
|
1184
1237
|
} catch {
|
|
1185
1238
|
}
|
|
1186
|
-
const o =
|
|
1239
|
+
const o = yr(
|
|
1187
1240
|
e,
|
|
1188
1241
|
t,
|
|
1189
1242
|
r,
|
|
@@ -1191,10 +1244,10 @@ function Hr(e, t, r, n = !1) {
|
|
|
1191
1244
|
);
|
|
1192
1245
|
return `${o.start} – ${o.end}`;
|
|
1193
1246
|
}
|
|
1194
|
-
function
|
|
1247
|
+
function yr(e, t, r, n = !1) {
|
|
1195
1248
|
try {
|
|
1196
|
-
if (
|
|
1197
|
-
const o =
|
|
1249
|
+
if (Ve(r)) {
|
|
1250
|
+
const o = je(e, t, n);
|
|
1198
1251
|
if (o)
|
|
1199
1252
|
return {
|
|
1200
1253
|
start: o.start,
|
|
@@ -1219,36 +1272,39 @@ function br(e, t, r, n = !1) {
|
|
|
1219
1272
|
export {
|
|
1220
1273
|
jr as A,
|
|
1221
1274
|
Vr as B,
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1275
|
+
Hr as C,
|
|
1276
|
+
Nr as D,
|
|
1277
|
+
zr as E,
|
|
1278
|
+
Gr as F,
|
|
1279
|
+
Br as G,
|
|
1280
|
+
qr as H,
|
|
1281
|
+
yr as I,
|
|
1226
1282
|
Pr as M,
|
|
1227
|
-
|
|
1283
|
+
Ut as P,
|
|
1228
1284
|
Fr as a,
|
|
1229
|
-
|
|
1285
|
+
Dr as b,
|
|
1230
1286
|
Lr as c,
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1287
|
+
Vt as d,
|
|
1288
|
+
$r as e,
|
|
1289
|
+
Xr as f,
|
|
1234
1290
|
Mr as g,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1291
|
+
Ir as h,
|
|
1292
|
+
kt as i,
|
|
1293
|
+
Nt as j,
|
|
1294
|
+
Rt as k,
|
|
1295
|
+
kr as l,
|
|
1296
|
+
jt as m,
|
|
1297
|
+
Ht as n,
|
|
1298
|
+
zt as o,
|
|
1299
|
+
Kt as p,
|
|
1300
|
+
Gt as q,
|
|
1245
1301
|
ge as r,
|
|
1246
|
-
|
|
1302
|
+
Ar as s,
|
|
1247
1303
|
H as t,
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1304
|
+
qt as u,
|
|
1305
|
+
Or as v,
|
|
1306
|
+
Qt as w,
|
|
1307
|
+
Rr as x,
|
|
1308
|
+
Ur as y,
|
|
1253
1309
|
Kr as z
|
|
1254
1310
|
};
|