react-semaphor 0.1.603 → 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 (167) hide show
  1. package/dist/activity/index.js +1 -73
  2. package/dist/analytics-protocol/index.js +1 -1491
  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 -4614
  72. package/dist/format-utils/index.js +1 -425
  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/index.js +1 -88
  83. package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
  84. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
  85. package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
  86. package/dist/types/lib/types/semantic-types.d.ts +6 -10
  87. package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
  88. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
  89. package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
  90. package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
  91. package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
  92. package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
  93. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
  94. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
  95. package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
  96. package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
  97. package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
  98. package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
  99. package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
  100. package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
  101. package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
  102. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -0
  103. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
  104. package/dist/usage-events/index.js +1 -285
  105. package/dist/value-format-preferences/index.js +1 -635
  106. package/package.json +4 -1
  107. package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
  108. package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
  109. package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
  110. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
  111. package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
  112. package/dist/chunks/assistant-chat-B6hNQI1t.js +0 -6115
  113. package/dist/chunks/attribution-BvoKvhcj.js +0 -32
  114. package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
  115. package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
  116. package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
  117. package/dist/chunks/brand-BoUV0iHF.js +0 -54
  118. package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
  119. package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
  120. package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
  121. package/dist/chunks/context-UCQ7sere.js +0 -369
  122. package/dist/chunks/conversation-sQiWYUOb.js +0 -16
  123. package/dist/chunks/dashboard-BghI99oY.js +0 -14
  124. package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
  125. package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
  126. package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
  127. package/dist/chunks/dates-BnrXF4bb.js +0 -185
  128. package/dist/chunks/edit-9df1zOWe.js +0 -226
  129. package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
  130. package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
  131. package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
  132. package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
  133. package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
  134. package/dist/chunks/index-BVKzKl5d.js +0 -90
  135. package/dist/chunks/index-CV_Kzou0.js +0 -595
  136. package/dist/chunks/index-D5rxbtS4.js +0 -2795
  137. package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
  138. package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
  139. package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
  140. package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
  141. package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
  142. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
  143. package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
  144. package/dist/chunks/palette-Be62Tkoa.js +0 -23
  145. package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
  146. package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
  147. package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
  148. package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
  149. package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
  150. package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
  151. package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
  152. package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
  153. package/dist/chunks/resolver-DG_tfEpt.js +0 -156
  154. package/dist/chunks/save-C5A0JnEV.js +0 -21
  155. package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
  156. package/dist/chunks/schema-C9NPiIru.js +0 -2568
  157. package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
  158. package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
  159. package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
  160. package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
  161. package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
  162. package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
  163. package/dist/chunks/token-types-XbM6QByy.js +0 -8
  164. package/dist/chunks/upload-H15d7uHK.js +0 -15
  165. package/dist/chunks/validators-Baf3VIf5.js +0 -3686
  166. package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
  167. package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
@@ -1,391 +0,0 @@
1
- import { $ as z, F as C } from "./raw-temporal-value-Dg_MTFF7.js";
2
- import { w as B, q as b, t as M, l as I, L as N, z as y, p as T, s as F, o as L } from "./matrix-analytical-definition-CCp48UCw.js";
3
- import { b as V } from "./metric-comparison-B0FR-Q8I.js";
4
- import { m as S } from "./validators-Baf3VIf5.js";
5
- function U(e) {
6
- const t = j(e);
7
- return O(t) ? t : void 0;
8
- }
9
- function j(e) {
10
- if (typeof e != "string" || e.trim().length === 0)
11
- return;
12
- const t = e.trim().toLowerCase();
13
- switch (t) {
14
- case "=":
15
- return "=";
16
- case "!=":
17
- return "!=";
18
- case "in":
19
- return "in";
20
- case "not_in":
21
- return "not_in";
22
- case "contains":
23
- return "contains";
24
- case "not_contains":
25
- return "not_contains";
26
- case "between":
27
- return "between";
28
- case "not_between":
29
- return "not_between";
30
- case ">":
31
- case ">=":
32
- case "<":
33
- case "<=":
34
- return t;
35
- case "is_null":
36
- return "is_null";
37
- case "is_not_null":
38
- return "is_not_null";
39
- default:
40
- return q(e) ? e : void 0;
41
- }
42
- }
43
- function O(e) {
44
- return e === "=" || e === "!=" || e === "in" || e === "not_in" || e === "contains" || e === "not_contains" || e === "between" || e === "not_between" || e === ">" || e === ">=" || e === "<" || e === "<=";
45
- }
46
- function q(e) {
47
- return O(e) || e === "not_contains" || e === "is_null" || e === "is_not_null";
48
- }
49
- function fe(e) {
50
- switch (e) {
51
- case "not in":
52
- return "not_in";
53
- case "like":
54
- return "contains";
55
- case "not like":
56
- return "not_contains";
57
- case "not between":
58
- return "not_between";
59
- case "is null":
60
- case "is not null":
61
- return;
62
- default:
63
- return U(e);
64
- }
65
- }
66
- const K = [
67
- "=",
68
- "!=",
69
- ">",
70
- "<",
71
- ">=",
72
- "<=",
73
- "like",
74
- "not like",
75
- "between",
76
- "not between",
77
- "in",
78
- "not in",
79
- "is null",
80
- "is not null"
81
- ], Y = /* @__PURE__ */ new Set(["string", "number", "date", "boolean"]);
82
- function G(e) {
83
- return typeof e == "string" && K.includes(e);
84
- }
85
- function $(e, t) {
86
- switch (e) {
87
- case "is null":
88
- case "is not null":
89
- return t.length === 0;
90
- case "between":
91
- case "not between":
92
- return t.length === 2;
93
- case "in":
94
- case "not in":
95
- return t.length >= 1;
96
- default:
97
- return t.length === 1;
98
- }
99
- }
100
- function H(e) {
101
- if (!e || typeof e != "object" || Array.isArray(e))
102
- return;
103
- const t = e, n = {};
104
- for (const r of Z)
105
- t[r] !== void 0 && (n[r] = t[r]);
106
- return n;
107
- }
108
- const Z = [
109
- "operation",
110
- "values",
111
- "valueType",
112
- "temporalBucket",
113
- "relativeMeta",
114
- "temporalPrecision"
115
- ];
116
- function J(e) {
117
- const t = H(e);
118
- if (!t) return;
119
- const { operation: n, values: r } = t;
120
- if (!G(n) || !Array.isArray(r) || !$(n, r)) return;
121
- const s = typeof t.valueType == "string" && Y.has(t.valueType) ? t.valueType : void 0;
122
- return {
123
- operation: n,
124
- values: r,
125
- ...s ? { valueType: s } : {},
126
- ...t.temporalBucket !== void 0 ? { temporalBucket: t.temporalBucket } : {},
127
- ...t.relativeMeta !== void 0 ? { relativeMeta: t.relativeMeta } : {},
128
- ...t.temporalPrecision !== void 0 ? { temporalPrecision: t.temporalPrecision } : {}
129
- };
130
- }
131
- function me(e) {
132
- const t = J(e);
133
- if (!t)
134
- throw new Error(
135
- `Filter operation "${String(e.operation)}" cannot be expressed as predicate semantics.`
136
- );
137
- return t;
138
- }
139
- function we(e) {
140
- return e.operation === "is null" || e.operation === "is not null";
141
- }
142
- function Q(e, t, n) {
143
- const r = new Date(e.startInclusive), s = new Date(e.endExclusive);
144
- if (!Number.isFinite(r.valueOf()) || !Number.isFinite(s.valueOf()) || r >= s) return null;
145
- try {
146
- return I({ start: r, endExclusive: s, zone: e.timezone, column: t, basis: n });
147
- } catch {
148
- return null;
149
- }
150
- }
151
- function v(e, t) {
152
- switch (e) {
153
- case "day":
154
- return { amount: -t, unit: "day" };
155
- case "week":
156
- return { amount: -7 * t, unit: "day" };
157
- case "month":
158
- return { amount: -t, unit: "month" };
159
- case "quarter":
160
- return { amount: -3 * t, unit: "month" };
161
- case "year":
162
- return { amount: -12 * t, unit: "month" };
163
- }
164
- }
165
- function k(e, t, n, r) {
166
- return { ...F(e, t, n, { toDate: r }), step: v(n, t) };
167
- }
168
- function D(e, t, n) {
169
- const r = n * t;
170
- return {
171
- start: e.start.subtract({ milliseconds: r }),
172
- endExclusive: e.endExclusive.subtract({ milliseconds: r }),
173
- step: { amount: -Math.round(r / 1e3), unit: "second" }
174
- };
175
- }
176
- function X(e) {
177
- const t = L(e), n = t.hours || t.minutes || t.seconds || t.milliseconds;
178
- return Math.max(1, t.days + (n ? 1 : 0));
179
- }
180
- const ee = 24 * 60 * 60 * 1e3;
181
- function te(e) {
182
- if (e.originalPeriod) return k(e.current, e.offset, e.originalPeriod, e.cut);
183
- const t = T(e.whole);
184
- return t < ee || !e.current.start.equals(e.current.start.startOfDay()) ? D(e.current, e.offset, t) : k(e.current, X(e.whole) * e.offset, "day", e.cut);
185
- }
186
- function ne(e) {
187
- if (e.basis.kind === "elapsed") return D(e.current, e.offset, T(e.whole));
188
- const t = k(e.current, e.basis.n * e.offset, e.basis.unit, e.basis.toDate || e.cut);
189
- return t.endExclusive.epochMilliseconds > e.current.start.epochMilliseconds ? { ...t, endExclusive: e.current.start } : t;
190
- }
191
- function re(e, t) {
192
- const n = 364 * t;
193
- return {
194
- start: b(e.start, -n, "day"),
195
- endExclusive: b(e.endExclusive, -n, "day"),
196
- step: { amount: -n, unit: "day" }
197
- };
198
- }
199
- const _ = (e) => ({
200
- tz: e.timezone,
201
- weekStart: e.weekStart,
202
- ...e.fiscalCalendar ? { fiscalCalendar: e.fiscalCalendar } : {}
203
- });
204
- function se(e) {
205
- const { start: t, end: n } = N(
206
- e.basis.window,
207
- { calendar: _(e.calendar), now: e.referenceTime },
208
- { spansBack: e.offset }
209
- ), r = e.basis.window, s = r.kind === "periods" ? (r.to - r.from + 1) * e.offset : e.offset, a = r.kind === "periods" ? r.unit : "day";
210
- return {
211
- start: y(t, e.calendar.timezone),
212
- endExclusive: y(C(n), e.calendar.timezone),
213
- step: v(a, s)
214
- };
215
- }
216
- function oe(e, t) {
217
- if (e.basis.kind !== "calendar") return;
218
- const n = e.basis.window;
219
- if (n.kind !== "periods" || !n.toDate || typeof n.anchor == "object") return;
220
- const { toDate: r, ...s } = n, { start: a, end: c } = N(
221
- { ...s, anchor: "now" },
222
- { calendar: _(t), now: new Date(e.endExclusive.epochMilliseconds - 1) }
223
- );
224
- return a.getTime() === e.start.epochMilliseconds ? { start: y(a, t.timezone), endExclusive: y(C(c), t.timezone) } : void 0;
225
- }
226
- const P = (e) => ({
227
- startInclusive: new Date(e.start.epochMilliseconds).toISOString(),
228
- endExclusive: new Date(e.endExclusive.epochMilliseconds).toISOString(),
229
- timezone: e.start.timeZoneId
230
- });
231
- function he(e) {
232
- if (!e.currentWindow)
233
- return { status: "unavailable", reason: "finite_current_window_required" };
234
- const t = Q(e.currentWindow, e.column, e.basis);
235
- if (!t || !Number.isFinite(e.referenceTime.getTime()))
236
- return { status: "unavailable", reason: "temporal_binding_invalid" };
237
- const n = { timezone: e.currentWindow.timezone, weekStart: e.weekStart, fiscalCalendar: e.fiscalCalendar }, r = z(
238
- new Date(t.start.epochMilliseconds),
239
- new Date(t.endExclusive.epochMilliseconds),
240
- _(n)
241
- ), s = B(t, e.referenceTime);
242
- if (!s)
243
- return { status: "unavailable", reason: "current_window_not_started" };
244
- const a = e.basis, c = oe(t, n) ?? t, o = s.endExclusive.epochMilliseconds < t.endExclusive.epochMilliseconds, i = V(e.spec), l = i.offset ?? 1, m = i.unit === "year" && !i.matchWeekdays;
245
- if (m && r === "day") {
246
- const f = s.start;
247
- if (f.month === 2 && f.day === 29 && b(f, -l, "year").day !== 29)
248
- return { status: "unavailable", reason: "insufficient_history" };
249
- }
250
- const u = i.unit === "period" ? void 0 : i.unit, w = (f, p, W) => f === "year" && i.matchWeekdays ? re(p, l) : m ? (
251
- // A step by years shifts both ends by years and gives the same answer for an anchored window (AO-D6).
252
- {
253
- start: b(p.start, -l, "year"),
254
- endExclusive: b(p.endExclusive, -l, "year"),
255
- step: v("year", l)
256
- }
257
- ) : (
258
- // A calendar unit back: whole months stay whole, any other window moves its last included instant (K6).
259
- k(p, l, f, W)
260
- ), g = u ? w(u, s, o) : a.kind === "anchored" ? se({ basis: a, referenceTime: e.referenceTime, offset: l, calendar: n }) : a.kind === "calendar" || a.kind === "elapsed" ? ne({ basis: a, current: s, whole: c, cut: o, offset: l }) : te({ current: s, whole: c, originalPeriod: r, cut: o, offset: l }), x = a.kind === "elapsed";
261
- if (u && M(w(u, c, !1), c, { elapsed: x }).endExclusive.epochMilliseconds > t.start.epochMilliseconds)
262
- return { status: "unavailable", reason: "overlaps_current_window" };
263
- const E = M(g, s, { elapsed: x });
264
- return {
265
- status: "resolved",
266
- currentWindow: P(s),
267
- comparisonWindow: P(E),
268
- step: E.step
269
- };
270
- }
271
- const A = "numeric_range", be = 32, ie = (e) => typeof e == "number" && Number.isFinite(e), h = (e) => {
272
- if (ie(e)) return e;
273
- if (typeof e == "string" && e.trim() !== "") {
274
- const t = Number(e);
275
- return Number.isFinite(t) ? t : null;
276
- }
277
- return null;
278
- };
279
- function pe(e) {
280
- if (!e || typeof e != "object") return;
281
- const t = e;
282
- if (t.kind !== A) return;
283
- const n = h(t.min), r = h(t.max), s = h(t.emptyRows) ?? 0, a = t.bucketing === "value" ? "value" : "width", c = h(t.bucketWidth) ?? 0, o = Array.isArray(t.buckets) ? t.buckets.map((i) => Math.max(0, h(i) ?? 0)) : [];
284
- if (n === null == (r === null) && !(n !== null && r !== null && n > r) && !(o.length > 0 && !(c > 0)))
285
- return { kind: A, min: n, max: r, emptyRows: s, bucketing: a, buckets: o, bucketWidth: c };
286
- }
287
- function R(e) {
288
- return e.buckets.reduce((t, n) => t + n, 0);
289
- }
290
- function ye(e, t) {
291
- const n = e.min ?? 0;
292
- return { from: n + t * e.bucketWidth, to: n + (t + 1) * e.bucketWidth };
293
- }
294
- function d(e, t, n) {
295
- const r = R(e);
296
- if (e.min === null || e.max === null || e.buckets.length === 0)
297
- return e.min === null ? { rows: 0, exact: !0 } : { rows: (n ? t >= e.min : t > e.min) ? r : 0, exact: !0 };
298
- if (e.bucketing === "value") {
299
- let i = 0;
300
- return e.buckets.forEach((l, m) => {
301
- const u = e.min + m;
302
- (n ? u <= t : u < t) && (i += l);
303
- }), { rows: i, exact: !0 };
304
- }
305
- if (t <= e.min) return { rows: 0, exact: !(n && t === e.min) };
306
- if (t >= e.max) return { rows: r, exact: n || t > e.max };
307
- const s = (t - e.min) / e.bucketWidth, a = Math.floor(s);
308
- let c = 0;
309
- for (let i = 0; i < a; i += 1) c += e.buckets[i] ?? 0;
310
- const o = s - a;
311
- return c += (e.buckets[a] ?? 0) * o, { rows: c, exact: o === 0 && !n };
312
- }
313
- function ke(e, t, n) {
314
- const r = R(e), s = (o, ...i) => ({
315
- rows: Math.round(Math.max(0, Math.min(r, o))),
316
- exact: i.every(Boolean)
317
- }), [a, c] = n;
318
- switch (t) {
319
- case "is null":
320
- return { rows: e.emptyRows, exact: !0 };
321
- case "is not null":
322
- return { rows: r, exact: !0 };
323
- case ">=": {
324
- const o = d(e, a, !1);
325
- return s(r - o.rows, o.exact);
326
- }
327
- case ">": {
328
- const o = d(e, a, !0);
329
- return s(r - o.rows, o.exact);
330
- }
331
- case "<=": {
332
- const o = d(e, a, !0);
333
- return s(o.rows, o.exact);
334
- }
335
- case "<": {
336
- const o = d(e, a, !1);
337
- return s(o.rows, o.exact);
338
- }
339
- case "between":
340
- case "not between": {
341
- const o = d(e, c, !0), i = d(e, a, !1), l = o.rows - i.rows;
342
- return s(t === "between" ? l : r - l, o.exact, i.exact);
343
- }
344
- case "=":
345
- case "!=": {
346
- if (e.bucketing !== "value" && e.buckets.length > 0) return null;
347
- const o = d(e, a, !0).rows - d(e, a, !1).rows;
348
- return s(t === "=" ? o : r - o, !0);
349
- }
350
- default:
351
- return null;
352
- }
353
- }
354
- function ae(e, t) {
355
- var r;
356
- if (t === null) return !0;
357
- if (t.overrides.length === 0) return e.length <= t.depth;
358
- const n = S(e);
359
- return ((r = t.overrides.find((s) => s.path.length === e.length && S(s.path) === n)) == null ? void 0 : r.expanded) ?? e.length <= t.depth;
360
- }
361
- function ve(e) {
362
- var w;
363
- const { path: t, levelCount: n, expansion: r, total: s, axis: a } = e, c = t.length >= n || ((w = t[t.length - 1]) == null ? void 0 : w.member.kind) === "others", o = !c && !e.childrenEmpty, i = o && ae(t, r), l = a === "rows" && e.rowLayout !== "tabular", m = i && !!e.skipRedundant && !!e.singleChild, u = !!(s != null && s.visible) && !m;
364
- return {
365
- expandable: o,
366
- expanded: i,
367
- memberVisible: l || !i,
368
- valueVisible: c || u && (!i || s.position === "before"),
369
- subtotalBefore: !l && i && u && s.position === "before",
370
- subtotalAfter: i && u && s.position === "after"
371
- };
372
- }
373
- export {
374
- K as N,
375
- j as a,
376
- J as b,
377
- me as c,
378
- he as d,
379
- A as e,
380
- be as f,
381
- R as g,
382
- ye as h,
383
- we as i,
384
- ke as j,
385
- ae as k,
386
- ve as l,
387
- U as n,
388
- H as p,
389
- pe as r,
390
- fe as t
391
- };