react-semaphor 0.1.536 → 0.1.538
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 +352 -341
- package/dist/assistant-context/index.js +10 -0
- package/dist/assistant-protocol/index.js +104 -0
- package/dist/brand-studio/index.js +35 -31
- package/dist/briefings/index.js +46 -45
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/chunks/add-to-dashboard-CxtTfISD.js +56 -0
- package/dist/chunks/aggregate-table-row-presentation-Qgpv6_G8.js +979 -0
- package/dist/chunks/analytics-base-schemas-BFAoRlkU.js +472 -0
- package/dist/chunks/apply-dashboard-operations-C-iahGka.js +402 -0
- package/dist/chunks/assistant-chat-BAqUIFp5.js +7966 -0
- package/dist/chunks/availability-Bp5Gfu1I.js +44 -0
- package/dist/chunks/{bookmark-state-B-I9BDD0.js → bookmark-state-k7y5SNGf.js} +9 -9
- package/dist/chunks/{braces-8TRlDwDw.js → braces-o9UiRQes.js} +1 -1
- package/dist/chunks/calculated-field-identity-DcBS2NPP.js +2161 -0
- package/dist/chunks/calendar-day-equality-Bpl15IBo.js +487 -0
- package/dist/chunks/class-utils-Df1OVOT1.js +2315 -0
- package/dist/chunks/{field-dependencies-CpRUwr9J.js → common-types-CUf03Htv.js} +65 -58
- package/dist/chunks/context-HD9usB1P.js +349 -0
- package/dist/chunks/conversation-sQiWYUOb.js +16 -0
- package/dist/chunks/csv-utils-GUfKyT1J.js +56 -0
- package/dist/chunks/custom-visual-inputs-BrUOIwln.js +3288 -0
- package/dist/chunks/{dashboard-BTDY_I5L.js → dashboard-DTDDFQsS.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DV_rlhT2.js → dashboard-briefing-launcher-Bb2QUqOa.js} +764 -740
- package/dist/chunks/{dashboard-controls-B4LxN5dr.js → dashboard-controls-FpONU8QV.js} +683 -686
- package/dist/chunks/{common-types-g7yS12Cg.js → dashboard-filter-value-compatibility-D95O4nd7.js} +18 -24
- package/dist/chunks/dashboard-json-DazPhBU_.js +69 -0
- package/dist/chunks/document-dashboard-inputs-D96rlU7S.js +10678 -0
- package/dist/chunks/document-sheet-utils-C1eEldxs.js +1076 -0
- package/dist/chunks/{edit-dashboard-visual-L5zsle6X.js → edit-dashboard-visual-CIhZodVH.js} +4744 -4746
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +15 -0
- package/dist/chunks/filter-value-text-BhWugPWE.js +163 -0
- package/dist/chunks/index-CqMiAkay.js +3164 -0
- package/dist/chunks/index-CuHybtft.js +51 -0
- package/dist/chunks/layout-grid-Bgzth8vd.js +16 -0
- package/dist/chunks/{matrix-analytical-definition-CgBTD6H8.js → matrix-analytical-definition-bcprSe4u.js} +1 -1
- package/dist/chunks/{matrix-card-CAdizkUl.js → matrix-card-CJn1hB5V.js} +13 -12
- package/dist/chunks/matrix-definition-DQDI2okF.js +206 -0
- package/dist/chunks/{matrix-formatter-DJCk8Znf.js → matrix-formatter-Bgw32tb3.js} +648 -457
- package/dist/chunks/matrix-member-presentation-BNPSDKBG.js +105 -0
- package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js} +134 -133
- package/dist/chunks/{metric-comparison-BKHyvnAy.js → metric-comparison-CojWeLqx.js} +1 -1
- package/dist/chunks/{palette-Cp1hqZtm.js → palette-D10o_yYX.js} +1 -1
- package/dist/chunks/pivot-header-presentation-MkcKnjn3.js +42 -0
- package/dist/chunks/{pivot-result-identity-Bs4tLtLo.js → pivot-result-identity-D6hhcRXi.js} +1 -1
- package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +804 -0
- package/dist/chunks/raw-temporal-D61lr48Y.js +1464 -0
- package/dist/chunks/{raw-temporal-contract-mLFS-9wk.js → raw-temporal-contract-C51YG48G.js} +1 -1
- package/dist/chunks/report-preferences-dialog-BCGs4-AE.js +1808 -0
- package/dist/chunks/{report-runtime-context-CG_I0PPW.js → report-runtime-context-B984Nq1E.js} +8 -7
- package/dist/chunks/save-CfJpQQ68.js +21 -0
- package/dist/chunks/saved-dashboard-context-BrTkjcod.js +566 -0
- package/dist/chunks/{selection-reducer-CiDEtmAq.js → selection-reducer-vKIb_jS6.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-3TXTZgw-.js → semaphor-ready-indicator-CHHoWhil.js} +65657 -62814
- package/dist/chunks/{shelf-drop-preview-context-CBCs9rjz.js → shelf-drop-preview-context-EsayECEC.js} +199 -196
- package/dist/chunks/{source-entity-resolution-C-oNyYMp.js → source-entity-resolution-CVA1a85c.js} +8 -8
- package/dist/chunks/switch-CvItuC1Q.js +8199 -0
- package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-D8JF7zKz.js} +86 -71
- package/dist/chunks/{temporal-bucket-contract-D2OuaVZ7.js → temporal-bucket-contract-DaOajRC7.js} +1 -1
- package/dist/chunks/{token-types-DtSJOUjh.js → token-types-bxUxXDX2.js} +1 -1
- package/dist/chunks/{upload-CAIpsti1.js → upload-BFX7apKV.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-Bk-SBnaY.js → use-create-flow-overlay-state-BqA92GkX.js} +331 -339
- package/dist/chunks/{validators-DMSH81OM.js → validators-Ej1DdCXa.js} +1050 -1510
- package/dist/chunks/visual-choice-JiJ-_3bi.js +204 -0
- package/dist/chunks/x-4f5U2XwU.js +100 -0
- package/dist/chunks/{zoned-wall-clock-1qlWCE20.js → zoned-wall-clock-MulfA26h.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +823 -661
- package/dist/data-app-sdk/index.js +32 -30
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +23 -22
- package/dist/format-utils/index.js +173 -168
- package/dist/index.js +267 -258
- package/dist/layouts/index.js +236 -24
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/assistant-context.d.ts +2 -0
- package/dist/types/assistant-protocol.d.ts +2 -0
- package/dist/types/components/assistant/assistant-entry-points.d.ts +18 -0
- package/dist/types/components/assistant/assistant-provider.d.ts +19 -0
- package/dist/types/components/assistant/assistant-store.d.ts +52 -0
- package/dist/types/components/assistant/use-assistant.d.ts +38 -0
- package/dist/types/components/index.d.ts +5 -1
- package/dist/types/components/surfboard/filter/types.d.ts +5 -2
- package/dist/types/index.js +50 -51
- package/dist/types/lib/api/invalidate-token.d.ts +7 -0
- package/dist/types/lib/charts/cartesian-fields.d.ts +64 -0
- package/dist/types/lib/charts/types.d.ts +7 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +14 -2
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +5 -6
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +8 -3
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +11 -6
- package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +7 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +79 -0
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +3 -2
- package/dist/types/lib/document/document-table-data-policy.d.ts +15 -0
- package/dist/types/lib/filter-values/filter-mode.d.ts +22 -0
- package/dist/types/lib/hooks/use-calendar-context.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +7 -0
- package/dist/types/lib/print/print-inputs.d.ts +4 -2
- package/dist/types/lib/query-context/build-card-query-context.d.ts +12 -4
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +93 -0
- package/dist/types/lib/query-context/card-server-request.d.ts +72 -0
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +56 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +45 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +17 -2
- package/dist/types/lib/stores/dashboard-store.d.ts +34 -11
- package/dist/types/lib/stores/editor-store.d.ts +4 -2
- package/dist/types/lib/types/token-types.d.ts +11 -0
- package/dist/types/lib/utils/card-type-change.d.ts +30 -0
- package/dist/types/lib/utils/comparison-window-caption.d.ts +12 -0
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +13 -2
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +74 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +5 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +43 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/visual-choice.d.ts +75 -0
- package/dist/types/shared/assistant-context/index.d.ts +9 -0
- package/dist/types/shared/assistant-context/project-context.d.ts +55 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +130 -0
- package/dist/types/shared/assistant-protocol/add-to-dashboard.d.ts +17 -0
- package/dist/types/shared/assistant-protocol/artifact.d.ts +63 -0
- package/dist/types/shared/assistant-protocol/availability.d.ts +39 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +952 -0
- package/dist/types/shared/assistant-protocol/conversation.d.ts +38 -0
- package/dist/types/shared/assistant-protocol/index.d.ts +16 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +53 -0
- package/dist/types/shared/assistant-protocol/parts.d.ts +131 -0
- package/dist/types/shared/assistant-protocol/request.d.ts +77 -0
- package/dist/types/shared/assistant-protocol/sources.d.ts +27 -0
- package/dist/types/shared/assistant-protocol/token-config.d.ts +32 -0
- package/dist/types/shared/assistant-protocol/transcript.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +112 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +1794 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/new-card.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/resolved-primary-date-field-validation.d.ts +16 -0
- package/dist/types/shared/format-utils/filter-detail.d.ts +70 -0
- package/dist/types/shared/format-utils/filter-value-text.d.ts +15 -0
- package/dist/types/shared/format-utils/index.d.ts +3 -0
- package/dist/types/shared/format-utils/raw-temporal.d.ts +7 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +7 -0
- package/dist/types/shared/layouts/frame-layouts.d.ts +23 -0
- package/dist/types/shared/layouts/index.d.ts +1 -0
- package/package.json +12 -2
- package/dist/chunks/calculated-field-identity-BptYhyOP.js +0 -1326
- package/dist/chunks/calendar-day-equality-BRjN1S9h.js +0 -383
- package/dist/chunks/card-config-utils-BOM1dxCk.js +0 -1150
- package/dist/chunks/constants-DNWVy8Y3.js +0 -9
- package/dist/chunks/dashboard-json-Ccjo0Dzw.js +0 -65
- package/dist/chunks/field-aggregations-CoLzYHeL.js +0 -1229
- package/dist/chunks/index-DTcTAGGM.js +0 -4101
- package/dist/chunks/matrix-continuation-C4sRcjZU.js +0 -72
- package/dist/chunks/matrix-control-sources-DTqcA2_L.js +0 -636
- package/dist/chunks/matrix-definition-D9iShKZI.js +0 -87
- package/dist/chunks/matrix-member-presentation-Ct8GuxHt.js +0 -209
- package/dist/chunks/numeric-presentation-CWu3gunq.js +0 -537
- package/dist/chunks/pivot-header-presentation-CHs2GFrM.js +0 -753
- package/dist/chunks/pivot-result-lifecycle-DQz_gjGu.js +0 -789
- package/dist/chunks/raw-temporal-iMXRK-Qz.js +0 -930
- package/dist/chunks/report-preferences-dialog-CW8VEIDx.js +0 -1623
- package/dist/chunks/save-kO6cIaob.js +0 -34
- package/dist/chunks/semantic-format-DiqYeKwU.js +0 -192
- package/dist/chunks/switch-CKB-kUaC.js +0 -25003
- package/dist/chunks/temporal-input-presentation-BD7YNUzu.js +0 -195
- package/dist/chunks/x-CXDkqdur.js +0 -149
- package/dist/types/lib/class-utils.d.ts +0 -2
- package/dist/types/lib/document/document-input-runtime.d.ts +0 -26
- package/dist/types/lib/utils.d.ts +0 -51
|
@@ -1,753 +0,0 @@
|
|
|
1
|
-
var W = Object.defineProperty;
|
|
2
|
-
var Y = (e, t, o) => t in e ? W(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
|
-
var A = (e, t, o) => Y(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
-
import { i as q } from "./raw-temporal-iMXRK-Qz.js";
|
|
5
|
-
import { e as v, i as Z } from "./numeric-presentation-CWu3gunq.js";
|
|
6
|
-
import { e as N, m as S, h as V, i as J, j as O } from "./matrix-formatter-DJCk8Znf.js";
|
|
7
|
-
import { i as E } from "./pivot-result-lifecycle-DQz_gjGu.js";
|
|
8
|
-
import { B as Q, bi as B, E as T, bd as ee, ba as te } from "./validators-DMSH81OM.js";
|
|
9
|
-
import "./matrix-operation-contract-BKupLHXL.js";
|
|
10
|
-
import "zod";
|
|
11
|
-
import { g as G } from "./matrix-definition-D9iShKZI.js";
|
|
12
|
-
import { PDF_SAFETY_LIMIT_EXCEEDED as U, getUtf8ByteLength as re, FAST_PDF_POLICY as oe } from "../pdf-export-policy/index.js";
|
|
13
|
-
import { a as ne } from "./zoned-wall-clock-1qlWCE20.js";
|
|
14
|
-
import { f as ae } from "./temporal-bucket-DlFuhCnT.js";
|
|
15
|
-
function se(e, t, o) {
|
|
16
|
-
const a = {
|
|
17
|
-
...t,
|
|
18
|
-
locale: t.locale ?? o
|
|
19
|
-
};
|
|
20
|
-
if (a.type === "number")
|
|
21
|
-
return v(e, a);
|
|
22
|
-
const { prefix: r, suffix: s, ...n } = a;
|
|
23
|
-
return `${r ?? ""}${v(e, {
|
|
24
|
-
...n,
|
|
25
|
-
negativeStyle: a.type === "currency" ? a.negativeStyle : "minus"
|
|
26
|
-
})}${s ?? ""}`;
|
|
27
|
-
}
|
|
28
|
-
function M(e, t, o) {
|
|
29
|
-
return e === null ? { value: e, text: null } : !t || !q(t) && t.type !== "duration" ? {
|
|
30
|
-
value: e,
|
|
31
|
-
text: v(e, { type: "number", locale: o })
|
|
32
|
-
} : t.type === "duration" ? {
|
|
33
|
-
value: e,
|
|
34
|
-
text: Z(e, {
|
|
35
|
-
inputUnit: t.inputUnit,
|
|
36
|
-
outputStyle: t.outputStyle,
|
|
37
|
-
largestUnit: t.largestUnit,
|
|
38
|
-
smallestUnit: t.smallestUnit,
|
|
39
|
-
maxUnits: t.maxUnits,
|
|
40
|
-
prefix: t.prefix,
|
|
41
|
-
suffix: t.suffix,
|
|
42
|
-
negativeInParentheses: t.negativeStyle === "parentheses"
|
|
43
|
-
})
|
|
44
|
-
} : { value: e, text: se(e, t, o) };
|
|
45
|
-
}
|
|
46
|
-
function I(e, t, o, a) {
|
|
47
|
-
return e === null ? { value: e, text: null } : a === "percent" ? {
|
|
48
|
-
value: e,
|
|
49
|
-
text: v(e, {
|
|
50
|
-
type: "percent",
|
|
51
|
-
locale: o,
|
|
52
|
-
minimumFractionDigits: t,
|
|
53
|
-
maximumFractionDigits: t,
|
|
54
|
-
percentValueMode: "fraction"
|
|
55
|
-
})
|
|
56
|
-
} : {
|
|
57
|
-
value: e,
|
|
58
|
-
text: v(e, {
|
|
59
|
-
type: "number",
|
|
60
|
-
locale: o,
|
|
61
|
-
minimumFractionDigits: t,
|
|
62
|
-
maximumFractionDigits: t,
|
|
63
|
-
suffix: "×"
|
|
64
|
-
})
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function _(e, t) {
|
|
68
|
-
if (e === void 0) return t;
|
|
69
|
-
if (!Number.isInteger(e) || e < 0 || e > 6)
|
|
70
|
-
throw new RangeError("Comparison precision must be an integer from 0 to 6.");
|
|
71
|
-
return e;
|
|
72
|
-
}
|
|
73
|
-
function Ve(e, t) {
|
|
74
|
-
const o = {
|
|
75
|
-
mode: t.displayMode,
|
|
76
|
-
current: M(
|
|
77
|
-
e.currentValue,
|
|
78
|
-
t.metricFormat,
|
|
79
|
-
t.locale
|
|
80
|
-
),
|
|
81
|
-
comparison: M(
|
|
82
|
-
e.comparisonValue,
|
|
83
|
-
t.metricFormat,
|
|
84
|
-
t.locale
|
|
85
|
-
)
|
|
86
|
-
};
|
|
87
|
-
return (t.displayMode === "difference" || t.displayMode === "both") && (o.difference = M(
|
|
88
|
-
e.delta,
|
|
89
|
-
t.metricFormat,
|
|
90
|
-
t.locale
|
|
91
|
-
)), (t.displayMode === "percent_change" || t.displayMode === "both") && (o.percentChange = I(
|
|
92
|
-
e.percentChange,
|
|
93
|
-
_(t.precision, 1),
|
|
94
|
-
t.locale,
|
|
95
|
-
"percent"
|
|
96
|
-
)), t.displayMode === "ratio" && (o.ratio = I(
|
|
97
|
-
e.ratio,
|
|
98
|
-
_(t.precision, 2),
|
|
99
|
-
t.locale,
|
|
100
|
-
"ratio"
|
|
101
|
-
)), o;
|
|
102
|
-
}
|
|
103
|
-
const le = 1e4, Oe = 1e6, Be = 5e6, Ge = 1024 ** 3, Ue = 1024 ** 3;
|
|
104
|
-
function je(e) {
|
|
105
|
-
return e > le;
|
|
106
|
-
}
|
|
107
|
-
const Xe = {
|
|
108
|
-
rowLabels: "tabular",
|
|
109
|
-
subtotals: "after"
|
|
110
|
-
};
|
|
111
|
-
function ze(e, t) {
|
|
112
|
-
const o = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, a = e.totals.rows;
|
|
113
|
-
return {
|
|
114
|
-
...e,
|
|
115
|
-
layout: o,
|
|
116
|
-
totals: {
|
|
117
|
-
...e.totals,
|
|
118
|
-
rows: {
|
|
119
|
-
...a,
|
|
120
|
-
levels: Object.fromEntries(
|
|
121
|
-
Object.entries(a.levels).map(([r, s]) => [
|
|
122
|
-
r,
|
|
123
|
-
{ ...s, position: t.subtotals }
|
|
124
|
-
])
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
const ie = 2;
|
|
131
|
-
function ce(e) {
|
|
132
|
-
return typeof e == "number" ? Number.isInteger(e) : B(e) ? !e.value.includes(".") : !0;
|
|
133
|
-
}
|
|
134
|
-
function ue(e, t, o) {
|
|
135
|
-
const a = e.descriptors.measures.filter(
|
|
136
|
-
(n) => o.measureFormats[n.id] === void 0 && n.semanticFormat === void 0 && Q(n.column.dataType) === "number"
|
|
137
|
-
);
|
|
138
|
-
if (a.length === 0) return o;
|
|
139
|
-
const r = /* @__PURE__ */ new Set();
|
|
140
|
-
e.columns.forEach((n, l) => {
|
|
141
|
-
if (!(n.kind !== "measure" || r.has(n.measureId)))
|
|
142
|
-
for (const u of t) {
|
|
143
|
-
const i = u.values[l];
|
|
144
|
-
if ((i == null ? void 0 : i.kind) === "value" && !ce(i.value)) {
|
|
145
|
-
r.add(n.measureId);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
const s = { ...o.measureFormats };
|
|
151
|
-
for (const { id: n } of a) {
|
|
152
|
-
const l = r.has(n) ? ie : 0;
|
|
153
|
-
s[n] = {
|
|
154
|
-
type: "number",
|
|
155
|
-
minimumFractionDigits: l,
|
|
156
|
-
maximumFractionDigits: l,
|
|
157
|
-
useGrouping: !0
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
return { ...o, measureFormats: s };
|
|
161
|
-
}
|
|
162
|
-
function P(e) {
|
|
163
|
-
return T(e.slice(0, -1));
|
|
164
|
-
}
|
|
165
|
-
function me(e, t) {
|
|
166
|
-
return t.length > e.length && T(t.slice(0, e.length)) === T(e);
|
|
167
|
-
}
|
|
168
|
-
function fe(e) {
|
|
169
|
-
return e.map((t, o) => {
|
|
170
|
-
if (o === 0 || t.kind !== "layout") return !1;
|
|
171
|
-
const a = e[o - 1];
|
|
172
|
-
if (a.kind !== "layout") return !1;
|
|
173
|
-
if (t.role !== "member" || me(a.rowPath, t.rowPath)) return !0;
|
|
174
|
-
const r = e[o - 2];
|
|
175
|
-
return a.role === "member" && (!r || r.kind !== "layout" || r.role !== "member" || P(r.rowPath) !== P(a.rowPath)) && t.rowPath.length === a.rowPath.length && P(t.rowPath) === P(a.rowPath);
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
const de = "pdf-group-continuation";
|
|
179
|
-
function ge(e) {
|
|
180
|
-
if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
|
|
181
|
-
return !0;
|
|
182
|
-
for (let t = 0; t <= e.levelIndex; t++)
|
|
183
|
-
if (e.getValue(e.row, t) !== e.getValue(e.previousRow, t))
|
|
184
|
-
return !0;
|
|
185
|
-
return !1;
|
|
186
|
-
}
|
|
187
|
-
function j(e, t, o) {
|
|
188
|
-
return !(o != null && o.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || B(t.value)) ? e : E(e);
|
|
189
|
-
}
|
|
190
|
-
function he(e, t, o) {
|
|
191
|
-
const a = N(e.descriptors, t.presentation, o), r = e.columns.map((c) => {
|
|
192
|
-
var m;
|
|
193
|
-
return c.kind === "measure" && ((m = a.measureSemantics.get(c.measureId)) == null ? void 0 : m.isNumeric) === !0;
|
|
194
|
-
}), s = (c) => S([c], a.levels), n = (c, m, f) => V(c, m, t.presentation.totals[f], a.levels), l = e.columns.map((c) => {
|
|
195
|
-
if (c.kind !== "measure") return c.label;
|
|
196
|
-
const m = c.columnPath.map(s);
|
|
197
|
-
return c.role !== "member" && m.push(n(c.columnPath, c.role, "columns")), [...m, c.label].join(" / ");
|
|
198
|
-
}), u = Math.min(t.spec.columns.length, Math.max(
|
|
199
|
-
0,
|
|
200
|
-
...e.columns.map((c) => c.kind === "measure" ? c.columnPath.length + (c.role !== "member" ? 1 : 0) : 0)
|
|
201
|
-
)), i = Array.from({ length: u + 1 }, (c, m) => e.columns.map((f) => m === u ? f.label : f.kind !== "measure" ? "" : m < f.columnPath.length ? s(f.columnPath[m]) : m === f.columnPath.length && f.role !== "member" ? n(f.columnPath, f.role, "columns") : "")), d = (c, m) => J({
|
|
202
|
-
path: c.rowPath,
|
|
203
|
-
role: c.kind === "layout" ? c.role : "member",
|
|
204
|
-
levelCount: Math.max(1, t.spec.rows.length),
|
|
205
|
-
repeatLabels: t.presentation.layout.kind !== "tabular" || t.presentation.layout.repeatLabels,
|
|
206
|
-
previousPath: m == null ? void 0 : m.rowPath
|
|
207
|
-
}), g = (c, m) => {
|
|
208
|
-
if (c.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
|
|
209
|
-
if (c.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
210
|
-
const f = d(c, m);
|
|
211
|
-
return e.columns.map((p, w) => {
|
|
212
|
-
if (p.kind === "hierarchy")
|
|
213
|
-
return `${" ".repeat(Math.max(0, c.rowPath.length - 1))}${n(c.rowPath, c.role, "rows")}`;
|
|
214
|
-
if (p.kind === "level") {
|
|
215
|
-
const x = t.spec.rows.findIndex((H) => H.id === p.levelId), b = f[x];
|
|
216
|
-
return b != null && b.visible ? b.total ? n(c.rowPath, c.role, "rows") : S(b.path, a.levels) : "";
|
|
217
|
-
}
|
|
218
|
-
const L = c.values[w], y = a.measures.get(p.measureId);
|
|
219
|
-
if (L.kind === "value" && !y)
|
|
220
|
-
throw new Error("Matrix value is missing its measure descriptor.");
|
|
221
|
-
return O(L, y, t.presentation.absence);
|
|
222
|
-
});
|
|
223
|
-
}, h = (c, m) => g(c, m).map((f, p) => {
|
|
224
|
-
const w = e.columns[p];
|
|
225
|
-
return w.kind === "measure" ? j(f, c.values[p], a.measureSemantics.get(w.measureId)) : E(f);
|
|
226
|
-
});
|
|
227
|
-
return {
|
|
228
|
-
headers: l,
|
|
229
|
-
headerBands: i,
|
|
230
|
-
numericColumns: r,
|
|
231
|
-
/** A row's cells; after `previous`, a tabular layout prints each label once. */
|
|
232
|
-
row: (c, m) => g(c, m),
|
|
233
|
-
/**
|
|
234
|
-
* Level columns whose group label the row above shows, so this row
|
|
235
|
-
* continues the group (Plan 2, 2d, C8). Only a member row after a member
|
|
236
|
-
* row continues one: a total prints as a band, and its rules stay whole
|
|
237
|
-
* above and below it.
|
|
238
|
-
*/
|
|
239
|
-
continuedColumns: (c, m) => {
|
|
240
|
-
const f = (w) => (w == null ? void 0 : w.kind) === "layout" && w.role === "member";
|
|
241
|
-
if (!f(c) || !f(m)) return [];
|
|
242
|
-
const p = d(c, m);
|
|
243
|
-
return e.columns.flatMap((w, L) => {
|
|
244
|
-
var x;
|
|
245
|
-
if (w.kind !== "level") return [];
|
|
246
|
-
const y = t.spec.rows.findIndex((b) => b.id === w.levelId);
|
|
247
|
-
return y < c.rowPath.length && ((x = p[y]) == null ? void 0 : x.visible) === !1 ? [L] : [];
|
|
248
|
-
});
|
|
249
|
-
},
|
|
250
|
-
csvRow: (c) => h(c),
|
|
251
|
-
/**
|
|
252
|
-
* `previousRow` is the row before `data[0]`, carried by the export's
|
|
253
|
-
* continuation, so a tabular layout prints each label once across the
|
|
254
|
-
* whole file. Retries are pure: suppression never relies on mutable
|
|
255
|
-
* formatter state or an earlier worker. Without it, the first row prints
|
|
256
|
-
* its labels.
|
|
257
|
-
*/
|
|
258
|
-
csvRows: (c, m) => c.map((f, p) => h(f, p ? c[p - 1] : m ?? void 0))
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
function Ke(e) {
|
|
262
|
-
return e.columns.map((t) => E(t.label));
|
|
263
|
-
}
|
|
264
|
-
function He(e, t, o) {
|
|
265
|
-
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
266
|
-
if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
267
|
-
const a = [...e.rowPath, ...e.columnPath];
|
|
268
|
-
return t.columns.map((r, s) => {
|
|
269
|
-
if (r.kind === "measure") {
|
|
270
|
-
const l = e.values[s], u = o.measures.get(r.measureId);
|
|
271
|
-
if (l.kind === "value" && !u) throw new Error("Matrix value is missing its measure descriptor.");
|
|
272
|
-
return j(
|
|
273
|
-
O(l, u, o.absence),
|
|
274
|
-
l,
|
|
275
|
-
o.measureSemantics.get(r.measureId)
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
const n = r.kind === "level" ? a.find((l) => l.levelId === r.levelId) : void 0;
|
|
279
|
-
if (!n) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
280
|
-
return E(S([n], o.levels));
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
function pe(e) {
|
|
284
|
-
const t = he(e.layout, e.request, e.report), o = e.layout.columns.map((n, l) => ({
|
|
285
|
-
index: l,
|
|
286
|
-
columnId: `matrix:${l}`,
|
|
287
|
-
label: t.headers[l],
|
|
288
|
-
isNumeric: t.numericColumns[l]
|
|
289
|
-
})), a = (n, l, u) => ({
|
|
290
|
-
text: n,
|
|
291
|
-
colspan: 1,
|
|
292
|
-
rowspan: 1,
|
|
293
|
-
columnId: o[l].columnId,
|
|
294
|
-
isHeader: u,
|
|
295
|
-
isNumeric: o[l].isNumeric,
|
|
296
|
-
className: o[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
|
|
297
|
-
}), r = [], s = e.layout.columns.findIndex((n) => n.kind === "measure");
|
|
298
|
-
e.request.spec.columns.length && s >= 0 && r.push({
|
|
299
|
-
repeatHeader: !0,
|
|
300
|
-
headerType: "pivot-axis",
|
|
301
|
-
headerRowIndex: 0,
|
|
302
|
-
cells: [
|
|
303
|
-
...s ? [{ ...a("", 0, !0), colspan: s }] : [],
|
|
304
|
-
{
|
|
305
|
-
...a(e.request.spec.columns.map((n) => G(n, e.request.presentation)).join(" / "), s, !0),
|
|
306
|
-
colspan: e.layout.columns.length - s,
|
|
307
|
-
isNumeric: !1,
|
|
308
|
-
className: ""
|
|
309
|
-
}
|
|
310
|
-
]
|
|
311
|
-
});
|
|
312
|
-
for (const [n, l] of t.headerBands.entries())
|
|
313
|
-
r.push({
|
|
314
|
-
repeatHeader: !0,
|
|
315
|
-
headerType: n === t.headerBands.length - 1 ? "metrics" : "pivot-level",
|
|
316
|
-
headerRowIndex: r.length,
|
|
317
|
-
cells: l.map((u, i) => a(u, i, !0))
|
|
318
|
-
});
|
|
319
|
-
return {
|
|
320
|
-
headers: r,
|
|
321
|
-
rows: e.rows.map((n, l) => {
|
|
322
|
-
const u = new Set(t.continuedColumns(n, e.rows[l - 1]));
|
|
323
|
-
return {
|
|
324
|
-
index: l,
|
|
325
|
-
type: n.kind === "layout" && n.role !== "member" ? "subtotal" : "data",
|
|
326
|
-
subtotalLevel: String(n.rowPath.length),
|
|
327
|
-
// A tabular layout prints each label once unless it repeats them; the
|
|
328
|
-
// blank cell continues its group, so a grid draws no rule above it.
|
|
329
|
-
cells: t.row(n, e.rows[l - 1]).map((i, d) => u.has(d) ? { ...a(i, d, !1), className: de } : a(i, d, !1))
|
|
330
|
-
};
|
|
331
|
-
}),
|
|
332
|
-
grandTotal: null,
|
|
333
|
-
// Totals are already in the ordered body at their authored position.
|
|
334
|
-
metadata: {
|
|
335
|
-
tableType: "pivot",
|
|
336
|
-
totalRows: e.rows.length,
|
|
337
|
-
totalColumns: o.length,
|
|
338
|
-
rowLevels: e.layout.columns.filter((n) => n.kind !== "measure").length,
|
|
339
|
-
pivotLevels: e.request.spec.columns.length,
|
|
340
|
-
hasGrandTotal: !1,
|
|
341
|
-
columnOrder: o.map((n) => n.columnId),
|
|
342
|
-
columns: o
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
function we(e, t, o) {
|
|
347
|
-
const { levels: a } = N(e.descriptors, t.presentation, o), r = t.spec.columns.length > 0, s = [], n = [], l = e.columns.map((i, d) => {
|
|
348
|
-
if (i.kind !== "measure") return null;
|
|
349
|
-
const g = r ? `${i.role}:${T(i.columnPath)}` : `measure:${d}`;
|
|
350
|
-
let h = s.indexOf(g);
|
|
351
|
-
return h < 0 && (h = s.push(g) - 1, n.push(r ? V(i.columnPath, i.role, t.presentation.totals.columns, a) : i.label)), h;
|
|
352
|
-
}), u = t.spec.columns[t.spec.columns.length - 1];
|
|
353
|
-
return {
|
|
354
|
-
columnGroups: l,
|
|
355
|
-
groupLabels: n,
|
|
356
|
-
/** What bands name their groups by: the innermost column level, or "Measures". */
|
|
357
|
-
groupLevelLabel: u ? G(u, t.presentation) : "Measures"
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
function We(e) {
|
|
361
|
-
const { layout: t, rows: o, report: a } = e, r = {
|
|
362
|
-
...e.request,
|
|
363
|
-
presentation: ue(t, o, e.request.presentation)
|
|
364
|
-
}, s = pe({ layout: t, rows: o, request: r, report: a }), n = fe(o), l = we(t, r, a), u = {
|
|
365
|
-
...s,
|
|
366
|
-
rows: s.rows.map((i, d) => ({ ...i, keepWithPrevious: n[d] })),
|
|
367
|
-
metadata: { ...s.metadata, ...l }
|
|
368
|
-
};
|
|
369
|
-
return { request: r, table: u, ...l };
|
|
370
|
-
}
|
|
371
|
-
class be extends Error {
|
|
372
|
-
constructor() {
|
|
373
|
-
super(...arguments);
|
|
374
|
-
A(this, "code", U);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
function R(e) {
|
|
378
|
-
if (!e || typeof e != "object")
|
|
379
|
-
return;
|
|
380
|
-
const { error: t, message: o, detail: a } = e;
|
|
381
|
-
for (const r of [t, o, a])
|
|
382
|
-
if (typeof r == "string" && r.trim())
|
|
383
|
-
return r.trim();
|
|
384
|
-
}
|
|
385
|
-
async function ye(e) {
|
|
386
|
-
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), o = e.headers.get("content-type") || "";
|
|
387
|
-
try {
|
|
388
|
-
if (o.includes("application/json")) {
|
|
389
|
-
const r = await e.json(), s = typeof r.code == "string" ? r.code : typeof r.errorCode == "string" ? r.errorCode : void 0;
|
|
390
|
-
return { message: R(r) || t, code: s };
|
|
391
|
-
}
|
|
392
|
-
const a = await e.text();
|
|
393
|
-
if (!a.trim())
|
|
394
|
-
return { message: t };
|
|
395
|
-
try {
|
|
396
|
-
const r = JSON.parse(a), s = typeof r.code == "string" ? r.code : typeof r.errorCode == "string" ? r.errorCode : void 0;
|
|
397
|
-
return {
|
|
398
|
-
message: R(r) || a.trim(),
|
|
399
|
-
code: s
|
|
400
|
-
};
|
|
401
|
-
} catch {
|
|
402
|
-
return { message: a.trim() };
|
|
403
|
-
}
|
|
404
|
-
} catch {
|
|
405
|
-
return { message: t };
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
async function Ye(e) {
|
|
409
|
-
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
410
|
-
if (re(e.serializedPayload) > oe.maxRequestBytes)
|
|
411
|
-
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
412
|
-
const t = await (e.fetchImpl ?? fetch)(e.url, {
|
|
413
|
-
method: "POST",
|
|
414
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${e.token}` },
|
|
415
|
-
body: e.serializedPayload,
|
|
416
|
-
signal: e.signal
|
|
417
|
-
});
|
|
418
|
-
if (!t.ok) {
|
|
419
|
-
const a = await ye(t);
|
|
420
|
-
throw a.code === U ? new be(a.message) : new Error(a.message);
|
|
421
|
-
}
|
|
422
|
-
const o = await t.json();
|
|
423
|
-
if (o != null && o.error) throw new Error(o.error);
|
|
424
|
-
if (typeof (o == null ? void 0 : o.url) != "string" || !o.url.trim())
|
|
425
|
-
throw new Error("Fast-path PDF response missing download URL");
|
|
426
|
-
return o;
|
|
427
|
-
}
|
|
428
|
-
const ve = /^\d{4}-\d{2}-\d{2}$/;
|
|
429
|
-
function X(e) {
|
|
430
|
-
const t = e.split(".");
|
|
431
|
-
return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase()).join(" ");
|
|
432
|
-
}
|
|
433
|
-
const F = 10;
|
|
434
|
-
function C(e, t) {
|
|
435
|
-
const o = e.slice(0, F).map(t).join(", "), a = e.length - F;
|
|
436
|
-
return a > 0 ? `${o}, and ${a} more` : o;
|
|
437
|
-
}
|
|
438
|
-
function Le(e) {
|
|
439
|
-
if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
|
|
440
|
-
return;
|
|
441
|
-
const t = ee(e.relativeMeta);
|
|
442
|
-
if (t)
|
|
443
|
-
return te(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
|
|
444
|
-
}
|
|
445
|
-
function D(e, t = {}) {
|
|
446
|
-
const { name: o, operation: a, values: r, valueType: s } = e, n = t.label ?? X(o), l = Le(e);
|
|
447
|
-
if (l) {
|
|
448
|
-
const i = ne(l);
|
|
449
|
-
if (i)
|
|
450
|
-
return a === "between" ? `${n}: ${i}` : `${n} not in ${i}`;
|
|
451
|
-
}
|
|
452
|
-
if (!r || r.length === 0)
|
|
453
|
-
return a === "is null" ? `${n} is empty` : a === "is not null" ? `${n} is not empty` : "";
|
|
454
|
-
const u = (i) => {
|
|
455
|
-
if (s === "date" && i) {
|
|
456
|
-
const d = e.temporalPrecision === "minute", g = {
|
|
457
|
-
year: "numeric",
|
|
458
|
-
month: "short",
|
|
459
|
-
day: "numeric",
|
|
460
|
-
...d ? {
|
|
461
|
-
hour: "numeric",
|
|
462
|
-
minute: "2-digit"
|
|
463
|
-
} : {}
|
|
464
|
-
};
|
|
465
|
-
if (typeof i == "string" && ve.test(i)) {
|
|
466
|
-
const [c, m, f] = i.split("-").map(Number);
|
|
467
|
-
return new Intl.DateTimeFormat(void 0, {
|
|
468
|
-
year: "numeric",
|
|
469
|
-
month: "short",
|
|
470
|
-
day: "numeric",
|
|
471
|
-
timeZone: "UTC"
|
|
472
|
-
}).format(new Date(Date.UTC(c, m - 1, f)));
|
|
473
|
-
}
|
|
474
|
-
const h = new Date(i);
|
|
475
|
-
if (!isNaN(h.getTime()))
|
|
476
|
-
try {
|
|
477
|
-
return new Intl.DateTimeFormat(void 0, {
|
|
478
|
-
...g,
|
|
479
|
-
...t.timezone ? { timeZone: t.timezone } : {}
|
|
480
|
-
}).format(h);
|
|
481
|
-
} catch {
|
|
482
|
-
return d ? h.toLocaleString(void 0, g) : h.toLocaleDateString(void 0, g);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
return String(i);
|
|
486
|
-
};
|
|
487
|
-
switch (a) {
|
|
488
|
-
case "=":
|
|
489
|
-
return `${n}: ${u(r[0])}`;
|
|
490
|
-
case "!=":
|
|
491
|
-
return `${n} ≠ ${u(r[0])}`;
|
|
492
|
-
case ">":
|
|
493
|
-
return `${n} > ${u(r[0])}`;
|
|
494
|
-
case "<":
|
|
495
|
-
return `${n} < ${u(r[0])}`;
|
|
496
|
-
case ">=":
|
|
497
|
-
return `${n} ≥ ${u(r[0])}`;
|
|
498
|
-
case "<=":
|
|
499
|
-
return `${n} ≤ ${u(r[0])}`;
|
|
500
|
-
case "between":
|
|
501
|
-
case "not between": {
|
|
502
|
-
const i = `${u(r[0])} - ${u(r[1])}`;
|
|
503
|
-
return a === "between" ? `${n}: ${i}` : `${n} not in ${i}`;
|
|
504
|
-
}
|
|
505
|
-
case "in":
|
|
506
|
-
return r.length === 1 ? `${n}: ${u(r[0])}` : `${n}: ${C(r, u)}`;
|
|
507
|
-
case "not in":
|
|
508
|
-
return `${n} not in (${C(r, u)})`;
|
|
509
|
-
case "like":
|
|
510
|
-
return `${n} contains "${r[0]}"`;
|
|
511
|
-
case "not like":
|
|
512
|
-
return `${n} doesn't contain "${r[0]}"`;
|
|
513
|
-
default:
|
|
514
|
-
return `${n}: ${C(r, u)}`;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
function qe(e, t = {}) {
|
|
518
|
-
if (!e || e.length === 0)
|
|
519
|
-
return "";
|
|
520
|
-
const o = /* @__PURE__ */ new Map();
|
|
521
|
-
e.forEach((r) => {
|
|
522
|
-
const s = o.get(r.name) || [];
|
|
523
|
-
s.push(r), o.set(r.name, s);
|
|
524
|
-
});
|
|
525
|
-
const a = [];
|
|
526
|
-
return o.forEach((r, s) => {
|
|
527
|
-
if (r.length === 1) {
|
|
528
|
-
const n = D(r[0], t);
|
|
529
|
-
n && a.push(n);
|
|
530
|
-
} else {
|
|
531
|
-
const n = X(s), l = r.map((u) => D(u, t).replace(`${n}: `, "").replace(`${n} `, "")).filter(Boolean);
|
|
532
|
-
l.length > 0 && a.push(`${n}: ${l.join(" and ")}`);
|
|
533
|
-
}
|
|
534
|
-
}), a.join(" | ");
|
|
535
|
-
}
|
|
536
|
-
const xe = "__TOTAL__";
|
|
537
|
-
function $(e) {
|
|
538
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
539
|
-
}
|
|
540
|
-
function k(e) {
|
|
541
|
-
return e === xe;
|
|
542
|
-
}
|
|
543
|
-
function Ze(e) {
|
|
544
|
-
const t = /* @__PURE__ */ new Map(), o = (e.groupByColumns ?? []).map((r, s) => {
|
|
545
|
-
var i, d, g;
|
|
546
|
-
if (!$(r))
|
|
547
|
-
throw new Error(`Aggregate groupByColumns[${s}] is invalid`);
|
|
548
|
-
const n = typeof r.id == "string" && r.id.length > 0 ? r.id : void 0, l = n ? (g = (d = (i = e.columnKeyMap) == null ? void 0 : i.byRole) == null ? void 0 : d.groupby) == null ? void 0 : g[n] : void 0, u = (l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || (typeof r.alias == "string" && r.alias.length > 0 ? r.alias : typeof r.name == "string" && r.name.length > 0 ? r.name : void 0);
|
|
549
|
-
if (!u)
|
|
550
|
-
throw new Error(`Aggregate groupByColumns[${s}] has no output key`);
|
|
551
|
-
return [n, r.alias, r.name, u].forEach((h) => {
|
|
552
|
-
typeof h == "string" && h.length > 0 && t.set(h, u);
|
|
553
|
-
}), u;
|
|
554
|
-
}), a = (e.rowAggregates ?? []).flatMap((r) => !$(r) || typeof r.function != "string" || typeof r.groupLevel != "string" ? [] : [
|
|
555
|
-
{
|
|
556
|
-
function: r.function,
|
|
557
|
-
groupLevel: r.groupLevel === "ALL" ? "ALL" : t.get(r.groupLevel) || r.groupLevel,
|
|
558
|
-
...typeof r.label == "string" ? { label: r.label } : {}
|
|
559
|
-
}
|
|
560
|
-
]);
|
|
561
|
-
return { groupColumnKeys: o, rowAggregates: a };
|
|
562
|
-
}
|
|
563
|
-
function z(e) {
|
|
564
|
-
return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
565
|
-
}
|
|
566
|
-
function Pe(e) {
|
|
567
|
-
var o;
|
|
568
|
-
if (e.customLabel) return e.customLabel;
|
|
569
|
-
const t = z(e.aggregateFunction);
|
|
570
|
-
if (e.levelValue !== void 0 && !k(e.levelValue)) {
|
|
571
|
-
if (e.levelValue === null) {
|
|
572
|
-
const r = (o = e.formatValue) == null ? void 0 : o.call(e, null);
|
|
573
|
-
return r ? `Subtotal ${r}` : `Subtotal ${t}`;
|
|
574
|
-
}
|
|
575
|
-
const a = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
|
|
576
|
-
if (a) return `Subtotal (${a})`;
|
|
577
|
-
}
|
|
578
|
-
return `Subtotal ${t}`;
|
|
579
|
-
}
|
|
580
|
-
function Te(e, t) {
|
|
581
|
-
return t || `Grand ${z(e)}`;
|
|
582
|
-
}
|
|
583
|
-
function Je(e) {
|
|
584
|
-
const t = e.context.groupColumnKeys.indexOf(e.columnKey);
|
|
585
|
-
if (t < 0)
|
|
586
|
-
throw new Error(
|
|
587
|
-
`Aggregate group column "${e.columnKey}" is unknown`
|
|
588
|
-
);
|
|
589
|
-
return ge({
|
|
590
|
-
row: e.row,
|
|
591
|
-
previousRow: e.previousRow,
|
|
592
|
-
levelIndex: t,
|
|
593
|
-
getValue: (o, a) => o[e.context.groupColumnKeys[a]]
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
function K(e) {
|
|
597
|
-
var a, r;
|
|
598
|
-
const t = e.context.groupColumnKeys, o = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
|
|
599
|
-
if (e.row.isGrandTotal === !0) {
|
|
600
|
-
const s = (a = e.context.rowAggregates.find(
|
|
601
|
-
(n) => n.groupLevel === "ALL"
|
|
602
|
-
)) == null ? void 0 : a.label;
|
|
603
|
-
return {
|
|
604
|
-
kind: "grand-total",
|
|
605
|
-
cells: t.map((n, l) => ({
|
|
606
|
-
columnKey: n,
|
|
607
|
-
text: l === 0 ? Te(o, s) : "",
|
|
608
|
-
placement: l === 0 ? "label" : "empty",
|
|
609
|
-
colSpan: l === 0 ? t.length : 1
|
|
610
|
-
}))
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
if (e.row.isSubtotal === !0) {
|
|
614
|
-
if (typeof e.row.subtotalLevel != "string")
|
|
615
|
-
throw new Error("Aggregate subtotal row is missing subtotalLevel");
|
|
616
|
-
const s = t.indexOf(e.row.subtotalLevel);
|
|
617
|
-
if (s < 0)
|
|
618
|
-
throw new Error(
|
|
619
|
-
`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
|
|
620
|
-
);
|
|
621
|
-
const n = $(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = $(n == null ? void 0 : n.groupByValues) ? n.groupByValues : {}, u = (r = e.context.rowAggregates.find(
|
|
622
|
-
(i) => i.groupLevel === e.row.subtotalLevel && i.function === o
|
|
623
|
-
)) == null ? void 0 : r.label;
|
|
624
|
-
return {
|
|
625
|
-
kind: "subtotal",
|
|
626
|
-
cells: t.map((i, d) => {
|
|
627
|
-
if (d > s)
|
|
628
|
-
return {
|
|
629
|
-
columnKey: i,
|
|
630
|
-
text: "",
|
|
631
|
-
placement: "empty",
|
|
632
|
-
colSpan: 1
|
|
633
|
-
};
|
|
634
|
-
if (d < s) {
|
|
635
|
-
const g = e.row[i];
|
|
636
|
-
return {
|
|
637
|
-
columnKey: i,
|
|
638
|
-
text: g === void 0 || k(g) ? "" : e.formatValue(g, i),
|
|
639
|
-
placement: "value",
|
|
640
|
-
colSpan: 1
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
return {
|
|
644
|
-
columnKey: i,
|
|
645
|
-
text: Pe({
|
|
646
|
-
aggregateFunction: o,
|
|
647
|
-
customLabel: u,
|
|
648
|
-
levelValue: l[i],
|
|
649
|
-
formatValue: (g) => e.formatLabelValue ? e.formatLabelValue(g, i) : String(e.formatValue(g, i) ?? "")
|
|
650
|
-
}),
|
|
651
|
-
placement: "label",
|
|
652
|
-
colSpan: t.length - s
|
|
653
|
-
};
|
|
654
|
-
})
|
|
655
|
-
};
|
|
656
|
-
}
|
|
657
|
-
return {
|
|
658
|
-
kind: "data",
|
|
659
|
-
cells: t.map((s) => {
|
|
660
|
-
const n = e.row[s];
|
|
661
|
-
return {
|
|
662
|
-
columnKey: s,
|
|
663
|
-
text: n === void 0 || k(n) ? "" : e.formatValue(n, s),
|
|
664
|
-
placement: "value",
|
|
665
|
-
colSpan: 1
|
|
666
|
-
};
|
|
667
|
-
})
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
function Qe(e) {
|
|
671
|
-
const t = K(e).cells.find(
|
|
672
|
-
(o) => o.columnKey === e.columnKey
|
|
673
|
-
);
|
|
674
|
-
if (!t)
|
|
675
|
-
throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
|
|
676
|
-
return t.text;
|
|
677
|
-
}
|
|
678
|
-
function et(e) {
|
|
679
|
-
return K(e).cells.map((t) => t.text);
|
|
680
|
-
}
|
|
681
|
-
class $e extends Error {
|
|
682
|
-
constructor(o, a) {
|
|
683
|
-
super(`${o}: ${a}`);
|
|
684
|
-
A(this, "deliveryBlocking", !0);
|
|
685
|
-
this.code = o, this.name = "PivotHeaderPresentationError";
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
function tt(e) {
|
|
689
|
-
var r;
|
|
690
|
-
const t = e.mode ?? "formatted", o = e.members.map((s) => {
|
|
691
|
-
var l;
|
|
692
|
-
if (t === "canonical" || !s.temporalBucket)
|
|
693
|
-
return s.value === null ? "" : String(s.value);
|
|
694
|
-
const n = (l = e.resolveTemporalFormat) == null ? void 0 : l.call(e, s.fieldId);
|
|
695
|
-
if (!n)
|
|
696
|
-
throw new $e(
|
|
697
|
-
"missing_resolved_temporal_format",
|
|
698
|
-
`Missing resolved temporal presentation for pivot field "${s.fieldId}"`
|
|
699
|
-
);
|
|
700
|
-
return ae({
|
|
701
|
-
value: s.value,
|
|
702
|
-
metadata: s.temporalBucket,
|
|
703
|
-
format: n
|
|
704
|
-
});
|
|
705
|
-
}), a = ((r = e.metricLabel) == null ? void 0 : r.trim()) || void 0;
|
|
706
|
-
return {
|
|
707
|
-
memberLabels: o,
|
|
708
|
-
...a ? { metricLabel: a } : {},
|
|
709
|
-
flattenedLabel: [
|
|
710
|
-
...o,
|
|
711
|
-
...a ? [a] : []
|
|
712
|
-
].join(" / ")
|
|
713
|
-
};
|
|
714
|
-
}
|
|
715
|
-
export {
|
|
716
|
-
xe as A,
|
|
717
|
-
K as B,
|
|
718
|
-
Qe as C,
|
|
719
|
-
le as D,
|
|
720
|
-
et as E,
|
|
721
|
-
Oe as F,
|
|
722
|
-
$e as G,
|
|
723
|
-
tt as H,
|
|
724
|
-
ge as I,
|
|
725
|
-
Be as M,
|
|
726
|
-
de as P,
|
|
727
|
-
Ge as a,
|
|
728
|
-
Ue as b,
|
|
729
|
-
He as c,
|
|
730
|
-
pe as d,
|
|
731
|
-
We as e,
|
|
732
|
-
Ve as f,
|
|
733
|
-
Xe as g,
|
|
734
|
-
ze as h,
|
|
735
|
-
ie as i,
|
|
736
|
-
ue as j,
|
|
737
|
-
fe as k,
|
|
738
|
-
be as l,
|
|
739
|
-
Ke as m,
|
|
740
|
-
ye as n,
|
|
741
|
-
Ye as o,
|
|
742
|
-
he as p,
|
|
743
|
-
F as q,
|
|
744
|
-
je as r,
|
|
745
|
-
Le as s,
|
|
746
|
-
D as t,
|
|
747
|
-
qe as u,
|
|
748
|
-
k as v,
|
|
749
|
-
Ze as w,
|
|
750
|
-
Pe as x,
|
|
751
|
-
Te as y,
|
|
752
|
-
Je as z
|
|
753
|
-
};
|