react-semaphor 0.1.543 → 0.1.545
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/activity/index.js +73 -0
- package/dist/analytics-protocol/index.js +35 -34
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +56 -52
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{apply-dashboard-operations-CG9S7MGt.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
- package/dist/chunks/{assistant-chat-BFMRUYoB.js → assistant-chat-D7sWTypJ.js} +26 -27
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
- package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-D4E6IHPD.js} +462 -456
- package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
- package/dist/chunks/dashboard-B1tMju0u.js +14 -0
- package/dist/chunks/dashboard-briefing-launcher-CePgIu0Z.js +3720 -0
- package/dist/chunks/{dashboard-controls-UGpjOM2k.js → dashboard-controls-Cq05n3e0.js} +526 -521
- package/dist/chunks/{dashboard-json-DG8dz0eX.js → dashboard-json-CoYRPqxx.js} +3 -3
- package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
- package/dist/chunks/{edit-dashboard-visual-CDpA4y5e.js → edit-dashboard-visual-JPtNfJRb.js} +5628 -5618
- package/dist/chunks/export-file-format-C-tJsxsf.js +111 -0
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
- package/dist/chunks/{index-l5LclZvs.js → index-DRWiuqyd.js} +378 -332
- package/dist/chunks/{matrix-formatter-BnsTX90d.js → matrix-formatter-DnCyRXJE.js} +13 -13
- package/dist/chunks/{numeric-presentation-F_-H6VAw.js → numeric-presentation-7X_IrD58.js} +2572 -2573
- package/dist/chunks/{pivot-result-lifecycle-DupbRk-R.js → pivot-result-lifecycle-DM4CyGKs.js} +285 -393
- package/dist/chunks/{raw-temporal-presentation-D-azM_98.js → raw-temporal-presentation-C3mUgnEx.js} +2 -2
- package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-CPwRwEJx.js → report-preferences-dialog-DUtuUL_5.js} +640 -612
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
- package/dist/chunks/{saved-dashboard-context-BKvMfRfC.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{semaphor-ready-indicator-CN2AHm2x.js → semaphor-ready-indicator-BxF96Yhv.js} +46859 -47102
- package/dist/chunks/shelf-drop-preview-context-CNaM_Gmh.js +2469 -0
- package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
- package/dist/chunks/{table-export-sheet-BDRXLLdq.js → table-export-sheet-YzMioA7Y.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BnclfB2k.js → use-create-flow-overlay-state-CjB7ig1o.js} +153 -164
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +553 -541
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +241 -227
- package/dist/index.js +354 -331
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/activity.d.ts +2 -0
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/activity/activity-bell.d.ts +11 -0
- package/dist/types/components/activity/activity-instance.d.ts +50 -0
- package/dist/types/components/activity/activity-notices.d.ts +7 -0
- package/dist/types/components/activity/activity-provider.d.ts +21 -0
- package/dist/types/components/activity/activity-types.d.ts +177 -0
- package/dist/types/components/activity/index.d.ts +6 -0
- package/dist/types/components/activity/use-activity.d.ts +20 -0
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/briefings/briefing-author.d.ts +14 -12
- package/dist/types/components/briefings/dashboard-briefing-launcher.d.ts +5 -0
- package/dist/types/components/briefings/use-briefing-run-detail.d.ts +34 -0
- package/dist/types/components/index.d.ts +1 -4
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/lib/activity-identity.d.ts +21 -0
- package/dist/types/lib/api/exports-api.d.ts +4 -4
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/index.d.ts +1 -3
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +21 -6
- package/dist/types/shared/activity/activity-contract.d.ts +84 -0
- package/dist/types/shared/activity/index.d.ts +5 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/format-utils/export-policy.d.ts +12 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/package.json +6 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/dashboard-B9mKTJoy.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-Bdmry_oG.js +0 -4248
- package/dist/chunks/document-dashboard-inputs-OwqCbrVp.js +0 -8087
- package/dist/chunks/document-sheet-utils-BTb3VZxV.js +0 -3619
- package/dist/chunks/shelf-drop-preview-context-BGl_rxcW.js +0 -2407
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/types/components/briefings/briefing-author/run-ui.d.ts +0 -81
- package/dist/types/components/briefings/use-briefing-run-polling.d.ts +0 -34
- package/dist/types/components/notifications/export-notification-item.d.ts +0 -24
- package/dist/types/components/notifications/export-notification-list.d.ts +0 -8
- package/dist/types/components/notifications/index.d.ts +0 -3
- package/dist/types/components/notifications/notification-bell.d.ts +0 -13
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
- package/dist/types/lib/exports/bounded-request.d.ts +0 -12
- package/dist/types/lib/hooks/use-export-polling.d.ts +0 -32
- package/dist/types/lib/hooks/use-export-recovery.d.ts +0 -11
- package/dist/types/lib/stores/export-store.d.ts +0 -62
package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-D4E6IHPD.js}
RENAMED
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var fe = (e, t, r) =>
|
|
4
|
-
import { i as
|
|
5
|
-
import { i as _e, m as te, j as De, k as
|
|
6
|
-
import {
|
|
7
|
-
import { aC as U, l as
|
|
1
|
+
var Qe = Object.defineProperty;
|
|
2
|
+
var et = (e, t, r) => t in e ? Qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var fe = (e, t, r) => et(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { i as tt, j as V, m as rt, Q as ne, f as Ie, F as $e, P as ot, r as nt, M as at, v as st, c as it, p as lt, J as ct, a as j, G as ut, I as mt } from "./temporal-bucket-D7NBrrtL.js";
|
|
5
|
+
import { i as _e, m as te, j as De, k as dt, l as Re, a as ge, d as ft, n as $ } from "./matrix-formatter-DnCyRXJE.js";
|
|
6
|
+
import { h as Z, e as gt, p as pt, k as yt } from "./export-file-format-C-tJsxsf.js";
|
|
7
|
+
import { aC as U, l as ht, w as X, aB as bt, y as ae, x as wt } from "./validators-DMHTpf7a.js";
|
|
8
8
|
import "./matrix-operation-contract-8OIO4gob.js";
|
|
9
9
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
10
10
|
import "zod";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import { A as Pe, a as vt, t as pe, s as Tt, P as ye, l as Ct, o as xt, v as St, G as O } from "./pivot-result-lifecycle-DM4CyGKs.js";
|
|
12
|
+
import { PDF_SAFETY_LIMIT_EXCEEDED as Ne, getUtf8ByteLength as Et, FAST_PDF_POLICY as kt } from "../pdf-export-policy/index.js";
|
|
13
|
+
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as At } from "../value-format-preferences/index.js";
|
|
14
|
+
import { z as Lt } from "./zoned-wall-clock-BkxV9jS2.js";
|
|
14
15
|
import { p as Ft } from "./pivot-header-presentation-DHcx1XGQ.js";
|
|
15
16
|
import { d as Mt, c as he } from "./pivot-result-identity-DJhXXcns.js";
|
|
16
17
|
import { v as It } from "./raw-temporal-contract-C51YG48G.js";
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
import { g as $t } from "./relative-date-label-Bk2j94pA.js";
|
|
19
|
+
function _t(e, t, r) {
|
|
20
|
+
const o = {
|
|
19
21
|
...t,
|
|
20
22
|
locale: t.locale ?? r
|
|
21
23
|
};
|
|
22
|
-
if (
|
|
23
|
-
return V(e,
|
|
24
|
-
const { prefix:
|
|
25
|
-
return `${
|
|
24
|
+
if (o.type === "number")
|
|
25
|
+
return V(e, o);
|
|
26
|
+
const { prefix: n, suffix: i, ...a } = o;
|
|
27
|
+
return `${n ?? ""}${V(e, {
|
|
26
28
|
...a,
|
|
27
|
-
negativeStyle:
|
|
29
|
+
negativeStyle: o.type === "currency" ? o.negativeStyle : "minus"
|
|
28
30
|
})}${i ?? ""}`;
|
|
29
31
|
}
|
|
30
32
|
function q(e, t, r) {
|
|
31
|
-
return e === null ? { value: e, text: null } : !t || !
|
|
33
|
+
return e === null ? { value: e, text: null } : !t || !tt(t) && t.type !== "duration" ? {
|
|
32
34
|
value: e,
|
|
33
35
|
text: V(e, { type: "number", locale: r })
|
|
34
36
|
} : t.type === "duration" ? {
|
|
35
37
|
value: e,
|
|
36
|
-
text:
|
|
38
|
+
text: rt(e, {
|
|
37
39
|
inputUnit: t.inputUnit,
|
|
38
40
|
outputStyle: t.outputStyle,
|
|
39
41
|
largestUnit: t.largestUnit,
|
|
@@ -43,10 +45,10 @@ function q(e, t, r) {
|
|
|
43
45
|
suffix: t.suffix,
|
|
44
46
|
negativeInParentheses: t.negativeStyle === "parentheses"
|
|
45
47
|
})
|
|
46
|
-
} : { value: e, text:
|
|
48
|
+
} : { value: e, text: _t(e, t, r) };
|
|
47
49
|
}
|
|
48
|
-
function be(e, t, r,
|
|
49
|
-
return e === null ? { value: e, text: null } :
|
|
50
|
+
function be(e, t, r, o) {
|
|
51
|
+
return e === null ? { value: e, text: null } : o === "percent" ? {
|
|
50
52
|
value: e,
|
|
51
53
|
text: V(e, {
|
|
52
54
|
type: "percent",
|
|
@@ -72,7 +74,7 @@ function we(e, t) {
|
|
|
72
74
|
throw new RangeError("Comparison precision must be an integer from 0 to 6.");
|
|
73
75
|
return e;
|
|
74
76
|
}
|
|
75
|
-
function
|
|
77
|
+
function fo(e, t) {
|
|
76
78
|
const r = {
|
|
77
79
|
mode: t.displayMode,
|
|
78
80
|
current: q(
|
|
@@ -102,19 +104,19 @@ function un(e, t) {
|
|
|
102
104
|
"ratio"
|
|
103
105
|
)), r;
|
|
104
106
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
107
|
+
const Dt = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
|
|
108
|
+
function Rt(e) {
|
|
107
109
|
const { presentation: t } = e;
|
|
108
|
-
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" ?
|
|
110
|
+
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" ? Dt.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";
|
|
109
111
|
}
|
|
110
|
-
function
|
|
111
|
-
const t = (
|
|
112
|
-
return
|
|
112
|
+
function Pt(e) {
|
|
113
|
+
const t = (n, i) => Number.isInteger(n) ? Math.min(20, Math.max(0, n)) : i, r = t(e.minimumFractionDigits, 0), o = Math.max(r, t(e.maximumFractionDigits, 2));
|
|
114
|
+
return o === 0 ? "" : `.${"0".repeat(o)}`;
|
|
113
115
|
}
|
|
114
116
|
function J(e) {
|
|
115
117
|
return `"${e.replace(/"/g, "")}"`;
|
|
116
118
|
}
|
|
117
|
-
function
|
|
119
|
+
function Nt(e) {
|
|
118
120
|
let t;
|
|
119
121
|
try {
|
|
120
122
|
t = new Intl.NumberFormat(e.locale ?? "en-US", {
|
|
@@ -124,33 +126,33 @@ function Pt(e) {
|
|
|
124
126
|
} catch {
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
|
-
const r = t.findIndex((i) => i.type === "currency"),
|
|
128
|
-
if (r < 0 ||
|
|
129
|
-
const
|
|
130
|
-
return r <
|
|
129
|
+
const r = t.findIndex((i) => i.type === "currency"), o = t.findIndex((i) => i.type === "integer");
|
|
130
|
+
if (r < 0 || o < 0) return;
|
|
131
|
+
const n = (i, a) => t.slice(i, a).filter((l) => l.type === "literal").map((l) => l.value.replace(/\s/g, " ")).join("");
|
|
132
|
+
return r < o ? { side: "before", text: t[r].value + n(r + 1, o) } : {
|
|
131
133
|
side: "after",
|
|
132
|
-
text: o
|
|
134
|
+
text: n(o + 1, r) + t[r].value
|
|
133
135
|
};
|
|
134
136
|
}
|
|
135
|
-
function
|
|
136
|
-
const t =
|
|
137
|
+
function Ot(e) {
|
|
138
|
+
const t = Pt(e);
|
|
137
139
|
let r;
|
|
138
140
|
if (e.type === "scientific")
|
|
139
141
|
r = `0${t}E+00`;
|
|
140
142
|
else {
|
|
141
|
-
const
|
|
143
|
+
const o = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
|
|
142
144
|
if (e.type === "currency") {
|
|
143
|
-
const
|
|
144
|
-
r =
|
|
145
|
-
} else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${
|
|
145
|
+
const n = Nt(e);
|
|
146
|
+
r = n ? n.side === "before" ? `${J(n.text)}${o}` : `${o}${J(n.text)}` : o;
|
|
147
|
+
} else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${o}${J("%")}` : `${o}%` : r = o;
|
|
146
148
|
}
|
|
147
149
|
return e.negativeStyle === "parentheses" ? `${r};(${r})` : r;
|
|
148
150
|
}
|
|
149
|
-
function
|
|
151
|
+
function Vt(e, t) {
|
|
150
152
|
if (!e.formattedValues) return;
|
|
151
153
|
const { presentation: r } = e;
|
|
152
154
|
if (t === "number" || t === "by_value")
|
|
153
|
-
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 :
|
|
155
|
+
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Ot(r.format);
|
|
154
156
|
if (t === "date") {
|
|
155
157
|
if ((r == null ? void 0 : r.kind) === "temporal_bucket")
|
|
156
158
|
return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
|
|
@@ -159,7 +161,7 @@ function Ot(e, t) {
|
|
|
159
161
|
}
|
|
160
162
|
}
|
|
161
163
|
function ve(e) {
|
|
162
|
-
const t =
|
|
164
|
+
const t = Rt(e), r = Vt(e, t);
|
|
163
165
|
return Object.freeze({
|
|
164
166
|
key: e.key,
|
|
165
167
|
label: e.label,
|
|
@@ -167,18 +169,18 @@ function ve(e) {
|
|
|
167
169
|
...r === void 0 ? {} : { numberFormat: r }
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
|
-
const
|
|
172
|
+
const Ut = 15, Kt = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
171
173
|
function Oe(e) {
|
|
172
|
-
return
|
|
174
|
+
return Kt.test(e) ? e : void 0;
|
|
173
175
|
}
|
|
174
176
|
function Te(e) {
|
|
175
177
|
const r = e.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
|
|
176
|
-
if (r.length >
|
|
177
|
-
const
|
|
178
|
-
return Number.isFinite(
|
|
178
|
+
if (r.length > Ut) return !1;
|
|
179
|
+
const o = Number(e);
|
|
180
|
+
return Number.isFinite(o) && (o !== 0 || r.length === 0);
|
|
179
181
|
}
|
|
180
|
-
const
|
|
181
|
-
function
|
|
182
|
+
const Bt = Date.UTC(1900, 2, 1), zt = Date.UTC(1e4, 0, 1), jt = Date.UTC(1899, 11, 30), Gt = 864e5;
|
|
183
|
+
function Ht(e) {
|
|
182
184
|
const t = Date.UTC(
|
|
183
185
|
e.year,
|
|
184
186
|
e.month - 1,
|
|
@@ -187,8 +189,8 @@ function Gt(e) {
|
|
|
187
189
|
e.minute,
|
|
188
190
|
e.second
|
|
189
191
|
);
|
|
190
|
-
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t <
|
|
191
|
-
return (t -
|
|
192
|
+
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < Bt || t >= zt))
|
|
193
|
+
return (t - jt) / Gt;
|
|
192
194
|
}
|
|
193
195
|
function Ce(e, t, r) {
|
|
194
196
|
if (typeof e == "number")
|
|
@@ -196,52 +198,55 @@ function Ce(e, t, r) {
|
|
|
196
198
|
if (U(e))
|
|
197
199
|
return Te(e.value) ? { kind: "number", text: t, value: e } : void 0;
|
|
198
200
|
if (r && typeof e == "string") {
|
|
199
|
-
const
|
|
200
|
-
return
|
|
201
|
+
const o = Oe(e);
|
|
202
|
+
return o !== void 0 && Te(o) ? { kind: "number", text: t, value: o } : void 0;
|
|
201
203
|
}
|
|
202
204
|
}
|
|
203
205
|
function P(e) {
|
|
204
|
-
const { value: t, text: r, column:
|
|
206
|
+
const { value: t, text: r, column: o } = e;
|
|
205
207
|
if (r === "") return { kind: "empty" };
|
|
206
|
-
const
|
|
207
|
-
switch (
|
|
208
|
+
const n = { kind: "text", text: r };
|
|
209
|
+
switch (o.cellType) {
|
|
208
210
|
case "text":
|
|
209
|
-
return
|
|
211
|
+
return n;
|
|
210
212
|
case "date": {
|
|
211
|
-
const i = e.wallClock ?
|
|
212
|
-
return i === void 0 ?
|
|
213
|
+
const i = e.wallClock ? Ht(e.wallClock) : void 0;
|
|
214
|
+
return i === void 0 ? n : { kind: "date", text: r, serial: i };
|
|
213
215
|
}
|
|
214
216
|
case "number":
|
|
215
|
-
return Ce(t, r, !0) ??
|
|
217
|
+
return Ce(t, r, !0) ?? n;
|
|
216
218
|
case "boolean":
|
|
217
|
-
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } :
|
|
219
|
+
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : n;
|
|
218
220
|
case "by_value":
|
|
219
|
-
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : Ce(t, r, !1) ??
|
|
221
|
+
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : Ce(t, r, !1) ?? n;
|
|
220
222
|
}
|
|
221
223
|
}
|
|
222
|
-
function
|
|
224
|
+
function go(e) {
|
|
223
225
|
return e.kind === "empty" ? "" : e.text;
|
|
224
226
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
return e >
|
|
227
|
+
const Ve = 1e4, Xt = 1e6, po = 5e6, yo = 1024 ** 3, ho = 1024 ** 3;
|
|
228
|
+
function bo(e) {
|
|
229
|
+
return e > Ve;
|
|
228
230
|
}
|
|
229
|
-
|
|
231
|
+
function wo(e) {
|
|
232
|
+
return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= Ve ? "direct" : e.loadedRowCount <= Xt ? "background" : "blocked";
|
|
233
|
+
}
|
|
234
|
+
const vo = {
|
|
230
235
|
rowLabels: "tabular",
|
|
231
236
|
subtotals: "after"
|
|
232
237
|
};
|
|
233
|
-
function
|
|
234
|
-
const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 },
|
|
238
|
+
function To(e, t) {
|
|
239
|
+
const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, o = e.totals.rows;
|
|
235
240
|
return {
|
|
236
241
|
...e,
|
|
237
242
|
layout: r,
|
|
238
243
|
totals: {
|
|
239
244
|
...e.totals,
|
|
240
245
|
rows: {
|
|
241
|
-
...
|
|
246
|
+
...o,
|
|
242
247
|
levels: Object.fromEntries(
|
|
243
|
-
Object.entries(
|
|
244
|
-
|
|
248
|
+
Object.entries(o.levels).map(([n, i]) => [
|
|
249
|
+
n,
|
|
245
250
|
{ ...i, position: t.subtotals }
|
|
246
251
|
])
|
|
247
252
|
)
|
|
@@ -249,29 +254,29 @@ function bn(e, t) {
|
|
|
249
254
|
}
|
|
250
255
|
};
|
|
251
256
|
}
|
|
252
|
-
const
|
|
253
|
-
function
|
|
257
|
+
const Wt = 2;
|
|
258
|
+
function Yt(e) {
|
|
254
259
|
return typeof e == "number" ? Number.isInteger(e) : U(e) ? !e.value.includes(".") : !0;
|
|
255
260
|
}
|
|
256
|
-
function
|
|
257
|
-
const
|
|
258
|
-
(a) => r.measureFormats[a.id] === void 0 && a.semanticFormat === void 0 &&
|
|
261
|
+
function Zt(e, t, r) {
|
|
262
|
+
const o = e.descriptors.measures.filter(
|
|
263
|
+
(a) => r.measureFormats[a.id] === void 0 && a.semanticFormat === void 0 && ht(a.column.dataType) === "number"
|
|
259
264
|
);
|
|
260
|
-
if (
|
|
261
|
-
const
|
|
265
|
+
if (o.length === 0) return r;
|
|
266
|
+
const n = /* @__PURE__ */ new Set();
|
|
262
267
|
e.columns.forEach((a, l) => {
|
|
263
|
-
if (!(a.kind !== "measure" ||
|
|
268
|
+
if (!(a.kind !== "measure" || n.has(a.measureId)))
|
|
264
269
|
for (const m of t) {
|
|
265
270
|
const u = m.values[l];
|
|
266
|
-
if ((u == null ? void 0 : u.kind) === "value" && !
|
|
267
|
-
|
|
271
|
+
if ((u == null ? void 0 : u.kind) === "value" && !Yt(u.value)) {
|
|
272
|
+
n.add(a.measureId);
|
|
268
273
|
return;
|
|
269
274
|
}
|
|
270
275
|
}
|
|
271
276
|
});
|
|
272
277
|
const i = { ...r.measureFormats };
|
|
273
|
-
for (const { id: a } of
|
|
274
|
-
const l =
|
|
278
|
+
for (const { id: a } of o) {
|
|
279
|
+
const l = n.has(a) ? Wt : 0;
|
|
275
280
|
i[a] = {
|
|
276
281
|
type: "number",
|
|
277
282
|
minimumFractionDigits: l,
|
|
@@ -284,21 +289,21 @@ function Yt(e, t, r) {
|
|
|
284
289
|
function G(e) {
|
|
285
290
|
return X(e.slice(0, -1));
|
|
286
291
|
}
|
|
287
|
-
function
|
|
292
|
+
function qt(e, t) {
|
|
288
293
|
return t.length > e.length && X(t.slice(0, e.length)) === X(e);
|
|
289
294
|
}
|
|
290
|
-
function
|
|
295
|
+
function Jt(e) {
|
|
291
296
|
return e.map((t, r) => {
|
|
292
297
|
if (r === 0 || t.kind !== "layout") return !1;
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
if (t.role !== "member" ||
|
|
296
|
-
const
|
|
297
|
-
return
|
|
298
|
+
const o = e[r - 1];
|
|
299
|
+
if (o.kind !== "layout") return !1;
|
|
300
|
+
if (t.role !== "member" || qt(o.rowPath, t.rowPath)) return !0;
|
|
301
|
+
const n = e[r - 2];
|
|
302
|
+
return o.role === "member" && (!n || n.kind !== "layout" || n.role !== "member" || G(n.rowPath) !== G(o.rowPath)) && t.rowPath.length === o.rowPath.length && G(t.rowPath) === G(o.rowPath);
|
|
298
303
|
});
|
|
299
304
|
}
|
|
300
|
-
const
|
|
301
|
-
function
|
|
305
|
+
const Qt = "pdf-group-continuation";
|
|
306
|
+
function er(e) {
|
|
302
307
|
if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
|
|
303
308
|
return !0;
|
|
304
309
|
for (let t = 0; t <= e.levelIndex; t++)
|
|
@@ -306,21 +311,21 @@ function Qt(e) {
|
|
|
306
311
|
return !0;
|
|
307
312
|
return !1;
|
|
308
313
|
}
|
|
309
|
-
function
|
|
314
|
+
function Ue(e, t, r) {
|
|
310
315
|
return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || U(t.value)) ? e : Z(e);
|
|
311
316
|
}
|
|
312
|
-
function
|
|
313
|
-
const
|
|
317
|
+
function tr(e, t, r) {
|
|
318
|
+
const o = _e(e.descriptors, t.presentation, r), n = e.columns.map((d) => {
|
|
314
319
|
var s;
|
|
315
|
-
return d.kind === "measure" && ((s =
|
|
316
|
-
}), i = (d) => te([d],
|
|
320
|
+
return d.kind === "measure" && ((s = o.measureSemantics.get(d.measureId)) == null ? void 0 : s.isNumeric) === !0;
|
|
321
|
+
}), i = (d) => te([d], o.levels), a = (d, s, f) => De(d, s, t.presentation.totals[f], o.levels), l = e.columns.map((d) => {
|
|
317
322
|
if (d.kind !== "measure") return d.label;
|
|
318
323
|
const s = d.columnPath.map(i);
|
|
319
324
|
return d.role !== "member" && s.push(a(d.columnPath, d.role, "columns")), [...s, d.label].join(" / ");
|
|
320
325
|
}), m = Math.min(t.spec.columns.length, Math.max(
|
|
321
326
|
0,
|
|
322
327
|
...e.columns.map((d) => d.kind === "measure" ? d.columnPath.length + (d.role !== "member" ? 1 : 0) : 0)
|
|
323
|
-
)), u = Array.from({ length: m + 1 }, (d, s) => e.columns.map((f) => s === m ? f.label : f.kind !== "measure" ? "" : s < f.columnPath.length ? i(f.columnPath[s]) : s === f.columnPath.length && f.role !== "member" ? a(f.columnPath, f.role, "columns") : "")), g = (d, s) =>
|
|
328
|
+
)), u = Array.from({ length: m + 1 }, (d, s) => e.columns.map((f) => s === m ? f.label : f.kind !== "measure" ? "" : s < f.columnPath.length ? i(f.columnPath[s]) : s === f.columnPath.length && f.role !== "member" ? a(f.columnPath, f.role, "columns") : "")), g = (d, s) => dt({
|
|
324
329
|
path: d.rowPath,
|
|
325
330
|
role: d.kind === "layout" ? d.role : "member",
|
|
326
331
|
levelCount: Math.max(1, t.spec.rows.length),
|
|
@@ -335,23 +340,23 @@ function er(e, t, r) {
|
|
|
335
340
|
return `${" ".repeat(Math.max(0, d.rowPath.length - 1))}${a(d.rowPath, d.role, "rows")}`;
|
|
336
341
|
if (b.kind === "level") {
|
|
337
342
|
const C = t.spec.rows.findIndex((F) => F.id === b.levelId), x = f[C];
|
|
338
|
-
return x != null && x.visible ? x.total ? a(d.rowPath, d.role, "rows") : te(x.path,
|
|
343
|
+
return x != null && x.visible ? x.total ? a(d.rowPath, d.role, "rows") : te(x.path, o.levels) : "";
|
|
339
344
|
}
|
|
340
|
-
const S = d.values[y], w =
|
|
345
|
+
const S = d.values[y], w = o.measures.get(b.measureId);
|
|
341
346
|
if (S.kind === "value" && !w)
|
|
342
347
|
throw new Error("Matrix value is missing its measure descriptor.");
|
|
343
348
|
return Re(S, w, t.presentation.absence);
|
|
344
349
|
});
|
|
345
350
|
}, v = (d, s) => p(d, s).map((f, b) => {
|
|
346
351
|
const y = e.columns[b];
|
|
347
|
-
return y.kind === "measure" ?
|
|
352
|
+
return y.kind === "measure" ? Ue(f, d.values[b], o.measureSemantics.get(y.measureId)) : Z(f);
|
|
348
353
|
});
|
|
349
354
|
return {
|
|
350
355
|
headers: l,
|
|
351
356
|
headerBands: u,
|
|
352
|
-
numericColumns:
|
|
357
|
+
numericColumns: n,
|
|
353
358
|
/** The card's prepared formats this presentation formats with (the Excel form reads its measure formats). */
|
|
354
|
-
formatting:
|
|
359
|
+
formatting: o,
|
|
355
360
|
/** A row's cells; after `previous`, a tabular layout prints each label once. */
|
|
356
361
|
row: (d, s) => p(d, s),
|
|
357
362
|
/**
|
|
@@ -382,37 +387,37 @@ function er(e, t, r) {
|
|
|
382
387
|
csvRows: (d, s) => d.map((f, b) => v(f, b ? d[b - 1] : s ?? void 0))
|
|
383
388
|
};
|
|
384
389
|
}
|
|
385
|
-
function
|
|
390
|
+
function Co(e) {
|
|
386
391
|
return e.columns.map((t) => Z(t.label));
|
|
387
392
|
}
|
|
388
|
-
function
|
|
389
|
-
return
|
|
390
|
-
const i = t.columns[
|
|
391
|
-
return i.kind === "measure" ?
|
|
393
|
+
function xo(e, t, r) {
|
|
394
|
+
return rr(e, t, r).map((o, n) => {
|
|
395
|
+
const i = t.columns[n];
|
|
396
|
+
return i.kind === "measure" ? Ue(o, e.values[n], r.measureSemantics.get(i.measureId)) : Z(o);
|
|
392
397
|
});
|
|
393
398
|
}
|
|
394
|
-
function
|
|
399
|
+
function rr(e, t, r) {
|
|
395
400
|
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
396
401
|
if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
397
|
-
const
|
|
398
|
-
return t.columns.map((
|
|
399
|
-
if (
|
|
400
|
-
const l = e.values[i], m = r.measures.get(
|
|
402
|
+
const o = [...e.rowPath, ...e.columnPath];
|
|
403
|
+
return t.columns.map((n, i) => {
|
|
404
|
+
if (n.kind === "measure") {
|
|
405
|
+
const l = e.values[i], m = r.measures.get(n.measureId);
|
|
401
406
|
if (l.kind === "value" && !m) throw new Error("Matrix value is missing its measure descriptor.");
|
|
402
407
|
return Re(l, m, r.absence);
|
|
403
408
|
}
|
|
404
|
-
const a =
|
|
409
|
+
const a = n.kind === "level" ? o.find((l) => l.levelId === n.levelId) : void 0;
|
|
405
410
|
if (!a) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
406
411
|
return te([a], r.levels);
|
|
407
412
|
});
|
|
408
413
|
}
|
|
409
|
-
function
|
|
410
|
-
const t =
|
|
414
|
+
function or(e) {
|
|
415
|
+
const t = tr(e.layout, e.request, e.report), r = e.layout.columns.map((a, l) => ({
|
|
411
416
|
index: l,
|
|
412
417
|
columnId: `matrix:${l}`,
|
|
413
418
|
label: t.headers[l],
|
|
414
419
|
isNumeric: t.numericColumns[l]
|
|
415
|
-
})),
|
|
420
|
+
})), o = (a, l, m) => ({
|
|
416
421
|
text: a,
|
|
417
422
|
colspan: 1,
|
|
418
423
|
rowspan: 1,
|
|
@@ -420,15 +425,15 @@ function rr(e) {
|
|
|
420
425
|
isHeader: m,
|
|
421
426
|
isNumeric: r[l].isNumeric,
|
|
422
427
|
className: r[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
|
|
423
|
-
}),
|
|
424
|
-
e.request.spec.columns.length && i >= 0 &&
|
|
428
|
+
}), n = [], i = e.layout.columns.findIndex((a) => a.kind === "measure");
|
|
429
|
+
e.request.spec.columns.length && i >= 0 && n.push({
|
|
425
430
|
repeatHeader: !0,
|
|
426
431
|
headerType: "pivot-axis",
|
|
427
432
|
headerRowIndex: 0,
|
|
428
433
|
cells: [
|
|
429
|
-
...i ? [{ ...
|
|
434
|
+
...i ? [{ ...o("", 0, !0), colspan: i }] : [],
|
|
430
435
|
{
|
|
431
|
-
...
|
|
436
|
+
...o(e.request.spec.columns.map((a) => Pe(a, e.request.presentation)).join(" / "), i, !0),
|
|
432
437
|
colspan: e.layout.columns.length - i,
|
|
433
438
|
isNumeric: !1,
|
|
434
439
|
className: ""
|
|
@@ -436,14 +441,14 @@ function rr(e) {
|
|
|
436
441
|
]
|
|
437
442
|
});
|
|
438
443
|
for (const [a, l] of t.headerBands.entries())
|
|
439
|
-
|
|
444
|
+
n.push({
|
|
440
445
|
repeatHeader: !0,
|
|
441
446
|
headerType: a === t.headerBands.length - 1 ? "metrics" : "pivot-level",
|
|
442
|
-
headerRowIndex:
|
|
443
|
-
cells: l.map((m, u) =>
|
|
447
|
+
headerRowIndex: n.length,
|
|
448
|
+
cells: l.map((m, u) => o(m, u, !0))
|
|
444
449
|
});
|
|
445
450
|
return {
|
|
446
|
-
headers:
|
|
451
|
+
headers: n,
|
|
447
452
|
rows: e.rows.map((a, l) => {
|
|
448
453
|
const m = new Set(t.continuedColumns(a, e.rows[l - 1]));
|
|
449
454
|
return {
|
|
@@ -452,7 +457,7 @@ function rr(e) {
|
|
|
452
457
|
subtotalLevel: String(a.rowPath.length),
|
|
453
458
|
// A tabular layout prints each label once unless it repeats them; the
|
|
454
459
|
// blank cell continues its group, so a grid draws no rule above it.
|
|
455
|
-
cells: t.row(a, e.rows[l - 1]).map((u, g) => m.has(g) ? { ...
|
|
460
|
+
cells: t.row(a, e.rows[l - 1]).map((u, g) => m.has(g) ? { ...o(u, g, !1), className: Qt } : o(u, g, !1))
|
|
456
461
|
};
|
|
457
462
|
}),
|
|
458
463
|
grandTotal: null,
|
|
@@ -470,11 +475,11 @@ function rr(e) {
|
|
|
470
475
|
};
|
|
471
476
|
}
|
|
472
477
|
function nr(e, t, r) {
|
|
473
|
-
const { levels:
|
|
478
|
+
const { levels: o } = _e(e.descriptors, t.presentation, r), n = t.spec.columns.length > 0, i = [], a = [], l = e.columns.map((u, g) => {
|
|
474
479
|
if (u.kind !== "measure") return null;
|
|
475
|
-
const p =
|
|
480
|
+
const p = n ? `${u.role}:${X(u.columnPath)}` : `measure:${g}`;
|
|
476
481
|
let v = i.indexOf(p);
|
|
477
|
-
return v < 0 && (v = i.push(p) - 1, a.push(
|
|
482
|
+
return v < 0 && (v = i.push(p) - 1, a.push(n ? De(u.columnPath, u.role, t.presentation.totals.columns, o) : u.label)), v;
|
|
478
483
|
}), m = t.spec.columns[t.spec.columns.length - 1];
|
|
479
484
|
return {
|
|
480
485
|
columnGroups: l,
|
|
@@ -483,18 +488,18 @@ function nr(e, t, r) {
|
|
|
483
488
|
groupLevelLabel: m ? Pe(m, t.presentation) : "Measures"
|
|
484
489
|
};
|
|
485
490
|
}
|
|
486
|
-
function
|
|
487
|
-
const { layout: t, rows: r, report:
|
|
491
|
+
function So(e) {
|
|
492
|
+
const { layout: t, rows: r, report: o } = e, n = {
|
|
488
493
|
...e.request,
|
|
489
|
-
presentation:
|
|
490
|
-
}, i =
|
|
494
|
+
presentation: Zt(t, r, e.request.presentation)
|
|
495
|
+
}, i = or({ layout: t, rows: r, request: n, report: o }), a = Jt(r), l = nr(t, n, o), m = {
|
|
491
496
|
...i,
|
|
492
497
|
rows: i.rows.map((u, g) => ({ ...u, keepWithPrevious: a[g] })),
|
|
493
498
|
metadata: { ...i.metadata, ...l }
|
|
494
499
|
};
|
|
495
|
-
return { request:
|
|
500
|
+
return { request: n, table: m, ...l };
|
|
496
501
|
}
|
|
497
|
-
class
|
|
502
|
+
class ar extends Error {
|
|
498
503
|
constructor() {
|
|
499
504
|
super(...arguments);
|
|
500
505
|
fe(this, "code", Ne);
|
|
@@ -503,37 +508,37 @@ class or extends Error {
|
|
|
503
508
|
function xe(e) {
|
|
504
509
|
if (!e || typeof e != "object")
|
|
505
510
|
return;
|
|
506
|
-
const { error: t, message: r, detail:
|
|
507
|
-
for (const
|
|
508
|
-
if (typeof
|
|
509
|
-
return
|
|
511
|
+
const { error: t, message: r, detail: o } = e;
|
|
512
|
+
for (const n of [t, r, o])
|
|
513
|
+
if (typeof n == "string" && n.trim())
|
|
514
|
+
return n.trim();
|
|
510
515
|
}
|
|
511
|
-
async function
|
|
516
|
+
async function sr(e) {
|
|
512
517
|
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
|
|
513
518
|
try {
|
|
514
519
|
if (r.includes("application/json")) {
|
|
515
|
-
const
|
|
516
|
-
return { message: xe(
|
|
520
|
+
const n = await e.json(), i = typeof n.code == "string" ? n.code : typeof n.errorCode == "string" ? n.errorCode : void 0;
|
|
521
|
+
return { message: xe(n) || t, code: i };
|
|
517
522
|
}
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
523
|
+
const o = await e.text();
|
|
524
|
+
if (!o.trim())
|
|
520
525
|
return { message: t };
|
|
521
526
|
try {
|
|
522
|
-
const
|
|
527
|
+
const n = JSON.parse(o), i = typeof n.code == "string" ? n.code : typeof n.errorCode == "string" ? n.errorCode : void 0;
|
|
523
528
|
return {
|
|
524
|
-
message: xe(
|
|
529
|
+
message: xe(n) || o.trim(),
|
|
525
530
|
code: i
|
|
526
531
|
};
|
|
527
532
|
} catch {
|
|
528
|
-
return { message:
|
|
533
|
+
return { message: o.trim() };
|
|
529
534
|
}
|
|
530
535
|
} catch {
|
|
531
536
|
return { message: t };
|
|
532
537
|
}
|
|
533
538
|
}
|
|
534
|
-
async function
|
|
539
|
+
async function Eo(e) {
|
|
535
540
|
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
536
|
-
if (
|
|
541
|
+
if (Et(e.serializedPayload) > kt.maxRequestBytes)
|
|
537
542
|
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
538
543
|
const t = await (e.fetchImpl ?? fetch)(e.url, {
|
|
539
544
|
method: "POST",
|
|
@@ -542,8 +547,8 @@ async function Cn(e) {
|
|
|
542
547
|
signal: e.signal
|
|
543
548
|
});
|
|
544
549
|
if (!t.ok) {
|
|
545
|
-
const
|
|
546
|
-
throw
|
|
550
|
+
const o = await sr(t);
|
|
551
|
+
throw o.code === Ne ? new ar(o.message) : new Error(o.message);
|
|
547
552
|
}
|
|
548
553
|
const r = await t.json();
|
|
549
554
|
if (r != null && r.error) throw new Error(r.error);
|
|
@@ -551,36 +556,36 @@ async function Cn(e) {
|
|
|
551
556
|
throw new Error("Fast-path PDF response missing download URL");
|
|
552
557
|
return r;
|
|
553
558
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
556
|
-
if (!
|
|
559
|
+
const ir = /* @__PURE__ */ new Set(["short", "medium", "long"]), lr = /^(\d{4})-(\d{2})-(\d{2})$/, cr = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, ur = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, se = " – ";
|
|
560
|
+
function ko(e) {
|
|
561
|
+
if (!ot(e)) return;
|
|
557
562
|
const t = Object.keys(e);
|
|
558
563
|
if (e.mode === "period_label" && t.length === 1)
|
|
559
564
|
return { mode: "period_label" };
|
|
560
|
-
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" &&
|
|
565
|
+
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && ir.has(e.dateStyle))
|
|
561
566
|
return { mode: "style", dateStyle: e.dateStyle };
|
|
562
|
-
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" &&
|
|
567
|
+
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && mr(e.pattern) === null)
|
|
563
568
|
return {
|
|
564
569
|
mode: "pattern",
|
|
565
570
|
dialect: "semaphor_tokens",
|
|
566
571
|
pattern: e.pattern
|
|
567
572
|
};
|
|
568
573
|
}
|
|
569
|
-
function
|
|
574
|
+
function mr(e) {
|
|
570
575
|
try {
|
|
571
|
-
return
|
|
576
|
+
return st({ dialect: "semaphor_tokens", pattern: e }), null;
|
|
572
577
|
} catch (t) {
|
|
573
578
|
return t instanceof Error ? t.message : "The pattern is invalid.";
|
|
574
579
|
}
|
|
575
580
|
}
|
|
576
|
-
function
|
|
577
|
-
const { value: t, part: r, presentation:
|
|
578
|
-
if ((
|
|
581
|
+
function Ao(e) {
|
|
582
|
+
const { value: t, part: r, presentation: o, preferences: n, calendar: i } = e;
|
|
583
|
+
if ((o == null ? void 0 : o.mode) === "period_label" && t.periodLabel && r === "range")
|
|
579
584
|
return { ok: !0, text: t.periodLabel };
|
|
580
585
|
const [a, l] = t.bounds, u = l === void 0 || r === "start" ? [{ raw: a, role: "start" }] : r === "end" ? [{ raw: l, role: "end" }] : [
|
|
581
586
|
{ raw: a, role: "start" },
|
|
582
587
|
{ raw: l, role: "end" }
|
|
583
|
-
], g = u.map(({ raw: s }) =>
|
|
588
|
+
], g = u.map(({ raw: s }) => pr(s, i.tz));
|
|
584
589
|
if (g.some((s) => s === null))
|
|
585
590
|
return {
|
|
586
591
|
ok: !1,
|
|
@@ -591,39 +596,39 @@ function Sn(e) {
|
|
|
591
596
|
}
|
|
592
597
|
};
|
|
593
598
|
const p = t.precision === "day" ? g.map(
|
|
594
|
-
(s, f) =>
|
|
599
|
+
(s, f) => hr(s, u[f].role, i.tz)
|
|
595
600
|
) : [], v = p.length > 0 && p.every((s) => s !== null) ? p : null;
|
|
596
|
-
return { ok: !0, text: v ?
|
|
597
|
-
g.map((s) =>
|
|
598
|
-
n,
|
|
601
|
+
return { ok: !0, text: v ? dr(v, o, n, i) : fr(
|
|
602
|
+
g.map((s) => yr(s, i.tz)),
|
|
599
603
|
o,
|
|
604
|
+
n,
|
|
600
605
|
i
|
|
601
606
|
) };
|
|
602
607
|
}
|
|
603
|
-
function
|
|
604
|
-
const [
|
|
608
|
+
function dr(e, t, r, o) {
|
|
609
|
+
const [n, i = n] = e;
|
|
605
610
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
606
|
-
return
|
|
611
|
+
return ze(
|
|
607
612
|
e.map(
|
|
608
|
-
(m) =>
|
|
613
|
+
(m) => Be(re(m), "date", t.pattern, r, o)
|
|
609
614
|
)
|
|
610
615
|
);
|
|
611
616
|
const a = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : r.dateStyle;
|
|
612
617
|
if (!t || t.mode === "period_label") {
|
|
613
|
-
const m =
|
|
618
|
+
const m = br(n, i, o);
|
|
614
619
|
if (m)
|
|
615
620
|
return Ie({
|
|
616
|
-
value: re(
|
|
621
|
+
value: re(n),
|
|
617
622
|
metadata: {
|
|
618
623
|
kind: "temporal_bucket",
|
|
619
624
|
granularity: m,
|
|
620
|
-
calendar: { tz:
|
|
625
|
+
calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
|
|
621
626
|
},
|
|
622
627
|
format: $e({
|
|
623
628
|
metadata: {
|
|
624
629
|
kind: "temporal_bucket",
|
|
625
630
|
granularity: m,
|
|
626
|
-
calendar: { tz:
|
|
631
|
+
calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
|
|
627
632
|
},
|
|
628
633
|
locale: r.locale,
|
|
629
634
|
styles: { dateStyle: a, dateTime: { ...r.dateTime } }
|
|
@@ -635,34 +640,34 @@ function mr(e, t, r, n) {
|
|
|
635
640
|
timeZone: "UTC",
|
|
636
641
|
dateStyle: a
|
|
637
642
|
});
|
|
638
|
-
return
|
|
643
|
+
return vr(n, i) ? l.format(H(n)) : Ke(l, H(n), H(i));
|
|
639
644
|
}
|
|
640
|
-
function
|
|
645
|
+
function fr(e, t, r, o) {
|
|
641
646
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
642
|
-
return
|
|
647
|
+
return ze(
|
|
643
648
|
e.map(
|
|
644
|
-
(l) =>
|
|
649
|
+
(l) => Be(
|
|
645
650
|
l.toISOString(),
|
|
646
651
|
"instant",
|
|
647
652
|
t.pattern,
|
|
648
653
|
r,
|
|
649
|
-
|
|
654
|
+
o
|
|
650
655
|
)
|
|
651
656
|
)
|
|
652
657
|
);
|
|
653
|
-
const
|
|
658
|
+
const n = new Intl.DateTimeFormat(r.locale, {
|
|
654
659
|
calendar: "gregory",
|
|
655
|
-
timeZone:
|
|
660
|
+
timeZone: o.tz,
|
|
656
661
|
dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : r.dateTime.dateStyle,
|
|
657
662
|
timeStyle: r.dateTime.timeStyle
|
|
658
663
|
}), [i, a] = e;
|
|
659
|
-
return a && a.getTime() !== i.getTime() ?
|
|
664
|
+
return a && a.getTime() !== i.getTime() ? Ke(n, i, a) : n.format(i);
|
|
660
665
|
}
|
|
661
|
-
function
|
|
662
|
-
const
|
|
663
|
-
return typeof
|
|
666
|
+
function Ke(e, t, r) {
|
|
667
|
+
const o = e;
|
|
668
|
+
return typeof o.formatRange == "function" ? o.formatRange(t, r) : `${e.format(t)}${se}${e.format(r)}`;
|
|
664
669
|
}
|
|
665
|
-
function
|
|
670
|
+
function Be(e, t, r, o, n) {
|
|
666
671
|
const i = nt({
|
|
667
672
|
format: {
|
|
668
673
|
type: "raw_temporal",
|
|
@@ -670,48 +675,48 @@ function Ke(e, t, r, n, o) {
|
|
|
670
675
|
},
|
|
671
676
|
// Temporal formatting reads no currency.
|
|
672
677
|
preferences: {
|
|
673
|
-
...
|
|
674
|
-
defaultCurrency:
|
|
678
|
+
...o,
|
|
679
|
+
defaultCurrency: At.defaultCurrency
|
|
675
680
|
},
|
|
676
|
-
calendar: { tz:
|
|
677
|
-
}), a = t === "date" &&
|
|
678
|
-
return
|
|
679
|
-
value: a === t ? e :
|
|
681
|
+
calendar: { tz: n.tz }
|
|
682
|
+
}), a = t === "date" && gr(r) ? "instant" : t;
|
|
683
|
+
return at({
|
|
684
|
+
value: a === t ? e : ne(`${e}T00:00:00`, n.tz).toISOString(),
|
|
680
685
|
metadata: { kind: "raw_temporal", valueKind: a },
|
|
681
686
|
format: i
|
|
682
687
|
}).text;
|
|
683
688
|
}
|
|
684
|
-
function
|
|
689
|
+
function gr(e) {
|
|
685
690
|
return /HH|mm|ss/.test(e);
|
|
686
691
|
}
|
|
687
|
-
function
|
|
692
|
+
function ze(e) {
|
|
688
693
|
return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(se);
|
|
689
694
|
}
|
|
690
|
-
function
|
|
691
|
-
const r =
|
|
695
|
+
function pr(e, t) {
|
|
696
|
+
const r = lr.exec(e);
|
|
692
697
|
if (r) {
|
|
693
|
-
const
|
|
698
|
+
const n = {
|
|
694
699
|
year: Number(r[1]),
|
|
695
700
|
month: Number(r[2]),
|
|
696
701
|
day: Number(r[3])
|
|
697
702
|
};
|
|
698
|
-
return
|
|
703
|
+
return Tr(n) ? { kind: "date", date: n } : null;
|
|
699
704
|
}
|
|
700
|
-
const
|
|
701
|
-
return
|
|
705
|
+
const o = ur.test(e) ? new Date(e.replace(" ", "T")) : cr.test(e) ? ne(e.replace(" ", "T"), t) : null;
|
|
706
|
+
return o && !Number.isNaN(o.getTime()) ? { kind: "instant", instant: o } : null;
|
|
702
707
|
}
|
|
703
|
-
function
|
|
704
|
-
return e.kind === "instant" ? e.instant :
|
|
708
|
+
function yr(e, t) {
|
|
709
|
+
return e.kind === "instant" ? e.instant : ne(`${re(e.date)}T00:00:00`, t);
|
|
705
710
|
}
|
|
706
|
-
function
|
|
711
|
+
function hr(e, t, r) {
|
|
707
712
|
if (e.kind === "date") return e.date;
|
|
708
|
-
const
|
|
709
|
-
if (
|
|
710
|
-
const a =
|
|
711
|
-
return t === "end" && a ?
|
|
713
|
+
const o = Lt(e.instant, r), n = { year: o.year, month: o.month, day: o.day };
|
|
714
|
+
if (o.hour === 0 && o.minute === 0 && o.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? n : wr(n, -1);
|
|
715
|
+
const a = o.hour === 23 && o.minute === 59 && o.second === 59;
|
|
716
|
+
return t === "end" && a ? n : null;
|
|
712
717
|
}
|
|
713
|
-
function
|
|
714
|
-
return r.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !==
|
|
718
|
+
function br(e, t, r) {
|
|
719
|
+
return r.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== je(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
|
|
715
720
|
}
|
|
716
721
|
function re(e) {
|
|
717
722
|
return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
|
|
@@ -720,7 +725,7 @@ function H(e) {
|
|
|
720
725
|
const t = /* @__PURE__ */ new Date(0);
|
|
721
726
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
|
|
722
727
|
}
|
|
723
|
-
function
|
|
728
|
+
function wr(e, t) {
|
|
724
729
|
const r = H(e);
|
|
725
730
|
return r.setUTCDate(r.getUTCDate() + t), {
|
|
726
731
|
year: r.getUTCFullYear(),
|
|
@@ -728,87 +733,87 @@ function br(e, t) {
|
|
|
728
733
|
day: r.getUTCDate()
|
|
729
734
|
};
|
|
730
735
|
}
|
|
731
|
-
function
|
|
736
|
+
function vr(e, t) {
|
|
732
737
|
return e.year === t.year && e.month === t.month && e.day === t.day;
|
|
733
738
|
}
|
|
734
|
-
function
|
|
739
|
+
function je(e, t) {
|
|
735
740
|
return new Date(Date.UTC(e, t, 0)).getUTCDate();
|
|
736
741
|
}
|
|
737
|
-
function
|
|
738
|
-
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <=
|
|
742
|
+
function Tr(e) {
|
|
743
|
+
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= je(e.year, e.month);
|
|
739
744
|
}
|
|
740
|
-
const
|
|
745
|
+
const Cr = "__TOTAL__";
|
|
741
746
|
function W(e) {
|
|
742
747
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
743
748
|
}
|
|
744
|
-
function
|
|
745
|
-
return e ===
|
|
749
|
+
function oe(e) {
|
|
750
|
+
return e === Cr;
|
|
746
751
|
}
|
|
747
|
-
function
|
|
748
|
-
const t = /* @__PURE__ */ new Map(), r = (e.groupByColumns ?? []).map((
|
|
752
|
+
function xr(e) {
|
|
753
|
+
const t = /* @__PURE__ */ new Map(), r = (e.groupByColumns ?? []).map((n, i) => {
|
|
749
754
|
var u, g, p;
|
|
750
|
-
if (!W(
|
|
755
|
+
if (!W(n))
|
|
751
756
|
throw new Error(`Aggregate groupByColumns[${i}] is invalid`);
|
|
752
|
-
const a = typeof
|
|
757
|
+
const a = typeof n.id == "string" && n.id.length > 0 ? n.id : void 0, l = a ? (p = (g = (u = e.columnKeyMap) == null ? void 0 : u.byRole) == null ? void 0 : g.groupby) == null ? void 0 : p[a] : void 0, m = (l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || (typeof n.alias == "string" && n.alias.length > 0 ? n.alias : typeof n.name == "string" && n.name.length > 0 ? n.name : void 0);
|
|
753
758
|
if (!m)
|
|
754
759
|
throw new Error(`Aggregate groupByColumns[${i}] has no output key`);
|
|
755
|
-
return [a,
|
|
760
|
+
return [a, n.alias, n.name, m].forEach((v) => {
|
|
756
761
|
typeof v == "string" && v.length > 0 && t.set(v, m);
|
|
757
762
|
}), m;
|
|
758
|
-
}),
|
|
763
|
+
}), o = (e.rowAggregates ?? []).flatMap((n) => !W(n) || typeof n.function != "string" || typeof n.groupLevel != "string" ? [] : [
|
|
759
764
|
{
|
|
760
|
-
function:
|
|
761
|
-
groupLevel:
|
|
762
|
-
...typeof
|
|
765
|
+
function: n.function,
|
|
766
|
+
groupLevel: n.groupLevel === "ALL" ? "ALL" : t.get(n.groupLevel) || n.groupLevel,
|
|
767
|
+
...typeof n.label == "string" ? { label: n.label } : {}
|
|
763
768
|
}
|
|
764
769
|
]);
|
|
765
|
-
return { groupColumnKeys: r, rowAggregates:
|
|
770
|
+
return { groupColumnKeys: r, rowAggregates: o };
|
|
766
771
|
}
|
|
767
|
-
function
|
|
772
|
+
function Ge(e) {
|
|
768
773
|
return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
769
774
|
}
|
|
770
|
-
function
|
|
775
|
+
function Sr(e) {
|
|
771
776
|
var r;
|
|
772
777
|
if (e.customLabel) return e.customLabel;
|
|
773
|
-
const t =
|
|
774
|
-
if (e.levelValue !== void 0 && !
|
|
778
|
+
const t = Ge(e.aggregateFunction);
|
|
779
|
+
if (e.levelValue !== void 0 && !oe(e.levelValue)) {
|
|
775
780
|
if (e.levelValue === null) {
|
|
776
|
-
const
|
|
777
|
-
return
|
|
781
|
+
const n = (r = e.formatValue) == null ? void 0 : r.call(e, null);
|
|
782
|
+
return n ? `Subtotal ${n}` : `Subtotal ${t}`;
|
|
778
783
|
}
|
|
779
|
-
const
|
|
780
|
-
if (
|
|
784
|
+
const o = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
|
|
785
|
+
if (o) return `Subtotal (${o})`;
|
|
781
786
|
}
|
|
782
787
|
return `Subtotal ${t}`;
|
|
783
788
|
}
|
|
784
|
-
function
|
|
785
|
-
return t || `Grand ${
|
|
789
|
+
function Er(e, t) {
|
|
790
|
+
return t || `Grand ${Ge(e)}`;
|
|
786
791
|
}
|
|
787
|
-
function
|
|
792
|
+
function Lo(e) {
|
|
788
793
|
const t = e.context.groupColumnKeys.indexOf(e.columnKey);
|
|
789
794
|
if (t < 0)
|
|
790
795
|
throw new Error(
|
|
791
796
|
`Aggregate group column "${e.columnKey}" is unknown`
|
|
792
797
|
);
|
|
793
|
-
return
|
|
798
|
+
return er({
|
|
794
799
|
row: e.row,
|
|
795
800
|
previousRow: e.previousRow,
|
|
796
801
|
levelIndex: t,
|
|
797
|
-
getValue: (r,
|
|
802
|
+
getValue: (r, o) => r[e.context.groupColumnKeys[o]]
|
|
798
803
|
});
|
|
799
804
|
}
|
|
800
|
-
function
|
|
801
|
-
var
|
|
805
|
+
function He(e) {
|
|
806
|
+
var o, n;
|
|
802
807
|
const t = e.context.groupColumnKeys, r = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
|
|
803
808
|
if (e.row.isGrandTotal === !0) {
|
|
804
|
-
const i = (
|
|
809
|
+
const i = (o = e.context.rowAggregates.find(
|
|
805
810
|
(a) => a.groupLevel === "ALL"
|
|
806
|
-
)) == null ? void 0 :
|
|
811
|
+
)) == null ? void 0 : o.label;
|
|
807
812
|
return {
|
|
808
813
|
kind: "grand-total",
|
|
809
814
|
cells: t.map((a, l) => ({
|
|
810
815
|
columnKey: a,
|
|
811
|
-
text: l === 0 ?
|
|
816
|
+
text: l === 0 ? Er(r, i) : "",
|
|
812
817
|
placement: l === 0 ? "label" : "empty",
|
|
813
818
|
colSpan: l === 0 ? t.length : 1
|
|
814
819
|
}))
|
|
@@ -822,9 +827,9 @@ function Ge(e) {
|
|
|
822
827
|
throw new Error(
|
|
823
828
|
`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
|
|
824
829
|
);
|
|
825
|
-
const a = W(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = W(a == null ? void 0 : a.groupByValues) ? a.groupByValues : {}, m = (
|
|
830
|
+
const a = W(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = W(a == null ? void 0 : a.groupByValues) ? a.groupByValues : {}, m = (n = e.context.rowAggregates.find(
|
|
826
831
|
(u) => u.groupLevel === e.row.subtotalLevel && u.function === r
|
|
827
|
-
)) == null ? void 0 :
|
|
832
|
+
)) == null ? void 0 : n.label;
|
|
828
833
|
return {
|
|
829
834
|
kind: "subtotal",
|
|
830
835
|
cells: t.map((u, g) => {
|
|
@@ -839,14 +844,14 @@ function Ge(e) {
|
|
|
839
844
|
const p = e.row[u];
|
|
840
845
|
return {
|
|
841
846
|
columnKey: u,
|
|
842
|
-
text: p === void 0 ||
|
|
847
|
+
text: p === void 0 || oe(p) ? "" : e.formatValue(p, u),
|
|
843
848
|
placement: "value",
|
|
844
849
|
colSpan: 1
|
|
845
850
|
};
|
|
846
851
|
}
|
|
847
852
|
return {
|
|
848
853
|
columnKey: u,
|
|
849
|
-
text:
|
|
854
|
+
text: Sr({
|
|
850
855
|
aggregateFunction: r,
|
|
851
856
|
customLabel: m,
|
|
852
857
|
levelValue: l[u],
|
|
@@ -864,99 +869,99 @@ function Ge(e) {
|
|
|
864
869
|
const a = e.row[i];
|
|
865
870
|
return {
|
|
866
871
|
columnKey: i,
|
|
867
|
-
text: a === void 0 ||
|
|
872
|
+
text: a === void 0 || oe(a) ? "" : e.formatValue(a, i),
|
|
868
873
|
placement: "value",
|
|
869
874
|
colSpan: 1
|
|
870
875
|
};
|
|
871
876
|
})
|
|
872
877
|
};
|
|
873
878
|
}
|
|
874
|
-
function
|
|
875
|
-
const t =
|
|
879
|
+
function Fo(e) {
|
|
880
|
+
const t = He(e).cells.find(
|
|
876
881
|
(r) => r.columnKey === e.columnKey
|
|
877
882
|
);
|
|
878
883
|
if (!t)
|
|
879
884
|
throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
|
|
880
885
|
return t.text;
|
|
881
886
|
}
|
|
882
|
-
function Er(e) {
|
|
883
|
-
return Ge(e).cells.map((t) => t.text);
|
|
884
|
-
}
|
|
885
887
|
function kr(e) {
|
|
888
|
+
return He(e).cells.map((t) => t.text);
|
|
889
|
+
}
|
|
890
|
+
function Ar(e) {
|
|
886
891
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
887
892
|
}
|
|
888
|
-
function
|
|
893
|
+
function Lr(e, t) {
|
|
889
894
|
if ((e == null ? void 0 : e.cardType) !== "aggregateTable") return;
|
|
890
|
-
const r =
|
|
891
|
-
if (n !== void 0 && !Array.isArray(n))
|
|
892
|
-
throw new Error("Aggregate export groupByColumns is invalid");
|
|
895
|
+
const r = Ar(e.cardConfig) ? e.cardConfig : void 0, o = r == null ? void 0 : r.groupByColumns, n = r == null ? void 0 : r.rowAggregates;
|
|
893
896
|
if (o !== void 0 && !Array.isArray(o))
|
|
897
|
+
throw new Error("Aggregate export groupByColumns is invalid");
|
|
898
|
+
if (n !== void 0 && !Array.isArray(n))
|
|
894
899
|
throw new Error("Aggregate export rowAggregates is invalid");
|
|
895
|
-
return
|
|
896
|
-
groupByColumns:
|
|
897
|
-
rowAggregates:
|
|
900
|
+
return xr({
|
|
901
|
+
groupByColumns: o,
|
|
902
|
+
rowAggregates: n,
|
|
898
903
|
columnKeyMap: t
|
|
899
904
|
});
|
|
900
905
|
}
|
|
901
|
-
function
|
|
906
|
+
function Fr(e) {
|
|
902
907
|
if (!e.aggregateContext || !e.useFormattedValues || e.row.isSubtotal !== !0 && e.row.isGrandTotal !== !0)
|
|
903
908
|
return;
|
|
904
|
-
const t =
|
|
909
|
+
const t = kr({
|
|
905
910
|
row: e.row,
|
|
906
911
|
context: e.aggregateContext,
|
|
907
|
-
formatValue: (r,
|
|
912
|
+
formatValue: (r, o) => e.visibleColumnKeys.has(o) ? e.formatGroupValue(r, o) : ""
|
|
908
913
|
});
|
|
909
914
|
return new Map(
|
|
910
|
-
e.aggregateContext.groupColumnKeys.map((r,
|
|
915
|
+
e.aggregateContext.groupColumnKeys.map((r, o) => [
|
|
911
916
|
r,
|
|
912
|
-
t[
|
|
917
|
+
t[o]
|
|
913
918
|
])
|
|
914
919
|
);
|
|
915
920
|
}
|
|
916
|
-
function
|
|
921
|
+
function Mr(e, t) {
|
|
917
922
|
return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === void 0;
|
|
918
923
|
}
|
|
919
|
-
function
|
|
924
|
+
function Xe(e) {
|
|
920
925
|
return new Map(
|
|
921
926
|
e.presentationExecutionSnapshot.resolvedFormats.flatMap(
|
|
922
|
-
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" &&
|
|
927
|
+
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" && Mr(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
|
|
923
928
|
)
|
|
924
929
|
);
|
|
925
930
|
}
|
|
926
|
-
function
|
|
931
|
+
function We(e) {
|
|
927
932
|
const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
|
|
928
933
|
return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
|
|
929
934
|
}
|
|
930
|
-
function
|
|
931
|
-
return e.formatting.useFormattedValues !== !1 &&
|
|
935
|
+
function Mo(e) {
|
|
936
|
+
return e.formatting.useFormattedValues !== !1 && We(e.queryPayload) && Xe(e.formatting).size > 0;
|
|
932
937
|
}
|
|
933
|
-
function
|
|
934
|
-
return e.map((r,
|
|
938
|
+
function Ir(e, t) {
|
|
939
|
+
return e.map((r, o) => {
|
|
935
940
|
if (!Object.prototype.hasOwnProperty.call(r, t) || r[t] === void 0)
|
|
936
941
|
throw new Error(
|
|
937
|
-
`missing_raw_temporal_result_contract: Row ${
|
|
942
|
+
`missing_raw_temporal_result_contract: Row ${o} is missing declared temporal column "${t}".`
|
|
938
943
|
);
|
|
939
|
-
const
|
|
940
|
-
return
|
|
944
|
+
const n = r[t];
|
|
945
|
+
return n === null || typeof n == "string" ? n : String(n);
|
|
941
946
|
});
|
|
942
947
|
}
|
|
943
|
-
function
|
|
948
|
+
function $r(e) {
|
|
944
949
|
if (e.formatting.useFormattedValues === !1)
|
|
945
950
|
return {
|
|
946
951
|
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
947
952
|
byColumnKey: /* @__PURE__ */ new Map()
|
|
948
953
|
};
|
|
949
|
-
const t =
|
|
954
|
+
const t = Xe(e.formatting), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
950
955
|
if (t.size === 0)
|
|
951
|
-
return { activatedColumnKeys: r, byColumnKey:
|
|
952
|
-
const
|
|
956
|
+
return { activatedColumnKeys: r, byColumnKey: o };
|
|
957
|
+
const n = new Map(
|
|
953
958
|
e.columns.flatMap((l) => {
|
|
954
959
|
const m = l.key || l.field;
|
|
955
960
|
return m ? [[m, l]] : [];
|
|
956
961
|
})
|
|
957
|
-
), i =
|
|
962
|
+
), i = We(e.queryPayload), a = /* @__PURE__ */ new Map();
|
|
958
963
|
for (const [l, m] of t) {
|
|
959
|
-
const u =
|
|
964
|
+
const u = n.get(l);
|
|
960
965
|
let g;
|
|
961
966
|
if (u != null && u.rawTemporal)
|
|
962
967
|
g = It(u, {
|
|
@@ -964,28 +969,28 @@ function Ir(e) {
|
|
|
964
969
|
}), r.add(l);
|
|
965
970
|
else if (i) {
|
|
966
971
|
r.add(l);
|
|
967
|
-
const p =
|
|
972
|
+
const p = it({
|
|
968
973
|
columnKey: l,
|
|
969
|
-
values:
|
|
974
|
+
values: Ir(e.records, l)
|
|
970
975
|
});
|
|
971
976
|
a.set(l, p), p.status === "classified" && (g = p.metadata);
|
|
972
977
|
} else
|
|
973
978
|
continue;
|
|
974
|
-
g &&
|
|
979
|
+
g && o.set(l, {
|
|
975
980
|
metadata: g,
|
|
976
981
|
format: m,
|
|
977
|
-
formatValue:
|
|
982
|
+
formatValue: lt({ metadata: g, format: m })
|
|
978
983
|
});
|
|
979
984
|
}
|
|
980
985
|
return {
|
|
981
986
|
activatedColumnKeys: r,
|
|
982
|
-
byColumnKey:
|
|
987
|
+
byColumnKey: o,
|
|
983
988
|
...i ? {
|
|
984
|
-
sqlChunkEvidence:
|
|
989
|
+
sqlChunkEvidence: ct(a)
|
|
985
990
|
} : {}
|
|
986
991
|
};
|
|
987
992
|
}
|
|
988
|
-
function
|
|
993
|
+
function _r(e) {
|
|
989
994
|
if (!e.resolution.activatedColumnKeys.has(e.columnKey))
|
|
990
995
|
return;
|
|
991
996
|
if (e.value === void 0)
|
|
@@ -1004,7 +1009,7 @@ function Se(e, t) {
|
|
|
1004
1009
|
const r = e.byColumnKey.get(t);
|
|
1005
1010
|
return r ? r.metadata.valueKind === "date" : void 0;
|
|
1006
1011
|
}
|
|
1007
|
-
const
|
|
1012
|
+
const Dr = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), Rr = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, Pr = /^\d{4}-\d{2}-\d{2}$/, Ye = "MM/dd/yyyy";
|
|
1008
1013
|
function Y(e) {
|
|
1009
1014
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1010
1015
|
}
|
|
@@ -1015,40 +1020,40 @@ function Q(e) {
|
|
|
1015
1020
|
return e == null ? "" : typeof e == "string" ? e : U(e) ? e.value : e instanceof Date ? e.toISOString() : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
1016
1021
|
}
|
|
1017
1022
|
function Ee(e, t) {
|
|
1018
|
-
var
|
|
1019
|
-
const r = (
|
|
1023
|
+
var o;
|
|
1024
|
+
const r = (o = e.columnSettings) == null ? void 0 : o[t];
|
|
1020
1025
|
if (!(!Y(r) || r.type !== "date"))
|
|
1021
1026
|
return Y(r.dateFormat) ? r.dateFormat : {};
|
|
1022
1027
|
}
|
|
1023
1028
|
function ke(e) {
|
|
1024
|
-
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format ||
|
|
1029
|
+
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || Ye;
|
|
1025
1030
|
}
|
|
1026
1031
|
function Ae(e, t) {
|
|
1027
1032
|
return e && e !== "auto" ? e : t;
|
|
1028
1033
|
}
|
|
1029
|
-
function
|
|
1034
|
+
function Nr(e) {
|
|
1030
1035
|
return !/[HhKkmsSa]/.test(e.replace(/'[^']*'/g, ""));
|
|
1031
1036
|
}
|
|
1032
|
-
function
|
|
1037
|
+
function Or(e) {
|
|
1033
1038
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
1034
1039
|
if (typeof e != "string" || !e.trim()) return null;
|
|
1035
1040
|
const t = Number(e);
|
|
1036
1041
|
return Number.isFinite(t) ? t : null;
|
|
1037
1042
|
}
|
|
1038
|
-
function
|
|
1043
|
+
function Vr(e) {
|
|
1039
1044
|
const t = Oe(e);
|
|
1040
1045
|
if (t !== void 0)
|
|
1041
1046
|
try {
|
|
1042
|
-
return
|
|
1047
|
+
return bt(t, /[.eE]/.test(t) ? "decimal" : "integer");
|
|
1043
1048
|
} catch {
|
|
1044
1049
|
return;
|
|
1045
1050
|
}
|
|
1046
1051
|
}
|
|
1047
|
-
function
|
|
1052
|
+
function Ur(e) {
|
|
1048
1053
|
return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
|
|
1049
1054
|
}
|
|
1050
|
-
function
|
|
1051
|
-
const { formatting: t, queryPayload: r } = e,
|
|
1055
|
+
function Io(e) {
|
|
1056
|
+
const { formatting: t, queryPayload: r } = e, o = t.useFormattedValues, n = t.scope, i = (s) => vt({ snapshot: t.presentationExecutionSnapshot, scope: n, target: { kind: "column", columnKey: s } }), a = (s) => Tt({ snapshot: t.presentationExecutionSnapshot, scope: n, target: { kind: "column", columnKey: s } });
|
|
1052
1057
|
function l(s) {
|
|
1053
1058
|
var b;
|
|
1054
1059
|
if ((b = t.visibleColumns) != null && b.length) return t.visibleColumns;
|
|
@@ -1065,13 +1070,13 @@ function Ln(e) {
|
|
|
1065
1070
|
return Ft({
|
|
1066
1071
|
members: y,
|
|
1067
1072
|
metricLabel: (s == null ? void 0 : s.label) || (s == null ? void 0 : s.headerName),
|
|
1068
|
-
mode:
|
|
1073
|
+
mode: o ? "formatted" : "canonical",
|
|
1069
1074
|
resolveTemporalFormat: (S) => {
|
|
1070
1075
|
const w = y.find((x) => x.fieldId === S);
|
|
1071
1076
|
if (!(w != null && w.temporalBucket)) return;
|
|
1072
1077
|
const C = pe({
|
|
1073
1078
|
snapshot: t.presentationExecutionSnapshot,
|
|
1074
|
-
scope:
|
|
1079
|
+
scope: n,
|
|
1075
1080
|
target: { kind: "field", fieldId: S, role: "pivotby" }
|
|
1076
1081
|
});
|
|
1077
1082
|
return C ? g(w.temporalBucket, C) : void 0;
|
|
@@ -1105,7 +1110,7 @@ function Ln(e) {
|
|
|
1105
1110
|
const h = N(c);
|
|
1106
1111
|
return h ? [[h, c]] : [];
|
|
1107
1112
|
})
|
|
1108
|
-
), F = new Map(s.resultColumns.map((c) => [c.key, c.dataType])), M =
|
|
1113
|
+
), F = new Map(s.resultColumns.map((c) => [c.key, c.dataType])), M = $r({
|
|
1109
1114
|
records: b,
|
|
1110
1115
|
columns: y,
|
|
1111
1116
|
formatting: t,
|
|
@@ -1119,29 +1124,29 @@ function Ln(e) {
|
|
|
1119
1124
|
for (const c of w) {
|
|
1120
1125
|
const h = pe({
|
|
1121
1126
|
snapshot: t.presentationExecutionSnapshot,
|
|
1122
|
-
scope:
|
|
1127
|
+
scope: n,
|
|
1123
1128
|
target: { kind: "column", columnKey: c }
|
|
1124
1129
|
}), T = K.get(c);
|
|
1125
|
-
if (
|
|
1130
|
+
if (o) {
|
|
1126
1131
|
if (h && !T) throw new Error(`Missing temporal bucket metadata for column "${c}"`);
|
|
1127
1132
|
if (T && !h) throw new Error(`Missing resolved temporal presentation for column "${c}"`);
|
|
1128
1133
|
}
|
|
1129
1134
|
h && T && le.set(c, g(T, h));
|
|
1130
1135
|
}
|
|
1131
|
-
const
|
|
1132
|
-
const h = F.get(c), T = h &&
|
|
1136
|
+
const qe = K.size > 0 && e.cardType === "aggregateTable" ? Lr(r, s.columnKeyMap) : void 0, B = w.map((c) => {
|
|
1137
|
+
const h = F.get(c), T = h && Dr.has(h) ? h : "unknown", E = o ? v(c, M, K) : void 0, k = m(c, x.get(c)), A = o && M.activatedColumnKeys.has(c) && Se(M, c) === void 0;
|
|
1133
1138
|
return {
|
|
1134
1139
|
key: c,
|
|
1135
1140
|
label: k,
|
|
1136
1141
|
dataType: T,
|
|
1137
1142
|
...E ? { presentation: E } : {},
|
|
1138
|
-
xlsx: ve({ key: c, label: k, formattedValues:
|
|
1143
|
+
xlsx: ve({ key: c, label: k, formattedValues: o, dataType: T, presentation: E }),
|
|
1139
1144
|
...A ? { xlsxPending: !0 } : {}
|
|
1140
1145
|
};
|
|
1141
1146
|
});
|
|
1142
1147
|
function ce(c, h, T, E) {
|
|
1143
|
-
if (!
|
|
1144
|
-
const k =
|
|
1148
|
+
if (!o) return { text: Q(c), value: c };
|
|
1149
|
+
const k = _r({ value: c, columnKey: h, rowIndex: T, resolution: M });
|
|
1145
1150
|
if (k !== void 0) return { text: k.text, value: c, ...k.wallClock ? { wallClock: k.wallClock } : {} };
|
|
1146
1151
|
const A = K.get(h);
|
|
1147
1152
|
if (A) {
|
|
@@ -1149,7 +1154,7 @@ function Ln(e) {
|
|
|
1149
1154
|
if (!L) throw new Error(`Missing resolved temporal presentation for column "${h}"`);
|
|
1150
1155
|
if (c != null && typeof c != "string")
|
|
1151
1156
|
throw new Error(`Canonical temporal column "${h}" must contain a string or null`);
|
|
1152
|
-
const D = c ?? null, R =
|
|
1157
|
+
const D = c ?? null, R = ut(D, A);
|
|
1153
1158
|
return {
|
|
1154
1159
|
text: Ie({ value: D, metadata: A, format: L }),
|
|
1155
1160
|
value: c,
|
|
@@ -1162,7 +1167,7 @@ function Ln(e) {
|
|
|
1162
1167
|
return {
|
|
1163
1168
|
text: ge(
|
|
1164
1169
|
new Date(c).toISOString(),
|
|
1165
|
-
_.pattern ||
|
|
1170
|
+
_.pattern || Ye,
|
|
1166
1171
|
Ae(_.timezone, t.timezone),
|
|
1167
1172
|
"UTC"
|
|
1168
1173
|
),
|
|
@@ -1174,8 +1179,8 @@ function Ln(e) {
|
|
|
1174
1179
|
if (U(c))
|
|
1175
1180
|
return { text: I ? j(c, I) : c.value, value: c };
|
|
1176
1181
|
const z = Ee(t, h);
|
|
1177
|
-
if (z && (c instanceof Date || typeof c == "string" &&
|
|
1178
|
-
const L = c instanceof Date ? c.toISOString() : c, D = typeof c == "string" &&
|
|
1182
|
+
if (z && (c instanceof Date || typeof c == "string" && Rr.test(c))) {
|
|
1183
|
+
const L = c instanceof Date ? c.toISOString() : c, D = typeof c == "string" && Pr.test(c), R = D ? "UTC" : Ae(z.timezone, t.timezone), me = D ? "UTC" : z.sourceTimezone || "auto", de = ft(L, R, me);
|
|
1179
1184
|
return {
|
|
1180
1185
|
text: ge(L, ke(z), R, me),
|
|
1181
1186
|
value: c,
|
|
@@ -1183,16 +1188,16 @@ function Ln(e) {
|
|
|
1183
1188
|
};
|
|
1184
1189
|
}
|
|
1185
1190
|
if (typeof c == "string" && I && E.dataType === "number") {
|
|
1186
|
-
const L =
|
|
1191
|
+
const L = Vr(c);
|
|
1187
1192
|
if (L) return { text: j(L, I), value: c };
|
|
1188
1193
|
}
|
|
1189
1194
|
return { text: Q(c), value: c };
|
|
1190
1195
|
}
|
|
1191
|
-
const
|
|
1192
|
-
const T =
|
|
1196
|
+
const Je = b.map((c, h) => {
|
|
1197
|
+
const T = Fr({
|
|
1193
1198
|
row: c,
|
|
1194
|
-
aggregateContext:
|
|
1195
|
-
useFormattedValues:
|
|
1199
|
+
aggregateContext: qe,
|
|
1200
|
+
useFormattedValues: o,
|
|
1196
1201
|
visibleColumnKeys: C,
|
|
1197
1202
|
formatGroupValue: (E, k) => {
|
|
1198
1203
|
const A = B.find((_) => _.key === k);
|
|
@@ -1214,7 +1219,7 @@ function Ln(e) {
|
|
|
1214
1219
|
return {
|
|
1215
1220
|
...ue ? { header: B.map((c) => c.label) } : {},
|
|
1216
1221
|
columns: B,
|
|
1217
|
-
rows:
|
|
1222
|
+
rows: Je,
|
|
1218
1223
|
...M.sqlChunkEvidence ? { rawTemporalClassification: M.sqlChunkEvidence } : {}
|
|
1219
1224
|
};
|
|
1220
1225
|
}
|
|
@@ -1224,10 +1229,10 @@ function Ln(e) {
|
|
|
1224
1229
|
return C === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: C };
|
|
1225
1230
|
}
|
|
1226
1231
|
const y = b.get(s);
|
|
1227
|
-
if (y) return { kind: "temporal_bucket", grain:
|
|
1232
|
+
if (y) return { kind: "temporal_bucket", grain: Ur(y) };
|
|
1228
1233
|
if (a(s)) return { kind: "text" };
|
|
1229
1234
|
const S = Ee(t, s);
|
|
1230
|
-
if (S) return { kind: "datetime", dateOnly:
|
|
1235
|
+
if (S) return { kind: "datetime", dateOnly: Nr(ke(S)) };
|
|
1231
1236
|
const w = i(s);
|
|
1232
1237
|
return w ? { kind: "measure", format: w } : void 0;
|
|
1233
1238
|
}
|
|
@@ -1235,22 +1240,22 @@ function Ln(e) {
|
|
|
1235
1240
|
if (!Number.isInteger(f) || f < 0)
|
|
1236
1241
|
throw new Error("totalRows must be a non-negative integer");
|
|
1237
1242
|
return f === 0 ? void 0 : (t.visibleColumns ?? Object.keys(s)).map((y) => {
|
|
1238
|
-
const w = Object.prototype.hasOwnProperty.call(s, y) ? s[y] : y === t.tableTotalsLabelColumnKey ? "Total" : null, C =
|
|
1243
|
+
const w = Object.prototype.hasOwnProperty.call(s, y) ? s[y] : y === t.tableTotalsLabelColumnKey ? "Total" : null, C = o ? i(y) : void 0, x = ve({
|
|
1239
1244
|
key: y,
|
|
1240
1245
|
label: y,
|
|
1241
|
-
formattedValues:
|
|
1246
|
+
formattedValues: o,
|
|
1242
1247
|
dataType: "unknown",
|
|
1243
1248
|
...C ? { presentation: { kind: "measure", format: C } } : {}
|
|
1244
1249
|
});
|
|
1245
1250
|
if (w == null) return { kind: "empty" };
|
|
1246
|
-
if (!
|
|
1247
|
-
const F = C ?
|
|
1251
|
+
if (!o) return P({ value: w, text: String(w), column: x });
|
|
1252
|
+
const F = C ? Or(w) : null;
|
|
1248
1253
|
return P(C && F !== null ? { value: F, text: j(F, C), column: x } : { value: w, text: String(w), column: x });
|
|
1249
1254
|
});
|
|
1250
1255
|
}
|
|
1251
1256
|
return { format: p, totals: d };
|
|
1252
1257
|
}
|
|
1253
|
-
const
|
|
1258
|
+
const Kr = /* @__PURE__ */ new Set([
|
|
1254
1259
|
"scope",
|
|
1255
1260
|
"useFormattedValues",
|
|
1256
1261
|
"timezone",
|
|
@@ -1275,7 +1280,7 @@ function Le(e, t) {
|
|
|
1275
1280
|
return e;
|
|
1276
1281
|
}
|
|
1277
1282
|
}
|
|
1278
|
-
function
|
|
1283
|
+
function $o(e) {
|
|
1279
1284
|
if (!ie(e))
|
|
1280
1285
|
throw new Error("formatting must be an object");
|
|
1281
1286
|
const t = ["reportContext", "resolvedFormats"].find(
|
|
@@ -1285,23 +1290,23 @@ function Fn(e) {
|
|
|
1285
1290
|
throw new ye(
|
|
1286
1291
|
`formatting.${t} is retired; formatting.presentationExecutionSnapshot is authoritative.`
|
|
1287
1292
|
);
|
|
1288
|
-
const r = Object.keys(e).find((s) => !
|
|
1293
|
+
const r = Object.keys(e).find((s) => !Kr.has(s));
|
|
1289
1294
|
if (r)
|
|
1290
1295
|
throw new Error(`formatting contains unknown property "${r}"`);
|
|
1291
|
-
const
|
|
1292
|
-
if (!n)
|
|
1293
|
-
throw new Error("formatting.timezone must be a non-empty string");
|
|
1294
|
-
const o = pt(e.delimiter);
|
|
1296
|
+
const o = typeof e.timezone == "string" ? e.timezone.trim() : "";
|
|
1295
1297
|
if (!o)
|
|
1298
|
+
throw new Error("formatting.timezone must be a non-empty string");
|
|
1299
|
+
const n = gt(e.delimiter);
|
|
1300
|
+
if (!n)
|
|
1296
1301
|
throw new Error("formatting.delimiter must be a comma, semicolon or tab");
|
|
1297
|
-
const i =
|
|
1302
|
+
const i = pt(e.csvEncoding);
|
|
1298
1303
|
if (!i)
|
|
1299
1304
|
throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
|
|
1300
1305
|
if (typeof e.includeHeaders != "boolean")
|
|
1301
1306
|
throw new Error("formatting.includeHeaders must be a boolean");
|
|
1302
1307
|
if (e.useFormattedValues !== void 0 && typeof e.useFormattedValues != "boolean")
|
|
1303
1308
|
throw new Error("formatting.useFormattedValues must be a boolean");
|
|
1304
|
-
const a = e.fileFormat === void 0 ? void 0 :
|
|
1309
|
+
const a = e.fileFormat === void 0 ? void 0 : yt(e.fileFormat);
|
|
1305
1310
|
if (e.fileFormat !== void 0 && !a)
|
|
1306
1311
|
throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
|
|
1307
1312
|
if (e.title !== void 0 && typeof e.title != "string")
|
|
@@ -1317,16 +1322,16 @@ function Fn(e) {
|
|
|
1317
1322
|
throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
|
|
1318
1323
|
if (g && !(l != null && l.includes(g)))
|
|
1319
1324
|
throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
|
|
1320
|
-
const p =
|
|
1325
|
+
const p = Ct(e.scope, "formatting.scope");
|
|
1321
1326
|
if (!p.cardId || p.attachmentIndex !== void 0)
|
|
1322
1327
|
throw new Error("formatting.scope must identify exactly one dashboard card");
|
|
1323
|
-
const v = e.useFormattedValues !== !1, d =
|
|
1324
|
-
if (
|
|
1328
|
+
const v = e.useFormattedValues !== !1, d = xt(e.presentationExecutionSnapshot);
|
|
1329
|
+
if (o !== d.reportContext.calendar.tz)
|
|
1325
1330
|
throw new Error(
|
|
1326
1331
|
"formatting.timezone must equal presentationExecutionSnapshot.reportContext.calendar.tz"
|
|
1327
1332
|
);
|
|
1328
1333
|
try {
|
|
1329
|
-
|
|
1334
|
+
St({
|
|
1330
1335
|
snapshot: d,
|
|
1331
1336
|
expectedScope: { dashboardId: p.dashboardId, cardId: p.cardId },
|
|
1332
1337
|
visibleColumns: l,
|
|
@@ -1340,9 +1345,9 @@ function Fn(e) {
|
|
|
1340
1345
|
return {
|
|
1341
1346
|
scope: { dashboardId: p.dashboardId, cardId: p.cardId },
|
|
1342
1347
|
useFormattedValues: v,
|
|
1343
|
-
timezone:
|
|
1348
|
+
timezone: o,
|
|
1344
1349
|
presentationExecutionSnapshot: d,
|
|
1345
|
-
delimiter:
|
|
1350
|
+
delimiter: n,
|
|
1346
1351
|
csvEncoding: i,
|
|
1347
1352
|
includeHeaders: e.includeHeaders,
|
|
1348
1353
|
...u ? { columnSettings: u } : {},
|
|
@@ -1353,8 +1358,8 @@ function Fn(e) {
|
|
|
1353
1358
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1354
1359
|
};
|
|
1355
1360
|
}
|
|
1356
|
-
function
|
|
1357
|
-
const t = e.formatOptions, r = (
|
|
1361
|
+
function _o(e) {
|
|
1362
|
+
const t = e.formatOptions, r = (o) => ie(o) ? o : void 0;
|
|
1358
1363
|
return {
|
|
1359
1364
|
scope: { dashboardId: e.dashboardId, cardId: e.cardId },
|
|
1360
1365
|
useFormattedValues: t.useFormattedValues !== !1,
|
|
@@ -1371,37 +1376,37 @@ function Mn(e) {
|
|
|
1371
1376
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1372
1377
|
};
|
|
1373
1378
|
}
|
|
1374
|
-
const
|
|
1375
|
-
function
|
|
1379
|
+
const Br = /^\d{4}-\d{2}-\d{2}$/;
|
|
1380
|
+
function Ze(e) {
|
|
1376
1381
|
const t = e.split(".");
|
|
1377
|
-
return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((
|
|
1382
|
+
return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(" ");
|
|
1378
1383
|
}
|
|
1379
1384
|
const Fe = 10;
|
|
1380
1385
|
function ee(e, t) {
|
|
1381
|
-
const r = e.slice(0, Fe).map(t).join(", "),
|
|
1382
|
-
return
|
|
1386
|
+
const r = e.slice(0, Fe).map(t).join(", "), o = e.length - Fe;
|
|
1387
|
+
return o > 0 ? `${r}, and ${o} more` : r;
|
|
1383
1388
|
}
|
|
1384
|
-
function
|
|
1389
|
+
function zr(e) {
|
|
1385
1390
|
if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
|
|
1386
1391
|
return;
|
|
1387
1392
|
const t = ae(e.relativeMeta);
|
|
1388
1393
|
if (t)
|
|
1389
|
-
return
|
|
1394
|
+
return wt(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
|
|
1390
1395
|
}
|
|
1391
|
-
function
|
|
1392
|
-
if (t !== "label") return
|
|
1396
|
+
function jr(e, t) {
|
|
1397
|
+
if (t !== "label") return zr(e);
|
|
1393
1398
|
if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
|
|
1394
1399
|
return ae(e.relativeMeta);
|
|
1395
1400
|
}
|
|
1396
1401
|
function Me(e, t = {}) {
|
|
1397
|
-
const { name: r, operation:
|
|
1402
|
+
const { name: r, operation: o, values: n, valueType: i } = e, a = t.label ?? Ze(r), l = jr(e, t.relativeDates);
|
|
1398
1403
|
if (l) {
|
|
1399
|
-
const u =
|
|
1404
|
+
const u = $t(l);
|
|
1400
1405
|
if (u)
|
|
1401
|
-
return
|
|
1406
|
+
return o === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
|
|
1402
1407
|
}
|
|
1403
|
-
if (!
|
|
1404
|
-
return
|
|
1408
|
+
if (!n || n.length === 0)
|
|
1409
|
+
return o === "is null" ? `${a} is empty` : o === "is not null" ? `${a} is not empty` : "";
|
|
1405
1410
|
const m = (u) => {
|
|
1406
1411
|
if (i === "date" && u) {
|
|
1407
1412
|
const g = e.temporalPrecision === "minute", p = {
|
|
@@ -1413,7 +1418,7 @@ function Me(e, t = {}) {
|
|
|
1413
1418
|
minute: "2-digit"
|
|
1414
1419
|
} : {}
|
|
1415
1420
|
};
|
|
1416
|
-
if (typeof u == "string" &&
|
|
1421
|
+
if (typeof u == "string" && Br.test(u)) {
|
|
1417
1422
|
const [d, s, f] = u.split("-").map(Number);
|
|
1418
1423
|
return new Intl.DateTimeFormat(void 0, {
|
|
1419
1424
|
year: "numeric",
|
|
@@ -1422,7 +1427,7 @@ function Me(e, t = {}) {
|
|
|
1422
1427
|
timeZone: "UTC"
|
|
1423
1428
|
}).format(new Date(Date.UTC(d, s - 1, f)));
|
|
1424
1429
|
}
|
|
1425
|
-
if (typeof u == "string" &&
|
|
1430
|
+
if (typeof u == "string" && mt(u) === "wall_datetime") {
|
|
1426
1431
|
const [d, s, f, b, y] = u.split(/[-T :.]/).map(Number);
|
|
1427
1432
|
return new Intl.DateTimeFormat(void 0, {
|
|
1428
1433
|
...p,
|
|
@@ -1442,100 +1447,100 @@ function Me(e, t = {}) {
|
|
|
1442
1447
|
}
|
|
1443
1448
|
return String(u);
|
|
1444
1449
|
};
|
|
1445
|
-
switch (
|
|
1450
|
+
switch (o) {
|
|
1446
1451
|
case "=":
|
|
1447
|
-
return `${a}: ${m(
|
|
1452
|
+
return `${a}: ${m(n[0])}`;
|
|
1448
1453
|
case "!=":
|
|
1449
|
-
return `${a} ≠ ${m(
|
|
1454
|
+
return `${a} ≠ ${m(n[0])}`;
|
|
1450
1455
|
case ">":
|
|
1451
|
-
return `${a} > ${m(
|
|
1456
|
+
return `${a} > ${m(n[0])}`;
|
|
1452
1457
|
case "<":
|
|
1453
|
-
return `${a} < ${m(
|
|
1458
|
+
return `${a} < ${m(n[0])}`;
|
|
1454
1459
|
case ">=":
|
|
1455
|
-
return `${a} ≥ ${m(
|
|
1460
|
+
return `${a} ≥ ${m(n[0])}`;
|
|
1456
1461
|
case "<=":
|
|
1457
|
-
return `${a} ≤ ${m(
|
|
1462
|
+
return `${a} ≤ ${m(n[0])}`;
|
|
1458
1463
|
case "between":
|
|
1459
1464
|
case "not between": {
|
|
1460
|
-
const u = `${m(
|
|
1461
|
-
return
|
|
1465
|
+
const u = `${m(n[0])} - ${m(n[1])}`;
|
|
1466
|
+
return o === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
|
|
1462
1467
|
}
|
|
1463
1468
|
case "in":
|
|
1464
|
-
return
|
|
1469
|
+
return n.length === 1 ? `${a}: ${m(n[0])}` : `${a}: ${ee(n, m)}`;
|
|
1465
1470
|
case "not in":
|
|
1466
|
-
return `${a} not in (${ee(
|
|
1471
|
+
return `${a} not in (${ee(n, m)})`;
|
|
1467
1472
|
case "like":
|
|
1468
|
-
return `${a} contains "${
|
|
1473
|
+
return `${a} contains "${n[0]}"`;
|
|
1469
1474
|
case "not like":
|
|
1470
|
-
return `${a} doesn't contain "${
|
|
1475
|
+
return `${a} doesn't contain "${n[0]}"`;
|
|
1471
1476
|
default:
|
|
1472
|
-
return `${a}: ${ee(
|
|
1477
|
+
return `${a}: ${ee(n, m)}`;
|
|
1473
1478
|
}
|
|
1474
1479
|
}
|
|
1475
|
-
function
|
|
1480
|
+
function Do(e, t = {}) {
|
|
1476
1481
|
if (!e || e.length === 0)
|
|
1477
1482
|
return "";
|
|
1478
1483
|
const r = /* @__PURE__ */ new Map();
|
|
1479
|
-
e.forEach((
|
|
1480
|
-
const i = r.get(
|
|
1481
|
-
i.push(
|
|
1484
|
+
e.forEach((n) => {
|
|
1485
|
+
const i = r.get(n.name) || [];
|
|
1486
|
+
i.push(n), r.set(n.name, i);
|
|
1482
1487
|
});
|
|
1483
|
-
const
|
|
1484
|
-
return r.forEach((
|
|
1485
|
-
if (
|
|
1486
|
-
const a = Me(
|
|
1487
|
-
a &&
|
|
1488
|
+
const o = [];
|
|
1489
|
+
return r.forEach((n, i) => {
|
|
1490
|
+
if (n.length === 1) {
|
|
1491
|
+
const a = Me(n[0], t);
|
|
1492
|
+
a && o.push(a);
|
|
1488
1493
|
} else {
|
|
1489
|
-
const a =
|
|
1490
|
-
l.length > 0 &&
|
|
1494
|
+
const a = Ze(i), l = n.map((m) => Me(m, t).replace(`${a}: `, "").replace(`${a} `, "")).filter(Boolean);
|
|
1495
|
+
l.length > 0 && o.push(`${a}: ${l.join(" and ")}`);
|
|
1491
1496
|
}
|
|
1492
|
-
}),
|
|
1497
|
+
}), o.join(" | ");
|
|
1493
1498
|
}
|
|
1494
|
-
function
|
|
1495
|
-
return ((e == null ? void 0 : e.filterValues) ?? []).filter(
|
|
1499
|
+
function Ro(e) {
|
|
1500
|
+
return ((e == null ? void 0 : e.filterValues) ?? []).filter(Gr).map(Hr);
|
|
1496
1501
|
}
|
|
1497
|
-
function
|
|
1502
|
+
function Gr(e) {
|
|
1498
1503
|
return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
|
|
1499
1504
|
}
|
|
1500
|
-
function
|
|
1505
|
+
function Hr(e) {
|
|
1501
1506
|
if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
|
|
1502
|
-
const { relativeMeta: t, ...r } = e,
|
|
1503
|
-
return
|
|
1507
|
+
const { relativeMeta: t, ...r } = e, o = ae(t);
|
|
1508
|
+
return o ? { ...r, relativeMeta: o } : r;
|
|
1504
1509
|
}
|
|
1505
|
-
const
|
|
1510
|
+
const Xr = /* @__PURE__ */ new Set([
|
|
1506
1511
|
"day",
|
|
1507
1512
|
"week",
|
|
1508
1513
|
"month",
|
|
1509
1514
|
"quarter",
|
|
1510
1515
|
"year"
|
|
1511
1516
|
]);
|
|
1512
|
-
function
|
|
1517
|
+
function Wr(e, t) {
|
|
1513
1518
|
try {
|
|
1514
1519
|
const r = $(
|
|
1515
1520
|
O(e),
|
|
1516
1521
|
t,
|
|
1517
1522
|
"yyyy-MM-dd"
|
|
1518
|
-
), [
|
|
1523
|
+
), [o, n, i] = r.split("-").map(Number), a = new Date(Date.UTC(o, n - 1, i));
|
|
1519
1524
|
return a.setUTCDate(a.getUTCDate() - 1), $(a, "UTC", "yyyy-MM-dd");
|
|
1520
1525
|
} catch {
|
|
1521
1526
|
return;
|
|
1522
1527
|
}
|
|
1523
1528
|
}
|
|
1524
|
-
function
|
|
1525
|
-
const
|
|
1529
|
+
function Po(e, t, r, o = !1) {
|
|
1530
|
+
const n = Yr(
|
|
1526
1531
|
e,
|
|
1527
1532
|
t,
|
|
1528
1533
|
r,
|
|
1529
|
-
|
|
1534
|
+
o
|
|
1530
1535
|
);
|
|
1531
|
-
return `${
|
|
1536
|
+
return `${n.start} - ${n.end}`;
|
|
1532
1537
|
}
|
|
1533
|
-
function
|
|
1538
|
+
function Yr(e, t, r, o = !1) {
|
|
1534
1539
|
try {
|
|
1535
|
-
if (r &&
|
|
1536
|
-
const
|
|
1537
|
-
if (
|
|
1538
|
-
const i =
|
|
1540
|
+
if (r && Xr.has(r)) {
|
|
1541
|
+
const n = Wr(e.end, t);
|
|
1542
|
+
if (n) {
|
|
1543
|
+
const i = o ? "MMM d" : "MMM d, yyyy";
|
|
1539
1544
|
return {
|
|
1540
1545
|
start: $(
|
|
1541
1546
|
O(e.start),
|
|
@@ -1543,7 +1548,7 @@ function Wr(e, t, r, n = !1) {
|
|
|
1543
1548
|
i
|
|
1544
1549
|
),
|
|
1545
1550
|
end: $(
|
|
1546
|
-
O(`${
|
|
1551
|
+
O(`${n}T00:00:00Z`),
|
|
1547
1552
|
"UTC",
|
|
1548
1553
|
"MMM d, yyyy"
|
|
1549
1554
|
)
|
|
@@ -1551,13 +1556,13 @@ function Wr(e, t, r, n = !1) {
|
|
|
1551
1556
|
}
|
|
1552
1557
|
}
|
|
1553
1558
|
if (r === "second" || r === "minute" || r === "hour") {
|
|
1554
|
-
const
|
|
1559
|
+
const n = o ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
|
|
1555
1560
|
return {
|
|
1556
|
-
start: $(O(e.start), t,
|
|
1561
|
+
start: $(O(e.start), t, n),
|
|
1557
1562
|
end: `before ${$(
|
|
1558
1563
|
O(e.end),
|
|
1559
1564
|
t,
|
|
1560
|
-
|
|
1565
|
+
n
|
|
1561
1566
|
)}`
|
|
1562
1567
|
};
|
|
1563
1568
|
}
|
|
@@ -1566,53 +1571,54 @@ function Wr(e, t, r, n = !1) {
|
|
|
1566
1571
|
return { start: e.start, end: `before ${e.end}` };
|
|
1567
1572
|
}
|
|
1568
1573
|
export {
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1574
|
+
Io as A,
|
|
1575
|
+
$o as B,
|
|
1576
|
+
_o as C,
|
|
1577
|
+
Ve as D,
|
|
1578
|
+
Mo as E,
|
|
1579
|
+
Xt as F,
|
|
1580
|
+
Fe as G,
|
|
1581
|
+
zr as H,
|
|
1582
|
+
Me as I,
|
|
1583
|
+
Do as J,
|
|
1584
|
+
Ro as K,
|
|
1585
|
+
Cr as L,
|
|
1586
|
+
po as M,
|
|
1587
|
+
oe as N,
|
|
1583
1588
|
xr as O,
|
|
1584
|
-
|
|
1589
|
+
Qt as P,
|
|
1585
1590
|
Sr as Q,
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1591
|
+
Er as R,
|
|
1592
|
+
Lo as S,
|
|
1593
|
+
He as T,
|
|
1594
|
+
Fo as U,
|
|
1595
|
+
kr as V,
|
|
1596
|
+
er as W,
|
|
1597
|
+
Yr as X,
|
|
1598
|
+
fo as a,
|
|
1599
|
+
yo as b,
|
|
1600
|
+
ho as c,
|
|
1601
|
+
bo as d,
|
|
1602
|
+
go as e,
|
|
1603
|
+
Po as f,
|
|
1604
|
+
wo as g,
|
|
1605
|
+
Co as h,
|
|
1606
|
+
xo as i,
|
|
1607
|
+
or as j,
|
|
1608
|
+
So as k,
|
|
1609
|
+
vo as l,
|
|
1610
|
+
rr as m,
|
|
1611
|
+
To as n,
|
|
1612
|
+
Wt as o,
|
|
1613
|
+
tr as p,
|
|
1614
|
+
Zt as q,
|
|
1609
1615
|
ve as r,
|
|
1610
|
-
|
|
1616
|
+
Jt as s,
|
|
1611
1617
|
P as t,
|
|
1612
1618
|
ar as u,
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1619
|
+
sr as v,
|
|
1620
|
+
Eo as w,
|
|
1621
|
+
ko as x,
|
|
1622
|
+
mr as y,
|
|
1623
|
+
Ao as z
|
|
1618
1624
|
};
|