react-semaphor 0.1.454 → 0.1.455
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/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-SYroFdae.js → dashboard-briefing-launcher-BgBMjAVe.js} +3 -3
- package/dist/chunks/{dashboard-briefing-launcher-Dwj1i7lr.cjs → dashboard-briefing-launcher-BmEHYblf.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-CpFoh7-A.cjs → dashboard-controls-BLNG_zHC.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-1LpeU2sz.js → dashboard-controls-C-23EDdr.js} +4 -4
- package/dist/chunks/{dashboard-json-DwSQopc_.cjs → dashboard-json-BJ_Z9EaL.cjs} +1 -1
- package/dist/chunks/{dashboard-json-D-T-sQxU.js → dashboard-json-BTF-1Iwa.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BEmoQAET.cjs → edit-dashboard-visual-CR832BJc.cjs} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DqxUq4Bs.js → edit-dashboard-visual-Mw-ZE7P7.js} +3 -3
- package/dist/chunks/{editor-action-buttons-18r2xwei.cjs → editor-action-buttons-BVigIMg0.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-B2l3WIRC.js → editor-action-buttons-BxbFCerU.js} +2 -2
- package/dist/chunks/{index-DAoS4BNU.js → index-B5Oy1eLv.js} +5316 -5297
- package/dist/chunks/index-C99Ow35Y.cjs +4 -0
- package/dist/chunks/{index-CLB_NGZ8.cjs → index-DIWJALWL.cjs} +61 -61
- package/dist/chunks/{index-Ca784dpx.js → index-DrYILnh0.js} +796 -806
- package/dist/chunks/{report-preferences-dialog-BgSvlDXa.cjs → report-preferences-dialog-BgE3Gzsp.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-DDc2WUa0.js → report-preferences-dialog-CFenWkcH.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings.d.ts +0 -5
- package/dist/types/dashboard-assistant.d.ts +0 -5
- package/dist/types/dashboard-authoring.d.ts +0 -5
- package/dist/types/dashboard.d.ts +0 -5
- package/dist/types/main.d.ts +0 -5
- package/dist/types/shared.d.ts +0 -5
- package/dist/types/surfboard.d.ts +0 -5
- package/dist/types/types.d.ts +0 -5
- package/package.json +1 -1
- package/dist/chunks/index-Bn5wlkHt.cjs +0 -4
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var Je = Object.defineProperty;
|
|
2
2
|
var Qe = (e, r, t) => r in e ? Je(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
-
var
|
|
4
|
-
import { E as Xe, C as et, q as tt, D as rt, A as J, u as q, o as nt, M as ot, w as at, R as it, i as
|
|
3
|
+
var _ = (e, r, t) => Qe(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { E as Xe, C as et, q as tt, D as rt, A as J, u as q, o as nt, M as ot, w as at, R as it, i as Ce, b as ct, m as lt, P as U } from "./pivot-result-lifecycle-sjzIOpvp.js";
|
|
5
5
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as de } from "../value-format-preferences/index.js";
|
|
6
|
-
import { n as
|
|
6
|
+
import { n as Te, q as dt, x as ae } from "./validators-DEmd8Sin.js";
|
|
7
7
|
import "./analyze-result-contract-BbRJ-C06.js";
|
|
8
|
-
import { h as $e, r as ke, a as Ee, v as
|
|
9
|
-
import { r as z, b as
|
|
10
|
-
import { v as
|
|
11
|
-
import { f as
|
|
12
|
-
import { r as Se, s as
|
|
8
|
+
import { h as $e, r as ke, a as Ee, v as st, i as mt } from "./saved-temporal-bucket-format-SGAV0ivR.js";
|
|
9
|
+
import { r as z, b as ut, d as ft, P as pt } from "./pivot-result-identity-DU1v-5Xk.js";
|
|
10
|
+
import { v as yt, a as ht } from "./temporal-bucket-contract-D5d-xEl3.js";
|
|
11
|
+
import { f as gt, T as vt, k as xe, i as bt } from "./temporal-bucket-5UYEotyQ.js";
|
|
12
|
+
import { r as Se, s as It, i as wt, a as Ct, b as Tt, c as $t } from "./canonical-result-keys-D6avdjpA.js";
|
|
13
13
|
import "./temporal-bucket-authoring-K1kE6R_z.js";
|
|
14
14
|
import { v as _e } from "./raw-temporal-contract-CxncLze5.js";
|
|
15
|
-
const
|
|
15
|
+
const kt = `import pandas as pd
|
|
16
16
|
df = pd.DataFrame(data) # 'data' contains the query result
|
|
17
17
|
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
18
18
|
`;
|
|
19
|
-
function
|
|
19
|
+
function hn(e) {
|
|
20
20
|
return {
|
|
21
21
|
databaseName: (e == null ? void 0 : e.lastSelectedDatabase) || "",
|
|
22
22
|
schemaName: (e == null ? void 0 : e.lastSelectedSchema) || "",
|
|
@@ -25,7 +25,7 @@ function vn(e) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
function H(e) {
|
|
28
|
-
return e ===
|
|
28
|
+
return e === kt ? "" : e;
|
|
29
29
|
}
|
|
30
30
|
function Q(e, r = e.config) {
|
|
31
31
|
return Se({
|
|
@@ -34,26 +34,26 @@ function Q(e, r = e.config) {
|
|
|
34
34
|
normalizedPython: H(e.python || "")
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
class
|
|
37
|
+
class Et extends Error {
|
|
38
38
|
constructor(t) {
|
|
39
39
|
super(
|
|
40
40
|
`ambiguous_temporal_grain: Temporal field "${t}" has saved presentation but no valid grouping grain. Reconfigure and resave the field.`
|
|
41
41
|
);
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
_(this, "code", "ambiguous_temporal_grain");
|
|
43
|
+
_(this, "fieldId");
|
|
44
44
|
this.name = "AmbiguousGroupedTemporalGrainError", this.fieldId = t;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function xt(e) {
|
|
48
48
|
return Ee(e) || e.semanticTemporalPresentation != null;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function St(e) {
|
|
51
51
|
if (!e.id || !["date", "datetime"].includes(
|
|
52
|
-
|
|
52
|
+
Te(e.dataType)
|
|
53
53
|
))
|
|
54
54
|
return;
|
|
55
|
-
if (
|
|
56
|
-
if (!
|
|
55
|
+
if (dt(e.granularity)) return e;
|
|
56
|
+
if (!xt(e)) return;
|
|
57
57
|
if (!ke({
|
|
58
58
|
fieldId: e.id,
|
|
59
59
|
dataType: e.dataType,
|
|
@@ -62,7 +62,7 @@ function _t(e) {
|
|
|
62
62
|
dateFormat: e.dateFormat,
|
|
63
63
|
customFormat: e.customFormat
|
|
64
64
|
}).ok)
|
|
65
|
-
throw new
|
|
65
|
+
throw new Et(e.id);
|
|
66
66
|
return { ...e, granularity: "day" };
|
|
67
67
|
}
|
|
68
68
|
function se(e) {
|
|
@@ -87,77 +87,77 @@ function se(e) {
|
|
|
87
87
|
cardType: e.card.type,
|
|
88
88
|
cardConfig: r,
|
|
89
89
|
fields: t.flatMap((n) => {
|
|
90
|
-
const o =
|
|
90
|
+
const o = St(n);
|
|
91
91
|
return o ? [o] : [];
|
|
92
92
|
})
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function gn(e) {
|
|
96
96
|
return se({
|
|
97
97
|
...e,
|
|
98
98
|
supportsCardType: (r) => r === "table"
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function vn(e) {
|
|
102
102
|
return se({
|
|
103
103
|
...e,
|
|
104
|
-
supportsCardType:
|
|
104
|
+
supportsCardType: wt
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function _t(e) {
|
|
108
108
|
return se({
|
|
109
109
|
...e,
|
|
110
110
|
// Raw detail-table presentation has its own result/adapter contract.
|
|
111
111
|
// This module remains grouped-only even though the shared producer
|
|
112
112
|
// registry now recognizes detailTable.
|
|
113
|
-
supportsCardType: (r) => r !== "detailTable" &&
|
|
113
|
+
supportsCardType: (r) => r !== "detailTable" && It(r)
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
function
|
|
118
|
-
const r =
|
|
116
|
+
const ge = /* @__PURE__ */ new WeakMap();
|
|
117
|
+
function Ft(e) {
|
|
118
|
+
const r = ge.get(e);
|
|
119
119
|
if (r) return r;
|
|
120
120
|
const t = Xe(e);
|
|
121
|
-
return
|
|
121
|
+
return ge.set(e, t), t;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function V(e, r) {
|
|
124
124
|
const t = e ?? [], n = r ?? [];
|
|
125
125
|
return t.length === n.length && t.every((o, a) => o === n[a]);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Rt(e, r) {
|
|
128
128
|
const t = et({
|
|
129
129
|
groupByFields: r.groupByColumns,
|
|
130
130
|
metricFields: r.metricColumns,
|
|
131
131
|
pivotByFields: r.pivotByColumns,
|
|
132
132
|
detailFields: r.detailColumns
|
|
133
133
|
});
|
|
134
|
-
return
|
|
134
|
+
return V(
|
|
135
135
|
e.expectedRoleFieldIds.groupby,
|
|
136
136
|
t.expectedRoleFieldIds.groupby
|
|
137
|
-
) &&
|
|
137
|
+
) && V(
|
|
138
138
|
e.expectedRoleFieldIds.metric,
|
|
139
139
|
t.expectedRoleFieldIds.metric
|
|
140
|
-
) &&
|
|
140
|
+
) && V(
|
|
141
141
|
e.expectedRoleFieldIds.pivotby,
|
|
142
142
|
t.expectedRoleFieldIds.pivotby
|
|
143
|
-
) &&
|
|
143
|
+
) && V(
|
|
144
144
|
e.expectedRoleFieldIds.detail,
|
|
145
145
|
t.expectedRoleFieldIds.detail
|
|
146
|
-
) &&
|
|
146
|
+
) && V(
|
|
147
147
|
e.expectedMetricAliases,
|
|
148
148
|
t.expectedMetricAliases
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class At extends Error {
|
|
152
152
|
constructor(t) {
|
|
153
153
|
super(
|
|
154
154
|
`missing_resolved_temporal_format: Saved presentation is missing temporal field "${t.fieldId}" for card "${t.cardId}". Resave the report or Briefing to capture the current dashboard presentation.`
|
|
155
155
|
);
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
_(this, "code", "missing_resolved_temporal_format");
|
|
157
|
+
_(this, "deliveryBlocking", !0);
|
|
158
|
+
_(this, "dashboardId");
|
|
159
|
+
_(this, "cardId");
|
|
160
|
+
_(this, "fieldId");
|
|
161
161
|
this.name = "MissingResolvedTemporalPresentationError", this.dashboardId = t.dashboardId, this.cardId = t.cardId, this.fieldId = t.fieldId;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -166,31 +166,31 @@ class ee extends Error {
|
|
|
166
166
|
super(
|
|
167
167
|
`missing_temporal_bucket_metadata: Result column "${t.columnKey}" is missing temporal bucket metadata for field "${t.fieldId}" on card "${t.cardId}". Refresh the report and resave the delivery if the problem persists.`
|
|
168
168
|
);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
_(this, "code", "missing_temporal_bucket_metadata");
|
|
170
|
+
_(this, "deliveryBlocking", !0);
|
|
171
|
+
_(this, "cardId");
|
|
172
|
+
_(this, "fieldId");
|
|
173
|
+
_(this, "columnKey");
|
|
174
174
|
this.name = "MissingTemporalResultMetadataError", this.cardId = t.cardId, this.fieldId = t.fieldId, this.columnKey = t.columnKey;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
class
|
|
177
|
+
class O extends Error {
|
|
178
178
|
constructor(t, n, o) {
|
|
179
179
|
super(`${t}: ${n}`);
|
|
180
|
-
|
|
180
|
+
_(this, "deliveryBlocking", !0);
|
|
181
181
|
this.code = t, this.context = o, this.name = "DashboardTemporalBoundaryError";
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
function Fe(e, r) {
|
|
185
185
|
return `${r}:${e}`;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function Bt(e) {
|
|
188
188
|
var r, t;
|
|
189
189
|
return (t = (r = e.presentation) == null ? void 0 : r.byFieldRole) == null ? void 0 : t.get(
|
|
190
190
|
Fe(e.fieldId, e.role)
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Pt(e) {
|
|
194
194
|
var t;
|
|
195
195
|
if ((((t = e.cardConfig.metricColumns) == null ? void 0 : t.length) || 0) > 0 || e.binding.role !== "metric")
|
|
196
196
|
return !1;
|
|
@@ -202,7 +202,7 @@ function Mt(e) {
|
|
|
202
202
|
}
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function bn(e, r) {
|
|
206
206
|
return !r || r.byColumnKey.size === 0 ? e.map((t) => ({ ...t })) : e.map((t) => {
|
|
207
207
|
const n = { ...t };
|
|
208
208
|
return r.byColumnKey.forEach((o, a) => {
|
|
@@ -213,8 +213,8 @@ function wn(e, r) {
|
|
|
213
213
|
}), n;
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
var
|
|
216
|
+
function In(e) {
|
|
217
|
+
var u;
|
|
218
218
|
if (!e.result || typeof e.result != "object") return !1;
|
|
219
219
|
const r = e.result;
|
|
220
220
|
if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner)
|
|
@@ -225,8 +225,8 @@ function Cn(e) {
|
|
|
225
225
|
const n = Array.isArray(r.records) ? r.records.length : void 0, o = (t.cardConfig.pivotByColumns || []).map((d) => d.id);
|
|
226
226
|
if (t.cardType === "pivotTable")
|
|
227
227
|
try {
|
|
228
|
-
const d =
|
|
229
|
-
if (!
|
|
228
|
+
const d = Ft(r);
|
|
229
|
+
if (!Rt(
|
|
230
230
|
d.pivotResultContract,
|
|
231
231
|
t.cardConfig
|
|
232
232
|
))
|
|
@@ -239,10 +239,10 @@ function Cn(e) {
|
|
|
239
239
|
var g;
|
|
240
240
|
return (((g = w.pivotIdentity) == null ? void 0 : g.members.length) ?? 0) > 0;
|
|
241
241
|
}
|
|
242
|
-
),
|
|
242
|
+
), b = v.length > 0 && v.every(
|
|
243
243
|
(w) => {
|
|
244
244
|
var g;
|
|
245
|
-
return ((g = w.pivotIdentity) == null ? void 0 : g.members.length) === 0 &&
|
|
245
|
+
return ((g = w.pivotIdentity) == null ? void 0 : g.members.length) === 0 && ut({
|
|
246
246
|
expectedPivotFieldIds: o,
|
|
247
247
|
classification: d.pivotResultContract.columnClassifications[w.key]
|
|
248
248
|
});
|
|
@@ -257,25 +257,25 @@ function Cn(e) {
|
|
|
257
257
|
);
|
|
258
258
|
if (!g) return !1;
|
|
259
259
|
if (g.role === "pivotby") {
|
|
260
|
-
const
|
|
261
|
-
(
|
|
262
|
-
var
|
|
263
|
-
return ((
|
|
260
|
+
const S = h.flatMap(
|
|
261
|
+
(A) => {
|
|
262
|
+
var L;
|
|
263
|
+
return ((L = A.pivotIdentity) == null ? void 0 : L.members.filter(
|
|
264
264
|
(Ze) => Ze.fieldId === w.id
|
|
265
265
|
)) ?? [];
|
|
266
266
|
}
|
|
267
267
|
);
|
|
268
|
-
return
|
|
269
|
-
(
|
|
270
|
-
var
|
|
271
|
-
return ((
|
|
268
|
+
return S.length === 0 ? b : S.every(
|
|
269
|
+
(A) => {
|
|
270
|
+
var L;
|
|
271
|
+
return ((L = A.temporalBucket) == null ? void 0 : L.granularity) === w.granularity;
|
|
272
272
|
}
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
|
-
const
|
|
276
|
-
(
|
|
275
|
+
const C = d.columns.find(
|
|
276
|
+
(S) => S.key === (g.outputKey || g.rawKey)
|
|
277
277
|
);
|
|
278
|
-
return ((E =
|
|
278
|
+
return ((E = C == null ? void 0 : C.temporalBucket) == null ? void 0 : E.granularity) === w.granularity;
|
|
279
279
|
});
|
|
280
280
|
} catch (d) {
|
|
281
281
|
if (d instanceof rt) return !1;
|
|
@@ -313,7 +313,7 @@ function Cn(e) {
|
|
|
313
313
|
"metric"
|
|
314
314
|
);
|
|
315
315
|
if (c) {
|
|
316
|
-
if (!
|
|
316
|
+
if (!Pt({
|
|
317
317
|
cardConfig: t.cardConfig,
|
|
318
318
|
binding: c,
|
|
319
319
|
columns: r.columns || []
|
|
@@ -329,7 +329,7 @@ function Cn(e) {
|
|
|
329
329
|
))
|
|
330
330
|
return !1;
|
|
331
331
|
try {
|
|
332
|
-
|
|
332
|
+
ft(
|
|
333
333
|
(r.columns || []).map((d) => ({
|
|
334
334
|
key: d.key,
|
|
335
335
|
pivotIdentity: d.pivotIdentity
|
|
@@ -340,15 +340,15 @@ function Cn(e) {
|
|
|
340
340
|
}
|
|
341
341
|
);
|
|
342
342
|
} catch (d) {
|
|
343
|
-
if (d instanceof
|
|
343
|
+
if (d instanceof pt) return !1;
|
|
344
344
|
throw d;
|
|
345
345
|
}
|
|
346
|
-
const
|
|
346
|
+
const f = (r.columns || []).filter((d) => {
|
|
347
347
|
const v = d.pivotIdentity;
|
|
348
348
|
return !!(v && v.members.length > 0);
|
|
349
349
|
});
|
|
350
|
-
return n !== 0 && ((
|
|
351
|
-
var
|
|
350
|
+
return n !== 0 && ((u = t.cardConfig.pivotByColumns) != null && u.length) && f.length === 0 ? !1 : t.fields.every((d) => {
|
|
351
|
+
var b;
|
|
352
352
|
const v = z(
|
|
353
353
|
a,
|
|
354
354
|
d.id,
|
|
@@ -356,21 +356,21 @@ function Cn(e) {
|
|
|
356
356
|
);
|
|
357
357
|
if (!v) return !1;
|
|
358
358
|
if (v.role === "pivotby") {
|
|
359
|
-
const g =
|
|
360
|
-
(
|
|
359
|
+
const g = f.flatMap(
|
|
360
|
+
(C) => {
|
|
361
361
|
var E;
|
|
362
|
-
return ((E =
|
|
362
|
+
return ((E = C.pivotIdentity) == null ? void 0 : E.members) ?? [];
|
|
363
363
|
}
|
|
364
|
-
).filter((
|
|
365
|
-
return
|
|
366
|
-
(
|
|
364
|
+
).filter((C) => C.fieldId === d.id);
|
|
365
|
+
return f.length === 0 ? n === 0 : g.length > 0 && g.every(
|
|
366
|
+
(C) => {
|
|
367
367
|
var E;
|
|
368
|
-
return ((E =
|
|
368
|
+
return ((E = C.temporalBucket) == null ? void 0 : E.granularity) === d.granularity;
|
|
369
369
|
}
|
|
370
370
|
);
|
|
371
371
|
}
|
|
372
372
|
const h = m.get(v.outputKey || v.rawKey);
|
|
373
|
-
return ((
|
|
373
|
+
return ((b = h == null ? void 0 : h.temporalBucket) == null ? void 0 : b.granularity) === d.granularity;
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
376
|
function Z(e, r) {
|
|
@@ -393,7 +393,7 @@ function Z(e, r) {
|
|
|
393
393
|
if (!o.ok) throw new Error(o.error.code);
|
|
394
394
|
return o.format;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function Mt(e, r, t = de) {
|
|
397
397
|
const n = Z(e, "card"), o = Z(e, "semantic"), a = e.semanticTemporalPresentation;
|
|
398
398
|
return xe({
|
|
399
399
|
metadata: r,
|
|
@@ -411,7 +411,7 @@ function Dt(e, r, t = de) {
|
|
|
411
411
|
}
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function Dt(e, r = bt, t = "en-US") {
|
|
415
415
|
var i;
|
|
416
416
|
const n = Z(e, "card"), o = ((i = e.semanticTemporalPresentation) == null ? void 0 : i.granularity) === e.granularity ? Z(e, "semantic") : void 0, a = n && n.presentation.mode !== "auto" ? n : o && o.presentation.mode !== "auto" ? o : {
|
|
417
417
|
presentation: { mode: "auto" }
|
|
@@ -426,7 +426,7 @@ function Ot(e, r = It, t = "en-US") {
|
|
|
426
426
|
presentation: a.presentation
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function wn(e) {
|
|
430
430
|
const r = e.activation;
|
|
431
431
|
if (!r)
|
|
432
432
|
return {
|
|
@@ -447,14 +447,14 @@ function Tn(e) {
|
|
|
447
447
|
Fe(c.id, c.role),
|
|
448
448
|
s
|
|
449
449
|
), i.get(c.id) === 1 && o.set(c.id, s);
|
|
450
|
-
}, m = (c, s,
|
|
450
|
+
}, m = (c, s, f) => {
|
|
451
451
|
if (s.granularity !== c.granularity)
|
|
452
|
-
throw new
|
|
452
|
+
throw new O(
|
|
453
453
|
"invalid_temporal_bucket_metadata",
|
|
454
|
-
`Result identity "${
|
|
455
|
-
{ cardId: e.card.id, fieldId: c.id, columnKey:
|
|
454
|
+
`Result identity "${f}" declares ${s.granularity} buckets for active ${c.granularity} field "${c.id}".`,
|
|
455
|
+
{ cardId: e.card.id, fieldId: c.id, columnKey: f }
|
|
456
456
|
);
|
|
457
|
-
const
|
|
457
|
+
const u = e.executionSnapshot && e.dashboardId ? tt({
|
|
458
458
|
snapshot: e.executionSnapshot,
|
|
459
459
|
scope: {
|
|
460
460
|
dashboardId: e.dashboardId,
|
|
@@ -467,25 +467,25 @@ function Tn(e) {
|
|
|
467
467
|
role: c.role
|
|
468
468
|
}
|
|
469
469
|
}) : void 0;
|
|
470
|
-
if (e.executionSnapshot && !
|
|
471
|
-
throw new
|
|
470
|
+
if (e.executionSnapshot && !u)
|
|
471
|
+
throw new At({
|
|
472
472
|
dashboardId: e.dashboardId,
|
|
473
473
|
cardId: e.card.id,
|
|
474
474
|
fieldId: c.id
|
|
475
475
|
});
|
|
476
476
|
return {
|
|
477
|
-
columnKey:
|
|
477
|
+
columnKey: f,
|
|
478
478
|
fieldId: c.id,
|
|
479
479
|
role: c.role,
|
|
480
480
|
metadata: s,
|
|
481
|
-
resolved:
|
|
481
|
+
resolved: u ? xe({
|
|
482
482
|
metadata: s,
|
|
483
|
-
cardFormat:
|
|
484
|
-
locale:
|
|
485
|
-
...
|
|
486
|
-
styles:
|
|
483
|
+
cardFormat: u,
|
|
484
|
+
locale: u.locale,
|
|
485
|
+
...u.presentation.mode === "auto" ? {
|
|
486
|
+
styles: u.presentation.styles
|
|
487
487
|
} : {}
|
|
488
|
-
}) :
|
|
488
|
+
}) : Mt(
|
|
489
489
|
c,
|
|
490
490
|
s,
|
|
491
491
|
e.valueFormatPreferences ?? de
|
|
@@ -501,7 +501,7 @@ function Tn(e) {
|
|
|
501
501
|
if (!s) {
|
|
502
502
|
if (e.columns === void 0 && e.columnKeyMap === void 0 && (e.resultRowCount === void 0 || e.resultRowCount === 0))
|
|
503
503
|
continue;
|
|
504
|
-
throw new
|
|
504
|
+
throw new O(
|
|
505
505
|
"missing_temporal_column_binding",
|
|
506
506
|
`Activated temporal field "${c.id}" has no authoritative result-column binding.`,
|
|
507
507
|
{ cardId: e.card.id, fieldId: c.id, columnKey: c.name }
|
|
@@ -510,13 +510,13 @@ function Tn(e) {
|
|
|
510
510
|
if (s.role === "pivotby") {
|
|
511
511
|
const h = (e.columns || []).filter(
|
|
512
512
|
(E) => E.pivotIdentity !== void 0
|
|
513
|
-
),
|
|
513
|
+
), b = h.flatMap(
|
|
514
514
|
(E) => {
|
|
515
|
-
var
|
|
516
|
-
return (((
|
|
515
|
+
var S;
|
|
516
|
+
return (((S = E.pivotIdentity) == null ? void 0 : S.members) || []).filter((A) => A.fieldId === c.id).map((A) => ({ column: E, member: A }));
|
|
517
517
|
}
|
|
518
518
|
);
|
|
519
|
-
if (
|
|
519
|
+
if (b.length === 0) {
|
|
520
520
|
if (h.length === 0 && (e.card.type !== "pivotTable" || e.resultRowCount === 0))
|
|
521
521
|
continue;
|
|
522
522
|
throw new ee({
|
|
@@ -525,18 +525,18 @@ function Tn(e) {
|
|
|
525
525
|
columnKey: s.outputKey || s.rawKey
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
|
-
const w =
|
|
528
|
+
const w = b[0];
|
|
529
529
|
if (!w.member.temporalBucket)
|
|
530
530
|
throw new ee({
|
|
531
531
|
cardId: e.card.id,
|
|
532
532
|
fieldId: c.id,
|
|
533
533
|
columnKey: w.column.key
|
|
534
534
|
});
|
|
535
|
-
const g =
|
|
535
|
+
const g = yt(
|
|
536
536
|
w.member.temporalBucket
|
|
537
537
|
);
|
|
538
538
|
if (!g.ok || !g.value)
|
|
539
|
-
throw new
|
|
539
|
+
throw new O(
|
|
540
540
|
"invalid_temporal_bucket_metadata",
|
|
541
541
|
g.ok ? `Pivot result column "${w.column.key}" has no validated temporal bucket metadata.` : g.error.message,
|
|
542
542
|
{
|
|
@@ -545,49 +545,49 @@ function Tn(e) {
|
|
|
545
545
|
columnKey: w.column.key
|
|
546
546
|
}
|
|
547
547
|
);
|
|
548
|
-
const
|
|
548
|
+
const C = m(
|
|
549
549
|
c,
|
|
550
550
|
g.value,
|
|
551
551
|
w.column.key
|
|
552
552
|
);
|
|
553
|
-
for (const { column: E, member:
|
|
554
|
-
if (!
|
|
555
|
-
throw new
|
|
553
|
+
for (const { column: E, member: S } of b)
|
|
554
|
+
if (!S.temporalBucket || JSON.stringify(S.temporalBucket) !== JSON.stringify(w.member.temporalBucket))
|
|
555
|
+
throw new O(
|
|
556
556
|
"invalid_temporal_bucket_metadata",
|
|
557
557
|
`Pivot result column "${E.key}" has contradictory bucket metadata for field "${c.id}".`,
|
|
558
558
|
{ cardId: e.card.id, fieldId: c.id, columnKey: E.key }
|
|
559
559
|
);
|
|
560
|
-
l(c,
|
|
560
|
+
l(c, C);
|
|
561
561
|
continue;
|
|
562
562
|
}
|
|
563
|
-
const
|
|
564
|
-
if (!(
|
|
563
|
+
const f = s.outputKey || s.rawKey, u = t.get(f);
|
|
564
|
+
if (!(u != null && u.temporalBucket))
|
|
565
565
|
throw new ee({
|
|
566
566
|
cardId: e.card.id,
|
|
567
567
|
fieldId: c.id,
|
|
568
|
-
columnKey:
|
|
568
|
+
columnKey: f
|
|
569
569
|
});
|
|
570
|
-
const d =
|
|
570
|
+
const d = ht(u, {
|
|
571
571
|
metadataRequired: !0
|
|
572
572
|
});
|
|
573
573
|
if (!d.ok || !d.value)
|
|
574
|
-
throw new
|
|
574
|
+
throw new O(
|
|
575
575
|
"invalid_temporal_bucket_metadata",
|
|
576
|
-
d.ok ? `Result column "${
|
|
577
|
-
{ cardId: e.card.id, fieldId: c.id, columnKey:
|
|
576
|
+
d.ok ? `Result column "${f}" has no validated temporal bucket metadata.` : d.error.message,
|
|
577
|
+
{ cardId: e.card.id, fieldId: c.id, columnKey: f }
|
|
578
578
|
);
|
|
579
579
|
const v = m(
|
|
580
580
|
c,
|
|
581
581
|
d.value,
|
|
582
|
-
|
|
582
|
+
f
|
|
583
583
|
);
|
|
584
|
-
n.set(
|
|
584
|
+
n.set(f, v), l(c, v);
|
|
585
585
|
}
|
|
586
586
|
return { byColumnKey: n, byFieldId: o, byFieldRole: a };
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function Cn(e) {
|
|
589
589
|
var t, n;
|
|
590
|
-
const r = e.role ?
|
|
590
|
+
const r = e.role ? Bt({
|
|
591
591
|
presentation: e.presentation,
|
|
592
592
|
fieldId: e.fieldId,
|
|
593
593
|
role: e.role
|
|
@@ -600,7 +600,7 @@ function $n(e) {
|
|
|
600
600
|
function Re(e) {
|
|
601
601
|
if (e.value === null || e.value === void 0) return "(Blank)";
|
|
602
602
|
if (typeof e.value != "string")
|
|
603
|
-
throw new
|
|
603
|
+
throw new O(
|
|
604
604
|
"invalid_temporal_bucket_value",
|
|
605
605
|
`Canonical temporal column "${e.presentation.columnKey}" must contain a string or null.`,
|
|
606
606
|
{
|
|
@@ -609,13 +609,13 @@ function Re(e) {
|
|
|
609
609
|
}
|
|
610
610
|
);
|
|
611
611
|
try {
|
|
612
|
-
return
|
|
612
|
+
return gt({
|
|
613
613
|
value: e.value,
|
|
614
614
|
metadata: e.presentation.metadata,
|
|
615
615
|
format: e.presentation.resolved.format
|
|
616
616
|
});
|
|
617
617
|
} catch (r) {
|
|
618
|
-
throw r instanceof
|
|
618
|
+
throw r instanceof vt ? new O(
|
|
619
619
|
r.code,
|
|
620
620
|
r.message,
|
|
621
621
|
{
|
|
@@ -709,7 +709,7 @@ function me(e) {
|
|
|
709
709
|
presentation: { mode: "auto" }
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Tn(e) {
|
|
713
713
|
const r = me(e.settings);
|
|
714
714
|
if (!r)
|
|
715
715
|
throw new x(
|
|
@@ -734,24 +734,18 @@ function kn(e) {
|
|
|
734
734
|
);
|
|
735
735
|
return a.text;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function Ot(e) {
|
|
738
738
|
var t;
|
|
739
739
|
const r = e.effectiveCardConfig ?? e.card.config;
|
|
740
740
|
return Q(e.card, r) === "freeform" && !!((t = e.card.sql) != null && t.trim()) && !H(e.card.python || "").trim();
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function Nt() {
|
|
743
743
|
return {
|
|
744
744
|
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
745
745
|
byColumnKey: /* @__PURE__ */ new Map(),
|
|
746
746
|
byFieldId: /* @__PURE__ */ new Map()
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
|
-
function ue(e) {
|
|
750
|
-
var r;
|
|
751
|
-
return e.cardType === "detailTable" && e.resultOwner === "config" ? (((r = e.effectiveCardConfig) == null ? void 0 : r.detailColumns) || []).filter(
|
|
752
|
-
(t) => t.dateValueMode === "canonical"
|
|
753
|
-
) : [];
|
|
754
|
-
}
|
|
755
749
|
function ie(e, r) {
|
|
756
750
|
return e === void 0 ? { kind: "invalid", error: r } : {
|
|
757
751
|
kind: "invalid",
|
|
@@ -766,12 +760,13 @@ function ie(e, r) {
|
|
|
766
760
|
)
|
|
767
761
|
};
|
|
768
762
|
}
|
|
769
|
-
function
|
|
770
|
-
|
|
771
|
-
if (
|
|
763
|
+
function zt(e) {
|
|
764
|
+
var o;
|
|
765
|
+
if (e.cardType !== "detailTable" || e.resultOwner !== "config")
|
|
766
|
+
return { kind: "inactive" };
|
|
772
767
|
if (!e.result) return { kind: "loading" };
|
|
773
|
-
const { records:
|
|
774
|
-
if (!Array.isArray(
|
|
768
|
+
const { records: r, columns: t, columnKeyMap: n } = e.result;
|
|
769
|
+
if (!Array.isArray(r) || !Array.isArray(t) || !n)
|
|
775
770
|
return ie(
|
|
776
771
|
void 0,
|
|
777
772
|
new x(
|
|
@@ -780,61 +775,66 @@ function Vt(e) {
|
|
|
780
775
|
)
|
|
781
776
|
);
|
|
782
777
|
try {
|
|
783
|
-
const a =
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
)
|
|
790
|
-
|
|
778
|
+
const a = t.filter((s) => s.rawTemporal);
|
|
779
|
+
if (a.length === 0) return { kind: "inactive" };
|
|
780
|
+
const i = new Map(
|
|
781
|
+
(((o = e.effectiveCardConfig) == null ? void 0 : o.detailColumns) || []).map((s) => [
|
|
782
|
+
s.id,
|
|
783
|
+
s
|
|
784
|
+
])
|
|
785
|
+
), l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
786
|
+
for (const s of a) {
|
|
787
|
+
const f = Array.from(i).flatMap(
|
|
788
|
+
([C, E]) => {
|
|
789
|
+
const S = z(
|
|
790
|
+
n,
|
|
791
|
+
C,
|
|
792
|
+
"detail"
|
|
793
|
+
);
|
|
794
|
+
return S && S.role === "detail" && (S.outputKey ?? S.rawKey) === s.key ? [{ field: E, binding: S }] : [];
|
|
795
|
+
}
|
|
796
|
+
), u = f.length === 1 ? f[0] : null;
|
|
797
|
+
if (!u || typeof u.binding.rawKey != "string" || u.binding.rawKey.trim().length === 0 || u.binding.outputKey !== void 0 && (typeof u.binding.outputKey != "string" || u.binding.outputKey.trim().length === 0))
|
|
791
798
|
throw new x(
|
|
792
799
|
"missing_raw_temporal_column_binding",
|
|
793
|
-
`Raw temporal
|
|
794
|
-
{
|
|
795
|
-
);
|
|
796
|
-
const s = c.outputKey ?? c.rawKey, u = n.find((h) => h.key === s);
|
|
797
|
-
if (!u)
|
|
798
|
-
throw new x(
|
|
799
|
-
"missing_raw_temporal_result_contract",
|
|
800
|
-
`Raw temporal result column "${s}" is absent.`,
|
|
801
|
-
{ fieldId: m.id, columnKey: s }
|
|
800
|
+
`Raw temporal result column "${s.key}" does not have one valid exact detail result binding.`,
|
|
801
|
+
{ columnKey: s.key }
|
|
802
802
|
);
|
|
803
|
-
const
|
|
803
|
+
const { field: d, binding: v } = u, h = v.outputKey ?? v.rawKey, b = _e(s, {
|
|
804
804
|
metadataRequired: !0
|
|
805
805
|
});
|
|
806
|
-
if (!
|
|
806
|
+
if (!b)
|
|
807
807
|
throw new x(
|
|
808
808
|
"invalid_raw_temporal_metadata",
|
|
809
|
-
`Raw temporal result column "${
|
|
810
|
-
{ fieldId:
|
|
809
|
+
`Raw temporal result column "${h}" has no metadata.`,
|
|
810
|
+
{ fieldId: d.id, columnKey: h }
|
|
811
811
|
);
|
|
812
|
-
const
|
|
813
|
-
format: Be(
|
|
812
|
+
const w = q({
|
|
813
|
+
format: Be(d),
|
|
814
814
|
preferences: e.preferences,
|
|
815
815
|
calendar: e.calendar
|
|
816
|
-
}),
|
|
817
|
-
fieldId:
|
|
818
|
-
columnKey:
|
|
819
|
-
metadata:
|
|
820
|
-
format:
|
|
821
|
-
formatValue: J({ metadata:
|
|
816
|
+
}), g = {
|
|
817
|
+
fieldId: d.id,
|
|
818
|
+
columnKey: h,
|
|
819
|
+
metadata: b,
|
|
820
|
+
format: w,
|
|
821
|
+
formatValue: J({ metadata: b, format: w })
|
|
822
822
|
};
|
|
823
|
-
for (let
|
|
824
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
823
|
+
for (let C = 0; C < r.length; C += 1)
|
|
824
|
+
if (!Object.prototype.hasOwnProperty.call(r[C], h) || r[C][h] === void 0)
|
|
825
825
|
throw new x(
|
|
826
826
|
"missing_raw_temporal_result_contract",
|
|
827
|
-
`Raw temporal result row ${
|
|
828
|
-
{ fieldId:
|
|
827
|
+
`Raw temporal result row ${C} is missing column "${h}".`,
|
|
828
|
+
{ fieldId: d.id, columnKey: h }
|
|
829
829
|
);
|
|
830
|
-
|
|
830
|
+
l.set(h, g), m.set(d.id, g);
|
|
831
831
|
}
|
|
832
|
-
const
|
|
833
|
-
activatedColumnKeys: new Set(
|
|
834
|
-
byColumnKey:
|
|
835
|
-
byFieldId:
|
|
832
|
+
const c = {
|
|
833
|
+
activatedColumnKeys: new Set(l.keys()),
|
|
834
|
+
byColumnKey: l,
|
|
835
|
+
byFieldId: m
|
|
836
836
|
};
|
|
837
|
-
return
|
|
837
|
+
return r.length === 0 ? { kind: "loaded_empty", presentation: c } : { kind: "loaded_valid", presentation: c };
|
|
838
838
|
} catch (a) {
|
|
839
839
|
return ie(
|
|
840
840
|
a,
|
|
@@ -846,37 +846,37 @@ function Vt(e) {
|
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
function Lt(e) {
|
|
849
|
-
var n, o;
|
|
849
|
+
var n, o, a;
|
|
850
850
|
const r = e.effectiveCardConfig ?? e.card.config, t = Q(
|
|
851
851
|
e.card,
|
|
852
852
|
r
|
|
853
853
|
);
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
854
|
+
if (e.card.type === "detailTable" && t === "config") {
|
|
855
|
+
const i = !!((n = e.columns) != null && n.some((l) => l.rawTemporal));
|
|
856
|
+
return i && e.records !== void 0 && !e.columnKeyMap ? {
|
|
857
|
+
kind: "invalid",
|
|
858
|
+
error: new x(
|
|
859
|
+
"missing_raw_temporal_result_contract",
|
|
860
|
+
"Activated raw temporal detail results require records, columns, and columnKeyMap atomically."
|
|
861
|
+
)
|
|
862
|
+
} : e.records !== void 0 && !i ? { kind: "inactive" } : ve(
|
|
863
|
+
zt({
|
|
864
|
+
cardType: e.card.type,
|
|
865
|
+
resultOwner: t,
|
|
866
|
+
effectiveCardConfig: r,
|
|
867
|
+
result: e.records === void 0 || !e.columns || !e.columnKeyMap ? void 0 : {
|
|
868
|
+
records: e.records,
|
|
869
|
+
columns: e.columns,
|
|
870
|
+
columnKeyMap: e.columnKeyMap
|
|
871
|
+
},
|
|
872
|
+
preferences: e.preferences,
|
|
873
|
+
calendar: e.calendar
|
|
874
|
+
}),
|
|
875
|
+
e
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
return ve(
|
|
865
879
|
Vt({
|
|
866
|
-
cardType: e.card.type,
|
|
867
|
-
resultOwner: t,
|
|
868
|
-
effectiveCardConfig: r,
|
|
869
|
-
result: e.records === void 0 || !e.columns || !e.columnKeyMap ? void 0 : {
|
|
870
|
-
records: e.records,
|
|
871
|
-
columns: e.columns,
|
|
872
|
-
columnKeyMap: e.columnKeyMap
|
|
873
|
-
},
|
|
874
|
-
preferences: e.preferences,
|
|
875
|
-
calendar: e.calendar
|
|
876
|
-
}),
|
|
877
|
-
e
|
|
878
|
-
) : be(
|
|
879
|
-
jt({
|
|
880
880
|
resultOwner: t,
|
|
881
881
|
sql: e.card.sql,
|
|
882
882
|
normalizedPython: H(
|
|
@@ -884,33 +884,29 @@ function Lt(e) {
|
|
|
884
884
|
),
|
|
885
885
|
records: e.records,
|
|
886
886
|
columns: e.columns,
|
|
887
|
-
columnSettings: (
|
|
887
|
+
columnSettings: (a = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : a.columnSettingsMap,
|
|
888
888
|
preferences: e.preferences,
|
|
889
889
|
calendar: e.calendar
|
|
890
890
|
}),
|
|
891
891
|
e
|
|
892
892
|
);
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
var n, o;
|
|
894
|
+
function $n(e) {
|
|
895
|
+
var n, o, a;
|
|
896
896
|
const r = e.effectiveCardConfig ?? e.card.config, t = Q(
|
|
897
897
|
e.card,
|
|
898
898
|
r
|
|
899
899
|
);
|
|
900
|
-
return
|
|
901
|
-
|
|
902
|
-
resultOwner: t,
|
|
903
|
-
effectiveCardConfig: r
|
|
904
|
-
}).length > 0 ? !0 : Nt(e) ? Object.values(
|
|
905
|
-
((o = (n = e.card.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : o.columnSettingsMap) || {}
|
|
900
|
+
return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) : Ot(e) ? Object.values(
|
|
901
|
+
((a = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : a.columnSettingsMap) || {}
|
|
906
902
|
).some(
|
|
907
|
-
(
|
|
908
|
-
var
|
|
909
|
-
return
|
|
903
|
+
(i) => {
|
|
904
|
+
var l;
|
|
905
|
+
return i.type === "date" && !((l = i.dateFormat) != null && l.useRelativeTime);
|
|
910
906
|
}
|
|
911
907
|
) : !1;
|
|
912
908
|
}
|
|
913
|
-
function
|
|
909
|
+
function ve(e, r) {
|
|
914
910
|
if (!r.executionSnapshot || e.kind === "inactive" || e.kind === "loading" || e.kind === "invalid")
|
|
915
911
|
return e;
|
|
916
912
|
if (!r.dashboardId)
|
|
@@ -958,7 +954,7 @@ function be(e, r) {
|
|
|
958
954
|
}
|
|
959
955
|
};
|
|
960
956
|
}
|
|
961
|
-
function
|
|
957
|
+
function Vt(e) {
|
|
962
958
|
var t, n;
|
|
963
959
|
if (e.resultOwner !== "freeform" || !((t = e.sql) != null && t.trim()) || (n = e.normalizedPython) != null && n.trim())
|
|
964
960
|
return { kind: "inactive" };
|
|
@@ -977,26 +973,26 @@ function jt(e) {
|
|
|
977
973
|
r.map(([c]) => c)
|
|
978
974
|
), i = /* @__PURE__ */ new Map(), l = [...e.columns || []];
|
|
979
975
|
for (const [c, s] of r) {
|
|
980
|
-
const
|
|
976
|
+
const f = me(
|
|
981
977
|
s.dateFormat
|
|
982
978
|
);
|
|
983
|
-
if (!
|
|
984
|
-
const
|
|
979
|
+
if (!f) continue;
|
|
980
|
+
const u = at({
|
|
985
981
|
columnKey: c,
|
|
986
|
-
values: e.records.map((
|
|
987
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
982
|
+
values: e.records.map((b) => {
|
|
983
|
+
if (!Object.prototype.hasOwnProperty.call(b, c))
|
|
988
984
|
throw new x(
|
|
989
985
|
"missing_raw_temporal_result_contract",
|
|
990
986
|
`Declared SQL temporal column "${c}" is absent from a physical result row.`,
|
|
991
987
|
{ columnKey: c }
|
|
992
988
|
);
|
|
993
|
-
const w =
|
|
989
|
+
const w = b[c];
|
|
994
990
|
return w === null || typeof w == "string" ? w : String(w);
|
|
995
991
|
})
|
|
996
992
|
});
|
|
997
|
-
if (i.set(c,
|
|
993
|
+
if (i.set(c, u), u.status !== "classified") continue;
|
|
998
994
|
let d = l.findIndex(
|
|
999
|
-
(
|
|
995
|
+
(b) => b.key === c
|
|
1000
996
|
);
|
|
1001
997
|
if (e.columns && d < 0)
|
|
1002
998
|
throw new x(
|
|
@@ -1014,29 +1010,29 @@ function jt(e) {
|
|
|
1014
1010
|
const v = {
|
|
1015
1011
|
...l[d],
|
|
1016
1012
|
role: "date",
|
|
1017
|
-
dataType:
|
|
1018
|
-
rawTemporal:
|
|
1013
|
+
dataType: u.metadata.valueKind === "date" ? "date" : "datetime",
|
|
1014
|
+
rawTemporal: u.metadata
|
|
1019
1015
|
};
|
|
1020
1016
|
_e(v, {
|
|
1021
1017
|
metadataRequired: !0
|
|
1022
1018
|
}), l[d] = v;
|
|
1023
1019
|
const h = q({
|
|
1024
|
-
format:
|
|
1020
|
+
format: f,
|
|
1025
1021
|
preferences: e.preferences,
|
|
1026
1022
|
calendar: e.calendar
|
|
1027
1023
|
});
|
|
1028
1024
|
o.set(c, {
|
|
1029
1025
|
columnKey: c,
|
|
1030
|
-
metadata:
|
|
1026
|
+
metadata: u.metadata,
|
|
1031
1027
|
format: h,
|
|
1032
1028
|
formatValue: J({
|
|
1033
|
-
metadata:
|
|
1029
|
+
metadata: u.metadata,
|
|
1034
1030
|
format: h
|
|
1035
1031
|
})
|
|
1036
1032
|
});
|
|
1037
1033
|
}
|
|
1038
1034
|
const m = {
|
|
1039
|
-
...
|
|
1035
|
+
...Nt(),
|
|
1040
1036
|
activatedColumnKeys: a,
|
|
1041
1037
|
byColumnKey: o
|
|
1042
1038
|
};
|
|
@@ -1061,7 +1057,7 @@ function jt(e) {
|
|
|
1061
1057
|
);
|
|
1062
1058
|
}
|
|
1063
1059
|
}
|
|
1064
|
-
function
|
|
1060
|
+
function kn(e) {
|
|
1065
1061
|
if (e.value !== null && typeof e.value != "string")
|
|
1066
1062
|
return {
|
|
1067
1063
|
value: e.value,
|
|
@@ -1078,17 +1074,10 @@ function En(e) {
|
|
|
1078
1074
|
const r = e.presentation.formatValue(e.value);
|
|
1079
1075
|
return { value: e.value, label: r.text, result: r };
|
|
1080
1076
|
}
|
|
1081
|
-
function
|
|
1077
|
+
function En(e) {
|
|
1082
1078
|
if (!e.result || typeof e.result != "object") return !1;
|
|
1083
1079
|
const r = e.result;
|
|
1084
|
-
if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner)
|
|
1085
|
-
return !1;
|
|
1086
|
-
if (!Ut({
|
|
1087
|
-
card: e.card,
|
|
1088
|
-
effectiveCardConfig: e.effectiveCardConfig
|
|
1089
|
-
}))
|
|
1090
|
-
return !0;
|
|
1091
|
-
if (!Array.isArray(r.records)) return !1;
|
|
1080
|
+
if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner || !Array.isArray(r.records)) return !1;
|
|
1092
1081
|
const t = Lt({
|
|
1093
1082
|
card: e.card,
|
|
1094
1083
|
effectiveCardConfig: e.effectiveCardConfig,
|
|
@@ -1100,36 +1089,36 @@ function xn(e) {
|
|
|
1100
1089
|
});
|
|
1101
1090
|
return t.kind === "inactive" || t.kind === "loaded_empty" || t.kind === "loaded_valid";
|
|
1102
1091
|
}
|
|
1103
|
-
function
|
|
1092
|
+
function be(e) {
|
|
1104
1093
|
return !e || typeof e != "object" ? !1 : Array.isArray(e.cards);
|
|
1105
1094
|
}
|
|
1106
|
-
function
|
|
1095
|
+
function Ut(e) {
|
|
1107
1096
|
if (!e)
|
|
1108
1097
|
return null;
|
|
1109
1098
|
if (typeof e == "string")
|
|
1110
1099
|
try {
|
|
1111
1100
|
const r = JSON.parse(e);
|
|
1112
|
-
return
|
|
1101
|
+
return be(r) ? r : null;
|
|
1113
1102
|
} catch {
|
|
1114
1103
|
return null;
|
|
1115
1104
|
}
|
|
1116
|
-
return
|
|
1105
|
+
return be(e) ? e : null;
|
|
1117
1106
|
}
|
|
1118
1107
|
function Pe(e) {
|
|
1119
1108
|
var r;
|
|
1120
1109
|
return (r = e == null ? void 0 : e.cards) != null && r.length ? e.activeCardId && e.cards.find((t) => t.id === e.activeCardId) || e.cards[0] : null;
|
|
1121
1110
|
}
|
|
1122
|
-
function
|
|
1111
|
+
function xn(e) {
|
|
1123
1112
|
var t;
|
|
1124
1113
|
const r = (e == null ? void 0 : e.frameObject) ?? ((t = e == null ? void 0 : e.visual) == null ? void 0 : t.frameObject);
|
|
1125
|
-
return Pe(
|
|
1114
|
+
return Pe(Ut(r));
|
|
1126
1115
|
}
|
|
1127
|
-
function
|
|
1116
|
+
function ue(e) {
|
|
1128
1117
|
if (!(e != null && e.expectedType)) return "table";
|
|
1129
1118
|
const r = Array.isArray(e.expectedType) ? e.expectedType[0] : e.expectedType;
|
|
1130
|
-
return
|
|
1119
|
+
return qt(r) ? r : "table";
|
|
1131
1120
|
}
|
|
1132
|
-
const
|
|
1121
|
+
const jt = [
|
|
1133
1122
|
"bar",
|
|
1134
1123
|
"horizontalBar",
|
|
1135
1124
|
"line",
|
|
@@ -1161,8 +1150,8 @@ const Gt = [
|
|
|
1161
1150
|
"treemap",
|
|
1162
1151
|
"custom"
|
|
1163
1152
|
];
|
|
1164
|
-
function
|
|
1165
|
-
return
|
|
1153
|
+
function qt(e) {
|
|
1154
|
+
return jt.includes(e);
|
|
1166
1155
|
}
|
|
1167
1156
|
function G(e) {
|
|
1168
1157
|
const r = e.position;
|
|
@@ -1205,54 +1194,54 @@ function De(e, r) {
|
|
|
1205
1194
|
if (!e || e.length === 0) return;
|
|
1206
1195
|
const t = [], n = [], o = [];
|
|
1207
1196
|
e.forEach((s) => {
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1197
|
+
const f = j(s.position);
|
|
1198
|
+
f && (f.kind === "number" ? t.push(s) : f.kind === "range" ? n.push(s) : f.kind === "dynamic" && o.push(s));
|
|
1210
1199
|
});
|
|
1211
1200
|
const a = t.find((s) => {
|
|
1212
|
-
const
|
|
1213
|
-
return (
|
|
1201
|
+
const f = j(s.position);
|
|
1202
|
+
return (f == null ? void 0 : f.kind) === "number" && f.start === r;
|
|
1214
1203
|
});
|
|
1215
1204
|
if (a) return a;
|
|
1216
1205
|
const l = n.sort(
|
|
1217
|
-
(s,
|
|
1206
|
+
(s, f) => G(s) - G(f)
|
|
1218
1207
|
).find((s) => {
|
|
1219
|
-
const
|
|
1220
|
-
return (
|
|
1208
|
+
const f = j(s.position);
|
|
1209
|
+
return (f == null ? void 0 : f.kind) === "range" && r >= f.start && r <= f.end;
|
|
1221
1210
|
});
|
|
1222
1211
|
if (l) return l;
|
|
1223
1212
|
const c = o.map((s) => ({
|
|
1224
1213
|
slot: s,
|
|
1225
1214
|
parsed: j(s.position)
|
|
1226
1215
|
})).filter((s) => {
|
|
1227
|
-
var
|
|
1228
|
-
return ((
|
|
1216
|
+
var f;
|
|
1217
|
+
return ((f = s.parsed) == null ? void 0 : f.kind) === "dynamic";
|
|
1229
1218
|
}).sort(
|
|
1230
|
-
(s,
|
|
1231
|
-
var
|
|
1232
|
-
return (((
|
|
1219
|
+
(s, f) => {
|
|
1220
|
+
var u, d;
|
|
1221
|
+
return (((u = s.parsed) == null ? void 0 : u.start) ?? 0) - (((d = f.parsed) == null ? void 0 : d.start) ?? 0);
|
|
1233
1222
|
}
|
|
1234
1223
|
).filter((s) => {
|
|
1235
|
-
var
|
|
1236
|
-
return r >= (((
|
|
1224
|
+
var f;
|
|
1225
|
+
return r >= (((f = s.parsed) == null ? void 0 : f.start) ?? 0);
|
|
1237
1226
|
}).sort(
|
|
1238
|
-
(s,
|
|
1239
|
-
var
|
|
1240
|
-
return (((
|
|
1227
|
+
(s, f) => {
|
|
1228
|
+
var u, d;
|
|
1229
|
+
return (((u = f.parsed) == null ? void 0 : u.start) ?? 0) - (((d = s.parsed) == null ? void 0 : d.start) ?? 0);
|
|
1241
1230
|
}
|
|
1242
1231
|
)[0];
|
|
1243
1232
|
return c == null ? void 0 : c.slot;
|
|
1244
1233
|
}
|
|
1245
|
-
function
|
|
1234
|
+
function Gt(e, r) {
|
|
1246
1235
|
const t = De(e, r);
|
|
1247
1236
|
if (t)
|
|
1248
|
-
return
|
|
1237
|
+
return ue(t);
|
|
1249
1238
|
}
|
|
1250
|
-
function
|
|
1239
|
+
function Ht(e, r) {
|
|
1251
1240
|
var n;
|
|
1252
1241
|
const t = (n = e == null ? void 0 : e.customCardPreferences) == null ? void 0 : n.slotIndex;
|
|
1253
1242
|
return typeof t == "number" ? t : r;
|
|
1254
1243
|
}
|
|
1255
|
-
function
|
|
1244
|
+
function Ie(e, r) {
|
|
1256
1245
|
var t;
|
|
1257
1246
|
if (!((t = e == null ? void 0 : e.customCardPreferences) != null && t.url))
|
|
1258
1247
|
return !1;
|
|
@@ -1270,18 +1259,18 @@ function we(e, r) {
|
|
|
1270
1259
|
}
|
|
1271
1260
|
return !1;
|
|
1272
1261
|
}
|
|
1273
|
-
function
|
|
1262
|
+
function Wt(e) {
|
|
1274
1263
|
const r = [];
|
|
1275
1264
|
let t = -1;
|
|
1276
1265
|
e.forEach((n, o) => {
|
|
1277
|
-
const a =
|
|
1266
|
+
const a = Ht(n, o);
|
|
1278
1267
|
a > t && (t = a), r[a] = n ?? null;
|
|
1279
1268
|
});
|
|
1280
1269
|
for (let n = 0; n <= t; n += 1)
|
|
1281
1270
|
n in r || (r[n] = null);
|
|
1282
1271
|
return r;
|
|
1283
1272
|
}
|
|
1284
|
-
function
|
|
1273
|
+
function Sn(e) {
|
|
1285
1274
|
return e.map((r, t) => !r.customCardPreferences || r.customCardPreferences.slotIndex === t ? r : {
|
|
1286
1275
|
...r,
|
|
1287
1276
|
customCardPreferences: {
|
|
@@ -1290,17 +1279,17 @@ function _n(e) {
|
|
|
1290
1279
|
}
|
|
1291
1280
|
});
|
|
1292
1281
|
}
|
|
1293
|
-
function
|
|
1282
|
+
function _n(e) {
|
|
1294
1283
|
const r = Me(e);
|
|
1295
1284
|
if (r)
|
|
1296
|
-
return
|
|
1285
|
+
return ue(r);
|
|
1297
1286
|
}
|
|
1298
|
-
function
|
|
1287
|
+
function Fn(e, r, t) {
|
|
1299
1288
|
if (!e) return;
|
|
1300
|
-
const n =
|
|
1289
|
+
const n = Gt(t, r);
|
|
1301
1290
|
return e.type === "custom" && n ? n : e.type;
|
|
1302
1291
|
}
|
|
1303
|
-
function
|
|
1292
|
+
function Rn(e, r, t) {
|
|
1304
1293
|
var v;
|
|
1305
1294
|
const n = {
|
|
1306
1295
|
dataSource: t.dataSource,
|
|
@@ -1319,19 +1308,19 @@ function An(e, r, t) {
|
|
|
1319
1308
|
pluginChartType: r.chartType,
|
|
1320
1309
|
minInputs: r.minInputs,
|
|
1321
1310
|
maxInputs: r.maxInputs
|
|
1322
|
-
}, a = r.minInputs || 1, l = e.map((h) => ({ slot: h, parsed: j(h.position) })).filter((h) => h.parsed !== null).reduce((h,
|
|
1323
|
-
const w =
|
|
1311
|
+
}, a = r.minInputs || 1, l = e.map((h) => ({ slot: h, parsed: j(h.position) })).filter((h) => h.parsed !== null).reduce((h, b) => {
|
|
1312
|
+
const w = b.parsed.end;
|
|
1324
1313
|
return Number.isFinite(w) ? Math.max(h, w) : h;
|
|
1325
1314
|
}, -1), m = Math.max(a, l + 1), c = Me(e), s = c ? G(c) : 0;
|
|
1326
|
-
let
|
|
1327
|
-
const
|
|
1315
|
+
let f = !1;
|
|
1316
|
+
const u = [];
|
|
1328
1317
|
for (let h = 0; h < m; h += 1) {
|
|
1329
|
-
const
|
|
1318
|
+
const b = De(e, h), w = ue(b), g = !f && h === s, C = h, E = {
|
|
1330
1319
|
...n,
|
|
1331
|
-
id:
|
|
1332
|
-
title: (g ? c == null ? void 0 : c.label :
|
|
1333
|
-
tabTitle: (g ? c == null ? void 0 : c.label :
|
|
1334
|
-
description: (g ? c == null ? void 0 : c.description :
|
|
1320
|
+
id: st(),
|
|
1321
|
+
title: (g ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${h + 1}`,
|
|
1322
|
+
tabTitle: (g ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${h + 1}`,
|
|
1323
|
+
description: (g ? c == null ? void 0 : c.description : b == null ? void 0 : b.description) || "",
|
|
1335
1324
|
type: w,
|
|
1336
1325
|
sql: "",
|
|
1337
1326
|
preferences: {
|
|
@@ -1340,41 +1329,41 @@ function An(e, r, t) {
|
|
|
1340
1329
|
...g && {
|
|
1341
1330
|
customCardPreferences: {
|
|
1342
1331
|
...o,
|
|
1343
|
-
slotIndex:
|
|
1332
|
+
slotIndex: C
|
|
1344
1333
|
}
|
|
1345
1334
|
},
|
|
1346
1335
|
...!g && {
|
|
1347
1336
|
customCardPreferences: {
|
|
1348
|
-
slotIndex:
|
|
1337
|
+
slotIndex: C
|
|
1349
1338
|
}
|
|
1350
1339
|
}
|
|
1351
1340
|
};
|
|
1352
|
-
g && (
|
|
1341
|
+
g && (f = !0), u.push(E);
|
|
1353
1342
|
}
|
|
1354
|
-
if (!
|
|
1355
|
-
const h = ((v =
|
|
1356
|
-
|
|
1357
|
-
...
|
|
1358
|
-
type:
|
|
1343
|
+
if (!f && u.length > 0) {
|
|
1344
|
+
const h = ((v = u[0].customCardPreferences) == null ? void 0 : v.slotIndex) ?? 0;
|
|
1345
|
+
u[0] = {
|
|
1346
|
+
...u[0],
|
|
1347
|
+
type: u[0].type,
|
|
1359
1348
|
customCardPreferences: {
|
|
1360
1349
|
...o,
|
|
1361
1350
|
slotIndex: h
|
|
1362
1351
|
}
|
|
1363
1352
|
};
|
|
1364
1353
|
}
|
|
1365
|
-
const d =
|
|
1354
|
+
const d = u.findIndex(
|
|
1366
1355
|
(h) => {
|
|
1367
|
-
var
|
|
1368
|
-
return !!((
|
|
1356
|
+
var b;
|
|
1357
|
+
return !!((b = h.customCardPreferences) != null && b.url);
|
|
1369
1358
|
}
|
|
1370
1359
|
);
|
|
1371
1360
|
if (d > 0) {
|
|
1372
|
-
const [h] =
|
|
1373
|
-
|
|
1361
|
+
const [h] = u.splice(d, 1);
|
|
1362
|
+
u.unshift(h);
|
|
1374
1363
|
}
|
|
1375
|
-
return
|
|
1364
|
+
return u;
|
|
1376
1365
|
}
|
|
1377
|
-
function
|
|
1366
|
+
function Yt({
|
|
1378
1367
|
frame: e,
|
|
1379
1368
|
configCard: r,
|
|
1380
1369
|
isMultiInputVisual: t
|
|
@@ -1389,10 +1378,10 @@ function Jt({
|
|
|
1389
1378
|
return e.cards.find((m) => m.id === i) || null;
|
|
1390
1379
|
}) : e.cards;
|
|
1391
1380
|
}
|
|
1392
|
-
function
|
|
1393
|
-
return r &&
|
|
1381
|
+
function Zt(e, r) {
|
|
1382
|
+
return r && Ie(r, e.cards) ? r : e.cards.find((t) => Ie(t, e.cards)) || null;
|
|
1394
1383
|
}
|
|
1395
|
-
function
|
|
1384
|
+
function Jt(e, r) {
|
|
1396
1385
|
var o, a;
|
|
1397
1386
|
if (!e) return null;
|
|
1398
1387
|
const t = r == null ? void 0 : r.visualType;
|
|
@@ -1402,10 +1391,10 @@ function Xt(e, r) {
|
|
|
1402
1391
|
const n = (o = e.customCardPreferences) == null ? void 0 : o.visualType;
|
|
1403
1392
|
return n || ((a = e.customCardPreferences) != null && a.dataInputCardIds ? "multiple" : null);
|
|
1404
1393
|
}
|
|
1405
|
-
function
|
|
1394
|
+
function An(e) {
|
|
1406
1395
|
return e.visualType === "multiple" || e.slots && e.slots.length > 0 || (e.minInputs || 0) > 1 || (e.maxInputs || 0) > 1 || (e.dataInputs || []).length > 1 ? "multiple" : "single";
|
|
1407
1396
|
}
|
|
1408
|
-
function
|
|
1397
|
+
function Bn(e) {
|
|
1409
1398
|
return Array.isArray(e) ? { records: e } : e;
|
|
1410
1399
|
}
|
|
1411
1400
|
class W extends Error {
|
|
@@ -1414,12 +1403,12 @@ class W extends Error {
|
|
|
1414
1403
|
super(
|
|
1415
1404
|
`Unable to resolve ${n} while capturing report presentation. Refresh the authoring page and select the attachment again.`
|
|
1416
1405
|
);
|
|
1417
|
-
|
|
1418
|
-
|
|
1406
|
+
_(this, "code", "temporal_snapshot_target_not_found");
|
|
1407
|
+
_(this, "selection");
|
|
1419
1408
|
this.name = "TemporalSnapshotSelectionError", this.selection = t;
|
|
1420
1409
|
}
|
|
1421
1410
|
}
|
|
1422
|
-
function
|
|
1411
|
+
function Qt(e, r) {
|
|
1423
1412
|
var o;
|
|
1424
1413
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
1425
1414
|
for (const a of r) {
|
|
@@ -1433,25 +1422,25 @@ function er(e, r) {
|
|
|
1433
1422
|
let l = !a.cardId;
|
|
1434
1423
|
for (const m of i) {
|
|
1435
1424
|
const c = (((o = m.document) == null ? void 0 : o.sections) || []).flatMap(
|
|
1436
|
-
(
|
|
1425
|
+
(u) => u.type === "table" || u.type === "chart" ? [u.card] : []
|
|
1437
1426
|
), s = (m.frames || []).flatMap(
|
|
1438
|
-
(
|
|
1427
|
+
(u) => Xt(u, a.cardId)
|
|
1439
1428
|
);
|
|
1440
1429
|
s.length > 0 && (l = !0);
|
|
1441
|
-
const
|
|
1430
|
+
const f = [
|
|
1442
1431
|
...s,
|
|
1443
1432
|
...(m.cards || []).filter(
|
|
1444
|
-
(
|
|
1433
|
+
(u) => !a.cardId || a.cardId === u.id
|
|
1445
1434
|
),
|
|
1446
1435
|
...c.filter(
|
|
1447
|
-
(
|
|
1436
|
+
(u) => !a.cardId || a.cardId === u.id
|
|
1448
1437
|
)
|
|
1449
1438
|
];
|
|
1450
|
-
for (const
|
|
1439
|
+
for (const u of f) {
|
|
1451
1440
|
l = !0;
|
|
1452
1441
|
const d = n.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
|
|
1453
|
-
d.has(
|
|
1454
|
-
card:
|
|
1442
|
+
d.has(u.id) || (d.add(u.id), n.set(a.attachmentIndex, d), t.push({
|
|
1443
|
+
card: u,
|
|
1455
1444
|
...a.attachmentIndex !== void 0 ? { attachmentIndex: a.attachmentIndex } : {}
|
|
1456
1445
|
}));
|
|
1457
1446
|
}
|
|
@@ -1461,29 +1450,29 @@ function er(e, r) {
|
|
|
1461
1450
|
}
|
|
1462
1451
|
return t;
|
|
1463
1452
|
}
|
|
1464
|
-
function
|
|
1453
|
+
function Xt(e, r) {
|
|
1465
1454
|
var i;
|
|
1466
1455
|
const t = r ? (i = e.cards) == null ? void 0 : i.find((l) => l.id === r) : Pe(e);
|
|
1467
1456
|
if (!t) return [];
|
|
1468
|
-
const n =
|
|
1457
|
+
const n = Zt(e, t), o = (e.cards || []).filter(
|
|
1469
1458
|
(l) => {
|
|
1470
1459
|
var m;
|
|
1471
1460
|
return typeof ((m = l.customCardPreferences) == null ? void 0 : m.slotIndex) == "number";
|
|
1472
1461
|
}
|
|
1473
|
-
).length > 1, a = n != null && (
|
|
1474
|
-
return !n || !a ? [t] :
|
|
1475
|
-
|
|
1462
|
+
).length > 1, a = n != null && (Jt(n) === "multiple" || o);
|
|
1463
|
+
return !n || !a ? [t] : Wt(
|
|
1464
|
+
Yt({
|
|
1476
1465
|
frame: e,
|
|
1477
1466
|
configCard: n,
|
|
1478
1467
|
isMultiInputVisual: !0
|
|
1479
1468
|
})
|
|
1480
1469
|
).filter((l) => l !== null);
|
|
1481
1470
|
}
|
|
1482
|
-
function
|
|
1483
|
-
return
|
|
1471
|
+
function Pn(e) {
|
|
1472
|
+
return Qt(e.dashboard, e.selections).flatMap(
|
|
1484
1473
|
({ card: r, attachmentIndex: t }) => {
|
|
1485
|
-
var s,
|
|
1486
|
-
const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o =
|
|
1474
|
+
var s, f, u, d;
|
|
1475
|
+
const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o = _t({
|
|
1487
1476
|
card: r,
|
|
1488
1477
|
cardConfig: n
|
|
1489
1478
|
}), a = {
|
|
@@ -1497,7 +1486,7 @@ function Mn(e) {
|
|
|
1497
1486
|
fieldId: v.id,
|
|
1498
1487
|
role: v.role
|
|
1499
1488
|
},
|
|
1500
|
-
format:
|
|
1489
|
+
format: Dt(
|
|
1501
1490
|
v,
|
|
1502
1491
|
{
|
|
1503
1492
|
dateStyle: e.valueFormatPreferences.dateStyle,
|
|
@@ -1526,27 +1515,28 @@ function Mn(e) {
|
|
|
1526
1515
|
field: g,
|
|
1527
1516
|
role: "detail"
|
|
1528
1517
|
}))
|
|
1529
|
-
],
|
|
1518
|
+
], b = /* @__PURE__ */ new Map(), w = new Set(
|
|
1530
1519
|
h.map(
|
|
1531
|
-
({ field: g, role:
|
|
1520
|
+
({ field: g, role: C }) => Ct(g, C)
|
|
1532
1521
|
)
|
|
1533
1522
|
);
|
|
1534
1523
|
for (const { field: g } of h) {
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1524
|
+
const C = g.label;
|
|
1525
|
+
C && b.set(C, (b.get(C) || 0) + 1);
|
|
1537
1526
|
}
|
|
1538
1527
|
for (const g of v) {
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1528
|
+
const C = Te(g.dataType);
|
|
1529
|
+
if (C !== "date" && C !== "datetime") continue;
|
|
1530
|
+
const E = Tt(g), S = g.label, A = $t({
|
|
1531
|
+
label: S,
|
|
1532
|
+
labelCount: S && b.get(S) || 0,
|
|
1533
|
+
rawKey: E,
|
|
1544
1534
|
rawKeys: w
|
|
1545
1535
|
});
|
|
1546
|
-
if (!
|
|
1536
|
+
if (!A) throw new W(a);
|
|
1547
1537
|
l.push({
|
|
1548
1538
|
scope: a,
|
|
1549
|
-
target: { kind: "column", columnKey:
|
|
1539
|
+
target: { kind: "column", columnKey: A },
|
|
1550
1540
|
format: q({
|
|
1551
1541
|
format: Be(g),
|
|
1552
1542
|
preferences: e.valueFormatPreferences,
|
|
@@ -1554,19 +1544,19 @@ function Mn(e) {
|
|
|
1554
1544
|
})
|
|
1555
1545
|
});
|
|
1556
1546
|
}
|
|
1557
|
-
} else if (m === "freeform" && ((
|
|
1547
|
+
} else if (m === "freeform" && ((f = r.sql) != null && f.trim()) && !c.trim())
|
|
1558
1548
|
for (const [v, h] of Object.entries(
|
|
1559
|
-
((d = (
|
|
1549
|
+
((d = (u = r.preferences) == null ? void 0 : u.tablePrefs) == null ? void 0 : d.columnSettingsMap) || {}
|
|
1560
1550
|
)) {
|
|
1561
1551
|
if (h.type !== "date") continue;
|
|
1562
|
-
const
|
|
1552
|
+
const b = me(
|
|
1563
1553
|
h.dateFormat
|
|
1564
1554
|
);
|
|
1565
|
-
|
|
1555
|
+
b && l.push({
|
|
1566
1556
|
scope: a,
|
|
1567
1557
|
target: { kind: "column", columnKey: v },
|
|
1568
1558
|
format: q({
|
|
1569
|
-
format:
|
|
1559
|
+
format: b,
|
|
1570
1560
|
preferences: e.valueFormatPreferences,
|
|
1571
1561
|
calendar: e.calendar
|
|
1572
1562
|
})
|
|
@@ -1576,13 +1566,13 @@ function Mn(e) {
|
|
|
1576
1566
|
}
|
|
1577
1567
|
);
|
|
1578
1568
|
}
|
|
1579
|
-
function
|
|
1569
|
+
function er(e) {
|
|
1580
1570
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
1581
1571
|
}
|
|
1582
|
-
function
|
|
1583
|
-
return
|
|
1572
|
+
function B(e, r, t) {
|
|
1573
|
+
return er(e) ? e : (t.push({ field: r, message: "Expected an object." }), {});
|
|
1584
1574
|
}
|
|
1585
|
-
function
|
|
1575
|
+
function P(e, r, t, n) {
|
|
1586
1576
|
const o = new Set(t);
|
|
1587
1577
|
Object.keys(e).forEach((a) => {
|
|
1588
1578
|
o.has(a) || n.push({
|
|
@@ -1591,7 +1581,7 @@ function B(e, r, t, n) {
|
|
|
1591
1581
|
});
|
|
1592
1582
|
});
|
|
1593
1583
|
}
|
|
1594
|
-
function
|
|
1584
|
+
function D(e, r, t, n, o = {}) {
|
|
1595
1585
|
if (e == null)
|
|
1596
1586
|
return;
|
|
1597
1587
|
if (typeof e != "string") {
|
|
@@ -1612,8 +1602,8 @@ function M(e, r, t, n, o = {}) {
|
|
|
1612
1602
|
}
|
|
1613
1603
|
return a;
|
|
1614
1604
|
}
|
|
1615
|
-
function
|
|
1616
|
-
const n =
|
|
1605
|
+
function fe(e, r, t) {
|
|
1606
|
+
const n = D(e, r, 2e3, t);
|
|
1617
1607
|
if (n)
|
|
1618
1608
|
try {
|
|
1619
1609
|
return new URL(n), n;
|
|
@@ -1622,13 +1612,13 @@ function pe(e, r, t) {
|
|
|
1622
1612
|
return;
|
|
1623
1613
|
}
|
|
1624
1614
|
}
|
|
1625
|
-
function
|
|
1626
|
-
const n =
|
|
1627
|
-
|
|
1615
|
+
function we(e, r, t) {
|
|
1616
|
+
const n = B(e, r, t);
|
|
1617
|
+
P(n, r, ["tokens", "components"], t);
|
|
1628
1618
|
const o = {};
|
|
1629
1619
|
if (n.tokens !== void 0) {
|
|
1630
|
-
const a =
|
|
1631
|
-
|
|
1620
|
+
const a = B(n.tokens, `${r}.tokens`, t);
|
|
1621
|
+
P(
|
|
1632
1622
|
a,
|
|
1633
1623
|
`${r}.tokens`,
|
|
1634
1624
|
["color", "typography"],
|
|
@@ -1636,7 +1626,7 @@ function Ce(e, r, t) {
|
|
|
1636
1626
|
);
|
|
1637
1627
|
const i = {};
|
|
1638
1628
|
if (a.color !== void 0) {
|
|
1639
|
-
const l =
|
|
1629
|
+
const l = B(
|
|
1640
1630
|
a.color,
|
|
1641
1631
|
`${r}.tokens.color`,
|
|
1642
1632
|
t
|
|
@@ -1653,37 +1643,37 @@ function Ce(e, r, t) {
|
|
|
1653
1643
|
"warning",
|
|
1654
1644
|
"info"
|
|
1655
1645
|
];
|
|
1656
|
-
|
|
1646
|
+
P(l, `${r}.tokens.color`, m, t);
|
|
1657
1647
|
const c = {};
|
|
1658
1648
|
m.forEach((s) => {
|
|
1659
|
-
const
|
|
1649
|
+
const f = D(
|
|
1660
1650
|
l[s],
|
|
1661
1651
|
`${r}.tokens.color.${s}`,
|
|
1662
1652
|
120,
|
|
1663
1653
|
t
|
|
1664
1654
|
);
|
|
1665
|
-
|
|
1655
|
+
f !== void 0 && (c[s] = f);
|
|
1666
1656
|
}), i.color = c;
|
|
1667
1657
|
}
|
|
1668
1658
|
if (a.typography !== void 0) {
|
|
1669
|
-
const l =
|
|
1659
|
+
const l = B(
|
|
1670
1660
|
a.typography,
|
|
1671
1661
|
`${r}.tokens.typography`,
|
|
1672
1662
|
t
|
|
1673
1663
|
);
|
|
1674
|
-
|
|
1664
|
+
P(
|
|
1675
1665
|
l,
|
|
1676
1666
|
`${r}.tokens.typography`,
|
|
1677
1667
|
["fontFamily", "monoFontFamily"],
|
|
1678
1668
|
t
|
|
1679
1669
|
);
|
|
1680
|
-
const m =
|
|
1670
|
+
const m = D(
|
|
1681
1671
|
l.fontFamily,
|
|
1682
1672
|
`${r}.tokens.typography.fontFamily`,
|
|
1683
1673
|
500,
|
|
1684
1674
|
t,
|
|
1685
1675
|
{ allowEmpty: !0 }
|
|
1686
|
-
), c =
|
|
1676
|
+
), c = D(
|
|
1687
1677
|
l.monoFontFamily,
|
|
1688
1678
|
`${r}.tokens.typography.monoFontFamily`,
|
|
1689
1679
|
500,
|
|
@@ -1698,24 +1688,24 @@ function Ce(e, r, t) {
|
|
|
1698
1688
|
o.tokens = i;
|
|
1699
1689
|
}
|
|
1700
1690
|
if (n.components !== void 0) {
|
|
1701
|
-
const a =
|
|
1691
|
+
const a = B(
|
|
1702
1692
|
n.components,
|
|
1703
1693
|
`${r}.components`,
|
|
1704
1694
|
t
|
|
1705
1695
|
);
|
|
1706
|
-
if (
|
|
1707
|
-
const i =
|
|
1696
|
+
if (P(a, `${r}.components`, ["chart"], t), a.chart !== void 0) {
|
|
1697
|
+
const i = B(
|
|
1708
1698
|
a.chart,
|
|
1709
1699
|
`${r}.components.chart`,
|
|
1710
1700
|
t
|
|
1711
1701
|
);
|
|
1712
|
-
|
|
1702
|
+
P(i, `${r}.components.chart`, ["palette"], t);
|
|
1713
1703
|
let l;
|
|
1714
1704
|
i.palette !== void 0 && (Array.isArray(i.palette) ? i.palette.length > 20 ? t.push({
|
|
1715
1705
|
field: `${r}.components.chart.palette`,
|
|
1716
1706
|
message: "Expected 20 colors or fewer."
|
|
1717
1707
|
}) : l = i.palette.map(
|
|
1718
|
-
(m, c) =>
|
|
1708
|
+
(m, c) => D(
|
|
1719
1709
|
m,
|
|
1720
1710
|
`${r}.components.chart.palette.${c}`,
|
|
1721
1711
|
120,
|
|
@@ -1731,22 +1721,22 @@ function Ce(e, r, t) {
|
|
|
1731
1721
|
}
|
|
1732
1722
|
return o;
|
|
1733
1723
|
}
|
|
1734
|
-
function
|
|
1735
|
-
const t = "presentation.appearance", n =
|
|
1736
|
-
|
|
1724
|
+
function tr(e, r) {
|
|
1725
|
+
const t = "presentation.appearance", n = B(e, t, r);
|
|
1726
|
+
P(n, t, ["version", "schemes"], r);
|
|
1737
1727
|
const o = {};
|
|
1738
1728
|
if (n.version !== void 0 && (typeof n.version != "number" || !Number.isFinite(n.version) ? r.push({ field: `${t}.version`, message: "Expected a number." }) : o.version = n.version), n.schemes !== void 0) {
|
|
1739
|
-
const a =
|
|
1740
|
-
|
|
1729
|
+
const a = B(n.schemes, `${t}.schemes`, r);
|
|
1730
|
+
P(a, `${t}.schemes`, ["light", "dark"], r), o.schemes = {
|
|
1741
1731
|
...a.light !== void 0 ? {
|
|
1742
|
-
light:
|
|
1732
|
+
light: we(
|
|
1743
1733
|
a.light,
|
|
1744
1734
|
`${t}.schemes.light`,
|
|
1745
1735
|
r
|
|
1746
1736
|
)
|
|
1747
1737
|
} : {},
|
|
1748
1738
|
...a.dark !== void 0 ? {
|
|
1749
|
-
dark:
|
|
1739
|
+
dark: we(
|
|
1750
1740
|
a.dark,
|
|
1751
1741
|
`${t}.schemes.dark`,
|
|
1752
1742
|
r
|
|
@@ -1756,23 +1746,23 @@ function nr(e, r) {
|
|
|
1756
1746
|
}
|
|
1757
1747
|
return o;
|
|
1758
1748
|
}
|
|
1759
|
-
function
|
|
1760
|
-
const t = "presentation.brandOverrides", n =
|
|
1761
|
-
|
|
1762
|
-
const o =
|
|
1749
|
+
function rr(e, r) {
|
|
1750
|
+
const t = "presentation.brandOverrides", n = B(e, t, r);
|
|
1751
|
+
P(n, t, ["brandName", "logoUrl", "link"], r);
|
|
1752
|
+
const o = D(
|
|
1763
1753
|
n.brandName,
|
|
1764
1754
|
`${t}.brandName`,
|
|
1765
1755
|
200,
|
|
1766
1756
|
r
|
|
1767
|
-
), a =
|
|
1757
|
+
), a = fe(n.logoUrl, `${t}.logoUrl`, r), i = D(n.link, `${t}.link`, 120, r);
|
|
1768
1758
|
return {
|
|
1769
1759
|
...o !== void 0 ? { brandName: o } : {},
|
|
1770
1760
|
...a !== void 0 ? { logoUrl: a } : {},
|
|
1771
1761
|
...i !== void 0 ? { link: i } : {}
|
|
1772
1762
|
};
|
|
1773
1763
|
}
|
|
1774
|
-
function
|
|
1775
|
-
const t = "presentation.fragments", n =
|
|
1764
|
+
function nr(e, r) {
|
|
1765
|
+
const t = "presentation.fragments", n = B(e, t, r), o = [
|
|
1776
1766
|
"preHeaderText",
|
|
1777
1767
|
"headerBannerHtml",
|
|
1778
1768
|
"signatureHtml",
|
|
@@ -1780,10 +1770,10 @@ function ar(e, r) {
|
|
|
1780
1770
|
"disclaimerHtml",
|
|
1781
1771
|
"unsubscribeUrl"
|
|
1782
1772
|
];
|
|
1783
|
-
|
|
1773
|
+
P(n, t, o, r);
|
|
1784
1774
|
const a = {};
|
|
1785
1775
|
return o.forEach((i) => {
|
|
1786
|
-
const l = i === "unsubscribeUrl" ?
|
|
1776
|
+
const l = i === "unsubscribeUrl" ? fe(n[i], `${t}.${i}`, r) : D(
|
|
1787
1777
|
n[i],
|
|
1788
1778
|
`${t}.${i}`,
|
|
1789
1779
|
i === "preHeaderText" ? 200 : 5e3,
|
|
@@ -1793,15 +1783,15 @@ function ar(e, r) {
|
|
|
1793
1783
|
l !== void 0 && (a[i] = l);
|
|
1794
1784
|
}), a;
|
|
1795
1785
|
}
|
|
1796
|
-
function
|
|
1786
|
+
function or(e) {
|
|
1797
1787
|
const r = [], t = {};
|
|
1798
|
-
if (e.appearance !== void 0 && (t.appearance =
|
|
1799
|
-
const n =
|
|
1788
|
+
if (e.appearance !== void 0 && (t.appearance = tr(e.appearance, r)), e.brandOverrides !== void 0 && (t.brandOverrides = rr(e.brandOverrides, r)), e.fragments !== void 0 && (t.fragments = nr(e.fragments, r)), e.viewUrl !== void 0) {
|
|
1789
|
+
const n = fe(e.viewUrl, "presentation.viewUrl", r);
|
|
1800
1790
|
n !== void 0 && (t.viewUrl = n);
|
|
1801
1791
|
}
|
|
1802
1792
|
return { value: t, issues: r };
|
|
1803
1793
|
}
|
|
1804
|
-
const
|
|
1794
|
+
const Ke = [
|
|
1805
1795
|
"SUN",
|
|
1806
1796
|
"MON",
|
|
1807
1797
|
"TUE",
|
|
@@ -1809,15 +1799,15 @@ const Oe = [
|
|
|
1809
1799
|
"THU",
|
|
1810
1800
|
"FRI",
|
|
1811
1801
|
"SAT"
|
|
1812
|
-
],
|
|
1813
|
-
|
|
1814
|
-
),
|
|
1802
|
+
], ar = new Map(
|
|
1803
|
+
Ke.map((e, r) => [e, r])
|
|
1804
|
+
), Mn = {
|
|
1815
1805
|
cadence: "weekly",
|
|
1816
1806
|
hour: 9,
|
|
1817
1807
|
minute: 0,
|
|
1818
1808
|
weekdays: [1]
|
|
1819
1809
|
};
|
|
1820
|
-
function
|
|
1810
|
+
function Dn(e) {
|
|
1821
1811
|
if (typeof e != "string" || e.length === 0 || e !== e.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(e))
|
|
1822
1812
|
return !1;
|
|
1823
1813
|
try {
|
|
@@ -1826,10 +1816,10 @@ function On(e) {
|
|
|
1826
1816
|
return !1;
|
|
1827
1817
|
}
|
|
1828
1818
|
}
|
|
1829
|
-
function
|
|
1819
|
+
function ir(e) {
|
|
1830
1820
|
return Number.isInteger(e.minute) && e.minute >= 0 && e.minute <= 59 && Number.isInteger(e.hour) && e.hour >= 0 && e.hour <= 23;
|
|
1831
1821
|
}
|
|
1832
|
-
function
|
|
1822
|
+
function Oe(e) {
|
|
1833
1823
|
if (e.length === 0) return null;
|
|
1834
1824
|
const r = [...e].sort((t, n) => t - n);
|
|
1835
1825
|
return r.some(
|
|
@@ -1837,16 +1827,16 @@ function Ke(e) {
|
|
|
1837
1827
|
) ? null : r;
|
|
1838
1828
|
}
|
|
1839
1829
|
function Kn(e) {
|
|
1840
|
-
if (!
|
|
1830
|
+
if (!ir(e))
|
|
1841
1831
|
throw new Error("Choose a valid schedule time.");
|
|
1842
1832
|
const r = `${e.minute} ${e.hour}`;
|
|
1843
1833
|
switch (e.cadence) {
|
|
1844
1834
|
case "daily":
|
|
1845
1835
|
return `${r} * * *`;
|
|
1846
1836
|
case "weekly": {
|
|
1847
|
-
const t =
|
|
1837
|
+
const t = Oe(e.weekdays);
|
|
1848
1838
|
if (!t) throw new Error("Choose at least one weekday.");
|
|
1849
|
-
return `${r} * * ${t.map((n) =>
|
|
1839
|
+
return `${r} * * ${t.map((n) => Ke[n]).join(",")}`;
|
|
1850
1840
|
}
|
|
1851
1841
|
case "twice_monthly":
|
|
1852
1842
|
return `${r} 1,15 * *`;
|
|
@@ -1854,7 +1844,7 @@ function Kn(e) {
|
|
|
1854
1844
|
return `${r} 1 * *`;
|
|
1855
1845
|
}
|
|
1856
1846
|
}
|
|
1857
|
-
function
|
|
1847
|
+
function cr(e) {
|
|
1858
1848
|
if (typeof e != "string" || e.length === 0)
|
|
1859
1849
|
return { ok: !1, issue: "Choose a supported schedule." };
|
|
1860
1850
|
if (e !== e.trim() || e.includes(" "))
|
|
@@ -1874,13 +1864,13 @@ function dr(e) {
|
|
|
1874
1864
|
value: { cadence: "daily", hour: m, minute: l, weekdays: [] }
|
|
1875
1865
|
};
|
|
1876
1866
|
if (o === "*" && i !== "*") {
|
|
1877
|
-
const s = i.split(",").map((d) =>
|
|
1867
|
+
const s = i.split(",").map((d) => ar.get(d));
|
|
1878
1868
|
if (s.some((d) => d === void 0))
|
|
1879
1869
|
return { ok: !1, issue: "Choose a supported schedule." };
|
|
1880
|
-
const
|
|
1881
|
-
return !
|
|
1870
|
+
const f = s, u = Oe(f);
|
|
1871
|
+
return !u || u.some((d, v) => d !== f[v]) ? { ok: !1, issue: "Choose a supported schedule." } : {
|
|
1882
1872
|
ok: !0,
|
|
1883
|
-
value: { cadence: "weekly", hour: m, minute: l, weekdays:
|
|
1873
|
+
value: { cadence: "weekly", hour: m, minute: l, weekdays: u }
|
|
1884
1874
|
};
|
|
1885
1875
|
}
|
|
1886
1876
|
return o === "1,15" && i === "*" ? {
|
|
@@ -1891,14 +1881,14 @@ function dr(e) {
|
|
|
1891
1881
|
value: { cadence: "monthly", hour: m, minute: l, weekdays: [] }
|
|
1892
1882
|
} : { ok: !1, issue: "Choose a supported schedule." };
|
|
1893
1883
|
}
|
|
1894
|
-
function
|
|
1884
|
+
function lr(e, r, t) {
|
|
1895
1885
|
return new Intl.DateTimeFormat(t, {
|
|
1896
1886
|
hour: "numeric",
|
|
1897
1887
|
minute: "2-digit",
|
|
1898
1888
|
timeZone: "UTC"
|
|
1899
1889
|
}).format(new Date(Date.UTC(2020, 0, 1, e, r)));
|
|
1900
1890
|
}
|
|
1901
|
-
function
|
|
1891
|
+
function dr(e, r) {
|
|
1902
1892
|
var t;
|
|
1903
1893
|
if (e === "UTC") return "UTC";
|
|
1904
1894
|
try {
|
|
@@ -1910,11 +1900,11 @@ function mr(e, r) {
|
|
|
1910
1900
|
return null;
|
|
1911
1901
|
}
|
|
1912
1902
|
}
|
|
1913
|
-
function
|
|
1914
|
-
const n =
|
|
1903
|
+
function On(e, r, t = "en-US") {
|
|
1904
|
+
const n = cr(e);
|
|
1915
1905
|
if (!n.ok) return null;
|
|
1916
1906
|
try {
|
|
1917
|
-
const o =
|
|
1907
|
+
const o = lr(n.value.hour, n.value.minute, t), a = dr(r, t);
|
|
1918
1908
|
if (!a) return null;
|
|
1919
1909
|
switch (n.value.cadence) {
|
|
1920
1910
|
case "daily":
|
|
@@ -1937,12 +1927,12 @@ function Nn(e, r, t = "en-US") {
|
|
|
1937
1927
|
return null;
|
|
1938
1928
|
}
|
|
1939
1929
|
}
|
|
1940
|
-
const
|
|
1930
|
+
const sr = /* @__PURE__ */ new Set([
|
|
1941
1931
|
"table",
|
|
1942
1932
|
"aggregateTable",
|
|
1943
1933
|
"pivotTable",
|
|
1944
1934
|
"detailTable"
|
|
1945
|
-
]),
|
|
1935
|
+
]), mr = /* @__PURE__ */ new Set([
|
|
1946
1936
|
"bar",
|
|
1947
1937
|
"horizontalBar",
|
|
1948
1938
|
"line",
|
|
@@ -1973,27 +1963,27 @@ const ur = /* @__PURE__ */ new Set([
|
|
|
1973
1963
|
"treemap",
|
|
1974
1964
|
"custom"
|
|
1975
1965
|
]);
|
|
1976
|
-
function
|
|
1966
|
+
function Nn(e) {
|
|
1977
1967
|
var n, o, a;
|
|
1978
|
-
const r =
|
|
1979
|
-
return e.type === "text" || !r ||
|
|
1980
|
-
formats:
|
|
1968
|
+
const r = mr.has(e.type) && (e.type !== "custom" || !!((n = e.customCardPreferences) != null && n.url));
|
|
1969
|
+
return e.type === "text" || !r || mt(e) ? { formats: [], defaultFormat: null } : {
|
|
1970
|
+
formats: ur({
|
|
1981
1971
|
cardType: e.type,
|
|
1982
1972
|
allowDownload: (o = e.preferences) == null ? void 0 : o.allowDownload
|
|
1983
1973
|
}),
|
|
1984
|
-
defaultFormat:
|
|
1974
|
+
defaultFormat: fr({
|
|
1985
1975
|
cardType: e.type,
|
|
1986
1976
|
allowDownload: (a = e.preferences) == null ? void 0 : a.allowDownload
|
|
1987
1977
|
})
|
|
1988
1978
|
};
|
|
1989
1979
|
}
|
|
1990
|
-
function
|
|
1980
|
+
function ur(e) {
|
|
1991
1981
|
return e.allowDownload === !1 ? ["pdf"] : ["pdf", "csv"];
|
|
1992
1982
|
}
|
|
1993
|
-
function
|
|
1994
|
-
return
|
|
1983
|
+
function fr(e) {
|
|
1984
|
+
return sr.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
|
|
1995
1985
|
}
|
|
1996
|
-
function
|
|
1986
|
+
function zn(e) {
|
|
1997
1987
|
return e != null && e.role ? e.type === "tenant" ? e.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(e.role) : !1;
|
|
1998
1988
|
}
|
|
1999
1989
|
function Ln(e) {
|
|
@@ -2002,22 +1992,22 @@ function Ln(e) {
|
|
|
2002
1992
|
...e.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
|
|
2003
1993
|
] : [];
|
|
2004
1994
|
}
|
|
2005
|
-
function
|
|
1995
|
+
function pr(e) {
|
|
2006
1996
|
const r = (e == null ? void 0 : e.channels) ?? [];
|
|
2007
1997
|
return r.length === 1 && r[0] === "EMAIL";
|
|
2008
1998
|
}
|
|
2009
|
-
function
|
|
2010
|
-
return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 &&
|
|
1999
|
+
function yr(e) {
|
|
2000
|
+
return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && pr(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
|
|
2011
2001
|
}
|
|
2012
|
-
function
|
|
2013
|
-
const r =
|
|
2002
|
+
function Vn(e) {
|
|
2003
|
+
const r = yr(e), t = r === "Scheduled report" || r === "On-demand report" ? "report" : "briefing";
|
|
2014
2004
|
return {
|
|
2015
2005
|
typeLabel: r,
|
|
2016
2006
|
noun: t,
|
|
2017
2007
|
pluralNoun: t === "report" ? "reports" : "briefings"
|
|
2018
2008
|
};
|
|
2019
2009
|
}
|
|
2020
|
-
const ce = "BRIEFING",
|
|
2010
|
+
const ce = "BRIEFING", hr = ["markdown", "html"], le = ["markdown"], te = 20, y = {
|
|
2021
2011
|
name: 500,
|
|
2022
2012
|
description: 2e3,
|
|
2023
2013
|
instruction: 5e4,
|
|
@@ -2033,7 +2023,7 @@ const ce = "BRIEFING", vr = ["markdown", "html"], le = ["markdown"], te = 20, y
|
|
|
2033
2023
|
presentationTone: 500,
|
|
2034
2024
|
presentationFormat: 2e3,
|
|
2035
2025
|
id: 500
|
|
2036
|
-
},
|
|
2026
|
+
}, F = {
|
|
2037
2027
|
maxBlocks: 50,
|
|
2038
2028
|
maxTableRows: 100,
|
|
2039
2029
|
maxTableColumns: 20,
|
|
@@ -2046,7 +2036,7 @@ const ce = "BRIEFING", vr = ["markdown", "html"], le = ["markdown"], te = 20, y
|
|
|
2046
2036
|
// tiny tiles in narrow client panels; 2-up was the chosen layout).
|
|
2047
2037
|
maxKpiTiles: 8
|
|
2048
2038
|
};
|
|
2049
|
-
function
|
|
2039
|
+
function gr(e) {
|
|
2050
2040
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
2051
2041
|
return !1;
|
|
2052
2042
|
const r = e;
|
|
@@ -2056,17 +2046,17 @@ function br(e) {
|
|
|
2056
2046
|
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
2057
2047
|
return !1;
|
|
2058
2048
|
const n = t;
|
|
2059
|
-
return (n.kind === "metric" && typeof n.metricId == "string" && !!n.metricId.trim() || n.kind === "column" && typeof n.columnKey == "string" && !!n.columnKey.trim() || n.kind === "matrix_measure" && typeof n.measureId == "string" && !!n.measureId.trim()) &&
|
|
2049
|
+
return (n.kind === "metric" && typeof n.metricId == "string" && !!n.metricId.trim() || n.kind === "column" && typeof n.columnKey == "string" && !!n.columnKey.trim() || n.kind === "matrix_measure" && typeof n.measureId == "string" && !!n.measureId.trim()) && Ce(r.format).ok;
|
|
2060
2050
|
}
|
|
2061
|
-
function
|
|
2062
|
-
return e == null ? "" :
|
|
2051
|
+
function vr(e) {
|
|
2052
|
+
return e == null ? "" : gr(e) ? ct(e.value, e.format) : String(e);
|
|
2063
2053
|
}
|
|
2064
|
-
function
|
|
2054
|
+
function Un(e) {
|
|
2065
2055
|
return [e.delta, e.percentChange].filter(
|
|
2066
2056
|
(r) => r != null
|
|
2067
|
-
).map(
|
|
2057
|
+
).map(vr).filter(Boolean).join(" / ");
|
|
2068
2058
|
}
|
|
2069
|
-
const Ne = new Set(
|
|
2059
|
+
const Ne = new Set(hr), br = /* @__PURE__ */ new Set([
|
|
2070
2060
|
"EMAIL",
|
|
2071
2061
|
"WEBHOOK",
|
|
2072
2062
|
"SLACK",
|
|
@@ -2077,39 +2067,39 @@ const Ne = new Set(vr), wr = /* @__PURE__ */ new Set([
|
|
|
2077
2067
|
maxPlanningIterations: { min: 1, max: 10 },
|
|
2078
2068
|
maxRows: { min: 1, max: 1e5 },
|
|
2079
2069
|
timeoutMs: { min: 1e3, max: 30 * 6e4 }
|
|
2080
|
-
},
|
|
2070
|
+
}, Ir = /* @__PURE__ */ new Set([
|
|
2081
2071
|
"letter",
|
|
2082
2072
|
"legal",
|
|
2083
2073
|
"a4",
|
|
2084
2074
|
"a3",
|
|
2085
2075
|
"tabloid"
|
|
2086
|
-
]),
|
|
2076
|
+
]), wr = /* @__PURE__ */ new Set([
|
|
2087
2077
|
"portrait",
|
|
2088
2078
|
"landscape"
|
|
2089
|
-
]),
|
|
2079
|
+
]), Cr = /* @__PURE__ */ new Set([",", ";", " "]), Tr = /* @__PURE__ */ new Set([
|
|
2090
2080
|
"current",
|
|
2091
2081
|
"all"
|
|
2092
|
-
]),
|
|
2082
|
+
]), $r = /* @__PURE__ */ new Set([
|
|
2093
2083
|
"concise",
|
|
2094
2084
|
"balanced",
|
|
2095
2085
|
"detailed"
|
|
2096
|
-
]),
|
|
2086
|
+
]), kr = /* @__PURE__ */ new Set([
|
|
2097
2087
|
"info",
|
|
2098
2088
|
"positive",
|
|
2099
2089
|
"warning",
|
|
2100
2090
|
"critical"
|
|
2101
|
-
]),
|
|
2091
|
+
]), Er = /* @__PURE__ */ new Set([
|
|
2102
2092
|
"text",
|
|
2103
2093
|
"number",
|
|
2104
2094
|
"currency",
|
|
2105
2095
|
"percent",
|
|
2106
2096
|
"date",
|
|
2107
2097
|
"boolean"
|
|
2108
|
-
]),
|
|
2098
|
+
]), xr = /* @__PURE__ */ new Set([
|
|
2109
2099
|
"left",
|
|
2110
2100
|
"center",
|
|
2111
2101
|
"right"
|
|
2112
|
-
]),
|
|
2102
|
+
]), Sr = [
|
|
2113
2103
|
"pageSize",
|
|
2114
2104
|
"orientation",
|
|
2115
2105
|
"includeFilters",
|
|
@@ -2138,56 +2128,56 @@ const Ne = new Set(vr), wr = /* @__PURE__ */ new Set([
|
|
|
2138
2128
|
class X extends Error {
|
|
2139
2129
|
constructor(t) {
|
|
2140
2130
|
super(t.map((n) => `${n.field}: ${n.message}`).join("; "));
|
|
2141
|
-
|
|
2131
|
+
_(this, "issues");
|
|
2142
2132
|
this.name = "BriefingContractError", this.issues = t;
|
|
2143
2133
|
}
|
|
2144
2134
|
}
|
|
2145
2135
|
function ze(e) {
|
|
2146
2136
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
2147
2137
|
}
|
|
2148
|
-
function
|
|
2138
|
+
function p(e, r, t) {
|
|
2149
2139
|
e.push({ field: r, message: t });
|
|
2150
2140
|
}
|
|
2151
2141
|
function k(e, r, t) {
|
|
2152
|
-
return ze(e) ? e : (
|
|
2142
|
+
return ze(e) ? e : (p(t, r, "Expected an object."), {});
|
|
2153
2143
|
}
|
|
2154
|
-
function
|
|
2144
|
+
function I(e, r, t, n) {
|
|
2155
2145
|
const o = new Set(t);
|
|
2156
2146
|
Object.keys(e).forEach((a) => {
|
|
2157
|
-
o.has(a) ||
|
|
2147
|
+
o.has(a) || p(
|
|
2158
2148
|
n,
|
|
2159
2149
|
r ? `${r}.${a}` : a,
|
|
2160
2150
|
`Unexpected field "${a}".`
|
|
2161
2151
|
);
|
|
2162
2152
|
});
|
|
2163
2153
|
}
|
|
2164
|
-
function
|
|
2154
|
+
function T(e, r, t, n) {
|
|
2165
2155
|
if (typeof e != "string")
|
|
2166
|
-
return
|
|
2156
|
+
return p(n, r, "Expected a string."), "";
|
|
2167
2157
|
const o = e.trim();
|
|
2168
|
-
return o ? (o.length > t &&
|
|
2158
|
+
return o ? (o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o) : (p(n, r, "Required value cannot be empty."), "");
|
|
2169
2159
|
}
|
|
2170
|
-
function
|
|
2160
|
+
function $(e, r, t, n) {
|
|
2171
2161
|
if (e == null)
|
|
2172
2162
|
return;
|
|
2173
2163
|
if (typeof e != "string") {
|
|
2174
|
-
|
|
2164
|
+
p(n, r, "Expected a string.");
|
|
2175
2165
|
return;
|
|
2176
2166
|
}
|
|
2177
2167
|
const o = e.trim();
|
|
2178
2168
|
if (o)
|
|
2179
|
-
return o.length > t &&
|
|
2169
|
+
return o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o;
|
|
2180
2170
|
}
|
|
2181
|
-
function
|
|
2171
|
+
function _r(e, r, t, n) {
|
|
2182
2172
|
if (typeof e != "string")
|
|
2183
|
-
return
|
|
2173
|
+
return p(n, r, "Expected a string."), "";
|
|
2184
2174
|
const o = e.trim();
|
|
2185
|
-
return o.length > t &&
|
|
2175
|
+
return o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o;
|
|
2186
2176
|
}
|
|
2187
|
-
function
|
|
2177
|
+
function Fr(e, r, t) {
|
|
2188
2178
|
if (e != null) {
|
|
2189
2179
|
if (!Number.isInteger(e) || Number(e) < 0) {
|
|
2190
|
-
|
|
2180
|
+
p(t, r, "Expected a non-negative integer.");
|
|
2191
2181
|
return;
|
|
2192
2182
|
}
|
|
2193
2183
|
return Number(e);
|
|
@@ -2195,74 +2185,74 @@ function Ar(e, r, t) {
|
|
|
2195
2185
|
}
|
|
2196
2186
|
function R(e, r, t, n = {}) {
|
|
2197
2187
|
if (e == null)
|
|
2198
|
-
return n.required ? (
|
|
2188
|
+
return n.required ? (p(t, r, "Expected at least one evidence id."), []) : void 0;
|
|
2199
2189
|
if (!Array.isArray(e))
|
|
2200
|
-
return
|
|
2190
|
+
return p(t, r, "Expected an array."), n.required ? [] : void 0;
|
|
2201
2191
|
const o = [];
|
|
2202
2192
|
return e.forEach((a, i) => {
|
|
2203
|
-
const l =
|
|
2193
|
+
const l = T(
|
|
2204
2194
|
a,
|
|
2205
2195
|
`${r}.${i}`,
|
|
2206
2196
|
y.id,
|
|
2207
2197
|
t
|
|
2208
2198
|
);
|
|
2209
2199
|
l && !o.includes(l) && o.push(l);
|
|
2210
|
-
}), n.required && o.length === 0 &&
|
|
2200
|
+
}), n.required && o.length === 0 && p(t, r, "Expected at least one evidence id."), o.length > 0 || n.required ? o : void 0;
|
|
2211
2201
|
}
|
|
2212
2202
|
function N(e, r, t, n) {
|
|
2213
|
-
return e == null ? r : typeof e != "boolean" ? (
|
|
2203
|
+
return e == null ? r : typeof e != "boolean" ? (p(n, t, "Expected a boolean."), r) : e;
|
|
2214
2204
|
}
|
|
2215
|
-
function
|
|
2216
|
-
return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (
|
|
2205
|
+
function Rr(e, r) {
|
|
2206
|
+
return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (p(r, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
|
|
2217
2207
|
}
|
|
2218
|
-
function
|
|
2208
|
+
function Ar(e) {
|
|
2219
2209
|
return e.includes("@") && e.includes(".") && !e.includes(" ");
|
|
2220
2210
|
}
|
|
2221
|
-
function
|
|
2211
|
+
function Le(e, r) {
|
|
2222
2212
|
if (e == null)
|
|
2223
2213
|
return { type: "project" };
|
|
2224
2214
|
const t = k(e, "source", r), n = t.type;
|
|
2225
|
-
return n === "project" ? (
|
|
2215
|
+
return n === "project" ? (I(t, "source", ["type"], r), { type: "project" }) : n === "dashboard" ? (I(t, "source", ["type", "dashboardId"], r), {
|
|
2226
2216
|
type: "dashboard",
|
|
2227
|
-
dashboardId:
|
|
2217
|
+
dashboardId: T(
|
|
2228
2218
|
t.dashboardId,
|
|
2229
2219
|
"source.dashboardId",
|
|
2230
2220
|
y.id,
|
|
2231
2221
|
r
|
|
2232
2222
|
)
|
|
2233
|
-
}) : (
|
|
2223
|
+
}) : (p(r, "source.type", "Expected project or dashboard."), { type: "project" });
|
|
2234
2224
|
}
|
|
2235
|
-
function
|
|
2225
|
+
function Ve(e, r) {
|
|
2236
2226
|
const t = k(e, "body", r), n = t.type;
|
|
2237
|
-
return n === "generated_analysis" ? (
|
|
2227
|
+
return n === "generated_analysis" ? (I(t, "body", ["type", "instruction"], r), {
|
|
2238
2228
|
type: "generated_analysis",
|
|
2239
|
-
instruction:
|
|
2229
|
+
instruction: T(
|
|
2240
2230
|
t.instruction,
|
|
2241
2231
|
"body.instruction",
|
|
2242
2232
|
y.instruction,
|
|
2243
2233
|
r
|
|
2244
2234
|
)
|
|
2245
|
-
}) : n === "custom_message" ? (
|
|
2235
|
+
}) : n === "custom_message" ? (I(t, "body", ["type", "message"], r), {
|
|
2246
2236
|
type: "custom_message",
|
|
2247
|
-
message:
|
|
2237
|
+
message: _r(
|
|
2248
2238
|
t.message,
|
|
2249
2239
|
"body.message",
|
|
2250
2240
|
y.customMessage,
|
|
2251
2241
|
r
|
|
2252
2242
|
)
|
|
2253
|
-
}) : n === "none" ? (
|
|
2243
|
+
}) : n === "none" ? (I(t, "body", ["type"], r), { type: "none" }) : (p(
|
|
2254
2244
|
r,
|
|
2255
2245
|
"body.type",
|
|
2256
2246
|
"Expected generated_analysis, custom_message, or none."
|
|
2257
2247
|
), { type: "none" });
|
|
2258
2248
|
}
|
|
2259
|
-
function
|
|
2249
|
+
function Br(e, r) {
|
|
2260
2250
|
if (e == null)
|
|
2261
2251
|
return [...le];
|
|
2262
2252
|
if (!Array.isArray(e))
|
|
2263
|
-
return
|
|
2253
|
+
return p(r, "presentation.artifactFormats", "Expected an array."), [...le];
|
|
2264
2254
|
if (e.length === 0)
|
|
2265
|
-
return
|
|
2255
|
+
return p(
|
|
2266
2256
|
r,
|
|
2267
2257
|
"presentation.artifactFormats",
|
|
2268
2258
|
"Choose at least one artifact format."
|
|
@@ -2270,7 +2260,7 @@ function Mr(e, r) {
|
|
|
2270
2260
|
const t = [];
|
|
2271
2261
|
return e.forEach((n, o) => {
|
|
2272
2262
|
if (typeof n != "string" || !Ne.has(n)) {
|
|
2273
|
-
|
|
2263
|
+
p(
|
|
2274
2264
|
r,
|
|
2275
2265
|
`presentation.artifactFormats.${o}`,
|
|
2276
2266
|
"Expected markdown or html."
|
|
@@ -2288,7 +2278,7 @@ function Ue(e, r) {
|
|
|
2288
2278
|
includeSql: !0
|
|
2289
2279
|
};
|
|
2290
2280
|
const t = k(e, "presentation", r);
|
|
2291
|
-
|
|
2281
|
+
I(
|
|
2292
2282
|
t,
|
|
2293
2283
|
"presentation",
|
|
2294
2284
|
[
|
|
@@ -2306,7 +2296,7 @@ function Ue(e, r) {
|
|
|
2306
2296
|
r
|
|
2307
2297
|
);
|
|
2308
2298
|
const n = {
|
|
2309
|
-
artifactFormats:
|
|
2299
|
+
artifactFormats: Br(t.artifactFormats, r),
|
|
2310
2300
|
includeEvidence: N(
|
|
2311
2301
|
t.includeEvidence,
|
|
2312
2302
|
!0,
|
|
@@ -2319,46 +2309,46 @@ function Ue(e, r) {
|
|
|
2319
2309
|
"presentation.includeSql",
|
|
2320
2310
|
r
|
|
2321
2311
|
)
|
|
2322
|
-
}, o =
|
|
2312
|
+
}, o = $(
|
|
2323
2313
|
t.audience,
|
|
2324
2314
|
"presentation.audience",
|
|
2325
2315
|
y.presentationAudience,
|
|
2326
2316
|
r
|
|
2327
|
-
), a =
|
|
2317
|
+
), a = $(
|
|
2328
2318
|
t.tone,
|
|
2329
2319
|
"presentation.tone",
|
|
2330
2320
|
y.presentationTone,
|
|
2331
2321
|
r
|
|
2332
|
-
), i =
|
|
2322
|
+
), i = $(
|
|
2333
2323
|
t.format,
|
|
2334
2324
|
"presentation.format",
|
|
2335
2325
|
y.presentationFormat,
|
|
2336
2326
|
r
|
|
2337
2327
|
);
|
|
2338
2328
|
o && (n.audience = o), a && (n.tone = a), i && (n.format = i);
|
|
2339
|
-
const l =
|
|
2340
|
-
return l.issues.forEach((m) =>
|
|
2329
|
+
const l = or(t);
|
|
2330
|
+
return l.issues.forEach((m) => p(r, m.field, m.message)), Object.assign(n, l.value), n;
|
|
2341
2331
|
}
|
|
2342
|
-
function
|
|
2343
|
-
return Array.isArray(e) ? (e.length === 0 &&
|
|
2332
|
+
function Pr(e, r, t) {
|
|
2333
|
+
return Array.isArray(e) ? (e.length === 0 && p(t, r, "Expected at least one item."), e.length > F.maxListItems && p(
|
|
2344
2334
|
t,
|
|
2345
2335
|
r,
|
|
2346
|
-
`Must have ${
|
|
2347
|
-
), e.slice(0,
|
|
2348
|
-
(n, o) =>
|
|
2336
|
+
`Must have ${F.maxListItems} items or fewer.`
|
|
2337
|
+
), e.slice(0, F.maxListItems).map(
|
|
2338
|
+
(n, o) => T(
|
|
2349
2339
|
n,
|
|
2350
2340
|
`${r}.${o}`,
|
|
2351
2341
|
y.contentItem,
|
|
2352
2342
|
t
|
|
2353
2343
|
)
|
|
2354
|
-
).filter(Boolean)) : (
|
|
2344
|
+
).filter(Boolean)) : (p(t, r, "Expected an array."), []);
|
|
2355
2345
|
}
|
|
2356
|
-
function
|
|
2346
|
+
function Mr(e, r, t) {
|
|
2357
2347
|
const n = k(e, r, t);
|
|
2358
2348
|
if (n.kind === "metric")
|
|
2359
|
-
return
|
|
2349
|
+
return I(n, r, ["kind", "metricId"], t), {
|
|
2360
2350
|
kind: "metric",
|
|
2361
|
-
metricId:
|
|
2351
|
+
metricId: T(
|
|
2362
2352
|
n.metricId,
|
|
2363
2353
|
`${r}.metricId`,
|
|
2364
2354
|
y.id,
|
|
@@ -2366,9 +2356,9 @@ function Or(e, r, t) {
|
|
|
2366
2356
|
)
|
|
2367
2357
|
};
|
|
2368
2358
|
if (n.kind === "column")
|
|
2369
|
-
return
|
|
2359
|
+
return I(n, r, ["kind", "columnKey"], t), {
|
|
2370
2360
|
kind: "column",
|
|
2371
|
-
columnKey:
|
|
2361
|
+
columnKey: T(
|
|
2372
2362
|
n.columnKey,
|
|
2373
2363
|
`${r}.columnKey`,
|
|
2374
2364
|
y.id,
|
|
@@ -2376,16 +2366,16 @@ function Or(e, r, t) {
|
|
|
2376
2366
|
)
|
|
2377
2367
|
};
|
|
2378
2368
|
if (n.kind === "matrix_measure")
|
|
2379
|
-
return
|
|
2369
|
+
return I(n, r, ["kind", "measureId"], t), {
|
|
2380
2370
|
kind: "matrix_measure",
|
|
2381
|
-
measureId:
|
|
2371
|
+
measureId: T(
|
|
2382
2372
|
n.measureId,
|
|
2383
2373
|
`${r}.measureId`,
|
|
2384
2374
|
y.id,
|
|
2385
2375
|
t
|
|
2386
2376
|
)
|
|
2387
2377
|
};
|
|
2388
|
-
|
|
2378
|
+
p(
|
|
2389
2379
|
t,
|
|
2390
2380
|
`${r}.kind`,
|
|
2391
2381
|
"Expected metric, column, or matrix_measure."
|
|
@@ -2397,14 +2387,14 @@ function je(e, r, t) {
|
|
|
2397
2387
|
const n = k(e, r, t);
|
|
2398
2388
|
if (!Object.prototype.hasOwnProperty.call(n, "target") && !Object.prototype.hasOwnProperty.call(n, "format"))
|
|
2399
2389
|
return;
|
|
2400
|
-
|
|
2401
|
-
const o =
|
|
2390
|
+
I(n, r, ["value", "target", "format"], t), (typeof n.value != "number" || !Number.isFinite(n.value)) && p(t, `${r}.value`, "Expected a finite number.");
|
|
2391
|
+
const o = Mr(
|
|
2402
2392
|
n.target,
|
|
2403
2393
|
`${r}.target`,
|
|
2404
2394
|
t
|
|
2405
|
-
), a =
|
|
2395
|
+
), a = Ce(n.format);
|
|
2406
2396
|
if (a.ok || a.issues.forEach(
|
|
2407
|
-
(i) =>
|
|
2397
|
+
(i) => p(
|
|
2408
2398
|
t,
|
|
2409
2399
|
i.path === "$" ? `${r}.format` : `${r}.format.${i.path}`,
|
|
2410
2400
|
i.message
|
|
@@ -2412,72 +2402,72 @@ function je(e, r, t) {
|
|
|
2412
2402
|
), !(typeof n.value != "number" || !Number.isFinite(n.value) || !o || !a.ok))
|
|
2413
2403
|
return { value: n.value, target: o, format: a.value };
|
|
2414
2404
|
}
|
|
2415
|
-
function
|
|
2405
|
+
function M(e, r, t) {
|
|
2416
2406
|
if (typeof e == "string")
|
|
2417
2407
|
return e;
|
|
2418
2408
|
if (typeof e == "number") {
|
|
2419
2409
|
if (!Number.isFinite(e)) {
|
|
2420
|
-
|
|
2410
|
+
p(t, r, "Expected a finite number.");
|
|
2421
2411
|
return;
|
|
2422
2412
|
}
|
|
2423
2413
|
return e;
|
|
2424
2414
|
}
|
|
2425
2415
|
const n = je(e, r, t);
|
|
2426
2416
|
if (n) return n;
|
|
2427
|
-
|
|
2417
|
+
p(
|
|
2428
2418
|
t,
|
|
2429
2419
|
r,
|
|
2430
2420
|
"Expected a string, number, or structured numeric value."
|
|
2431
2421
|
);
|
|
2432
2422
|
}
|
|
2433
|
-
function
|
|
2423
|
+
function Dr(e, r, t) {
|
|
2434
2424
|
if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
2435
|
-
return typeof e == "string" && e.length > y.contentCell ? (
|
|
2425
|
+
return typeof e == "string" && e.length > y.contentCell ? (p(
|
|
2436
2426
|
t,
|
|
2437
2427
|
r,
|
|
2438
2428
|
`Must be ${y.contentCell} characters or fewer.`
|
|
2439
|
-
), e.slice(0, y.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (
|
|
2429
|
+
), e.slice(0, y.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (p(t, r, "Expected a finite number."), null) : e;
|
|
2440
2430
|
const n = je(e, r, t);
|
|
2441
|
-
return n || (
|
|
2431
|
+
return n || (p(
|
|
2442
2432
|
t,
|
|
2443
2433
|
r,
|
|
2444
2434
|
"Expected a string, number, boolean, structured numeric value, or null."
|
|
2445
2435
|
), null);
|
|
2446
2436
|
}
|
|
2447
|
-
function
|
|
2437
|
+
function Kr(e, r, t) {
|
|
2448
2438
|
if (!Array.isArray(e))
|
|
2449
|
-
return
|
|
2450
|
-
e.length === 0 &&
|
|
2439
|
+
return p(t, r, "Expected an array."), [];
|
|
2440
|
+
e.length === 0 && p(t, r, "Expected at least one column."), e.length > F.maxTableColumns && p(
|
|
2451
2441
|
t,
|
|
2452
2442
|
r,
|
|
2453
|
-
`Must have ${
|
|
2443
|
+
`Must have ${F.maxTableColumns} columns or fewer.`
|
|
2454
2444
|
);
|
|
2455
2445
|
const n = /* @__PURE__ */ new Set();
|
|
2456
|
-
return e.slice(0,
|
|
2446
|
+
return e.slice(0, F.maxTableColumns).map((o, a) => {
|
|
2457
2447
|
const i = `${r}.${a}`, l = k(o, i, t);
|
|
2458
|
-
|
|
2459
|
-
const m =
|
|
2448
|
+
I(l, i, ["key", "label", "kind", "align"], t);
|
|
2449
|
+
const m = T(
|
|
2460
2450
|
l.key,
|
|
2461
2451
|
`${i}.key`,
|
|
2462
2452
|
y.id,
|
|
2463
2453
|
t
|
|
2464
2454
|
);
|
|
2465
|
-
m && (n.has(m) &&
|
|
2466
|
-
const c =
|
|
2455
|
+
m && (n.has(m) && p(t, `${i}.key`, "Column key must be unique."), n.add(m));
|
|
2456
|
+
const c = T(
|
|
2467
2457
|
l.label,
|
|
2468
2458
|
`${i}.label`,
|
|
2469
2459
|
y.contentTitle,
|
|
2470
2460
|
t
|
|
2471
|
-
), s =
|
|
2461
|
+
), s = K(
|
|
2472
2462
|
l.kind,
|
|
2473
2463
|
`${i}.kind`,
|
|
2474
|
-
|
|
2464
|
+
Er,
|
|
2475
2465
|
"text, number, currency, percent, date, or boolean",
|
|
2476
2466
|
t
|
|
2477
|
-
),
|
|
2467
|
+
), f = K(
|
|
2478
2468
|
l.align,
|
|
2479
2469
|
`${i}.align`,
|
|
2480
|
-
|
|
2470
|
+
xr,
|
|
2481
2471
|
"left, center, or right",
|
|
2482
2472
|
t
|
|
2483
2473
|
);
|
|
@@ -2485,41 +2475,41 @@ function Nr(e, r, t) {
|
|
|
2485
2475
|
key: m,
|
|
2486
2476
|
label: c,
|
|
2487
2477
|
...s ? { kind: s } : {},
|
|
2488
|
-
...
|
|
2478
|
+
...f ? { align: f } : {}
|
|
2489
2479
|
};
|
|
2490
2480
|
});
|
|
2491
2481
|
}
|
|
2492
|
-
function
|
|
2482
|
+
function Or(e, r, t, n) {
|
|
2493
2483
|
if (!Array.isArray(e))
|
|
2494
|
-
return
|
|
2495
|
-
e.length >
|
|
2484
|
+
return p(n, r, "Expected an array."), [];
|
|
2485
|
+
e.length > F.maxTableRows && p(
|
|
2496
2486
|
n,
|
|
2497
2487
|
r,
|
|
2498
|
-
`Must have ${
|
|
2488
|
+
`Must have ${F.maxTableRows} rows or fewer.`
|
|
2499
2489
|
);
|
|
2500
2490
|
const o = new Set(t.map((a) => a.key).filter(Boolean));
|
|
2501
|
-
return e.slice(0,
|
|
2491
|
+
return e.slice(0, F.maxTableRows).map((a, i) => {
|
|
2502
2492
|
const l = `${r}.${i}`, m = k(a, l, n);
|
|
2503
2493
|
return Object.keys(m).forEach((c) => {
|
|
2504
|
-
o.has(c) ||
|
|
2494
|
+
o.has(c) || p(n, `${l}.${c}`, `Unexpected table cell "${c}".`);
|
|
2505
2495
|
}), Object.fromEntries(
|
|
2506
2496
|
t.map((c) => [
|
|
2507
2497
|
c.key,
|
|
2508
|
-
|
|
2498
|
+
Dr(m[c.key] ?? null, `${l}.${c.key}`, n)
|
|
2509
2499
|
])
|
|
2510
2500
|
);
|
|
2511
2501
|
});
|
|
2512
2502
|
}
|
|
2513
|
-
function
|
|
2503
|
+
function Nr(e, r, t) {
|
|
2514
2504
|
const n = `content.blocks.${r}`, o = k(e, n, t), a = o.type;
|
|
2515
2505
|
if (a === "heading") {
|
|
2516
|
-
|
|
2506
|
+
I(o, n, ["type", "text", "level", "evidenceIds"], t);
|
|
2517
2507
|
const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
|
|
2518
|
-
o.level !== void 0 && o.level !== null && i === void 0 &&
|
|
2508
|
+
o.level !== void 0 && o.level !== null && i === void 0 && p(t, `${n}.level`, "Expected 2 or 3.");
|
|
2519
2509
|
const l = R(o.evidenceIds, `${n}.evidenceIds`, t);
|
|
2520
2510
|
return {
|
|
2521
2511
|
type: "heading",
|
|
2522
|
-
text:
|
|
2512
|
+
text: T(
|
|
2523
2513
|
o.text,
|
|
2524
2514
|
`${n}.text`,
|
|
2525
2515
|
y.contentTitle,
|
|
@@ -2530,11 +2520,11 @@ function Vr(e, r, t) {
|
|
|
2530
2520
|
};
|
|
2531
2521
|
}
|
|
2532
2522
|
if (a === "paragraph") {
|
|
2533
|
-
|
|
2523
|
+
I(o, n, ["type", "text", "evidenceIds"], t);
|
|
2534
2524
|
const i = R(o.evidenceIds, `${n}.evidenceIds`, t);
|
|
2535
2525
|
return {
|
|
2536
2526
|
type: "paragraph",
|
|
2537
|
-
text:
|
|
2527
|
+
text: T(
|
|
2538
2528
|
o.text,
|
|
2539
2529
|
`${n}.text`,
|
|
2540
2530
|
y.contentText,
|
|
@@ -2544,23 +2534,23 @@ function Vr(e, r, t) {
|
|
|
2544
2534
|
};
|
|
2545
2535
|
}
|
|
2546
2536
|
if (a === "finding") {
|
|
2547
|
-
|
|
2548
|
-
const i =
|
|
2537
|
+
I(o, n, ["type", "title", "text", "severity", "evidenceIds"], t);
|
|
2538
|
+
const i = $(
|
|
2549
2539
|
o.title,
|
|
2550
2540
|
`${n}.title`,
|
|
2551
2541
|
y.contentTitle,
|
|
2552
2542
|
t
|
|
2553
|
-
), l =
|
|
2543
|
+
), l = K(
|
|
2554
2544
|
o.severity,
|
|
2555
2545
|
`${n}.severity`,
|
|
2556
|
-
|
|
2546
|
+
kr,
|
|
2557
2547
|
"info, positive, warning, or critical",
|
|
2558
2548
|
t
|
|
2559
2549
|
);
|
|
2560
2550
|
return {
|
|
2561
2551
|
type: "finding",
|
|
2562
2552
|
...i ? { title: i } : {},
|
|
2563
|
-
text:
|
|
2553
|
+
text: T(
|
|
2564
2554
|
o.text,
|
|
2565
2555
|
`${n}.text`,
|
|
2566
2556
|
y.contentText,
|
|
@@ -2573,8 +2563,8 @@ function Vr(e, r, t) {
|
|
|
2573
2563
|
};
|
|
2574
2564
|
}
|
|
2575
2565
|
if (a === "bullets" || a === "actions" || a === "limitations") {
|
|
2576
|
-
|
|
2577
|
-
const i =
|
|
2566
|
+
I(o, n, ["type", "title", "items", "evidenceIds"], t);
|
|
2567
|
+
const i = $(
|
|
2578
2568
|
o.title,
|
|
2579
2569
|
`${n}.title`,
|
|
2580
2570
|
y.contentTitle,
|
|
@@ -2583,12 +2573,12 @@ function Vr(e, r, t) {
|
|
|
2583
2573
|
return {
|
|
2584
2574
|
type: a,
|
|
2585
2575
|
...i ? { title: i } : {},
|
|
2586
|
-
items:
|
|
2576
|
+
items: Pr(o.items, `${n}.items`, t),
|
|
2587
2577
|
...l ? { evidenceIds: l } : {}
|
|
2588
2578
|
};
|
|
2589
2579
|
}
|
|
2590
2580
|
if (a === "metric") {
|
|
2591
|
-
|
|
2581
|
+
I(
|
|
2592
2582
|
o,
|
|
2593
2583
|
n,
|
|
2594
2584
|
[
|
|
@@ -2603,33 +2593,33 @@ function Vr(e, r, t) {
|
|
|
2603
2593
|
],
|
|
2604
2594
|
t
|
|
2605
2595
|
);
|
|
2606
|
-
const i =
|
|
2607
|
-
i === "" &&
|
|
2596
|
+
const i = M(o.value, `${n}.value`, t) ?? "";
|
|
2597
|
+
i === "" && p(
|
|
2608
2598
|
t,
|
|
2609
2599
|
`${n}.value`,
|
|
2610
2600
|
"Expected a non-empty string, number, or structured numeric value."
|
|
2611
2601
|
);
|
|
2612
|
-
const l = o.previousValue === void 0 || o.previousValue === null ? o.previousValue :
|
|
2602
|
+
const l = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : M(
|
|
2613
2603
|
o.previousValue,
|
|
2614
2604
|
`${n}.previousValue`,
|
|
2615
2605
|
t
|
|
2616
|
-
), m = o.delta === void 0 || o.delta === null ? o.delta :
|
|
2606
|
+
), m = o.delta === void 0 || o.delta === null ? o.delta : M(
|
|
2617
2607
|
o.delta,
|
|
2618
2608
|
`${n}.delta`,
|
|
2619
2609
|
t
|
|
2620
|
-
), c = o.percentChange === void 0 || o.percentChange === null ? o.percentChange :
|
|
2610
|
+
), c = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : M(
|
|
2621
2611
|
o.percentChange,
|
|
2622
2612
|
`${n}.percentChange`,
|
|
2623
2613
|
t
|
|
2624
|
-
), s =
|
|
2614
|
+
), s = $(
|
|
2625
2615
|
o.unit,
|
|
2626
2616
|
`${n}.unit`,
|
|
2627
2617
|
y.contentTitle,
|
|
2628
2618
|
t
|
|
2629
|
-
),
|
|
2619
|
+
), f = R(o.evidenceIds, `${n}.evidenceIds`, t);
|
|
2630
2620
|
return {
|
|
2631
2621
|
type: "metric",
|
|
2632
|
-
label:
|
|
2622
|
+
label: T(
|
|
2633
2623
|
o.label,
|
|
2634
2624
|
`${n}.label`,
|
|
2635
2625
|
y.contentTitle,
|
|
@@ -2640,27 +2630,27 @@ function Vr(e, r, t) {
|
|
|
2640
2630
|
...m !== void 0 ? { delta: m } : {},
|
|
2641
2631
|
...c !== void 0 ? { percentChange: c } : {},
|
|
2642
2632
|
...s ? { unit: s } : {},
|
|
2643
|
-
...
|
|
2633
|
+
...f ? { evidenceIds: f } : {}
|
|
2644
2634
|
};
|
|
2645
2635
|
}
|
|
2646
2636
|
if (a === "kpi_grid") {
|
|
2647
|
-
|
|
2648
|
-
const i =
|
|
2637
|
+
I(o, n, ["type", "title", "tiles", "evidenceIds"], t);
|
|
2638
|
+
const i = $(
|
|
2649
2639
|
o.title,
|
|
2650
2640
|
`${n}.title`,
|
|
2651
2641
|
y.contentTitle,
|
|
2652
2642
|
t
|
|
2653
2643
|
), l = Array.isArray(o.tiles) ? o.tiles : [];
|
|
2654
|
-
Array.isArray(o.tiles) ||
|
|
2644
|
+
Array.isArray(o.tiles) || p(t, `${n}.tiles`, "Expected an array."), l.length === 0 && p(t, `${n}.tiles`, "Expected at least one tile."), l.length > F.maxKpiTiles && p(
|
|
2655
2645
|
t,
|
|
2656
2646
|
`${n}.tiles`,
|
|
2657
|
-
`Must have ${
|
|
2647
|
+
`Must have ${F.maxKpiTiles} tiles or fewer.`
|
|
2658
2648
|
);
|
|
2659
|
-
const m = l.slice(0,
|
|
2660
|
-
const
|
|
2661
|
-
|
|
2649
|
+
const m = l.slice(0, F.maxKpiTiles).map((s, f) => {
|
|
2650
|
+
const u = `${n}.tiles.${f}`, d = k(s, u, t);
|
|
2651
|
+
I(
|
|
2662
2652
|
d,
|
|
2663
|
-
|
|
2653
|
+
u,
|
|
2664
2654
|
[
|
|
2665
2655
|
"label",
|
|
2666
2656
|
"value",
|
|
@@ -2672,51 +2662,51 @@ function Vr(e, r, t) {
|
|
|
2672
2662
|
],
|
|
2673
2663
|
t
|
|
2674
2664
|
);
|
|
2675
|
-
const v =
|
|
2665
|
+
const v = M(
|
|
2676
2666
|
d.value,
|
|
2677
|
-
`${
|
|
2667
|
+
`${u}.value`,
|
|
2678
2668
|
t
|
|
2679
2669
|
) ?? "";
|
|
2680
|
-
v === "" &&
|
|
2670
|
+
v === "" && p(
|
|
2681
2671
|
t,
|
|
2682
|
-
`${
|
|
2672
|
+
`${u}.value`,
|
|
2683
2673
|
"Expected a non-empty string, number, or structured numeric value."
|
|
2684
2674
|
);
|
|
2685
|
-
const h = d.previousValue === void 0 || d.previousValue === null ? d.previousValue :
|
|
2675
|
+
const h = d.previousValue === void 0 || d.previousValue === null ? d.previousValue : M(
|
|
2686
2676
|
d.previousValue,
|
|
2687
|
-
`${
|
|
2677
|
+
`${u}.previousValue`,
|
|
2688
2678
|
t
|
|
2689
|
-
),
|
|
2679
|
+
), b = d.delta === void 0 || d.delta === null ? d.delta : M(
|
|
2690
2680
|
d.delta,
|
|
2691
|
-
`${
|
|
2681
|
+
`${u}.delta`,
|
|
2692
2682
|
t
|
|
2693
|
-
), w = d.percentChange === void 0 || d.percentChange === null ? d.percentChange :
|
|
2683
|
+
), w = d.percentChange === void 0 || d.percentChange === null ? d.percentChange : M(
|
|
2694
2684
|
d.percentChange,
|
|
2695
|
-
`${
|
|
2685
|
+
`${u}.percentChange`,
|
|
2696
2686
|
t
|
|
2697
|
-
), g =
|
|
2687
|
+
), g = $(
|
|
2698
2688
|
d.unit,
|
|
2699
|
-
`${
|
|
2689
|
+
`${u}.unit`,
|
|
2700
2690
|
y.contentTitle,
|
|
2701
2691
|
t
|
|
2702
|
-
),
|
|
2692
|
+
), C = R(
|
|
2703
2693
|
d.evidenceIds,
|
|
2704
|
-
`${
|
|
2694
|
+
`${u}.evidenceIds`,
|
|
2705
2695
|
t
|
|
2706
2696
|
);
|
|
2707
2697
|
return {
|
|
2708
|
-
label:
|
|
2698
|
+
label: T(
|
|
2709
2699
|
d.label,
|
|
2710
|
-
`${
|
|
2700
|
+
`${u}.label`,
|
|
2711
2701
|
y.contentTitle,
|
|
2712
2702
|
t
|
|
2713
2703
|
),
|
|
2714
2704
|
value: v,
|
|
2715
2705
|
...h !== void 0 ? { previousValue: h } : {},
|
|
2716
|
-
...
|
|
2706
|
+
...b !== void 0 ? { delta: b } : {},
|
|
2717
2707
|
...w !== void 0 ? { percentChange: w } : {},
|
|
2718
2708
|
...g ? { unit: g } : {},
|
|
2719
|
-
|
|
2709
|
+
...C ? { evidenceIds: C } : {}
|
|
2720
2710
|
};
|
|
2721
2711
|
}), c = R(
|
|
2722
2712
|
o.evidenceIds,
|
|
@@ -2731,10 +2721,10 @@ function Vr(e, r, t) {
|
|
|
2731
2721
|
};
|
|
2732
2722
|
}
|
|
2733
2723
|
if (a === "progress") {
|
|
2734
|
-
|
|
2724
|
+
I(o, n, ["type", "label", "value", "detail", "evidenceIds"], t);
|
|
2735
2725
|
const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
|
|
2736
|
-
(typeof o.value != "number" || !Number.isFinite(o.value)) &&
|
|
2737
|
-
const l =
|
|
2726
|
+
(typeof o.value != "number" || !Number.isFinite(o.value)) && p(t, `${n}.value`, "Expected a finite number.");
|
|
2727
|
+
const l = $(
|
|
2738
2728
|
o.detail,
|
|
2739
2729
|
`${n}.detail`,
|
|
2740
2730
|
y.contentText,
|
|
@@ -2742,7 +2732,7 @@ function Vr(e, r, t) {
|
|
|
2742
2732
|
), m = R(o.evidenceIds, `${n}.evidenceIds`, t);
|
|
2743
2733
|
return {
|
|
2744
2734
|
type: "progress",
|
|
2745
|
-
label:
|
|
2735
|
+
label: T(
|
|
2746
2736
|
o.label,
|
|
2747
2737
|
`${n}.label`,
|
|
2748
2738
|
y.contentTitle,
|
|
@@ -2754,46 +2744,46 @@ function Vr(e, r, t) {
|
|
|
2754
2744
|
};
|
|
2755
2745
|
}
|
|
2756
2746
|
if (a === "table") {
|
|
2757
|
-
|
|
2747
|
+
I(
|
|
2758
2748
|
o,
|
|
2759
2749
|
n,
|
|
2760
2750
|
["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
|
|
2761
2751
|
t
|
|
2762
2752
|
);
|
|
2763
|
-
const i =
|
|
2753
|
+
const i = Kr(o.columns, `${n}.columns`, t), l = $(
|
|
2764
2754
|
o.title,
|
|
2765
2755
|
`${n}.title`,
|
|
2766
2756
|
y.contentTitle,
|
|
2767
2757
|
t
|
|
2768
|
-
), m =
|
|
2758
|
+
), m = $(
|
|
2769
2759
|
o.id,
|
|
2770
2760
|
`${n}.id`,
|
|
2771
2761
|
y.id,
|
|
2772
2762
|
t
|
|
2773
|
-
), c =
|
|
2763
|
+
), c = $(
|
|
2774
2764
|
o.caption,
|
|
2775
2765
|
`${n}.caption`,
|
|
2776
2766
|
y.contentItem,
|
|
2777
2767
|
t
|
|
2778
|
-
), s =
|
|
2768
|
+
), s = Fr(
|
|
2779
2769
|
o.totalRows,
|
|
2780
2770
|
`${n}.totalRows`,
|
|
2781
2771
|
t
|
|
2782
|
-
),
|
|
2772
|
+
), f = R(o.evidenceIds, `${n}.evidenceIds`, t);
|
|
2783
2773
|
return {
|
|
2784
2774
|
type: "table",
|
|
2785
2775
|
...m ? { id: m } : {},
|
|
2786
2776
|
...l ? { title: l } : {},
|
|
2787
2777
|
columns: i,
|
|
2788
|
-
rows:
|
|
2778
|
+
rows: Or(o.rows, `${n}.rows`, i, t),
|
|
2789
2779
|
...c ? { caption: c } : {},
|
|
2790
2780
|
...s !== void 0 ? { totalRows: s } : {},
|
|
2791
|
-
...
|
|
2781
|
+
...f ? { evidenceIds: f } : {}
|
|
2792
2782
|
};
|
|
2793
2783
|
}
|
|
2794
2784
|
if (a === "evidence_appendix") {
|
|
2795
|
-
|
|
2796
|
-
const i =
|
|
2785
|
+
I(o, n, ["type", "title", "evidenceIds"], t);
|
|
2786
|
+
const i = $(
|
|
2797
2787
|
o.title,
|
|
2798
2788
|
`${n}.title`,
|
|
2799
2789
|
y.contentTitle,
|
|
@@ -2808,13 +2798,13 @@ function Vr(e, r, t) {
|
|
|
2808
2798
|
};
|
|
2809
2799
|
}
|
|
2810
2800
|
if (a === "sql") {
|
|
2811
|
-
|
|
2812
|
-
const i =
|
|
2801
|
+
I(o, n, ["type", "title", "sql", "evidenceIds"], t);
|
|
2802
|
+
const i = $(
|
|
2813
2803
|
o.title,
|
|
2814
2804
|
`${n}.title`,
|
|
2815
2805
|
y.contentTitle,
|
|
2816
2806
|
t
|
|
2817
|
-
), l =
|
|
2807
|
+
), l = T(
|
|
2818
2808
|
o.sql,
|
|
2819
2809
|
`${n}.sql`,
|
|
2820
2810
|
y.contentSql,
|
|
@@ -2827,7 +2817,7 @@ function Vr(e, r, t) {
|
|
|
2827
2817
|
...m ? { evidenceIds: m } : {}
|
|
2828
2818
|
};
|
|
2829
2819
|
}
|
|
2830
|
-
return
|
|
2820
|
+
return p(
|
|
2831
2821
|
t,
|
|
2832
2822
|
`${n}.type`,
|
|
2833
2823
|
"Expected heading, paragraph, finding, bullets, metric, kpi_grid, progress, table, actions, limitations, sql, or evidence_appendix."
|
|
@@ -2836,40 +2826,40 @@ function Vr(e, r, t) {
|
|
|
2836
2826
|
text: ""
|
|
2837
2827
|
};
|
|
2838
2828
|
}
|
|
2839
|
-
function
|
|
2829
|
+
function zr(e) {
|
|
2840
2830
|
const r = [], t = k(e, "content", r);
|
|
2841
|
-
|
|
2842
|
-
const n =
|
|
2831
|
+
I(t, "content", ["version", "title", "summary", "blocks"], r), t.version !== 1 && p(r, "content.version", "Expected version 1.");
|
|
2832
|
+
const n = $(
|
|
2843
2833
|
t.title,
|
|
2844
2834
|
"content.title",
|
|
2845
2835
|
y.contentTitle,
|
|
2846
2836
|
r
|
|
2847
|
-
), o =
|
|
2837
|
+
), o = $(
|
|
2848
2838
|
t.summary,
|
|
2849
2839
|
"content.summary",
|
|
2850
2840
|
y.contentSummary,
|
|
2851
2841
|
r
|
|
2852
2842
|
);
|
|
2853
|
-
Array.isArray(t.blocks) ||
|
|
2843
|
+
Array.isArray(t.blocks) || p(r, "content.blocks", "Expected an array.");
|
|
2854
2844
|
const a = Array.isArray(t.blocks) ? t.blocks : [];
|
|
2855
|
-
a.length === 0 &&
|
|
2845
|
+
a.length === 0 && p(r, "content.blocks", "Expected at least one block."), a.length > F.maxBlocks && p(
|
|
2856
2846
|
r,
|
|
2857
2847
|
"content.blocks",
|
|
2858
|
-
`Must have ${
|
|
2848
|
+
`Must have ${F.maxBlocks} blocks or fewer.`
|
|
2859
2849
|
);
|
|
2860
|
-
const i = a.slice(0,
|
|
2861
|
-
return
|
|
2850
|
+
const i = a.slice(0, F.maxBlocks).map((l, m) => Nr(l, m, r));
|
|
2851
|
+
return pe(r), {
|
|
2862
2852
|
version: 1,
|
|
2863
2853
|
...n ? { title: n } : {},
|
|
2864
2854
|
...o ? { summary: o } : {},
|
|
2865
2855
|
blocks: i
|
|
2866
2856
|
};
|
|
2867
2857
|
}
|
|
2868
|
-
function
|
|
2858
|
+
function jn(e) {
|
|
2869
2859
|
try {
|
|
2870
2860
|
return {
|
|
2871
2861
|
valid: !0,
|
|
2872
|
-
value:
|
|
2862
|
+
value: zr(e),
|
|
2873
2863
|
issues: []
|
|
2874
2864
|
};
|
|
2875
2865
|
} catch (r) {
|
|
@@ -2879,60 +2869,60 @@ function qn(e) {
|
|
|
2879
2869
|
}
|
|
2880
2870
|
}
|
|
2881
2871
|
function Y(e, r, t, n) {
|
|
2882
|
-
return typeof e == "string" && t.includes(e) ? e : (
|
|
2872
|
+
return typeof e == "string" && t.includes(e) ? e : (p(n, r, `Expected ${t.join(" or ")}.`), t[0]);
|
|
2883
2873
|
}
|
|
2884
|
-
function
|
|
2874
|
+
function K(e, r, t, n, o) {
|
|
2885
2875
|
if (e != null) {
|
|
2886
2876
|
if (typeof e == "string" && t.has(e))
|
|
2887
2877
|
return e;
|
|
2888
|
-
|
|
2878
|
+
p(o, r, `Expected ${n}.`);
|
|
2889
2879
|
}
|
|
2890
2880
|
}
|
|
2891
|
-
function
|
|
2881
|
+
function Lr(e, r, t) {
|
|
2892
2882
|
if (e != null) {
|
|
2893
2883
|
if (!Array.isArray(e)) {
|
|
2894
|
-
|
|
2884
|
+
p(t, r, "Expected an array.");
|
|
2895
2885
|
return;
|
|
2896
2886
|
}
|
|
2897
2887
|
return e;
|
|
2898
2888
|
}
|
|
2899
2889
|
}
|
|
2900
|
-
function
|
|
2890
|
+
function Vr(e, r, t) {
|
|
2901
2891
|
if (e != null) {
|
|
2902
2892
|
if (!ze(e)) {
|
|
2903
|
-
|
|
2893
|
+
p(t, r, "Expected an object.");
|
|
2904
2894
|
return;
|
|
2905
2895
|
}
|
|
2906
2896
|
return e;
|
|
2907
2897
|
}
|
|
2908
2898
|
}
|
|
2909
|
-
function
|
|
2899
|
+
function Ur(e, r, t) {
|
|
2910
2900
|
if (e == null)
|
|
2911
2901
|
return;
|
|
2912
2902
|
const n = k(e, r, t);
|
|
2913
|
-
|
|
2914
|
-
const o = {}, a =
|
|
2903
|
+
I(n, r, Sr, t);
|
|
2904
|
+
const o = {}, a = K(
|
|
2915
2905
|
n.pageSize,
|
|
2916
2906
|
`${r}.pageSize`,
|
|
2917
|
-
|
|
2907
|
+
Ir,
|
|
2918
2908
|
"letter, legal, a4, a3, or tabloid",
|
|
2919
2909
|
t
|
|
2920
|
-
), i =
|
|
2910
|
+
), i = K(
|
|
2921
2911
|
n.orientation,
|
|
2922
2912
|
`${r}.orientation`,
|
|
2923
|
-
|
|
2913
|
+
wr,
|
|
2924
2914
|
"portrait or landscape",
|
|
2925
2915
|
t
|
|
2926
|
-
), l =
|
|
2916
|
+
), l = K(
|
|
2927
2917
|
n.delimiter,
|
|
2928
2918
|
`${r}.delimiter`,
|
|
2929
|
-
|
|
2919
|
+
Cr,
|
|
2930
2920
|
"comma, semicolon, or tab",
|
|
2931
2921
|
t
|
|
2932
|
-
), m =
|
|
2922
|
+
), m = K(
|
|
2933
2923
|
n.sheetSelection,
|
|
2934
2924
|
`${r}.sheetSelection`,
|
|
2935
|
-
|
|
2925
|
+
Tr,
|
|
2936
2926
|
"current or all",
|
|
2937
2927
|
t
|
|
2938
2928
|
);
|
|
@@ -2946,7 +2936,7 @@ function qr(e, r, t) {
|
|
|
2946
2936
|
])
|
|
2947
2937
|
if (!(n[c] === void 0 || n[c] === null)) {
|
|
2948
2938
|
if (typeof n[c] != "boolean") {
|
|
2949
|
-
|
|
2939
|
+
p(t, `${r}.${c}`, "Expected a boolean.");
|
|
2950
2940
|
continue;
|
|
2951
2941
|
}
|
|
2952
2942
|
o[c] = n[c];
|
|
@@ -2959,7 +2949,7 @@ function qr(e, r, t) {
|
|
|
2959
2949
|
"cardType",
|
|
2960
2950
|
"theme"
|
|
2961
2951
|
]) {
|
|
2962
|
-
const s =
|
|
2952
|
+
const s = $(
|
|
2963
2953
|
n[c],
|
|
2964
2954
|
`${r}.${c}`,
|
|
2965
2955
|
y.id,
|
|
@@ -2975,7 +2965,7 @@ function qr(e, r, t) {
|
|
|
2975
2965
|
"cardControlDefinitions",
|
|
2976
2966
|
"controlBindings"
|
|
2977
2967
|
]) {
|
|
2978
|
-
const s =
|
|
2968
|
+
const s = Lr(n[c], `${r}.${c}`, t);
|
|
2979
2969
|
s && (o[c] = s);
|
|
2980
2970
|
}
|
|
2981
2971
|
for (const c of [
|
|
@@ -2983,13 +2973,13 @@ function qr(e, r, t) {
|
|
|
2983
2973
|
"tablePreferences",
|
|
2984
2974
|
"dashboardInputExecutionSnapshot"
|
|
2985
2975
|
]) {
|
|
2986
|
-
const s =
|
|
2976
|
+
const s = Vr(n[c], `${r}.${c}`, t);
|
|
2987
2977
|
s && (o[c] = s);
|
|
2988
2978
|
}
|
|
2989
2979
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
2990
2980
|
}
|
|
2991
2981
|
function ne(e, r, t, n) {
|
|
2992
|
-
const o =
|
|
2982
|
+
const o = $(
|
|
2993
2983
|
r,
|
|
2994
2984
|
t,
|
|
2995
2985
|
y.attachmentTitle,
|
|
@@ -2998,13 +2988,13 @@ function ne(e, r, t, n) {
|
|
|
2998
2988
|
return o && (e.title = o), e;
|
|
2999
2989
|
}
|
|
3000
2990
|
function oe(e, r, t, n) {
|
|
3001
|
-
const o =
|
|
2991
|
+
const o = Ur(r, t, n);
|
|
3002
2992
|
return o && (e.settings = o), e;
|
|
3003
2993
|
}
|
|
3004
|
-
function
|
|
2994
|
+
function jr(e, r, t) {
|
|
3005
2995
|
const n = `attachments.${r}`, o = k(e, n, t), a = o.type;
|
|
3006
2996
|
if (a === "dashboard") {
|
|
3007
|
-
|
|
2997
|
+
I(
|
|
3008
2998
|
o,
|
|
3009
2999
|
n,
|
|
3010
3000
|
["type", "dashboardId", "format", "title", "settings"],
|
|
@@ -3013,7 +3003,7 @@ function Gr(e, r, t) {
|
|
|
3013
3003
|
const i = ne(
|
|
3014
3004
|
{
|
|
3015
3005
|
type: "dashboard",
|
|
3016
|
-
dashboardId:
|
|
3006
|
+
dashboardId: T(
|
|
3017
3007
|
o.dashboardId,
|
|
3018
3008
|
`${n}.dashboardId`,
|
|
3019
3009
|
y.id,
|
|
@@ -3028,7 +3018,7 @@ function Gr(e, r, t) {
|
|
|
3028
3018
|
return oe(i, o.settings, `${n}.settings`, t);
|
|
3029
3019
|
}
|
|
3030
3020
|
if (a === "dashboard_sheet" || a === "document_sheet") {
|
|
3031
|
-
|
|
3021
|
+
I(
|
|
3032
3022
|
o,
|
|
3033
3023
|
n,
|
|
3034
3024
|
["type", "dashboardId", "sheetId", "format", "title", "settings"],
|
|
@@ -3037,13 +3027,13 @@ function Gr(e, r, t) {
|
|
|
3037
3027
|
const i = ne(
|
|
3038
3028
|
{
|
|
3039
3029
|
type: a,
|
|
3040
|
-
dashboardId:
|
|
3030
|
+
dashboardId: T(
|
|
3041
3031
|
o.dashboardId,
|
|
3042
3032
|
`${n}.dashboardId`,
|
|
3043
3033
|
y.id,
|
|
3044
3034
|
t
|
|
3045
3035
|
),
|
|
3046
|
-
sheetId:
|
|
3036
|
+
sheetId: T(
|
|
3047
3037
|
o.sheetId,
|
|
3048
3038
|
`${n}.sheetId`,
|
|
3049
3039
|
y.id,
|
|
@@ -3058,7 +3048,7 @@ function Gr(e, r, t) {
|
|
|
3058
3048
|
return oe(i, o.settings, `${n}.settings`, t);
|
|
3059
3049
|
}
|
|
3060
3050
|
if (a === "card") {
|
|
3061
|
-
|
|
3051
|
+
I(
|
|
3062
3052
|
o,
|
|
3063
3053
|
n,
|
|
3064
3054
|
["type", "dashboardId", "cardId", "format", "title", "settings"],
|
|
@@ -3067,13 +3057,13 @@ function Gr(e, r, t) {
|
|
|
3067
3057
|
const i = ne(
|
|
3068
3058
|
{
|
|
3069
3059
|
type: "card",
|
|
3070
|
-
dashboardId:
|
|
3060
|
+
dashboardId: T(
|
|
3071
3061
|
o.dashboardId,
|
|
3072
3062
|
`${n}.dashboardId`,
|
|
3073
3063
|
y.id,
|
|
3074
3064
|
t
|
|
3075
3065
|
),
|
|
3076
|
-
cardId:
|
|
3066
|
+
cardId: T(
|
|
3077
3067
|
o.cardId,
|
|
3078
3068
|
`${n}.cardId`,
|
|
3079
3069
|
y.id,
|
|
@@ -3092,13 +3082,13 @@ function Gr(e, r, t) {
|
|
|
3092
3082
|
);
|
|
3093
3083
|
return oe(i, o.settings, `${n}.settings`, t);
|
|
3094
3084
|
}
|
|
3095
|
-
return
|
|
3085
|
+
return p(
|
|
3096
3086
|
t,
|
|
3097
3087
|
`${n}.type`,
|
|
3098
3088
|
"Expected dashboard, dashboard_sheet, document_sheet, or card."
|
|
3099
3089
|
), { type: "dashboard", dashboardId: "", format: "pdf" };
|
|
3100
3090
|
}
|
|
3101
|
-
function
|
|
3091
|
+
function qr(e) {
|
|
3102
3092
|
switch (e.type) {
|
|
3103
3093
|
case "dashboard":
|
|
3104
3094
|
return `${e.type}:${e.dashboardId}:${e.format}`;
|
|
@@ -3113,23 +3103,23 @@ function qe(e, r) {
|
|
|
3113
3103
|
if (e == null)
|
|
3114
3104
|
return [];
|
|
3115
3105
|
if (!Array.isArray(e))
|
|
3116
|
-
return
|
|
3117
|
-
e.length > te &&
|
|
3106
|
+
return p(r, "attachments", "Expected an array."), [];
|
|
3107
|
+
e.length > te && p(
|
|
3118
3108
|
r,
|
|
3119
3109
|
"attachments",
|
|
3120
3110
|
`Choose ${te} attachments or fewer.`
|
|
3121
3111
|
);
|
|
3122
|
-
const t = e.slice(0, te).map((o, a) =>
|
|
3112
|
+
const t = e.slice(0, te).map((o, a) => jr(o, a, r)), n = /* @__PURE__ */ new Set();
|
|
3123
3113
|
return t.forEach((o, a) => {
|
|
3124
|
-
const i =
|
|
3125
|
-
n.has(i) &&
|
|
3114
|
+
const i = qr(o);
|
|
3115
|
+
n.has(i) && p(r, `attachments.${a}`, "Duplicate attachment."), n.add(i);
|
|
3126
3116
|
}), t;
|
|
3127
3117
|
}
|
|
3128
3118
|
function Ge(e, r) {
|
|
3129
3119
|
if (e == null)
|
|
3130
3120
|
return;
|
|
3131
3121
|
const t = k(e, "limits", r);
|
|
3132
|
-
|
|
3122
|
+
I(t, "limits", Object.keys(re), r);
|
|
3133
3123
|
const n = {};
|
|
3134
3124
|
return Object.keys(re).forEach((o) => {
|
|
3135
3125
|
const a = t[o];
|
|
@@ -3137,7 +3127,7 @@ function Ge(e, r) {
|
|
|
3137
3127
|
return;
|
|
3138
3128
|
const i = re[o];
|
|
3139
3129
|
if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
|
|
3140
|
-
|
|
3130
|
+
p(
|
|
3141
3131
|
r,
|
|
3142
3132
|
`limits.${o}`,
|
|
3143
3133
|
`Expected an integer between ${i.min} and ${i.max}.`
|
|
@@ -3147,18 +3137,18 @@ function Ge(e, r) {
|
|
|
3147
3137
|
n[o] = a;
|
|
3148
3138
|
}), Object.keys(n).length > 0 ? n : void 0;
|
|
3149
3139
|
}
|
|
3150
|
-
function
|
|
3140
|
+
function pe(e) {
|
|
3151
3141
|
if (e.length > 0)
|
|
3152
3142
|
throw new X(e);
|
|
3153
3143
|
}
|
|
3154
3144
|
function He(e, r, t) {
|
|
3155
|
-
!(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 &&
|
|
3145
|
+
!(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 && p(
|
|
3156
3146
|
t,
|
|
3157
3147
|
"body",
|
|
3158
3148
|
"Add briefing instructions, a custom message, or at least one attachment."
|
|
3159
3149
|
);
|
|
3160
3150
|
}
|
|
3161
|
-
function
|
|
3151
|
+
function Gr(e, r, t) {
|
|
3162
3152
|
e == null || e.forEach((n, o) => {
|
|
3163
3153
|
const a = `${t}.${o}.scope`, i = n.scope.attachmentIndex;
|
|
3164
3154
|
if (i === void 0)
|
|
@@ -3182,7 +3172,7 @@ function Wr(e, r, t) {
|
|
|
3182
3172
|
}
|
|
3183
3173
|
function We(e) {
|
|
3184
3174
|
const r = [], t = k(e, "jobConfig", r);
|
|
3185
|
-
|
|
3175
|
+
I(
|
|
3186
3176
|
t,
|
|
3187
3177
|
"jobConfig",
|
|
3188
3178
|
[
|
|
@@ -3195,7 +3185,7 @@ function We(e) {
|
|
|
3195
3185
|
"limits"
|
|
3196
3186
|
],
|
|
3197
3187
|
r
|
|
3198
|
-
), t.kind !== ce &&
|
|
3188
|
+
), t.kind !== ce && p(r, "kind", "Expected BRIEFING.");
|
|
3199
3189
|
let n;
|
|
3200
3190
|
try {
|
|
3201
3191
|
n = lt(
|
|
@@ -3204,18 +3194,18 @@ function We(e) {
|
|
|
3204
3194
|
} catch (c) {
|
|
3205
3195
|
if (c instanceof U)
|
|
3206
3196
|
throw c;
|
|
3207
|
-
|
|
3197
|
+
p(
|
|
3208
3198
|
r,
|
|
3209
3199
|
"jobConfig.presentationExecutionSnapshot",
|
|
3210
3200
|
c instanceof Error ? c.message : "Invalid presentation snapshot."
|
|
3211
3201
|
);
|
|
3212
3202
|
}
|
|
3213
|
-
const o =
|
|
3214
|
-
return He(a, i, r),
|
|
3203
|
+
const o = Le(t.source, r), a = Ve(t.body, r), i = qe(t.attachments, r), l = Ue(t.presentation, r), m = Ge(t.limits, r);
|
|
3204
|
+
return He(a, i, r), Gr(
|
|
3215
3205
|
n == null ? void 0 : n.resolvedFormats,
|
|
3216
3206
|
i,
|
|
3217
3207
|
"jobConfig.presentationExecutionSnapshot.resolvedFormats"
|
|
3218
|
-
),
|
|
3208
|
+
), pe(r), {
|
|
3219
3209
|
kind: ce,
|
|
3220
3210
|
presentationExecutionSnapshot: n,
|
|
3221
3211
|
source: o,
|
|
@@ -3225,75 +3215,75 @@ function We(e) {
|
|
|
3225
3215
|
...m ? { limits: m } : {}
|
|
3226
3216
|
};
|
|
3227
3217
|
}
|
|
3228
|
-
function
|
|
3218
|
+
function qn(e) {
|
|
3229
3219
|
return We({
|
|
3230
3220
|
...e,
|
|
3231
3221
|
kind: ce
|
|
3232
3222
|
});
|
|
3233
3223
|
}
|
|
3234
|
-
function
|
|
3224
|
+
function ye(e, r, t, n = "deliveryConfig.recipients") {
|
|
3235
3225
|
const o = `${n}.${r}`, a = k(e, o, t), i = a.type;
|
|
3236
3226
|
if (i === "email") {
|
|
3237
|
-
|
|
3238
|
-
const l =
|
|
3227
|
+
I(a, o, ["type", "address", "name"], t);
|
|
3228
|
+
const l = T(
|
|
3239
3229
|
a.address,
|
|
3240
3230
|
`${o}.address`,
|
|
3241
3231
|
y.id,
|
|
3242
3232
|
t
|
|
3243
|
-
), m =
|
|
3233
|
+
), m = $(
|
|
3244
3234
|
a.name,
|
|
3245
3235
|
`${o}.name`,
|
|
3246
3236
|
y.attachmentTitle,
|
|
3247
3237
|
t
|
|
3248
3238
|
);
|
|
3249
|
-
return l && !
|
|
3239
|
+
return l && !Ar(l) && p(t, `${o}.address`, "Email address is invalid."), {
|
|
3250
3240
|
type: "email",
|
|
3251
3241
|
address: l,
|
|
3252
3242
|
...m ? { name: m } : {}
|
|
3253
3243
|
};
|
|
3254
3244
|
}
|
|
3255
|
-
return i === "user" ? (
|
|
3245
|
+
return i === "user" ? (I(a, o, ["type", "userId"], t), {
|
|
3256
3246
|
type: "user",
|
|
3257
|
-
userId:
|
|
3247
|
+
userId: T(
|
|
3258
3248
|
a.userId,
|
|
3259
3249
|
`${o}.userId`,
|
|
3260
3250
|
y.id,
|
|
3261
3251
|
t
|
|
3262
3252
|
)
|
|
3263
|
-
}) : i === "tenant_user" ? (
|
|
3253
|
+
}) : i === "tenant_user" ? (I(a, o, ["type", "tenantUserId"], t), {
|
|
3264
3254
|
type: "tenant_user",
|
|
3265
|
-
tenantUserId:
|
|
3255
|
+
tenantUserId: T(
|
|
3266
3256
|
a.tenantUserId,
|
|
3267
3257
|
`${o}.tenantUserId`,
|
|
3268
3258
|
y.id,
|
|
3269
3259
|
t
|
|
3270
3260
|
)
|
|
3271
|
-
}) : i === "group" ? (
|
|
3261
|
+
}) : i === "group" ? (I(a, o, ["type", "groupId"], t), {
|
|
3272
3262
|
type: "group",
|
|
3273
|
-
groupId:
|
|
3263
|
+
groupId: T(
|
|
3274
3264
|
a.groupId,
|
|
3275
3265
|
`${o}.groupId`,
|
|
3276
3266
|
y.id,
|
|
3277
3267
|
t
|
|
3278
3268
|
)
|
|
3279
|
-
}) : (
|
|
3269
|
+
}) : (p(
|
|
3280
3270
|
t,
|
|
3281
3271
|
`${o}.type`,
|
|
3282
3272
|
"Expected email, user, tenant_user, or group."
|
|
3283
3273
|
), { type: "email", address: "" });
|
|
3284
3274
|
}
|
|
3285
|
-
function
|
|
3275
|
+
function Hr(e, r) {
|
|
3286
3276
|
return e == null ? [] : Array.isArray(e) ? e.map(
|
|
3287
|
-
(t, n) =>
|
|
3288
|
-
) : (
|
|
3277
|
+
(t, n) => ye(t, n, r)
|
|
3278
|
+
) : (p(r, "deliveryConfig.recipients", "Expected an array."), []);
|
|
3289
3279
|
}
|
|
3290
|
-
function
|
|
3280
|
+
function Wr(e, r) {
|
|
3291
3281
|
if (!Array.isArray(e))
|
|
3292
|
-
return
|
|
3282
|
+
return p(r, "deliveryConfig.channels", "Expected an array."), [];
|
|
3293
3283
|
const t = [];
|
|
3294
3284
|
return e.forEach((n, o) => {
|
|
3295
3285
|
if (!Ye(n)) {
|
|
3296
|
-
|
|
3286
|
+
p(
|
|
3297
3287
|
r,
|
|
3298
3288
|
`deliveryConfig.channels.${o}`,
|
|
3299
3289
|
"Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM."
|
|
@@ -3303,51 +3293,51 @@ function Zr(e, r) {
|
|
|
3303
3293
|
t.includes(n) || t.push(n);
|
|
3304
3294
|
}), t;
|
|
3305
3295
|
}
|
|
3306
|
-
function
|
|
3296
|
+
function Yr(e, r, t) {
|
|
3307
3297
|
if (e == null)
|
|
3308
3298
|
return;
|
|
3309
3299
|
const n = k(e, r, t), o = {};
|
|
3310
3300
|
return Object.entries(n).forEach(([a, i]) => {
|
|
3311
3301
|
if (typeof i != "string") {
|
|
3312
|
-
|
|
3302
|
+
p(t, `${r}.${a}`, "Expected a string.");
|
|
3313
3303
|
return;
|
|
3314
3304
|
}
|
|
3315
3305
|
o[a] = i.trim();
|
|
3316
3306
|
}), Object.keys(o).length > 0 ? o : void 0;
|
|
3317
3307
|
}
|
|
3318
|
-
function
|
|
3308
|
+
function Zr(e, r, t) {
|
|
3319
3309
|
if (e == null)
|
|
3320
3310
|
return;
|
|
3321
3311
|
const n = k(e, r, t);
|
|
3322
|
-
|
|
3312
|
+
I(
|
|
3323
3313
|
n,
|
|
3324
3314
|
r,
|
|
3325
3315
|
["url", "method", "headers", "secretEncrypted"],
|
|
3326
3316
|
t
|
|
3327
3317
|
);
|
|
3328
|
-
const o = n.method === void 0 || n.method === null ? void 0 : Y(n.method, `${r}.method`, ["POST", "PUT"], t), a =
|
|
3318
|
+
const o = n.method === void 0 || n.method === null ? void 0 : Y(n.method, `${r}.method`, ["POST", "PUT"], t), a = Yr(n.headers, `${r}.headers`, t), i = $(
|
|
3329
3319
|
n.secretEncrypted,
|
|
3330
3320
|
`${r}.secretEncrypted`,
|
|
3331
3321
|
2e3,
|
|
3332
3322
|
t
|
|
3333
3323
|
);
|
|
3334
3324
|
return {
|
|
3335
|
-
url:
|
|
3325
|
+
url: T(n.url, `${r}.url`, 2e3, t),
|
|
3336
3326
|
...o ? { method: o } : {},
|
|
3337
3327
|
...a ? { headers: a } : {},
|
|
3338
3328
|
...i ? { secretEncrypted: i } : {}
|
|
3339
3329
|
};
|
|
3340
3330
|
}
|
|
3341
|
-
function
|
|
3331
|
+
function Jr(e, r, t) {
|
|
3342
3332
|
const n = k(e, r, t), o = n.type;
|
|
3343
3333
|
if (o === "channel") {
|
|
3344
|
-
|
|
3334
|
+
I(
|
|
3345
3335
|
n,
|
|
3346
3336
|
r,
|
|
3347
3337
|
["type", "channelId", "channelName", "isPrivate"],
|
|
3348
3338
|
t
|
|
3349
3339
|
);
|
|
3350
|
-
const a =
|
|
3340
|
+
const a = $(
|
|
3351
3341
|
n.channelName,
|
|
3352
3342
|
`${r}.channelName`,
|
|
3353
3343
|
y.attachmentTitle,
|
|
@@ -3360,7 +3350,7 @@ function Xr(e, r, t) {
|
|
|
3360
3350
|
);
|
|
3361
3351
|
return {
|
|
3362
3352
|
type: "channel",
|
|
3363
|
-
channelId:
|
|
3353
|
+
channelId: T(
|
|
3364
3354
|
n.channelId,
|
|
3365
3355
|
`${r}.channelId`,
|
|
3366
3356
|
y.id,
|
|
@@ -3370,32 +3360,32 @@ function Xr(e, r, t) {
|
|
|
3370
3360
|
...i !== void 0 ? { isPrivate: i } : {}
|
|
3371
3361
|
};
|
|
3372
3362
|
}
|
|
3373
|
-
return o === "dm" ? (
|
|
3363
|
+
return o === "dm" ? (I(n, r, ["type", "recipient"], t), p(
|
|
3374
3364
|
t,
|
|
3375
3365
|
`${r}.type`,
|
|
3376
3366
|
"Slack DM delivery is not supported in V1."
|
|
3377
3367
|
), {
|
|
3378
3368
|
type: "dm",
|
|
3379
|
-
recipient:
|
|
3380
|
-
}) : (
|
|
3369
|
+
recipient: ye(n.recipient, 0, t, `${r}.recipient`)
|
|
3370
|
+
}) : (p(t, `${r}.type`, "Expected channel."), { type: "channel", channelId: "" });
|
|
3381
3371
|
}
|
|
3382
|
-
function
|
|
3372
|
+
function Qr(e, r, t) {
|
|
3383
3373
|
if (e == null)
|
|
3384
3374
|
return;
|
|
3385
3375
|
if (!Array.isArray(e)) {
|
|
3386
|
-
|
|
3376
|
+
p(t, r, "Expected an array.");
|
|
3387
3377
|
return;
|
|
3388
3378
|
}
|
|
3389
3379
|
const n = e.map(
|
|
3390
|
-
(o, a) =>
|
|
3380
|
+
(o, a) => ye(o, a, t, r)
|
|
3391
3381
|
);
|
|
3392
3382
|
return n.length > 0 ? n : void 0;
|
|
3393
3383
|
}
|
|
3394
|
-
function
|
|
3384
|
+
function Xr(e, r, t) {
|
|
3395
3385
|
if (e == null)
|
|
3396
3386
|
return;
|
|
3397
3387
|
const n = k(e, r, t);
|
|
3398
|
-
|
|
3388
|
+
I(
|
|
3399
3389
|
n,
|
|
3400
3390
|
r,
|
|
3401
3391
|
[
|
|
@@ -3407,7 +3397,7 @@ function tn(e, r, t) {
|
|
|
3407
3397
|
],
|
|
3408
3398
|
t
|
|
3409
3399
|
);
|
|
3410
|
-
const o =
|
|
3400
|
+
const o = Qr(
|
|
3411
3401
|
n.threadMentions,
|
|
3412
3402
|
`${r}.threadMentions`,
|
|
3413
3403
|
t
|
|
@@ -3428,7 +3418,7 @@ function tn(e, r, t) {
|
|
|
3428
3418
|
t
|
|
3429
3419
|
);
|
|
3430
3420
|
return {
|
|
3431
|
-
destination:
|
|
3421
|
+
destination: Jr(
|
|
3432
3422
|
n.destination,
|
|
3433
3423
|
`${r}.destination`,
|
|
3434
3424
|
t
|
|
@@ -3439,9 +3429,9 @@ function tn(e, r, t) {
|
|
|
3439
3429
|
...n.includeBriefingLink !== void 0 ? { includeBriefingLink: l } : {}
|
|
3440
3430
|
};
|
|
3441
3431
|
}
|
|
3442
|
-
function
|
|
3432
|
+
function en(e, r, t) {
|
|
3443
3433
|
const n = k(e, r, t);
|
|
3444
|
-
|
|
3434
|
+
I(
|
|
3445
3435
|
n,
|
|
3446
3436
|
r,
|
|
3447
3437
|
[
|
|
@@ -3455,23 +3445,23 @@ function rn(e, r, t) {
|
|
|
3455
3445
|
],
|
|
3456
3446
|
t
|
|
3457
3447
|
);
|
|
3458
|
-
const o =
|
|
3448
|
+
const o = K(
|
|
3459
3449
|
n.formatProfile,
|
|
3460
3450
|
`${r}.formatProfile`,
|
|
3461
|
-
|
|
3451
|
+
$r,
|
|
3462
3452
|
"concise, balanced, or detailed",
|
|
3463
3453
|
t
|
|
3464
|
-
), a =
|
|
3454
|
+
), a = $(
|
|
3465
3455
|
n.subjectOverride,
|
|
3466
3456
|
`${r}.subjectOverride`,
|
|
3467
3457
|
500,
|
|
3468
3458
|
t
|
|
3469
|
-
), i =
|
|
3459
|
+
), i = $(
|
|
3470
3460
|
n.titleOverride,
|
|
3471
3461
|
`${r}.titleOverride`,
|
|
3472
3462
|
500,
|
|
3473
3463
|
t
|
|
3474
|
-
), l =
|
|
3464
|
+
), l = $(
|
|
3475
3465
|
n.summaryOverride,
|
|
3476
3466
|
`${r}.summaryOverride`,
|
|
3477
3467
|
2e3,
|
|
@@ -3481,11 +3471,11 @@ function rn(e, r, t) {
|
|
|
3481
3471
|
!0,
|
|
3482
3472
|
`${r}.actionBlockVisible`,
|
|
3483
3473
|
t
|
|
3484
|
-
), c =
|
|
3474
|
+
), c = Zr(
|
|
3485
3475
|
n.webhookConfig,
|
|
3486
3476
|
`${r}.webhookConfig`,
|
|
3487
3477
|
t
|
|
3488
|
-
), s =
|
|
3478
|
+
), s = Xr(
|
|
3489
3479
|
n.slackConfig,
|
|
3490
3480
|
`${r}.slackConfig`,
|
|
3491
3481
|
t
|
|
@@ -3500,53 +3490,53 @@ function rn(e, r, t) {
|
|
|
3500
3490
|
...c ? { webhookConfig: c } : {}
|
|
3501
3491
|
};
|
|
3502
3492
|
}
|
|
3503
|
-
function
|
|
3493
|
+
function tn(e, r) {
|
|
3504
3494
|
if (e == null)
|
|
3505
3495
|
return;
|
|
3506
3496
|
const t = k(e, "deliveryConfig.channelConfigs", r), n = {};
|
|
3507
3497
|
return Object.entries(t).forEach(([o, a]) => {
|
|
3508
3498
|
if (!Ye(o)) {
|
|
3509
|
-
|
|
3499
|
+
p(
|
|
3510
3500
|
r,
|
|
3511
3501
|
`deliveryConfig.channelConfigs.${o}`,
|
|
3512
3502
|
"Expected a supported delivery channel."
|
|
3513
3503
|
);
|
|
3514
3504
|
return;
|
|
3515
3505
|
}
|
|
3516
|
-
n[o] =
|
|
3506
|
+
n[o] = en(
|
|
3517
3507
|
a,
|
|
3518
3508
|
`deliveryConfig.channelConfigs.${o}`,
|
|
3519
3509
|
r
|
|
3520
3510
|
);
|
|
3521
3511
|
}), Object.keys(n).length > 0 ? n : void 0;
|
|
3522
3512
|
}
|
|
3523
|
-
function
|
|
3513
|
+
function rn(e, r) {
|
|
3524
3514
|
var m, c, s;
|
|
3525
3515
|
if (e == null)
|
|
3526
3516
|
return null;
|
|
3527
3517
|
const t = k(e, "deliveryConfig", r);
|
|
3528
|
-
|
|
3518
|
+
I(
|
|
3529
3519
|
t,
|
|
3530
3520
|
"deliveryConfig",
|
|
3531
3521
|
["recipients", "channels", "channelConfigs"],
|
|
3532
3522
|
r
|
|
3533
3523
|
);
|
|
3534
|
-
const n =
|
|
3524
|
+
const n = tn(t.channelConfigs, r), o = Hr(t.recipients, r), a = Wr(t.channels, r), i = ((c = (m = n == null ? void 0 : n.SLACK) == null ? void 0 : m.slackConfig) == null ? void 0 : c.destination.type) === "channel" && !!n.SLACK.slackConfig.destination.channelId.trim();
|
|
3535
3525
|
return a.some(
|
|
3536
|
-
(
|
|
3537
|
-
) && o.length === 0 &&
|
|
3526
|
+
(f) => f !== "SLACK"
|
|
3527
|
+
) && o.length === 0 && p(
|
|
3538
3528
|
r,
|
|
3539
3529
|
"deliveryConfig.recipients",
|
|
3540
3530
|
"Add at least one recipient or remove delivery config."
|
|
3541
|
-
), a.length === 0 &&
|
|
3531
|
+
), a.length === 0 && p(
|
|
3542
3532
|
r,
|
|
3543
3533
|
"deliveryConfig.channels",
|
|
3544
3534
|
"Choose at least one delivery channel or remove delivery config."
|
|
3545
|
-
), a.includes("SLACK") && !i &&
|
|
3535
|
+
), a.includes("SLACK") && !i && p(
|
|
3546
3536
|
r,
|
|
3547
3537
|
"deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
|
|
3548
3538
|
"Choose a Slack channel destination."
|
|
3549
|
-
), !a.includes("SLACK") && ((s = n == null ? void 0 : n.SLACK) != null && s.slackConfig) &&
|
|
3539
|
+
), !a.includes("SLACK") && ((s = n == null ? void 0 : n.SLACK) != null && s.slackConfig) && p(
|
|
3550
3540
|
r,
|
|
3551
3541
|
"deliveryConfig.channelConfigs.SLACK",
|
|
3552
3542
|
"Slack config requires SLACK in deliveryConfig.channels."
|
|
@@ -3556,9 +3546,9 @@ function on(e, r) {
|
|
|
3556
3546
|
...n ? { channelConfigs: n } : {}
|
|
3557
3547
|
};
|
|
3558
3548
|
}
|
|
3559
|
-
function
|
|
3549
|
+
function he(e) {
|
|
3560
3550
|
const r = [], t = k(e, "draft", r);
|
|
3561
|
-
|
|
3551
|
+
I(
|
|
3562
3552
|
t,
|
|
3563
3553
|
"draft",
|
|
3564
3554
|
[
|
|
@@ -3576,18 +3566,18 @@ function ge(e) {
|
|
|
3576
3566
|
],
|
|
3577
3567
|
r
|
|
3578
3568
|
);
|
|
3579
|
-
const n =
|
|
3569
|
+
const n = T(
|
|
3580
3570
|
t.name,
|
|
3581
3571
|
"name",
|
|
3582
3572
|
y.name,
|
|
3583
3573
|
r
|
|
3584
|
-
), o =
|
|
3574
|
+
), o = $(
|
|
3585
3575
|
t.description,
|
|
3586
3576
|
"description",
|
|
3587
3577
|
y.description,
|
|
3588
3578
|
r
|
|
3589
|
-
) ?? null, a =
|
|
3590
|
-
return He(c, s, r),
|
|
3579
|
+
) ?? null, a = $(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = $(t.timezone, "timezone", 200, r) ?? "UTC", l = Rr(t.status, r), m = Le(t.source, r), c = Ve(t.body, r), s = qe(t.attachments, r), f = Ue(t.presentation, r), u = Ge(t.limits, r), d = rn(t.deliveryConfig, r);
|
|
3580
|
+
return He(c, s, r), pe(r), {
|
|
3591
3581
|
name: n,
|
|
3592
3582
|
description: o,
|
|
3593
3583
|
status: l,
|
|
@@ -3596,27 +3586,27 @@ function ge(e) {
|
|
|
3596
3586
|
source: m,
|
|
3597
3587
|
body: c,
|
|
3598
3588
|
attachments: s,
|
|
3599
|
-
presentation:
|
|
3600
|
-
...
|
|
3589
|
+
presentation: f,
|
|
3590
|
+
...u ? { limits: u } : {},
|
|
3601
3591
|
deliveryConfig: d
|
|
3602
3592
|
};
|
|
3603
3593
|
}
|
|
3594
|
+
function Gn(e) {
|
|
3595
|
+
return he(e);
|
|
3596
|
+
}
|
|
3604
3597
|
function Hn(e) {
|
|
3605
|
-
return
|
|
3598
|
+
return he(e);
|
|
3606
3599
|
}
|
|
3607
3600
|
function Wn(e) {
|
|
3608
|
-
return ge(e);
|
|
3609
|
-
}
|
|
3610
|
-
function Yn(e) {
|
|
3611
3601
|
try {
|
|
3612
|
-
return { valid: !0, value:
|
|
3602
|
+
return { valid: !0, value: he(e), issues: [] };
|
|
3613
3603
|
} catch (r) {
|
|
3614
3604
|
if (r instanceof X)
|
|
3615
3605
|
return { valid: !1, issues: r.issues };
|
|
3616
3606
|
throw r;
|
|
3617
3607
|
}
|
|
3618
3608
|
}
|
|
3619
|
-
function
|
|
3609
|
+
function Yn(e) {
|
|
3620
3610
|
try {
|
|
3621
3611
|
return { valid: !0, value: We(e), issues: [] };
|
|
3622
3612
|
} catch (r) {
|
|
@@ -3625,90 +3615,90 @@ function Zn(e) {
|
|
|
3625
3615
|
throw r;
|
|
3626
3616
|
}
|
|
3627
3617
|
}
|
|
3628
|
-
function
|
|
3618
|
+
function Zn(e) {
|
|
3629
3619
|
return typeof e == "string" && Ne.has(e);
|
|
3630
3620
|
}
|
|
3631
3621
|
function Ye(e) {
|
|
3632
|
-
return typeof e == "string" &&
|
|
3622
|
+
return typeof e == "string" && br.has(e);
|
|
3633
3623
|
}
|
|
3634
3624
|
export {
|
|
3635
3625
|
Pe as $,
|
|
3636
|
-
|
|
3626
|
+
Pn as A,
|
|
3637
3627
|
Q as B,
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3628
|
+
Bt as C,
|
|
3629
|
+
gn as D,
|
|
3630
|
+
kn as E,
|
|
3631
|
+
O as F,
|
|
3632
|
+
Cn as G,
|
|
3633
|
+
Et as H,
|
|
3634
|
+
Ft as I,
|
|
3635
|
+
Rt as J,
|
|
3636
|
+
zt as K,
|
|
3647
3637
|
me as L,
|
|
3648
|
-
|
|
3638
|
+
Dt as M,
|
|
3649
3639
|
Lt as N,
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3640
|
+
$n as O,
|
|
3641
|
+
bn as P,
|
|
3642
|
+
Tn as Q,
|
|
3643
|
+
Ot as R,
|
|
3644
|
+
Nn as S,
|
|
3645
|
+
ur as T,
|
|
3646
|
+
Dn as U,
|
|
3647
|
+
cr as V,
|
|
3658
3648
|
Kn as W,
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3649
|
+
Mn as X,
|
|
3650
|
+
pr as Y,
|
|
3651
|
+
zn as Z,
|
|
3652
|
+
Ut as _,
|
|
3663
3653
|
Ln as a,
|
|
3664
|
-
|
|
3665
|
-
|
|
3654
|
+
xn as a0,
|
|
3655
|
+
kt as a1,
|
|
3666
3656
|
ce as a2,
|
|
3667
|
-
|
|
3657
|
+
hr as a3,
|
|
3668
3658
|
le as a4,
|
|
3669
3659
|
te as a5,
|
|
3670
3660
|
y as a6,
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3661
|
+
F as a7,
|
|
3662
|
+
gr as a8,
|
|
3663
|
+
vr as a9,
|
|
3664
|
+
Un as aa,
|
|
3675
3665
|
X as ab,
|
|
3676
|
-
|
|
3677
|
-
|
|
3666
|
+
zr as ac,
|
|
3667
|
+
jn as ad,
|
|
3678
3668
|
We as ae,
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3669
|
+
qn as af,
|
|
3670
|
+
he as ag,
|
|
3671
|
+
Gn as ah,
|
|
3672
|
+
Hn as ai,
|
|
3673
|
+
Wn as aj,
|
|
3674
|
+
Yn as ak,
|
|
3675
|
+
Zn as al,
|
|
3686
3676
|
Ye as am,
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3677
|
+
fr as an,
|
|
3678
|
+
yr as ao,
|
|
3679
|
+
Yt as b,
|
|
3680
|
+
Ht as c,
|
|
3681
|
+
On as d,
|
|
3682
|
+
Fn as e,
|
|
3683
|
+
Zt as f,
|
|
3684
|
+
Vn as g,
|
|
3685
|
+
An as h,
|
|
3686
|
+
Ie as i,
|
|
3687
|
+
Rn as j,
|
|
3688
|
+
Wt as k,
|
|
3689
|
+
Bn as l,
|
|
3700
3690
|
De as m,
|
|
3701
3691
|
H as n,
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3692
|
+
Sn as o,
|
|
3693
|
+
ue as p,
|
|
3694
|
+
_n as q,
|
|
3695
|
+
Jt as r,
|
|
3696
|
+
St as s,
|
|
3697
|
+
hn as t,
|
|
3698
|
+
wn as u,
|
|
3699
|
+
_t as v,
|
|
3700
|
+
In as w,
|
|
3701
|
+
En as x,
|
|
3702
|
+
vn as y,
|
|
3713
3703
|
Re as z
|
|
3714
3704
|
};
|