react-semaphor 0.1.568 → 0.1.570
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/README.md +0 -7
- package/dist/analytics-protocol/index.js +434 -454
- package/dist/appearance/index.js +6 -3
- package/dist/appearance-runtime/index.js +1 -1
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +572 -436
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/appearance-context-BwBp25ZG.js +162 -0
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +80 -0
- package/dist/chunks/assistant-chat-B-Ddyy8b.js +5940 -0
- package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-DCYD-6Fr.js} +2 -2
- package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
- package/dist/chunks/brand-B4BdpAB_.js +54 -0
- package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-0VvKmRst.js} +992 -991
- package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-PtcDWvkN.js} +252 -253
- package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-DxGIr1vZ.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-B-quOOOQ.js} +253 -253
- package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-Caodx80b.js} +288 -285
- package/dist/chunks/dashboard-json-Ct-AGDHF.js +66 -0
- package/dist/chunks/{dates-CKO05ino.js → dates-B9mL8BHE.js} +16 -15
- package/dist/chunks/edit-Bpdh_P_a.js +226 -0
- package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-DeDTuYB5.js} +2257 -2270
- package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-BSY33ro5.js} +1440 -1301
- package/dist/chunks/filter-value-text-DvvSNlho.js +146 -0
- package/dist/chunks/index-BVKzKl5d.js +90 -0
- package/dist/chunks/{index-RNaTnE3m.js → index-CV_Kzou0.js} +233 -223
- package/dist/chunks/{index-CPNZW0mu.js → index-y3HUzRNk.js} +76 -77
- package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-8rR-LPTk.js} +1 -1
- package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C1-uTgjR.js} +1 -1
- package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
- package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
- package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
- package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
- package/dist/chunks/paintbrush-aR17Z3C9.js +27 -0
- package/dist/chunks/{palette-4vf2BEEg.js → palette-a5FCZKFI.js} +1 -1
- package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → pickers-DkqmtnTL.js} +352 -290
- package/dist/chunks/pivot-result-contract-expectations-C-HnUKYe.js +55 -0
- package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
- package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
- package/dist/chunks/{report-preferences-dialog-Mbd-I0wV.js → report-preferences-dialog-Yvhv3WX2.js} +95 -97
- package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-Lkbwycwe.js} +5491 -5683
- package/dist/chunks/resolver-DG_tfEpt.js +156 -0
- package/dist/chunks/{save-D6pHmSSP.js → save-D985VvYp.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-DC_TEd6y.js} +6 -6
- package/dist/chunks/schema-C9NPiIru.js +2568 -0
- package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-ByFvqHEO.js} +35916 -36001
- package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-CjoVaK6J.js} +64 -66
- package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-C0hekXiI.js} +332 -333
- package/dist/chunks/{code-editor-DJNOsgJH.js → style-sheet-parts-C7qGZuH1.js} +2402 -2040
- package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-CP8zSOhj.js} +1 -1
- package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-CqbJjIuu.js} +18 -18
- package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
- package/dist/chunks/{upload-Cf3wXZT8.js → upload-CiGNKJ_0.js} +1 -1
- package/dist/chunks/validators-B8fpdinG.js +3651 -0
- package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-9-huI1h4.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1888 -1826
- package/dist/format-utils/index.js +230 -231
- package/dist/index.js +349 -353
- package/dist/layouts/index.js +1 -1
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/appearance/index.d.ts +1 -0
- package/dist/types/brand-studio/brand-studio-draft.d.ts +7 -0
- package/dist/types/brand-studio/index.d.ts +1 -1
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/providers/appearance-runtime-provider.d.ts +4 -1
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -2
- package/dist/types/components/sharing-and-management/utils/types.d.ts +0 -72
- package/dist/types/components/surfboard/filter/types.d.ts +5 -4
- package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -9
- package/dist/types/components/visual/data-table/utils/pagination-utils.d.ts +0 -19
- package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -1
- package/dist/types/index.js +9 -9
- package/dist/types/lib/appearance/aliases.d.ts +42 -0
- package/dist/types/lib/appearance/compiler.d.ts +6 -0
- package/dist/types/lib/appearance/defaults.d.ts +6 -0
- package/dist/types/lib/appearance/index.d.ts +2 -0
- package/dist/types/lib/appearance/normalize-organization.d.ts +17 -0
- package/dist/types/lib/appearance/resolver.d.ts +2 -2
- package/dist/types/lib/appearance/types.d.ts +38 -1
- package/dist/types/lib/charts/types.d.ts +6 -2
- package/dist/types/lib/dashboard/semantic-dataset-references.d.ts +0 -1
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +0 -2
- package/dist/types/lib/dashboard-variables/types.d.ts +1 -6
- package/dist/types/lib/download-pdf.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +3 -4
- package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +15 -6
- package/dist/types/lib/stores/editor-store.d.ts +0 -1
- package/dist/types/lib/stores/table-actions.d.ts +0 -1
- package/dist/types/lib/table-formatting/table-formatting-css.d.ts +0 -5
- package/dist/types/lib/types/common-types.d.ts +3 -2
- package/dist/types/lib/types/explorer-types.d.ts +2 -2
- package/dist/types/lib/types/index.d.ts +1 -1
- package/dist/types/lib/types/summary-types.d.ts +0 -5
- package/dist/types/lib/utils/card-definition.d.ts +7 -7
- package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +4 -4
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
- package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +10 -10
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +72 -72
- package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
- package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
- package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
- package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
- package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
- package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
- package/dist/types/shared/assistant-protocol/context.d.ts +30 -30
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +344 -1772
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +104 -104
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
- package/dist/types/shared/dashboard-authoring/dashboard-style/bounds.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/brand.d.ts +20 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/edit-words.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/edit.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/index.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/layers.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/legacy.d.ts +21 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/parse.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/pickers.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/types.d.ts +122 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/view.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
- package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
- package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +10 -10
- package/dist/types/shared/temporal/index.d.ts +0 -2
- package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
- package/package.json +7 -26
- package/DATA_APP_SDK.md +0 -339
- package/dist/chunks/appearance-context-DEYtWinQ.js +0 -126
- package/dist/chunks/appearance-runtime-provider-B-M8gwlZ.js +0 -81
- package/dist/chunks/assistant-chat-BN5I8KuN.js +0 -8849
- package/dist/chunks/color-CJvdlFM_.js +0 -2162
- package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
- package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
- package/dist/chunks/index-CLIro-EG.js +0 -425
- package/dist/chunks/index-CuHybtft.js +0 -51
- package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
- package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
- package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
- package/dist/chunks/operators-B3zZoskU.js +0 -66
- package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
- package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
- package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
- package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
- package/dist/chunks/validators-wtjw0aw6.js +0 -3332
- package/dist/data-app-sdk/index.js +0 -1412
- package/dist/data-app-sdk-adapters/index.js +0 -361
- package/dist/data-app-sdk-validation/index.js +0 -1031
- package/dist/types/components/sharing-and-management/utils/group-types.d.ts +0 -105
- package/dist/types/data-app-sdk/adapters.d.ts +0 -35
- package/dist/types/data-app-sdk/builders.d.ts +0 -62
- package/dist/types/data-app-sdk/contracts.d.ts +0 -419
- package/dist/types/data-app-sdk/executor.d.ts +0 -5
- package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
- package/dist/types/data-app-sdk/hooks.d.ts +0 -11
- package/dist/types/data-app-sdk/index.d.ts +0 -9
- package/dist/types/data-app-sdk/provider.d.ts +0 -8
- package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
- package/dist/types/data-app-sdk/selection.d.ts +0 -2
- package/dist/types/data-app-sdk/validation.d.ts +0 -58
- package/dist/types/data-app-sdk-adapters.d.ts +0 -2
- package/dist/types/data-app-sdk-validation.d.ts +0 -2
- package/dist/types/data-app-sdk.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
- package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
- package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
- package/dist/types/shared/temporal/relative-date.d.ts +0 -21
- package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
- package/src/data-app-sdk/README.md +0 -402
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var d = (e, r, t) => r in e ? c(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var l = (e, r, t) => d(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { ad as u } from "./temporal-input-presentation-CqbJjIuu.js";
|
|
5
|
+
import "./validators-B8fpdinG.js";
|
|
6
|
+
import "./matrix-operation-contract-DCVinw1o.js";
|
|
7
|
+
import { r as v } from "./metric-comparison-n9NsIa-2.js";
|
|
8
|
+
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
9
|
+
class f extends Error {
|
|
10
|
+
constructor(t, a) {
|
|
11
|
+
super(`${t}: ${a}`);
|
|
12
|
+
l(this, "deliveryBlocking", !0);
|
|
13
|
+
this.code = t, this.name = "PivotHeaderPresentationError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function h(e) {
|
|
17
|
+
var i;
|
|
18
|
+
const r = e.mode ?? "formatted", t = e.members.map((o) => {
|
|
19
|
+
var n;
|
|
20
|
+
if (r === "canonical" || !o.temporalBucket)
|
|
21
|
+
return o.value === null ? "" : String(o.value);
|
|
22
|
+
const s = (n = e.resolveTemporalFormat) == null ? void 0 : n.call(e, o.fieldId);
|
|
23
|
+
if (!s)
|
|
24
|
+
throw new f(
|
|
25
|
+
"missing_resolved_temporal_format",
|
|
26
|
+
`Missing resolved temporal presentation for pivot field "${o.fieldId}"`
|
|
27
|
+
);
|
|
28
|
+
return u({
|
|
29
|
+
value: o.value,
|
|
30
|
+
metadata: o.temporalBucket,
|
|
31
|
+
format: s
|
|
32
|
+
});
|
|
33
|
+
}), a = ((i = e.metricLabel) == null ? void 0 : i.trim()) || void 0;
|
|
34
|
+
return {
|
|
35
|
+
memberLabels: t,
|
|
36
|
+
...a ? { metricLabel: a } : {},
|
|
37
|
+
flattenedLabel: [
|
|
38
|
+
...t,
|
|
39
|
+
...a ? [a] : []
|
|
40
|
+
].join(" / ")
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function k(e) {
|
|
44
|
+
const r = /* @__PURE__ */ new Map();
|
|
45
|
+
return e.forEach((t) => {
|
|
46
|
+
t.id && r.set(t.id, (r.get(t.id) ?? 0) + 1);
|
|
47
|
+
}), e.flatMap(
|
|
48
|
+
(t) => t.id && (r.get(t.id) ?? 0) > 1 ? [v(t)] : []
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
f as P,
|
|
53
|
+
k as d,
|
|
54
|
+
h as p
|
|
55
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var y = Object.defineProperty;
|
|
2
2
|
var c = (i, t, e) => t in i ? y(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var a = (i, t, e) => c(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { v as u } from "./metric-comparison-
|
|
4
|
+
import { v as u } from "./metric-comparison-n9NsIa-2.js";
|
|
5
5
|
class l extends Error {
|
|
6
6
|
constructor(e) {
|
|
7
7
|
super(`missing_pivot_member_identity: ${e}`);
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var h = (t, e, a) => e in t ? y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
3
|
+
var l = (t, e, a) => h(t, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
+
import { R } from "./analytics-base-schemas-BaIQrEzX.js";
|
|
5
|
+
const f = /* @__PURE__ */ new Map();
|
|
6
|
+
function _(t, e) {
|
|
7
|
+
let a = f.get(e);
|
|
8
|
+
a || (a = new Intl.DateTimeFormat("en-CA", {
|
|
9
|
+
calendar: "gregory",
|
|
10
|
+
numberingSystem: "latn",
|
|
11
|
+
timeZone: e,
|
|
12
|
+
year: "numeric",
|
|
13
|
+
month: "2-digit",
|
|
14
|
+
day: "2-digit",
|
|
15
|
+
hour: "2-digit",
|
|
16
|
+
minute: "2-digit",
|
|
17
|
+
second: "2-digit",
|
|
18
|
+
hourCycle: "h23"
|
|
19
|
+
}), f.set(e, a));
|
|
20
|
+
const n = a.formatToParts(t), o = (r) => {
|
|
21
|
+
var s;
|
|
22
|
+
return Number((s = n.find((d) => d.type === r)) == null ? void 0 : s.value);
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
year: o("year"),
|
|
26
|
+
month: o("month"),
|
|
27
|
+
day: o("day"),
|
|
28
|
+
hour: o("hour"),
|
|
29
|
+
minute: o("minute"),
|
|
30
|
+
second: o("second")
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function m(t) {
|
|
34
|
+
const e = /* @__PURE__ */ new Date(0);
|
|
35
|
+
return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond ?? 0), e.getTime();
|
|
36
|
+
}
|
|
37
|
+
function u(t, e) {
|
|
38
|
+
const a = t - (t % 1e3 + 1e3) % 1e3;
|
|
39
|
+
return m(_(new Date(a), e)) - a;
|
|
40
|
+
}
|
|
41
|
+
const c = 864e5;
|
|
42
|
+
function k(t, e) {
|
|
43
|
+
const a = b(t, e);
|
|
44
|
+
if (a.length) return a[0];
|
|
45
|
+
const n = m(t);
|
|
46
|
+
return new Date(n - u(n - c, e));
|
|
47
|
+
}
|
|
48
|
+
function b(t, e) {
|
|
49
|
+
const a = m(t), n = u(a - c, e), o = u(a + c, e);
|
|
50
|
+
return [.../* @__PURE__ */ new Set([n, o])].map((r) => a - r).filter((r) => u(r, e) === a - r).sort((r, s) => r - s).map((r) => new Date(r));
|
|
51
|
+
}
|
|
52
|
+
class i extends Error {
|
|
53
|
+
constructor(a) {
|
|
54
|
+
super(a);
|
|
55
|
+
l(this, "code");
|
|
56
|
+
this.name = "RawTemporalMetadataContractError", this.code = R.invalidMetadata;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function g(t) {
|
|
60
|
+
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
61
|
+
return !1;
|
|
62
|
+
const e = Object.getPrototypeOf(t);
|
|
63
|
+
return e === null || e === Object.prototype;
|
|
64
|
+
}
|
|
65
|
+
function N(t) {
|
|
66
|
+
if (!g(t))
|
|
67
|
+
throw new i(
|
|
68
|
+
"Raw temporal metadata must be an object."
|
|
69
|
+
);
|
|
70
|
+
const e = Object.keys(t);
|
|
71
|
+
if (e.length !== 2 || !e.includes("kind") || !e.includes("valueKind"))
|
|
72
|
+
throw new i(
|
|
73
|
+
"Raw temporal metadata must contain only kind and valueKind."
|
|
74
|
+
);
|
|
75
|
+
if (t.kind !== "raw_temporal")
|
|
76
|
+
throw new i(
|
|
77
|
+
"Raw temporal metadata kind must be raw_temporal."
|
|
78
|
+
);
|
|
79
|
+
if (t.valueKind !== "date" && t.valueKind !== "wall_datetime" && t.valueKind !== "instant")
|
|
80
|
+
throw new i(
|
|
81
|
+
"Raw temporal valueKind must be date, wall_datetime, or instant."
|
|
82
|
+
);
|
|
83
|
+
return {
|
|
84
|
+
kind: "raw_temporal",
|
|
85
|
+
valueKind: t.valueKind
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function K(t, e) {
|
|
89
|
+
if (!t.rawTemporal) {
|
|
90
|
+
if (e.metadataRequired)
|
|
91
|
+
throw new i(
|
|
92
|
+
"Activated raw temporal result is missing metadata."
|
|
93
|
+
);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (t.temporalBucket)
|
|
97
|
+
throw new i(
|
|
98
|
+
"A result column cannot carry both raw and grouped temporal metadata."
|
|
99
|
+
);
|
|
100
|
+
const a = N(t.rawTemporal), n = a.valueKind === "date" ? "date" : "datetime";
|
|
101
|
+
if (t.dataType !== n)
|
|
102
|
+
throw new i(
|
|
103
|
+
`${a.valueKind} raw temporal values require dataType ${n}.`
|
|
104
|
+
);
|
|
105
|
+
return a;
|
|
106
|
+
}
|
|
107
|
+
const p = /^(\d{4})-(\d{2})-(\d{2})$/, w = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?$/, T = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
108
|
+
function O(t) {
|
|
109
|
+
if (p.test(t)) return "date";
|
|
110
|
+
if (T.test(t)) return "instant";
|
|
111
|
+
if (w.test(t)) return "wall_datetime";
|
|
112
|
+
}
|
|
113
|
+
function A(t) {
|
|
114
|
+
return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
|
|
115
|
+
}
|
|
116
|
+
function C(t, e) {
|
|
117
|
+
return e === 2 ? A(t) ? 29 : 28 : [4, 6, 9, 11].includes(e) ? 30 : 31;
|
|
118
|
+
}
|
|
119
|
+
function v(t) {
|
|
120
|
+
return t.year >= 1 && t.year <= 9999 && t.month >= 1 && t.month <= 12 && t.day >= 1 && t.day <= C(t.year, t.month) && t.hour >= 0 && t.hour <= 23 && t.minute >= 0 && t.minute <= 59 && t.second >= 0 && t.second <= 59;
|
|
121
|
+
}
|
|
122
|
+
function E(t) {
|
|
123
|
+
return {
|
|
124
|
+
year: Number(t[1]),
|
|
125
|
+
month: Number(t[2]),
|
|
126
|
+
day: Number(t[3]),
|
|
127
|
+
hour: Number(t[4] ?? 0),
|
|
128
|
+
minute: Number(t[5] ?? 0),
|
|
129
|
+
second: Number(t[6] ?? 0),
|
|
130
|
+
fraction: t[7] ?? ""
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function I(t, e) {
|
|
134
|
+
const a = e === "date" ? t.match(p) : e === "wall_datetime" ? t.match(w) : t.match(T);
|
|
135
|
+
if (!a) return { status: "invalid_shape" };
|
|
136
|
+
const n = E(a);
|
|
137
|
+
if (!v(n)) return { status: "out_of_range" };
|
|
138
|
+
if (e === "instant") {
|
|
139
|
+
const o = a[8];
|
|
140
|
+
if (o && o !== "Z") {
|
|
141
|
+
const [s, d] = o.slice(1).split(":").map(Number);
|
|
142
|
+
if (s > 23 || d > 59) return { status: "out_of_range" };
|
|
143
|
+
}
|
|
144
|
+
const r = new Date(t.replace(" ", "T"));
|
|
145
|
+
return Number.isNaN(r.getTime()) ? { status: "out_of_range" } : { status: "valid", fields: n, instant: r };
|
|
146
|
+
}
|
|
147
|
+
return { status: "valid", fields: n };
|
|
148
|
+
}
|
|
149
|
+
export {
|
|
150
|
+
i as R,
|
|
151
|
+
I as a,
|
|
152
|
+
_ as b,
|
|
153
|
+
O as c,
|
|
154
|
+
k as d,
|
|
155
|
+
N as p,
|
|
156
|
+
K as v,
|
|
157
|
+
m as w,
|
|
158
|
+
b as z
|
|
159
|
+
};
|