react-semaphor 0.1.602 → 0.1.604
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1451
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +4 -1594
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
- package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
- package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
- package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
- package/dist/chunks/brand-DCaZyRt6.js +1 -0
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
- package/dist/chunks/context-ALdccLHw.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-BX28ld6s.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
- package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
- package/dist/chunks/dates-D-KP8G-z.js +1 -0
- package/dist/chunks/edit-DEAK0UZo.js +1 -0
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-CwQrqORc.js +1 -0
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
- package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
- package/dist/chunks/index-B-VF1ogs.js +1 -0
- package/dist/chunks/index-BE1DfxNs.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
- package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
- package/dist/chunks/palette-BzC-CGOc.js +6 -0
- package/dist/chunks/pickers-DuBrUht0.js +1 -0
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
- package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
- package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
- package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
- package/dist/chunks/save-DdFUZcbi.js +6 -0
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
- package/dist/chunks/schema-MC0cQSAb.js +4 -0
- package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
- package/dist/chunks/set-DuJfGkbY.js +1 -0
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
- package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
- package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
- package/dist/chunks/validators-CqV3Yka1.js +1 -0
- package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4491
- package/dist/format-utils/index.js +1 -424
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +1 -88
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +6 -2
- package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
- package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
- package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
- package/dist/chunks/context-BJoEFgNl.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
- package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
- package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
- package/dist/chunks/dates-Bz-qM5px.js +0 -164
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-BXT6y303.js +0 -703
- package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
- package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-BW0yozjs.js +0 -2795
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
- package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
- package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
- package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
- package/dist/chunks/palette-CuA0HlzF.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
- package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
- package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
- package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-BKHlDONy.js +0 -21
- package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
- package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
- package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
- package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
- package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
- package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
- package/dist/chunks/token-types-D_xKgyVS.js +0 -8
- package/dist/chunks/upload-Dll_M7XQ.js +0 -15
- package/dist/chunks/validators-ClWHpYql.js +0 -3686
- package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
import { parseValueFormatPreferences as _, isReportPreferenceSource as C } from "../value-format-preferences/index.js";
|
|
2
|
-
import { p as g } from "./validators-ClWHpYql.js";
|
|
3
|
-
import { i as k } from "./analytics-base-schemas-DevrgqQb.js";
|
|
4
|
-
const D = {
|
|
5
|
-
tz: "UTC",
|
|
6
|
-
weekStart: 1,
|
|
7
|
-
anchor: "now"
|
|
8
|
-
}, b = [
|
|
9
|
-
"tz",
|
|
10
|
-
"weekStart",
|
|
11
|
-
"anchor",
|
|
12
|
-
"fiscalCalendar"
|
|
13
|
-
], w = ["kind", "yearStartMonth"], E = [
|
|
14
|
-
"calendar",
|
|
15
|
-
"valueFormat",
|
|
16
|
-
"preferenceSources"
|
|
17
|
-
], z = ["calendar", "valueFormat"], p = ["tz", "weekStart"], F = [
|
|
18
|
-
"stored",
|
|
19
|
-
"inherited",
|
|
20
|
-
"inheritedSources",
|
|
21
|
-
"resolved",
|
|
22
|
-
"sources"
|
|
23
|
-
], T = [
|
|
24
|
-
"locale",
|
|
25
|
-
"dateStyle",
|
|
26
|
-
"dateTime",
|
|
27
|
-
"defaultCurrency"
|
|
28
|
-
], R = ["dateStyle", "timeStyle"];
|
|
29
|
-
function o(e) {
|
|
30
|
-
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
31
|
-
return !1;
|
|
32
|
-
const a = Object.getPrototypeOf(e);
|
|
33
|
-
return a === null || Object.getPrototypeOf(a) === null;
|
|
34
|
-
}
|
|
35
|
-
function n(e, a, r) {
|
|
36
|
-
const t = new Set(a);
|
|
37
|
-
return Object.keys(e).filter((s) => !t.has(s)).map((s) => ({
|
|
38
|
-
path: r === "$" ? s : `${r}.${s}`,
|
|
39
|
-
code: "unknown_property",
|
|
40
|
-
message: `Unknown property "${s}"`
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
function y(e) {
|
|
44
|
-
return Number.isInteger(e) && typeof e == "number" && e >= 0 && e <= 6;
|
|
45
|
-
}
|
|
46
|
-
function d(e, a, r) {
|
|
47
|
-
if (!o(e))
|
|
48
|
-
return {
|
|
49
|
-
ok: !1,
|
|
50
|
-
issues: [
|
|
51
|
-
{
|
|
52
|
-
path: a,
|
|
53
|
-
code: "invalid_type",
|
|
54
|
-
message: "Calendar preferences must be an object"
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
};
|
|
58
|
-
const t = n(e, ["tz", "weekStart"], a);
|
|
59
|
-
return (!r || e.tz !== void 0) && (typeof e.tz != "string" || !k(e.tz)) && t.push({
|
|
60
|
-
path: `${a}.tz`,
|
|
61
|
-
code: "invalid_timezone",
|
|
62
|
-
message: "tz must be a valid IANA timezone"
|
|
63
|
-
}), (!r || e.weekStart !== void 0) && !y(e.weekStart) && t.push({
|
|
64
|
-
path: `${a}.weekStart`,
|
|
65
|
-
code: "invalid_week_start",
|
|
66
|
-
message: "weekStart must be an integer from 0 to 6"
|
|
67
|
-
}), t.length ? { ok: !1, issues: t } : {
|
|
68
|
-
ok: !0,
|
|
69
|
-
value: {
|
|
70
|
-
...e.tz !== void 0 ? { tz: e.tz } : {},
|
|
71
|
-
...e.weekStart !== void 0 ? { weekStart: e.weekStart } : {}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function A(e) {
|
|
76
|
-
if (e === "now") return { ok: !0, value: "now" };
|
|
77
|
-
if (!o(e))
|
|
78
|
-
return {
|
|
79
|
-
ok: !1,
|
|
80
|
-
issues: [
|
|
81
|
-
{
|
|
82
|
-
path: "anchor",
|
|
83
|
-
code: "invalid_anchor",
|
|
84
|
-
message: 'anchor must be "now" or an object with an ISO timestamp'
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
};
|
|
88
|
-
const a = n(e, ["iso"], "anchor"), r = e.iso;
|
|
89
|
-
return g(r) === null && a.push({
|
|
90
|
-
path: "anchor.iso",
|
|
91
|
-
code: "invalid_anchor",
|
|
92
|
-
message: "anchor.iso must be an ISO timestamp with an explicit offset"
|
|
93
|
-
}), a.length ? { ok: !1, issues: a } : { ok: !0, value: { iso: r } };
|
|
94
|
-
}
|
|
95
|
-
function $(e) {
|
|
96
|
-
if (!o(e))
|
|
97
|
-
return {
|
|
98
|
-
ok: !1,
|
|
99
|
-
issues: [
|
|
100
|
-
{
|
|
101
|
-
path: "fiscalCalendar",
|
|
102
|
-
code: "invalid_fiscal_calendar",
|
|
103
|
-
message: "fiscalCalendar must be an object"
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
};
|
|
107
|
-
const a = n(e, w, "fiscalCalendar");
|
|
108
|
-
return e.kind !== "month_aligned" && a.push({
|
|
109
|
-
path: "fiscalCalendar.kind",
|
|
110
|
-
code: "invalid_fiscal_calendar",
|
|
111
|
-
message: 'fiscalCalendar.kind must be "month_aligned"'
|
|
112
|
-
}), (!Number.isInteger(e.yearStartMonth) || typeof e.yearStartMonth != "number" || e.yearStartMonth < 1 || e.yearStartMonth > 12) && a.push({
|
|
113
|
-
path: "fiscalCalendar.yearStartMonth",
|
|
114
|
-
code: "invalid_fiscal_calendar",
|
|
115
|
-
message: "fiscalCalendar.yearStartMonth must be an integer from 1 to 12"
|
|
116
|
-
}), a.length ? { ok: !1, issues: a } : {
|
|
117
|
-
ok: !0,
|
|
118
|
-
value: {
|
|
119
|
-
kind: "month_aligned",
|
|
120
|
-
yearStartMonth: e.yearStartMonth
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
function O(e) {
|
|
125
|
-
if (!o(e))
|
|
126
|
-
return {
|
|
127
|
-
ok: !1,
|
|
128
|
-
issues: [
|
|
129
|
-
{
|
|
130
|
-
path: "$",
|
|
131
|
-
code: "invalid_type",
|
|
132
|
-
message: "Calendar context must be an object"
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
};
|
|
136
|
-
const a = n(e, b, "$");
|
|
137
|
-
(typeof e.tz != "string" || !k(e.tz)) && a.push({
|
|
138
|
-
path: "tz",
|
|
139
|
-
code: "invalid_timezone",
|
|
140
|
-
message: "tz must be a valid IANA timezone"
|
|
141
|
-
}), y(e.weekStart) || a.push({
|
|
142
|
-
path: "weekStart",
|
|
143
|
-
code: "invalid_week_start",
|
|
144
|
-
message: "weekStart must be an integer from 0 to 6"
|
|
145
|
-
});
|
|
146
|
-
const r = A(e.anchor);
|
|
147
|
-
r.ok || a.push(...r.issues);
|
|
148
|
-
let t;
|
|
149
|
-
if (e.fiscalCalendar !== void 0) {
|
|
150
|
-
const s = $(e.fiscalCalendar);
|
|
151
|
-
s.ok ? t = s.value : a.push(...s.issues);
|
|
152
|
-
}
|
|
153
|
-
return a.length || !r.ok ? { ok: !1, issues: a } : {
|
|
154
|
-
ok: !0,
|
|
155
|
-
value: {
|
|
156
|
-
tz: e.tz,
|
|
157
|
-
weekStart: e.weekStart,
|
|
158
|
-
anchor: r.value,
|
|
159
|
-
...t ? { fiscalCalendar: t } : {}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
function l(e, a, r) {
|
|
164
|
-
if (!C(e)) {
|
|
165
|
-
r.push({
|
|
166
|
-
path: a,
|
|
167
|
-
code: "invalid_preference_source",
|
|
168
|
-
message: "Preference source is invalid"
|
|
169
|
-
});
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
return e;
|
|
173
|
-
}
|
|
174
|
-
function h(e, a) {
|
|
175
|
-
if (!o(e))
|
|
176
|
-
return {
|
|
177
|
-
ok: !1,
|
|
178
|
-
issues: [
|
|
179
|
-
{
|
|
180
|
-
path: a,
|
|
181
|
-
code: "invalid_type",
|
|
182
|
-
message: "Calendar preference sources must be an object"
|
|
183
|
-
}
|
|
184
|
-
]
|
|
185
|
-
};
|
|
186
|
-
const r = n(e, p, a), t = l(e.tz, `${a}.tz`, r), s = l(
|
|
187
|
-
e.weekStart,
|
|
188
|
-
`${a}.weekStart`,
|
|
189
|
-
r
|
|
190
|
-
);
|
|
191
|
-
return r.length || !t || !s ? { ok: !1, issues: r } : { ok: !0, value: { tz: t, weekStart: s } };
|
|
192
|
-
}
|
|
193
|
-
function K(e) {
|
|
194
|
-
if (!o(e))
|
|
195
|
-
return {
|
|
196
|
-
ok: !1,
|
|
197
|
-
issues: [
|
|
198
|
-
{
|
|
199
|
-
path: "$",
|
|
200
|
-
code: "invalid_type",
|
|
201
|
-
message: "Calendar preference response must be an object"
|
|
202
|
-
}
|
|
203
|
-
]
|
|
204
|
-
};
|
|
205
|
-
const a = n(e, F, "$"), r = e.stored === null ? { ok: !0, value: null } : d(e.stored, "stored", !0), t = d(
|
|
206
|
-
e.inherited,
|
|
207
|
-
"inherited",
|
|
208
|
-
!1
|
|
209
|
-
), s = h(
|
|
210
|
-
e.inheritedSources,
|
|
211
|
-
"inheritedSources"
|
|
212
|
-
), c = d(e.resolved, "resolved", !1), i = h(e.sources, "sources");
|
|
213
|
-
for (const u of [r, t, s, c, i])
|
|
214
|
-
u.ok || a.push(...u.issues);
|
|
215
|
-
return a.length || !r.ok || !t.ok || !s.ok || !c.ok || !i.ok ? { ok: !1, issues: a } : {
|
|
216
|
-
ok: !0,
|
|
217
|
-
value: {
|
|
218
|
-
stored: r.value,
|
|
219
|
-
inherited: t.value,
|
|
220
|
-
inheritedSources: s.value,
|
|
221
|
-
resolved: c.value,
|
|
222
|
-
sources: i.value
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
function j(e) {
|
|
227
|
-
if (!o(e))
|
|
228
|
-
return {
|
|
229
|
-
ok: !1,
|
|
230
|
-
issues: [
|
|
231
|
-
{
|
|
232
|
-
path: "preferenceSources",
|
|
233
|
-
code: "invalid_type",
|
|
234
|
-
message: "preferenceSources must be an object"
|
|
235
|
-
}
|
|
236
|
-
]
|
|
237
|
-
};
|
|
238
|
-
const a = n(e, z, "preferenceSources"), r = e.calendar, t = e.valueFormat;
|
|
239
|
-
if (o(r) || a.push({
|
|
240
|
-
path: "preferenceSources.calendar",
|
|
241
|
-
code: "invalid_type",
|
|
242
|
-
message: "Calendar preference sources must be an object"
|
|
243
|
-
}), o(t) || a.push({
|
|
244
|
-
path: "preferenceSources.valueFormat",
|
|
245
|
-
code: "invalid_type",
|
|
246
|
-
message: "Value-format preference sources must be an object"
|
|
247
|
-
}), !o(r) || !o(t))
|
|
248
|
-
return { ok: !1, issues: a };
|
|
249
|
-
a.push(
|
|
250
|
-
...n(
|
|
251
|
-
r,
|
|
252
|
-
p,
|
|
253
|
-
"preferenceSources.calendar"
|
|
254
|
-
),
|
|
255
|
-
...n(
|
|
256
|
-
t,
|
|
257
|
-
T,
|
|
258
|
-
"preferenceSources.valueFormat"
|
|
259
|
-
)
|
|
260
|
-
);
|
|
261
|
-
const s = t.dateTime;
|
|
262
|
-
o(s) ? a.push(
|
|
263
|
-
...n(
|
|
264
|
-
s,
|
|
265
|
-
R,
|
|
266
|
-
"preferenceSources.valueFormat.dateTime"
|
|
267
|
-
)
|
|
268
|
-
) : a.push({
|
|
269
|
-
path: "preferenceSources.valueFormat.dateTime",
|
|
270
|
-
code: "invalid_type",
|
|
271
|
-
message: "Datetime preference sources must be an object"
|
|
272
|
-
});
|
|
273
|
-
const c = l(
|
|
274
|
-
r.tz,
|
|
275
|
-
"preferenceSources.calendar.tz",
|
|
276
|
-
a
|
|
277
|
-
), i = l(
|
|
278
|
-
r.weekStart,
|
|
279
|
-
"preferenceSources.calendar.weekStart",
|
|
280
|
-
a
|
|
281
|
-
), u = l(
|
|
282
|
-
t.locale,
|
|
283
|
-
"preferenceSources.valueFormat.locale",
|
|
284
|
-
a
|
|
285
|
-
), f = l(
|
|
286
|
-
t.dateStyle,
|
|
287
|
-
"preferenceSources.valueFormat.dateStyle",
|
|
288
|
-
a
|
|
289
|
-
), m = o(s) ? l(
|
|
290
|
-
s.dateStyle,
|
|
291
|
-
"preferenceSources.valueFormat.dateTime.dateStyle",
|
|
292
|
-
a
|
|
293
|
-
) : void 0, S = o(s) ? l(
|
|
294
|
-
s.timeStyle,
|
|
295
|
-
"preferenceSources.valueFormat.dateTime.timeStyle",
|
|
296
|
-
a
|
|
297
|
-
) : void 0, v = l(
|
|
298
|
-
t.defaultCurrency,
|
|
299
|
-
"preferenceSources.valueFormat.defaultCurrency",
|
|
300
|
-
a
|
|
301
|
-
);
|
|
302
|
-
return a.length || !c || !i || !u || !f || !m || !S || !v ? { ok: !1, issues: a } : {
|
|
303
|
-
ok: !0,
|
|
304
|
-
value: {
|
|
305
|
-
calendar: {
|
|
306
|
-
tz: c,
|
|
307
|
-
weekStart: i
|
|
308
|
-
},
|
|
309
|
-
valueFormat: {
|
|
310
|
-
locale: u,
|
|
311
|
-
dateStyle: f,
|
|
312
|
-
dateTime: {
|
|
313
|
-
dateStyle: m,
|
|
314
|
-
timeStyle: S
|
|
315
|
-
},
|
|
316
|
-
defaultCurrency: v
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
function P(e) {
|
|
322
|
-
var t;
|
|
323
|
-
const a = _(e);
|
|
324
|
-
if (!a.ok)
|
|
325
|
-
return {
|
|
326
|
-
ok: !1,
|
|
327
|
-
issues: a.issues.map((s) => ({
|
|
328
|
-
path: `valueFormat.${s.path}`,
|
|
329
|
-
code: "invalid_value_format",
|
|
330
|
-
message: s.message
|
|
331
|
-
}))
|
|
332
|
-
};
|
|
333
|
-
const r = a.value;
|
|
334
|
-
return r.locale === void 0 || r.dateStyle === void 0 || ((t = r.dateTime) == null ? void 0 : t.dateStyle) === void 0 || r.dateTime.timeStyle === void 0 || r.defaultCurrency === void 0 ? {
|
|
335
|
-
ok: !1,
|
|
336
|
-
issues: [
|
|
337
|
-
{
|
|
338
|
-
path: "valueFormat",
|
|
339
|
-
code: "invalid_value_format",
|
|
340
|
-
message: "Resolved value-format preferences must be complete"
|
|
341
|
-
}
|
|
342
|
-
]
|
|
343
|
-
} : {
|
|
344
|
-
ok: !0,
|
|
345
|
-
value: {
|
|
346
|
-
locale: r.locale,
|
|
347
|
-
dateStyle: r.dateStyle,
|
|
348
|
-
dateTime: {
|
|
349
|
-
dateStyle: r.dateTime.dateStyle,
|
|
350
|
-
timeStyle: r.dateTime.timeStyle
|
|
351
|
-
},
|
|
352
|
-
defaultCurrency: r.defaultCurrency
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
function U(e) {
|
|
357
|
-
if (!o(e))
|
|
358
|
-
return {
|
|
359
|
-
ok: !1,
|
|
360
|
-
issues: [
|
|
361
|
-
{
|
|
362
|
-
path: "$",
|
|
363
|
-
code: "invalid_type",
|
|
364
|
-
message: "Report runtime context must be an object"
|
|
365
|
-
}
|
|
366
|
-
]
|
|
367
|
-
};
|
|
368
|
-
const a = n(e, E, "$"), r = O(e.calendar), t = P(e.valueFormat), s = j(e.preferenceSources);
|
|
369
|
-
return r.ok || a.push(
|
|
370
|
-
...r.issues.map((c) => ({
|
|
371
|
-
...c,
|
|
372
|
-
path: c.path === "$" ? "calendar" : `calendar.${c.path}`
|
|
373
|
-
}))
|
|
374
|
-
), t.ok || a.push(...t.issues), s.ok || a.push(...s.issues), a.length || !r.ok || !t.ok || !s.ok ? { ok: !1, issues: a } : {
|
|
375
|
-
ok: !0,
|
|
376
|
-
value: {
|
|
377
|
-
calendar: r.value,
|
|
378
|
-
valueFormat: t.value,
|
|
379
|
-
preferenceSources: s.value
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
export {
|
|
384
|
-
D,
|
|
385
|
-
K as a,
|
|
386
|
-
U as b,
|
|
387
|
-
O as p
|
|
388
|
-
};
|