react-semaphor 0.1.476 → 0.1.478
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.cjs +1 -1
- package/dist/analytics-protocol/index.js +9 -9
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{analyze-result-contract-OgPk-zGu.cjs → analyze-result-contract-BX_nQmPN.cjs} +1 -1
- package/dist/chunks/{analyze-result-contract-C8s8EUL5.js → analyze-result-contract-DsiAzCYn.js} +1 -1
- package/dist/chunks/{saved-temporal-bucket-format-CHsXUPJI.js → card-config-utils-CyDKaPNT.js} +190 -190
- package/dist/chunks/card-config-utils-D3Xuu0ub.cjs +1 -0
- package/dist/chunks/{common-types-C1IM7gao.cjs → common-types-BCSbPclk.cjs} +1 -1
- package/dist/chunks/{common-types-BLPy5_E0.js → common-types-D3r4PILe.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-ZfuxdRN2.cjs → dashboard-briefing-launcher-7qAW16mO.cjs} +2 -2
- package/dist/chunks/{dashboard-briefing-launcher-eBsB9kr8.js → dashboard-briefing-launcher-DAhtLQPc.js} +134 -134
- package/dist/chunks/{dashboard-controls-BX6p6z8a.js → dashboard-controls-C_CBmEwW.js} +13 -12
- package/dist/chunks/{dashboard-controls-DwjEc7sO.cjs → dashboard-controls-CoVqAeKG.cjs} +10 -10
- package/dist/chunks/{dashboard-input-contract-JFJZgenC.cjs → dashboard-date-comparison-definition-C93wv8Ua.cjs} +1 -1
- package/dist/chunks/{dashboard-input-contract-BrGdGFz0.js → dashboard-date-comparison-definition-KohOqBqR.js} +19 -19
- package/dist/chunks/dashboard-filter-value-compatibility-BAatYtUS.js +1215 -0
- package/dist/chunks/dashboard-filter-value-compatibility-Bco2gN96.cjs +1 -0
- package/dist/chunks/{dashboard-json-BfgitBXc.js → dashboard-json-0w58H39L.js} +7 -7
- package/dist/chunks/dashboard-json-B3XSl7b_.cjs +1 -0
- package/dist/chunks/{edit-dashboard-visual-Cbougpzc.cjs → edit-dashboard-visual-BsLRKeuO.cjs} +6 -6
- package/dist/chunks/{edit-dashboard-visual-D80DLF7C.js → edit-dashboard-visual-BsWEU8xf.js} +277 -277
- package/dist/chunks/{editor-action-buttons-DjsEDQok.js → editor-action-buttons-B3CB5c__.js} +39 -39
- package/dist/chunks/{editor-action-buttons-BDRLfaW-.cjs → editor-action-buttons-DMLDvrJD.cjs} +1 -1
- package/dist/chunks/{index-CneWIz__.cjs → index--0Il-Bpd.cjs} +238 -238
- package/dist/chunks/{format-types-CFHQoIuk.js → index-BS0_dp0l.js} +168 -168
- package/dist/chunks/{index-D9S3j7_z.js → index-BvRREsU9.js} +9 -9
- package/dist/chunks/index-ByQgqT9d.cjs +1 -0
- package/dist/chunks/{index-v2MZLyus.cjs → index-CXeIDdjd.cjs} +1 -1
- package/dist/chunks/{index-Dv5hbC1r.js → index-DgGcVyUs.js} +35550 -35937
- package/dist/chunks/matrix-result-contract-CFPnlcLm.cjs +1 -0
- package/dist/chunks/{matrix-result-contract-BpzhImar.js → matrix-result-contract-DFfUvb1r.js} +3 -3
- package/dist/chunks/{temporal-bucket-CtP7hKLa.js → metric-comparison-CTexJ8V1.js} +705 -705
- package/dist/chunks/metric-comparison-x0lipytf.cjs +1 -0
- package/dist/chunks/pivot-header-presentation-8Ra1RfHg.cjs +4 -0
- package/dist/chunks/{pivot-header-presentation-CaERAWpl.js → pivot-header-presentation-tpb_J900.js} +118 -118
- package/dist/chunks/{pivot-result-identity-CIZXsI53.js → pivot-result-identity-BIeP9v8I.js} +1 -1
- package/dist/chunks/{pivot-result-identity-DRUlTWUq.cjs → pivot-result-identity-BVnhG2rR.cjs} +1 -1
- package/dist/chunks/pivot-result-lifecycle-D_bRCqaB.cjs +1 -0
- package/dist/chunks/{pivot-result-lifecycle-B9FTybxN.js → pivot-result-lifecycle-mjJ1rBvV.js} +7 -7
- package/dist/chunks/{raw-temporal-contract-U8J9RlEH.js → raw-temporal-contract-BuQIB31z.js} +1 -1
- package/dist/chunks/{raw-temporal-contract-D8YuxTAg.cjs → raw-temporal-contract-vnNwLy9R.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-BXBlvW79.js → report-preferences-dialog-Bytgubvz.js} +25 -25
- package/dist/chunks/report-preferences-dialog-I0Pbn_Yb.cjs +1 -0
- package/dist/chunks/{report-runtime-context-DNbgCsko.js → report-runtime-context-B_pAmqxl.js} +1 -1
- package/dist/chunks/{report-runtime-context-RFiWq4wK.cjs → report-runtime-context-BfW4qiMJ.cjs} +1 -1
- package/dist/chunks/{source-entity-resolution-BDC-Qngk.cjs → source-entity-resolution-DCAAS-y8.cjs} +1 -1
- package/dist/chunks/{source-entity-resolution-ugN3sZUk.js → source-entity-resolution-WUstJID6.js} +1 -1
- package/dist/chunks/{switch-C8NihGV4.js → switch-BsGTOjuD.js} +12342 -11110
- package/dist/chunks/switch-Cpj3DrCZ.cjs +138 -0
- package/dist/chunks/{temporal-bucket-authoring-DJ9kK2wD.js → temporal-bucket-authoring-CyTCHy1K.js} +3 -3
- package/dist/chunks/temporal-bucket-authoring-DueSgLJU.cjs +1 -0
- package/dist/chunks/{temporal-bucket-contract-CZl5D7FZ.js → temporal-bucket-contract-BeOx0uYe.js} +1 -1
- package/dist/chunks/{temporal-bucket-contract-BD862TAa.cjs → temporal-bucket-contract-Cp-usD9Z.cjs} +1 -1
- package/dist/chunks/{token-types-CoHsSJ4E.cjs → token-types-D9eN35rf.cjs} +1 -1
- package/dist/chunks/{token-types-DfDtCqlw.js → token-types-Dvomvqw0.js} +1 -1
- package/dist/chunks/{update-policy-BGNXFgBU.cjs → update-policy-Buw2LmvX.cjs} +1 -1
- package/dist/chunks/{update-policy-BybMiM61.js → update-policy-MWg0aH3d.js} +1 -1
- package/dist/chunks/{validators-D-T-2HOR.js → validators-D3AarM2T.js} +662 -663
- package/dist/chunks/validators-DqIM0B3C.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +81 -79
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +3 -3
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +3 -3
- package/dist/format-utils/index.cjs +3 -3
- package/dist/format-utils/index.js +9 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +177 -176
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/briefings.d.ts +15 -2
- package/dist/types/dashboard-authoring.d.ts +21 -2
- package/dist/types/dashboard.d.ts +15 -2
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/main.d.ts +25 -6
- package/dist/types/shared.d.ts +15 -2
- package/dist/types/surfboard.d.ts +15 -2
- package/dist/types/types.d.ts +15 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-filter-value-compatibility-BCVF9IHg.js +0 -1026
- package/dist/chunks/dashboard-filter-value-compatibility-DLkdeypb.cjs +0 -1
- package/dist/chunks/dashboard-json-CdwYFOsc.cjs +0 -1
- package/dist/chunks/format-types-PSZZ7hG8.cjs +0 -1
- package/dist/chunks/matrix-result-contract-Bhg60NtS.cjs +0 -1
- package/dist/chunks/pivot-header-presentation-CePk1R6g.cjs +0 -4
- package/dist/chunks/pivot-result-lifecycle-CcGt_29N.cjs +0 -1
- package/dist/chunks/report-preferences-dialog-cSMJYqns.cjs +0 -1
- package/dist/chunks/saved-temporal-bucket-format-DNMtD77o.cjs +0 -1
- package/dist/chunks/switch-B1mZx2k9.cjs +0 -138
- package/dist/chunks/temporal-bucket-9Wz9Ds6H.cjs +0 -1
- package/dist/chunks/temporal-bucket-authoring-DSpzgXHc.cjs +0 -1
- package/dist/chunks/validators-DcshgK7w.cjs +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { A as
|
|
3
|
-
import { k as _e, ai as W, aj as we, y as ie, F as ve, B as
|
|
4
|
-
import "../chunks/analyze-result-contract-
|
|
1
|
+
import { D as B, a as ye } from "../chunks/contracts-CoCOpd_i.js";
|
|
2
|
+
import { A as Rt, S as Bt, g as Pt, a as zt, i as Ot, p as qt, c as Vt, b as Lt, r as jt, s as Et, t as Ht } from "../chunks/temporal-bucket-authoring-CyTCHy1K.js";
|
|
3
|
+
import { k as _e, ai as W, aj as we, y as ie, F as ve, B as Ce } from "../chunks/validators-D3AarM2T.js";
|
|
4
|
+
import "../chunks/analyze-result-contract-DsiAzCYn.js";
|
|
5
5
|
import "../value-format-preferences/index.js";
|
|
6
|
-
import { m as O } from "../chunks/dashboard-filter-value-compatibility-
|
|
7
|
-
import { D as Kt,
|
|
8
|
-
import { n as
|
|
9
|
-
import { a as
|
|
6
|
+
import { m as O } from "../chunks/dashboard-filter-value-compatibility-BAatYtUS.js";
|
|
7
|
+
import { D as Kt, t as Gt, b as Ut, s as Qt, o as Yt, d as Jt, g as Xt, p as Zt, f as en, a as tn, e as nn, j as rn, i as an, q as on, n as sn, l as dn, r as cn, h as ln, k as un } from "../chunks/dashboard-filter-value-compatibility-BAatYtUS.js";
|
|
8
|
+
import { n as Se } from "../chunks/operators-C8TxpM4C.js";
|
|
9
|
+
import { a as pn, b as hn, r as mn } from "../chunks/canonical-result-keys-CEQefvdO.js";
|
|
10
10
|
function _(e) {
|
|
11
11
|
return e && typeof e == "object" ? e : null;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function S(e) {
|
|
14
14
|
return typeof e == "string" ? e : null;
|
|
15
15
|
}
|
|
16
16
|
function ke(e) {
|
|
@@ -57,7 +57,7 @@ function re(e, t) {
|
|
|
57
57
|
(n) => (n == null ? void 0 : n.kind) === "semantic" && W(e, n) && !!n.connectionId
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function C(e, t) {
|
|
61
61
|
const n = E(e == null ? void 0 : e.source);
|
|
62
62
|
return n ? j(n, t) : void 0;
|
|
63
63
|
}
|
|
@@ -75,7 +75,7 @@ function Ae({
|
|
|
75
75
|
return a;
|
|
76
76
|
if (e !== void 0)
|
|
77
77
|
return;
|
|
78
|
-
const d =
|
|
78
|
+
const d = C(t, n), s = d ? j(
|
|
79
79
|
d,
|
|
80
80
|
re(d, o)
|
|
81
81
|
) : void 0;
|
|
@@ -87,46 +87,46 @@ function Ae({
|
|
|
87
87
|
function At(e, t) {
|
|
88
88
|
if (!(e != null && e.name) || !(t != null && t.name) || e.name !== t.name)
|
|
89
89
|
return !1;
|
|
90
|
-
const n =
|
|
90
|
+
const n = C(e), r = C(t);
|
|
91
91
|
return !n || !r ? !0 : oe(n, r);
|
|
92
92
|
}
|
|
93
93
|
function D(e) {
|
|
94
94
|
var t;
|
|
95
|
-
return
|
|
95
|
+
return S((t = _(e)) == null ? void 0 : t.kind);
|
|
96
96
|
}
|
|
97
97
|
function se(e) {
|
|
98
98
|
var t, n;
|
|
99
|
-
return D(e) !== "semantic" ? null : ((n =
|
|
99
|
+
return D(e) !== "semantic" ? null : ((n = S((t = _(e)) == null ? void 0 : t.domainId)) == null ? void 0 : n.trim()) || null;
|
|
100
100
|
}
|
|
101
101
|
function Fe(e) {
|
|
102
102
|
var t;
|
|
103
|
-
return D(e) !== "semantic" ? null :
|
|
103
|
+
return D(e) !== "semantic" ? null : S((t = _(e)) == null ? void 0 : t.datasetName);
|
|
104
104
|
}
|
|
105
105
|
function xe(e) {
|
|
106
106
|
var t;
|
|
107
|
-
return D(e) !== "semantic" ? null :
|
|
107
|
+
return D(e) !== "semantic" ? null : S((t = _(e)) == null ? void 0 : t.datasetId);
|
|
108
108
|
}
|
|
109
109
|
function Te(e) {
|
|
110
110
|
var t;
|
|
111
|
-
return D(e) !== "physical" ? null :
|
|
111
|
+
return D(e) !== "physical" ? null : S((t = _(e)) == null ? void 0 : t.connectionId);
|
|
112
112
|
}
|
|
113
113
|
function $e(e) {
|
|
114
114
|
var t;
|
|
115
|
-
return D(e) !== "physical" ? null :
|
|
115
|
+
return D(e) !== "physical" ? null : S((t = _(e)) == null ? void 0 : t.tableName);
|
|
116
116
|
}
|
|
117
117
|
function Me(e) {
|
|
118
118
|
var t;
|
|
119
|
-
return D(e) !== "physical" ? "" :
|
|
119
|
+
return D(e) !== "physical" ? "" : S((t = _(e)) == null ? void 0 : t.databaseName) || "";
|
|
120
120
|
}
|
|
121
121
|
function Ne(e) {
|
|
122
122
|
var t;
|
|
123
|
-
return D(e) !== "physical" ? "" :
|
|
123
|
+
return D(e) !== "physical" ? "" : S((t = _(e)) == null ? void 0 : t.schemaName) || "";
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Re(e) {
|
|
126
126
|
if (e.analyticsIntent && typeof e.analyticsIntent == "object" && "source" in e.analyticsIntent)
|
|
127
127
|
return e.analyticsIntent.source;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Be({
|
|
130
130
|
datasets: e,
|
|
131
131
|
requireAtLeastOne: t
|
|
132
132
|
}) {
|
|
@@ -170,7 +170,7 @@ function de({
|
|
|
170
170
|
}) {
|
|
171
171
|
if (e.type === "text")
|
|
172
172
|
return;
|
|
173
|
-
const r =
|
|
173
|
+
const r = Re(e);
|
|
174
174
|
if (!r) {
|
|
175
175
|
if (t.length <= 1)
|
|
176
176
|
return;
|
|
@@ -191,10 +191,10 @@ function de({
|
|
|
191
191
|
)
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function R(e) {
|
|
195
195
|
return e.map((t) => t == null ? void 0 : t.source).filter((t) => !!t);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function q(e) {
|
|
198
198
|
return Array.isArray(e) ? e.filter(
|
|
199
199
|
(t) => !!(t && typeof t == "object")
|
|
200
200
|
) : [];
|
|
@@ -210,28 +210,28 @@ function Pe(e) {
|
|
|
210
210
|
return [];
|
|
211
211
|
const t = [e.source];
|
|
212
212
|
return e.kind === "metric" ? t.push(
|
|
213
|
-
...
|
|
214
|
-
...
|
|
213
|
+
...R([
|
|
214
|
+
...q(e.measures),
|
|
215
215
|
e.primaryMeasure,
|
|
216
216
|
e.dateField,
|
|
217
|
-
...
|
|
217
|
+
...q(e.dimensions),
|
|
218
218
|
...ae(e.filters).map((o) => o.field)
|
|
219
219
|
])
|
|
220
220
|
) : e.kind === "records" ? t.push(
|
|
221
|
-
...
|
|
222
|
-
...
|
|
221
|
+
...R([
|
|
222
|
+
...q(e.fields),
|
|
223
223
|
e.dateField,
|
|
224
224
|
(n = e.orderBy) == null ? void 0 : n.field,
|
|
225
225
|
...ae(e.filters).map((o) => o.field)
|
|
226
226
|
])
|
|
227
227
|
) : e.kind === "inputOptions" ? (((r = e.population) == null ? void 0 : r.kind) === "related_population" && t.push(e.population.baseSource), t.push(
|
|
228
|
-
...
|
|
228
|
+
...R([
|
|
229
229
|
e.labelField,
|
|
230
230
|
e.valueField,
|
|
231
231
|
e.searchField,
|
|
232
232
|
...e.disambiguationFields || []
|
|
233
233
|
])
|
|
234
|
-
)) : e.kind === "sql" && t.push(...
|
|
234
|
+
)) : e.kind === "sql" && t.push(...R(e.fields || [])), t;
|
|
235
235
|
}
|
|
236
236
|
function ce({
|
|
237
237
|
card: e,
|
|
@@ -276,7 +276,7 @@ function ue({
|
|
|
276
276
|
errors: t,
|
|
277
277
|
requireAtLeastOne: n
|
|
278
278
|
}) {
|
|
279
|
-
const r =
|
|
279
|
+
const r = Be({
|
|
280
280
|
datasets: e,
|
|
281
281
|
requireAtLeastOne: n
|
|
282
282
|
});
|
|
@@ -338,10 +338,10 @@ function ze(e) {
|
|
|
338
338
|
p("invalid_sheet_kind", 'Generated sheet must use kind "dashboard".')
|
|
339
339
|
);
|
|
340
340
|
const d = (a == null ? void 0 : a.cards) || [];
|
|
341
|
-
d.length >
|
|
341
|
+
d.length > B && t.push(
|
|
342
342
|
p(
|
|
343
343
|
"too_many_cards",
|
|
344
|
-
`Generated dashboards can contain at most ${
|
|
344
|
+
`Generated dashboards can contain at most ${B} cards.`
|
|
345
345
|
)
|
|
346
346
|
);
|
|
347
347
|
const s = N(d.map((l) => l.id));
|
|
@@ -450,14 +450,14 @@ function Oe(e) {
|
|
|
450
450
|
}
|
|
451
451
|
return { ok: t.length === 0, errors: t, warnings: r };
|
|
452
452
|
}
|
|
453
|
-
const
|
|
453
|
+
const qe = {
|
|
454
454
|
lg: 48,
|
|
455
455
|
md: 36,
|
|
456
456
|
sm: 24,
|
|
457
457
|
xs: 12,
|
|
458
458
|
xxs: 6
|
|
459
459
|
};
|
|
460
|
-
function
|
|
460
|
+
function Ve(e, t) {
|
|
461
461
|
let n = 0, r = 0, o = 0;
|
|
462
462
|
return e.map((i) => {
|
|
463
463
|
const a = Math.min(i.w, t);
|
|
@@ -540,14 +540,14 @@ function G(e) {
|
|
|
540
540
|
const t = Le(e);
|
|
541
541
|
return Object.fromEntries(
|
|
542
542
|
ye.map((n) => {
|
|
543
|
-
const r =
|
|
543
|
+
const r = qe[n], o = [
|
|
544
544
|
...F(t.introText, "introText", n, r),
|
|
545
545
|
...F(t.kpis, "kpi", n, r),
|
|
546
546
|
...F(t.charts, "chart", n, r),
|
|
547
547
|
...F(t.tables, "table", n, r),
|
|
548
548
|
...F(t.supportingText, "supportingText", n, r)
|
|
549
549
|
];
|
|
550
|
-
return [n,
|
|
550
|
+
return [n, Ve(o, r)];
|
|
551
551
|
})
|
|
552
552
|
);
|
|
553
553
|
}
|
|
@@ -791,7 +791,7 @@ function tt(e) {
|
|
|
791
791
|
(n) => (n.kind || "dashboard") === "dashboard"
|
|
792
792
|
);
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function V(e, t) {
|
|
795
795
|
var n;
|
|
796
796
|
for (const r of e.sheets || [])
|
|
797
797
|
for (const o of r.frames || []) {
|
|
@@ -891,11 +891,11 @@ function Tt(e) {
|
|
|
891
891
|
return w + (((y = v.cards) == null ? void 0 : y.length) || 0);
|
|
892
892
|
},
|
|
893
893
|
0
|
|
894
|
-
) >=
|
|
894
|
+
) >= B) {
|
|
895
895
|
o.push(
|
|
896
896
|
A(
|
|
897
897
|
"generated_card_limit_reached",
|
|
898
|
-
`AI refinement is capped at ${
|
|
898
|
+
`AI refinement is capped at ${B} cards.`,
|
|
899
899
|
s.card.id
|
|
900
900
|
)
|
|
901
901
|
);
|
|
@@ -948,7 +948,7 @@ function Tt(e) {
|
|
|
948
948
|
else if (s.field.scope === "sheet" && s.field.field)
|
|
949
949
|
a.calculatedFields ?? (a.calculatedFields = []), a.calculatedFields.push(s.field.field);
|
|
950
950
|
else if (s.field.scope === "card" && s.field.field) {
|
|
951
|
-
const u = s.field.targetCardId ?
|
|
951
|
+
const u = s.field.targetCardId ? V(n, s.field.targetCardId) : null;
|
|
952
952
|
u ? ((d = u.card).calculatedFields ?? (d.calculatedFields = []), u.card.calculatedFields.push(s.field.field)) : o.push(
|
|
953
953
|
A(
|
|
954
954
|
"missing_calculated_field_target",
|
|
@@ -959,7 +959,7 @@ function Tt(e) {
|
|
|
959
959
|
break;
|
|
960
960
|
}
|
|
961
961
|
case "renameCard": {
|
|
962
|
-
const u =
|
|
962
|
+
const u = V(n, s.cardId);
|
|
963
963
|
if (!u) {
|
|
964
964
|
o.push(
|
|
965
965
|
A(
|
|
@@ -976,7 +976,7 @@ function Tt(e) {
|
|
|
976
976
|
case "reorderCards": {
|
|
977
977
|
const u = /* @__PURE__ */ new Map();
|
|
978
978
|
for (let h = 0; h < s.cardIds.length; h += 1) {
|
|
979
|
-
const I = s.cardIds[h], w =
|
|
979
|
+
const I = s.cardIds[h], w = V(n, I);
|
|
980
980
|
w && u.set(w.frame.id, h);
|
|
981
981
|
}
|
|
982
982
|
me(a, u);
|
|
@@ -1035,7 +1035,7 @@ function k(e) {
|
|
|
1035
1035
|
return [];
|
|
1036
1036
|
const t = [];
|
|
1037
1037
|
for (const n of e) {
|
|
1038
|
-
const r =
|
|
1038
|
+
const r = C(n);
|
|
1039
1039
|
r && t.push(r);
|
|
1040
1040
|
}
|
|
1041
1041
|
return t;
|
|
@@ -1047,14 +1047,14 @@ function ot(e) {
|
|
|
1047
1047
|
const t = [];
|
|
1048
1048
|
if (T(e.source) && t.push(e.source), e.kind === "metric") {
|
|
1049
1049
|
t.push(...k(e.measures));
|
|
1050
|
-
const a =
|
|
1050
|
+
const a = C(e.dateField);
|
|
1051
1051
|
a && t.push(a), t.push(...k(e.dimensions)), t.push(
|
|
1052
1052
|
...k(
|
|
1053
1053
|
(r = e.filters) == null ? void 0 : r.map((d) => d.field)
|
|
1054
1054
|
)
|
|
1055
1055
|
);
|
|
1056
1056
|
} else if (e.kind === "records") {
|
|
1057
|
-
const a =
|
|
1057
|
+
const a = C(e.dateField);
|
|
1058
1058
|
a && t.push(a), t.push(...k(e.fields)), t.push(
|
|
1059
1059
|
...k(
|
|
1060
1060
|
(o = e.filters) == null ? void 0 : o.map((d) => d.field)
|
|
@@ -1070,7 +1070,7 @@ function ot(e) {
|
|
|
1070
1070
|
)) : e.kind === "sql" && t.push(...k(e.fields));
|
|
1071
1071
|
const n = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
|
|
1072
1072
|
for (const a of n) {
|
|
1073
|
-
const d =
|
|
1073
|
+
const d = C(a.field);
|
|
1074
1074
|
d && t.push(d);
|
|
1075
1075
|
}
|
|
1076
1076
|
return t;
|
|
@@ -1078,7 +1078,7 @@ function ot(e) {
|
|
|
1078
1078
|
function st(e) {
|
|
1079
1079
|
const t = [];
|
|
1080
1080
|
for (const n of ge(e)) {
|
|
1081
|
-
const r =
|
|
1081
|
+
const r = C(n.field);
|
|
1082
1082
|
r && t.push(r);
|
|
1083
1083
|
}
|
|
1084
1084
|
for (const n of Q(e))
|
|
@@ -1155,7 +1155,7 @@ function pt(e) {
|
|
|
1155
1155
|
return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((n = e.presentation) == null ? void 0 : n.kind) === "table" ? "table" : ((r = e.presentation) == null ? void 0 : r.kind) === "text" ? "text" : "chart";
|
|
1156
1156
|
}
|
|
1157
1157
|
function ht(e) {
|
|
1158
|
-
const t =
|
|
1158
|
+
const t = Se(e);
|
|
1159
1159
|
switch (t) {
|
|
1160
1160
|
case "not_in":
|
|
1161
1161
|
return "not in";
|
|
@@ -1331,7 +1331,7 @@ function It(e) {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
function $t(e) {
|
|
1333
1333
|
var v, y, c;
|
|
1334
|
-
const t = [], n =
|
|
1334
|
+
const t = [], n = Ce(e);
|
|
1335
1335
|
for (const f of n.warnings)
|
|
1336
1336
|
t.push(g(f.code, f.message));
|
|
1337
1337
|
for (const f of n.errors)
|
|
@@ -1427,57 +1427,59 @@ function $t(e) {
|
|
|
1427
1427
|
}, warnings: t };
|
|
1428
1428
|
}
|
|
1429
1429
|
export {
|
|
1430
|
-
|
|
1430
|
+
Rt as AUTOMATIC_TEMPORAL_BUCKET_FORMAT,
|
|
1431
1431
|
ye as DASHBOARD_AUTHORING_BREAKPOINTS,
|
|
1432
|
-
|
|
1432
|
+
B as DASHBOARD_AUTHORING_MAX_GENERATED_CARDS,
|
|
1433
1433
|
Kt as DashboardFilterMappingContractError,
|
|
1434
|
-
|
|
1434
|
+
Bt as SEMAPHOR_CARTESIAN_CHART_TYPES,
|
|
1435
|
+
Gt as applyCardReferenceRemapping,
|
|
1435
1436
|
Tt as applyDashboardChangePlan,
|
|
1436
|
-
|
|
1437
|
+
Ut as buildDashboardCardSourceIndex,
|
|
1437
1438
|
xt as compileDashboardFromPlan,
|
|
1438
1439
|
G as compileResponsiveDashboardLayouts,
|
|
1439
|
-
|
|
1440
|
+
Qt as composeCardReferenceRemapping,
|
|
1441
|
+
Yt as createDashboardFilterBindingId,
|
|
1440
1442
|
K as dashboardAuthoringDatasetMatchesSource,
|
|
1441
1443
|
At as dashboardAuthoringFieldsReferToSameTarget,
|
|
1442
|
-
|
|
1444
|
+
C as dashboardAuthoringSourceFromField,
|
|
1443
1445
|
kt as dashboardAuthoringSourceKey,
|
|
1444
1446
|
oe as dashboardAuthoringSourcesReferToSameDataset,
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1447
|
+
Jt as dashboardCardFilterSourceInventoryContains,
|
|
1448
|
+
Xt as dashboardFilterTargetMatchesLogicalValue,
|
|
1449
|
+
Zt as dashboardFilterValueTypeForDataType,
|
|
1448
1450
|
$t as dashboardPlanFromSemaphorDashboardIntent,
|
|
1449
1451
|
Ft as findDashboardAuthoringDatasetForSource,
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1452
|
+
en as findDashboardCardExecutableSource,
|
|
1453
|
+
tn as findDashboardCardPinnedCatalogSource,
|
|
1454
|
+
nn as findDashboardSqlPinnedCatalogSource,
|
|
1455
|
+
Re as getDashboardAuthoringCardSource,
|
|
1456
|
+
rn as getDashboardFilterSubscriptionHint,
|
|
1455
1457
|
Pt as getTemporalBucketAuthoringOptions,
|
|
1456
1458
|
zt as getTemporalBucketAuthoringSelection,
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
+
an as hasDashboardFilterSubscription,
|
|
1460
|
+
on as isDashboardFilterOperationCompatible,
|
|
1459
1461
|
T as isMaterializableDashboardAuthoringSource,
|
|
1460
1462
|
Ot as isSemaphorCartesianChartType,
|
|
1461
1463
|
ke as isSemaphorSourceRef,
|
|
1462
1464
|
P as mergeDashboardAuthoringSources,
|
|
1463
|
-
|
|
1465
|
+
sn as normalizeDashboardInputs,
|
|
1464
1466
|
De as preferDashboardAuthoringSourceMetadata,
|
|
1465
1467
|
Dt as preferredDashboardAuthoringSource,
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1468
|
+
qt as previewTemporalBucketAuthoringFormat,
|
|
1469
|
+
Vt as reconcileTemporalBucketAuthoringFormat,
|
|
1470
|
+
dn as requireNormalizedDashboardInputs,
|
|
1471
|
+
pn as resolveCanonicalDetailResultRawKey,
|
|
1472
|
+
hn as resolveCanonicalResultOutputKey,
|
|
1473
|
+
mn as resolveCanonicalResultRawKey,
|
|
1472
1474
|
Ae as resolveDashboardAuthoringSource,
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1475
|
+
cn as resolveDashboardFilterAutomaticTarget,
|
|
1476
|
+
ln as resolveDashboardFilterInheritedTarget,
|
|
1477
|
+
un as resolveDashboardSqlFilterTarget,
|
|
1476
1478
|
Lt as resolveTemporalBucketAuthoringFormat,
|
|
1477
1479
|
jt as resolveTemporalResultOwner,
|
|
1478
1480
|
Et as supportsCanonicalDashboardTemporalResult,
|
|
1479
1481
|
Ht as transformComparisonDocument,
|
|
1480
|
-
|
|
1482
|
+
Be as validateDashboardAuthoringDatasetScope,
|
|
1481
1483
|
Oe as validateDashboardChangePlan,
|
|
1482
1484
|
ze as validateDashboardPlan
|
|
1483
1485
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),An=require("react-dom/client"),k=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),An=require("react-dom/client"),k=require("../chunks/index--0Il-Bpd.cjs"),w=require("../chunks/switch-Cpj3DrCZ.cjs"),Ze=require("../data-app-builder-browser-runtime/index.cjs"),te=require("../chunks/x-B6ghREd2.cjs"),Cn=require("../chunks/save-3dYRmehL.cjs"),Rn=require("../chunks/mouse-pointer-2-DX4A_XZw.cjs"),tt=require("../chunks/search-BqqhaMx9.cjs");function Tr(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,d.get?d:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const Bn=Tr(p),Dn=Tr(An);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -2,8 +2,8 @@ import { jsx as r, jsxs as c, Fragment as re } from "react/jsx-runtime";
|
|
|
2
2
|
import * as Zn from "react";
|
|
3
3
|
import { useContext as qn, useState as x, useRef as oe, useMemo as je, useEffect as W, useCallback as Ot } from "react";
|
|
4
4
|
import * as Xn from "react-dom/client";
|
|
5
|
-
import {
|
|
6
|
-
import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-
|
|
5
|
+
import { aL as ea, aM as ta, aN as Ir, aO as jr, aP as zr, aQ as ra, aR as Wr, aS as Hr, aT as Jr, aU as Vr, aV as _r, aW as Ur, aX as Gr, aY as na, aZ as aa, a_ as oa, a$ as Ht, b0 as on, R as Kr, b1 as sa, b2 as Vt, b3 as sn, b4 as ia, b5 as la } from "../chunks/index-DgGcVyUs.js";
|
|
6
|
+
import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-BsGTOjuD.js";
|
|
7
7
|
import { loadSemaphorBrowserRuntime as ot } from "../data-app-builder-browser-runtime/index.js";
|
|
8
8
|
import { c as Ve, X as He } from "../chunks/x-CXDkqdur.js";
|
|
9
9
|
import { S as fa } from "../chunks/save-DgMfP0j8.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/validators-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/validators-DqIM0B3C.cjs"),e=require("../chunks/update-policy-Buw2LmvX.cjs");exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.CODEGEN_SUMMARY_SCHEMA_VERSION=e.CODEGEN_SUMMARY_SCHEMA_VERSION;exports.CODEGEN_SUMMARY_VALIDATOR_VERSION=e.CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.CONTRACT_MANIFEST_SCHEMA_VERSION=e.CONTRACT_MANIFEST_SCHEMA_VERSION;exports.GENERATED_CONTRACT_SCHEMA_VERSION=e.GENERATED_CONTRACT_SCHEMA_VERSION;exports.GENERATED_CONTRACT_TYPESCRIPT_FILES=e.GENERATED_CONTRACT_TYPESCRIPT_FILES;exports.REQUIRED_GENERATED_CONTRACT_FILES=e.REQUIRED_GENERATED_CONTRACT_FILES;exports.assertValidCodegenSummary=e.assertValidCodegenSummary;exports.buildSemaphorGeneratedActiveInput=e.buildSemaphorGeneratedActiveInput;exports.buildSemaphorGeneratedInputOptionIntent=e.buildSemaphorGeneratedInputOptionIntent;exports.buildSemaphorGeneratedViewExecutionRequest=e.buildSemaphorGeneratedViewExecutionRequest;exports.buildSemaphorGeneratedViewExecutionRequests=e.buildSemaphorGeneratedViewExecutionRequests;exports.evaluateSemaphorDataAppContractUpdatePolicy=e.evaluateSemaphorDataAppContractUpdatePolicy;exports.validateCodegenSummary=e.validateCodegenSummary;exports.validateSemaphorGeneratedContract=e.validateSemaphorGeneratedContract;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as E, a as S, i as A, v as t } from "../chunks/validators-
|
|
2
|
-
import { C as R, a as r, b as s, G as C, e as o, R as p, c as d, f as O, g as i, h as m, i as n, j as N, v as T, d as I } from "../chunks/update-policy-
|
|
1
|
+
import { S as E, a as S, i as A, v as t } from "../chunks/validators-D3AarM2T.js";
|
|
2
|
+
import { C as R, a as r, b as s, G as C, e as o, R as p, c as d, f as O, g as i, h as m, i as n, j as N, v as T, d as I } from "../chunks/update-policy-MWg0aH3d.js";
|
|
3
3
|
export {
|
|
4
4
|
R as CODEGEN_SUMMARY_SCHEMA_VERSION,
|
|
5
5
|
r as CODEGEN_SUMMARY_VALIDATOR_VERSION,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../chunks/validators-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../chunks/validators-DqIM0B3C.cjs"),R=require("../chunks/update-policy-Buw2LmvX.cjs"),he=require("node:crypto"),Ce="src/semaphor/generated",H=`// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
|
|
2
2
|
// Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.
|
|
3
3
|
`;function Oe(e,n={}){R.assertValidCodegenSummary(e);const r=Me(e);if(r.views.length===0&&!n.allowEmpty)throw new Error("Contract generation produced zero executable views. Stop and ask for a different domain/goal or semantic model improvement; pass --allow-empty only for an explicit model-gap report.");const t=ke(r),o=Ne({contract:r,files:t,generatorName:n.generatorName||"react-semaphor/data-app-codegen/node",generatorVersion:n.generatorVersion||"unknown"}),a={...t,"contract.manifest.json":`${JSON.stringify(o,null,2)}
|
|
4
4
|
`};return{schemaVersion:R.GENERATED_CONTRACT_SCHEMA_VERSION,files:a,manifest:o,contentHash:String(o.generatedContentHash||""),usageExample:Te(r),warnings:r.warnings,stats:{inputCount:r.inputs.length,executableViewCount:r.views.length,presentationViewCount:r.presentationViews.length,queryCount:r.views.length,optionQueryCount:r.optionQueries.length}}}function Me(e){var d,p,m,i,l,g,h,I,$,M,b,E;const n=[],r=[];for(const s of e.inputs){S(r,s.fieldRef);for(const V of s.bindings||[])S(r,V.fieldRef);S(r,(d=s.optionQuery)==null?void 0:d.valueFieldRef),S(r,(p=s.optionQuery)==null?void 0:p.labelFieldRef),S(r,(m=s.optionQuery)==null?void 0:m.filterFieldRef),D(r,(i=s.optionQuery)==null?void 0:i.spec)}for(const s of e.filterContracts){S(r,s.fieldRef),S(r,(l=s.optionQuery)==null?void 0:l.valueFieldRef),S(r,(g=s.optionQuery)==null?void 0:g.labelFieldRef),S(r,(h=s.optionQuery)==null?void 0:h.filterFieldRef),D(r,(I=s.optionQuery)==null?void 0:I.spec);for(const V of s.bindings||[])S(r,V.fieldRef)}for(const s of e.views){for(const V of s.fields||[])S(r,V);D(r,($=s.sdkSpec)==null?void 0:$.spec),D(r,s.visualSpec)}const t=e.implementationChecklist||{};for(const s of Object.values(t.bindingsByView||{}))for(const V of Array.isArray(s)?s:[])S(r,V.fieldRef),S(r,V.optionValueField),S(r,V.optionLabelField);for(const s of t.requiredInputOptions||[])S(r,s.visibleLabelField),S(r,s.optionValueField),S(r,s.runtimeFilterField);const o=pn([...e.sources.map(s=>({raw:s,key:Ie(s),aliases:Ve(s),name:""})),...r.map(s=>an(s)).filter(x)]);P(o,s=>{const V=F(s.raw);return j(s.raw.label||(V==null?void 0:V.datasetName)||(V==null?void 0:V.datasetId)||(V==null?void 0:V.name)||s.raw.kind||"source")});const a=ln(o),u=ne(r.filter(s=>s.name).map(s=>({raw:s,key:X(s),name:""})),s=>s.key);P(u,s=>j([s.raw.sourceKey?yn(s.raw.sourceKey):"",s.raw.aggregate?s.raw.aggregate.toLowerCase():"",s.raw.name].filter(Boolean).join("_")));const c=new Map(u.map(s=>[s.key,s.name])),w=e.inputs.map(s=>({raw:s,name:j(s.id||s.label||"input")}));P(w,s=>s.name);const f=w.filter(s=>!!s.raw.optionQuery).map(s=>({input:s,name:`${s.name}Options`,raw:s.raw.optionQuery}));P(f,s=>s.name);for(const s of f)un(s.raw.labelFieldRef,s.raw.valueFieldRef)&&dn(s.raw.valueFieldRef)&&n.push(`Input option query ${((M=s.raw.spec)==null?void 0:M.inputId)||s.input.raw.id||s.name} uses identifier field ${s.raw.valueFieldRef.name} as both label and value. It can execute, but the UI will show key values unless the semantic model exposes a human-readable label through a modeled relationship.`);const y=e.views.filter(s=>{var V,K;return!!((V=s.sdkSpec)!=null&&V.builder&&((K=s.sdkSpec)!=null&&K.spec))}).map(s=>({raw:s,name:j(s.id||s.title||"query")}));P(y,s=>s.name);const k=e.views.filter(s=>fe(s)&&!("sdkSpec"in s)).map(s=>sn(s));for(const s of e.views)(!("sdkSpec"in s)||!((b=s.sdkSpec)!=null&&b.builder)||!((E=s.sdkSpec)!=null&&E.spec))&&!fe(s)&&n.push(`Skipped view ${s.id||s.title||"unknown"} because it has no sdkSpec.`);return Ee({inputs:w,views:y,filterContracts:e.filterContracts}),{summary:e,title:e.title||"Semaphor Data App",sources:o,fields:u,inputs:w,optionQueries:f,views:y,presentationViews:k,filterContracts:e.filterContracts,checklist:t,sourceNameByKey:a,fieldNameByKey:c,warnings:n}}function Ee({inputs:e,views:n,filterContracts:r}){const t=new Set(e.map(a=>a.raw.id).filter(Boolean)),o=new Set(n.map(a=>a.raw.id).filter(Boolean));for(const[a,u]of r.entries()){if(!t.has(u.inputId))throw new Error(`filterContracts.${a}.inputId must reference a generated input.`);const c=new Set(u.appliesToViewIds||[]),w=new Set(u.notAppliedToViewIds||[]);for(const[f,y]of(u.appliesToViewIds||[]).entries())if(!o.has(y))throw new Error(`filterContracts.${a}.appliesToViewIds.${f} must reference an executable generated view.`);for(const[f,y]of(u.notAppliedToViewIds||[]).entries())if(!o.has(y))throw new Error(`filterContracts.${a}.notAppliedToViewIds.${f} must reference an executable generated view.`);for(const[f,y]of(u.bindings||[]).entries()){if(!o.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must reference an executable generated view.`);if(!c.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must be included in appliesToViewIds.`);if(w.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must not be listed in notAppliedToViewIds.`)}}}function ke(e){return{"sources.ts":ve(e),"fields.ts":qe(e),"inputs.ts":De(e),"queries.ts":Pe(e),"bindings.ts":Le(e),"accessors.ts":Ye(e),"metadata.ts":We(e),"index.ts":Xe(),"USAGE.md":Ae(e)}}function Ne({contract:e,files:n,generatorName:r,generatorVersion:t}){return{schemaVersion:R.CONTRACT_MANIFEST_SCHEMA_VERSION,generatedContractSchemaVersion:R.GENERATED_CONTRACT_SCHEMA_VERSION,generator:{name:r,version:t},generatedContentHash:Ge(n),codegenSummaryValidatorVersion:R.CODEGEN_SUMMARY_VALIDATOR_VERSION,codegenSummaryHash:xe(e.summary),codegenSummary:e.summary}}function Ge(e){const n=he.createHash("sha256");for(const r of Object.keys(e).filter(t=>t.endsWith(".ts")).sort())n.update(r),n.update("\0"),n.update(e[r]),n.update("\0");return`sha256:${n.digest("hex")}`}function Ae(e){const n=["# Semaphor Generated Data App Contract","","Generated files in this directory are governed Semaphor analytics wiring. Do not hand-edit them.","","Use the app-facing exports from `index.ts`:","","- `queries`: generated governed query factories.","- `queryOptionsForView`: active-input wiring for each generated view.","- `rowsForView`: table/records row readers.","- `rowValuesForView`: friendly row object readers for chart/table views.","- `metricValuesForView`: friendly metric-value readers.","- `kpiPropsForView`: KPI component props derived from runtime metric results.","- `roleValuesForView`: canonical dimension/measure/date/id role readers.","- `appInputSpecs`: generated input/filter specs.","- `inputOptionQueries`: option-list query factories for generated inputs.","- `semaphorGeneratedContractMetadata`: generated view/input metadata and presentation-only views.","","Start with these exports before opening large generated internals such as `metadata.ts`.",""];return e.views.length>0&&(n.push("Generated executable views:"),e.views.forEach(r=>{n.push(`- \`${r.raw.id}\`: ${r.raw.title||r.name}`)}),n.push("")),e.inputs.length>0&&(n.push("Generated inputs:"),e.inputs.forEach(r=>{n.push(`- \`${r.raw.id}\`: ${r.raw.label||r.name}`)}),n.push("")),`${n.join(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as Vn, a as Fn, i as bn, v as kn } from "../chunks/validators-
|
|
2
|
-
import { c as ke, G as fe, a as Re, b as Me } from "../chunks/update-policy-
|
|
3
|
-
import { C as Mn, e as Cn, R as On, f as xn, g as Gn, h as Nn, i as En, j as An, v as jn, d as vn } from "../chunks/update-policy-
|
|
1
|
+
import { S as Vn, a as Fn, i as bn, v as kn } from "../chunks/validators-D3AarM2T.js";
|
|
2
|
+
import { c as ke, G as fe, a as Re, b as Me } from "../chunks/update-policy-MWg0aH3d.js";
|
|
3
|
+
import { C as Mn, e as Cn, R as On, f as xn, g as Gn, h as Nn, i as En, j as An, v as jn, d as vn } from "../chunks/update-policy-MWg0aH3d.js";
|
|
4
4
|
import { createHash as ye } from "node:crypto";
|
|
5
5
|
const wn = "src/semaphor/generated", v = `// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
|
|
6
6
|
// Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../data-app-sdk-adapters/index.cjs"),i=require("react/jsx-runtime"),c=require("react"),ae=require("../chunks/validators-DcshgK7w.cjs");require("../chunks/analyze-result-contract-OgPk-zGu.cjs");require("../value-format-preferences/index.cjs");const se=require("../chunks/search-BqqhaMx9.cjs"),Ke=require("../chunks/x-B6ghREd2.cjs");function ue(e,r,t={}){return{...t,name:e,role:r}}function Mr(e){return e}function Kr(e){return e}const Wr={source:{semantic(e){return{...e,kind:"semantic"}},sql(e){return{...e,kind:"sql"}}},field:{measure(e,r){return ue(e,"measure",r)},dimension(e,r){return ue(e,"dimension",r)},date(e,r){return ue(e,"date",r)},id(e,r){return ue(e,"id",r)}},filter(e){return{...e,kind:"filter"}},bindInput(e,r){return{toAnalyticsInput(){const[t]=w.toSemaphorInputSnapshots([e]),n=w.toSemaphorInputBinding({...r,inputId:r.inputId||t.inputId});return{...t,inputId:n.inputId,...n.kind?{kind:n.kind}:{},...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}}},control(e){return{...e,kind:"control"}},sqlParam(e){return{...e,kind:"control",role:"sqlParam"}},derivedField(e){return{...e,kind:"derived_field",expressionLanguage:e.expressionLanguage||"semaphor_sql_template"}},metric(e){return{...e,queryKind:"metric"}},analysis(e){return{...e,queryKind:"analysis"}},records(e){return{...e,queryKind:"records"}},inputOptions(e){return{...e,queryKind:"inputOptions"}},sql(e){return{...e,queryKind:"sql"}},matrix(e){return{...e,queryKind:"matrix"}}},ie=10,Le=8;function We(e,r){const t=e==null?void 0:e.result;if(t)switch(t.kind){case"records":return te({title:"Records",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"sql":return te({title:"SQL Rows",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"inputOptions":return te({title:"Options",rowNoun:"options",records:t.options.slice(0,ie).map(n=>{var s;return{label:n.label,value:n.value,count:n.count,disambiguation:(s=n.disambiguation)==null?void 0:s.join(" / ")}}),columns:[{key:"label",label:"Label"},{key:"value",label:"Value"},{key:"count",label:"Count"},{key:"disambiguation",label:"Disambiguation"}],rowCount:t.rowCount??t.options.length});case"metric":return _r(t,r);case"matrix":return te({title:"Matrix Cells",rowNoun:"cells",records:t.cells.slice(0,ie).map(n=>{const s=t.nodesById[n.rowId],o=n.columnId?t.nodesById[n.columnId]:void 0,u=t.measuresById[n.measureId];return{row:(s==null?void 0:s.label)||n.rowId,column:(o==null?void 0:o.label)||n.columnId||"Total",measure:(u==null?void 0:u.label)||n.measureId,value:n.value,role:n.role}}),columns:[{key:"row",label:"Row"},{key:"column",label:"Column"},{key:"measure",label:"Measure"},{key:"value",label:"Value"},{key:"role",label:"Role"}],rowCount:t.rowCount??t.cells.length});default:return Fr(t)}}function _r(e,r){var o,u,p,d,f;const t=[{metric:"primaryValue",value:(r==null?void 0:r.primaryValue)??e.primaryValue}],n=(r==null?void 0:r.comparisonKind)??((o=e.comparison)==null?void 0:o.kind);return n&&t.push({metric:`${n} value`,value:(r==null?void 0:r.comparisonValue)??((u=e.comparison)==null?void 0:u.value)},{metric:"delta",value:(r==null?void 0:r.delta)??((p=e.comparison)==null?void 0:p.delta)},{metric:"deltaPercent",value:(r==null?void 0:r.deltaPercent)??((d=e.comparison)==null?void 0:d.deltaPercent)}),(((f=r==null?void 0:r.missingMeasures)==null?void 0:f.filter(Boolean))??[]).forEach(g=>{t.push({metric:`missing:${g}`,value:"missing"})}),Object.entries((r==null?void 0:r.measures)??{}).sort(([g],[m])=>g.localeCompare(m)).forEach(([g,m])=>{t.push({metric:`measure:${g}`,value:m})}),Object.entries((r==null?void 0:r.measureBindings)??{}).sort(([g],[m])=>g.localeCompare(m)).forEach(([g,m])=>{t.push({metric:`binding:${g}`,value:m})}),te({title:"Metric",rowNoun:"values",records:t,columns:[{key:"metric",label:"Metric"},{key:"value",label:"Value"}],rowCount:t.length})}function te({title:e,rowNoun:r,records:t,columns:n,rowCount:s}){const o=Nr(n,t);if(!o.length)return;const u=s??t.length,p=t.slice(0,ie);return{title:e,summary:`${Pr(u)} ${r}`,columns:o.slice(0,Le),rows:p,truncatedRows:u>p.length,truncatedColumns:o.length>Le}}function Nr(e,r){if(e!=null&&e.length)return e.filter(n=>n.key).map(n=>({key:n.key,label:n.label||n.key}));const t=new Set;return r.slice(0,ie).forEach(n=>{Object.keys(n).forEach(s=>t.add(s))}),[...t].map(n=>({key:n,label:n}))}function Fr(e){throw new Error(`Unhandled Semaphor result kind: ${pr(e)}`)}function zr(e){return e===null?"null":e===void 0?"":typeof e=="string"?rr(e):typeof e=="number"||typeof e=="boolean"?String(e):rr(pr(e))}function Pr(e){return typeof e=="number"?e.toLocaleString():"-"}function pr(e){return JSON.stringify(e,null,2)??"undefined"}function rr(e){return e.length>80?`${e.slice(0,77)}...`:e}function he(e){return e.viewTitle||e.queryLabel||e.viewId||e.queryId}function Hr(e){if(e.label)return e.label;if(e.queryKind!=="inputOptions")return;const t=e.labelField.label||e.valueField.label||e.labelField.name||e.valueField.name||e.inputId;return`${Vr(t)} Options`}function Vr(e){return(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\bfilter\b/gi," ").replace(/\boptions?\b/gi," ").replace(/\bid\b/gi," ").replace(/\s+/g," ").trim()||e).split(" ").filter(Boolean).map(n=>n===n.toUpperCase()&&n.length>1?n:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join(" ")}function _e(e){return e.flatMap(r=>{var g,m,v,y;const t=r.latestAttempt,n=t==null?void 0:t.executionResult,s=Se((g=n==null?void 0:n.validation)==null?void 0:g.warnings),o=Se((m=n==null?void 0:n.validation)==null?void 0:m.errors),u=Jr((v=n==null?void 0:n.coverage)==null?void 0:v.missingObligations),p=Se((y=n==null?void 0:n.coverage)==null?void 0:y.warnings),d=[],f=he(r);(t==null?void 0:t.status)==="error"&&d.push({trace:r,tone:"error",title:f,message:t.errorMessage||"Query attempt failed."});for(const h of r.clientWarnings)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of s)d.push({trace:r,tone:"warning",title:f,...h});for(const h of o)d.push({trace:r,tone:"error",title:f,...h});for(const h of u)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of p)d.push({trace:r,tone:"warning",title:f,...h});return d})}function Qr(e){return{traceId:e.trace.traceId,queryId:e.trace.queryId,viewId:e.trace.viewId,viewTitle:e.trace.viewTitle,queryLabel:e.trace.queryLabel,severity:e.tone,title:e.title,message:e.message,code:e.code,path:e.path}}function Ur(e,r){return e.filter(t=>t.trace.traceId===r.traceId).length}function Gr(e){const r=_e(e),t=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="error"}).length,n=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="loading"}).length,s=r.filter(u=>u.tone==="error").length,o=r.filter(u=>u.tone==="warning").length;return{total:e.length,failed:t,loading:n,errorCount:s,warningCount:o,issueCount:r.length,severity:t||s?"error":o?"warning":n?"loading":"ok"}}function Jr(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function Se(e){return Array.isArray(e)?e.map(Yr).filter(r=>!!r):[]}function Yr(e){if(typeof e=="string")return{message:e};if(!e||typeof e!="object"||Array.isArray(e))return;const r=e,t=typeof r.message=="string"?r.message:"",n=typeof r.code=="string"?r.code:"",s=typeof r.path=="string"?r.path:"";return t&&n?{message:s?`${t} (${n}, ${s})`:`${t} (${n})`,code:n,...s?{path:s}:{}}:t?{message:t,...s?{path:s}:{}}:n?{message:n,code:n}:void 0}function Xr(e){if(!e.enabled)return e;const r=e.queries.map(gr);return{enabled:e.enabled,queries:r,issues:e.issues,getQuery:t=>r.find(n=>n.queryId===t),getQueries:t=>r.filter(n=>n.queryId===t)}}function tr(e){return e?gr(e):void 0}function gr(e){var r;return(r=e==null?void 0:e.latestAttempt)!=null&&r.executionResult?{...e,latestAttempt:{...e.latestAttempt,resultPreview:e.latestAttempt.resultPreview||We(e.latestAttempt.executionResult),executionResult:Zr(e.latestAttempt.executionResult)}}:e}function Zr(e){const{compiledQuery:r,intent:t,result:n,...s}=e,o=et(s.metadata);return{...s,...o?{metadata:o}:{}}}function et(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e.dataAppDebug;if(!r||typeof r!="object"||Array.isArray(r))return e;const{compiledSql:t,...n}=r;return{...e,dataAppDebug:n}}function rt(e){return e==="relative"?{position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"}:{top:e.startsWith("top")?20:"auto",right:e.endsWith("right")?20:"auto",bottom:e.startsWith("bottom")?20:"auto",left:e.endsWith("left")?20:"auto"}}function tt(e){return e==="error"?{borderColor:"var(--sd-error-border)",background:"var(--sd-error-bg)",color:"var(--sd-error-fg)"}:e==="warning"?{borderColor:"var(--sd-warning-border)",background:"var(--sd-warning-bg)",color:"var(--sd-warning-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",background:"var(--sd-loading-bg)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-success-border)",background:"var(--sd-success-bg)",color:"var(--sd-success-fg)"}}function nt(e){return e==="right"?{top:16,right:16,bottom:16,left:"auto",width:"min(720px, calc(100vw - 32px))",height:"auto",borderRadius:6}:{top:"auto",right:16,bottom:16,left:16,width:"auto",height:"min(420px, 45vh)",borderRadius:6}}function st(e){return e==="right"?{gridTemplateColumns:"minmax(210px, 280px) minmax(0, 1fr)"}:{gridTemplateColumns:"minmax(260px, 340px) minmax(0, 1fr)"}}function it(e){return{borderRight:"1px solid var(--sd-border)",borderBottom:0}}function mr(e){return e==="error"?{background:"var(--sd-error-dot)"}:e==="success"?{background:"var(--sd-success-dot)"}:e==="loading"?{background:"var(--sd-loading-dot)"}:{background:"var(--sd-idle-dot)"}}function ot(e){return e==="error"?{borderColor:"var(--sd-error-border)",color:"var(--sd-error-fg)"}:e==="success"?{borderColor:"var(--sd-success-border)",color:"var(--sd-success-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-border)",color:"var(--sd-fg-muted)"}}const nr="semaphor-devtools-stylesheet",T="semaphor-devtools",at=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../data-app-sdk-adapters/index.cjs"),i=require("react/jsx-runtime"),c=require("react"),ae=require("../chunks/validators-DqIM0B3C.cjs");require("../chunks/analyze-result-contract-BX_nQmPN.cjs");require("../value-format-preferences/index.cjs");const se=require("../chunks/search-BqqhaMx9.cjs"),Ke=require("../chunks/x-B6ghREd2.cjs");function ue(e,r,t={}){return{...t,name:e,role:r}}function Mr(e){return e}function Kr(e){return e}const Wr={source:{semantic(e){return{...e,kind:"semantic"}},sql(e){return{...e,kind:"sql"}}},field:{measure(e,r){return ue(e,"measure",r)},dimension(e,r){return ue(e,"dimension",r)},date(e,r){return ue(e,"date",r)},id(e,r){return ue(e,"id",r)}},filter(e){return{...e,kind:"filter"}},bindInput(e,r){return{toAnalyticsInput(){const[t]=w.toSemaphorInputSnapshots([e]),n=w.toSemaphorInputBinding({...r,inputId:r.inputId||t.inputId});return{...t,inputId:n.inputId,...n.kind?{kind:n.kind}:{},...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}}},control(e){return{...e,kind:"control"}},sqlParam(e){return{...e,kind:"control",role:"sqlParam"}},derivedField(e){return{...e,kind:"derived_field",expressionLanguage:e.expressionLanguage||"semaphor_sql_template"}},metric(e){return{...e,queryKind:"metric"}},analysis(e){return{...e,queryKind:"analysis"}},records(e){return{...e,queryKind:"records"}},inputOptions(e){return{...e,queryKind:"inputOptions"}},sql(e){return{...e,queryKind:"sql"}},matrix(e){return{...e,queryKind:"matrix"}}},ie=10,Le=8;function We(e,r){const t=e==null?void 0:e.result;if(t)switch(t.kind){case"records":return te({title:"Records",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"sql":return te({title:"SQL Rows",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"inputOptions":return te({title:"Options",rowNoun:"options",records:t.options.slice(0,ie).map(n=>{var s;return{label:n.label,value:n.value,count:n.count,disambiguation:(s=n.disambiguation)==null?void 0:s.join(" / ")}}),columns:[{key:"label",label:"Label"},{key:"value",label:"Value"},{key:"count",label:"Count"},{key:"disambiguation",label:"Disambiguation"}],rowCount:t.rowCount??t.options.length});case"metric":return _r(t,r);case"matrix":return te({title:"Matrix Cells",rowNoun:"cells",records:t.cells.slice(0,ie).map(n=>{const s=t.nodesById[n.rowId],o=n.columnId?t.nodesById[n.columnId]:void 0,u=t.measuresById[n.measureId];return{row:(s==null?void 0:s.label)||n.rowId,column:(o==null?void 0:o.label)||n.columnId||"Total",measure:(u==null?void 0:u.label)||n.measureId,value:n.value,role:n.role}}),columns:[{key:"row",label:"Row"},{key:"column",label:"Column"},{key:"measure",label:"Measure"},{key:"value",label:"Value"},{key:"role",label:"Role"}],rowCount:t.rowCount??t.cells.length});default:return Fr(t)}}function _r(e,r){var o,u,p,d,f;const t=[{metric:"primaryValue",value:(r==null?void 0:r.primaryValue)??e.primaryValue}],n=(r==null?void 0:r.comparisonKind)??((o=e.comparison)==null?void 0:o.kind);return n&&t.push({metric:`${n} value`,value:(r==null?void 0:r.comparisonValue)??((u=e.comparison)==null?void 0:u.value)},{metric:"delta",value:(r==null?void 0:r.delta)??((p=e.comparison)==null?void 0:p.delta)},{metric:"deltaPercent",value:(r==null?void 0:r.deltaPercent)??((d=e.comparison)==null?void 0:d.deltaPercent)}),(((f=r==null?void 0:r.missingMeasures)==null?void 0:f.filter(Boolean))??[]).forEach(g=>{t.push({metric:`missing:${g}`,value:"missing"})}),Object.entries((r==null?void 0:r.measures)??{}).sort(([g],[m])=>g.localeCompare(m)).forEach(([g,m])=>{t.push({metric:`measure:${g}`,value:m})}),Object.entries((r==null?void 0:r.measureBindings)??{}).sort(([g],[m])=>g.localeCompare(m)).forEach(([g,m])=>{t.push({metric:`binding:${g}`,value:m})}),te({title:"Metric",rowNoun:"values",records:t,columns:[{key:"metric",label:"Metric"},{key:"value",label:"Value"}],rowCount:t.length})}function te({title:e,rowNoun:r,records:t,columns:n,rowCount:s}){const o=Nr(n,t);if(!o.length)return;const u=s??t.length,p=t.slice(0,ie);return{title:e,summary:`${Pr(u)} ${r}`,columns:o.slice(0,Le),rows:p,truncatedRows:u>p.length,truncatedColumns:o.length>Le}}function Nr(e,r){if(e!=null&&e.length)return e.filter(n=>n.key).map(n=>({key:n.key,label:n.label||n.key}));const t=new Set;return r.slice(0,ie).forEach(n=>{Object.keys(n).forEach(s=>t.add(s))}),[...t].map(n=>({key:n,label:n}))}function Fr(e){throw new Error(`Unhandled Semaphor result kind: ${pr(e)}`)}function zr(e){return e===null?"null":e===void 0?"":typeof e=="string"?rr(e):typeof e=="number"||typeof e=="boolean"?String(e):rr(pr(e))}function Pr(e){return typeof e=="number"?e.toLocaleString():"-"}function pr(e){return JSON.stringify(e,null,2)??"undefined"}function rr(e){return e.length>80?`${e.slice(0,77)}...`:e}function he(e){return e.viewTitle||e.queryLabel||e.viewId||e.queryId}function Hr(e){if(e.label)return e.label;if(e.queryKind!=="inputOptions")return;const t=e.labelField.label||e.valueField.label||e.labelField.name||e.valueField.name||e.inputId;return`${Vr(t)} Options`}function Vr(e){return(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\bfilter\b/gi," ").replace(/\boptions?\b/gi," ").replace(/\bid\b/gi," ").replace(/\s+/g," ").trim()||e).split(" ").filter(Boolean).map(n=>n===n.toUpperCase()&&n.length>1?n:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join(" ")}function _e(e){return e.flatMap(r=>{var g,m,v,y;const t=r.latestAttempt,n=t==null?void 0:t.executionResult,s=Se((g=n==null?void 0:n.validation)==null?void 0:g.warnings),o=Se((m=n==null?void 0:n.validation)==null?void 0:m.errors),u=Jr((v=n==null?void 0:n.coverage)==null?void 0:v.missingObligations),p=Se((y=n==null?void 0:n.coverage)==null?void 0:y.warnings),d=[],f=he(r);(t==null?void 0:t.status)==="error"&&d.push({trace:r,tone:"error",title:f,message:t.errorMessage||"Query attempt failed."});for(const h of r.clientWarnings)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of s)d.push({trace:r,tone:"warning",title:f,...h});for(const h of o)d.push({trace:r,tone:"error",title:f,...h});for(const h of u)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of p)d.push({trace:r,tone:"warning",title:f,...h});return d})}function Qr(e){return{traceId:e.trace.traceId,queryId:e.trace.queryId,viewId:e.trace.viewId,viewTitle:e.trace.viewTitle,queryLabel:e.trace.queryLabel,severity:e.tone,title:e.title,message:e.message,code:e.code,path:e.path}}function Ur(e,r){return e.filter(t=>t.trace.traceId===r.traceId).length}function Gr(e){const r=_e(e),t=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="error"}).length,n=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="loading"}).length,s=r.filter(u=>u.tone==="error").length,o=r.filter(u=>u.tone==="warning").length;return{total:e.length,failed:t,loading:n,errorCount:s,warningCount:o,issueCount:r.length,severity:t||s?"error":o?"warning":n?"loading":"ok"}}function Jr(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function Se(e){return Array.isArray(e)?e.map(Yr).filter(r=>!!r):[]}function Yr(e){if(typeof e=="string")return{message:e};if(!e||typeof e!="object"||Array.isArray(e))return;const r=e,t=typeof r.message=="string"?r.message:"",n=typeof r.code=="string"?r.code:"",s=typeof r.path=="string"?r.path:"";return t&&n?{message:s?`${t} (${n}, ${s})`:`${t} (${n})`,code:n,...s?{path:s}:{}}:t?{message:t,...s?{path:s}:{}}:n?{message:n,code:n}:void 0}function Xr(e){if(!e.enabled)return e;const r=e.queries.map(gr);return{enabled:e.enabled,queries:r,issues:e.issues,getQuery:t=>r.find(n=>n.queryId===t),getQueries:t=>r.filter(n=>n.queryId===t)}}function tr(e){return e?gr(e):void 0}function gr(e){var r;return(r=e==null?void 0:e.latestAttempt)!=null&&r.executionResult?{...e,latestAttempt:{...e.latestAttempt,resultPreview:e.latestAttempt.resultPreview||We(e.latestAttempt.executionResult),executionResult:Zr(e.latestAttempt.executionResult)}}:e}function Zr(e){const{compiledQuery:r,intent:t,result:n,...s}=e,o=et(s.metadata);return{...s,...o?{metadata:o}:{}}}function et(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e.dataAppDebug;if(!r||typeof r!="object"||Array.isArray(r))return e;const{compiledSql:t,...n}=r;return{...e,dataAppDebug:n}}function rt(e){return e==="relative"?{position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"}:{top:e.startsWith("top")?20:"auto",right:e.endsWith("right")?20:"auto",bottom:e.startsWith("bottom")?20:"auto",left:e.endsWith("left")?20:"auto"}}function tt(e){return e==="error"?{borderColor:"var(--sd-error-border)",background:"var(--sd-error-bg)",color:"var(--sd-error-fg)"}:e==="warning"?{borderColor:"var(--sd-warning-border)",background:"var(--sd-warning-bg)",color:"var(--sd-warning-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",background:"var(--sd-loading-bg)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-success-border)",background:"var(--sd-success-bg)",color:"var(--sd-success-fg)"}}function nt(e){return e==="right"?{top:16,right:16,bottom:16,left:"auto",width:"min(720px, calc(100vw - 32px))",height:"auto",borderRadius:6}:{top:"auto",right:16,bottom:16,left:16,width:"auto",height:"min(420px, 45vh)",borderRadius:6}}function st(e){return e==="right"?{gridTemplateColumns:"minmax(210px, 280px) minmax(0, 1fr)"}:{gridTemplateColumns:"minmax(260px, 340px) minmax(0, 1fr)"}}function it(e){return{borderRight:"1px solid var(--sd-border)",borderBottom:0}}function mr(e){return e==="error"?{background:"var(--sd-error-dot)"}:e==="success"?{background:"var(--sd-success-dot)"}:e==="loading"?{background:"var(--sd-loading-dot)"}:{background:"var(--sd-idle-dot)"}}function ot(e){return e==="error"?{borderColor:"var(--sd-error-border)",color:"var(--sd-error-fg)"}:e==="success"?{borderColor:"var(--sd-success-border)",color:"var(--sd-success-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-border)",color:"var(--sd-fg-muted)"}}const nr="semaphor-devtools-stylesheet",T="semaphor-devtools",at=`
|
|
2
2
|
.${T} {
|
|
3
3
|
--sd-bg: #ffffff;
|
|
4
4
|
--sd-bg-muted: #fafafa;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { toSemaphorInputSnapshots as jr, toSemaphorInputBinding as Hr, toSemaphorActiveInputSnapshots as X, toSemaphorMatrixIntent as Pr, toSemaphorSqlIntent as Vr, toSemaphorInputOptionsIntent as Qr, toSemaphorRecordsIntent as Ur, toSemaphorAnalysisQueryOptions as Gr, toSemaphorAnalysisIntent as Jr, toSemaphorMetricIntent as Yr, hasSemaphorInputValue as ue, normalizeSemaphorInputOptions as hr, toSemaphorInputSpec as br } from "../data-app-sdk-adapters/index.js";
|
|
2
2
|
import { jsxs as p, Fragment as vr, jsx as a } from "react/jsx-runtime";
|
|
3
3
|
import { createContext as Ie, useContext as Q, useState as z, useRef as E, useEffect as B, useMemo as I, Fragment as Xr, useId as Sr, useCallback as D, useReducer as Zr } from "react";
|
|
4
|
-
import { k as et, ak as rt, y as tt } from "../chunks/validators-
|
|
5
|
-
import { c as lo, al as uo } from "../chunks/validators-
|
|
6
|
-
import "../chunks/analyze-result-contract-
|
|
4
|
+
import { k as et, ak as rt, y as tt } from "../chunks/validators-D3AarM2T.js";
|
|
5
|
+
import { c as lo, al as uo } from "../chunks/validators-D3AarM2T.js";
|
|
6
|
+
import "../chunks/analyze-result-contract-DsiAzCYn.js";
|
|
7
7
|
import "../value-format-preferences/index.js";
|
|
8
8
|
import { M as nt, a as it, S as ot, E as st, C as at } from "../chunks/search-BHsQIWBV.js";
|
|
9
9
|
import { X as lt, C as dt, j as ut } from "../chunks/x-CXDkqdur.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../chunks/validators-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../chunks/validators-DqIM0B3C.cjs"),c=require("../chunks/operators-DrTQsJXv.cjs");require("../chunks/analyze-result-contract-BX_nQmPN.cjs");require("../value-format-preferences/index.cjs");function p(i){var n,r,a;const t=b(i);return{version:1,kind:"metric",id:i.id,label:i.label,source:s(i),measures:t,primaryMeasure:M(i,t),dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,dimensions:(n=i.dimensions)==null?void 0:n.map(e=>o(e,"dimension")),comparison:G(i.comparison),orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...(r=i.filters)!=null&&r.length?{filters:i.filters}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function v(i){return{...p(i),...i.timeWindow?{timeWindow:i.timeWindow}:{},...i.analysis?{analysis:i.analysis}:{}}}function F(i){return{...i.chartTitle?{chartTitle:i.chartTitle}:{},...i.chartType?{chartType:i.chartType}:{},...i.driverMode?{driverMode:i.driverMode}:{},...i.includePopulation!==void 0?{includePopulation:i.includePopulation}:{},...i.calendarContext?{calendarContext:i.calendarContext}:{}}}function M(i,t){if(!i.primaryMeasure)return t[0]||{name:"",role:"measure"};const n=o(i.primaryMeasure,"measure"),r=k(n,t),a=r.length===1?r[0]:void 0;return a?I(n,a):n}function b(i){const t=[];for(const n of i.measures.map(r=>o(r,"measure"))){if(!n.name)continue;const r=t.findIndex(a=>R(a,n));if(r===-1){t.push(n);continue}t[r]=I(t[r],n)}return t}function R(i,t){return u.semaphorFieldRefsMatch(i,t)&&d(i)===d(t)}function w(i,t){return d(t)===d(i)}function H(i,t){return t.name!==i.name||i.source&&!u.semaphorFieldRefsMatch(t,i)?!1:w(i,t)}function k(i,t){const n=t.filter(r=>H(i,r));return i.aggregate!==void 0,n}function d(i){return u.semaphorMetricAggregate(i)}function I(i,t){if(i.aggregate&&t.aggregate&&i.aggregate!==t.aggregate)throw new Error(`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`);return{...u.preferSemaphorFieldRefMetadata(i,t),aggregate:i.aggregate||t.aggregate}}function A(i){var n,r;if("sort"in i)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!V(i))throw new Error("semaphor.records needs at least one field.");const t=B(i.fields);return{version:1,kind:"records",id:i.id,label:i.label,source:s(i),fields:t,dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,...i.timeWindow?{timeWindow:i.timeWindow}:{},...(n=i.filters)!=null&&n.length?{filters:i.filters}:{},orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...i.pagination?{pagination:i.pagination}:{},...i.totals?{totals:{mode:"server",measures:i.totals.measures.map(a=>o(a,"measure"))}}:{},...(r=i.derivedFields)!=null&&r.length?{derivedFields:i.derivedFields}:{}}}function B(i){return i.map(t=>{const n=o(t);if(!n.role)throw new Error(`semaphor.records field "${n.name}" needs an explicit role.`);return n})}function x(i){var n,r,a;const t=s(i);if(t.kind==="sql")throw new Error("semaphor.inputOptions requires a semantic or physical option source.");return{version:1,kind:"inputOptions",id:i.id,label:i.label,inputId:i.inputId,source:t,labelField:o(i.labelField,"dimension"),valueField:o(i.valueField,"dimension"),...i.searchField?{searchField:o(i.searchField,"dimension")}:{},...(n=i.disambiguationFields)!=null&&n.length?{disambiguationFields:i.disambiguationFields.map(e=>o(e,"dimension"))}:{},...i.population?{population:i.population}:{},...i.dependencies?{dependencies:i.dependencies}:{},search:i.search,limit:i.limit,...(r=i.inputs)!=null&&r.length?{inputs:i.inputs.map(e=>f(e))}:{},...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function O(i){var t;return{version:1,kind:"sql",id:i.id,label:i.label,source:i.source,sql:i.sql,...i.defaultParameters?{defaultParameters:i.defaultParameters}:{},...i.pythonCode?{pythonCode:i.pythonCode}:{},...(t=i.fields)!=null&&t.length?{fields:i.fields.map(n=>o(n))}:{},inputs:l(i.inputs),limit:i.limit,...i.pagination?{pagination:i.pagination}:{},rationale:i.rationale}}function P(i){var t,n;return{version:1,kind:"matrix",id:i.id,label:i.label,source:s(i),rows:i.rows.map(r=>g(r,"dimension")),columns:(i.columns??[]).map(r=>g(r,"dimension")),values:i.values.map(q),...(t=i.filters)!=null&&t.length?{filters:i.filters}:{},inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},...i.totals?{totals:i.totals}:{},...(n=i.sort)!=null&&n.length?{sort:i.sort}:{},...i.expansion?{expansion:i.expansion}:{},...i.layout?{layout:i.layout}:{},...i.displayLimits?{displayLimits:i.displayLimits}:{}}}function g(i,t){return z(i)?{...i,field:o(i.field,t)}:{field:o(i,t)}}function q(i){return C(i)?{...i,field:o(i.field,"measure")}:{field:o(i,"measure"),aggregate:i.aggregate}}function z(i){return"field"in i}function C(i){return"field"in i}function f(i){if("toAnalyticsInput"in i){const e=i.toAnalyticsInput();return{inputId:e.inputId,kind:e.kind,...e.controlRole?{controlRole:e.controlRole}:{},...e.operator?{operator:e.operator}:{},...e.field?{field:e.field}:{},...e.relationshipHint?{relationshipHint:e.relationshipHint}:{}}}if("id"in i){const e=h(i);return{inputId:e.inputId,kind:e.kind,...e.controlRole?{controlRole:e.controlRole}:{},...e.operator?{operator:e.operator}:{},...e.field?{field:e.field}:{},...e.relationshipHint?{relationshipHint:e.relationshipHint}:{}}}const t="kind"in i?i.kind:void 0,n="operator"in i?S(i.operator,i.inputId):void 0,r="controlRole"in i?i.controlRole:"role"in i?i.role:void 0,a=T(r)?r:void 0;return{inputId:i.inputId,...t?{kind:t}:{},...a?{controlRole:a}:{},...n?{operator:n}:{},...i.field?{field:i.field}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}function T(i){return i==="grain"||i==="measure"||i==="dimension"||i==="aggregation"||i==="sqlParam"}function E(i){const t=l(i);return t.length>0?t:void 0}function y(i){return(i||[]).map(L)}function W(i){return y(i).filter(t=>t.isActive)}function h(i){if(i.kind==="filter"){const t=S(i.operator,i.id);return{inputId:i.id,kind:i.kind,label:i.label,field:o(i.field,"dimension"),operator:t||"in",...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}return{inputId:i.id,kind:i.kind,label:i.label,controlRole:i.role}}function $(i=[]){return i.map(t=>typeof t=="object"?t:{label:String(t),value:t})}function m(i){return i==null?!1:Array.isArray(i)?i.length>0:typeof i=="string"?i.trim().length>0:!0}function L(i){if("toAnalyticsInput"in i)return i.toAnalyticsInput();if("kind"in i&&"isActive"in i)return i;if("id"in i){const t=h(i),n=Object.prototype.hasOwnProperty.call(i,"value")?i.value:i.defaultValue;return{inputId:t.inputId,kind:t.kind,label:t.label,...t.field?{field:t.field}:{},...t.operator?{operator:t.operator}:{},...t.controlRole?{controlRole:t.controlRole}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},value:n,isActive:m(n)}}return{...i,kind:"filter",isActive:m(i.value),value:i.value}}function s(i){return i.source}function V(i){var t;return!!((t=i.fields)!=null&&t.length)}function o(i,t){return{...i,role:i.role||t}}function l(i){return(i||[]).map(f)}function G(i){if(i)return i}function S(i,t){if(i===void 0)return;const n=c.normalizeSemaphorInputOperator(i);if(!n)throw new Error(`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`);return n}exports.hasSemaphorInputValue=m;exports.normalizeSemaphorInputOptions=$;exports.toSemaphorActiveInputSnapshots=W;exports.toSemaphorAnalysisIntent=v;exports.toSemaphorAnalysisQueryOptions=F;exports.toSemaphorInputBinding=f;exports.toSemaphorInputBindings=E;exports.toSemaphorInputOptionsIntent=x;exports.toSemaphorInputSnapshots=y;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=P;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=A;exports.toSemaphorSqlIntent=O;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as m, p as I, c as p } from "../chunks/validators-
|
|
1
|
+
import { s as m, p as I, c as p } from "../chunks/validators-D3AarM2T.js";
|
|
2
2
|
import { n as c } from "../chunks/operators-C8TxpM4C.js";
|
|
3
|
-
import "../chunks/analyze-result-contract-
|
|
3
|
+
import "../chunks/analyze-result-contract-DsiAzCYn.js";
|
|
4
4
|
import "../value-format-preferences/index.js";
|
|
5
5
|
function F(i) {
|
|
6
6
|
var n, e, a;
|