react-semaphor 0.1.449 → 0.1.454

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.
Files changed (147) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +119 -112
  3. package/dist/appearance/index.cjs +1 -1
  4. package/dist/appearance/index.js +1 -1
  5. package/dist/brand-studio/index.cjs +4 -4
  6. package/dist/brand-studio/index.js +15 -13
  7. package/dist/briefings/index.cjs +1 -1
  8. package/dist/briefings/index.js +39 -2131
  9. package/dist/chunks/{analyze-result-contract-T-0Ntzys.js → analyze-result-contract-BbRJ-C06.js} +1 -1
  10. package/dist/chunks/{analyze-result-contract-BHb7sUUW.cjs → analyze-result-contract-LPDNldic.cjs} +1 -1
  11. package/dist/chunks/canonical-result-keys-BA0HCP4e.cjs +1 -0
  12. package/dist/chunks/canonical-result-keys-D6avdjpA.js +467 -0
  13. package/dist/chunks/color-CJvdlFM_.js +2162 -0
  14. package/dist/chunks/color-CyB5o13F.cjs +4 -0
  15. package/dist/chunks/{common-types-CQ6SHfLk.cjs → common-types-C57kJ59w.cjs} +1 -1
  16. package/dist/chunks/{common-types-B7Jk3Rtj.js → common-types-H51FLKB7.js} +1 -1
  17. package/dist/chunks/contracts-CoCOpd_i.js +11 -0
  18. package/dist/chunks/contracts-CtB2VONT.cjs +1 -0
  19. package/dist/chunks/dashboard-briefing-launcher-Dwj1i7lr.cjs +26 -0
  20. package/dist/chunks/{dashboard-briefing-launcher-DCHiEkLE.js → dashboard-briefing-launcher-SYroFdae.js} +86 -84
  21. package/dist/chunks/{dashboard-controls-DwRFCcHV.js → dashboard-controls-1LpeU2sz.js} +15 -13
  22. package/dist/chunks/{dashboard-controls-CaFioayc.cjs → dashboard-controls-CpFoh7-A.cjs} +1 -1
  23. package/dist/chunks/dashboard-date-comparison-definition-Ces4alFm.cjs +1 -0
  24. package/dist/chunks/{dashboard-date-comparison-definition-Ba-clViK.js → dashboard-date-comparison-definition-DC3ekV2S.js} +1 -1
  25. package/dist/chunks/{dashboard-json-WoILbfTe.js → dashboard-json-D-T-sQxU.js} +25 -23
  26. package/dist/chunks/dashboard-json-DwSQopc_.cjs +1 -0
  27. package/dist/chunks/edit-dashboard-visual-BEmoQAET.cjs +172 -0
  28. package/dist/chunks/{edit-dashboard-visual-ciFhxqaI.js → edit-dashboard-visual-DqxUq4Bs.js} +6925 -6947
  29. package/dist/chunks/editor-action-buttons-18r2xwei.cjs +16 -0
  30. package/dist/chunks/{editor-action-buttons-BPo_45pM.js → editor-action-buttons-B2l3WIRC.js} +41 -39
  31. package/dist/chunks/format-types-CFHQoIuk.js +1350 -0
  32. package/dist/chunks/format-types-PSZZ7hG8.cjs +1 -0
  33. package/dist/chunks/index-Bn5wlkHt.cjs +4 -0
  34. package/dist/chunks/index-ByFbacH7.cjs +1 -0
  35. package/dist/chunks/index-CACdoqu3.js +318 -0
  36. package/dist/chunks/index-CLB_NGZ8.cjs +1392 -0
  37. package/dist/chunks/index-Ca784dpx.js +3714 -0
  38. package/dist/chunks/{index-CPuawpXJ.js → index-DAoS4BNU.js} +48514 -48484
  39. package/dist/chunks/index-DSKR3nKn.js +421 -0
  40. package/dist/chunks/index-F25jnH0p.cjs +1 -0
  41. package/dist/chunks/matrix-result-contract-CofATICL.js +437 -0
  42. package/dist/chunks/matrix-result-contract-zamd9euI.cjs +1 -0
  43. package/dist/chunks/pivot-header-presentation-DhyQXxKq.cjs +4 -0
  44. package/dist/chunks/pivot-header-presentation-ckYOQ4aZ.js +557 -0
  45. package/dist/chunks/{pivot-result-identity-CDLRT-YG.cjs → pivot-result-identity-Bb4EixVN.cjs} +1 -1
  46. package/dist/chunks/{pivot-result-identity-CwJWpKI7.js → pivot-result-identity-DU1v-5Xk.js} +1 -1
  47. package/dist/chunks/pivot-result-lifecycle-DmcF1ris.cjs +1 -0
  48. package/dist/chunks/pivot-result-lifecycle-sjzIOpvp.js +1641 -0
  49. package/dist/chunks/raw-temporal-contract-BtjH_G-d.cjs +1 -0
  50. package/dist/chunks/raw-temporal-contract-CxncLze5.js +64 -0
  51. package/dist/chunks/report-preferences-dialog-BgSvlDXa.cjs +1 -0
  52. package/dist/chunks/report-preferences-dialog-DDc2WUa0.js +723 -0
  53. package/dist/chunks/{report-runtime-context-C8LZFsqV.cjs → report-runtime-context-DqxS4wbi.cjs} +1 -1
  54. package/dist/chunks/{report-runtime-context-bCy3CVzK.js → report-runtime-context-SM6YO61_.js} +5 -5
  55. package/dist/chunks/saved-temporal-bucket-format-CFfWXRl9.cjs +1 -0
  56. package/dist/chunks/saved-temporal-bucket-format-SGAV0ivR.js +922 -0
  57. package/dist/chunks/{switch-BXet-Sno.js → switch-BeZW-HnS.js} +4350 -5249
  58. package/dist/chunks/switch-D-CCcfhc.cjs +138 -0
  59. package/dist/chunks/temporal-bucket-5UYEotyQ.js +810 -0
  60. package/dist/chunks/temporal-bucket-DHY1y9lq.cjs +1 -0
  61. package/dist/chunks/temporal-bucket-authoring-K1kE6R_z.js +222 -0
  62. package/dist/chunks/temporal-bucket-authoring-o3Emn05L.cjs +1 -0
  63. package/dist/chunks/{temporal-bucket-contract-ChDBWX8I.cjs → temporal-bucket-contract-D2-93DGr.cjs} +1 -1
  64. package/dist/chunks/{temporal-bucket-contract-_F6vNhhH.js → temporal-bucket-contract-D5d-xEl3.js} +1 -1
  65. package/dist/chunks/{token-types-BdQ8kHBm.cjs → token-types-D7CaaI80.cjs} +1 -1
  66. package/dist/chunks/{token-types-BHR58aTy.js → token-types-GbxRUozo.js} +1 -1
  67. package/dist/chunks/{update-policy-BxvYMYz0.cjs → update-policy-BmiOd0PB.cjs} +1 -1
  68. package/dist/chunks/{update-policy-g0rCQ9BM.js → update-policy-hednMF-0.js} +1 -1
  69. package/dist/chunks/validators-BDYprKI9.cjs +1 -0
  70. package/dist/chunks/{validators-Cs74WVie.js → validators-DEmd8Sin.js} +1561 -1197
  71. package/dist/dashboard/index.cjs +1 -1
  72. package/dist/dashboard/index.js +2 -2
  73. package/dist/dashboard-authoring/index.cjs +3 -3
  74. package/dist/dashboard-authoring/index.js +35 -32
  75. package/dist/data-app-builder/index.cjs +1 -1
  76. package/dist/data-app-builder/index.js +2 -2
  77. package/dist/data-app-codegen/index.cjs +1 -1
  78. package/dist/data-app-codegen/index.js +2 -2
  79. package/dist/data-app-codegen-node/index.cjs +1 -1
  80. package/dist/data-app-codegen-node/index.js +3 -3
  81. package/dist/data-app-sdk/index.cjs +1 -1
  82. package/dist/data-app-sdk/index.js +78 -77
  83. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  84. package/dist/data-app-sdk-adapters/index.js +29 -30
  85. package/dist/data-app-sdk-validation/index.cjs +1 -1
  86. package/dist/data-app-sdk-validation/index.js +21 -21
  87. package/dist/format-utils/index.cjs +3 -3
  88. package/dist/format-utils/index.js +156 -140
  89. package/dist/index.cjs +1 -1
  90. package/dist/index.js +157 -155
  91. package/dist/report-runtime-context/index.cjs +1 -1
  92. package/dist/report-runtime-context/index.js +2 -2
  93. package/dist/style.css +1 -1
  94. package/dist/surfboard/index.cjs +1 -1
  95. package/dist/surfboard/index.js +3 -3
  96. package/dist/types/analytics-protocol.d.ts +81 -11
  97. package/dist/types/briefings.d.ts +727 -19
  98. package/dist/types/dashboard-assistant.d.ts +37 -17
  99. package/dist/types/dashboard-authoring.d.ts +61 -14
  100. package/dist/types/dashboard.d.ts +137 -12
  101. package/dist/types/data-app-builder.d.ts +28 -2
  102. package/dist/types/data-app-codegen-node.d.ts +29 -3
  103. package/dist/types/data-app-codegen.d.ts +29 -3
  104. package/dist/types/data-app-sdk-adapters.d.ts +28 -2
  105. package/dist/types/data-app-sdk-validation.d.ts +51 -7
  106. package/dist/types/data-app-sdk.d.ts +55 -10
  107. package/dist/types/format-utils.d.ts +190 -3
  108. package/dist/types/index.cjs +1 -1
  109. package/dist/types/index.js +4 -4
  110. package/dist/types/main.d.ts +128 -33
  111. package/dist/types/shared.d.ts +14 -12
  112. package/dist/types/surfboard.d.ts +138 -13
  113. package/dist/types/types.d.ts +117 -23
  114. package/dist/types/value-format-preferences.d.ts +3 -0
  115. package/package.json +2 -1
  116. package/dist/chunks/card-config-utils-15sRtebL.cjs +0 -1
  117. package/dist/chunks/card-config-utils-BYZ5MJOh.js +0 -16
  118. package/dist/chunks/catalog-field-grounding-Bnx-3tE0.cjs +0 -1
  119. package/dist/chunks/catalog-field-grounding-S2jKwKGD.js +0 -100
  120. package/dist/chunks/dashboard-briefing-launcher-DDgDr2s3.cjs +0 -26
  121. package/dist/chunks/dashboard-date-comparison-definition-DZq0htjG.cjs +0 -1
  122. package/dist/chunks/dashboard-input-contract-DSt8dGzP.js +0 -18
  123. package/dist/chunks/dashboard-input-contract-DV3cshjz.cjs +0 -1
  124. package/dist/chunks/dashboard-json-CYtvwtvj.cjs +0 -1
  125. package/dist/chunks/edit-dashboard-visual-DwKcvlsF.cjs +0 -177
  126. package/dist/chunks/editor-action-buttons-BVmsk0Aj.cjs +0 -16
  127. package/dist/chunks/format-types-CSv0V7mm.cjs +0 -1
  128. package/dist/chunks/format-types-DZGgYj39.js +0 -1663
  129. package/dist/chunks/index-CJdxSyQq.js +0 -2578
  130. package/dist/chunks/index-DPv8_Ild.cjs +0 -1395
  131. package/dist/chunks/index-DRlMUglg.cjs +0 -4
  132. package/dist/chunks/metric-comparison-97zHGEx5.js +0 -387
  133. package/dist/chunks/metric-comparison-CUAJ8n4y.cjs +0 -1
  134. package/dist/chunks/pivot-result-lifecycle-BBabQ_da.js +0 -914
  135. package/dist/chunks/pivot-result-lifecycle-DPc0ANwk.cjs +0 -4
  136. package/dist/chunks/presentation-execution-BLfPTGX_.js +0 -637
  137. package/dist/chunks/presentation-execution-BTV-Q43g.cjs +0 -1
  138. package/dist/chunks/report-preferences-dialog-D9ZCGh9l.js +0 -691
  139. package/dist/chunks/report-preferences-dialog-DaqTEcac.cjs +0 -1
  140. package/dist/chunks/switch-Cjk6G06r.cjs +0 -138
  141. package/dist/chunks/temporal-bucket-BnPxGrAi.js +0 -446
  142. package/dist/chunks/temporal-bucket-authoring-CPTwHzvs.cjs +0 -1
  143. package/dist/chunks/temporal-bucket-authoring-CgOuakGW.js +0 -205
  144. package/dist/chunks/temporal-bucket-pMnV-4Nj.cjs +0 -1
  145. package/dist/chunks/temporal-result-owner-6peubmhU.js +0 -443
  146. package/dist/chunks/temporal-result-owner-f6-i65Fb.cjs +0 -1
  147. package/dist/chunks/validators-9D4KBqKD.cjs +0 -1
@@ -0,0 +1,557 @@
1
+ var U = Object.defineProperty;
2
+ var E = (e, t, n) => t in e ? U(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var A = (e, t, n) => E(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { t as f, c as P, g as R, e as O, a as T, m as S, b as M, i as Z, f as k, d as B } from "./format-types-CFHQoIuk.js";
5
+ import { b as y } from "./pivot-result-lifecycle-sjzIOpvp.js";
6
+ import { f as j } from "./index-CACdoqu3.js";
7
+ import { f as X } from "./temporal-bucket-5UYEotyQ.js";
8
+ function b(e, t) {
9
+ const n = f(e), o = f(t), r = n.getTime() - o.getTime();
10
+ return r < 0 ? -1 : r > 0 ? 1 : r;
11
+ }
12
+ function G(e) {
13
+ return P(e, Date.now());
14
+ }
15
+ function H(e, t) {
16
+ const n = f(e), o = f(t), r = n.getFullYear() - o.getFullYear(), s = n.getMonth() - o.getMonth();
17
+ return r * 12 + s;
18
+ }
19
+ function Y(e) {
20
+ return (t) => {
21
+ const o = (e ? Math[e] : Math.trunc)(t);
22
+ return o === 0 ? 0 : o;
23
+ };
24
+ }
25
+ function W(e, t) {
26
+ return +f(e) - +f(t);
27
+ }
28
+ function q(e) {
29
+ const t = f(e);
30
+ return t.setHours(23, 59, 59, 999), t;
31
+ }
32
+ function K(e) {
33
+ const t = f(e), n = t.getMonth();
34
+ return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
35
+ }
36
+ function J(e) {
37
+ const t = f(e);
38
+ return +q(t) == +K(t);
39
+ }
40
+ function Q(e, t) {
41
+ const n = f(e), o = f(t), r = b(n, o), s = Math.abs(
42
+ H(n, o)
43
+ );
44
+ let i;
45
+ if (s < 1)
46
+ i = 0;
47
+ else {
48
+ n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - r * s);
49
+ let a = b(n, o) === -r;
50
+ J(f(e)) && s === 1 && b(e, o) === 1 && (a = !1), i = r * (s - Number(a));
51
+ }
52
+ return i === 0 ? 0 : i;
53
+ }
54
+ function z(e, t, n) {
55
+ const o = W(e, t) / 1e3;
56
+ return Y(n == null ? void 0 : n.roundingMethod)(o);
57
+ }
58
+ function ee(e, t, n) {
59
+ const o = R(), r = (n == null ? void 0 : n.locale) ?? o.locale ?? O, s = 2520, i = b(e, t);
60
+ if (isNaN(i))
61
+ throw new RangeError("Invalid time value");
62
+ const a = Object.assign({}, n, {
63
+ addSuffix: n == null ? void 0 : n.addSuffix,
64
+ comparison: i
65
+ });
66
+ let l, c;
67
+ i > 0 ? (l = f(t), c = f(e)) : (l = f(e), c = f(t));
68
+ const d = z(c, l), m = (T(c) - T(l)) / 1e3, u = Math.round((d - m) / 60);
69
+ let h;
70
+ if (u < 2)
71
+ return n != null && n.includeSeconds ? d < 5 ? r.formatDistance("lessThanXSeconds", 5, a) : d < 10 ? r.formatDistance("lessThanXSeconds", 10, a) : d < 20 ? r.formatDistance("lessThanXSeconds", 20, a) : d < 40 ? r.formatDistance("halfAMinute", 0, a) : d < 60 ? r.formatDistance("lessThanXMinutes", 1, a) : r.formatDistance("xMinutes", 1, a) : u === 0 ? r.formatDistance("lessThanXMinutes", 1, a) : r.formatDistance("xMinutes", u, a);
72
+ if (u < 45)
73
+ return r.formatDistance("xMinutes", u, a);
74
+ if (u < 90)
75
+ return r.formatDistance("aboutXHours", 1, a);
76
+ if (u < S) {
77
+ const g = Math.round(u / 60);
78
+ return r.formatDistance("aboutXHours", g, a);
79
+ } else {
80
+ if (u < s)
81
+ return r.formatDistance("xDays", 1, a);
82
+ if (u < M) {
83
+ const g = Math.round(u / S);
84
+ return r.formatDistance("xDays", g, a);
85
+ } else if (u < M * 2)
86
+ return h = Math.round(u / M), r.formatDistance("aboutXMonths", h, a);
87
+ }
88
+ if (h = Q(c, l), h < 12) {
89
+ const g = Math.round(u / M);
90
+ return r.formatDistance("xMonths", g, a);
91
+ } else {
92
+ const g = h % 12, w = Math.trunc(h / 12);
93
+ return g < 3 ? r.formatDistance("aboutXYears", w, a) : g < 9 ? r.formatDistance("overXYears", w, a) : r.formatDistance("almostXYears", w + 1, a);
94
+ }
95
+ }
96
+ function te(e, t) {
97
+ return ee(e, G(e), t);
98
+ }
99
+ const V = [
100
+ "day",
101
+ "hour",
102
+ "minute",
103
+ "second",
104
+ "millisecond"
105
+ ], L = {
106
+ day: 864e5,
107
+ hour: 36e5,
108
+ minute: 6e4,
109
+ second: 1e3,
110
+ millisecond: 1
111
+ }, ne = {
112
+ day: "d",
113
+ hour: "hr",
114
+ minute: "min",
115
+ second: "s",
116
+ millisecond: "ms"
117
+ }, re = {
118
+ day: ["day", "days"],
119
+ hour: ["hour", "hours"],
120
+ minute: ["minute", "minutes"],
121
+ second: ["second", "seconds"],
122
+ millisecond: ["millisecond", "milliseconds"]
123
+ };
124
+ function oe(e) {
125
+ return e === "day" || e === "hour" || e === "minute" || e === "second" || e === "millisecond";
126
+ }
127
+ function $(e, t) {
128
+ return oe(e) ? e : t;
129
+ }
130
+ function N(e, t) {
131
+ return V.indexOf($(e, t));
132
+ }
133
+ function se(e, t) {
134
+ const n = N(e, "day"), o = N(t, "second"), r = Math.min(n, o), s = Math.max(n, o);
135
+ return V.slice(r, s + 1);
136
+ }
137
+ function ae(e, t) {
138
+ return e * L[$(t, "second")];
139
+ }
140
+ function ie(e, t) {
141
+ const n = se(t.largestUnit, t.smallestUnit), o = n[n.length - 1], r = L[o];
142
+ let s = Math.round(e / r) * r;
143
+ return n.map((i) => {
144
+ const a = L[i], l = Math.floor(s / a);
145
+ return s -= l * a, { unit: i, value: l };
146
+ });
147
+ }
148
+ function le(e, t) {
149
+ const n = e.filter((s) => s.value !== 0), o = n.length > 0 ? n : [e[e.length - 1]], r = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : o.length;
150
+ return o.slice(0, r).map((s) => `${s.value}${ne[s.unit]}`).join(" ");
151
+ }
152
+ function ce(e, t) {
153
+ const n = e.filter((s) => s.value !== 0), o = n.length > 0 ? n : [e[e.length - 1]], r = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : o.length;
154
+ return o.slice(0, r).map((s) => {
155
+ const [i, a] = re[s.unit];
156
+ return `${s.value} ${s.value === 1 ? i : a}`;
157
+ }).join(" ");
158
+ }
159
+ function ue(e) {
160
+ const t = e.some(
161
+ (l) => l.unit === "day" && l.value !== 0
162
+ ), n = e.some((l) => l.unit === "millisecond"), o = e.findIndex((l) => l.value !== 0), r = Math.max(0, e.length - 2), s = t ? 0 : o === -1 ? r : Math.min(o, r), i = o === -1 ? e.slice(r) : e.slice(s);
163
+ if (i.length === 0)
164
+ return "0";
165
+ const a = i.map((l, c) => l.unit === "millisecond" ? String(l.value).padStart(3, "0") : c === 0 ? String(l.value) : String(l.value).padStart(2, "0")).join(":");
166
+ return n ? a.replace(/:(\d{3})$/, ".$1") : a;
167
+ }
168
+ function fe(e, t, n) {
169
+ const o = `${n.prefix || ""}${e}${n.suffix || ""}`;
170
+ return t ? n.negativeInParentheses ? `(${o})` : `-${o}` : o;
171
+ }
172
+ function me(e, t = {}) {
173
+ if (e == null)
174
+ return "";
175
+ const n = typeof e == "number" ? e : typeof e == "string" && e.trim() ? Number(e) : NaN;
176
+ if (!Number.isFinite(n))
177
+ return "";
178
+ const o = t.inputUnit || "second", r = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", s = n < 0, i = Math.abs(ae(n, o)), a = ie(i, t), l = r === "digital" ? ue(a) : r === "long" ? ce(a, t.maxUnits) : le(a, t.maxUnits);
179
+ return fe(l, s, t);
180
+ }
181
+ function de(e, t, n) {
182
+ const o = {
183
+ ...t,
184
+ locale: t.locale ?? n
185
+ };
186
+ if (o.type === "number")
187
+ return y(e, o);
188
+ const { prefix: r, suffix: s, ...i } = o;
189
+ return `${r ?? ""}${y(e, {
190
+ ...i,
191
+ negativeStyle: o.type === "currency" ? o.negativeStyle : "minus"
192
+ })}${s ?? ""}`;
193
+ }
194
+ function p(e, t, n) {
195
+ return e === null ? { value: e, text: null } : !t || !Z(t) && t.type !== "duration" ? {
196
+ value: e,
197
+ text: y(e, { type: "number", locale: n })
198
+ } : t.type === "duration" ? {
199
+ value: e,
200
+ text: me(e, {
201
+ inputUnit: t.inputUnit,
202
+ outputStyle: t.outputStyle,
203
+ largestUnit: t.largestUnit,
204
+ smallestUnit: t.smallestUnit,
205
+ maxUnits: t.maxUnits,
206
+ prefix: t.prefix,
207
+ suffix: t.suffix,
208
+ negativeInParentheses: t.negativeStyle === "parentheses"
209
+ })
210
+ } : { value: e, text: de(e, t, n) };
211
+ }
212
+ function v(e, t, n, o) {
213
+ return e === null ? { value: e, text: null } : o === "percent" ? {
214
+ value: e,
215
+ text: y(e, {
216
+ type: "percent",
217
+ locale: n,
218
+ minimumFractionDigits: t,
219
+ maximumFractionDigits: t,
220
+ percentValueMode: "fraction"
221
+ })
222
+ } : {
223
+ value: e,
224
+ text: y(e, {
225
+ type: "number",
226
+ locale: n,
227
+ minimumFractionDigits: t,
228
+ maximumFractionDigits: t,
229
+ suffix: "×"
230
+ })
231
+ };
232
+ }
233
+ function I(e, t) {
234
+ if (e === void 0) return t;
235
+ if (!Number.isInteger(e) || e < 0 || e > 6)
236
+ throw new RangeError("Comparison precision must be an integer from 0 to 6.");
237
+ return e;
238
+ }
239
+ function Ne(e, t) {
240
+ const n = {
241
+ mode: t.displayMode,
242
+ current: p(
243
+ e.currentValue,
244
+ t.metricFormat,
245
+ t.locale
246
+ ),
247
+ comparison: p(
248
+ e.comparisonValue,
249
+ t.metricFormat,
250
+ t.locale
251
+ )
252
+ };
253
+ return (t.displayMode === "difference" || t.displayMode === "both") && (n.difference = p(
254
+ e.delta,
255
+ t.metricFormat,
256
+ t.locale
257
+ )), (t.displayMode === "percent_change" || t.displayMode === "both") && (n.percentChange = v(
258
+ e.percentChange,
259
+ I(t.precision, 1),
260
+ t.locale,
261
+ "percent"
262
+ )), t.displayMode === "ratio" && (n.ratio = v(
263
+ e.ratio,
264
+ I(t.precision, 2),
265
+ t.locale,
266
+ "ratio"
267
+ )), n;
268
+ }
269
+ function ve(e, t) {
270
+ return e && e !== "auto" ? e : t;
271
+ }
272
+ function Ie(e, t = /* @__PURE__ */ new Date()) {
273
+ try {
274
+ const n = {
275
+ timeZone: e,
276
+ timeZoneName: "short"
277
+ }, r = new Intl.DateTimeFormat("en-US", n).formatToParts(t).find((s) => s.type === "timeZoneName");
278
+ return (r == null ? void 0 : r.value) || e;
279
+ } catch {
280
+ return e;
281
+ }
282
+ }
283
+ function Ve(e) {
284
+ try {
285
+ const t = {
286
+ timeZone: e,
287
+ timeZoneName: "long"
288
+ }, o = new Intl.DateTimeFormat("en-US", t).formatToParts(
289
+ /* @__PURE__ */ new Date()
290
+ ).find((r) => r.type === "timeZoneName");
291
+ return (o == null ? void 0 : o.value) || e;
292
+ } catch {
293
+ return e;
294
+ }
295
+ }
296
+ function C(e, t = "auto") {
297
+ if (!e)
298
+ return /* @__PURE__ */ new Date(NaN);
299
+ const n = e.endsWith("Z"), o = /[+-]\d{2}:?\d{2}$/.test(e), r = /\([A-Z]{3,4}\)$/.test(e);
300
+ if (t === "auto")
301
+ return n || o || r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z");
302
+ if (t === "local") {
303
+ if (n || o) {
304
+ const s = e.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
305
+ return new Date(s);
306
+ }
307
+ return new Date(e);
308
+ } else return t === "UTC" ? n ? new Date(e) : o ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || o || r ? new Date(e) : j(e, t);
309
+ }
310
+ const ge = "MM/dd/yyyy", $e = (e, t, n, o = "auto") => {
311
+ if (!e)
312
+ return "";
313
+ try {
314
+ const r = C(e, o);
315
+ if (isNaN(r.getTime()))
316
+ return e;
317
+ const i = (t && t.trim() ? t : ge).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
318
+ return n && n !== "auto" ? k(r, n, i) : B(r, i);
319
+ } catch (r) {
320
+ return console.error("Date formatting error:", r), e;
321
+ }
322
+ }, Ce = (e, t = "auto") => {
323
+ if (!e)
324
+ return "";
325
+ try {
326
+ const n = C(e, t);
327
+ return isNaN(n.getTime()) ? e : te(n, { addSuffix: !0 });
328
+ } catch (n) {
329
+ return console.error("Relative time formatting error:", n), e;
330
+ }
331
+ };
332
+ function he(e, t = ",") {
333
+ if (e == null)
334
+ return "";
335
+ const n = String(e);
336
+ return n.includes(t) || n.includes('"') || n.includes(`
337
+ `) || n.includes("\r") ? `"${n.replace(/"/g, '""')}"` : n;
338
+ }
339
+ function ye(e, t = ",") {
340
+ return e.map((n) => he(n, t)).join(t);
341
+ }
342
+ function Me(e, t = {}) {
343
+ const { delimiter: n = ",", lineEnding: o = `
344
+ ` } = t;
345
+ return e.map((r) => ye(r, n)).join(o);
346
+ }
347
+ function _e(e, t = {}) {
348
+ if (e.length === 0)
349
+ return "";
350
+ const {
351
+ delimiter: n = ",",
352
+ lineEnding: o = `
353
+ `,
354
+ includeHeaders: r = !0,
355
+ columns: s
356
+ } = t, i = s || Object.keys(e[0]), a = [];
357
+ r && a.push(i);
358
+ for (const l of e) {
359
+ const c = i.map((d) => {
360
+ const m = l[d];
361
+ return m == null ? "" : String(m);
362
+ });
363
+ a.push(c);
364
+ }
365
+ return Me(a, { delimiter: n, lineEnding: o });
366
+ }
367
+ const be = "__TOTAL__";
368
+ function D(e) {
369
+ return typeof e == "object" && e !== null && !Array.isArray(e);
370
+ }
371
+ function x(e) {
372
+ return e === be;
373
+ }
374
+ function Fe(e) {
375
+ const t = /* @__PURE__ */ new Map(), n = (e.groupByColumns ?? []).map((r, s) => {
376
+ var c, d, m;
377
+ if (!D(r))
378
+ throw new Error(`Aggregate groupByColumns[${s}] is invalid`);
379
+ const i = typeof r.id == "string" && r.id.length > 0 ? r.id : void 0, a = i ? (m = (d = (c = e.columnKeyMap) == null ? void 0 : c.byRole) == null ? void 0 : d.groupby) == null ? void 0 : m[i] : void 0, l = (a == null ? void 0 : a.outputKey) || (a == null ? void 0 : a.rawKey) || (typeof r.alias == "string" && r.alias.length > 0 ? r.alias : typeof r.name == "string" && r.name.length > 0 ? r.name : void 0);
380
+ if (!l)
381
+ throw new Error(`Aggregate groupByColumns[${s}] has no output key`);
382
+ return [i, r.alias, r.name, l].forEach((u) => {
383
+ typeof u == "string" && u.length > 0 && t.set(u, l);
384
+ }), l;
385
+ }), o = (e.rowAggregates ?? []).flatMap((r) => !D(r) || typeof r.function != "string" || typeof r.groupLevel != "string" ? [] : [
386
+ {
387
+ function: r.function,
388
+ groupLevel: r.groupLevel === "ALL" ? "ALL" : t.get(r.groupLevel) || r.groupLevel,
389
+ ...typeof r.label == "string" ? { label: r.label } : {}
390
+ }
391
+ ]);
392
+ return { groupColumnKeys: n, rowAggregates: o };
393
+ }
394
+ function _(e) {
395
+ return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
396
+ }
397
+ function De(e) {
398
+ var n;
399
+ if (e.customLabel) return e.customLabel;
400
+ const t = _(e.aggregateFunction);
401
+ if (e.levelValue !== void 0 && !x(e.levelValue)) {
402
+ if (e.levelValue === null) {
403
+ const r = (n = e.formatValue) == null ? void 0 : n.call(e, null);
404
+ return r ? `Subtotal ${r}` : `Subtotal ${t}`;
405
+ }
406
+ const o = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
407
+ if (o) return `Subtotal (${o})`;
408
+ }
409
+ return `Subtotal ${t}`;
410
+ }
411
+ function we(e, t) {
412
+ return t || `Grand ${_(e)}`;
413
+ }
414
+ function F(e) {
415
+ var o, r;
416
+ const t = e.context.groupColumnKeys, n = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
417
+ if (e.row.isGrandTotal === !0) {
418
+ const s = (o = e.context.rowAggregates.find(
419
+ (i) => i.groupLevel === "ALL"
420
+ )) == null ? void 0 : o.label;
421
+ return {
422
+ kind: "grand-total",
423
+ cells: t.map((i, a) => ({
424
+ columnKey: i,
425
+ text: a === 0 ? we(n, s) : "",
426
+ placement: a === 0 ? "label" : "empty",
427
+ colSpan: a === 0 ? t.length : 1
428
+ }))
429
+ };
430
+ }
431
+ if (e.row.isSubtotal === !0) {
432
+ if (typeof e.row.subtotalLevel != "string")
433
+ throw new Error("Aggregate subtotal row is missing subtotalLevel");
434
+ const s = t.indexOf(e.row.subtotalLevel);
435
+ if (s < 0)
436
+ throw new Error(
437
+ `Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
438
+ );
439
+ const i = D(e.row.subtotalContext) ? e.row.subtotalContext : void 0, a = D(i == null ? void 0 : i.groupByValues) ? i.groupByValues : {}, l = (r = e.context.rowAggregates.find(
440
+ (c) => c.groupLevel === e.row.subtotalLevel && c.function === n
441
+ )) == null ? void 0 : r.label;
442
+ return {
443
+ kind: "subtotal",
444
+ cells: t.map((c, d) => {
445
+ if (d > s)
446
+ return {
447
+ columnKey: c,
448
+ text: "",
449
+ placement: "empty",
450
+ colSpan: 1
451
+ };
452
+ if (d < s) {
453
+ const m = e.row[c];
454
+ return {
455
+ columnKey: c,
456
+ text: m === void 0 || x(m) ? "" : e.formatValue(m, c),
457
+ placement: "value",
458
+ colSpan: 1
459
+ };
460
+ }
461
+ return {
462
+ columnKey: c,
463
+ text: De({
464
+ aggregateFunction: n,
465
+ customLabel: l,
466
+ levelValue: a[c],
467
+ formatValue: (m) => e.formatLabelValue ? e.formatLabelValue(m, c) : String(e.formatValue(m, c) ?? "")
468
+ }),
469
+ placement: "label",
470
+ colSpan: t.length - s
471
+ };
472
+ })
473
+ };
474
+ }
475
+ return {
476
+ kind: "data",
477
+ cells: t.map((s) => {
478
+ const i = e.row[s];
479
+ return {
480
+ columnKey: s,
481
+ text: i === void 0 || x(i) ? "" : e.formatValue(i, s),
482
+ placement: "value",
483
+ colSpan: 1
484
+ };
485
+ })
486
+ };
487
+ }
488
+ function Ue(e) {
489
+ const t = F(e).cells.find(
490
+ (n) => n.columnKey === e.columnKey
491
+ );
492
+ if (!t)
493
+ throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
494
+ return t.text;
495
+ }
496
+ function Ee(e) {
497
+ return F(e).cells.map((t) => t.text);
498
+ }
499
+ class pe extends Error {
500
+ constructor(n, o) {
501
+ super(`${n}: ${o}`);
502
+ A(this, "deliveryBlocking", !0);
503
+ this.code = n, this.name = "PivotHeaderPresentationError";
504
+ }
505
+ }
506
+ function Pe(e) {
507
+ var r;
508
+ const t = e.mode ?? "formatted", n = e.members.map((s) => {
509
+ var a;
510
+ if (t === "canonical" || !s.temporalBucket)
511
+ return s.value === null ? "" : String(s.value);
512
+ const i = (a = e.resolveTemporalFormat) == null ? void 0 : a.call(e, s.fieldId);
513
+ if (!i)
514
+ throw new pe(
515
+ "missing_resolved_temporal_format",
516
+ `Missing resolved temporal presentation for pivot field "${s.fieldId}"`
517
+ );
518
+ return X({
519
+ value: s.value,
520
+ metadata: s.temporalBucket,
521
+ format: i
522
+ });
523
+ }), o = ((r = e.metricLabel) == null ? void 0 : r.trim()) || void 0;
524
+ return {
525
+ memberLabels: n,
526
+ ...o ? { metricLabel: o } : {},
527
+ flattenedLabel: [
528
+ ...n,
529
+ ...o ? [o] : []
530
+ ].join(" / ")
531
+ };
532
+ }
533
+ export {
534
+ be as A,
535
+ pe as P,
536
+ $e as a,
537
+ ye as b,
538
+ me as c,
539
+ Ne as d,
540
+ he as e,
541
+ Ce as f,
542
+ Ie as g,
543
+ Ve as h,
544
+ Me as i,
545
+ x as j,
546
+ Fe as k,
547
+ De as l,
548
+ we as m,
549
+ F as n,
550
+ _e as o,
551
+ C as p,
552
+ Ue as q,
553
+ ve as r,
554
+ Ee as s,
555
+ Pe as t,
556
+ te as u
557
+ };
@@ -1 +1 @@
1
- "use strict";var v=Object.defineProperty;var m=(t,e,r)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var n=(t,e,r)=>m(t,typeof e!="symbol"?e+"":e,r);const f=require("./temporal-bucket-contract-ChDBWX8I.cjs");function y(t){return!!(t!=null&&t.isSubtotal&&t.subtotalScope==="pivot-value")}function c(t){var e;return t.expectedPivotFieldIds.length===0?!0:!!((e=t.classification)!=null&&e.isSubtotal&&t.classification.subtotalScope==="grand-total")}class u extends Error{constructor(r){super(`missing_pivot_member_identity: ${r}`);n(this,"deliveryBlocking",!0);n(this,"code","missing_pivot_member_identity");this.name="PivotResultIdentityError"}}function d(t){const{identity:e,columnKey:r,expectedPivotFieldIds:i,allowPrefix:l=!1}=t,s=t.allowEmpty??((i==null?void 0:i.length)||0)===0;if(!e||typeof e!="object"||Array.isArray(e)||typeof e.metricId!="string"||!e.metricId||typeof e.metricAlias!="string"||!e.metricAlias||!Array.isArray(e.members))throw new u(`Physical pivot column "${r}" is missing stable metric or member identity.`);if(e.members.forEach((o,a)=>{if(!o||typeof o!="object"||Array.isArray(o)||typeof o.fieldId!="string"||!o.fieldId||o.value!==null&&typeof o.value!="string"||o.temporalBucket!==void 0&&!f.validateTemporalBucketMetadata(o.temporalBucket).ok)throw new u(`Physical pivot column "${r}" has invalid identity for member ${a}.`);if(i&&o.fieldId!==i[a])throw new u(`Physical pivot column "${r}" has member "${o.fieldId}" at tuple position ${a}; expected "${i[a]||"no member"}".`)}),e.members.length===0){if(s)return e.members;throw new u(`Physical pivot column "${r}" is missing its required pivot tuple.`)}if(i&&(!l&&e.members.length!==i.length||e.members.length>i.length))throw new u(`Physical pivot column "${r}" has ${e.members.length} members; expected ${l?"at most ":""}${i.length}.`);return e.members}function p(t,e){t.forEach(r=>{var l,s,o;if(r.pivotIdentity===void 0)return;const i=(l=e.columnClassifications)==null?void 0:l[r.key];d({identity:r.pivotIdentity,columnKey:r.key,expectedPivotFieldIds:e.expectedPivotFieldIds,allowPrefix:((s=e.allowPrefixForColumn)==null?void 0:s.call(e,r))??y(i),allowEmpty:((o=e.allowEmptyForColumn)==null?void 0:o.call(e,r))??c({expectedPivotFieldIds:e.expectedPivotFieldIds,classification:i})})})}function h(t,e,r){var l;const i=t==null?void 0:t.byRole;if(!(!i||typeof i!="object"||Array.isArray(i)))return(l=i[r])==null?void 0:l[e]}function P(t,e){if(!t)return;const r=t.byRole;if(!r||typeof r!="object"||Array.isArray(r))return;const i=Object.values(r).flatMap(s=>{const o=s==null?void 0:s[e];return o?[o]:[]});if(i.length!==1)return;const[l]=i;if(!(l.role==="metric"&&Object.values(t.byMetricAlias??{}).some(s=>s.role===l.role&&s.rawKey===l.rawKey&&s.outputKey===l.outputKey)))return l}exports.PivotResultIdentityError=u;exports.isPivotEmptyTupleAllowed=c;exports.isPivotSubtotalPrefix=y;exports.requirePivotHeaderMembers=d;exports.requirePivotResultColumnIdentities=p;exports.resolveQueryColumnKeyMapEntry=h;exports.resolveUniqueQueryColumnKeyMapEntry=P;
1
+ "use strict";var v=Object.defineProperty;var m=(t,e,r)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var n=(t,e,r)=>m(t,typeof e!="symbol"?e+"":e,r);const f=require("./temporal-bucket-contract-D2-93DGr.cjs");function y(t){return!!(t!=null&&t.isSubtotal&&t.subtotalScope==="pivot-value")}function c(t){var e;return t.expectedPivotFieldIds.length===0?!0:!!((e=t.classification)!=null&&e.isSubtotal&&t.classification.subtotalScope==="grand-total")}class u extends Error{constructor(r){super(`missing_pivot_member_identity: ${r}`);n(this,"deliveryBlocking",!0);n(this,"code","missing_pivot_member_identity");this.name="PivotResultIdentityError"}}function d(t){const{identity:e,columnKey:r,expectedPivotFieldIds:i,allowPrefix:l=!1}=t,s=t.allowEmpty??((i==null?void 0:i.length)||0)===0;if(!e||typeof e!="object"||Array.isArray(e)||typeof e.metricId!="string"||!e.metricId||typeof e.metricAlias!="string"||!e.metricAlias||!Array.isArray(e.members))throw new u(`Physical pivot column "${r}" is missing stable metric or member identity.`);if(e.members.forEach((o,a)=>{if(!o||typeof o!="object"||Array.isArray(o)||typeof o.fieldId!="string"||!o.fieldId||o.value!==null&&typeof o.value!="string"||o.temporalBucket!==void 0&&!f.validateTemporalBucketMetadata(o.temporalBucket).ok)throw new u(`Physical pivot column "${r}" has invalid identity for member ${a}.`);if(i&&o.fieldId!==i[a])throw new u(`Physical pivot column "${r}" has member "${o.fieldId}" at tuple position ${a}; expected "${i[a]||"no member"}".`)}),e.members.length===0){if(s)return e.members;throw new u(`Physical pivot column "${r}" is missing its required pivot tuple.`)}if(i&&(!l&&e.members.length!==i.length||e.members.length>i.length))throw new u(`Physical pivot column "${r}" has ${e.members.length} members; expected ${l?"at most ":""}${i.length}.`);return e.members}function p(t,e){t.forEach(r=>{var l,s,o;if(r.pivotIdentity===void 0)return;const i=(l=e.columnClassifications)==null?void 0:l[r.key];d({identity:r.pivotIdentity,columnKey:r.key,expectedPivotFieldIds:e.expectedPivotFieldIds,allowPrefix:((s=e.allowPrefixForColumn)==null?void 0:s.call(e,r))??y(i),allowEmpty:((o=e.allowEmptyForColumn)==null?void 0:o.call(e,r))??c({expectedPivotFieldIds:e.expectedPivotFieldIds,classification:i})})})}function h(t,e,r){var l;const i=t==null?void 0:t.byRole;if(!(!i||typeof i!="object"||Array.isArray(i)))return(l=i[r])==null?void 0:l[e]}function P(t,e){if(!t)return;const r=t.byRole;if(!r||typeof r!="object"||Array.isArray(r))return;const i=Object.values(r).flatMap(s=>{const o=s==null?void 0:s[e];return o?[o]:[]});if(i.length!==1)return;const[l]=i;if(!(l.role==="metric"&&Object.values(t.byMetricAlias??{}).some(s=>s.role===l.role&&s.rawKey===l.rawKey&&s.outputKey===l.outputKey)))return l}exports.PivotResultIdentityError=u;exports.isPivotEmptyTupleAllowed=c;exports.isPivotSubtotalPrefix=y;exports.requirePivotHeaderMembers=d;exports.requirePivotResultColumnIdentities=p;exports.resolveQueryColumnKeyMapEntry=h;exports.resolveUniqueQueryColumnKeyMapEntry=P;
@@ -1,7 +1,7 @@
1
1
  var y = Object.defineProperty;
2
2
  var c = (t, e, r) => e in t ? y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var u = (t, e, r) => c(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { v as d } from "./temporal-bucket-contract-_F6vNhhH.js";
4
+ import { v as d } from "./temporal-bucket-contract-D5d-xEl3.js";
5
5
  function f(t) {
6
6
  return !!(t != null && t.isSubtotal && t.subtotalScope === "pivot-value");
7
7
  }