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