react-semaphor 0.1.602 → 0.1.604

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 (211) hide show
  1. package/dist/activity/index.js +1 -73
  2. package/dist/analytics-protocol/index.js +1 -1451
  3. package/dist/appearance/index.js +1 -12
  4. package/dist/appearance-runtime/index.js +1 -5
  5. package/dist/assistant-context/index.js +1 -11
  6. package/dist/assistant-protocol/index.js +1 -152
  7. package/dist/brand-studio/index.js +4 -1594
  8. package/dist/briefings/index.js +1 -70
  9. package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
  10. package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
  11. package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
  12. package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
  13. package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
  14. package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
  15. package/dist/chunks/attribution-BEFSsbNn.js +1 -0
  16. package/dist/chunks/availability-3AIOf6Z-.js +1 -0
  17. package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
  18. package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
  19. package/dist/chunks/brand-DCaZyRt6.js +1 -0
  20. package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
  21. package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
  22. package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
  23. package/dist/chunks/context-ALdccLHw.js +2 -0
  24. package/dist/chunks/conversation-JMK2kyTK.js +1 -0
  25. package/dist/chunks/dashboard-BX28ld6s.js +1 -0
  26. package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
  27. package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
  28. package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
  29. package/dist/chunks/dates-D-KP8G-z.js +1 -0
  30. package/dist/chunks/edit-DEAK0UZo.js +1 -0
  31. package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
  32. package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
  33. package/dist/chunks/filter-line-CwQrqORc.js +1 -0
  34. package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
  35. package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
  36. package/dist/chunks/index-B-VF1ogs.js +1 -0
  37. package/dist/chunks/index-BE1DfxNs.js +1 -0
  38. package/dist/chunks/index-DViPGDFj.js +1 -0
  39. package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
  40. package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
  41. package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
  42. package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
  43. package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
  44. package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
  45. package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
  46. package/dist/chunks/palette-BzC-CGOc.js +6 -0
  47. package/dist/chunks/pickers-DuBrUht0.js +1 -0
  48. package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
  49. package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
  50. package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
  51. package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
  52. package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
  53. package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
  54. package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
  55. package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
  56. package/dist/chunks/save-DdFUZcbi.js +6 -0
  57. package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
  58. package/dist/chunks/schema-MC0cQSAb.js +4 -0
  59. package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
  60. package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
  61. package/dist/chunks/set-DuJfGkbY.js +1 -0
  62. package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
  63. package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
  64. package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
  65. package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
  66. package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
  67. package/dist/chunks/validators-CqV3Yka1.js +1 -0
  68. package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
  69. package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
  70. package/dist/dashboard/index.js +1 -7
  71. package/dist/dashboard-authoring/index.js +1 -4491
  72. package/dist/format-utils/index.js +1 -424
  73. package/dist/index.js +1 -554
  74. package/dist/layouts/index.js +1 -7
  75. package/dist/live-channel/index.js +1 -124
  76. package/dist/pdf-export-policy/index.js +1 -92
  77. package/dist/pdf-table-layout/index.js +1 -993
  78. package/dist/report-runtime-context/index.js +1 -9
  79. package/dist/shared/index.js +1 -6
  80. package/dist/style.css +1 -1
  81. package/dist/surfboard/index.js +1 -9
  82. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
  83. package/dist/types/index.js +1 -88
  84. package/dist/types/lib/document/document-edits.d.ts +0 -4
  85. package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
  86. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
  87. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  88. package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
  89. package/dist/types/lib/types/common-types.d.ts +0 -2
  90. package/dist/types/lib/types/explorer-types.d.ts +1 -1
  91. package/dist/types/lib/types/semantic-types.d.ts +6 -10
  92. package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
  93. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
  94. package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
  95. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
  96. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
  97. package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
  98. package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
  99. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
  100. package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
  101. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  102. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
  103. package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
  104. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
  105. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
  106. package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
  107. package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
  108. package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
  109. package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
  110. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
  111. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
  112. package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
  113. package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
  114. package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
  115. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
  116. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  117. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
  118. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
  119. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
  120. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  121. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  122. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
  123. package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
  124. package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
  125. package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
  126. package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
  127. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
  128. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
  129. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
  130. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
  131. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
  132. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
  133. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
  134. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
  135. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
  136. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
  137. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
  138. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
  139. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
  140. package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
  141. package/dist/types/shared/format-utils/index.d.ts +1 -0
  142. package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
  143. package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
  144. package/dist/types/shared/temporal/index.d.ts +2 -0
  145. package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
  146. package/dist/types/shared/temporal/temporal.d.ts +27 -0
  147. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
  148. package/dist/usage-events/index.js +1 -285
  149. package/dist/value-format-preferences/index.js +1 -635
  150. package/package.json +6 -2
  151. package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
  152. package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
  153. package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
  154. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
  155. package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
  156. package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
  157. package/dist/chunks/attribution-BvoKvhcj.js +0 -32
  158. package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
  159. package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
  160. package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
  161. package/dist/chunks/brand-BoUV0iHF.js +0 -54
  162. package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
  163. package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
  164. package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
  165. package/dist/chunks/context-BJoEFgNl.js +0 -369
  166. package/dist/chunks/conversation-sQiWYUOb.js +0 -16
  167. package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
  168. package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
  169. package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
  170. package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
  171. package/dist/chunks/dates-Bz-qM5px.js +0 -164
  172. package/dist/chunks/edit-9df1zOWe.js +0 -226
  173. package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
  174. package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
  175. package/dist/chunks/filter-line-BXT6y303.js +0 -703
  176. package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
  177. package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
  178. package/dist/chunks/index-BVKzKl5d.js +0 -90
  179. package/dist/chunks/index-BW0yozjs.js +0 -2795
  180. package/dist/chunks/index-CV_Kzou0.js +0 -595
  181. package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
  182. package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
  183. package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
  184. package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
  185. package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
  186. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
  187. package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
  188. package/dist/chunks/palette-CuA0HlzF.js +0 -23
  189. package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
  190. package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
  191. package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
  192. package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
  193. package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
  194. package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
  195. package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
  196. package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
  197. package/dist/chunks/resolver-DG_tfEpt.js +0 -156
  198. package/dist/chunks/save-BKHlDONy.js +0 -21
  199. package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
  200. package/dist/chunks/schema-C9NPiIru.js +0 -2568
  201. package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
  202. package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
  203. package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
  204. package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
  205. package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
  206. package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
  207. package/dist/chunks/token-types-D_xKgyVS.js +0 -8
  208. package/dist/chunks/upload-Dll_M7XQ.js +0 -15
  209. package/dist/chunks/validators-ClWHpYql.js +0 -3686
  210. package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
  211. package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
@@ -1,741 +0,0 @@
1
- import { aH as Q, i as ee, j as T, m as te, S as V, aI as R, aJ as X, aK as re, aL as G, aM as H, am as ne, ao as oe, aN as w, aO as $ } from "./pivot-result-contract-expectations-C8KL7hPx.js";
2
- import { h as S } from "./export-file-format-C-tJsxsf.js";
3
- import { a6 as ae, aX as q, m as E, k as se } from "./validators-ClWHpYql.js";
4
- import "./matrix-operation-contract--DkNCOzd.js";
5
- import "./analytics-base-schemas-DevrgqQb.js";
6
- import { readPdfCapacityFacts as ie, PDF_SAFETY_LIMIT_EXCEEDED as O, PDF_CAPACITY as v, PDF_NUMBER_COLUMN_TOO_WIDE as K, getUtf8ByteLength as ue, FAST_PDF_POLICY as le, isPdfCapacityRefusalCode as ce } from "../pdf-export-policy/index.js";
7
- import { w as me } from "./raw-temporal-value-E416F-0L.js";
8
- function de(e, t, r) {
9
- const n = {
10
- ...t,
11
- locale: t.locale ?? r
12
- };
13
- if (n.type === "number")
14
- return T(e, n);
15
- const { prefix: o, suffix: a, ...s } = n;
16
- return `${o ?? ""}${T(e, {
17
- ...s,
18
- negativeStyle: n.type === "currency" ? n.negativeStyle : "minus"
19
- })}${a ?? ""}`;
20
- }
21
- function I(e, t, r) {
22
- return e === null ? { value: e, text: null } : !t || !ee(t) && t.type !== "duration" ? {
23
- value: e,
24
- text: T(e, { type: "number", locale: r })
25
- } : t.type === "duration" ? {
26
- value: e,
27
- text: te(e, {
28
- inputUnit: t.inputUnit,
29
- outputStyle: t.outputStyle,
30
- largestUnit: t.largestUnit,
31
- smallestUnit: t.smallestUnit,
32
- maxUnits: t.maxUnits,
33
- prefix: t.prefix,
34
- suffix: t.suffix,
35
- negativeInParentheses: t.negativeStyle === "parentheses"
36
- })
37
- } : { value: e, text: de(e, t, r) };
38
- }
39
- function U(e, t, r, n) {
40
- return e === null ? { value: e, text: null } : n === "percent" ? {
41
- value: e,
42
- text: T(e, {
43
- type: "percent",
44
- locale: r,
45
- minimumFractionDigits: t,
46
- maximumFractionDigits: t,
47
- percentValueMode: "fraction"
48
- })
49
- } : {
50
- value: e,
51
- text: T(e, {
52
- type: "number",
53
- locale: r,
54
- minimumFractionDigits: t,
55
- maximumFractionDigits: t,
56
- suffix: "×"
57
- })
58
- };
59
- }
60
- function j(e, t) {
61
- if (e === void 0) return t;
62
- if (!Number.isInteger(e) || e < 0 || e > 6)
63
- throw new RangeError("Comparison precision must be an integer from 0 to 6.");
64
- return e;
65
- }
66
- function qe(e, t) {
67
- const r = {
68
- mode: t.displayMode,
69
- current: I(
70
- e.currentValue,
71
- t.metricFormat,
72
- t.locale
73
- ),
74
- comparison: I(
75
- e.comparisonValue,
76
- t.metricFormat,
77
- t.locale
78
- )
79
- };
80
- return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference = I(
81
- e.delta,
82
- Q(t.metricFormat),
83
- t.locale
84
- )), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = U(
85
- e.percentChange,
86
- j(t.precision, 1),
87
- t.locale,
88
- "percent"
89
- )), t.displayMode === "ratio" && (r.ratio = U(
90
- e.ratio,
91
- j(t.precision, 2),
92
- t.locale,
93
- "ratio"
94
- )), r;
95
- }
96
- const Ke = {
97
- rowLabels: "tabular",
98
- subtotals: "after"
99
- };
100
- function We(e, t) {
101
- const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, n = e.totals.rows;
102
- return {
103
- ...e,
104
- layout: r,
105
- totals: {
106
- ...e.totals,
107
- rows: {
108
- ...n,
109
- levels: Object.fromEntries(
110
- Object.entries(n.levels).map(([o, a]) => [
111
- o,
112
- { ...a, position: t.subtotals }
113
- ])
114
- )
115
- }
116
- }
117
- };
118
- }
119
- const fe = 2;
120
- function he(e) {
121
- return typeof e == "number" ? Number.isInteger(e) : q(e) ? !e.value.includes(".") : !0;
122
- }
123
- function pe(e, t, r) {
124
- const n = e.descriptors.measures.filter(
125
- (s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && ae(s.column.dataType) === "number"
126
- );
127
- if (n.length === 0) return r;
128
- const o = /* @__PURE__ */ new Set();
129
- e.columns.forEach((s, u) => {
130
- if (!(s.kind !== "measure" || o.has(s.measureId)))
131
- for (const m of t) {
132
- const l = m.values[u];
133
- if ((l == null ? void 0 : l.kind) === "value" && !he(l.value)) {
134
- o.add(s.measureId);
135
- return;
136
- }
137
- }
138
- });
139
- const a = { ...r.measureFormats };
140
- for (const { id: s } of n) {
141
- const u = o.has(s) ? fe : 0;
142
- a[s] = {
143
- type: "number",
144
- minimumFractionDigits: u,
145
- maximumFractionDigits: u,
146
- useGrouping: !0
147
- };
148
- }
149
- return { ...r, measureFormats: a };
150
- }
151
- function L(e) {
152
- return E(e.slice(0, -1));
153
- }
154
- function ge(e, t) {
155
- return t.length > e.length && E(t.slice(0, e.length)) === E(e);
156
- }
157
- function ye(e) {
158
- return e.map((t, r) => {
159
- if (r === 0 || t.kind !== "layout") return !1;
160
- const n = e[r - 1];
161
- if (n.kind !== "layout") return !1;
162
- if (t.role !== "member" || ge(n.rowPath, t.rowPath)) return !0;
163
- const o = e[r - 2];
164
- return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || L(o.rowPath) !== L(n.rowPath)) && t.rowPath.length === n.rowPath.length && L(t.rowPath) === L(n.rowPath);
165
- });
166
- }
167
- const we = "pdf-group-continuation";
168
- function W(e, t, r) {
169
- return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || q(t.value)) ? e : S(e);
170
- }
171
- function be(e, t, r) {
172
- const n = V(e.descriptors, t.presentation, r), o = e.columns.map((i) => {
173
- var c;
174
- return i.kind === "measure" && ((c = n.measureSemantics.get(i.measureId)) == null ? void 0 : c.isNumeric) === !0;
175
- }), a = (i) => R([i], n.levels), s = (i, c, d) => X(i, c, t.presentation.totals[d], n.levels), u = e.columns.map((i) => {
176
- if (i.kind !== "measure") return i.label;
177
- const c = i.columnPath.map(a);
178
- return i.role !== "member" && c.push(s(i.columnPath, i.role, "columns")), [...c, i.label].join(" / ");
179
- }), m = Math.min(t.spec.columns.length, Math.max(
180
- 0,
181
- ...e.columns.map((i) => i.kind === "measure" ? i.columnPath.length + (i.role !== "member" ? 1 : 0) : 0)
182
- )), l = Array.from({ length: m + 1 }, (i, c) => e.columns.map((d) => c === m ? d.label : d.kind !== "measure" ? "" : c < d.columnPath.length ? a(d.columnPath[c]) : c === d.columnPath.length && d.role !== "member" ? s(d.columnPath, d.role, "columns") : "")), f = (i, c) => re({
183
- path: i.rowPath,
184
- role: i.kind === "layout" ? i.role : "member",
185
- levelCount: Math.max(1, t.spec.rows.length),
186
- repeatLabels: t.presentation.layout.kind !== "tabular" || t.presentation.layout.repeatLabels,
187
- previousPath: c == null ? void 0 : c.rowPath
188
- }), P = (i, c) => {
189
- if (i.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
190
- if (i.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
191
- const d = f(i, c);
192
- return e.columns.map((h, p) => {
193
- if (h.kind === "hierarchy")
194
- return `${" ".repeat(Math.max(0, i.rowPath.length - 1))}${s(i.rowPath, i.role, "rows")}`;
195
- if (h.kind === "level") {
196
- const D = t.spec.rows.findIndex((J) => J.id === h.levelId), b = d[D];
197
- return b != null && b.visible ? b.total ? s(i.rowPath, i.role, "rows") : R(b.path, n.levels) : "";
198
- }
199
- const C = i.values[p], x = n.measures.get(h.measureId);
200
- if (C.kind === "value" && !x)
201
- throw new Error("Matrix value is missing its measure descriptor.");
202
- return G(C, x, t.presentation.absence);
203
- });
204
- }, _ = (i, c) => P(i, c).map((d, h) => {
205
- const p = e.columns[h];
206
- return p.kind === "measure" ? W(d, i.values[h], n.measureSemantics.get(p.measureId)) : S(d);
207
- });
208
- return {
209
- headers: u,
210
- headerBands: l,
211
- numericColumns: o,
212
- /** The card's prepared formats this presentation formats with (the Excel form reads its measure formats). */
213
- formatting: n,
214
- /** A row's cells; after `previous`, a tabular layout prints each label once. */
215
- row: (i, c) => P(i, c),
216
- /**
217
- * Level columns whose group label the row above shows, so this row
218
- * continues the group (Plan 2, 2d, C8). Only a member row after a member
219
- * row continues one: a total prints as a band, and its rules stay whole
220
- * above and below it.
221
- */
222
- continuedColumns: (i, c) => {
223
- const d = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
224
- if (!d(i) || !d(c)) return [];
225
- const h = f(i, c);
226
- return e.columns.flatMap((p, C) => {
227
- var D;
228
- if (p.kind !== "level") return [];
229
- const x = t.spec.rows.findIndex((b) => b.id === p.levelId);
230
- return x < i.rowPath.length && ((D = h[x]) == null ? void 0 : D.visible) === !1 ? [C] : [];
231
- });
232
- },
233
- csvRow: (i) => _(i),
234
- /**
235
- * `previousRow` is the row before `data[0]`, carried by the export's
236
- * continuation, so a tabular layout prints each label once across the
237
- * whole file. Retries are pure: suppression never relies on mutable
238
- * formatter state or an earlier worker. Without it, the first row prints
239
- * its labels.
240
- */
241
- csvRows: (i, c) => i.map((d, h) => _(d, h ? i[h - 1] : c ?? void 0))
242
- };
243
- }
244
- function Ye(e) {
245
- return e.columns.map((t) => S(t.label));
246
- }
247
- function Ze(e, t, r) {
248
- return _e(e, t, r).map((n, o) => {
249
- const a = t.columns[o];
250
- return a.kind === "measure" ? W(n, e.values[o], r.measureSemantics.get(a.measureId)) : S(n);
251
- });
252
- }
253
- function _e(e, t, r) {
254
- if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
255
- if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
256
- const n = [...e.rowPath, ...e.columnPath];
257
- return t.columns.map((o, a) => {
258
- if (o.kind === "measure") {
259
- const u = e.values[a], m = r.measures.get(o.measureId);
260
- if (u.kind === "value" && !m) throw new Error("Matrix value is missing its measure descriptor.");
261
- return G(u, m, r.absence);
262
- }
263
- const s = o.kind === "level" ? n.find((u) => u.levelId === o.levelId) : void 0;
264
- if (!s) throw new Error("Flat Matrix row does not match its frozen layout.");
265
- return R([s], r.levels);
266
- });
267
- }
268
- function ve(e) {
269
- const t = be(e.layout, e.request, e.report), r = e.layout.columns.map((s, u) => ({
270
- index: u,
271
- columnId: `matrix:${u}`,
272
- label: t.headers[u],
273
- isNumeric: t.numericColumns[u]
274
- })), n = (s, u, m) => ({
275
- text: s,
276
- colspan: 1,
277
- rowspan: 1,
278
- columnId: r[u].columnId,
279
- isHeader: m,
280
- isNumeric: r[u].isNumeric,
281
- className: r[u].isNumeric ? "numeric" : e.layout.columns[u].kind === "hierarchy" ? "matrix-hierarchy" : ""
282
- }), o = [], a = e.layout.columns.findIndex((s) => s.kind === "measure");
283
- e.request.spec.columns.length && a >= 0 && o.push({
284
- repeatHeader: !0,
285
- headerType: "pivot-axis",
286
- headerRowIndex: 0,
287
- cells: [
288
- ...a ? [{ ...n("", 0, !0), colspan: a }] : [],
289
- {
290
- ...n(e.request.spec.columns.map((s) => H(s, e.request.presentation)).join(" / "), a, !0),
291
- colspan: e.layout.columns.length - a,
292
- isNumeric: !1,
293
- className: ""
294
- }
295
- ]
296
- });
297
- for (const [s, u] of t.headerBands.entries())
298
- o.push({
299
- repeatHeader: !0,
300
- headerType: s === t.headerBands.length - 1 ? "metrics" : "pivot-level",
301
- headerRowIndex: o.length,
302
- cells: u.map((m, l) => n(m, l, !0))
303
- });
304
- return {
305
- headers: o,
306
- rows: e.rows.map((s, u) => {
307
- const m = new Set(t.continuedColumns(s, e.rows[u - 1]));
308
- return {
309
- index: u,
310
- type: s.kind === "layout" && s.role !== "member" ? "subtotal" : "data",
311
- subtotalLevel: String(s.rowPath.length),
312
- // A tabular layout prints each label once unless it repeats them; the
313
- // blank cell continues its group, so a grid draws no rule above it.
314
- cells: t.row(s, e.rows[u - 1]).map((l, f) => m.has(f) ? { ...n(l, f, !1), className: we } : n(l, f, !1))
315
- };
316
- }),
317
- grandTotal: null,
318
- // Totals are already in the ordered body at their authored position.
319
- metadata: {
320
- tableType: "pivot",
321
- totalRows: e.rows.length,
322
- totalColumns: r.length,
323
- rowLevels: e.layout.columns.filter((s) => s.kind !== "measure").length,
324
- pivotLevels: e.request.spec.columns.length,
325
- hasGrandTotal: !1,
326
- columnOrder: r.map((s) => s.columnId),
327
- columns: r
328
- }
329
- };
330
- }
331
- function Pe(e, t, r) {
332
- const { levels: n } = V(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, a = [], s = [], u = e.columns.map((l, f) => {
333
- if (l.kind !== "measure") return null;
334
- const P = o ? `${l.role}:${E(l.columnPath)}` : `measure:${f}`;
335
- let _ = a.indexOf(P);
336
- return _ < 0 && (_ = a.push(P) - 1, s.push(o ? X(l.columnPath, l.role, t.presentation.totals.columns, n) : l.label)), _;
337
- }), m = t.spec.columns[t.spec.columns.length - 1];
338
- return {
339
- columnGroups: u,
340
- groupLabels: s,
341
- /** What bands name their groups by: the innermost column level, or "Measures". */
342
- groupLevelLabel: m ? H(m, t.presentation) : "Measures"
343
- };
344
- }
345
- function ze(e) {
346
- const { layout: t, rows: r, report: n } = e, o = {
347
- ...e.request,
348
- presentation: pe(t, r, e.request.presentation)
349
- }, a = ve({ layout: t, rows: r, request: o, report: n }), s = ye(r), u = Pe(t, o, n), m = {
350
- ...a,
351
- rows: a.rows.map((l, f) => ({ ...l, keepWithPrevious: s[f] })),
352
- metadata: { ...a.metadata, ...u }
353
- };
354
- return { request: o, table: m, ...u };
355
- }
356
- const y = (e) => e.toLocaleString("en-US"), M = (e) => `${y(Math.ceil(e / 1048576))} MB`, F = "export the data as CSV or Excel";
357
- function Je(e) {
358
- const t = ie(e.facts), r = e.dataExport ? `Add a filter to narrow it, or ${F}.` : "Add a filter to narrow it, then export again.";
359
- switch (e.code) {
360
- case "PDF_ROW_LIMIT_EXCEEDED": {
361
- const n = e.subject ?? "This table", o = t.rowLimit ?? v.maxTableRows;
362
- return t.rowCount !== void 0 ? `${n} has ${y(t.rowCount)} rows. A PDF holds up to ${y(o)} rows per table. ${r}` : `${n} has more than ${y(o)} rows, the most a PDF holds per table. ${r}`;
363
- }
364
- case "PDF_PAGE_LIMIT_EXCEEDED": {
365
- const n = e.subject ?? "This PDF", o = t.pageLimit ?? v.maxPages;
366
- return t.pageCount !== void 0 ? `${n} is ${y(t.pageCount)} pages. A PDF holds up to ${y(o)}. ${r}` : `${n} is longer than ${y(o)} pages, the most a PDF holds. ${r}`;
367
- }
368
- case "PDF_SIZE_LIMIT_EXCEEDED": {
369
- const n = e.subject ?? "This PDF", o = t.byteLimit ?? v.maxFileBytes;
370
- return t.bytes !== void 0 ? `${n} is ${M(t.bytes)}. A PDF file holds up to ${M(o)}. ${r}` : `${n} is larger than ${M(o)}, the most a PDF file holds. ${r}`;
371
- }
372
- case "PDF_CAPTURE_TOO_TALL":
373
- return `${e.subject ?? "This dashboard"} is too long to print as one PDF. Print one sheet or fewer cards${e.dataExport ? `, or ${F}` : ""}.`;
374
- case K:
375
- return `A number in this table is too wide for its column in a PDF. Use landscape or fewer columns${e.dataExport ? `, or ${F}` : ""}.`;
376
- case O:
377
- return `This PDF is over what a PDF holds: ${y(v.maxTableRows)} rows per table, ${y(
378
- v.maxPages
379
- )} pages and ${M(v.maxFileBytes)}. ${r}`;
380
- }
381
- }
382
- class xe extends Error {
383
- constructor(t, r = O) {
384
- super(t), this.code = r;
385
- }
386
- }
387
- function Te(e) {
388
- return ce(e) || e === O || e === K;
389
- }
390
- function B(e) {
391
- if (!e || typeof e != "object")
392
- return;
393
- const { error: t, message: r, detail: n } = e;
394
- for (const o of [t, r, n])
395
- if (typeof o == "string" && o.trim())
396
- return o.trim();
397
- }
398
- async function $e(e) {
399
- const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
400
- try {
401
- if (r.includes("application/json")) {
402
- const o = await e.json(), a = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
403
- return { message: B(o) || t, code: a };
404
- }
405
- const n = await e.text();
406
- if (!n.trim())
407
- return { message: t };
408
- try {
409
- const o = JSON.parse(n), a = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
410
- return {
411
- message: B(o) || n.trim(),
412
- code: a
413
- };
414
- } catch {
415
- return { message: n.trim() };
416
- }
417
- } catch {
418
- return { message: t };
419
- }
420
- }
421
- async function Qe(e) {
422
- if (!e.token) throw new Error("Missing auth token for PDF export");
423
- if (ue(e.serializedPayload) > le.maxRequestBytes)
424
- throw new Error("Fast-path PDF request exceeds the structured body limit");
425
- const t = await (e.fetchImpl ?? fetch)(e.url, {
426
- method: "POST",
427
- headers: { "Content-Type": "application/json", Authorization: `Bearer ${e.token}` },
428
- body: e.serializedPayload,
429
- signal: e.signal
430
- });
431
- if (!t.ok) {
432
- const n = await $e(t);
433
- throw Te(n.code) ? new xe(n.message, n.code) : new Error(n.message);
434
- }
435
- const r = await t.json();
436
- if (r != null && r.error) throw new Error(r.error);
437
- if (typeof (r == null ? void 0 : r.url) != "string" || !r.url.trim())
438
- throw new Error("Fast-path PDF response missing download URL");
439
- return r;
440
- }
441
- const et = 1, Y = ["loading", "measuring", "checking", "laidOut"], Ce = [
442
- // Already emitted before these contracts; names kept.
443
- "document_matrix_too_large",
444
- "document_matrix_unavailable",
445
- "document_matrix_too_wide",
446
- "document_kpi_value_overflow",
447
- "print_inputs_not_captured",
448
- // New.
449
- "document_section_setup",
450
- "document_input_missing",
451
- "document_section_query_failed",
452
- "document_table_completeness_unverified",
453
- "document_row_limit_exceeded",
454
- "document_section_render_failed",
455
- "document_page_overflow",
456
- "document_sheet_not_found",
457
- "document_print_timed_out",
458
- // PDF capacity contract PC-D3: more pages than one PDF holds.
459
- "document_page_limit_exceeded"
460
- ];
461
- function tt(e) {
462
- return Ce.includes(e);
463
- }
464
- const De = 64, Le = 120, Me = 3, Ee = 80, Se = [...Y, "noPageStack", "unknown"];
465
- function A(e, t) {
466
- return typeof e != "string" ? void 0 : e.trim().slice(0, t).trim() || void 0;
467
- }
468
- function g(e, t) {
469
- return typeof e == "number" && Number.isInteger(e) && e >= t ? e : void 0;
470
- }
471
- function k(e, t) {
472
- return t.includes(e) ? e : void 0;
473
- }
474
- function Ie(e) {
475
- let t = e;
476
- if (typeof e == "string")
477
- try {
478
- t = JSON.parse(e);
479
- } catch {
480
- return {};
481
- }
482
- if (!t || typeof t != "object" || Array.isArray(t)) return {};
483
- const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((a) => A(a, Ee)).filter((a) => a !== void 0).slice(0, Me) : [], o = {
484
- sectionId: A(r.sectionId, De),
485
- sectionTitle: A(r.sectionTitle, Le),
486
- pageNumber: g(r.pageNumber, 1),
487
- rowCount: g(r.rowCount, 0),
488
- rowLimit: g(r.rowLimit, 1),
489
- inputLabels: n.length ? n : void 0,
490
- overflowAxis: k(r.overflowAxis, ["height", "width"]),
491
- overflowPx: g(r.overflowPx, 0),
492
- matrixLimit: k(r.matrixLimit, ["rows", "bytes"]),
493
- layoutStage: k(r.layoutStage, Se),
494
- loadingSectionCount: g(r.loadingSectionCount, 0),
495
- measuredRowCount: g(r.measuredRowCount, 0),
496
- totalRowCount: g(r.totalRowCount, 0),
497
- pageCount: g(r.pageCount, 0),
498
- pageLimit: g(r.pageLimit, 1)
499
- };
500
- return Object.fromEntries(
501
- Object.entries(o).filter(([, a]) => a !== void 0)
502
- );
503
- }
504
- function rt(e) {
505
- const t = Ie(e.facts), r = t.sectionTitle ? `Section "${t.sectionTitle}"` : t.sectionId ? `Section ${t.sectionId}` : "A section", n = t.pageNumber !== void 0 ? ` on page ${t.pageNumber}` : "";
506
- switch (e.code) {
507
- case "document_section_setup":
508
- return `${r} is not set up to print.`;
509
- case "document_input_missing":
510
- return t.inputLabels ? `${r} needs a value for ${t.inputLabels.join(", ")}.` : `${r} needs a value for a required input.`;
511
- case "document_section_query_failed":
512
- return `${r}: its data could not be loaded.`;
513
- case "document_table_completeness_unverified":
514
- return `${r}: the query returned no total row count, so the table could not be confirmed complete.`;
515
- case "document_row_limit_exceeded":
516
- return t.rowCount !== void 0 && t.rowLimit !== void 0 ? `${r} has ${t.rowCount} rows; a document table prints up to ${t.rowLimit}.` : `${r} has more rows than a document table prints.`;
517
- case "document_section_render_failed":
518
- return `${r} could not be drawn.`;
519
- case "document_page_overflow":
520
- return `${r}${n} does not fit the page${t.overflowAxis ? ` (${t.overflowAxis}` : ""}${t.overflowAxis && t.overflowPx !== void 0 ? `, ${t.overflowPx} px over` : ""}${t.overflowAxis ? ")" : ""}.`;
521
- case "document_matrix_too_large":
522
- return t.matrixLimit === "rows" && t.rowLimit !== void 0 ? `${r}: the Matrix has more than ${t.rowLimit} rows, the most a report prints.` : `${r}: the Matrix is too large to print.`;
523
- case "document_matrix_unavailable":
524
- return `${r}: the Matrix result could not be loaded.`;
525
- case "document_matrix_too_wide":
526
- return `${r}: the Matrix is wider than the page.`;
527
- case "document_kpi_value_overflow":
528
- return `${r}: a KPI value does not fit its tile.`;
529
- case "print_inputs_not_captured":
530
- return t.inputLabels ? `The report's input values were not saved: ${t.inputLabels.join(", ")}.` : "The report's input values were not saved.";
531
- case "document_sheet_not_found":
532
- return "The requested Document sheet is not in the dashboard.";
533
- case "document_page_limit_exceeded":
534
- return t.pageCount !== void 0 && t.pageLimit !== void 0 ? `The Document is ${t.pageCount} pages; a PDF holds up to ${t.pageLimit}.` : "The Document has more pages than a PDF holds.";
535
- case "document_print_timed_out":
536
- return [
537
- `The Document did not finish preparing in time (stage ${t.layoutStage ?? "unknown"}`,
538
- t.measuredRowCount !== void 0 ? `; ${t.measuredRowCount} of ${t.totalRowCount ?? "unknown"} rows measured` : "",
539
- t.pageCount !== void 0 ? `; ${t.pageCount} pages` : "",
540
- t.loadingSectionCount ? `; ${t.loadingSectionCount} sections loading` : "",
541
- ")."
542
- ].join("");
543
- }
544
- }
545
- function Fe(e) {
546
- return Y.includes(e);
547
- }
548
- function N(e) {
549
- return typeof e == "number" && Number.isInteger(e) && e >= 0;
550
- }
551
- function nt(e) {
552
- let t = e;
553
- if (typeof e == "string")
554
- try {
555
- t = JSON.parse(e);
556
- } catch {
557
- return;
558
- }
559
- if (!t || typeof t != "object" || Array.isArray(t)) return;
560
- const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: a } = t;
561
- if (!(!Fe(r) || !N(n) || o !== null && !N(o) || a !== null && !N(a)))
562
- return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: a };
563
- }
564
- function ot(e, t, r) {
565
- const n = t.from > e.start ? t.from : e.start, o = t.to && t.to < e.end ? t.to : e.end, a = o > r ? "running" : n > e.start ? "start" : o < e.end ? "end" : void 0;
566
- return { start: n, end: o, ...a ? { partial: a } : {} };
567
- }
568
- function at(e, t, r) {
569
- switch (t) {
570
- case "running":
571
- return `${e} (so far)`;
572
- case "start":
573
- return r ? `${e} (from ${r.start})` : `${e} (partial)`;
574
- case "end":
575
- return r ? `${e} (to ${r.end})` : `${e} (partial)`;
576
- default:
577
- return e;
578
- }
579
- }
580
- function st(e, t, r) {
581
- const n = Date.parse(e.startInclusive), o = Date.parse(e.endExclusive);
582
- if (!Number.isFinite(n) || !Number.isFinite(o)) return;
583
- if (t.granularity === "hour" || t.granularity === "minute" || t.granularity === "second") {
584
- const m = (l) => {
585
- try {
586
- return new Intl.DateTimeFormat((r == null ? void 0 : r.locale) ?? "en-US", {
587
- timeStyle: (r == null ? void 0 : r.dateTime.timeStyle) ?? "short",
588
- timeZone: t.calendar.tz
589
- }).format(new Date(l));
590
- } catch {
591
- return new Date(l).toISOString();
592
- }
593
- };
594
- return { start: m(n), end: m(o) };
595
- }
596
- const a = { kind: "temporal_bucket", granularity: "day", calendar: t.calendar };
597
- let s;
598
- try {
599
- s = ne({
600
- metadata: a,
601
- locale: (r == null ? void 0 : r.locale) ?? "en-US",
602
- ...r ? { styles: { dateStyle: r.dateStyle, dateTime: r.dateTime } } : {}
603
- });
604
- } catch {
605
- s = void 0;
606
- }
607
- const u = (m) => {
608
- const l = me(new Date(m), t.calendar.tz), f = `${String(l.year).padStart(4, "0")}-${String(l.month).padStart(2, "0")}-${String(l.day).padStart(2, "0")}`;
609
- try {
610
- return s ? oe({ value: f, metadata: a, format: s.format }) : f;
611
- } catch {
612
- return f;
613
- }
614
- };
615
- return { start: u(n), end: u(o - 1) };
616
- }
617
- function it(e) {
618
- return ((e == null ? void 0 : e.filterValues) ?? []).filter(Ae).map(ke);
619
- }
620
- function Ae(e) {
621
- return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
622
- }
623
- function ke(e) {
624
- if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
625
- const { relativeMeta: t, ...r } = e, n = se(t);
626
- return n ? { ...r, relativeMeta: n } : r;
627
- }
628
- const Ne = /* @__PURE__ */ new Set([
629
- "day",
630
- "week",
631
- "month",
632
- "quarter",
633
- "year"
634
- ]);
635
- function Re(e, t) {
636
- try {
637
- const r = $(e), n = w(r, t, "yyyy-MM-dd");
638
- if (w(r, t, "HH:mm:ss.SSS") !== "00:00:00.000")
639
- return {
640
- date: n,
641
- time: w(r, t, "h:mm a")
642
- };
643
- const [o, a, s] = n.split("-").map(Number), u = new Date(Date.UTC(o, a - 1, s));
644
- return u.setUTCDate(u.getUTCDate() - 1), { date: w(u, "UTC", "yyyy-MM-dd") };
645
- } catch {
646
- return;
647
- }
648
- }
649
- function Z(e, t, r) {
650
- const n = Re(e.end, t);
651
- if (n)
652
- return {
653
- start: w(
654
- $(e.start),
655
- t,
656
- r ? "MMM d" : "MMM d, yyyy"
657
- ),
658
- endDate: w(
659
- $(`${n.date}T00:00:00Z`),
660
- "UTC",
661
- "MMM d, yyyy"
662
- ),
663
- ...n.time ? { endTime: n.time } : {}
664
- };
665
- }
666
- function z(e) {
667
- return !!(e && Ne.has(e));
668
- }
669
- function ut(e, t, r, n = !1) {
670
- if (z(r))
671
- try {
672
- const a = Z(e, t, !1);
673
- if (a && a.start === a.endDate)
674
- return a.endTime ? `${a.endDate} until ${a.endTime}` : a.endDate;
675
- } catch {
676
- }
677
- const o = Oe(
678
- e,
679
- t,
680
- r,
681
- n
682
- );
683
- return `${o.start} – ${o.end}`;
684
- }
685
- function Oe(e, t, r, n = !1) {
686
- try {
687
- if (z(r)) {
688
- const o = Z(e, t, n);
689
- if (o)
690
- return {
691
- start: o.start,
692
- end: o.endTime ? `${o.endDate}, ${o.endTime}` : o.endDate
693
- };
694
- }
695
- if (r === "second" || r === "minute" || r === "hour") {
696
- const o = n ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
697
- return {
698
- start: w($(e.start), t, o),
699
- end: `before ${w(
700
- $(e.end),
701
- t,
702
- o
703
- )}`
704
- };
705
- }
706
- } catch {
707
- }
708
- return { start: e.start, end: `before ${e.end}` };
709
- }
710
- export {
711
- Oe as A,
712
- et as D,
713
- Ke as M,
714
- we as P,
715
- qe as a,
716
- Ye as b,
717
- Ze as c,
718
- ve as d,
719
- ze as e,
720
- ut as f,
721
- We as g,
722
- fe as h,
723
- pe as i,
724
- ye as j,
725
- Je as k,
726
- xe as l,
727
- _e as m,
728
- Te as n,
729
- Qe as o,
730
- be as p,
731
- Ce as q,
732
- $e as r,
733
- tt as s,
734
- Ie as t,
735
- rt as u,
736
- nt as v,
737
- ot as w,
738
- at as x,
739
- st as y,
740
- it as z
741
- };