react-semaphor 0.1.584 → 0.1.586
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +474 -435
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +2 -2
- package/dist/chunks/{assistant-chat-nmycV1Se.js → assistant-chat-BU5gchFy.js} +8 -8
- package/dist/chunks/{bookmark-impact-CI3gmxi0.js → bookmark-impact-ZPSGncK6.js} +2 -2
- package/dist/chunks/{bookmark-state-D9-RFkDg.js → bookmark-state-CL4WEpgB.js} +2 -2
- package/dist/chunks/{card-filter-builder-C7QyPqRy.js → card-filter-builder-HELJWA4D.js} +208 -208
- package/dist/chunks/{comparison-window-caption-BAnsTI8y.js → comparison-window-caption-CoART8BC.js} +530 -633
- package/dist/chunks/{dashboard-inJy_V78.js → dashboard-BXP-ZxSY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DXs0XA1O.js → dashboard-briefing-launcher-BGj42whr.js} +9 -9
- package/dist/chunks/{dashboard-controls-6Zoo8d8Y.js → dashboard-controls-zvbRp6D2.js} +9 -9
- package/dist/chunks/{dashboard-json-D5eJhVA9.js → dashboard-json-CykexgqL.js} +1 -1
- package/dist/chunks/{dates-B3_GWc_Y.js → dates-CaqZtq01.js} +6 -6
- package/dist/chunks/{edit-dashboard-visual-DR03SYeW.js → edit-dashboard-visual-C82JNxbt.js} +2679 -2614
- package/dist/chunks/filter-line-Cu2u1K36.js +131 -0
- package/dist/chunks/{filter-reach-copy-CZwzrxBp.js → filter-reach-copy-ZERaFKsN.js} +1640 -1367
- package/dist/chunks/{filter-value-text-DtOvqcjn.js → filter-value-text-xefXzZlf.js} +10 -10
- package/dist/chunks/{index-BgT1L0p5.js → index-otMIColV.js} +35 -35
- package/dist/chunks/{matrix-analytical-definition-Cs2v43FM.js → matrix-analytical-definition-DOVSFFuf.js} +390 -542
- package/dist/chunks/{metric-comparison-Be4uS3Ql.js → metric-comparison-ZmurmEIs.js} +2 -2
- package/dist/chunks/{pivot-header-presentation-uH06jiZD.js → pivot-header-presentation-CdeTU96P.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-DvZY4eJM.js → pivot-result-contract-expectations-Bx_BCu-7.js} +1010 -1005
- package/dist/chunks/{pivot-result-identity-BZexMfmL.js → pivot-result-identity-Bvs6Uq3v.js} +1 -1
- package/dist/chunks/raw-temporal-value-DH-feMc2.js +322 -0
- package/dist/chunks/{report-preferences-dialog-DWeVe2so.js → report-preferences-dialog-B-CoyS1x.js} +119 -119
- package/dist/chunks/{resolve-dashboard-input-context-uATCuOP7.js → resolve-dashboard-input-context-BTTdKXH0.js} +10273 -10190
- package/dist/chunks/{saved-dashboard-context-DSVV9iqW.js → saved-dashboard-context-B-rosN4W.js} +78 -75
- package/dist/chunks/{semaphor-ready-indicator-B9vvRMnJ.js → semaphor-ready-indicator-Cy1n_04D.js} +28208 -27864
- package/dist/chunks/{shelf-drop-preview-context-BHOnp5Bo.js → shelf-drop-preview-context-Bmz54WYm.js} +2 -2
- package/dist/chunks/{stored-dashboard-xc5iidHL.js → stored-dashboard-rDJ8sw6J.js} +601 -596
- package/dist/chunks/{table-export-sheet-Cv_94obr.js → table-export-sheet-Dmtqi5NV.js} +1 -1
- package/dist/chunks/{variable-draft-C3CjhsJQ.js → variable-draft-DvngkRMl.js} +3 -3
- package/dist/chunks/{visual-choice-JiJ-_3bi.js → visual-choice-BBPizkRo.js} +74 -72
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +699 -688
- package/dist/format-utils/index.js +145 -142
- package/dist/index.js +14 -14
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/index.js +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +86 -3
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +49 -27
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +30 -2
- package/dist/types/shared/analytics-protocol/click-reach-filter-id.d.ts +9 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +3 -1
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-card-decision.d.ts +102 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +13 -1
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +191 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +5 -2
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +37 -4
- package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +13 -0
- package/dist/types/shared/format-utils/semantic-format.d.ts +0 -1
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +20 -0
- package/dist/types/shared/temporal/calendar-periods.d.ts +15 -0
- package/dist/types/shared/temporal/raw-temporal-equality.d.ts +14 -0
- package/package.json +2 -2
- package/dist/chunks/raw-temporal-value-DdT0s47W.js +0 -159
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var y = Object.defineProperty;
|
|
2
2
|
var c = (i, t, e) => t in i ? y(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var a = (i, t, e) => c(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { v as u } from "./metric-comparison-
|
|
4
|
+
import { v as u } from "./metric-comparison-ZmurmEIs.js";
|
|
5
5
|
class l extends Error {
|
|
6
6
|
constructor(e) {
|
|
7
7
|
super(`missing_pivot_member_identity: ${e}`);
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var k = (t, e, n) => e in t ? v(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var C = (t, e, n) => k(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { R as O } from "./analytics-base-schemas-BaIQrEzX.js";
|
|
5
|
+
const D = /* @__PURE__ */ new Map();
|
|
6
|
+
function h(t, e) {
|
|
7
|
+
let n = D.get(e);
|
|
8
|
+
n || (n = new Intl.DateTimeFormat("en-CA", {
|
|
9
|
+
calendar: "gregory",
|
|
10
|
+
numberingSystem: "latn",
|
|
11
|
+
timeZone: e,
|
|
12
|
+
year: "numeric",
|
|
13
|
+
month: "2-digit",
|
|
14
|
+
day: "2-digit",
|
|
15
|
+
hour: "2-digit",
|
|
16
|
+
minute: "2-digit",
|
|
17
|
+
second: "2-digit",
|
|
18
|
+
hourCycle: "h23"
|
|
19
|
+
}), D.set(e, n));
|
|
20
|
+
const r = n.formatToParts(t), a = (o) => {
|
|
21
|
+
var s;
|
|
22
|
+
return Number((s = r.find((i) => i.type === o)) == null ? void 0 : s.value);
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
year: a("year"),
|
|
26
|
+
month: a("month"),
|
|
27
|
+
day: a("day"),
|
|
28
|
+
hour: a("hour"),
|
|
29
|
+
minute: a("minute"),
|
|
30
|
+
second: a("second")
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function u(t) {
|
|
34
|
+
const e = /* @__PURE__ */ new Date(0);
|
|
35
|
+
return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond ?? 0), e.getTime();
|
|
36
|
+
}
|
|
37
|
+
function l(t, e) {
|
|
38
|
+
const n = t - (t % 1e3 + 1e3) % 1e3;
|
|
39
|
+
return u(h(new Date(n), e)) - n;
|
|
40
|
+
}
|
|
41
|
+
const T = 864e5;
|
|
42
|
+
function U(t, e) {
|
|
43
|
+
const n = I(t, e);
|
|
44
|
+
if (n.length) return n[0];
|
|
45
|
+
const r = u(t);
|
|
46
|
+
return new Date(r - l(r - T, e));
|
|
47
|
+
}
|
|
48
|
+
function I(t, e) {
|
|
49
|
+
const n = u(t), r = l(n - T, e), a = l(n + T, e);
|
|
50
|
+
return [.../* @__PURE__ */ new Set([r, a])].map((o) => n - o).filter((o) => l(o, e) === n - o).sort((o, s) => o - s).map((o) => new Date(o));
|
|
51
|
+
}
|
|
52
|
+
const p = 864e5, b = {
|
|
53
|
+
second: 1e3,
|
|
54
|
+
minute: 6e4,
|
|
55
|
+
hour: 36e5
|
|
56
|
+
};
|
|
57
|
+
function w(t, e) {
|
|
58
|
+
return {
|
|
59
|
+
...h(t, e),
|
|
60
|
+
millisecond: (t.getTime() % 1e3 + 1e3) % 1e3
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function d(t, e) {
|
|
64
|
+
return U(t, e);
|
|
65
|
+
}
|
|
66
|
+
function y(t) {
|
|
67
|
+
const e = new Date(t);
|
|
68
|
+
return {
|
|
69
|
+
year: e.getUTCFullYear(),
|
|
70
|
+
month: e.getUTCMonth() + 1,
|
|
71
|
+
day: e.getUTCDate(),
|
|
72
|
+
hour: e.getUTCHours(),
|
|
73
|
+
minute: e.getUTCMinutes(),
|
|
74
|
+
second: e.getUTCSeconds(),
|
|
75
|
+
millisecond: e.getUTCMilliseconds()
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function A(t, e) {
|
|
79
|
+
const n = /* @__PURE__ */ new Date(0);
|
|
80
|
+
return n.setUTCFullYear(t, e, 0), n.getUTCDate();
|
|
81
|
+
}
|
|
82
|
+
function f(t, e) {
|
|
83
|
+
const n = t.year * 12 + (t.month - 1) + e, r = Math.floor(n / 12), a = n - r * 12 + 1;
|
|
84
|
+
return { ...t, year: r, month: a, day: Math.min(t.day, A(r, a)) };
|
|
85
|
+
}
|
|
86
|
+
function m(t, e, n) {
|
|
87
|
+
if (e === 0) return t;
|
|
88
|
+
switch (n) {
|
|
89
|
+
case "second":
|
|
90
|
+
case "minute":
|
|
91
|
+
case "hour":
|
|
92
|
+
return y(
|
|
93
|
+
u(t) + e * b[n]
|
|
94
|
+
);
|
|
95
|
+
case "day":
|
|
96
|
+
return y(u(t) + e * p);
|
|
97
|
+
case "week":
|
|
98
|
+
return y(u(t) + e * 7 * p);
|
|
99
|
+
case "month":
|
|
100
|
+
return f(t, e);
|
|
101
|
+
case "quarter":
|
|
102
|
+
return f(t, e * 3);
|
|
103
|
+
case "year":
|
|
104
|
+
return f(t, e * 12);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function W(t) {
|
|
108
|
+
return new Date(
|
|
109
|
+
u({ ...t, hour: 0, minute: 0, second: 0 })
|
|
110
|
+
).getUTCDay();
|
|
111
|
+
}
|
|
112
|
+
function _(t) {
|
|
113
|
+
var n;
|
|
114
|
+
const e = (n = t.fiscalCalendar) == null ? void 0 : n.yearStartMonth;
|
|
115
|
+
return e && e >= 1 && e <= 12 ? e : 1;
|
|
116
|
+
}
|
|
117
|
+
function L(t, e, n) {
|
|
118
|
+
const r = { ...t, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
119
|
+
switch (e) {
|
|
120
|
+
case "day":
|
|
121
|
+
return r;
|
|
122
|
+
case "week":
|
|
123
|
+
return m(
|
|
124
|
+
r,
|
|
125
|
+
-((W(t) - n.weekStart + 7) % 7),
|
|
126
|
+
"day"
|
|
127
|
+
);
|
|
128
|
+
case "month":
|
|
129
|
+
return { ...r, day: 1 };
|
|
130
|
+
case "quarter": {
|
|
131
|
+
const a = (t.month - _(n) + 12) % 12;
|
|
132
|
+
return f({ ...r, day: 1 }, -(a % 3));
|
|
133
|
+
}
|
|
134
|
+
case "year": {
|
|
135
|
+
const a = _(n);
|
|
136
|
+
return {
|
|
137
|
+
...r,
|
|
138
|
+
year: t.month >= a ? t.year : t.year - 1,
|
|
139
|
+
month: a,
|
|
140
|
+
day: 1
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function R(t, e, n, r = 0) {
|
|
146
|
+
const a = b[e];
|
|
147
|
+
if (a !== void 0) {
|
|
148
|
+
const i = w(t, n.tz), S = i.millisecond + (e === "second" ? 0 : i.second * 1e3) + (e === "hour" ? i.minute * 6e4 : 0), g = t.getTime() - S + r * a;
|
|
149
|
+
return { start: new Date(g), endExclusive: new Date(g + a) };
|
|
150
|
+
}
|
|
151
|
+
const o = e, s = m(
|
|
152
|
+
L(w(t, n.tz), o, n),
|
|
153
|
+
r,
|
|
154
|
+
e
|
|
155
|
+
);
|
|
156
|
+
return {
|
|
157
|
+
start: d(s, n.tz),
|
|
158
|
+
endExclusive: d(m(s, 1, e), n.tz)
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function B(t, e, n) {
|
|
162
|
+
return R(t, e, n).start;
|
|
163
|
+
}
|
|
164
|
+
function H(t, e, n) {
|
|
165
|
+
return new Date(R(t, e, n).endExclusive.getTime() - 1);
|
|
166
|
+
}
|
|
167
|
+
function V(t, e, n, r) {
|
|
168
|
+
return e === 0 ? t : d(
|
|
169
|
+
m(w(t, r.tz), e, n),
|
|
170
|
+
r.tz
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
function G(t, e, n) {
|
|
174
|
+
const r = (a) => {
|
|
175
|
+
const { year: o, month: s, day: i } = h(a, n);
|
|
176
|
+
return u({ year: o, month: s, day: i, hour: 0, minute: 0, second: 0 });
|
|
177
|
+
};
|
|
178
|
+
return Math.round((r(e) - r(t)) / p);
|
|
179
|
+
}
|
|
180
|
+
const P = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
181
|
+
function J(t, e) {
|
|
182
|
+
const { year: n, month: r, day: a } = h(t, e);
|
|
183
|
+
return `${String(n).padStart(4, "0")}-${String(r).padStart(2, "0")}-${String(a).padStart(2, "0")}`;
|
|
184
|
+
}
|
|
185
|
+
function K(t) {
|
|
186
|
+
const e = P.exec(t);
|
|
187
|
+
if (!e) return null;
|
|
188
|
+
const n = Number(e[1]), r = Number(e[2]), a = Number(e[3]);
|
|
189
|
+
return r < 1 || r > 12 || a < 1 || a > A(n, r) ? null : { year: n, month: r, day: a };
|
|
190
|
+
}
|
|
191
|
+
function Q(t, e) {
|
|
192
|
+
const n = K(t);
|
|
193
|
+
if (!n) return null;
|
|
194
|
+
const r = { ...n, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
195
|
+
return {
|
|
196
|
+
start: d(r, e),
|
|
197
|
+
endExclusive: d(m(r, 1, "day"), e)
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
class c extends Error {
|
|
201
|
+
constructor(n) {
|
|
202
|
+
super(n);
|
|
203
|
+
C(this, "code");
|
|
204
|
+
this.name = "RawTemporalMetadataContractError", this.code = O.invalidMetadata;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function $(t) {
|
|
208
|
+
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
209
|
+
return !1;
|
|
210
|
+
const e = Object.getPrototypeOf(t);
|
|
211
|
+
return e === null || e === Object.prototype;
|
|
212
|
+
}
|
|
213
|
+
function x(t) {
|
|
214
|
+
if (!$(t))
|
|
215
|
+
throw new c(
|
|
216
|
+
"Raw temporal metadata must be an object."
|
|
217
|
+
);
|
|
218
|
+
const e = Object.keys(t);
|
|
219
|
+
if (e.length !== 2 || !e.includes("kind") || !e.includes("valueKind"))
|
|
220
|
+
throw new c(
|
|
221
|
+
"Raw temporal metadata must contain only kind and valueKind."
|
|
222
|
+
);
|
|
223
|
+
if (t.kind !== "raw_temporal")
|
|
224
|
+
throw new c(
|
|
225
|
+
"Raw temporal metadata kind must be raw_temporal."
|
|
226
|
+
);
|
|
227
|
+
if (t.valueKind !== "date" && t.valueKind !== "wall_datetime" && t.valueKind !== "instant")
|
|
228
|
+
throw new c(
|
|
229
|
+
"Raw temporal valueKind must be date, wall_datetime, or instant."
|
|
230
|
+
);
|
|
231
|
+
return {
|
|
232
|
+
kind: "raw_temporal",
|
|
233
|
+
valueKind: t.valueKind
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function X(t, e) {
|
|
237
|
+
if (!t.rawTemporal) {
|
|
238
|
+
if (e.metadataRequired)
|
|
239
|
+
throw new c(
|
|
240
|
+
"Activated raw temporal result is missing metadata."
|
|
241
|
+
);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (t.temporalBucket)
|
|
245
|
+
throw new c(
|
|
246
|
+
"A result column cannot carry both raw and grouped temporal metadata."
|
|
247
|
+
);
|
|
248
|
+
const n = x(t.rawTemporal), r = n.valueKind === "date" ? "date" : "datetime";
|
|
249
|
+
if (t.dataType !== r)
|
|
250
|
+
throw new c(
|
|
251
|
+
`${n.valueKind} raw temporal values require dataType ${r}.`
|
|
252
|
+
);
|
|
253
|
+
return n;
|
|
254
|
+
}
|
|
255
|
+
const M = /^(\d{4})-(\d{2})-(\d{2})$/, N = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?$/, E = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
256
|
+
function tt(t) {
|
|
257
|
+
if (M.test(t)) return "date";
|
|
258
|
+
if (E.test(t)) return "instant";
|
|
259
|
+
if (N.test(t)) return "wall_datetime";
|
|
260
|
+
}
|
|
261
|
+
function j(t) {
|
|
262
|
+
return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
|
|
263
|
+
}
|
|
264
|
+
function F(t, e) {
|
|
265
|
+
return e === 2 ? j(t) ? 29 : 28 : [4, 6, 9, 11].includes(e) ? 30 : 31;
|
|
266
|
+
}
|
|
267
|
+
function Y(t) {
|
|
268
|
+
return t.year >= 1 && t.year <= 9999 && t.month >= 1 && t.month <= 12 && t.day >= 1 && t.day <= F(t.year, t.month) && t.hour >= 0 && t.hour <= 23 && t.minute >= 0 && t.minute <= 59 && t.second >= 0 && t.second <= 59;
|
|
269
|
+
}
|
|
270
|
+
function q(t) {
|
|
271
|
+
return {
|
|
272
|
+
year: Number(t[1]),
|
|
273
|
+
month: Number(t[2]),
|
|
274
|
+
day: Number(t[3]),
|
|
275
|
+
hour: Number(t[4] ?? 0),
|
|
276
|
+
minute: Number(t[5] ?? 0),
|
|
277
|
+
second: Number(t[6] ?? 0),
|
|
278
|
+
fraction: t[7] ?? ""
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function et(t, e) {
|
|
282
|
+
const n = e === "date" ? t.match(M) : e === "wall_datetime" ? t.match(N) : t.match(E);
|
|
283
|
+
if (!n) return { status: "invalid_shape" };
|
|
284
|
+
const r = q(n);
|
|
285
|
+
if (!Y(r)) return { status: "out_of_range" };
|
|
286
|
+
if (e === "instant") {
|
|
287
|
+
const a = n[8];
|
|
288
|
+
if (a && a !== "Z") {
|
|
289
|
+
const [s, i] = a.slice(1).split(":").map(Number);
|
|
290
|
+
if (s > 23 || i > 59) return { status: "out_of_range" };
|
|
291
|
+
}
|
|
292
|
+
const o = new Date(t.replace(" ", "T"));
|
|
293
|
+
return Number.isNaN(o.getTime()) ? { status: "out_of_range" } : { status: "valid", fields: r, instant: o };
|
|
294
|
+
}
|
|
295
|
+
return { status: "valid", fields: r };
|
|
296
|
+
}
|
|
297
|
+
export {
|
|
298
|
+
b as E,
|
|
299
|
+
c as R,
|
|
300
|
+
et as a,
|
|
301
|
+
h as b,
|
|
302
|
+
tt as c,
|
|
303
|
+
u as d,
|
|
304
|
+
U as e,
|
|
305
|
+
A as f,
|
|
306
|
+
W as g,
|
|
307
|
+
L as h,
|
|
308
|
+
d as i,
|
|
309
|
+
R as j,
|
|
310
|
+
B as k,
|
|
311
|
+
H as l,
|
|
312
|
+
V as m,
|
|
313
|
+
G as n,
|
|
314
|
+
J as o,
|
|
315
|
+
x as p,
|
|
316
|
+
K as q,
|
|
317
|
+
Q as r,
|
|
318
|
+
m as s,
|
|
319
|
+
X as v,
|
|
320
|
+
w,
|
|
321
|
+
I as z
|
|
322
|
+
};
|