react-semaphor 0.1.525 → 0.1.527
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/DATA_APP_SDK.md +5 -1
- package/dist/analytics-protocol/index.js +1179 -296
- package/dist/brand-studio/index.js +31 -31
- package/dist/briefings/index.js +50 -49
- package/dist/chunks/{calculated-field-identity-Dy_WpDdo.js → calculated-field-identity-DEhjPSr-.js} +77 -76
- package/dist/chunks/{card-config-utils-CAyjC5Tp.js → card-config-utils-BlIbwkuD.js} +62 -59
- package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
- package/dist/chunks/dashboard-JNHR0_cZ.js +14 -0
- package/dist/chunks/{dashboard-briefing-launcher-BilVIEyw.js → dashboard-briefing-launcher-D9pFByPh.js} +274 -267
- package/dist/chunks/{dashboard-controls-DyLPcvCK.js → dashboard-controls-CJI5ZWMq.js} +740 -692
- package/dist/chunks/dashboard-json-DLdrFry-.js +65 -0
- package/dist/chunks/{edit-dashboard-visual-DtmKNNdE.js → edit-dashboard-visual-D5LjWle1.js} +6760 -6728
- package/dist/chunks/editor-action-buttons-G91NQKxU.js +2070 -0
- package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-DeVQLIsP.js} +19 -19
- package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
- package/dist/chunks/{index-ON7Gpvcv.js → index-BvJOYbNv.js} +760 -750
- package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
- package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DY45yiUM.js} +7 -6
- package/dist/chunks/{matrix-control-sources-B1K7x0SL.js → matrix-control-sources-BypfLZsK.js} +36 -36
- package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
- package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-BoKU3MzZ.js} +655 -511
- package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
- package/dist/chunks/matrix-operation-contract-BV02rLhu.js +809 -0
- package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
- package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
- package/dist/chunks/pivot-header-presentation-D5v8uyjj.js +618 -0
- package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-BWrPhlGT.js} +259 -204
- package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
- package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
- package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
- package/dist/chunks/report-preferences-dialog-D3hxu4sE.js +1231 -0
- package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
- package/dist/chunks/{selection-reducer-CvCBQbl2.js → selection-reducer-C7Um5XN-.js} +3 -3
- package/dist/chunks/semantic-format-BjBMOSoo.js +192 -0
- package/dist/chunks/{index-DYOaHuLS.js → semaphor-ready-indicator-D46I_4g7.js} +145070 -146854
- package/dist/chunks/slider-B6LELqx6.js +876 -0
- package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
- package/dist/chunks/{switch-CWPcwAZ4.js → switch-_7uBAbYx.js} +7950 -8545
- package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
- package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
- package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
- package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
- package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +138 -137
- package/dist/data-app-sdk/index.js +30 -29
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +27 -26
- package/dist/format-utils/index.js +247 -329
- package/dist/index.js +435 -246
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +4 -5
- package/dist/types/briefings/index.d.ts +3 -0
- package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
- package/dist/types/components/dashboard/sheet/layout-change-guard.d.ts +1 -1
- package/dist/types/components/dashboard/sheet/sheet-layout.d.ts +1 -1
- package/dist/types/components/editor/editor-main/text-card.d.ts +1 -1
- package/dist/types/components/editor/editor.d.ts +1 -1
- package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
- package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
- package/dist/types/components/providers/semaphor-context-provider.d.ts +1 -1
- package/dist/types/components/providers/theme-provider-context.d.ts +1 -1
- package/dist/types/components/providers/theme-provider.d.ts +1 -1
- package/dist/types/components/shared/unsaved-changes/use-pristine-snapshot-initializer.d.ts +1 -1
- package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
- package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
- package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +8 -29
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
- package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
- package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
- package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
- package/dist/types/components/visual/column-display-utils.d.ts +1 -1
- package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
- package/dist/types/components/visual/kpi-visual/kpi-utils.d.ts +1 -1
- package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
- package/dist/types/components/visual/settings/color-format.d.ts +1 -1
- package/dist/types/components/visual/visual-utils.d.ts +1 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/actions/data-point-click-action.d.ts +2 -1
- package/dist/types/lib/api/exports-api.d.ts +3 -0
- package/dist/types/lib/csv-download.d.ts +9 -0
- package/dist/types/lib/csv-encoding-options.d.ts +6 -0
- package/dist/types/lib/dashboard/normalize-dashboard-for-dirty-check.d.ts +1 -1
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
- package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
- package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
- package/dist/types/lib/export-utils.d.ts +17 -15
- package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
- package/dist/types/lib/hooks/explorer/use-schemas.d.ts +1 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +2 -2
- package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +1 -2
- package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
- package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
- package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
- package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
- package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
- package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
- package/dist/types/lib/stores/editor-store.d.ts +1 -2
- package/dist/types/lib/stores/table-actions.d.ts +2 -1
- package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
- package/dist/types/lib/types/common-types.d.ts +5 -0
- package/dist/types/lib/types/explorer-types.d.ts +14 -0
- package/dist/types/lib/types/token-types.d.ts +0 -13
- package/dist/types/lib/utils/card-definition.d.ts +1 -1
- package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
- package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
- package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
- package/dist/types/lib/utils.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/contracts.d.ts +10 -7
- package/dist/types/shared/analytics-protocol/index.d.ts +12 -1
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +51 -5
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
- package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
- package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
- package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
- package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
- package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
- package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
- package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
- package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
- package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
- package/dist/types/shared/temporal/index.d.ts +5 -0
- package/dist/types/shared/temporal/relative-date.d.ts +21 -0
- package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
- package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
- package/package.json +2 -17
- package/src/data-app-sdk/README.md +6 -3
- package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
- package/dist/chunks/dashboard-json-QEoU-mx4.js +0 -75
- package/dist/chunks/editor-action-buttons-B9VRW3Bh.js +0 -2019
- package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
- package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
- package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
- package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
- package/dist/chunks/report-preferences-dialog-BLaFmlE2.js +0 -723
- package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
- package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
- package/dist/data-app-builder/index.js +0 -3666
- package/dist/data-app-builder-browser-runtime/index.js +0 -8
- package/dist/data-app-codegen/index.js +0 -22
- package/dist/data-app-codegen-node/index.js +0 -1807
- package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
- package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
- package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
- package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
- package/dist/types/data-app-builder/constants.d.ts +0 -14
- package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
- package/dist/types/data-app-builder/index.d.ts +0 -1
- package/dist/types/data-app-builder/lib/api.d.ts +0 -36
- package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
- package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
- package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
- package/dist/types/data-app-builder/types.d.ts +0 -558
- package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
- package/dist/types/data-app-builder.d.ts +0 -2
- package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
- package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
- package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
- package/dist/types/data-app-codegen/index.d.ts +0 -6
- package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
- package/dist/types/data-app-codegen/node.d.ts +0 -2
- package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
- package/dist/types/data-app-codegen/validation.d.ts +0 -8
- package/dist/types/data-app-codegen-node.d.ts +0 -2
- package/dist/types/data-app-codegen.d.ts +0 -2
- package/dist/types/lib/encrypt-utils.d.ts +0 -9
- package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
- package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
- package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
var ft = Object.defineProperty;
|
|
2
2
|
var pt = (e, r, t) => r in e ? ft(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
3
|
var F = (e, r, t) => pt(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
-
import { k as Re,
|
|
5
|
-
import {
|
|
4
|
+
import { k as Re, e as yt } from "./numeric-presentation-LvnNY5Ma.js";
|
|
5
|
+
import { F as Ae, am as ht, S as me, ah as ye, t as gt } from "./validators-CQcG0EPN.js";
|
|
6
|
+
import { z as vt, x as bt, u as It, y as Ct, s as Tt, M as wt, o as $t, C as xt, n as Et, P as G } from "./pivot-result-lifecycle-BWrPhlGT.js";
|
|
6
7
|
import "./matrix-continuation-C4sRcjZU.js";
|
|
7
|
-
import {
|
|
8
|
-
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as he } from "../value-format-preferences/index.js";
|
|
9
|
-
import { k as It, i as Ct, g as Tt, j as wt, e as $t, M as xt, c as kt, b as Et, P as G } from "./pivot-result-lifecycle-BFO354lk.js";
|
|
8
|
+
import { a4 as kt, a6 as St } from "./matrix-operation-contract-BV02rLhu.js";
|
|
10
9
|
import { z as T } from "zod";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { r as Rt } from "./
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { r as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
10
|
+
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as he } from "../value-format-preferences/index.js";
|
|
11
|
+
import { r as _t } from "./matrix-definition-Cdn3LoxW.js";
|
|
12
|
+
import { h as De, i as ge, r as Me, a as Pe, v as Ft, b as Rt } from "./card-config-utils-BlIbwkuD.js";
|
|
13
|
+
import { r as At } from "./matrix-card-DY45yiUM.js";
|
|
14
|
+
import { a as Be, s as Dt, i as Mt, o as Pt } from "./field-aggregations-DeVQLIsP.js";
|
|
15
|
+
import { f as re, r as W, c as Bt, R as Ot, v as Kt } from "./raw-temporal-CdnA_OXJ.js";
|
|
16
|
+
import { r as q, b as Nt, d as Lt, P as zt } from "./pivot-result-identity-CY__BuwI.js";
|
|
17
|
+
import { v as Vt, a as qt } from "./temporal-bucket-contract-C6lUGPS3.js";
|
|
18
|
+
import { f as Ut, a as jt, c as Oe, D as Gt } from "./temporal-bucket-DlFuhCnT.js";
|
|
19
|
+
import { v as Ke } from "./raw-temporal-contract-Bc9z83t-.js";
|
|
20
|
+
import { r as Ht, a as Wt, b as Yt } from "./canonical-result-keys-CEQefvdO.js";
|
|
21
|
+
const Zt = `import pandas as pd
|
|
22
22
|
df = pd.DataFrame(data) # 'data' contains the query result
|
|
23
23
|
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
24
24
|
`;
|
|
25
|
-
function
|
|
25
|
+
function oo(e) {
|
|
26
26
|
return {
|
|
27
27
|
databaseName: (e == null ? void 0 : e.lastSelectedDatabase) || "",
|
|
28
28
|
schemaName: (e == null ? void 0 : e.lastSelectedSchema) || "",
|
|
@@ -31,7 +31,7 @@ function ro(e) {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
function Z(e) {
|
|
34
|
-
return e ===
|
|
34
|
+
return e === Zt ? "" : e;
|
|
35
35
|
}
|
|
36
36
|
function ne(e, r = e.config) {
|
|
37
37
|
return Be({
|
|
@@ -40,7 +40,7 @@ function ne(e, r = e.config) {
|
|
|
40
40
|
normalizedPython: Z(e.python || "")
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
class
|
|
43
|
+
class Qt extends Error {
|
|
44
44
|
constructor(t) {
|
|
45
45
|
super(
|
|
46
46
|
`ambiguous_temporal_grain: Temporal field "${t}" has saved presentation but no valid grouping grain. Reconfigure and resave the field.`
|
|
@@ -50,16 +50,16 @@ class Zt extends Error {
|
|
|
50
50
|
this.name = "AmbiguousGroupedTemporalGrainError", this.fieldId = t;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Xt(e) {
|
|
54
54
|
return Pe(e) || e.semanticTemporalPresentation != null;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Jt(e) {
|
|
57
57
|
if (!e.id || !["date", "datetime"].includes(
|
|
58
58
|
Ae(e.dataType)
|
|
59
59
|
))
|
|
60
60
|
return;
|
|
61
61
|
if (ht(e.granularity)) return e;
|
|
62
|
-
if (!
|
|
62
|
+
if (!Xt(e)) return;
|
|
63
63
|
if (!Me({
|
|
64
64
|
fieldId: e.id,
|
|
65
65
|
dataType: e.dataType,
|
|
@@ -68,7 +68,7 @@ function Xt(e) {
|
|
|
68
68
|
dateFormat: e.dateFormat,
|
|
69
69
|
customFormat: e.customFormat
|
|
70
70
|
}).ok)
|
|
71
|
-
throw new
|
|
71
|
+
throw new Qt(e.id);
|
|
72
72
|
return { ...e, granularity: "day" };
|
|
73
73
|
}
|
|
74
74
|
function ve(e) {
|
|
@@ -93,12 +93,12 @@ function ve(e) {
|
|
|
93
93
|
cardType: e.card.type,
|
|
94
94
|
cardConfig: r,
|
|
95
95
|
fields: t.flatMap((n) => {
|
|
96
|
-
const o =
|
|
96
|
+
const o = Jt(n);
|
|
97
97
|
return o ? [o] : [];
|
|
98
98
|
})
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function ao(e) {
|
|
102
102
|
if (ge(e.card))
|
|
103
103
|
return ve({
|
|
104
104
|
...e,
|
|
@@ -106,15 +106,15 @@ function no(e) {
|
|
|
106
106
|
supportsCardType: (r) => r === "table"
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function io(e) {
|
|
110
110
|
if (ge(e.card))
|
|
111
111
|
return ve({
|
|
112
112
|
...e,
|
|
113
113
|
card: e.card,
|
|
114
|
-
supportsCardType:
|
|
114
|
+
supportsCardType: Mt
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function er(e) {
|
|
118
118
|
if (ge(e.card))
|
|
119
119
|
return ve({
|
|
120
120
|
...e,
|
|
@@ -122,22 +122,22 @@ function Jt(e) {
|
|
|
122
122
|
// Raw detail-table presentation has its own result/adapter contract.
|
|
123
123
|
// This module remains grouped-only even though the shared producer
|
|
124
124
|
// registry now recognizes detailTable.
|
|
125
|
-
supportsCardType: (r) => r !== "detailTable" &&
|
|
125
|
+
supportsCardType: (r) => r !== "detailTable" && Dt(r)
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
const xe = /* @__PURE__ */ new WeakMap();
|
|
129
|
-
function
|
|
129
|
+
function tr(e) {
|
|
130
130
|
const r = xe.get(e);
|
|
131
131
|
if (r) return r;
|
|
132
|
-
const t =
|
|
132
|
+
const t = vt(e);
|
|
133
133
|
return xe.set(e, t), t;
|
|
134
134
|
}
|
|
135
135
|
function j(e, r) {
|
|
136
136
|
const t = e ?? [], n = r ?? [];
|
|
137
137
|
return t.length === n.length && t.every((o, a) => o === n[a]);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
const t =
|
|
139
|
+
function rr(e, r) {
|
|
140
|
+
const t = bt({
|
|
141
141
|
groupByFields: r.groupByColumns,
|
|
142
142
|
metricFields: r.metricColumns,
|
|
143
143
|
pivotByFields: r.pivotByColumns,
|
|
@@ -160,7 +160,7 @@ function tr(e, r) {
|
|
|
160
160
|
t.expectedMetricAliases
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
|
-
class
|
|
163
|
+
class nr extends Error {
|
|
164
164
|
constructor(t) {
|
|
165
165
|
super(
|
|
166
166
|
`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.`
|
|
@@ -196,13 +196,13 @@ class L extends Error {
|
|
|
196
196
|
function Ne(e, r) {
|
|
197
197
|
return `${r}:${e}`;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function or(e) {
|
|
200
200
|
var r, t;
|
|
201
201
|
return (t = (r = e.presentation) == null ? void 0 : r.byFieldRole) == null ? void 0 : t.get(
|
|
202
202
|
Ne(e.fieldId, e.role)
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function ar(e) {
|
|
206
206
|
var t;
|
|
207
207
|
if ((((t = e.cardConfig.metricColumns) == null ? void 0 : t.length) || 0) > 0 || e.binding.role !== "metric")
|
|
208
208
|
return !1;
|
|
@@ -214,7 +214,7 @@ function or(e) {
|
|
|
214
214
|
}
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function co(e, r) {
|
|
218
218
|
return !r || r.byColumnKey.size === 0 ? e.map((t) => ({ ...t })) : e.map((t) => {
|
|
219
219
|
const n = { ...t };
|
|
220
220
|
return r.byColumnKey.forEach((o, a) => {
|
|
@@ -225,8 +225,8 @@ function ao(e, r) {
|
|
|
225
225
|
}), n;
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
var
|
|
228
|
+
function lo(e) {
|
|
229
|
+
var f;
|
|
230
230
|
if (!e.result || typeof e.result != "object") return !1;
|
|
231
231
|
const r = e.result;
|
|
232
232
|
if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner)
|
|
@@ -237,8 +237,8 @@ function io(e) {
|
|
|
237
237
|
const n = Array.isArray(r.records) ? r.records.length : void 0, o = (t.cardConfig.pivotByColumns || []).map((m) => m.id);
|
|
238
238
|
if (t.cardType === "pivotTable")
|
|
239
239
|
try {
|
|
240
|
-
const m =
|
|
241
|
-
if (!
|
|
240
|
+
const m = tr(r);
|
|
241
|
+
if (!rr(
|
|
242
242
|
m.pivotResultContract,
|
|
243
243
|
t.cardConfig
|
|
244
244
|
))
|
|
@@ -254,15 +254,15 @@ function io(e) {
|
|
|
254
254
|
), b = g.length > 0 && g.every(
|
|
255
255
|
(C) => {
|
|
256
256
|
var v;
|
|
257
|
-
return ((v = C.pivotIdentity) == null ? void 0 : v.members.length) === 0 &&
|
|
257
|
+
return ((v = C.pivotIdentity) == null ? void 0 : v.members.length) === 0 && Nt({
|
|
258
258
|
expectedPivotFieldIds: o,
|
|
259
259
|
classification: m.pivotResultContract.columnClassifications[C.key]
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
262
|
);
|
|
263
263
|
return t.fields.every((C) => {
|
|
264
|
-
var
|
|
265
|
-
const v =
|
|
264
|
+
var k;
|
|
265
|
+
const v = q(
|
|
266
266
|
m.columnKeyMap,
|
|
267
267
|
C.id,
|
|
268
268
|
C.role
|
|
@@ -287,10 +287,10 @@ function io(e) {
|
|
|
287
287
|
const w = m.columns.find(
|
|
288
288
|
(_) => _.key === (v.outputKey || v.rawKey)
|
|
289
289
|
);
|
|
290
|
-
return ((
|
|
290
|
+
return ((k = w == null ? void 0 : w.temporalBucket) == null ? void 0 : k.granularity) === C.granularity;
|
|
291
291
|
});
|
|
292
292
|
} catch (m) {
|
|
293
|
-
if (m instanceof
|
|
293
|
+
if (m instanceof Ct) return !1;
|
|
294
294
|
throw m;
|
|
295
295
|
}
|
|
296
296
|
if (n === 0)
|
|
@@ -315,33 +315,33 @@ function io(e) {
|
|
|
315
315
|
field: m,
|
|
316
316
|
role: "detail"
|
|
317
317
|
}))
|
|
318
|
-
],
|
|
318
|
+
], c = new Set(
|
|
319
319
|
i.map(({ field: m, role: g }) => `${g}:${m.id}`)
|
|
320
320
|
), d = new Map(
|
|
321
321
|
(r.columns || []).map((m) => [m.key, m])
|
|
322
|
-
),
|
|
322
|
+
), l = q(
|
|
323
323
|
a,
|
|
324
324
|
me,
|
|
325
325
|
"metric"
|
|
326
326
|
);
|
|
327
|
-
if (
|
|
328
|
-
if (!
|
|
327
|
+
if (l) {
|
|
328
|
+
if (!ar({
|
|
329
329
|
cardConfig: t.cardConfig,
|
|
330
|
-
binding:
|
|
330
|
+
binding: l,
|
|
331
331
|
columns: r.columns || []
|
|
332
332
|
}))
|
|
333
333
|
return !1;
|
|
334
|
-
|
|
334
|
+
c.add(`metric:${me}`);
|
|
335
335
|
}
|
|
336
336
|
const s = Object.entries(a.byRole).flatMap(
|
|
337
337
|
([m, g]) => Object.keys(g || {}).map((y) => `${m}:${y}`)
|
|
338
338
|
);
|
|
339
|
-
if (s.length !==
|
|
340
|
-
({ field: m, role: g }) => !
|
|
339
|
+
if (s.length !== c.size || s.some((m) => !c.has(m)) || i.some(
|
|
340
|
+
({ field: m, role: g }) => !q(a, m.id, g)
|
|
341
341
|
))
|
|
342
342
|
return !1;
|
|
343
343
|
try {
|
|
344
|
-
|
|
344
|
+
Lt(
|
|
345
345
|
(r.columns || []).map((m) => ({
|
|
346
346
|
key: m.key,
|
|
347
347
|
pivotIdentity: m.pivotIdentity
|
|
@@ -352,16 +352,16 @@ function io(e) {
|
|
|
352
352
|
}
|
|
353
353
|
);
|
|
354
354
|
} catch (m) {
|
|
355
|
-
if (m instanceof
|
|
355
|
+
if (m instanceof zt) return !1;
|
|
356
356
|
throw m;
|
|
357
357
|
}
|
|
358
358
|
const u = (r.columns || []).filter((m) => {
|
|
359
359
|
const g = m.pivotIdentity;
|
|
360
360
|
return !!(g && g.members.length > 0);
|
|
361
361
|
});
|
|
362
|
-
return n !== 0 && ((
|
|
362
|
+
return n !== 0 && ((f = t.cardConfig.pivotByColumns) != null && f.length) && u.length === 0 ? !1 : t.fields.every((m) => {
|
|
363
363
|
var b;
|
|
364
|
-
const g =
|
|
364
|
+
const g = q(
|
|
365
365
|
a,
|
|
366
366
|
m.id,
|
|
367
367
|
m.role
|
|
@@ -370,14 +370,14 @@ function io(e) {
|
|
|
370
370
|
if (g.role === "pivotby") {
|
|
371
371
|
const v = u.flatMap(
|
|
372
372
|
(w) => {
|
|
373
|
-
var
|
|
374
|
-
return ((
|
|
373
|
+
var k;
|
|
374
|
+
return ((k = w.pivotIdentity) == null ? void 0 : k.members) ?? [];
|
|
375
375
|
}
|
|
376
376
|
).filter((w) => w.fieldId === m.id);
|
|
377
377
|
return u.length === 0 ? n === 0 : v.length > 0 && v.every(
|
|
378
378
|
(w) => {
|
|
379
|
-
var
|
|
380
|
-
return ((
|
|
379
|
+
var k;
|
|
380
|
+
return ((k = w.temporalBucket) == null ? void 0 : k.granularity) === m.granularity;
|
|
381
381
|
}
|
|
382
382
|
);
|
|
383
383
|
}
|
|
@@ -405,7 +405,7 @@ function ee(e, r) {
|
|
|
405
405
|
if (!o.ok) throw new Error(o.error.code);
|
|
406
406
|
return o.format;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function ir(e, r, t = he) {
|
|
409
409
|
const n = ee(e, "card"), o = ee(e, "semantic"), a = e.semanticTemporalPresentation;
|
|
410
410
|
return Oe({
|
|
411
411
|
metadata: r,
|
|
@@ -423,7 +423,7 @@ function ar(e, r, t = he) {
|
|
|
423
423
|
}
|
|
424
424
|
});
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function cr(e, r = Gt, t = "en-US") {
|
|
427
427
|
var i;
|
|
428
428
|
const n = ee(e, "card"), o = ((i = e.semanticTemporalPresentation) == null ? void 0 : i.granularity) === e.granularity ? ee(e, "semantic") : void 0, a = n && n.presentation.mode !== "auto" ? n : o && o.presentation.mode !== "auto" ? o : {
|
|
429
429
|
presentation: { mode: "auto" }
|
|
@@ -438,7 +438,7 @@ function ir(e, r = jt, t = "en-US") {
|
|
|
438
438
|
presentation: a.presentation
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function so(e) {
|
|
442
442
|
const r = e.activation;
|
|
443
443
|
if (!r)
|
|
444
444
|
return {
|
|
@@ -453,20 +453,20 @@ function co(e) {
|
|
|
453
453
|
byFieldRole: /* @__PURE__ */ new Map()
|
|
454
454
|
};
|
|
455
455
|
const t = new Map(
|
|
456
|
-
(e.columns || []).map((
|
|
457
|
-
), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = r.fields.reduce((
|
|
456
|
+
(e.columns || []).map((l) => [l.key, l])
|
|
457
|
+
), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = r.fields.reduce((l, s) => (l.set(s.id, (l.get(s.id) || 0) + 1), l), /* @__PURE__ */ new Map()), c = (l, s) => {
|
|
458
458
|
a.set(
|
|
459
|
-
Ne(
|
|
459
|
+
Ne(l.id, l.role),
|
|
460
460
|
s
|
|
461
|
-
), i.get(
|
|
462
|
-
}, d = (
|
|
463
|
-
if (s.granularity !==
|
|
461
|
+
), i.get(l.id) === 1 && o.set(l.id, s);
|
|
462
|
+
}, d = (l, s, u) => {
|
|
463
|
+
if (s.granularity !== l.granularity)
|
|
464
464
|
throw new L(
|
|
465
465
|
"invalid_temporal_bucket_metadata",
|
|
466
|
-
`Result identity "${u}" declares ${s.granularity} buckets for active ${
|
|
467
|
-
{ cardId: e.card.id, fieldId:
|
|
466
|
+
`Result identity "${u}" declares ${s.granularity} buckets for active ${l.granularity} field "${l.id}".`,
|
|
467
|
+
{ cardId: e.card.id, fieldId: l.id, columnKey: u }
|
|
468
468
|
);
|
|
469
|
-
const
|
|
469
|
+
const f = e.executionSnapshot && e.dashboardId ? It({
|
|
470
470
|
snapshot: e.executionSnapshot,
|
|
471
471
|
scope: {
|
|
472
472
|
dashboardId: e.dashboardId,
|
|
@@ -475,57 +475,57 @@ function co(e) {
|
|
|
475
475
|
},
|
|
476
476
|
target: {
|
|
477
477
|
kind: "field",
|
|
478
|
-
fieldId:
|
|
479
|
-
role:
|
|
478
|
+
fieldId: l.id,
|
|
479
|
+
role: l.role
|
|
480
480
|
}
|
|
481
481
|
}) : void 0;
|
|
482
|
-
if (e.executionSnapshot && !
|
|
483
|
-
throw new
|
|
482
|
+
if (e.executionSnapshot && !f)
|
|
483
|
+
throw new nr({
|
|
484
484
|
dashboardId: e.dashboardId,
|
|
485
485
|
cardId: e.card.id,
|
|
486
|
-
fieldId:
|
|
486
|
+
fieldId: l.id
|
|
487
487
|
});
|
|
488
488
|
return {
|
|
489
489
|
columnKey: u,
|
|
490
|
-
fieldId:
|
|
491
|
-
role:
|
|
490
|
+
fieldId: l.id,
|
|
491
|
+
role: l.role,
|
|
492
492
|
metadata: s,
|
|
493
|
-
resolved:
|
|
493
|
+
resolved: f ? Oe({
|
|
494
494
|
metadata: s,
|
|
495
|
-
cardFormat:
|
|
496
|
-
locale:
|
|
497
|
-
...
|
|
498
|
-
styles:
|
|
495
|
+
cardFormat: f,
|
|
496
|
+
locale: f.locale,
|
|
497
|
+
...f.presentation.mode === "auto" ? {
|
|
498
|
+
styles: f.presentation.styles
|
|
499
499
|
} : {}
|
|
500
|
-
}) :
|
|
501
|
-
|
|
500
|
+
}) : ir(
|
|
501
|
+
l,
|
|
502
502
|
s,
|
|
503
503
|
e.valueFormatPreferences ?? he
|
|
504
504
|
)
|
|
505
505
|
};
|
|
506
506
|
};
|
|
507
|
-
for (const
|
|
508
|
-
const s =
|
|
507
|
+
for (const l of r.fields) {
|
|
508
|
+
const s = q(
|
|
509
509
|
e.columnKeyMap,
|
|
510
|
-
|
|
511
|
-
|
|
510
|
+
l.id,
|
|
511
|
+
l.role
|
|
512
512
|
);
|
|
513
513
|
if (!s) {
|
|
514
514
|
if (e.columns === void 0 && e.columnKeyMap === void 0 && (e.resultRowCount === void 0 || e.resultRowCount === 0))
|
|
515
515
|
continue;
|
|
516
516
|
throw new L(
|
|
517
517
|
"missing_temporal_column_binding",
|
|
518
|
-
`Activated temporal field "${
|
|
519
|
-
{ cardId: e.card.id, fieldId:
|
|
518
|
+
`Activated temporal field "${l.id}" has no authoritative result-column binding.`,
|
|
519
|
+
{ cardId: e.card.id, fieldId: l.id, columnKey: l.name }
|
|
520
520
|
);
|
|
521
521
|
}
|
|
522
522
|
if (s.role === "pivotby") {
|
|
523
523
|
const y = (e.columns || []).filter(
|
|
524
|
-
(
|
|
524
|
+
(k) => k.pivotIdentity !== void 0
|
|
525
525
|
), b = y.flatMap(
|
|
526
|
-
(
|
|
526
|
+
(k) => {
|
|
527
527
|
var _;
|
|
528
|
-
return (((_ =
|
|
528
|
+
return (((_ = k.pivotIdentity) == null ? void 0 : _.members) || []).filter((M) => M.fieldId === l.id).map((M) => ({ column: k, member: M }));
|
|
529
529
|
}
|
|
530
530
|
);
|
|
531
531
|
if (b.length === 0) {
|
|
@@ -533,7 +533,7 @@ function co(e) {
|
|
|
533
533
|
continue;
|
|
534
534
|
throw new ae({
|
|
535
535
|
cardId: e.card.id,
|
|
536
|
-
fieldId:
|
|
536
|
+
fieldId: l.id,
|
|
537
537
|
columnKey: s.outputKey || s.rawKey
|
|
538
538
|
});
|
|
539
539
|
}
|
|
@@ -541,10 +541,10 @@ function co(e) {
|
|
|
541
541
|
if (!C.member.temporalBucket)
|
|
542
542
|
throw new ae({
|
|
543
543
|
cardId: e.card.id,
|
|
544
|
-
fieldId:
|
|
544
|
+
fieldId: l.id,
|
|
545
545
|
columnKey: C.column.key
|
|
546
546
|
});
|
|
547
|
-
const v =
|
|
547
|
+
const v = Vt(
|
|
548
548
|
C.member.temporalBucket
|
|
549
549
|
);
|
|
550
550
|
if (!v.ok || !v.value)
|
|
@@ -553,53 +553,53 @@ function co(e) {
|
|
|
553
553
|
v.ok ? `Pivot result column "${C.column.key}" has no validated temporal bucket metadata.` : v.error.message,
|
|
554
554
|
{
|
|
555
555
|
cardId: e.card.id,
|
|
556
|
-
fieldId:
|
|
556
|
+
fieldId: l.id,
|
|
557
557
|
columnKey: C.column.key
|
|
558
558
|
}
|
|
559
559
|
);
|
|
560
560
|
const w = d(
|
|
561
|
-
|
|
561
|
+
l,
|
|
562
562
|
v.value,
|
|
563
563
|
C.column.key
|
|
564
564
|
);
|
|
565
|
-
for (const { column:
|
|
565
|
+
for (const { column: k, member: _ } of b)
|
|
566
566
|
if (!_.temporalBucket || JSON.stringify(_.temporalBucket) !== JSON.stringify(C.member.temporalBucket))
|
|
567
567
|
throw new L(
|
|
568
568
|
"invalid_temporal_bucket_metadata",
|
|
569
|
-
`Pivot result column "${
|
|
570
|
-
{ cardId: e.card.id, fieldId:
|
|
569
|
+
`Pivot result column "${k.key}" has contradictory bucket metadata for field "${l.id}".`,
|
|
570
|
+
{ cardId: e.card.id, fieldId: l.id, columnKey: k.key }
|
|
571
571
|
);
|
|
572
|
-
l
|
|
572
|
+
c(l, w);
|
|
573
573
|
continue;
|
|
574
574
|
}
|
|
575
|
-
const u = s.outputKey || s.rawKey,
|
|
576
|
-
if (!(
|
|
575
|
+
const u = s.outputKey || s.rawKey, f = t.get(u);
|
|
576
|
+
if (!(f != null && f.temporalBucket))
|
|
577
577
|
throw new ae({
|
|
578
578
|
cardId: e.card.id,
|
|
579
|
-
fieldId:
|
|
579
|
+
fieldId: l.id,
|
|
580
580
|
columnKey: u
|
|
581
581
|
});
|
|
582
|
-
const m = qt(
|
|
582
|
+
const m = qt(f, {
|
|
583
583
|
metadataRequired: !0
|
|
584
584
|
});
|
|
585
585
|
if (!m.ok || !m.value)
|
|
586
586
|
throw new L(
|
|
587
587
|
"invalid_temporal_bucket_metadata",
|
|
588
588
|
m.ok ? `Result column "${u}" has no validated temporal bucket metadata.` : m.error.message,
|
|
589
|
-
{ cardId: e.card.id, fieldId:
|
|
589
|
+
{ cardId: e.card.id, fieldId: l.id, columnKey: u }
|
|
590
590
|
);
|
|
591
591
|
const g = d(
|
|
592
|
-
|
|
592
|
+
l,
|
|
593
593
|
m.value,
|
|
594
594
|
u
|
|
595
595
|
);
|
|
596
|
-
n.set(u, g), l
|
|
596
|
+
n.set(u, g), c(l, g);
|
|
597
597
|
}
|
|
598
598
|
return { byColumnKey: n, byFieldId: o, byFieldRole: a };
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function mo(e) {
|
|
601
601
|
var t, n;
|
|
602
|
-
const r = e.role ?
|
|
602
|
+
const r = e.role ? or({
|
|
603
603
|
presentation: e.presentation,
|
|
604
604
|
fieldId: e.fieldId,
|
|
605
605
|
role: e.role
|
|
@@ -621,13 +621,13 @@ function Le(e) {
|
|
|
621
621
|
}
|
|
622
622
|
);
|
|
623
623
|
try {
|
|
624
|
-
return
|
|
624
|
+
return Ut({
|
|
625
625
|
value: e.value,
|
|
626
626
|
metadata: e.presentation.metadata,
|
|
627
627
|
format: e.presentation.resolved.format
|
|
628
628
|
});
|
|
629
629
|
} catch (r) {
|
|
630
|
-
throw r instanceof
|
|
630
|
+
throw r instanceof jt ? new L(
|
|
631
631
|
r.code,
|
|
632
632
|
r.message,
|
|
633
633
|
{
|
|
@@ -645,16 +645,16 @@ class S extends Error {
|
|
|
645
645
|
function ze() {
|
|
646
646
|
return { type: "raw_temporal", presentation: { mode: "auto" } };
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function lr(e) {
|
|
649
649
|
if (e.locale || e.relative || e.timezone && e.timezone !== "auto" || e.sourceTimezone && e.sourceTimezone !== "auto" || e.prefix || e.suffix)
|
|
650
650
|
throw new S(
|
|
651
651
|
"invalid_raw_temporal_format",
|
|
652
652
|
"Activated raw temporal presentation contains unsupported locale, relative-time, timezone, prefix, or suffix settings."
|
|
653
653
|
);
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Ve(e) {
|
|
656
656
|
const r = e.format;
|
|
657
|
-
if ((r == null ? void 0 : r.type) === "date" && (
|
|
657
|
+
if ((r == null ? void 0 : r.type) === "date" && (lr(r), r.pattern))
|
|
658
658
|
return {
|
|
659
659
|
type: "raw_temporal",
|
|
660
660
|
presentation: {
|
|
@@ -723,17 +723,17 @@ function be(e) {
|
|
|
723
723
|
presentation: { mode: "auto" }
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function uo(e) {
|
|
727
727
|
return e === "instant" ? "yyyy-MM-dd'T'HH:mm:ssXXX" : e === "wall_datetime" ? "yyyy-MM-dd'T'HH:mm:ss" : "yyyy-MM-dd";
|
|
728
728
|
}
|
|
729
|
-
function
|
|
730
|
-
|
|
729
|
+
function fo(e) {
|
|
730
|
+
Kt({
|
|
731
731
|
dialect: "date_fns",
|
|
732
732
|
pattern: e.pattern,
|
|
733
733
|
valueKind: e.valueKind
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function sr(e) {
|
|
737
737
|
const r = be(e.settings);
|
|
738
738
|
if (!r)
|
|
739
739
|
throw new S(
|
|
@@ -758,9 +758,9 @@ function lr(e) {
|
|
|
758
758
|
);
|
|
759
759
|
return a.text;
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function po(e) {
|
|
762
762
|
try {
|
|
763
|
-
return { ok: !0, text:
|
|
763
|
+
return { ok: !0, text: sr(e) };
|
|
764
764
|
} catch (r) {
|
|
765
765
|
return {
|
|
766
766
|
ok: !1,
|
|
@@ -768,14 +768,14 @@ function uo(e) {
|
|
|
768
768
|
};
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function qe(e) {
|
|
772
772
|
var t;
|
|
773
773
|
const r = e.effectiveCardConfig ?? e.card.config;
|
|
774
774
|
return ne(e.card, r) === "freeform" && !!((t = e.card.sql) != null && t.trim()) && !Z(e.card.python || "").trim();
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function dr(e) {
|
|
777
777
|
var r, t;
|
|
778
|
-
return e.type !== "table" && e.type !== "detailTable" || !
|
|
778
|
+
return e.type !== "table" && e.type !== "detailTable" || !qe({ card: e }) ? !1 : Object.values(
|
|
779
779
|
((t = (r = e.preferences) == null ? void 0 : r.tablePrefs) == null ? void 0 : t.columnSettingsMap) || {}
|
|
780
780
|
).some(
|
|
781
781
|
(n) => {
|
|
@@ -784,9 +784,9 @@ function sr(e) {
|
|
|
784
784
|
}
|
|
785
785
|
);
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function yo(e) {
|
|
788
788
|
var t, n, o;
|
|
789
|
-
if (!
|
|
789
|
+
if (!dr(e)) return e;
|
|
790
790
|
const r = ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.columnSettingsMap) || {};
|
|
791
791
|
return {
|
|
792
792
|
...e,
|
|
@@ -796,10 +796,10 @@ function fo(e) {
|
|
|
796
796
|
...(o = e.preferences) == null ? void 0 : o.tablePrefs,
|
|
797
797
|
columnSettingsMap: Object.fromEntries(
|
|
798
798
|
Object.entries(r).map(([a, i]) => {
|
|
799
|
-
var
|
|
799
|
+
var c, d, l;
|
|
800
800
|
return [
|
|
801
801
|
a,
|
|
802
|
-
i.type === "date" && ((
|
|
802
|
+
i.type === "date" && ((c = i.dateFormat) == null ? void 0 : c.useRelativeTime) !== !0 && ((d = i.dateFormat) == null ? void 0 : d.useCustomFormat) === !0 && !((l = i.dateFormat.customFormat) != null && l.trim()) ? {
|
|
803
803
|
...i,
|
|
804
804
|
dateFormat: {
|
|
805
805
|
...i.dateFormat,
|
|
@@ -815,7 +815,7 @@ function fo(e) {
|
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function mr() {
|
|
819
819
|
return {
|
|
820
820
|
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
821
821
|
byColumnKey: /* @__PURE__ */ new Map(),
|
|
@@ -825,7 +825,7 @@ function dr() {
|
|
|
825
825
|
function ue(e, r) {
|
|
826
826
|
return e === void 0 ? { kind: "invalid", error: r } : {
|
|
827
827
|
kind: "invalid",
|
|
828
|
-
error: e instanceof S ? e : e instanceof
|
|
828
|
+
error: e instanceof S ? e : e instanceof Ot ? new S(
|
|
829
829
|
e.code,
|
|
830
830
|
e.message,
|
|
831
831
|
r.context
|
|
@@ -836,7 +836,7 @@ function ue(e, r) {
|
|
|
836
836
|
)
|
|
837
837
|
};
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function ur(e) {
|
|
840
840
|
var o;
|
|
841
841
|
if (e.cardType !== "detailTable" || e.resultOwner !== "config")
|
|
842
842
|
return { kind: "inactive" };
|
|
@@ -858,25 +858,25 @@ function mr(e) {
|
|
|
858
858
|
s.id,
|
|
859
859
|
s
|
|
860
860
|
])
|
|
861
|
-
),
|
|
861
|
+
), c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
862
862
|
for (const s of a) {
|
|
863
863
|
const u = Array.from(i).flatMap(
|
|
864
|
-
([w,
|
|
865
|
-
const _ =
|
|
864
|
+
([w, k]) => {
|
|
865
|
+
const _ = q(
|
|
866
866
|
n,
|
|
867
867
|
w,
|
|
868
868
|
"detail"
|
|
869
869
|
);
|
|
870
|
-
return _ && _.role === "detail" && (_.outputKey ?? _.rawKey) === s.key ? [{ field:
|
|
870
|
+
return _ && _.role === "detail" && (_.outputKey ?? _.rawKey) === s.key ? [{ field: k, binding: _ }] : [];
|
|
871
871
|
}
|
|
872
|
-
),
|
|
873
|
-
if (!
|
|
872
|
+
), f = u.length === 1 ? u[0] : null;
|
|
873
|
+
if (!f || typeof f.binding.rawKey != "string" || f.binding.rawKey.trim().length === 0 || f.binding.outputKey !== void 0 && (typeof f.binding.outputKey != "string" || f.binding.outputKey.trim().length === 0))
|
|
874
874
|
throw new S(
|
|
875
875
|
"missing_raw_temporal_column_binding",
|
|
876
876
|
`Raw temporal result column "${s.key}" does not have one valid exact detail result binding.`,
|
|
877
877
|
{ columnKey: s.key }
|
|
878
878
|
);
|
|
879
|
-
const { field: m, binding: g } =
|
|
879
|
+
const { field: m, binding: g } = f, y = g.outputKey ?? g.rawKey, b = Ke(s, {
|
|
880
880
|
metadataRequired: !0
|
|
881
881
|
});
|
|
882
882
|
if (!b)
|
|
@@ -886,7 +886,7 @@ function mr(e) {
|
|
|
886
886
|
{ fieldId: m.id, columnKey: y }
|
|
887
887
|
);
|
|
888
888
|
const C = W({
|
|
889
|
-
format:
|
|
889
|
+
format: Ve(m),
|
|
890
890
|
preferences: e.preferences,
|
|
891
891
|
calendar: e.calendar
|
|
892
892
|
}), v = {
|
|
@@ -903,14 +903,14 @@ function mr(e) {
|
|
|
903
903
|
`Raw temporal result row ${w} is missing column "${y}".`,
|
|
904
904
|
{ fieldId: m.id, columnKey: y }
|
|
905
905
|
);
|
|
906
|
-
|
|
906
|
+
c.set(y, v), d.set(m.id, v);
|
|
907
907
|
}
|
|
908
|
-
const
|
|
909
|
-
activatedColumnKeys: new Set(
|
|
910
|
-
byColumnKey:
|
|
908
|
+
const l = {
|
|
909
|
+
activatedColumnKeys: new Set(c.keys()),
|
|
910
|
+
byColumnKey: c,
|
|
911
911
|
byFieldId: d
|
|
912
912
|
};
|
|
913
|
-
return r.length === 0 ? { kind: "loaded_empty", presentation:
|
|
913
|
+
return r.length === 0 ? { kind: "loaded_empty", presentation: l } : { kind: "loaded_valid", presentation: l };
|
|
914
914
|
} catch (a) {
|
|
915
915
|
return ue(
|
|
916
916
|
a,
|
|
@@ -921,22 +921,22 @@ function mr(e) {
|
|
|
921
921
|
);
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function fr(e) {
|
|
925
925
|
var n, o, a;
|
|
926
926
|
const r = e.effectiveCardConfig ?? e.card.config, t = ne(
|
|
927
927
|
e.card,
|
|
928
928
|
r
|
|
929
929
|
);
|
|
930
930
|
if (e.card.type === "detailTable" && t === "config") {
|
|
931
|
-
const i = !!((n = e.columns) != null && n.some((
|
|
931
|
+
const i = !!((n = e.columns) != null && n.some((c) => c.rawTemporal));
|
|
932
932
|
return i && e.records !== void 0 && !e.columnKeyMap ? {
|
|
933
933
|
kind: "invalid",
|
|
934
934
|
error: new S(
|
|
935
935
|
"missing_raw_temporal_result_contract",
|
|
936
936
|
"Activated raw temporal detail results require records, columns, and columnKeyMap atomically."
|
|
937
937
|
)
|
|
938
|
-
} : e.records !== void 0 && !i ? { kind: "inactive" } :
|
|
939
|
-
|
|
938
|
+
} : e.records !== void 0 && !i ? { kind: "inactive" } : Ee(
|
|
939
|
+
ur({
|
|
940
940
|
cardType: e.card.type,
|
|
941
941
|
resultOwner: t,
|
|
942
942
|
effectiveCardConfig: r,
|
|
@@ -951,8 +951,8 @@ function ur(e) {
|
|
|
951
951
|
e
|
|
952
952
|
);
|
|
953
953
|
}
|
|
954
|
-
return
|
|
955
|
-
|
|
954
|
+
return Ee(
|
|
955
|
+
pr({
|
|
956
956
|
resultOwner: t,
|
|
957
957
|
sql: e.card.sql,
|
|
958
958
|
normalizedPython: Z(
|
|
@@ -967,22 +967,22 @@ function ur(e) {
|
|
|
967
967
|
e
|
|
968
968
|
);
|
|
969
969
|
}
|
|
970
|
-
function
|
|
970
|
+
function ho(e) {
|
|
971
971
|
var n, o, a;
|
|
972
972
|
const r = e.effectiveCardConfig ?? e.card.config, t = ne(
|
|
973
973
|
e.card,
|
|
974
974
|
r
|
|
975
975
|
);
|
|
976
|
-
return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) :
|
|
976
|
+
return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) : qe(e) ? Object.values(
|
|
977
977
|
((a = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : a.columnSettingsMap) || {}
|
|
978
978
|
).some(
|
|
979
979
|
(i) => {
|
|
980
|
-
var
|
|
981
|
-
return i.type === "date" && !((
|
|
980
|
+
var c;
|
|
981
|
+
return i.type === "date" && !((c = i.dateFormat) != null && c.useRelativeTime);
|
|
982
982
|
}
|
|
983
983
|
) : !1;
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function Ee(e, r) {
|
|
986
986
|
if (!r.executionSnapshot || e.kind === "inactive" || e.kind === "loading" || e.kind === "invalid")
|
|
987
987
|
return e;
|
|
988
988
|
if (!r.dashboardId)
|
|
@@ -995,7 +995,7 @@ function ke(e, r) {
|
|
|
995
995
|
};
|
|
996
996
|
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
997
997
|
for (const o of e.presentation.activatedColumnKeys) {
|
|
998
|
-
const a =
|
|
998
|
+
const a = Tt({
|
|
999
999
|
snapshot: r.executionSnapshot,
|
|
1000
1000
|
scope: {
|
|
1001
1001
|
dashboardId: r.dashboardId,
|
|
@@ -1007,11 +1007,11 @@ function ke(e, r) {
|
|
|
1007
1007
|
if (!a)
|
|
1008
1008
|
return {
|
|
1009
1009
|
kind: "invalid",
|
|
1010
|
-
error: new
|
|
1010
|
+
error: new wt(o)
|
|
1011
1011
|
};
|
|
1012
1012
|
const i = e.presentation.byColumnKey.get(o);
|
|
1013
1013
|
if (!i) continue;
|
|
1014
|
-
const
|
|
1014
|
+
const c = {
|
|
1015
1015
|
...i,
|
|
1016
1016
|
format: a,
|
|
1017
1017
|
formatValue: re({
|
|
@@ -1019,7 +1019,7 @@ function ke(e, r) {
|
|
|
1019
1019
|
format: a
|
|
1020
1020
|
})
|
|
1021
1021
|
};
|
|
1022
|
-
t.set(i.columnKey,
|
|
1022
|
+
t.set(i.columnKey, c), i.fieldId && n.set(i.fieldId, c);
|
|
1023
1023
|
}
|
|
1024
1024
|
return {
|
|
1025
1025
|
...e,
|
|
@@ -1030,7 +1030,7 @@ function ke(e, r) {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
};
|
|
1032
1032
|
}
|
|
1033
|
-
function
|
|
1033
|
+
function pr(e) {
|
|
1034
1034
|
var t, n;
|
|
1035
1035
|
if (e.resultOwner !== "freeform" || !((t = e.sql) != null && t.trim()) || (n = e.normalizedPython) != null && n.trim())
|
|
1036
1036
|
return { kind: "inactive" };
|
|
@@ -1046,81 +1046,81 @@ function fr(e) {
|
|
|
1046
1046
|
if (!e.records) return { kind: "loading" };
|
|
1047
1047
|
try {
|
|
1048
1048
|
const o = /* @__PURE__ */ new Map(), a = new Set(
|
|
1049
|
-
r.map(([
|
|
1050
|
-
), i = /* @__PURE__ */ new Map(),
|
|
1051
|
-
for (const [
|
|
1049
|
+
r.map(([l]) => l)
|
|
1050
|
+
), i = /* @__PURE__ */ new Map(), c = [...e.columns || []];
|
|
1051
|
+
for (const [l, s] of r) {
|
|
1052
1052
|
const u = be(
|
|
1053
1053
|
s.dateFormat
|
|
1054
1054
|
);
|
|
1055
1055
|
if (!u) continue;
|
|
1056
|
-
const
|
|
1057
|
-
columnKey:
|
|
1056
|
+
const f = Bt({
|
|
1057
|
+
columnKey: l,
|
|
1058
1058
|
values: e.records.map((b) => {
|
|
1059
|
-
if (!Object.prototype.hasOwnProperty.call(b,
|
|
1059
|
+
if (!Object.prototype.hasOwnProperty.call(b, l))
|
|
1060
1060
|
throw new S(
|
|
1061
1061
|
"missing_raw_temporal_result_contract",
|
|
1062
|
-
`Declared SQL temporal column "${
|
|
1063
|
-
{ columnKey:
|
|
1062
|
+
`Declared SQL temporal column "${l}" is absent from a physical result row.`,
|
|
1063
|
+
{ columnKey: l }
|
|
1064
1064
|
);
|
|
1065
|
-
const C = b[
|
|
1065
|
+
const C = b[l];
|
|
1066
1066
|
return C === null || typeof C == "string" ? C : String(C);
|
|
1067
1067
|
})
|
|
1068
1068
|
});
|
|
1069
|
-
if (i.set(
|
|
1070
|
-
let m =
|
|
1071
|
-
(b) => b.key ===
|
|
1069
|
+
if (i.set(l, f), f.status !== "classified") continue;
|
|
1070
|
+
let m = c.findIndex(
|
|
1071
|
+
(b) => b.key === l
|
|
1072
1072
|
);
|
|
1073
1073
|
if (e.columns && m < 0)
|
|
1074
1074
|
throw new S(
|
|
1075
1075
|
"missing_raw_temporal_result_contract",
|
|
1076
|
-
`Classified SQL temporal column "${
|
|
1077
|
-
{ columnKey:
|
|
1076
|
+
`Classified SQL temporal column "${l}" is absent from result columns.`,
|
|
1077
|
+
{ columnKey: l }
|
|
1078
1078
|
);
|
|
1079
|
-
m < 0 && (m =
|
|
1080
|
-
key:
|
|
1081
|
-
name:
|
|
1082
|
-
label:
|
|
1079
|
+
m < 0 && (m = c.length, c.push({
|
|
1080
|
+
key: l,
|
|
1081
|
+
name: l,
|
|
1082
|
+
label: l,
|
|
1083
1083
|
role: "dimension",
|
|
1084
1084
|
dataType: "string"
|
|
1085
1085
|
}));
|
|
1086
1086
|
const g = {
|
|
1087
|
-
...
|
|
1087
|
+
...c[m],
|
|
1088
1088
|
role: "date",
|
|
1089
|
-
dataType:
|
|
1090
|
-
rawTemporal:
|
|
1089
|
+
dataType: f.metadata.valueKind === "date" ? "date" : "datetime",
|
|
1090
|
+
rawTemporal: f.metadata
|
|
1091
1091
|
};
|
|
1092
1092
|
Ke(g, {
|
|
1093
1093
|
metadataRequired: !0
|
|
1094
|
-
}),
|
|
1094
|
+
}), c[m] = g;
|
|
1095
1095
|
const y = W({
|
|
1096
1096
|
format: u,
|
|
1097
1097
|
preferences: e.preferences,
|
|
1098
1098
|
calendar: e.calendar
|
|
1099
1099
|
});
|
|
1100
|
-
o.set(
|
|
1101
|
-
columnKey:
|
|
1102
|
-
metadata:
|
|
1100
|
+
o.set(l, {
|
|
1101
|
+
columnKey: l,
|
|
1102
|
+
metadata: f.metadata,
|
|
1103
1103
|
format: y,
|
|
1104
1104
|
formatValue: re({
|
|
1105
|
-
metadata:
|
|
1105
|
+
metadata: f.metadata,
|
|
1106
1106
|
format: y
|
|
1107
1107
|
})
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
1110
|
const d = {
|
|
1111
|
-
...
|
|
1111
|
+
...mr(),
|
|
1112
1112
|
activatedColumnKeys: a,
|
|
1113
1113
|
byColumnKey: o
|
|
1114
1114
|
};
|
|
1115
1115
|
return e.records.length === 0 ? {
|
|
1116
1116
|
kind: "loaded_empty",
|
|
1117
1117
|
presentation: d,
|
|
1118
|
-
adaptedColumns:
|
|
1118
|
+
adaptedColumns: c,
|
|
1119
1119
|
sqlClassifications: i
|
|
1120
1120
|
} : {
|
|
1121
1121
|
kind: "loaded_valid",
|
|
1122
1122
|
presentation: d,
|
|
1123
|
-
adaptedColumns:
|
|
1123
|
+
adaptedColumns: c,
|
|
1124
1124
|
sqlClassifications: i
|
|
1125
1125
|
};
|
|
1126
1126
|
} catch (o) {
|
|
@@ -1133,7 +1133,7 @@ function fr(e) {
|
|
|
1133
1133
|
);
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function go(e) {
|
|
1137
1137
|
if (e.value !== null && typeof e.value != "string")
|
|
1138
1138
|
return {
|
|
1139
1139
|
value: e.value,
|
|
@@ -1150,11 +1150,11 @@ function yo(e) {
|
|
|
1150
1150
|
const r = e.presentation.formatValue(e.value);
|
|
1151
1151
|
return { value: e.value, label: r.text, result: r };
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function vo(e) {
|
|
1154
1154
|
if (!e.result || typeof e.result != "object") return !1;
|
|
1155
1155
|
const r = e.result;
|
|
1156
1156
|
if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner || !Array.isArray(r.records)) return !1;
|
|
1157
|
-
const t =
|
|
1157
|
+
const t = fr({
|
|
1158
1158
|
card: e.card,
|
|
1159
1159
|
effectiveCardConfig: e.effectiveCardConfig,
|
|
1160
1160
|
records: r.records,
|
|
@@ -1165,36 +1165,36 @@ function ho(e) {
|
|
|
1165
1165
|
});
|
|
1166
1166
|
return t.kind === "inactive" || t.kind === "loaded_empty" || t.kind === "loaded_valid";
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function ke(e) {
|
|
1169
1169
|
return !e || typeof e != "object" ? !1 : Array.isArray(e.cards);
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function yr(e) {
|
|
1172
1172
|
if (!e)
|
|
1173
1173
|
return null;
|
|
1174
1174
|
if (typeof e == "string")
|
|
1175
1175
|
try {
|
|
1176
1176
|
const r = JSON.parse(e);
|
|
1177
|
-
return
|
|
1177
|
+
return ke(r) ? r : null;
|
|
1178
1178
|
} catch {
|
|
1179
1179
|
return null;
|
|
1180
1180
|
}
|
|
1181
|
-
return
|
|
1181
|
+
return ke(e) ? e : null;
|
|
1182
1182
|
}
|
|
1183
1183
|
function Ue(e) {
|
|
1184
1184
|
var r;
|
|
1185
1185
|
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;
|
|
1186
1186
|
}
|
|
1187
|
-
function
|
|
1187
|
+
function bo(e) {
|
|
1188
1188
|
var t;
|
|
1189
1189
|
const r = (e == null ? void 0 : e.frameObject) ?? ((t = e == null ? void 0 : e.visual) == null ? void 0 : t.frameObject);
|
|
1190
|
-
return Ue(
|
|
1190
|
+
return Ue(yr(r));
|
|
1191
1191
|
}
|
|
1192
1192
|
function Ie(e) {
|
|
1193
1193
|
if (!(e != null && e.expectedType)) return "table";
|
|
1194
1194
|
const r = Array.isArray(e.expectedType) ? e.expectedType[0] : e.expectedType;
|
|
1195
|
-
return
|
|
1195
|
+
return gr(r) ? r : "table";
|
|
1196
1196
|
}
|
|
1197
|
-
const
|
|
1197
|
+
const hr = [
|
|
1198
1198
|
"bar",
|
|
1199
1199
|
"horizontalBar",
|
|
1200
1200
|
"line",
|
|
@@ -1225,8 +1225,8 @@ const yr = [
|
|
|
1225
1225
|
"treemap",
|
|
1226
1226
|
"custom"
|
|
1227
1227
|
];
|
|
1228
|
-
function
|
|
1229
|
-
return
|
|
1228
|
+
function gr(e) {
|
|
1229
|
+
return hr.includes(e);
|
|
1230
1230
|
}
|
|
1231
1231
|
function Y(e) {
|
|
1232
1232
|
const r = e.position;
|
|
@@ -1277,14 +1277,14 @@ function Ge(e, r) {
|
|
|
1277
1277
|
return (u == null ? void 0 : u.kind) === "number" && u.start === r;
|
|
1278
1278
|
});
|
|
1279
1279
|
if (a) return a;
|
|
1280
|
-
const
|
|
1280
|
+
const c = n.sort(
|
|
1281
1281
|
(s, u) => Y(s) - Y(u)
|
|
1282
1282
|
).find((s) => {
|
|
1283
1283
|
const u = H(s.position);
|
|
1284
1284
|
return (u == null ? void 0 : u.kind) === "range" && r >= u.start && r <= u.end;
|
|
1285
1285
|
});
|
|
1286
|
-
if (
|
|
1287
|
-
const
|
|
1286
|
+
if (c) return c;
|
|
1287
|
+
const l = o.map((s) => ({
|
|
1288
1288
|
slot: s,
|
|
1289
1289
|
parsed: H(s.position)
|
|
1290
1290
|
})).filter((s) => {
|
|
@@ -1292,26 +1292,26 @@ function Ge(e, r) {
|
|
|
1292
1292
|
return ((u = s.parsed) == null ? void 0 : u.kind) === "dynamic";
|
|
1293
1293
|
}).sort(
|
|
1294
1294
|
(s, u) => {
|
|
1295
|
-
var
|
|
1296
|
-
return (((
|
|
1295
|
+
var f, m;
|
|
1296
|
+
return (((f = s.parsed) == null ? void 0 : f.start) ?? 0) - (((m = u.parsed) == null ? void 0 : m.start) ?? 0);
|
|
1297
1297
|
}
|
|
1298
1298
|
).filter((s) => {
|
|
1299
1299
|
var u;
|
|
1300
1300
|
return r >= (((u = s.parsed) == null ? void 0 : u.start) ?? 0);
|
|
1301
1301
|
}).sort(
|
|
1302
1302
|
(s, u) => {
|
|
1303
|
-
var
|
|
1304
|
-
return (((
|
|
1303
|
+
var f, m;
|
|
1304
|
+
return (((f = u.parsed) == null ? void 0 : f.start) ?? 0) - (((m = s.parsed) == null ? void 0 : m.start) ?? 0);
|
|
1305
1305
|
}
|
|
1306
1306
|
)[0];
|
|
1307
|
-
return
|
|
1307
|
+
return l == null ? void 0 : l.slot;
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1309
|
+
function vr(e, r) {
|
|
1310
1310
|
const t = Ge(e, r);
|
|
1311
1311
|
if (t)
|
|
1312
1312
|
return Ie(t);
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function br(e, r) {
|
|
1315
1315
|
var n;
|
|
1316
1316
|
const t = (n = e == null ? void 0 : e.customCardPreferences) == null ? void 0 : n.slotIndex;
|
|
1317
1317
|
return typeof t == "number" ? t : r;
|
|
@@ -1334,18 +1334,18 @@ function Se(e, r) {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
return !1;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Ir(e) {
|
|
1338
1338
|
const r = [];
|
|
1339
1339
|
let t = -1;
|
|
1340
1340
|
e.forEach((n, o) => {
|
|
1341
|
-
const a =
|
|
1341
|
+
const a = br(n, o);
|
|
1342
1342
|
a > t && (t = a), r[a] = n ?? null;
|
|
1343
1343
|
});
|
|
1344
1344
|
for (let n = 0; n <= t; n += 1)
|
|
1345
1345
|
n in r || (r[n] = null);
|
|
1346
1346
|
return r;
|
|
1347
1347
|
}
|
|
1348
|
-
function
|
|
1348
|
+
function Io(e) {
|
|
1349
1349
|
return e.map((r, t) => !r.customCardPreferences || r.customCardPreferences.slotIndex === t ? r : {
|
|
1350
1350
|
...r,
|
|
1351
1351
|
customCardPreferences: {
|
|
@@ -1354,17 +1354,17 @@ function vo(e) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
});
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function Co(e) {
|
|
1358
1358
|
const r = je(e);
|
|
1359
1359
|
if (r)
|
|
1360
1360
|
return Ie(r);
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1362
|
+
function To(e, r, t) {
|
|
1363
1363
|
if (!e) return;
|
|
1364
|
-
const n =
|
|
1364
|
+
const n = vr(t, r);
|
|
1365
1365
|
return e.type === "custom" && n ? n : e.type;
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1367
|
+
function wo(e, r, t) {
|
|
1368
1368
|
var g;
|
|
1369
1369
|
const n = {
|
|
1370
1370
|
dataSource: t.dataSource,
|
|
@@ -1383,19 +1383,19 @@ function Co(e, r, t) {
|
|
|
1383
1383
|
pluginChartType: r.chartType,
|
|
1384
1384
|
minInputs: r.minInputs,
|
|
1385
1385
|
maxInputs: r.maxInputs
|
|
1386
|
-
}, a = r.minInputs || 1,
|
|
1386
|
+
}, a = r.minInputs || 1, c = e.map((y) => ({ slot: y, parsed: H(y.position) })).filter((y) => y.parsed !== null).reduce((y, b) => {
|
|
1387
1387
|
const C = b.parsed.end;
|
|
1388
1388
|
return Number.isFinite(C) ? Math.max(y, C) : y;
|
|
1389
|
-
}, -1), d = Math.max(a,
|
|
1389
|
+
}, -1), d = Math.max(a, c + 1), l = je(e), s = l ? Y(l) : 0;
|
|
1390
1390
|
let u = !1;
|
|
1391
|
-
const
|
|
1391
|
+
const f = [];
|
|
1392
1392
|
for (let y = 0; y < d; y += 1) {
|
|
1393
|
-
const b = Ge(e, y), C = Ie(b), v = !u && y === s, w = y,
|
|
1393
|
+
const b = Ge(e, y), C = Ie(b), v = !u && y === s, w = y, k = {
|
|
1394
1394
|
...n,
|
|
1395
|
-
id:
|
|
1396
|
-
title: (v ?
|
|
1397
|
-
tabTitle: (v ?
|
|
1398
|
-
description: (v ?
|
|
1395
|
+
id: Ft(),
|
|
1396
|
+
title: (v ? l == null ? void 0 : l.label : b == null ? void 0 : b.label) || `Tab ${y + 1}`,
|
|
1397
|
+
tabTitle: (v ? l == null ? void 0 : l.label : b == null ? void 0 : b.label) || `Tab ${y + 1}`,
|
|
1398
|
+
description: (v ? l == null ? void 0 : l.description : b == null ? void 0 : b.description) || "",
|
|
1399
1399
|
type: C,
|
|
1400
1400
|
sql: "",
|
|
1401
1401
|
preferences: {
|
|
@@ -1413,32 +1413,32 @@ function Co(e, r, t) {
|
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
1415
|
};
|
|
1416
|
-
v && (u = !0),
|
|
1416
|
+
v && (u = !0), f.push(k);
|
|
1417
1417
|
}
|
|
1418
|
-
if (!u &&
|
|
1419
|
-
const y = ((g =
|
|
1420
|
-
|
|
1421
|
-
...
|
|
1422
|
-
type:
|
|
1418
|
+
if (!u && f.length > 0) {
|
|
1419
|
+
const y = ((g = f[0].customCardPreferences) == null ? void 0 : g.slotIndex) ?? 0;
|
|
1420
|
+
f[0] = {
|
|
1421
|
+
...f[0],
|
|
1422
|
+
type: f[0].type,
|
|
1423
1423
|
customCardPreferences: {
|
|
1424
1424
|
...o,
|
|
1425
1425
|
slotIndex: y
|
|
1426
1426
|
}
|
|
1427
1427
|
};
|
|
1428
1428
|
}
|
|
1429
|
-
const m =
|
|
1429
|
+
const m = f.findIndex(
|
|
1430
1430
|
(y) => {
|
|
1431
1431
|
var b;
|
|
1432
1432
|
return !!((b = y.customCardPreferences) != null && b.url);
|
|
1433
1433
|
}
|
|
1434
1434
|
);
|
|
1435
1435
|
if (m > 0) {
|
|
1436
|
-
const [y] =
|
|
1437
|
-
|
|
1436
|
+
const [y] = f.splice(m, 1);
|
|
1437
|
+
f.unshift(y);
|
|
1438
1438
|
}
|
|
1439
|
-
return
|
|
1439
|
+
return f;
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1441
|
+
function Cr({
|
|
1442
1442
|
frame: e,
|
|
1443
1443
|
configCard: r,
|
|
1444
1444
|
isMultiInputVisual: t
|
|
@@ -1448,15 +1448,15 @@ function Ir({
|
|
|
1448
1448
|
return e.cards;
|
|
1449
1449
|
const n = (o = r.customCardPreferences) == null ? void 0 : o.dataInputCardIds;
|
|
1450
1450
|
return n ? Object.keys(n).sort((a, i) => Number(a) - Number(i)).map((a) => {
|
|
1451
|
-
var
|
|
1452
|
-
const i = (
|
|
1451
|
+
var c;
|
|
1452
|
+
const i = (c = n[a]) == null ? void 0 : c.cardId;
|
|
1453
1453
|
return e.cards.find((d) => d.id === i) || null;
|
|
1454
1454
|
}) : e.cards;
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1456
|
+
function Tr(e, r) {
|
|
1457
1457
|
return r && Se(r, e.cards) ? r : e.cards.find((t) => Se(t, e.cards)) || null;
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function wr(e, r) {
|
|
1460
1460
|
var o, a;
|
|
1461
1461
|
if (!e) return null;
|
|
1462
1462
|
const t = r == null ? void 0 : r.visualType;
|
|
@@ -1466,10 +1466,10 @@ function Tr(e, r) {
|
|
|
1466
1466
|
const n = (o = e.customCardPreferences) == null ? void 0 : o.visualType;
|
|
1467
1467
|
return n || ((a = e.customCardPreferences) != null && a.dataInputCardIds ? "multiple" : null);
|
|
1468
1468
|
}
|
|
1469
|
-
function
|
|
1469
|
+
function $o(e) {
|
|
1470
1470
|
return e.visualType === "multiple" || e.slots && e.slots.length > 0 || (e.minInputs || 0) > 1 || (e.maxInputs || 0) > 1 || (e.dataInputs || []).length > 1 ? "multiple" : "single";
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function xo(e) {
|
|
1473
1473
|
return Array.isArray(e) ? { records: e } : e;
|
|
1474
1474
|
}
|
|
1475
1475
|
class Q extends Error {
|
|
@@ -1483,7 +1483,7 @@ class Q extends Error {
|
|
|
1483
1483
|
this.name = "TemporalSnapshotSelectionError", this.selection = t;
|
|
1484
1484
|
}
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function $r(e, r) {
|
|
1487
1487
|
var o;
|
|
1488
1488
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
1489
1489
|
for (const a of r) {
|
|
@@ -1494,60 +1494,60 @@ function wr(e, r) {
|
|
|
1494
1494
|
);
|
|
1495
1495
|
if (a.sheetId && i.length === 0)
|
|
1496
1496
|
throw new Q(a);
|
|
1497
|
-
let
|
|
1497
|
+
let c = !a.cardId;
|
|
1498
1498
|
for (const d of i) {
|
|
1499
|
-
const
|
|
1500
|
-
(
|
|
1499
|
+
const l = (((o = d.document) == null ? void 0 : o.sections) || []).flatMap(
|
|
1500
|
+
(f) => Pt(f)
|
|
1501
1501
|
), s = (d.frames || []).flatMap(
|
|
1502
|
-
(
|
|
1502
|
+
(f) => xr(f, a.cardId)
|
|
1503
1503
|
);
|
|
1504
|
-
s.length > 0 && (
|
|
1504
|
+
s.length > 0 && (c = !0);
|
|
1505
1505
|
const u = [
|
|
1506
1506
|
...s,
|
|
1507
1507
|
...(d.cards || []).filter(
|
|
1508
|
-
(
|
|
1508
|
+
(f) => !a.cardId || a.cardId === f.id
|
|
1509
1509
|
),
|
|
1510
|
-
...
|
|
1511
|
-
(
|
|
1510
|
+
...l.filter(
|
|
1511
|
+
(f) => !a.cardId || a.cardId === f.id
|
|
1512
1512
|
)
|
|
1513
1513
|
];
|
|
1514
|
-
for (const
|
|
1515
|
-
|
|
1514
|
+
for (const f of u) {
|
|
1515
|
+
c = !0;
|
|
1516
1516
|
const m = n.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
|
|
1517
|
-
m.has(
|
|
1518
|
-
card:
|
|
1517
|
+
m.has(f.id) || (m.add(f.id), n.set(a.attachmentIndex, m), t.push({
|
|
1518
|
+
card: f,
|
|
1519
1519
|
...a.attachmentIndex !== void 0 ? { attachmentIndex: a.attachmentIndex } : {}
|
|
1520
1520
|
}));
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
|
-
if (!
|
|
1523
|
+
if (!c)
|
|
1524
1524
|
throw new Q(a);
|
|
1525
1525
|
}
|
|
1526
1526
|
return t;
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1528
|
+
function xr(e, r) {
|
|
1529
1529
|
var i;
|
|
1530
|
-
const t = r ? (i = e.cards) == null ? void 0 : i.find((
|
|
1530
|
+
const t = r ? (i = e.cards) == null ? void 0 : i.find((c) => c.id === r) : Ue(e);
|
|
1531
1531
|
if (!t) return [];
|
|
1532
|
-
const n =
|
|
1533
|
-
(
|
|
1532
|
+
const n = Tr(e, t), o = (e.cards || []).filter(
|
|
1533
|
+
(c) => {
|
|
1534
1534
|
var d;
|
|
1535
|
-
return typeof ((d =
|
|
1535
|
+
return typeof ((d = c.customCardPreferences) == null ? void 0 : d.slotIndex) == "number";
|
|
1536
1536
|
}
|
|
1537
|
-
).length > 1, a = n != null && (
|
|
1538
|
-
return !n || !a ? [t] :
|
|
1539
|
-
|
|
1537
|
+
).length > 1, a = n != null && (wr(n) === "multiple" || o);
|
|
1538
|
+
return !n || !a ? [t] : Ir(
|
|
1539
|
+
Cr({
|
|
1540
1540
|
frame: e,
|
|
1541
1541
|
configCard: n,
|
|
1542
1542
|
isMultiInputVisual: !0
|
|
1543
1543
|
})
|
|
1544
|
-
).filter((
|
|
1544
|
+
).filter((c) => c !== null);
|
|
1545
1545
|
}
|
|
1546
|
-
function
|
|
1547
|
-
return
|
|
1546
|
+
function Eo(e) {
|
|
1547
|
+
return $r(e.dashboard, e.selections).flatMap(
|
|
1548
1548
|
({ card: r, attachmentIndex: t }) => {
|
|
1549
|
-
var s, u,
|
|
1550
|
-
const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o =
|
|
1549
|
+
var s, u, f, m;
|
|
1550
|
+
const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o = er({
|
|
1551
1551
|
card: r,
|
|
1552
1552
|
cardConfig: n
|
|
1553
1553
|
}), a = {
|
|
@@ -1561,7 +1561,7 @@ function $o(e) {
|
|
|
1561
1561
|
fieldId: g.id,
|
|
1562
1562
|
role: g.role
|
|
1563
1563
|
},
|
|
1564
|
-
format:
|
|
1564
|
+
format: cr(
|
|
1565
1565
|
g,
|
|
1566
1566
|
{
|
|
1567
1567
|
dateStyle: e.valueFormatPreferences.dateStyle,
|
|
@@ -1569,7 +1569,7 @@ function $o(e) {
|
|
|
1569
1569
|
},
|
|
1570
1570
|
e.valueFormatPreferences.locale
|
|
1571
1571
|
)
|
|
1572
|
-
})) : [],
|
|
1572
|
+
})) : [], c = [], d = ne(r, n), l = Z(
|
|
1573
1573
|
r.python || ""
|
|
1574
1574
|
);
|
|
1575
1575
|
if (r.type === "detailTable" && d === "config") {
|
|
@@ -1592,7 +1592,7 @@ function $o(e) {
|
|
|
1592
1592
|
}))
|
|
1593
1593
|
], b = /* @__PURE__ */ new Map(), C = new Set(
|
|
1594
1594
|
y.map(
|
|
1595
|
-
({ field: v, role: w }) =>
|
|
1595
|
+
({ field: v, role: w }) => Ht(v, w)
|
|
1596
1596
|
)
|
|
1597
1597
|
);
|
|
1598
1598
|
for (const { field: v } of y) {
|
|
@@ -1602,32 +1602,32 @@ function $o(e) {
|
|
|
1602
1602
|
for (const v of g) {
|
|
1603
1603
|
const w = Ae(v.dataType);
|
|
1604
1604
|
if (w !== "date" && w !== "datetime") continue;
|
|
1605
|
-
const
|
|
1605
|
+
const k = Wt(v), _ = v.label, M = Yt({
|
|
1606
1606
|
label: _,
|
|
1607
1607
|
labelCount: _ && b.get(_) || 0,
|
|
1608
|
-
rawKey:
|
|
1608
|
+
rawKey: k,
|
|
1609
1609
|
rawKeys: C
|
|
1610
1610
|
});
|
|
1611
1611
|
if (!M) throw new Q(a);
|
|
1612
|
-
|
|
1612
|
+
c.push({
|
|
1613
1613
|
scope: a,
|
|
1614
1614
|
target: { kind: "column", columnKey: M },
|
|
1615
1615
|
format: W({
|
|
1616
|
-
format:
|
|
1616
|
+
format: Ve(v),
|
|
1617
1617
|
preferences: e.valueFormatPreferences,
|
|
1618
1618
|
calendar: e.calendar
|
|
1619
1619
|
})
|
|
1620
1620
|
});
|
|
1621
1621
|
}
|
|
1622
|
-
} else if (d === "freeform" && ((u = r.sql) != null && u.trim()) && !
|
|
1622
|
+
} else if (d === "freeform" && ((u = r.sql) != null && u.trim()) && !l.trim())
|
|
1623
1623
|
for (const [g, y] of Object.entries(
|
|
1624
|
-
((m = (
|
|
1624
|
+
((m = (f = r.preferences) == null ? void 0 : f.tablePrefs) == null ? void 0 : m.columnSettingsMap) || {}
|
|
1625
1625
|
)) {
|
|
1626
1626
|
if (y.type !== "date") continue;
|
|
1627
1627
|
const b = be(
|
|
1628
1628
|
y.dateFormat
|
|
1629
1629
|
);
|
|
1630
|
-
b &&
|
|
1630
|
+
b && c.push({
|
|
1631
1631
|
scope: a,
|
|
1632
1632
|
target: { kind: "column", columnKey: g },
|
|
1633
1633
|
format: W({
|
|
@@ -1637,11 +1637,11 @@ function $o(e) {
|
|
|
1637
1637
|
})
|
|
1638
1638
|
});
|
|
1639
1639
|
}
|
|
1640
|
-
return [...i, ...
|
|
1640
|
+
return [...i, ...c];
|
|
1641
1641
|
}
|
|
1642
1642
|
);
|
|
1643
1643
|
}
|
|
1644
|
-
const
|
|
1644
|
+
const Er = /* @__PURE__ */ new Set([
|
|
1645
1645
|
"table",
|
|
1646
1646
|
"aggregateTable",
|
|
1647
1647
|
"pivotTable",
|
|
@@ -1677,34 +1677,34 @@ const xr = /* @__PURE__ */ new Set([
|
|
|
1677
1677
|
"treemap",
|
|
1678
1678
|
"custom"
|
|
1679
1679
|
]);
|
|
1680
|
-
function
|
|
1680
|
+
function ko(e) {
|
|
1681
1681
|
var o, a, i;
|
|
1682
1682
|
const r = kr.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
|
|
1683
1683
|
let t = !1;
|
|
1684
1684
|
try {
|
|
1685
|
-
t = !!
|
|
1685
|
+
t = !!At(e);
|
|
1686
1686
|
} catch {
|
|
1687
1687
|
return { formats: [], defaultFormat: null };
|
|
1688
1688
|
}
|
|
1689
|
-
return e.type === "text" || !r || !t &&
|
|
1690
|
-
formats:
|
|
1689
|
+
return e.type === "text" || !r || !t && Rt(e) ? { formats: [], defaultFormat: null } : {
|
|
1690
|
+
formats: Sr({
|
|
1691
1691
|
cardType: e.type,
|
|
1692
1692
|
allowDownload: (a = e.preferences) == null ? void 0 : a.allowDownload
|
|
1693
1693
|
}),
|
|
1694
|
-
defaultFormat:
|
|
1694
|
+
defaultFormat: _r({
|
|
1695
1695
|
cardType: e.type,
|
|
1696
1696
|
allowDownload: (i = e.preferences) == null ? void 0 : i.allowDownload
|
|
1697
1697
|
})
|
|
1698
1698
|
};
|
|
1699
1699
|
}
|
|
1700
|
-
function
|
|
1700
|
+
function Sr(e) {
|
|
1701
1701
|
return e.allowDownload === !1 ? ["pdf"] : ["pdf", "csv"];
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1704
|
-
return
|
|
1703
|
+
function _r(e) {
|
|
1704
|
+
return Er.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1707
|
-
const { config: r } = e, t =
|
|
1706
|
+
function So(e) {
|
|
1707
|
+
const { config: r } = e, t = _t({
|
|
1708
1708
|
spec: r.spec,
|
|
1709
1709
|
presentation: r.presentation,
|
|
1710
1710
|
defaults: r.defaultView,
|
|
@@ -1724,7 +1724,7 @@ function ko(e) {
|
|
|
1724
1724
|
}
|
|
1725
1725
|
});
|
|
1726
1726
|
}
|
|
1727
|
-
const
|
|
1727
|
+
const Fr = T.object({
|
|
1728
1728
|
connection_id: T.string().min(1),
|
|
1729
1729
|
cardType: T.literal("matrixTable"),
|
|
1730
1730
|
resultOwner: T.literal("config"),
|
|
@@ -1739,7 +1739,7 @@ const _r = T.object({
|
|
|
1739
1739
|
semanticDomainId: T.string().optional()
|
|
1740
1740
|
}).passthrough(),
|
|
1741
1741
|
active_filters: T.array(T.unknown()).default([])
|
|
1742
|
-
}).passthrough(),
|
|
1742
|
+
}).passthrough(), _o = Fr.extend({
|
|
1743
1743
|
dashboardId: T.string().min(1),
|
|
1744
1744
|
cardId: T.string().min(1),
|
|
1745
1745
|
formatOptions: T.object({
|
|
@@ -1754,7 +1754,7 @@ const _r = T.object({
|
|
|
1754
1754
|
});
|
|
1755
1755
|
})
|
|
1756
1756
|
});
|
|
1757
|
-
function
|
|
1757
|
+
function Fo(e) {
|
|
1758
1758
|
return {
|
|
1759
1759
|
...e.controls,
|
|
1760
1760
|
type: "card",
|
|
@@ -1774,24 +1774,27 @@ function So(e) {
|
|
|
1774
1774
|
},
|
|
1775
1775
|
active_filters: e.activeFilters,
|
|
1776
1776
|
formatOptions: {
|
|
1777
|
-
...e.matrix.format === "csv" ? {
|
|
1777
|
+
...e.matrix.format === "csv" ? {
|
|
1778
|
+
acquisition: "continuation",
|
|
1779
|
+
...e.csvEncoding ? { csvEncoding: e.csvEncoding } : {}
|
|
1780
|
+
} : {},
|
|
1778
1781
|
matrix: e.matrix,
|
|
1779
1782
|
delimiter: e.delimiter,
|
|
1780
1783
|
includeHeaders: e.includeHeaders,
|
|
1781
1784
|
timezone: e.reportContext.calendar.tz,
|
|
1782
|
-
presentationExecutionSnapshot:
|
|
1785
|
+
presentationExecutionSnapshot: $t({
|
|
1783
1786
|
reportContext: e.reportContext,
|
|
1784
1787
|
resolvedFormats: []
|
|
1785
1788
|
})
|
|
1786
1789
|
}
|
|
1787
1790
|
};
|
|
1788
1791
|
}
|
|
1789
|
-
const ie = T.number().int().nonnegative(),
|
|
1792
|
+
const ie = T.number().int().nonnegative(), Ro = T.discriminatedUnion("status", [
|
|
1790
1793
|
T.object({
|
|
1791
1794
|
status: T.literal("ok"),
|
|
1792
1795
|
request: ye,
|
|
1793
|
-
layout:
|
|
1794
|
-
rows: T.array(
|
|
1796
|
+
layout: kt,
|
|
1797
|
+
rows: T.array(St).readonly(),
|
|
1795
1798
|
usage: T.object({ rows: ie, cells: ie, bytes: ie }).strict()
|
|
1796
1799
|
}).strict(),
|
|
1797
1800
|
T.object({
|
|
@@ -1813,11 +1816,11 @@ const ie = T.number().int().nonnegative(), _o = T.discriminatedUnion("status", [
|
|
|
1813
1816
|
}).strict()
|
|
1814
1817
|
}).strict()
|
|
1815
1818
|
]);
|
|
1816
|
-
function
|
|
1819
|
+
function Rr(e) {
|
|
1817
1820
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
1818
1821
|
}
|
|
1819
1822
|
function P(e, r, t) {
|
|
1820
|
-
return
|
|
1823
|
+
return Rr(e) ? e : (t.push({ field: r, message: "Expected an object." }), {});
|
|
1821
1824
|
}
|
|
1822
1825
|
function B(e, r, t, n) {
|
|
1823
1826
|
const o = new Set(t);
|
|
@@ -1873,7 +1876,7 @@ function _e(e, r, t) {
|
|
|
1873
1876
|
);
|
|
1874
1877
|
const i = {};
|
|
1875
1878
|
if (a.color !== void 0) {
|
|
1876
|
-
const
|
|
1879
|
+
const c = P(
|
|
1877
1880
|
a.color,
|
|
1878
1881
|
`${r}.tokens.color`,
|
|
1879
1882
|
t
|
|
@@ -1890,38 +1893,38 @@ function _e(e, r, t) {
|
|
|
1890
1893
|
"warning",
|
|
1891
1894
|
"info"
|
|
1892
1895
|
];
|
|
1893
|
-
B(
|
|
1894
|
-
const
|
|
1896
|
+
B(c, `${r}.tokens.color`, d, t);
|
|
1897
|
+
const l = {};
|
|
1895
1898
|
d.forEach((s) => {
|
|
1896
1899
|
const u = N(
|
|
1897
|
-
|
|
1900
|
+
c[s],
|
|
1898
1901
|
`${r}.tokens.color.${s}`,
|
|
1899
1902
|
120,
|
|
1900
1903
|
t
|
|
1901
1904
|
);
|
|
1902
|
-
u !== void 0 && (
|
|
1903
|
-
}), i.color =
|
|
1905
|
+
u !== void 0 && (l[s] = u);
|
|
1906
|
+
}), i.color = l;
|
|
1904
1907
|
}
|
|
1905
1908
|
if (a.typography !== void 0) {
|
|
1906
|
-
const
|
|
1909
|
+
const c = P(
|
|
1907
1910
|
a.typography,
|
|
1908
1911
|
`${r}.tokens.typography`,
|
|
1909
1912
|
t
|
|
1910
1913
|
);
|
|
1911
1914
|
B(
|
|
1912
|
-
|
|
1915
|
+
c,
|
|
1913
1916
|
`${r}.tokens.typography`,
|
|
1914
1917
|
["fontFamily", "monoFontFamily"],
|
|
1915
1918
|
t
|
|
1916
1919
|
);
|
|
1917
1920
|
const d = N(
|
|
1918
|
-
|
|
1921
|
+
c.fontFamily,
|
|
1919
1922
|
`${r}.tokens.typography.fontFamily`,
|
|
1920
1923
|
500,
|
|
1921
1924
|
t,
|
|
1922
1925
|
{ allowEmpty: !0 }
|
|
1923
|
-
),
|
|
1924
|
-
|
|
1926
|
+
), l = N(
|
|
1927
|
+
c.monoFontFamily,
|
|
1925
1928
|
`${r}.tokens.typography.monoFontFamily`,
|
|
1926
1929
|
500,
|
|
1927
1930
|
t,
|
|
@@ -1929,7 +1932,7 @@ function _e(e, r, t) {
|
|
|
1929
1932
|
);
|
|
1930
1933
|
i.typography = {
|
|
1931
1934
|
...d !== void 0 ? { fontFamily: d } : {},
|
|
1932
|
-
...
|
|
1935
|
+
...l !== void 0 ? { monoFontFamily: l } : {}
|
|
1933
1936
|
};
|
|
1934
1937
|
}
|
|
1935
1938
|
o.tokens = i;
|
|
@@ -1947,14 +1950,14 @@ function _e(e, r, t) {
|
|
|
1947
1950
|
t
|
|
1948
1951
|
);
|
|
1949
1952
|
B(i, `${r}.components.chart`, ["palette"], t);
|
|
1950
|
-
let
|
|
1953
|
+
let c;
|
|
1951
1954
|
i.palette !== void 0 && (Array.isArray(i.palette) ? i.palette.length > 20 ? t.push({
|
|
1952
1955
|
field: `${r}.components.chart.palette`,
|
|
1953
1956
|
message: "Expected 20 colors or fewer."
|
|
1954
|
-
}) :
|
|
1955
|
-
(d,
|
|
1957
|
+
}) : c = i.palette.map(
|
|
1958
|
+
(d, l) => N(
|
|
1956
1959
|
d,
|
|
1957
|
-
`${r}.components.chart.palette.${
|
|
1960
|
+
`${r}.components.chart.palette.${l}`,
|
|
1958
1961
|
120,
|
|
1959
1962
|
t
|
|
1960
1963
|
)
|
|
@@ -1962,13 +1965,13 @@ function _e(e, r, t) {
|
|
|
1962
1965
|
field: `${r}.components.chart.palette`,
|
|
1963
1966
|
message: "Expected an array."
|
|
1964
1967
|
})), o.components = {
|
|
1965
|
-
chart:
|
|
1968
|
+
chart: c ? { palette: c } : {}
|
|
1966
1969
|
};
|
|
1967
1970
|
}
|
|
1968
1971
|
}
|
|
1969
1972
|
return o;
|
|
1970
1973
|
}
|
|
1971
|
-
function
|
|
1974
|
+
function Ar(e, r) {
|
|
1972
1975
|
const t = "presentation.appearance", n = P(e, t, r);
|
|
1973
1976
|
B(n, t, ["version", "schemes"], r);
|
|
1974
1977
|
const o = {};
|
|
@@ -1993,7 +1996,7 @@ function Rr(e, r) {
|
|
|
1993
1996
|
}
|
|
1994
1997
|
return o;
|
|
1995
1998
|
}
|
|
1996
|
-
function
|
|
1999
|
+
function Dr(e, r) {
|
|
1997
2000
|
const t = "presentation.brandOverrides", n = P(e, t, r);
|
|
1998
2001
|
B(n, t, ["brandName", "logoUrl", "link"], r);
|
|
1999
2002
|
const o = N(
|
|
@@ -2008,7 +2011,7 @@ function Ar(e, r) {
|
|
|
2008
2011
|
...i !== void 0 ? { link: i } : {}
|
|
2009
2012
|
};
|
|
2010
2013
|
}
|
|
2011
|
-
function
|
|
2014
|
+
function Mr(e, r) {
|
|
2012
2015
|
const t = "presentation.fragments", n = P(e, t, r), o = [
|
|
2013
2016
|
"preHeaderText",
|
|
2014
2017
|
"headerBannerHtml",
|
|
@@ -2020,19 +2023,19 @@ function Dr(e, r) {
|
|
|
2020
2023
|
B(n, t, o, r);
|
|
2021
2024
|
const a = {};
|
|
2022
2025
|
return o.forEach((i) => {
|
|
2023
|
-
const
|
|
2026
|
+
const c = i === "unsubscribeUrl" ? Ce(n[i], `${t}.${i}`, r) : N(
|
|
2024
2027
|
n[i],
|
|
2025
2028
|
`${t}.${i}`,
|
|
2026
2029
|
i === "preHeaderText" ? 200 : 5e3,
|
|
2027
2030
|
r,
|
|
2028
2031
|
{ trim: i === "preHeaderText" }
|
|
2029
2032
|
);
|
|
2030
|
-
|
|
2033
|
+
c !== void 0 && (a[i] = c);
|
|
2031
2034
|
}), a;
|
|
2032
2035
|
}
|
|
2033
|
-
function
|
|
2036
|
+
function Pr(e) {
|
|
2034
2037
|
const r = [], t = {};
|
|
2035
|
-
if (e.appearance !== void 0 && (t.appearance =
|
|
2038
|
+
if (e.appearance !== void 0 && (t.appearance = Ar(e.appearance, r)), e.brandOverrides !== void 0 && (t.brandOverrides = Dr(e.brandOverrides, r)), e.fragments !== void 0 && (t.fragments = Mr(e.fragments, r)), e.viewUrl !== void 0) {
|
|
2036
2039
|
const n = Ce(e.viewUrl, "presentation.viewUrl", r);
|
|
2037
2040
|
n !== void 0 && (t.viewUrl = n);
|
|
2038
2041
|
}
|
|
@@ -2054,13 +2057,13 @@ const X = [
|
|
|
2054
2057
|
3: "third",
|
|
2055
2058
|
4: "fourth",
|
|
2056
2059
|
[-1]: "last"
|
|
2057
|
-
},
|
|
2060
|
+
}, Ao = {
|
|
2058
2061
|
frequency: "weekly",
|
|
2059
2062
|
hour: 9,
|
|
2060
2063
|
minute: 0,
|
|
2061
2064
|
weekdays: [1]
|
|
2062
2065
|
}, A = { ok: !1, issue: "Choose a supported schedule." };
|
|
2063
|
-
function
|
|
2066
|
+
function Br(e) {
|
|
2064
2067
|
if (typeof e != "string" || e.length === 0 || e !== e.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(e))
|
|
2065
2068
|
return !1;
|
|
2066
2069
|
try {
|
|
@@ -2069,7 +2072,7 @@ function Pr(e) {
|
|
|
2069
2072
|
return !1;
|
|
2070
2073
|
}
|
|
2071
2074
|
}
|
|
2072
|
-
function
|
|
2075
|
+
function Or(e) {
|
|
2073
2076
|
return Number.isInteger(e.minute) && e.minute >= 0 && e.minute <= 59 && Number.isInteger(e.hour) && e.hour >= 0 && e.hour <= 23;
|
|
2074
2077
|
}
|
|
2075
2078
|
function Ze(e) {
|
|
@@ -2088,20 +2091,20 @@ function Qe(e) {
|
|
|
2088
2091
|
const n = e.includes("last") ? [...t, "last"] : t;
|
|
2089
2092
|
return n.length > 0 ? n : null;
|
|
2090
2093
|
}
|
|
2091
|
-
function
|
|
2094
|
+
function V(e, r) {
|
|
2092
2095
|
const t = [];
|
|
2093
2096
|
for (let n = 0; n < 12 / e; n += 1)
|
|
2094
2097
|
t.push((r + n * e) % 12);
|
|
2095
2098
|
return t.sort((n, o) => n - o);
|
|
2096
2099
|
}
|
|
2097
|
-
function
|
|
2098
|
-
return e === 1 ? "*" :
|
|
2100
|
+
function Kr(e, r) {
|
|
2101
|
+
return e === 1 ? "*" : V(e, r).map((t) => t + 1).join(",");
|
|
2099
2102
|
}
|
|
2100
2103
|
function Xe(e, r) {
|
|
2101
|
-
return e.every((t) =>
|
|
2104
|
+
return e.every((t) => Gr(t, r));
|
|
2102
2105
|
}
|
|
2103
|
-
function
|
|
2104
|
-
if (!
|
|
2106
|
+
function Do(e) {
|
|
2107
|
+
if (!Or(e))
|
|
2105
2108
|
throw new Error("Choose a valid schedule time.");
|
|
2106
2109
|
const r = `${e.minute} ${e.hour}`;
|
|
2107
2110
|
switch (e.frequency) {
|
|
@@ -2115,14 +2118,14 @@ function Ro(e) {
|
|
|
2115
2118
|
case "monthly": {
|
|
2116
2119
|
if (!We.includes(e.interval) || !Number.isInteger(e.startMonth) || e.startMonth < 0 || e.startMonth >= e.interval)
|
|
2117
2120
|
throw new Error("Choose a valid month cycle.");
|
|
2118
|
-
const t =
|
|
2121
|
+
const t = Kr(e.interval, e.startMonth);
|
|
2119
2122
|
if (e.on.type === "days") {
|
|
2120
2123
|
const i = Qe(e.on.days);
|
|
2121
2124
|
if (!i) throw new Error("Choose at least one day of the month.");
|
|
2122
|
-
const
|
|
2123
|
-
if (!Xe(i,
|
|
2125
|
+
const c = V(e.interval, e.startMonth);
|
|
2126
|
+
if (!Xe(i, c))
|
|
2124
2127
|
throw new Error("Choose a day that occurs in the chosen months.");
|
|
2125
|
-
const d = i.map((
|
|
2128
|
+
const d = i.map((l) => l === "last" ? "L" : String(l)).join(",");
|
|
2126
2129
|
return `${r} ${d} ${t} *`;
|
|
2127
2130
|
}
|
|
2128
2131
|
const { ordinal: n, weekday: o } = e.on;
|
|
@@ -2133,20 +2136,20 @@ function Ro(e) {
|
|
|
2133
2136
|
}
|
|
2134
2137
|
}
|
|
2135
2138
|
}
|
|
2136
|
-
function
|
|
2139
|
+
function Nr(e) {
|
|
2137
2140
|
if (e === "*") return { interval: 1, startMonth: 0 };
|
|
2138
2141
|
const r = e.split(",");
|
|
2139
2142
|
if (r.some((i) => !/^([1-9]|1[0-2])$/.test(i))) return null;
|
|
2140
2143
|
const t = r.map((i) => Number(i) - 1), n = 12 / t.length;
|
|
2141
2144
|
if (!We.includes(n))
|
|
2142
2145
|
return null;
|
|
2143
|
-
const o = t[0], a =
|
|
2146
|
+
const o = t[0], a = V(
|
|
2144
2147
|
n,
|
|
2145
2148
|
o
|
|
2146
2149
|
);
|
|
2147
|
-
return o >= n || a.length !== t.length || a.some((i,
|
|
2150
|
+
return o >= n || a.length !== t.length || a.some((i, c) => i !== t[c]) ? null : { interval: n, startMonth: o };
|
|
2148
2151
|
}
|
|
2149
|
-
function
|
|
2152
|
+
function Lr(e) {
|
|
2150
2153
|
const r = e.split(",");
|
|
2151
2154
|
if (r.some((o) => !/^(L|[1-9]|[12]\d|3[01])$/.test(o))) return null;
|
|
2152
2155
|
const t = r.map(
|
|
@@ -2154,7 +2157,7 @@ function Nr(e) {
|
|
|
2154
2157
|
), n = Qe(t);
|
|
2155
2158
|
return !n || n.some((o, a) => o !== t[a]) ? null : n;
|
|
2156
2159
|
}
|
|
2157
|
-
function
|
|
2160
|
+
function zr(e) {
|
|
2158
2161
|
const r = /^([A-Z]{3})(?:#([1-4])|(L))$/.exec(e);
|
|
2159
2162
|
if (!r) return null;
|
|
2160
2163
|
const t = He.get(r[1]);
|
|
@@ -2171,56 +2174,56 @@ function Je(e) {
|
|
|
2171
2174
|
const [t, n, o, a, i] = r;
|
|
2172
2175
|
if (!/^(0|[1-9]\d?)$/.test(t) || !/^(0|[1-9]\d?)$/.test(n))
|
|
2173
2176
|
return A;
|
|
2174
|
-
const
|
|
2175
|
-
if (
|
|
2177
|
+
const c = Number(t), d = Number(n);
|
|
2178
|
+
if (c > 59 || d > 23) return A;
|
|
2176
2179
|
if (a === "*" && o === "*" && i === "*")
|
|
2177
2180
|
return {
|
|
2178
2181
|
ok: !0,
|
|
2179
|
-
value: { frequency: "daily", hour: d, minute:
|
|
2182
|
+
value: { frequency: "daily", hour: d, minute: c, weekdaysOnly: !1 }
|
|
2180
2183
|
};
|
|
2181
2184
|
if (a === "*" && o === "*" && !i.includes("#") && !i.endsWith("L")) {
|
|
2182
2185
|
const u = i.split(",").map((g) => He.get(g));
|
|
2183
2186
|
if (u.some((g) => g === void 0)) return A;
|
|
2184
|
-
const
|
|
2185
|
-
return !m || m.some((g, y) => g !==
|
|
2187
|
+
const f = u, m = Ze(f);
|
|
2188
|
+
return !m || m.some((g, y) => g !== f[y]) ? A : m.length === te.length && m.every((g, y) => g === te[y]) ? {
|
|
2186
2189
|
ok: !0,
|
|
2187
|
-
value: { frequency: "daily", hour: d, minute:
|
|
2190
|
+
value: { frequency: "daily", hour: d, minute: c, weekdaysOnly: !0 }
|
|
2188
2191
|
} : {
|
|
2189
2192
|
ok: !0,
|
|
2190
|
-
value: { frequency: "weekly", hour: d, minute:
|
|
2193
|
+
value: { frequency: "weekly", hour: d, minute: c, weekdays: m }
|
|
2191
2194
|
};
|
|
2192
2195
|
}
|
|
2193
|
-
const
|
|
2194
|
-
if (!
|
|
2196
|
+
const l = Nr(a);
|
|
2197
|
+
if (!l) return A;
|
|
2195
2198
|
if (o !== "*" && i === "*") {
|
|
2196
|
-
const s =
|
|
2199
|
+
const s = Lr(o), u = V(l.interval, l.startMonth);
|
|
2197
2200
|
return !s || !Xe(s, u) ? A : {
|
|
2198
2201
|
ok: !0,
|
|
2199
2202
|
value: {
|
|
2200
2203
|
frequency: "monthly",
|
|
2201
2204
|
hour: d,
|
|
2202
|
-
minute:
|
|
2203
|
-
...
|
|
2205
|
+
minute: c,
|
|
2206
|
+
...l,
|
|
2204
2207
|
on: { type: "days", days: s }
|
|
2205
2208
|
}
|
|
2206
2209
|
};
|
|
2207
2210
|
}
|
|
2208
2211
|
if (o === "*" && i !== "*") {
|
|
2209
|
-
const s =
|
|
2212
|
+
const s = zr(i);
|
|
2210
2213
|
return s ? {
|
|
2211
2214
|
ok: !0,
|
|
2212
2215
|
value: {
|
|
2213
2216
|
frequency: "monthly",
|
|
2214
2217
|
hour: d,
|
|
2215
|
-
minute:
|
|
2216
|
-
...
|
|
2218
|
+
minute: c,
|
|
2219
|
+
...l,
|
|
2217
2220
|
on: { type: "weekday", ...s }
|
|
2218
2221
|
}
|
|
2219
2222
|
} : A;
|
|
2220
2223
|
}
|
|
2221
2224
|
return A;
|
|
2222
2225
|
}
|
|
2223
|
-
function
|
|
2226
|
+
function Vr(e, r, t) {
|
|
2224
2227
|
return new Intl.DateTimeFormat(t, {
|
|
2225
2228
|
hour: "numeric",
|
|
2226
2229
|
minute: "2-digit",
|
|
@@ -2242,26 +2245,26 @@ function qr(e, r) {
|
|
|
2242
2245
|
function Fe(e) {
|
|
2243
2246
|
return e.length <= 1 ? e.join("") : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
|
|
2244
2247
|
}
|
|
2245
|
-
function
|
|
2248
|
+
function Ur(e) {
|
|
2246
2249
|
const r = e % 100;
|
|
2247
2250
|
return r >= 11 && r <= 13 ? `${e}th` : `${e}${["th", "st", "nd", "rd"][e % 10] ?? "th"}`;
|
|
2248
2251
|
}
|
|
2249
|
-
function
|
|
2252
|
+
function jr(e, r, t) {
|
|
2250
2253
|
const n = (a, i) => new Intl.DateTimeFormat(t, { month: i, timeZone: "UTC" }).format(
|
|
2251
2254
|
new Date(Date.UTC(2020, a, 1))
|
|
2252
2255
|
);
|
|
2253
2256
|
if (e === 1) return "every month";
|
|
2254
2257
|
if (e === 12) return `${n(r, "long")} each year`;
|
|
2255
|
-
const o =
|
|
2258
|
+
const o = V(e, r).map((a) => n(a, "short")).join(", ");
|
|
2256
2259
|
return e === 3 ? `each quarter (${o})` : `every ${e} months (${o})`;
|
|
2257
2260
|
}
|
|
2258
|
-
function
|
|
2261
|
+
function Mo(e, r, t = "en-US") {
|
|
2259
2262
|
const n = Je(e);
|
|
2260
2263
|
if (!n.ok) return null;
|
|
2261
2264
|
try {
|
|
2262
2265
|
const o = n.value, a = qr(r, t);
|
|
2263
2266
|
if (!a) return null;
|
|
2264
|
-
const i = `at ${
|
|
2267
|
+
const i = `at ${Vr(o.hour, o.minute, t)} ${a}`, c = (d) => new Intl.DateTimeFormat(t, {
|
|
2265
2268
|
weekday: "long",
|
|
2266
2269
|
timeZone: "UTC"
|
|
2267
2270
|
}).format(new Date(Date.UTC(2023, 0, 1 + d)));
|
|
@@ -2269,15 +2272,15 @@ function Ao(e, r, t = "en-US") {
|
|
|
2269
2272
|
case "daily":
|
|
2270
2273
|
return o.weekdaysOnly ? `Every weekday, Monday to Friday, ${i}` : `Every day ${i}`;
|
|
2271
2274
|
case "weekly":
|
|
2272
|
-
return `Every ${Fe(o.weekdays.map(
|
|
2275
|
+
return `Every ${Fe(o.weekdays.map(c))} ${i}`;
|
|
2273
2276
|
case "monthly": {
|
|
2274
|
-
const d =
|
|
2277
|
+
const d = jr(o.interval, o.startMonth, t);
|
|
2275
2278
|
if (o.on.type === "weekday")
|
|
2276
|
-
return `On the ${Ye[o.on.ordinal]} ${
|
|
2277
|
-
const
|
|
2278
|
-
(s) => s === "last" ? "last day" :
|
|
2279
|
+
return `On the ${Ye[o.on.ordinal]} ${c(o.on.weekday)} of ${d} ${i}`;
|
|
2280
|
+
const l = o.on.days.map(
|
|
2281
|
+
(s) => s === "last" ? "last day" : Ur(s)
|
|
2279
2282
|
);
|
|
2280
|
-
return `On the ${Fe(
|
|
2283
|
+
return `On the ${Fe(l)} of ${d} ${i}`;
|
|
2281
2284
|
}
|
|
2282
2285
|
}
|
|
2283
2286
|
} catch {
|
|
@@ -2285,22 +2288,22 @@ function Ao(e, r, t = "en-US") {
|
|
|
2285
2288
|
}
|
|
2286
2289
|
}
|
|
2287
2290
|
const et = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2288
|
-
function
|
|
2291
|
+
function Gr(e, r) {
|
|
2289
2292
|
return e === "last" || r.some((t) => e <= et[t]);
|
|
2290
2293
|
}
|
|
2291
|
-
function
|
|
2294
|
+
function Po(e) {
|
|
2292
2295
|
if (e.frequency !== "monthly" || e.on.type !== "days") return null;
|
|
2293
2296
|
const r = e.on.days.filter((o) => o !== "last");
|
|
2294
2297
|
if (r.length === 0) return null;
|
|
2295
|
-
const t = Math.max(...r), n =
|
|
2298
|
+
const t = Math.max(...r), n = V(e.interval, e.startMonth).filter(
|
|
2296
2299
|
(o) => t > (o === 1 ? 28 : et[o])
|
|
2297
2300
|
);
|
|
2298
2301
|
return n.length > 0 ? { day: t, months: n } : null;
|
|
2299
2302
|
}
|
|
2300
|
-
function
|
|
2303
|
+
function Hr(e, r) {
|
|
2301
2304
|
return new Date(Date.UTC(e, r + 1, 0)).getUTCDate();
|
|
2302
2305
|
}
|
|
2303
|
-
function
|
|
2306
|
+
function Wr(e, r, t, n) {
|
|
2304
2307
|
const o = new Date(Date.UTC(r, t, n)).getUTCDay();
|
|
2305
2308
|
switch (e.frequency) {
|
|
2306
2309
|
case "daily":
|
|
@@ -2308,18 +2311,18 @@ function Hr(e, r, t, n) {
|
|
|
2308
2311
|
case "weekly":
|
|
2309
2312
|
return e.weekdays.includes(o);
|
|
2310
2313
|
case "monthly": {
|
|
2311
|
-
if (!
|
|
2314
|
+
if (!V(e.interval, e.startMonth).includes(t))
|
|
2312
2315
|
return !1;
|
|
2313
|
-
const a =
|
|
2316
|
+
const a = Hr(r, t);
|
|
2314
2317
|
return e.on.type === "days" ? e.on.days.some(
|
|
2315
2318
|
(i) => i === "last" ? n === a : i === n
|
|
2316
2319
|
) : o !== e.on.weekday ? !1 : e.on.ordinal === -1 ? n + 7 > a : Math.ceil(n / 7) === e.on.ordinal;
|
|
2317
2320
|
}
|
|
2318
2321
|
}
|
|
2319
2322
|
}
|
|
2320
|
-
function
|
|
2323
|
+
function Bo(e, r, t, n) {
|
|
2321
2324
|
const o = Je(e);
|
|
2322
|
-
if (!o.ok || !
|
|
2325
|
+
if (!o.ok || !Br(r)) return [];
|
|
2323
2326
|
const a = o.value, i = new Intl.DateTimeFormat("en-US", {
|
|
2324
2327
|
timeZone: r,
|
|
2325
2328
|
hourCycle: "h23",
|
|
@@ -2328,41 +2331,41 @@ function Mo(e, r, t, n) {
|
|
|
2328
2331
|
day: "numeric",
|
|
2329
2332
|
hour: "numeric",
|
|
2330
2333
|
minute: "numeric"
|
|
2331
|
-
}).formatToParts(t),
|
|
2334
|
+
}).formatToParts(t), c = (s) => {
|
|
2332
2335
|
var u;
|
|
2333
|
-
return Number((u = i.find((
|
|
2334
|
-
}, d = new Date(Date.UTC(
|
|
2335
|
-
|
|
2336
|
-
const
|
|
2337
|
-
for (let s = 0; s < 366 * 4 * (n + 1) &&
|
|
2338
|
-
|
|
2339
|
-
return
|
|
2336
|
+
return Number((u = i.find((f) => f.type === s)) == null ? void 0 : u.value);
|
|
2337
|
+
}, d = new Date(Date.UTC(c("year"), c("month") - 1, c("day")));
|
|
2338
|
+
c("hour") * 60 + c("minute") >= a.hour * 60 + a.minute && d.setUTCDate(d.getUTCDate() + 1);
|
|
2339
|
+
const l = [];
|
|
2340
|
+
for (let s = 0; s < 366 * 4 * (n + 1) && l.length < n; s += 1)
|
|
2341
|
+
Wr(a, d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()) && l.push(d.toISOString().slice(0, 10)), d.setUTCDate(d.getUTCDate() + 1);
|
|
2342
|
+
return l;
|
|
2340
2343
|
}
|
|
2341
|
-
function
|
|
2344
|
+
function Oo(e) {
|
|
2342
2345
|
return e != null && e.role ? e.type === "tenant" ? e.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(e.role) : !1;
|
|
2343
2346
|
}
|
|
2344
|
-
function
|
|
2347
|
+
function Ko(e) {
|
|
2345
2348
|
return e.canCreate ? [
|
|
2346
2349
|
...e.scheduledReportAvailable ? ["scheduled_report"] : [],
|
|
2347
2350
|
...e.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
|
|
2348
2351
|
] : [];
|
|
2349
2352
|
}
|
|
2350
|
-
function
|
|
2353
|
+
function Yr(e) {
|
|
2351
2354
|
const r = (e == null ? void 0 : e.channels) ?? [];
|
|
2352
2355
|
return r.length === 1 && r[0] === "EMAIL";
|
|
2353
2356
|
}
|
|
2354
|
-
function
|
|
2355
|
-
return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 &&
|
|
2357
|
+
function Zr(e) {
|
|
2358
|
+
return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && Yr(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
|
|
2356
2359
|
}
|
|
2357
|
-
function
|
|
2358
|
-
const r =
|
|
2360
|
+
function No(e) {
|
|
2361
|
+
const r = Zr(e), t = r === "Scheduled report" || r === "On-demand report" ? "report" : "briefing";
|
|
2359
2362
|
return {
|
|
2360
2363
|
typeLabel: r,
|
|
2361
2364
|
noun: t,
|
|
2362
2365
|
pluralNoun: t === "report" ? "reports" : "briefings"
|
|
2363
2366
|
};
|
|
2364
2367
|
}
|
|
2365
|
-
const fe = "BRIEFING",
|
|
2368
|
+
const fe = "BRIEFING", Qr = ["markdown", "html"], pe = ["markdown"], ce = 20, h = {
|
|
2366
2369
|
name: 500,
|
|
2367
2370
|
description: 2e3,
|
|
2368
2371
|
instruction: 5e4,
|
|
@@ -2391,7 +2394,7 @@ const fe = "BRIEFING", Zr = ["markdown", "html"], pe = ["markdown"], ce = 20, h
|
|
|
2391
2394
|
// tiny tiles in narrow client panels; 2-up was the chosen layout).
|
|
2392
2395
|
maxKpiTiles: 8
|
|
2393
2396
|
};
|
|
2394
|
-
function
|
|
2397
|
+
function Xr(e) {
|
|
2395
2398
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
2396
2399
|
return !1;
|
|
2397
2400
|
const r = e;
|
|
@@ -2403,15 +2406,15 @@ function Qr(e) {
|
|
|
2403
2406
|
const n = t;
|
|
2404
2407
|
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()) && Re(r.format).ok;
|
|
2405
2408
|
}
|
|
2406
|
-
function
|
|
2407
|
-
return e == null ? "" :
|
|
2409
|
+
function Jr(e) {
|
|
2410
|
+
return e == null ? "" : Xr(e) ? yt(e.value, e.format) : String(e);
|
|
2408
2411
|
}
|
|
2409
|
-
function
|
|
2412
|
+
function Lo(e) {
|
|
2410
2413
|
return [e.delta, e.percentChange].filter(
|
|
2411
2414
|
(r) => r != null
|
|
2412
|
-
).map(
|
|
2415
|
+
).map(Jr).filter(Boolean).join(" / ");
|
|
2413
2416
|
}
|
|
2414
|
-
const tt = new Set(
|
|
2417
|
+
const tt = new Set(Qr), en = /* @__PURE__ */ new Set([
|
|
2415
2418
|
"EMAIL",
|
|
2416
2419
|
"WEBHOOK",
|
|
2417
2420
|
"SLACK",
|
|
@@ -2422,45 +2425,46 @@ const tt = new Set(Zr), Jr = /* @__PURE__ */ new Set([
|
|
|
2422
2425
|
maxPlanningIterations: { min: 1, max: 10 },
|
|
2423
2426
|
maxRows: { min: 1, max: 1e5 },
|
|
2424
2427
|
timeoutMs: { min: 1e3, max: 30 * 6e4 }
|
|
2425
|
-
},
|
|
2428
|
+
}, tn = /* @__PURE__ */ new Set([
|
|
2426
2429
|
"letter",
|
|
2427
2430
|
"legal",
|
|
2428
2431
|
"a4",
|
|
2429
2432
|
"a3",
|
|
2430
2433
|
"tabloid"
|
|
2431
|
-
]),
|
|
2434
|
+
]), rn = /* @__PURE__ */ new Set([
|
|
2432
2435
|
"portrait",
|
|
2433
2436
|
"landscape"
|
|
2434
|
-
]),
|
|
2437
|
+
]), nn = /* @__PURE__ */ new Set([",", ";", " "]), on = new Set(xt), an = /* @__PURE__ */ new Set([
|
|
2435
2438
|
"current",
|
|
2436
2439
|
"all"
|
|
2437
|
-
]),
|
|
2440
|
+
]), cn = /* @__PURE__ */ new Set([
|
|
2438
2441
|
"concise",
|
|
2439
2442
|
"balanced",
|
|
2440
2443
|
"detailed"
|
|
2441
|
-
]),
|
|
2444
|
+
]), ln = /* @__PURE__ */ new Set([
|
|
2442
2445
|
"info",
|
|
2443
2446
|
"positive",
|
|
2444
2447
|
"warning",
|
|
2445
2448
|
"critical"
|
|
2446
|
-
]),
|
|
2449
|
+
]), sn = /* @__PURE__ */ new Set([
|
|
2447
2450
|
"text",
|
|
2448
2451
|
"number",
|
|
2449
2452
|
"currency",
|
|
2450
2453
|
"percent",
|
|
2451
2454
|
"date",
|
|
2452
2455
|
"boolean"
|
|
2453
|
-
]),
|
|
2456
|
+
]), dn = /* @__PURE__ */ new Set([
|
|
2454
2457
|
"left",
|
|
2455
2458
|
"center",
|
|
2456
2459
|
"right"
|
|
2457
|
-
]),
|
|
2460
|
+
]), mn = [
|
|
2458
2461
|
"matrix",
|
|
2459
2462
|
"pageSize",
|
|
2460
2463
|
"orientation",
|
|
2461
2464
|
"includeFilters",
|
|
2462
2465
|
"includeTimestamp",
|
|
2463
2466
|
"delimiter",
|
|
2467
|
+
"csvEncoding",
|
|
2464
2468
|
"includeHeaders",
|
|
2465
2469
|
"useFormattedValues",
|
|
2466
2470
|
"sheetSelection",
|
|
@@ -2492,16 +2496,16 @@ class oe extends Error {
|
|
|
2492
2496
|
function rt(e) {
|
|
2493
2497
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
2494
2498
|
}
|
|
2495
|
-
function
|
|
2499
|
+
function p(e, r, t) {
|
|
2496
2500
|
e.push({ field: r, message: t });
|
|
2497
2501
|
}
|
|
2498
|
-
function
|
|
2499
|
-
return rt(e) ? e : (
|
|
2502
|
+
function E(e, r, t) {
|
|
2503
|
+
return rt(e) ? e : (p(t, r, "Expected an object."), {});
|
|
2500
2504
|
}
|
|
2501
2505
|
function I(e, r, t, n) {
|
|
2502
2506
|
const o = new Set(t);
|
|
2503
2507
|
Object.keys(e).forEach((a) => {
|
|
2504
|
-
o.has(a) ||
|
|
2508
|
+
o.has(a) || p(
|
|
2505
2509
|
n,
|
|
2506
2510
|
r ? `${r}.${a}` : a,
|
|
2507
2511
|
`Unexpected field "${a}".`
|
|
@@ -2510,31 +2514,31 @@ function I(e, r, t, n) {
|
|
|
2510
2514
|
}
|
|
2511
2515
|
function $(e, r, t, n) {
|
|
2512
2516
|
if (typeof e != "string")
|
|
2513
|
-
return
|
|
2517
|
+
return p(n, r, "Expected a string."), "";
|
|
2514
2518
|
const o = e.trim();
|
|
2515
|
-
return o ? (o.length > t &&
|
|
2519
|
+
return o ? (o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o) : (p(n, r, "Required value cannot be empty."), "");
|
|
2516
2520
|
}
|
|
2517
2521
|
function x(e, r, t, n) {
|
|
2518
2522
|
if (e == null)
|
|
2519
2523
|
return;
|
|
2520
2524
|
if (typeof e != "string") {
|
|
2521
|
-
|
|
2525
|
+
p(n, r, "Expected a string.");
|
|
2522
2526
|
return;
|
|
2523
2527
|
}
|
|
2524
2528
|
const o = e.trim();
|
|
2525
2529
|
if (o)
|
|
2526
|
-
return o.length > t &&
|
|
2530
|
+
return o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o;
|
|
2527
2531
|
}
|
|
2528
|
-
function
|
|
2532
|
+
function un(e, r, t, n) {
|
|
2529
2533
|
if (typeof e != "string")
|
|
2530
|
-
return
|
|
2534
|
+
return p(n, r, "Expected a string."), "";
|
|
2531
2535
|
const o = e.trim();
|
|
2532
|
-
return o.length > t &&
|
|
2536
|
+
return o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o;
|
|
2533
2537
|
}
|
|
2534
|
-
function
|
|
2538
|
+
function fn(e, r, t) {
|
|
2535
2539
|
if (e != null) {
|
|
2536
2540
|
if (!Number.isInteger(e) || Number(e) < 0) {
|
|
2537
|
-
|
|
2541
|
+
p(t, r, "Expected a non-negative integer.");
|
|
2538
2542
|
return;
|
|
2539
2543
|
}
|
|
2540
2544
|
return Number(e);
|
|
@@ -2542,33 +2546,33 @@ function mn(e, r, t) {
|
|
|
2542
2546
|
}
|
|
2543
2547
|
function D(e, r, t, n = {}) {
|
|
2544
2548
|
if (e == null)
|
|
2545
|
-
return n.required ? (
|
|
2549
|
+
return n.required ? (p(t, r, "Expected at least one evidence id."), []) : void 0;
|
|
2546
2550
|
if (!Array.isArray(e))
|
|
2547
|
-
return
|
|
2551
|
+
return p(t, r, "Expected an array."), n.required ? [] : void 0;
|
|
2548
2552
|
const o = [];
|
|
2549
2553
|
return e.forEach((a, i) => {
|
|
2550
|
-
const
|
|
2554
|
+
const c = $(
|
|
2551
2555
|
a,
|
|
2552
2556
|
`${r}.${i}`,
|
|
2553
2557
|
h.id,
|
|
2554
2558
|
t
|
|
2555
2559
|
);
|
|
2556
|
-
|
|
2557
|
-
}), n.required && o.length === 0 &&
|
|
2560
|
+
c && !o.includes(c) && o.push(c);
|
|
2561
|
+
}), n.required && o.length === 0 && p(t, r, "Expected at least one evidence id."), o.length > 0 || n.required ? o : void 0;
|
|
2558
2562
|
}
|
|
2559
2563
|
function z(e, r, t, n) {
|
|
2560
|
-
return e == null ? r : typeof e != "boolean" ? (
|
|
2564
|
+
return e == null ? r : typeof e != "boolean" ? (p(n, t, "Expected a boolean."), r) : e;
|
|
2561
2565
|
}
|
|
2562
|
-
function
|
|
2563
|
-
return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (
|
|
2566
|
+
function pn(e, r) {
|
|
2567
|
+
return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (p(r, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
|
|
2564
2568
|
}
|
|
2565
|
-
function
|
|
2569
|
+
function yn(e) {
|
|
2566
2570
|
return e.includes("@") && e.includes(".") && !e.includes(" ");
|
|
2567
2571
|
}
|
|
2568
2572
|
function nt(e, r) {
|
|
2569
2573
|
if (e == null)
|
|
2570
2574
|
return { type: "project" };
|
|
2571
|
-
const t =
|
|
2575
|
+
const t = E(e, "source", r), n = t.type;
|
|
2572
2576
|
return n === "project" ? (I(t, "source", ["type"], r), { type: "project" }) : n === "dashboard" ? (I(t, "source", ["type", "dashboardId"], r), {
|
|
2573
2577
|
type: "dashboard",
|
|
2574
2578
|
dashboardId: $(
|
|
@@ -2577,10 +2581,10 @@ function nt(e, r) {
|
|
|
2577
2581
|
h.id,
|
|
2578
2582
|
r
|
|
2579
2583
|
)
|
|
2580
|
-
}) : (
|
|
2584
|
+
}) : (p(r, "source.type", "Expected project or dashboard."), { type: "project" });
|
|
2581
2585
|
}
|
|
2582
2586
|
function ot(e, r) {
|
|
2583
|
-
const t =
|
|
2587
|
+
const t = E(e, "body", r), n = t.type;
|
|
2584
2588
|
return n === "generated_analysis" ? (I(t, "body", ["type", "instruction"], r), {
|
|
2585
2589
|
type: "generated_analysis",
|
|
2586
2590
|
instruction: $(
|
|
@@ -2591,25 +2595,25 @@ function ot(e, r) {
|
|
|
2591
2595
|
)
|
|
2592
2596
|
}) : n === "custom_message" ? (I(t, "body", ["type", "message"], r), {
|
|
2593
2597
|
type: "custom_message",
|
|
2594
|
-
message:
|
|
2598
|
+
message: un(
|
|
2595
2599
|
t.message,
|
|
2596
2600
|
"body.message",
|
|
2597
2601
|
h.customMessage,
|
|
2598
2602
|
r
|
|
2599
2603
|
)
|
|
2600
|
-
}) : n === "none" ? (I(t, "body", ["type"], r), { type: "none" }) : (
|
|
2604
|
+
}) : n === "none" ? (I(t, "body", ["type"], r), { type: "none" }) : (p(
|
|
2601
2605
|
r,
|
|
2602
2606
|
"body.type",
|
|
2603
2607
|
"Expected generated_analysis, custom_message, or none."
|
|
2604
2608
|
), { type: "none" });
|
|
2605
2609
|
}
|
|
2606
|
-
function
|
|
2610
|
+
function hn(e, r) {
|
|
2607
2611
|
if (e == null)
|
|
2608
2612
|
return [...pe];
|
|
2609
2613
|
if (!Array.isArray(e))
|
|
2610
|
-
return
|
|
2614
|
+
return p(r, "presentation.artifactFormats", "Expected an array."), [...pe];
|
|
2611
2615
|
if (e.length === 0)
|
|
2612
|
-
return
|
|
2616
|
+
return p(
|
|
2613
2617
|
r,
|
|
2614
2618
|
"presentation.artifactFormats",
|
|
2615
2619
|
"Choose at least one artifact format."
|
|
@@ -2617,7 +2621,7 @@ function pn(e, r) {
|
|
|
2617
2621
|
const t = [];
|
|
2618
2622
|
return e.forEach((n, o) => {
|
|
2619
2623
|
if (typeof n != "string" || !tt.has(n)) {
|
|
2620
|
-
|
|
2624
|
+
p(
|
|
2621
2625
|
r,
|
|
2622
2626
|
`presentation.artifactFormats.${o}`,
|
|
2623
2627
|
"Expected markdown or html."
|
|
@@ -2634,7 +2638,7 @@ function at(e, r) {
|
|
|
2634
2638
|
includeEvidence: !0,
|
|
2635
2639
|
includeSql: !0
|
|
2636
2640
|
};
|
|
2637
|
-
const t =
|
|
2641
|
+
const t = E(e, "presentation", r);
|
|
2638
2642
|
I(
|
|
2639
2643
|
t,
|
|
2640
2644
|
"presentation",
|
|
@@ -2653,7 +2657,7 @@ function at(e, r) {
|
|
|
2653
2657
|
r
|
|
2654
2658
|
);
|
|
2655
2659
|
const n = {
|
|
2656
|
-
artifactFormats:
|
|
2660
|
+
artifactFormats: hn(t.artifactFormats, r),
|
|
2657
2661
|
includeEvidence: z(
|
|
2658
2662
|
t.includeEvidence,
|
|
2659
2663
|
!0,
|
|
@@ -2683,11 +2687,11 @@ function at(e, r) {
|
|
|
2683
2687
|
r
|
|
2684
2688
|
);
|
|
2685
2689
|
o && (n.audience = o), a && (n.tone = a), i && (n.format = i);
|
|
2686
|
-
const
|
|
2687
|
-
return
|
|
2690
|
+
const c = Pr(t);
|
|
2691
|
+
return c.issues.forEach((d) => p(r, d.field, d.message)), Object.assign(n, c.value), n;
|
|
2688
2692
|
}
|
|
2689
|
-
function
|
|
2690
|
-
return Array.isArray(e) ? (e.length === 0 &&
|
|
2693
|
+
function gn(e, r, t) {
|
|
2694
|
+
return Array.isArray(e) ? (e.length === 0 && p(t, r, "Expected at least one item."), e.length > R.maxListItems && p(
|
|
2691
2695
|
t,
|
|
2692
2696
|
r,
|
|
2693
2697
|
`Must have ${R.maxListItems} items or fewer.`
|
|
@@ -2698,10 +2702,10 @@ function yn(e, r, t) {
|
|
|
2698
2702
|
h.contentItem,
|
|
2699
2703
|
t
|
|
2700
2704
|
)
|
|
2701
|
-
).filter(Boolean)) : (
|
|
2705
|
+
).filter(Boolean)) : (p(t, r, "Expected an array."), []);
|
|
2702
2706
|
}
|
|
2703
|
-
function
|
|
2704
|
-
const n =
|
|
2707
|
+
function vn(e, r, t) {
|
|
2708
|
+
const n = E(e, r, t);
|
|
2705
2709
|
if (n.kind === "metric")
|
|
2706
2710
|
return I(n, r, ["kind", "metricId"], t), {
|
|
2707
2711
|
kind: "metric",
|
|
@@ -2732,7 +2736,7 @@ function hn(e, r, t) {
|
|
|
2732
2736
|
t
|
|
2733
2737
|
)
|
|
2734
2738
|
};
|
|
2735
|
-
|
|
2739
|
+
p(
|
|
2736
2740
|
t,
|
|
2737
2741
|
`${r}.kind`,
|
|
2738
2742
|
"Expected metric, column, or matrix_measure."
|
|
@@ -2741,17 +2745,17 @@ function hn(e, r, t) {
|
|
|
2741
2745
|
function it(e, r, t) {
|
|
2742
2746
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
2743
2747
|
return;
|
|
2744
|
-
const n =
|
|
2748
|
+
const n = E(e, r, t);
|
|
2745
2749
|
if (!Object.prototype.hasOwnProperty.call(n, "target") && !Object.prototype.hasOwnProperty.call(n, "format"))
|
|
2746
2750
|
return;
|
|
2747
|
-
I(n, r, ["value", "target", "format"], t), (typeof n.value != "number" || !Number.isFinite(n.value)) &&
|
|
2748
|
-
const o =
|
|
2751
|
+
I(n, r, ["value", "target", "format"], t), (typeof n.value != "number" || !Number.isFinite(n.value)) && p(t, `${r}.value`, "Expected a finite number.");
|
|
2752
|
+
const o = vn(
|
|
2749
2753
|
n.target,
|
|
2750
2754
|
`${r}.target`,
|
|
2751
2755
|
t
|
|
2752
2756
|
), a = Re(n.format);
|
|
2753
2757
|
if (a.ok || a.issues.forEach(
|
|
2754
|
-
(i) =>
|
|
2758
|
+
(i) => p(
|
|
2755
2759
|
t,
|
|
2756
2760
|
i.path === "$" ? `${r}.format` : `${r}.format.${i.path}`,
|
|
2757
2761
|
i.message
|
|
@@ -2764,106 +2768,106 @@ function K(e, r, t) {
|
|
|
2764
2768
|
return e;
|
|
2765
2769
|
if (typeof e == "number") {
|
|
2766
2770
|
if (!Number.isFinite(e)) {
|
|
2767
|
-
|
|
2771
|
+
p(t, r, "Expected a finite number.");
|
|
2768
2772
|
return;
|
|
2769
2773
|
}
|
|
2770
2774
|
return e;
|
|
2771
2775
|
}
|
|
2772
2776
|
const n = it(e, r, t);
|
|
2773
2777
|
if (n) return n;
|
|
2774
|
-
|
|
2778
|
+
p(
|
|
2775
2779
|
t,
|
|
2776
2780
|
r,
|
|
2777
2781
|
"Expected a string, number, or structured numeric value."
|
|
2778
2782
|
);
|
|
2779
2783
|
}
|
|
2780
|
-
function
|
|
2784
|
+
function bn(e, r, t) {
|
|
2781
2785
|
if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
2782
|
-
return typeof e == "string" && e.length > h.contentCell ? (
|
|
2786
|
+
return typeof e == "string" && e.length > h.contentCell ? (p(
|
|
2783
2787
|
t,
|
|
2784
2788
|
r,
|
|
2785
2789
|
`Must be ${h.contentCell} characters or fewer.`
|
|
2786
|
-
), e.slice(0, h.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (
|
|
2790
|
+
), e.slice(0, h.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (p(t, r, "Expected a finite number."), null) : e;
|
|
2787
2791
|
const n = it(e, r, t);
|
|
2788
|
-
return n || (
|
|
2792
|
+
return n || (p(
|
|
2789
2793
|
t,
|
|
2790
2794
|
r,
|
|
2791
2795
|
"Expected a string, number, boolean, structured numeric value, or null."
|
|
2792
2796
|
), null);
|
|
2793
2797
|
}
|
|
2794
|
-
function
|
|
2798
|
+
function In(e, r, t) {
|
|
2795
2799
|
if (!Array.isArray(e))
|
|
2796
|
-
return
|
|
2797
|
-
e.length === 0 &&
|
|
2800
|
+
return p(t, r, "Expected an array."), [];
|
|
2801
|
+
e.length === 0 && p(t, r, "Expected at least one column."), e.length > R.maxTableColumns && p(
|
|
2798
2802
|
t,
|
|
2799
2803
|
r,
|
|
2800
2804
|
`Must have ${R.maxTableColumns} columns or fewer.`
|
|
2801
2805
|
);
|
|
2802
2806
|
const n = /* @__PURE__ */ new Set();
|
|
2803
2807
|
return e.slice(0, R.maxTableColumns).map((o, a) => {
|
|
2804
|
-
const i = `${r}.${a}`,
|
|
2805
|
-
I(
|
|
2808
|
+
const i = `${r}.${a}`, c = E(o, i, t);
|
|
2809
|
+
I(c, i, ["key", "label", "kind", "align"], t);
|
|
2806
2810
|
const d = $(
|
|
2807
|
-
|
|
2811
|
+
c.key,
|
|
2808
2812
|
`${i}.key`,
|
|
2809
2813
|
h.id,
|
|
2810
2814
|
t
|
|
2811
2815
|
);
|
|
2812
|
-
d && (n.has(d) &&
|
|
2813
|
-
const
|
|
2814
|
-
|
|
2816
|
+
d && (n.has(d) && p(t, `${i}.key`, "Column key must be unique."), n.add(d));
|
|
2817
|
+
const l = $(
|
|
2818
|
+
c.label,
|
|
2815
2819
|
`${i}.label`,
|
|
2816
2820
|
h.contentTitle,
|
|
2817
2821
|
t
|
|
2818
2822
|
), s = O(
|
|
2819
|
-
|
|
2823
|
+
c.kind,
|
|
2820
2824
|
`${i}.kind`,
|
|
2821
|
-
|
|
2825
|
+
sn,
|
|
2822
2826
|
"text, number, currency, percent, date, or boolean",
|
|
2823
2827
|
t
|
|
2824
2828
|
), u = O(
|
|
2825
|
-
|
|
2829
|
+
c.align,
|
|
2826
2830
|
`${i}.align`,
|
|
2827
|
-
|
|
2831
|
+
dn,
|
|
2828
2832
|
"left, center, or right",
|
|
2829
2833
|
t
|
|
2830
2834
|
);
|
|
2831
2835
|
return {
|
|
2832
2836
|
key: d,
|
|
2833
|
-
label:
|
|
2837
|
+
label: l,
|
|
2834
2838
|
...s ? { kind: s } : {},
|
|
2835
2839
|
...u ? { align: u } : {}
|
|
2836
2840
|
};
|
|
2837
2841
|
});
|
|
2838
2842
|
}
|
|
2839
|
-
function
|
|
2843
|
+
function Cn(e, r, t, n) {
|
|
2840
2844
|
if (!Array.isArray(e))
|
|
2841
|
-
return
|
|
2842
|
-
e.length > R.maxTableRows &&
|
|
2845
|
+
return p(n, r, "Expected an array."), [];
|
|
2846
|
+
e.length > R.maxTableRows && p(
|
|
2843
2847
|
n,
|
|
2844
2848
|
r,
|
|
2845
2849
|
`Must have ${R.maxTableRows} rows or fewer.`
|
|
2846
2850
|
);
|
|
2847
2851
|
const o = new Set(t.map((a) => a.key).filter(Boolean));
|
|
2848
2852
|
return e.slice(0, R.maxTableRows).map((a, i) => {
|
|
2849
|
-
const
|
|
2850
|
-
return Object.keys(d).forEach((
|
|
2851
|
-
o.has(
|
|
2853
|
+
const c = `${r}.${i}`, d = E(a, c, n);
|
|
2854
|
+
return Object.keys(d).forEach((l) => {
|
|
2855
|
+
o.has(l) || p(n, `${c}.${l}`, `Unexpected table cell "${l}".`);
|
|
2852
2856
|
}), Object.fromEntries(
|
|
2853
|
-
t.map((
|
|
2854
|
-
|
|
2855
|
-
|
|
2857
|
+
t.map((l) => [
|
|
2858
|
+
l.key,
|
|
2859
|
+
bn(d[l.key] ?? null, `${c}.${l.key}`, n)
|
|
2856
2860
|
])
|
|
2857
2861
|
);
|
|
2858
2862
|
});
|
|
2859
2863
|
}
|
|
2860
|
-
function
|
|
2861
|
-
const n = `content.blocks.${r}`, o =
|
|
2864
|
+
function Tn(e, r, t) {
|
|
2865
|
+
const n = `content.blocks.${r}`, o = E(e, n, t), a = o.type;
|
|
2862
2866
|
if (a === "heading") {
|
|
2863
2867
|
I(o, n, ["type", "text", "level", "evidenceIds"], t);
|
|
2864
2868
|
const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
|
|
2865
|
-
o.level !== void 0 && o.level !== null && i === void 0 &&
|
|
2866
|
-
const
|
|
2869
|
+
o.level !== void 0 && o.level !== null && i === void 0 && p(t, `${n}.level`, "Expected 2 or 3.");
|
|
2870
|
+
const c = D(o.evidenceIds, `${n}.evidenceIds`, t);
|
|
2867
2871
|
return {
|
|
2868
2872
|
type: "heading",
|
|
2869
2873
|
text: $(
|
|
@@ -2873,7 +2877,7 @@ function In(e, r, t) {
|
|
|
2873
2877
|
t
|
|
2874
2878
|
),
|
|
2875
2879
|
...i ? { level: i } : {},
|
|
2876
|
-
...
|
|
2880
|
+
...c ? { evidenceIds: c } : {}
|
|
2877
2881
|
};
|
|
2878
2882
|
}
|
|
2879
2883
|
if (a === "paragraph") {
|
|
@@ -2897,10 +2901,10 @@ function In(e, r, t) {
|
|
|
2897
2901
|
`${n}.title`,
|
|
2898
2902
|
h.contentTitle,
|
|
2899
2903
|
t
|
|
2900
|
-
),
|
|
2904
|
+
), c = O(
|
|
2901
2905
|
o.severity,
|
|
2902
2906
|
`${n}.severity`,
|
|
2903
|
-
|
|
2907
|
+
ln,
|
|
2904
2908
|
"info, positive, warning, or critical",
|
|
2905
2909
|
t
|
|
2906
2910
|
);
|
|
@@ -2913,7 +2917,7 @@ function In(e, r, t) {
|
|
|
2913
2917
|
h.contentText,
|
|
2914
2918
|
t
|
|
2915
2919
|
),
|
|
2916
|
-
...
|
|
2920
|
+
...c ? { severity: c } : {},
|
|
2917
2921
|
evidenceIds: D(o.evidenceIds, `${n}.evidenceIds`, t, {
|
|
2918
2922
|
required: !0
|
|
2919
2923
|
}) ?? []
|
|
@@ -2926,12 +2930,12 @@ function In(e, r, t) {
|
|
|
2926
2930
|
`${n}.title`,
|
|
2927
2931
|
h.contentTitle,
|
|
2928
2932
|
t
|
|
2929
|
-
),
|
|
2933
|
+
), c = D(o.evidenceIds, `${n}.evidenceIds`, t);
|
|
2930
2934
|
return {
|
|
2931
2935
|
type: a,
|
|
2932
2936
|
...i ? { title: i } : {},
|
|
2933
|
-
items:
|
|
2934
|
-
...
|
|
2937
|
+
items: gn(o.items, `${n}.items`, t),
|
|
2938
|
+
...c ? { evidenceIds: c } : {}
|
|
2935
2939
|
};
|
|
2936
2940
|
}
|
|
2937
2941
|
if (a === "metric") {
|
|
@@ -2951,12 +2955,12 @@ function In(e, r, t) {
|
|
|
2951
2955
|
t
|
|
2952
2956
|
);
|
|
2953
2957
|
const i = K(o.value, `${n}.value`, t) ?? "";
|
|
2954
|
-
i === "" &&
|
|
2958
|
+
i === "" && p(
|
|
2955
2959
|
t,
|
|
2956
2960
|
`${n}.value`,
|
|
2957
2961
|
"Expected a non-empty string, number, or structured numeric value."
|
|
2958
2962
|
);
|
|
2959
|
-
const
|
|
2963
|
+
const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : K(
|
|
2960
2964
|
o.previousValue,
|
|
2961
2965
|
`${n}.previousValue`,
|
|
2962
2966
|
t
|
|
@@ -2964,7 +2968,7 @@ function In(e, r, t) {
|
|
|
2964
2968
|
o.delta,
|
|
2965
2969
|
`${n}.delta`,
|
|
2966
2970
|
t
|
|
2967
|
-
),
|
|
2971
|
+
), l = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : K(
|
|
2968
2972
|
o.percentChange,
|
|
2969
2973
|
`${n}.percentChange`,
|
|
2970
2974
|
t
|
|
@@ -2983,9 +2987,9 @@ function In(e, r, t) {
|
|
|
2983
2987
|
t
|
|
2984
2988
|
),
|
|
2985
2989
|
value: i,
|
|
2986
|
-
...
|
|
2990
|
+
...c !== void 0 ? { previousValue: c } : {},
|
|
2987
2991
|
...d !== void 0 ? { delta: d } : {},
|
|
2988
|
-
...
|
|
2992
|
+
...l !== void 0 ? { percentChange: l } : {},
|
|
2989
2993
|
...s ? { unit: s } : {},
|
|
2990
2994
|
...u ? { evidenceIds: u } : {}
|
|
2991
2995
|
};
|
|
@@ -2997,17 +3001,17 @@ function In(e, r, t) {
|
|
|
2997
3001
|
`${n}.title`,
|
|
2998
3002
|
h.contentTitle,
|
|
2999
3003
|
t
|
|
3000
|
-
),
|
|
3001
|
-
Array.isArray(o.tiles) ||
|
|
3004
|
+
), c = Array.isArray(o.tiles) ? o.tiles : [];
|
|
3005
|
+
Array.isArray(o.tiles) || p(t, `${n}.tiles`, "Expected an array."), c.length === 0 && p(t, `${n}.tiles`, "Expected at least one tile."), c.length > R.maxKpiTiles && p(
|
|
3002
3006
|
t,
|
|
3003
3007
|
`${n}.tiles`,
|
|
3004
3008
|
`Must have ${R.maxKpiTiles} tiles or fewer.`
|
|
3005
3009
|
);
|
|
3006
|
-
const d =
|
|
3007
|
-
const
|
|
3010
|
+
const d = c.slice(0, R.maxKpiTiles).map((s, u) => {
|
|
3011
|
+
const f = `${n}.tiles.${u}`, m = E(s, f, t);
|
|
3008
3012
|
I(
|
|
3009
3013
|
m,
|
|
3010
|
-
|
|
3014
|
+
f,
|
|
3011
3015
|
[
|
|
3012
3016
|
"label",
|
|
3013
3017
|
"value",
|
|
@@ -3021,40 +3025,40 @@ function In(e, r, t) {
|
|
|
3021
3025
|
);
|
|
3022
3026
|
const g = K(
|
|
3023
3027
|
m.value,
|
|
3024
|
-
`${
|
|
3028
|
+
`${f}.value`,
|
|
3025
3029
|
t
|
|
3026
3030
|
) ?? "";
|
|
3027
|
-
g === "" &&
|
|
3031
|
+
g === "" && p(
|
|
3028
3032
|
t,
|
|
3029
|
-
`${
|
|
3033
|
+
`${f}.value`,
|
|
3030
3034
|
"Expected a non-empty string, number, or structured numeric value."
|
|
3031
3035
|
);
|
|
3032
3036
|
const y = m.previousValue === void 0 || m.previousValue === null ? m.previousValue : K(
|
|
3033
3037
|
m.previousValue,
|
|
3034
|
-
`${
|
|
3038
|
+
`${f}.previousValue`,
|
|
3035
3039
|
t
|
|
3036
3040
|
), b = m.delta === void 0 || m.delta === null ? m.delta : K(
|
|
3037
3041
|
m.delta,
|
|
3038
|
-
`${
|
|
3042
|
+
`${f}.delta`,
|
|
3039
3043
|
t
|
|
3040
3044
|
), C = m.percentChange === void 0 || m.percentChange === null ? m.percentChange : K(
|
|
3041
3045
|
m.percentChange,
|
|
3042
|
-
`${
|
|
3046
|
+
`${f}.percentChange`,
|
|
3043
3047
|
t
|
|
3044
3048
|
), v = x(
|
|
3045
3049
|
m.unit,
|
|
3046
|
-
`${
|
|
3050
|
+
`${f}.unit`,
|
|
3047
3051
|
h.contentTitle,
|
|
3048
3052
|
t
|
|
3049
3053
|
), w = D(
|
|
3050
3054
|
m.evidenceIds,
|
|
3051
|
-
`${
|
|
3055
|
+
`${f}.evidenceIds`,
|
|
3052
3056
|
t
|
|
3053
3057
|
);
|
|
3054
3058
|
return {
|
|
3055
3059
|
label: $(
|
|
3056
3060
|
m.label,
|
|
3057
|
-
`${
|
|
3061
|
+
`${f}.label`,
|
|
3058
3062
|
h.contentTitle,
|
|
3059
3063
|
t
|
|
3060
3064
|
),
|
|
@@ -3065,7 +3069,7 @@ function In(e, r, t) {
|
|
|
3065
3069
|
...v ? { unit: v } : {},
|
|
3066
3070
|
...w ? { evidenceIds: w } : {}
|
|
3067
3071
|
};
|
|
3068
|
-
}),
|
|
3072
|
+
}), l = D(
|
|
3069
3073
|
o.evidenceIds,
|
|
3070
3074
|
`${n}.evidenceIds`,
|
|
3071
3075
|
t
|
|
@@ -3074,14 +3078,14 @@ function In(e, r, t) {
|
|
|
3074
3078
|
type: "kpi_grid",
|
|
3075
3079
|
...i ? { title: i } : {},
|
|
3076
3080
|
tiles: d,
|
|
3077
|
-
...
|
|
3081
|
+
...l ? { evidenceIds: l } : {}
|
|
3078
3082
|
};
|
|
3079
3083
|
}
|
|
3080
3084
|
if (a === "progress") {
|
|
3081
3085
|
I(o, n, ["type", "label", "value", "detail", "evidenceIds"], t);
|
|
3082
3086
|
const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
|
|
3083
|
-
(typeof o.value != "number" || !Number.isFinite(o.value)) &&
|
|
3084
|
-
const
|
|
3087
|
+
(typeof o.value != "number" || !Number.isFinite(o.value)) && p(t, `${n}.value`, "Expected a finite number.");
|
|
3088
|
+
const c = x(
|
|
3085
3089
|
o.detail,
|
|
3086
3090
|
`${n}.detail`,
|
|
3087
3091
|
h.contentText,
|
|
@@ -3096,7 +3100,7 @@ function In(e, r, t) {
|
|
|
3096
3100
|
t
|
|
3097
3101
|
),
|
|
3098
3102
|
value: i,
|
|
3099
|
-
...
|
|
3103
|
+
...c ? { detail: c } : {},
|
|
3100
3104
|
...d ? { evidenceIds: d } : {}
|
|
3101
3105
|
};
|
|
3102
3106
|
}
|
|
@@ -3107,7 +3111,7 @@ function In(e, r, t) {
|
|
|
3107
3111
|
["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
|
|
3108
3112
|
t
|
|
3109
3113
|
);
|
|
3110
|
-
const i =
|
|
3114
|
+
const i = In(o.columns, `${n}.columns`, t), c = x(
|
|
3111
3115
|
o.title,
|
|
3112
3116
|
`${n}.title`,
|
|
3113
3117
|
h.contentTitle,
|
|
@@ -3117,12 +3121,12 @@ function In(e, r, t) {
|
|
|
3117
3121
|
`${n}.id`,
|
|
3118
3122
|
h.id,
|
|
3119
3123
|
t
|
|
3120
|
-
),
|
|
3124
|
+
), l = x(
|
|
3121
3125
|
o.caption,
|
|
3122
3126
|
`${n}.caption`,
|
|
3123
3127
|
h.contentItem,
|
|
3124
3128
|
t
|
|
3125
|
-
), s =
|
|
3129
|
+
), s = fn(
|
|
3126
3130
|
o.totalRows,
|
|
3127
3131
|
`${n}.totalRows`,
|
|
3128
3132
|
t
|
|
@@ -3130,10 +3134,10 @@ function In(e, r, t) {
|
|
|
3130
3134
|
return {
|
|
3131
3135
|
type: "table",
|
|
3132
3136
|
...d ? { id: d } : {},
|
|
3133
|
-
...
|
|
3137
|
+
...c ? { title: c } : {},
|
|
3134
3138
|
columns: i,
|
|
3135
|
-
rows:
|
|
3136
|
-
...
|
|
3139
|
+
rows: Cn(o.rows, `${n}.rows`, i, t),
|
|
3140
|
+
...l ? { caption: l } : {},
|
|
3137
3141
|
...s !== void 0 ? { totalRows: s } : {},
|
|
3138
3142
|
...u ? { evidenceIds: u } : {}
|
|
3139
3143
|
};
|
|
@@ -3161,7 +3165,7 @@ function In(e, r, t) {
|
|
|
3161
3165
|
`${n}.title`,
|
|
3162
3166
|
h.contentTitle,
|
|
3163
3167
|
t
|
|
3164
|
-
),
|
|
3168
|
+
), c = $(
|
|
3165
3169
|
o.sql,
|
|
3166
3170
|
`${n}.sql`,
|
|
3167
3171
|
h.contentSql,
|
|
@@ -3170,11 +3174,11 @@ function In(e, r, t) {
|
|
|
3170
3174
|
return {
|
|
3171
3175
|
type: "sql",
|
|
3172
3176
|
...i ? { title: i } : {},
|
|
3173
|
-
sql:
|
|
3177
|
+
sql: c,
|
|
3174
3178
|
...d ? { evidenceIds: d } : {}
|
|
3175
3179
|
};
|
|
3176
3180
|
}
|
|
3177
|
-
return
|
|
3181
|
+
return p(
|
|
3178
3182
|
t,
|
|
3179
3183
|
`${n}.type`,
|
|
3180
3184
|
"Expected heading, paragraph, finding, bullets, metric, kpi_grid, progress, table, actions, limitations, sql, or evidence_appendix."
|
|
@@ -3183,9 +3187,9 @@ function In(e, r, t) {
|
|
|
3183
3187
|
text: ""
|
|
3184
3188
|
};
|
|
3185
3189
|
}
|
|
3186
|
-
function
|
|
3187
|
-
const r = [], t =
|
|
3188
|
-
I(t, "content", ["version", "title", "summary", "blocks"], r), t.version !== 1 &&
|
|
3190
|
+
function wn(e) {
|
|
3191
|
+
const r = [], t = E(e, "content", r);
|
|
3192
|
+
I(t, "content", ["version", "title", "summary", "blocks"], r), t.version !== 1 && p(r, "content.version", "Expected version 1.");
|
|
3189
3193
|
const n = x(
|
|
3190
3194
|
t.title,
|
|
3191
3195
|
"content.title",
|
|
@@ -3197,14 +3201,14 @@ function Cn(e) {
|
|
|
3197
3201
|
h.contentSummary,
|
|
3198
3202
|
r
|
|
3199
3203
|
);
|
|
3200
|
-
Array.isArray(t.blocks) ||
|
|
3204
|
+
Array.isArray(t.blocks) || p(r, "content.blocks", "Expected an array.");
|
|
3201
3205
|
const a = Array.isArray(t.blocks) ? t.blocks : [];
|
|
3202
|
-
a.length === 0 &&
|
|
3206
|
+
a.length === 0 && p(r, "content.blocks", "Expected at least one block."), a.length > R.maxBlocks && p(
|
|
3203
3207
|
r,
|
|
3204
3208
|
"content.blocks",
|
|
3205
3209
|
`Must have ${R.maxBlocks} blocks or fewer.`
|
|
3206
3210
|
);
|
|
3207
|
-
const i = a.slice(0, R.maxBlocks).map((
|
|
3211
|
+
const i = a.slice(0, R.maxBlocks).map((c, d) => Tn(c, d, r));
|
|
3208
3212
|
return Te(r), {
|
|
3209
3213
|
version: 1,
|
|
3210
3214
|
...n ? { title: n } : {},
|
|
@@ -3212,11 +3216,11 @@ function Cn(e) {
|
|
|
3212
3216
|
blocks: i
|
|
3213
3217
|
};
|
|
3214
3218
|
}
|
|
3215
|
-
function
|
|
3219
|
+
function zo(e) {
|
|
3216
3220
|
try {
|
|
3217
3221
|
return {
|
|
3218
3222
|
valid: !0,
|
|
3219
|
-
value:
|
|
3223
|
+
value: wn(e),
|
|
3220
3224
|
issues: []
|
|
3221
3225
|
};
|
|
3222
3226
|
} catch (r) {
|
|
@@ -3226,94 +3230,100 @@ function No(e) {
|
|
|
3226
3230
|
}
|
|
3227
3231
|
}
|
|
3228
3232
|
function J(e, r, t, n) {
|
|
3229
|
-
return typeof e == "string" && t.includes(e) ? e : (
|
|
3233
|
+
return typeof e == "string" && t.includes(e) ? e : (p(n, r, `Expected ${t.join(" or ")}.`), t[0]);
|
|
3230
3234
|
}
|
|
3231
3235
|
function O(e, r, t, n, o) {
|
|
3232
3236
|
if (e != null) {
|
|
3233
3237
|
if (typeof e == "string" && t.has(e))
|
|
3234
3238
|
return e;
|
|
3235
|
-
|
|
3239
|
+
p(o, r, `Expected ${n}.`);
|
|
3236
3240
|
}
|
|
3237
3241
|
}
|
|
3238
|
-
function
|
|
3242
|
+
function $n(e, r, t) {
|
|
3239
3243
|
if (e != null) {
|
|
3240
3244
|
if (!Array.isArray(e)) {
|
|
3241
|
-
|
|
3245
|
+
p(t, r, "Expected an array.");
|
|
3242
3246
|
return;
|
|
3243
3247
|
}
|
|
3244
3248
|
return e;
|
|
3245
3249
|
}
|
|
3246
3250
|
}
|
|
3247
|
-
function
|
|
3251
|
+
function xn(e, r, t) {
|
|
3248
3252
|
if (e != null) {
|
|
3249
3253
|
if (!rt(e)) {
|
|
3250
|
-
|
|
3254
|
+
p(t, r, "Expected an object.");
|
|
3251
3255
|
return;
|
|
3252
3256
|
}
|
|
3253
3257
|
return e;
|
|
3254
3258
|
}
|
|
3255
3259
|
}
|
|
3256
|
-
function
|
|
3260
|
+
function En(e, r, t) {
|
|
3257
3261
|
if (e == null)
|
|
3258
3262
|
return;
|
|
3259
|
-
const n =
|
|
3260
|
-
I(n, r,
|
|
3263
|
+
const n = E(e, r, t);
|
|
3264
|
+
I(n, r, mn, t);
|
|
3261
3265
|
const o = {};
|
|
3262
3266
|
if (n.matrix !== void 0) {
|
|
3263
|
-
const
|
|
3264
|
-
I(
|
|
3265
|
-
const
|
|
3266
|
-
|
|
3267
|
-
const
|
|
3268
|
-
|
|
3267
|
+
const s = E(n.matrix, `${r}.matrix`, t);
|
|
3268
|
+
I(s, `${r}.matrix`, ["config", "content"], t);
|
|
3269
|
+
const u = gt.safeParse(s.config);
|
|
3270
|
+
u.success || p(t, `${r}.matrix.config`, "Expected a valid Matrix definition.");
|
|
3271
|
+
const f = O(
|
|
3272
|
+
s.content,
|
|
3269
3273
|
`${r}.matrix.content`,
|
|
3270
3274
|
/* @__PURE__ */ new Set(["current", "all", "flat"]),
|
|
3271
3275
|
"current, all, or flat",
|
|
3272
3276
|
t
|
|
3273
3277
|
);
|
|
3274
|
-
|
|
3278
|
+
f || p(t, `${r}.matrix.content`, "Choose Matrix export content."), u.success && f && (o.matrix = { config: u.data, content: f });
|
|
3275
3279
|
}
|
|
3276
3280
|
const a = O(
|
|
3277
3281
|
n.pageSize,
|
|
3278
3282
|
`${r}.pageSize`,
|
|
3279
|
-
|
|
3283
|
+
tn,
|
|
3280
3284
|
"letter, legal, a4, a3, or tabloid",
|
|
3281
3285
|
t
|
|
3282
3286
|
), i = O(
|
|
3283
3287
|
n.orientation,
|
|
3284
3288
|
`${r}.orientation`,
|
|
3285
|
-
|
|
3289
|
+
rn,
|
|
3286
3290
|
"portrait or landscape",
|
|
3287
3291
|
t
|
|
3288
|
-
),
|
|
3292
|
+
), c = O(
|
|
3289
3293
|
n.delimiter,
|
|
3290
3294
|
`${r}.delimiter`,
|
|
3291
|
-
|
|
3295
|
+
nn,
|
|
3292
3296
|
"comma, semicolon, or tab",
|
|
3293
3297
|
t
|
|
3294
3298
|
), d = O(
|
|
3299
|
+
n.csvEncoding,
|
|
3300
|
+
`${r}.csvEncoding`,
|
|
3301
|
+
on,
|
|
3302
|
+
"utf-8-bom or utf-8",
|
|
3303
|
+
t
|
|
3304
|
+
), l = O(
|
|
3295
3305
|
n.sheetSelection,
|
|
3296
3306
|
`${r}.sheetSelection`,
|
|
3297
|
-
|
|
3307
|
+
an,
|
|
3298
3308
|
"current or all",
|
|
3299
3309
|
t
|
|
3300
3310
|
);
|
|
3301
|
-
a && (o.pageSize = a), i && (o.orientation = i),
|
|
3302
|
-
for (const
|
|
3311
|
+
a && (o.pageSize = a), i && (o.orientation = i), c && (o.delimiter = c), d && (o.csvEncoding = d), l && (o.sheetSelection = l);
|
|
3312
|
+
for (const s of [
|
|
3303
3313
|
"includeFilters",
|
|
3304
3314
|
"includeTimestamp",
|
|
3305
3315
|
"includeHeaders",
|
|
3306
3316
|
"useFormattedValues",
|
|
3307
3317
|
"allowDownload"
|
|
3308
3318
|
])
|
|
3309
|
-
if (!(n[
|
|
3310
|
-
if (typeof n[
|
|
3311
|
-
|
|
3319
|
+
if (!(n[s] === void 0 || n[s] === null)) {
|
|
3320
|
+
if (typeof n[s] != "boolean") {
|
|
3321
|
+
p(t, `${r}.${s}`, "Expected a boolean.");
|
|
3312
3322
|
continue;
|
|
3313
3323
|
}
|
|
3314
|
-
o[
|
|
3324
|
+
o[s] = n[s];
|
|
3315
3325
|
}
|
|
3316
|
-
for (const
|
|
3326
|
+
for (const s of [
|
|
3317
3327
|
"currentSheetId",
|
|
3318
3328
|
"currentSheetName",
|
|
3319
3329
|
"filterLine",
|
|
@@ -3321,15 +3331,15 @@ function $n(e, r, t) {
|
|
|
3321
3331
|
"cardType",
|
|
3322
3332
|
"theme"
|
|
3323
3333
|
]) {
|
|
3324
|
-
const
|
|
3325
|
-
n[
|
|
3326
|
-
`${r}.${
|
|
3334
|
+
const u = x(
|
|
3335
|
+
n[s],
|
|
3336
|
+
`${r}.${s}`,
|
|
3327
3337
|
h.id,
|
|
3328
3338
|
t
|
|
3329
3339
|
);
|
|
3330
|
-
|
|
3340
|
+
u && (o[s] = u);
|
|
3331
3341
|
}
|
|
3332
|
-
for (const
|
|
3342
|
+
for (const s of [
|
|
3333
3343
|
"filterValues",
|
|
3334
3344
|
"inlineFilterValues",
|
|
3335
3345
|
"sheetFilterValues",
|
|
@@ -3337,17 +3347,17 @@ function $n(e, r, t) {
|
|
|
3337
3347
|
"cardControlDefinitions",
|
|
3338
3348
|
"controlBindings"
|
|
3339
3349
|
]) {
|
|
3340
|
-
const
|
|
3341
|
-
|
|
3350
|
+
const u = $n(n[s], `${r}.${s}`, t);
|
|
3351
|
+
u && (o[s] = u);
|
|
3342
3352
|
}
|
|
3343
|
-
for (const
|
|
3353
|
+
for (const s of [
|
|
3344
3354
|
"controlValues",
|
|
3345
3355
|
"tablePreferences",
|
|
3346
3356
|
"dashboardInputExecutionSnapshot",
|
|
3347
3357
|
"printInputCapture"
|
|
3348
3358
|
]) {
|
|
3349
|
-
const
|
|
3350
|
-
|
|
3359
|
+
const u = xn(n[s], `${r}.${s}`, t);
|
|
3360
|
+
u && (o[s] = u);
|
|
3351
3361
|
}
|
|
3352
3362
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
3353
3363
|
}
|
|
@@ -3361,15 +3371,15 @@ function se(e, r, t, n) {
|
|
|
3361
3371
|
return o && (e.title = o), e;
|
|
3362
3372
|
}
|
|
3363
3373
|
function de(e, r, t, n) {
|
|
3364
|
-
const o =
|
|
3365
|
-
return o != null && o.printInputCapture && e.type !== "dashboard" &&
|
|
3374
|
+
const o = En(r, t, n);
|
|
3375
|
+
return o != null && o.printInputCapture && e.type !== "dashboard" && p(
|
|
3366
3376
|
n,
|
|
3367
3377
|
`${t}.printInputCapture`,
|
|
3368
3378
|
"Only a full dashboard attachment can carry printInputCapture."
|
|
3369
3379
|
), o && (e.settings = o), e;
|
|
3370
3380
|
}
|
|
3371
|
-
function
|
|
3372
|
-
const n = `attachments.${r}`, o =
|
|
3381
|
+
function kn(e, r, t) {
|
|
3382
|
+
const n = `attachments.${r}`, o = E(e, n, t), a = o.type;
|
|
3373
3383
|
if (a === "dashboard") {
|
|
3374
3384
|
I(
|
|
3375
3385
|
o,
|
|
@@ -3459,13 +3469,13 @@ function xn(e, r, t) {
|
|
|
3459
3469
|
);
|
|
3460
3470
|
return de(i, o.settings, `${n}.settings`, t);
|
|
3461
3471
|
}
|
|
3462
|
-
return
|
|
3472
|
+
return p(
|
|
3463
3473
|
t,
|
|
3464
3474
|
`${n}.type`,
|
|
3465
3475
|
"Expected dashboard, dashboard_sheet, document_sheet, or card."
|
|
3466
3476
|
), { type: "dashboard", dashboardId: "", format: "pdf" };
|
|
3467
3477
|
}
|
|
3468
|
-
function
|
|
3478
|
+
function Sn(e) {
|
|
3469
3479
|
switch (e.type) {
|
|
3470
3480
|
case "dashboard":
|
|
3471
3481
|
return `${e.type}:${e.dashboardId}:${e.format}`;
|
|
@@ -3480,24 +3490,24 @@ function ct(e, r) {
|
|
|
3480
3490
|
if (e == null)
|
|
3481
3491
|
return [];
|
|
3482
3492
|
if (!Array.isArray(e))
|
|
3483
|
-
return
|
|
3484
|
-
e.length > ce &&
|
|
3493
|
+
return p(r, "attachments", "Expected an array."), [];
|
|
3494
|
+
e.length > ce && p(
|
|
3485
3495
|
r,
|
|
3486
3496
|
"attachments",
|
|
3487
3497
|
`Choose ${ce} attachments or fewer.`
|
|
3488
3498
|
);
|
|
3489
|
-
const t = e.slice(0, ce).map((o, a) =>
|
|
3499
|
+
const t = e.slice(0, ce).map((o, a) => kn(o, a, r)), n = /* @__PURE__ */ new Set();
|
|
3490
3500
|
return t.forEach((o, a) => {
|
|
3491
|
-
var
|
|
3492
|
-
(
|
|
3493
|
-
const i =
|
|
3494
|
-
n.has(i) &&
|
|
3501
|
+
var c;
|
|
3502
|
+
(c = o.settings) != null && c.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format !== "csv") && p(r, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV.");
|
|
3503
|
+
const i = Sn(o);
|
|
3504
|
+
n.has(i) && p(r, `attachments.${a}`, "Duplicate attachment."), n.add(i);
|
|
3495
3505
|
}), t;
|
|
3496
3506
|
}
|
|
3497
3507
|
function lt(e, r) {
|
|
3498
3508
|
if (e == null)
|
|
3499
3509
|
return;
|
|
3500
|
-
const t =
|
|
3510
|
+
const t = E(e, "limits", r);
|
|
3501
3511
|
I(t, "limits", Object.keys(le), r);
|
|
3502
3512
|
const n = {};
|
|
3503
3513
|
return Object.keys(le).forEach((o) => {
|
|
@@ -3506,7 +3516,7 @@ function lt(e, r) {
|
|
|
3506
3516
|
return;
|
|
3507
3517
|
const i = le[o];
|
|
3508
3518
|
if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
|
|
3509
|
-
|
|
3519
|
+
p(
|
|
3510
3520
|
r,
|
|
3511
3521
|
`limits.${o}`,
|
|
3512
3522
|
`Expected an integer between ${i.min} and ${i.max}.`
|
|
@@ -3521,36 +3531,36 @@ function Te(e) {
|
|
|
3521
3531
|
throw new oe(e);
|
|
3522
3532
|
}
|
|
3523
3533
|
function st(e, r, t) {
|
|
3524
|
-
!(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 &&
|
|
3534
|
+
!(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 && p(
|
|
3525
3535
|
t,
|
|
3526
3536
|
"body",
|
|
3527
3537
|
"Add briefing instructions, a custom message, or at least one attachment."
|
|
3528
3538
|
);
|
|
3529
3539
|
}
|
|
3530
|
-
function
|
|
3540
|
+
function _n(e, r, t) {
|
|
3531
3541
|
e == null || e.forEach((n, o) => {
|
|
3532
3542
|
const a = `${t}.${o}.scope`, i = n.scope.attachmentIndex;
|
|
3533
3543
|
if (i === void 0)
|
|
3534
3544
|
throw new G(
|
|
3535
3545
|
`${a}.attachmentIndex must identify the attachment that owns this presentation entry.`
|
|
3536
3546
|
);
|
|
3537
|
-
const
|
|
3538
|
-
if (!
|
|
3547
|
+
const c = r[i];
|
|
3548
|
+
if (!c)
|
|
3539
3549
|
throw new G(
|
|
3540
3550
|
`${a}.attachmentIndex must identify an existing attachment.`
|
|
3541
3551
|
);
|
|
3542
|
-
if (n.scope.dashboardId !==
|
|
3552
|
+
if (n.scope.dashboardId !== c.dashboardId)
|
|
3543
3553
|
throw new G(
|
|
3544
3554
|
`${a}.dashboardId must match the dashboard selected by the referenced attachment.`
|
|
3545
3555
|
);
|
|
3546
|
-
if (
|
|
3556
|
+
if (c.type === "card" && n.scope.cardId !== c.cardId)
|
|
3547
3557
|
throw new G(
|
|
3548
3558
|
`${a}.cardId must match the card selected by the referenced attachment.`
|
|
3549
3559
|
);
|
|
3550
3560
|
});
|
|
3551
3561
|
}
|
|
3552
3562
|
function dt(e) {
|
|
3553
|
-
const r = [], t =
|
|
3563
|
+
const r = [], t = E(e, "jobConfig", r);
|
|
3554
3564
|
I(
|
|
3555
3565
|
t,
|
|
3556
3566
|
"jobConfig",
|
|
@@ -3564,23 +3574,23 @@ function dt(e) {
|
|
|
3564
3574
|
"limits"
|
|
3565
3575
|
],
|
|
3566
3576
|
r
|
|
3567
|
-
), t.kind !== fe &&
|
|
3577
|
+
), t.kind !== fe && p(r, "kind", "Expected BRIEFING.");
|
|
3568
3578
|
let n;
|
|
3569
3579
|
try {
|
|
3570
3580
|
n = Et(
|
|
3571
3581
|
t.presentationExecutionSnapshot
|
|
3572
3582
|
);
|
|
3573
|
-
} catch (
|
|
3574
|
-
if (
|
|
3575
|
-
throw
|
|
3576
|
-
|
|
3583
|
+
} catch (l) {
|
|
3584
|
+
if (l instanceof G)
|
|
3585
|
+
throw l;
|
|
3586
|
+
p(
|
|
3577
3587
|
r,
|
|
3578
3588
|
"jobConfig.presentationExecutionSnapshot",
|
|
3579
|
-
|
|
3589
|
+
l instanceof Error ? l.message : "Invalid presentation snapshot."
|
|
3580
3590
|
);
|
|
3581
3591
|
}
|
|
3582
|
-
const o = nt(t.source, r), a = ot(t.body, r), i = ct(t.attachments, r),
|
|
3583
|
-
return st(a, i, r),
|
|
3592
|
+
const o = nt(t.source, r), a = ot(t.body, r), i = ct(t.attachments, r), c = at(t.presentation, r), d = lt(t.limits, r);
|
|
3593
|
+
return st(a, i, r), _n(
|
|
3584
3594
|
n == null ? void 0 : n.resolvedFormats,
|
|
3585
3595
|
i,
|
|
3586
3596
|
"jobConfig.presentationExecutionSnapshot.resolvedFormats"
|
|
@@ -3590,21 +3600,21 @@ function dt(e) {
|
|
|
3590
3600
|
source: o,
|
|
3591
3601
|
body: a,
|
|
3592
3602
|
attachments: i,
|
|
3593
|
-
presentation:
|
|
3603
|
+
presentation: c,
|
|
3594
3604
|
...d ? { limits: d } : {}
|
|
3595
3605
|
};
|
|
3596
3606
|
}
|
|
3597
|
-
function
|
|
3607
|
+
function Vo(e) {
|
|
3598
3608
|
return dt({
|
|
3599
3609
|
...e,
|
|
3600
3610
|
kind: fe
|
|
3601
3611
|
});
|
|
3602
3612
|
}
|
|
3603
3613
|
function we(e, r, t, n = "deliveryConfig.recipients") {
|
|
3604
|
-
const o = `${n}.${r}`, a =
|
|
3614
|
+
const o = `${n}.${r}`, a = E(e, o, t), i = a.type;
|
|
3605
3615
|
if (i === "email") {
|
|
3606
3616
|
I(a, o, ["type", "address", "name"], t);
|
|
3607
|
-
const
|
|
3617
|
+
const c = $(
|
|
3608
3618
|
a.address,
|
|
3609
3619
|
`${o}.address`,
|
|
3610
3620
|
h.id,
|
|
@@ -3615,9 +3625,9 @@ function we(e, r, t, n = "deliveryConfig.recipients") {
|
|
|
3615
3625
|
h.attachmentTitle,
|
|
3616
3626
|
t
|
|
3617
3627
|
);
|
|
3618
|
-
return
|
|
3628
|
+
return c && !yn(c) && p(t, `${o}.address`, "Email address is invalid."), {
|
|
3619
3629
|
type: "email",
|
|
3620
|
-
address:
|
|
3630
|
+
address: c,
|
|
3621
3631
|
...d ? { name: d } : {}
|
|
3622
3632
|
};
|
|
3623
3633
|
}
|
|
@@ -3645,24 +3655,24 @@ function we(e, r, t, n = "deliveryConfig.recipients") {
|
|
|
3645
3655
|
h.id,
|
|
3646
3656
|
t
|
|
3647
3657
|
)
|
|
3648
|
-
}) : (
|
|
3658
|
+
}) : (p(
|
|
3649
3659
|
t,
|
|
3650
3660
|
`${o}.type`,
|
|
3651
3661
|
"Expected email, user, tenant_user, or group."
|
|
3652
3662
|
), { type: "email", address: "" });
|
|
3653
3663
|
}
|
|
3654
|
-
function
|
|
3664
|
+
function Fn(e, r) {
|
|
3655
3665
|
return e == null ? [] : Array.isArray(e) ? e.map(
|
|
3656
3666
|
(t, n) => we(t, n, r)
|
|
3657
|
-
) : (
|
|
3667
|
+
) : (p(r, "deliveryConfig.recipients", "Expected an array."), []);
|
|
3658
3668
|
}
|
|
3659
|
-
function
|
|
3669
|
+
function Rn(e, r) {
|
|
3660
3670
|
if (!Array.isArray(e))
|
|
3661
|
-
return
|
|
3671
|
+
return p(r, "deliveryConfig.channels", "Expected an array."), [];
|
|
3662
3672
|
const t = [];
|
|
3663
3673
|
return e.forEach((n, o) => {
|
|
3664
3674
|
if (!mt(n)) {
|
|
3665
|
-
|
|
3675
|
+
p(
|
|
3666
3676
|
r,
|
|
3667
3677
|
`deliveryConfig.channels.${o}`,
|
|
3668
3678
|
"Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM."
|
|
@@ -3672,29 +3682,29 @@ function _n(e, r) {
|
|
|
3672
3682
|
t.includes(n) || t.push(n);
|
|
3673
3683
|
}), t;
|
|
3674
3684
|
}
|
|
3675
|
-
function
|
|
3685
|
+
function An(e, r, t) {
|
|
3676
3686
|
if (e == null)
|
|
3677
3687
|
return;
|
|
3678
|
-
const n =
|
|
3688
|
+
const n = E(e, r, t), o = {};
|
|
3679
3689
|
return Object.entries(n).forEach(([a, i]) => {
|
|
3680
3690
|
if (typeof i != "string") {
|
|
3681
|
-
|
|
3691
|
+
p(t, `${r}.${a}`, "Expected a string.");
|
|
3682
3692
|
return;
|
|
3683
3693
|
}
|
|
3684
3694
|
o[a] = i.trim();
|
|
3685
3695
|
}), Object.keys(o).length > 0 ? o : void 0;
|
|
3686
3696
|
}
|
|
3687
|
-
function
|
|
3697
|
+
function Dn(e, r, t) {
|
|
3688
3698
|
if (e == null)
|
|
3689
3699
|
return;
|
|
3690
|
-
const n =
|
|
3700
|
+
const n = E(e, r, t);
|
|
3691
3701
|
I(
|
|
3692
3702
|
n,
|
|
3693
3703
|
r,
|
|
3694
3704
|
["url", "method", "headers", "secretEncrypted"],
|
|
3695
3705
|
t
|
|
3696
3706
|
);
|
|
3697
|
-
const o = n.method === void 0 || n.method === null ? void 0 : J(n.method, `${r}.method`, ["POST", "PUT"], t), a =
|
|
3707
|
+
const o = n.method === void 0 || n.method === null ? void 0 : J(n.method, `${r}.method`, ["POST", "PUT"], t), a = An(n.headers, `${r}.headers`, t), i = x(
|
|
3698
3708
|
n.secretEncrypted,
|
|
3699
3709
|
`${r}.secretEncrypted`,
|
|
3700
3710
|
2e3,
|
|
@@ -3707,8 +3717,8 @@ function Rn(e, r, t) {
|
|
|
3707
3717
|
...i ? { secretEncrypted: i } : {}
|
|
3708
3718
|
};
|
|
3709
3719
|
}
|
|
3710
|
-
function
|
|
3711
|
-
const n =
|
|
3720
|
+
function Mn(e, r, t) {
|
|
3721
|
+
const n = E(e, r, t), o = n.type;
|
|
3712
3722
|
if (o === "channel") {
|
|
3713
3723
|
I(
|
|
3714
3724
|
n,
|
|
@@ -3739,20 +3749,20 @@ function An(e, r, t) {
|
|
|
3739
3749
|
...i !== void 0 ? { isPrivate: i } : {}
|
|
3740
3750
|
};
|
|
3741
3751
|
}
|
|
3742
|
-
return o === "dm" ? (I(n, r, ["type", "recipient"], t),
|
|
3752
|
+
return o === "dm" ? (I(n, r, ["type", "recipient"], t), p(
|
|
3743
3753
|
t,
|
|
3744
3754
|
`${r}.type`,
|
|
3745
3755
|
"Slack DM delivery is not supported in V1."
|
|
3746
3756
|
), {
|
|
3747
3757
|
type: "dm",
|
|
3748
3758
|
recipient: we(n.recipient, 0, t, `${r}.recipient`)
|
|
3749
|
-
}) : (
|
|
3759
|
+
}) : (p(t, `${r}.type`, "Expected channel."), { type: "channel", channelId: "" });
|
|
3750
3760
|
}
|
|
3751
|
-
function
|
|
3761
|
+
function Pn(e, r, t) {
|
|
3752
3762
|
if (e == null)
|
|
3753
3763
|
return;
|
|
3754
3764
|
if (!Array.isArray(e)) {
|
|
3755
|
-
|
|
3765
|
+
p(t, r, "Expected an array.");
|
|
3756
3766
|
return;
|
|
3757
3767
|
}
|
|
3758
3768
|
const n = e.map(
|
|
@@ -3760,10 +3770,10 @@ function Dn(e, r, t) {
|
|
|
3760
3770
|
);
|
|
3761
3771
|
return n.length > 0 ? n : void 0;
|
|
3762
3772
|
}
|
|
3763
|
-
function
|
|
3773
|
+
function Bn(e, r, t) {
|
|
3764
3774
|
if (e == null)
|
|
3765
3775
|
return;
|
|
3766
|
-
const n =
|
|
3776
|
+
const n = E(e, r, t);
|
|
3767
3777
|
I(
|
|
3768
3778
|
n,
|
|
3769
3779
|
r,
|
|
@@ -3776,7 +3786,7 @@ function Mn(e, r, t) {
|
|
|
3776
3786
|
],
|
|
3777
3787
|
t
|
|
3778
3788
|
);
|
|
3779
|
-
const o =
|
|
3789
|
+
const o = Pn(
|
|
3780
3790
|
n.threadMentions,
|
|
3781
3791
|
`${r}.threadMentions`,
|
|
3782
3792
|
t
|
|
@@ -3790,14 +3800,14 @@ function Mn(e, r, t) {
|
|
|
3790
3800
|
!0,
|
|
3791
3801
|
`${r}.includeDashboardLink`,
|
|
3792
3802
|
t
|
|
3793
|
-
),
|
|
3803
|
+
), c = z(
|
|
3794
3804
|
n.includeBriefingLink,
|
|
3795
3805
|
!0,
|
|
3796
3806
|
`${r}.includeBriefingLink`,
|
|
3797
3807
|
t
|
|
3798
3808
|
);
|
|
3799
3809
|
return {
|
|
3800
|
-
destination:
|
|
3810
|
+
destination: Mn(
|
|
3801
3811
|
n.destination,
|
|
3802
3812
|
`${r}.destination`,
|
|
3803
3813
|
t
|
|
@@ -3805,11 +3815,11 @@ function Mn(e, r, t) {
|
|
|
3805
3815
|
...o ? { threadMentions: o } : {},
|
|
3806
3816
|
...n.postThreadDetail !== void 0 ? { postThreadDetail: a } : {},
|
|
3807
3817
|
...n.includeDashboardLink !== void 0 ? { includeDashboardLink: i } : {},
|
|
3808
|
-
...n.includeBriefingLink !== void 0 ? { includeBriefingLink:
|
|
3818
|
+
...n.includeBriefingLink !== void 0 ? { includeBriefingLink: c } : {}
|
|
3809
3819
|
};
|
|
3810
3820
|
}
|
|
3811
|
-
function
|
|
3812
|
-
const n =
|
|
3821
|
+
function On(e, r, t) {
|
|
3822
|
+
const n = E(e, r, t);
|
|
3813
3823
|
I(
|
|
3814
3824
|
n,
|
|
3815
3825
|
r,
|
|
@@ -3827,7 +3837,7 @@ function Pn(e, r, t) {
|
|
|
3827
3837
|
const o = O(
|
|
3828
3838
|
n.formatProfile,
|
|
3829
3839
|
`${r}.formatProfile`,
|
|
3830
|
-
|
|
3840
|
+
cn,
|
|
3831
3841
|
"concise, balanced, or detailed",
|
|
3832
3842
|
t
|
|
3833
3843
|
), a = x(
|
|
@@ -3840,7 +3850,7 @@ function Pn(e, r, t) {
|
|
|
3840
3850
|
`${r}.titleOverride`,
|
|
3841
3851
|
500,
|
|
3842
3852
|
t
|
|
3843
|
-
),
|
|
3853
|
+
), c = x(
|
|
3844
3854
|
n.summaryOverride,
|
|
3845
3855
|
`${r}.summaryOverride`,
|
|
3846
3856
|
2e3,
|
|
@@ -3850,11 +3860,11 @@ function Pn(e, r, t) {
|
|
|
3850
3860
|
!0,
|
|
3851
3861
|
`${r}.actionBlockVisible`,
|
|
3852
3862
|
t
|
|
3853
|
-
),
|
|
3863
|
+
), l = Dn(
|
|
3854
3864
|
n.webhookConfig,
|
|
3855
3865
|
`${r}.webhookConfig`,
|
|
3856
3866
|
t
|
|
3857
|
-
), s =
|
|
3867
|
+
), s = Bn(
|
|
3858
3868
|
n.slackConfig,
|
|
3859
3869
|
`${r}.slackConfig`,
|
|
3860
3870
|
t
|
|
@@ -3863,59 +3873,59 @@ function Pn(e, r, t) {
|
|
|
3863
3873
|
...o ? { formatProfile: o } : {},
|
|
3864
3874
|
...a ? { subjectOverride: a } : {},
|
|
3865
3875
|
...i ? { titleOverride: i } : {},
|
|
3866
|
-
...
|
|
3876
|
+
...c ? { summaryOverride: c } : {},
|
|
3867
3877
|
...n.actionBlockVisible !== void 0 ? { actionBlockVisible: d } : {},
|
|
3868
3878
|
...s ? { slackConfig: s } : {},
|
|
3869
|
-
...
|
|
3879
|
+
...l ? { webhookConfig: l } : {}
|
|
3870
3880
|
};
|
|
3871
3881
|
}
|
|
3872
|
-
function
|
|
3882
|
+
function Kn(e, r) {
|
|
3873
3883
|
if (e == null)
|
|
3874
3884
|
return;
|
|
3875
|
-
const t =
|
|
3885
|
+
const t = E(e, "deliveryConfig.channelConfigs", r), n = {};
|
|
3876
3886
|
return Object.entries(t).forEach(([o, a]) => {
|
|
3877
3887
|
if (!mt(o)) {
|
|
3878
|
-
|
|
3888
|
+
p(
|
|
3879
3889
|
r,
|
|
3880
3890
|
`deliveryConfig.channelConfigs.${o}`,
|
|
3881
3891
|
"Expected a supported delivery channel."
|
|
3882
3892
|
);
|
|
3883
3893
|
return;
|
|
3884
3894
|
}
|
|
3885
|
-
n[o] =
|
|
3895
|
+
n[o] = On(
|
|
3886
3896
|
a,
|
|
3887
3897
|
`deliveryConfig.channelConfigs.${o}`,
|
|
3888
3898
|
r
|
|
3889
3899
|
);
|
|
3890
3900
|
}), Object.keys(n).length > 0 ? n : void 0;
|
|
3891
3901
|
}
|
|
3892
|
-
function
|
|
3893
|
-
var d,
|
|
3902
|
+
function Nn(e, r) {
|
|
3903
|
+
var d, l, s;
|
|
3894
3904
|
if (e == null)
|
|
3895
3905
|
return null;
|
|
3896
|
-
const t =
|
|
3906
|
+
const t = E(e, "deliveryConfig", r);
|
|
3897
3907
|
I(
|
|
3898
3908
|
t,
|
|
3899
3909
|
"deliveryConfig",
|
|
3900
3910
|
["recipients", "channels", "channelConfigs"],
|
|
3901
3911
|
r
|
|
3902
3912
|
);
|
|
3903
|
-
const n =
|
|
3913
|
+
const n = Kn(t.channelConfigs, r), o = Fn(t.recipients, r), a = Rn(t.channels, r), i = ((l = (d = n == null ? void 0 : n.SLACK) == null ? void 0 : d.slackConfig) == null ? void 0 : l.destination.type) === "channel" && !!n.SLACK.slackConfig.destination.channelId.trim();
|
|
3904
3914
|
return a.some(
|
|
3905
3915
|
(u) => u !== "SLACK"
|
|
3906
|
-
) && o.length === 0 &&
|
|
3916
|
+
) && o.length === 0 && p(
|
|
3907
3917
|
r,
|
|
3908
3918
|
"deliveryConfig.recipients",
|
|
3909
3919
|
"Add at least one recipient or remove delivery config."
|
|
3910
|
-
), a.length === 0 &&
|
|
3920
|
+
), a.length === 0 && p(
|
|
3911
3921
|
r,
|
|
3912
3922
|
"deliveryConfig.channels",
|
|
3913
3923
|
"Choose at least one delivery channel or remove delivery config."
|
|
3914
|
-
), a.includes("SLACK") && !i &&
|
|
3924
|
+
), a.includes("SLACK") && !i && p(
|
|
3915
3925
|
r,
|
|
3916
3926
|
"deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
|
|
3917
3927
|
"Choose a Slack channel destination."
|
|
3918
|
-
), !a.includes("SLACK") && ((s = n == null ? void 0 : n.SLACK) != null && s.slackConfig) &&
|
|
3928
|
+
), !a.includes("SLACK") && ((s = n == null ? void 0 : n.SLACK) != null && s.slackConfig) && p(
|
|
3919
3929
|
r,
|
|
3920
3930
|
"deliveryConfig.channelConfigs.SLACK",
|
|
3921
3931
|
"Slack config requires SLACK in deliveryConfig.channels."
|
|
@@ -3926,7 +3936,7 @@ function On(e, r) {
|
|
|
3926
3936
|
};
|
|
3927
3937
|
}
|
|
3928
3938
|
function $e(e) {
|
|
3929
|
-
const r = [], t =
|
|
3939
|
+
const r = [], t = E(e, "draft", r);
|
|
3930
3940
|
I(
|
|
3931
3941
|
t,
|
|
3932
3942
|
"draft",
|
|
@@ -3955,28 +3965,28 @@ function $e(e) {
|
|
|
3955
3965
|
"description",
|
|
3956
3966
|
h.description,
|
|
3957
3967
|
r
|
|
3958
|
-
) ?? null, a = x(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = x(t.timezone, "timezone", 200, r) ?? "UTC",
|
|
3959
|
-
return st(
|
|
3968
|
+
) ?? null, a = x(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = x(t.timezone, "timezone", 200, r) ?? "UTC", c = pn(t.status, r), d = nt(t.source, r), l = ot(t.body, r), s = ct(t.attachments, r), u = at(t.presentation, r), f = lt(t.limits, r), m = Nn(t.deliveryConfig, r);
|
|
3969
|
+
return st(l, s, r), Te(r), {
|
|
3960
3970
|
name: n,
|
|
3961
3971
|
description: o,
|
|
3962
|
-
status:
|
|
3972
|
+
status: c,
|
|
3963
3973
|
scheduleExpr: a,
|
|
3964
3974
|
timezone: i,
|
|
3965
3975
|
source: d,
|
|
3966
|
-
body:
|
|
3976
|
+
body: l,
|
|
3967
3977
|
attachments: s,
|
|
3968
3978
|
presentation: u,
|
|
3969
|
-
...
|
|
3979
|
+
...f ? { limits: f } : {},
|
|
3970
3980
|
deliveryConfig: m
|
|
3971
3981
|
};
|
|
3972
3982
|
}
|
|
3973
|
-
function
|
|
3983
|
+
function qo(e) {
|
|
3974
3984
|
return $e(e);
|
|
3975
3985
|
}
|
|
3976
|
-
function
|
|
3986
|
+
function Uo(e) {
|
|
3977
3987
|
return $e(e);
|
|
3978
3988
|
}
|
|
3979
|
-
function
|
|
3989
|
+
function jo(e) {
|
|
3980
3990
|
try {
|
|
3981
3991
|
return { valid: !0, value: $e(e), issues: [] };
|
|
3982
3992
|
} catch (r) {
|
|
@@ -3985,7 +3995,7 @@ function Vo(e) {
|
|
|
3985
3995
|
throw r;
|
|
3986
3996
|
}
|
|
3987
3997
|
}
|
|
3988
|
-
function
|
|
3998
|
+
function Go(e) {
|
|
3989
3999
|
try {
|
|
3990
4000
|
return { valid: !0, value: dt(e), issues: [] };
|
|
3991
4001
|
} catch (r) {
|
|
@@ -3994,105 +4004,105 @@ function Uo(e) {
|
|
|
3994
4004
|
throw r;
|
|
3995
4005
|
}
|
|
3996
4006
|
}
|
|
3997
|
-
function
|
|
4007
|
+
function Ho(e) {
|
|
3998
4008
|
return typeof e == "string" && tt.has(e);
|
|
3999
4009
|
}
|
|
4000
4010
|
function mt(e) {
|
|
4001
|
-
return typeof e == "string" &&
|
|
4011
|
+
return typeof e == "string" && en.has(e);
|
|
4002
4012
|
}
|
|
4003
4013
|
export {
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4014
|
+
Br as $,
|
|
4015
|
+
yo as A,
|
|
4016
|
+
Eo as B,
|
|
4017
|
+
Sr as C,
|
|
4018
|
+
So as D,
|
|
4019
|
+
Fo as E,
|
|
4010
4020
|
ne as F,
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4021
|
+
or as G,
|
|
4022
|
+
ao as H,
|
|
4023
|
+
go as I,
|
|
4014
4024
|
L as J,
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4025
|
+
mo as K,
|
|
4026
|
+
Qt as L,
|
|
4027
|
+
tr as M,
|
|
4028
|
+
rr as N,
|
|
4029
|
+
fr as O,
|
|
4030
|
+
Zt as P,
|
|
4031
|
+
ur as Q,
|
|
4032
|
+
be as R,
|
|
4033
|
+
cr as S,
|
|
4034
|
+
ho as T,
|
|
4035
|
+
co as U,
|
|
4036
|
+
uo as V,
|
|
4037
|
+
fo as W,
|
|
4038
|
+
po as X,
|
|
4039
|
+
qe as Y,
|
|
4040
|
+
S as Z,
|
|
4041
|
+
ko as _,
|
|
4042
|
+
br as a,
|
|
4043
|
+
Je as a0,
|
|
4044
|
+
Do as a1,
|
|
4045
|
+
V as a2,
|
|
4046
|
+
Po as a3,
|
|
4047
|
+
Gr as a4,
|
|
4048
|
+
Bo as a5,
|
|
4049
|
+
Qe as a6,
|
|
4050
|
+
Ao as a7,
|
|
4051
|
+
Yr as a8,
|
|
4052
|
+
Oo as a9,
|
|
4053
|
+
_o as aA,
|
|
4054
|
+
Fr as aB,
|
|
4055
|
+
_r as aC,
|
|
4056
|
+
Zr as aD,
|
|
4057
|
+
dr as aa,
|
|
4058
|
+
yr as ab,
|
|
4059
|
+
Ue as ac,
|
|
4060
|
+
bo as ad,
|
|
4061
|
+
Ro as ae,
|
|
4052
4062
|
fe as af,
|
|
4053
|
-
|
|
4063
|
+
Qr as ag,
|
|
4054
4064
|
pe as ah,
|
|
4055
4065
|
ce as ai,
|
|
4056
4066
|
h as aj,
|
|
4057
4067
|
R as ak,
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4068
|
+
Xr as al,
|
|
4069
|
+
Jr as am,
|
|
4070
|
+
Lo as an,
|
|
4061
4071
|
oe as ao,
|
|
4062
|
-
|
|
4063
|
-
|
|
4072
|
+
wn as ap,
|
|
4073
|
+
zo as aq,
|
|
4064
4074
|
dt as ar,
|
|
4065
|
-
|
|
4075
|
+
Vo as as,
|
|
4066
4076
|
$e as at,
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4077
|
+
qo as au,
|
|
4078
|
+
Uo as av,
|
|
4079
|
+
jo as aw,
|
|
4080
|
+
Go as ax,
|
|
4081
|
+
Ho as ay,
|
|
4072
4082
|
mt as az,
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4083
|
+
To as b,
|
|
4084
|
+
Ir as c,
|
|
4085
|
+
No as d,
|
|
4086
|
+
Mo as e,
|
|
4087
|
+
Tr as f,
|
|
4088
|
+
Cr as g,
|
|
4089
|
+
Ko as h,
|
|
4080
4090
|
Se as i,
|
|
4081
|
-
|
|
4082
|
-
|
|
4091
|
+
Z as j,
|
|
4092
|
+
$o as k,
|
|
4083
4093
|
wo as l,
|
|
4084
4094
|
Ge as m,
|
|
4085
|
-
|
|
4086
|
-
|
|
4095
|
+
xo as n,
|
|
4096
|
+
Io as o,
|
|
4087
4097
|
Ie as p,
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4098
|
+
Co as q,
|
|
4099
|
+
wr as r,
|
|
4100
|
+
Jt as s,
|
|
4101
|
+
oo as t,
|
|
4102
|
+
so as u,
|
|
4103
|
+
er as v,
|
|
4104
|
+
lo as w,
|
|
4105
|
+
vo as x,
|
|
4096
4106
|
Le as y,
|
|
4097
|
-
|
|
4107
|
+
io as z
|
|
4098
4108
|
};
|