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,77 +0,0 @@
|
|
|
1
|
-
var y = Object.defineProperty;
|
|
2
|
-
var c = (i, t, e) => t in i ? y(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
-
var a = (i, t, e) => c(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { v as u } from "./metric-comparison-zMylnIkc.js";
|
|
5
|
-
class l extends Error {
|
|
6
|
-
constructor(e) {
|
|
7
|
-
super(`missing_pivot_member_identity: ${e}`);
|
|
8
|
-
a(this, "deliveryBlocking", !0);
|
|
9
|
-
a(this, "code", "missing_pivot_member_identity");
|
|
10
|
-
this.name = "PivotResultIdentityError";
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function d(i) {
|
|
14
|
-
const { identity: t, columnKey: e, expectedPivotFieldIds: o } = i, s = ((o == null ? void 0 : o.length) || 0) === 0;
|
|
15
|
-
if (!t || typeof t != "object" || Array.isArray(t) || typeof t.metricId != "string" || !t.metricId || typeof t.metricAlias != "string" || !t.metricAlias || !Array.isArray(t.members))
|
|
16
|
-
throw new l(
|
|
17
|
-
`Physical pivot column "${e}" is missing stable metric or member identity.`
|
|
18
|
-
);
|
|
19
|
-
if (t.members.forEach((r, n) => {
|
|
20
|
-
if (!r || typeof r != "object" || Array.isArray(r) || typeof r.fieldId != "string" || !r.fieldId || r.value !== null && typeof r.value != "string" || r.temporalBucket !== void 0 && !u(r.temporalBucket).ok)
|
|
21
|
-
throw new l(
|
|
22
|
-
`Physical pivot column "${e}" has invalid identity for member ${n}.`
|
|
23
|
-
);
|
|
24
|
-
if (o && r.fieldId !== o[n])
|
|
25
|
-
throw new l(
|
|
26
|
-
`Physical pivot column "${e}" has member "${r.fieldId}" at tuple position ${n}; expected "${o[n] || "no member"}".`
|
|
27
|
-
);
|
|
28
|
-
}), t.members.length === 0) {
|
|
29
|
-
if (s) return t.members;
|
|
30
|
-
throw new l(
|
|
31
|
-
`Physical pivot column "${e}" is missing its required pivot tuple.`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
if (o && t.members.length !== o.length)
|
|
35
|
-
throw new l(
|
|
36
|
-
`Physical pivot column "${e}" has ${t.members.length} members; expected ${o.length}.`
|
|
37
|
-
);
|
|
38
|
-
return t.members;
|
|
39
|
-
}
|
|
40
|
-
function m(i, t) {
|
|
41
|
-
i.forEach((e) => {
|
|
42
|
-
e.pivotIdentity !== void 0 && d({
|
|
43
|
-
identity: e.pivotIdentity,
|
|
44
|
-
columnKey: e.key,
|
|
45
|
-
expectedPivotFieldIds: t.expectedPivotFieldIds
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function p(i, t, e) {
|
|
50
|
-
var s;
|
|
51
|
-
const o = i == null ? void 0 : i.byRole;
|
|
52
|
-
if (!(!o || typeof o != "object" || Array.isArray(o)))
|
|
53
|
-
return (s = o[e]) == null ? void 0 : s[t];
|
|
54
|
-
}
|
|
55
|
-
function h(i, t) {
|
|
56
|
-
if (!i) return;
|
|
57
|
-
const e = i.byRole;
|
|
58
|
-
if (!e || typeof e != "object" || Array.isArray(e))
|
|
59
|
-
return;
|
|
60
|
-
const o = Object.values(e).flatMap((r) => {
|
|
61
|
-
const n = r == null ? void 0 : r[t];
|
|
62
|
-
return n ? [n] : [];
|
|
63
|
-
});
|
|
64
|
-
if (o.length !== 1) return;
|
|
65
|
-
const [s] = o;
|
|
66
|
-
if (!(s.role === "metric" && Object.values(i.byMetricAlias ?? {}).some(
|
|
67
|
-
(r) => r.role === s.role && r.rawKey === s.rawKey && r.outputKey === s.outputKey
|
|
68
|
-
)))
|
|
69
|
-
return s;
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
l as P,
|
|
73
|
-
h as a,
|
|
74
|
-
d as b,
|
|
75
|
-
m as c,
|
|
76
|
-
p as r
|
|
77
|
-
};
|
|
@@ -1,454 +0,0 @@
|
|
|
1
|
-
var O = Object.defineProperty;
|
|
2
|
-
var P = (t, e, n) => e in t ? O(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
-
var b = (t, e, n) => P(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { j as U, r as W, aM as E } from "./validators-ClWHpYql.js";
|
|
5
|
-
import { R as x } from "./analytics-base-schemas-DevrgqQb.js";
|
|
6
|
-
const k = /* @__PURE__ */ new Map();
|
|
7
|
-
function y(t, e) {
|
|
8
|
-
let n = k.get(e);
|
|
9
|
-
n || (n = new Intl.DateTimeFormat("en-CA", {
|
|
10
|
-
calendar: "gregory",
|
|
11
|
-
numberingSystem: "latn",
|
|
12
|
-
timeZone: e,
|
|
13
|
-
year: "numeric",
|
|
14
|
-
month: "2-digit",
|
|
15
|
-
day: "2-digit",
|
|
16
|
-
hour: "2-digit",
|
|
17
|
-
minute: "2-digit",
|
|
18
|
-
second: "2-digit",
|
|
19
|
-
hourCycle: "h23"
|
|
20
|
-
}), k.set(e, n));
|
|
21
|
-
const r = n.formatToParts(t), o = (a) => {
|
|
22
|
-
var i;
|
|
23
|
-
return Number((i = r.find((u) => u.type === a)) == null ? void 0 : i.value);
|
|
24
|
-
};
|
|
25
|
-
return {
|
|
26
|
-
year: o("year"),
|
|
27
|
-
month: o("month"),
|
|
28
|
-
day: o("day"),
|
|
29
|
-
hour: o("hour"),
|
|
30
|
-
minute: o("minute"),
|
|
31
|
-
second: o("second")
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function s(t) {
|
|
35
|
-
const e = /* @__PURE__ */ new Date(0);
|
|
36
|
-
return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond ?? 0), e.getTime();
|
|
37
|
-
}
|
|
38
|
-
function l(t, e) {
|
|
39
|
-
const n = t - (t % 1e3 + 1e3) % 1e3;
|
|
40
|
-
return s(y(new Date(n), e)) - n;
|
|
41
|
-
}
|
|
42
|
-
const v = 864e5;
|
|
43
|
-
function K(t, e) {
|
|
44
|
-
const n = F(t, e);
|
|
45
|
-
if (n.length) return n[0];
|
|
46
|
-
const r = s(t);
|
|
47
|
-
return new Date(r - l(r - v, e));
|
|
48
|
-
}
|
|
49
|
-
function F(t, e) {
|
|
50
|
-
const n = s(t), r = l(n - v, e), o = l(n + v, e);
|
|
51
|
-
return [.../* @__PURE__ */ new Set([r, o])].map((a) => n - a).filter((a) => l(a, e) === n - a).sort((a, i) => a - i).map((a) => new Date(a));
|
|
52
|
-
}
|
|
53
|
-
const D = 864e5, w = {
|
|
54
|
-
second: 1e3,
|
|
55
|
-
minute: 6e4,
|
|
56
|
-
hour: 36e5
|
|
57
|
-
};
|
|
58
|
-
function g(t, e) {
|
|
59
|
-
return {
|
|
60
|
-
...y(t, e),
|
|
61
|
-
millisecond: (t.getTime() % 1e3 + 1e3) % 1e3
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function d(t, e) {
|
|
65
|
-
return K(t, e);
|
|
66
|
-
}
|
|
67
|
-
function p(t) {
|
|
68
|
-
const e = new Date(t);
|
|
69
|
-
return {
|
|
70
|
-
year: e.getUTCFullYear(),
|
|
71
|
-
month: e.getUTCMonth() + 1,
|
|
72
|
-
day: e.getUTCDate(),
|
|
73
|
-
hour: e.getUTCHours(),
|
|
74
|
-
minute: e.getUTCMinutes(),
|
|
75
|
-
second: e.getUTCSeconds(),
|
|
76
|
-
millisecond: e.getUTCMilliseconds()
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function S(t, e) {
|
|
80
|
-
const n = /* @__PURE__ */ new Date(0);
|
|
81
|
-
return n.setUTCFullYear(t, e, 0), n.getUTCDate();
|
|
82
|
-
}
|
|
83
|
-
function m(t, e) {
|
|
84
|
-
const n = t.year * 12 + (t.month - 1) + e, r = Math.floor(n / 12), o = n - r * 12 + 1;
|
|
85
|
-
return { ...t, year: r, month: o, day: Math.min(t.day, S(r, o)) };
|
|
86
|
-
}
|
|
87
|
-
function f(t, e, n) {
|
|
88
|
-
if (e === 0) return t;
|
|
89
|
-
switch (n) {
|
|
90
|
-
case "second":
|
|
91
|
-
case "minute":
|
|
92
|
-
case "hour":
|
|
93
|
-
return p(
|
|
94
|
-
s(t) + e * w[n]
|
|
95
|
-
);
|
|
96
|
-
case "day":
|
|
97
|
-
return p(s(t) + e * D);
|
|
98
|
-
case "week":
|
|
99
|
-
return p(s(t) + e * 7 * D);
|
|
100
|
-
case "month":
|
|
101
|
-
return m(t, e);
|
|
102
|
-
case "quarter":
|
|
103
|
-
return m(t, e * 3);
|
|
104
|
-
case "year":
|
|
105
|
-
return m(t, e * 12);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function j(t) {
|
|
109
|
-
return new Date(
|
|
110
|
-
s({ ...t, hour: 0, minute: 0, second: 0 })
|
|
111
|
-
).getUTCDay();
|
|
112
|
-
}
|
|
113
|
-
function A(t) {
|
|
114
|
-
var n;
|
|
115
|
-
const e = (n = t.fiscalCalendar) == null ? void 0 : n.yearStartMonth;
|
|
116
|
-
return e && e >= 1 && e <= 12 ? e : 1;
|
|
117
|
-
}
|
|
118
|
-
function Y(t, e, n) {
|
|
119
|
-
const r = { ...t, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
120
|
-
switch (e) {
|
|
121
|
-
case "day":
|
|
122
|
-
return r;
|
|
123
|
-
case "week":
|
|
124
|
-
return f(
|
|
125
|
-
r,
|
|
126
|
-
-((j(t) - n.weekStart + 7) % 7),
|
|
127
|
-
"day"
|
|
128
|
-
);
|
|
129
|
-
case "month":
|
|
130
|
-
return { ...r, day: 1 };
|
|
131
|
-
case "quarter": {
|
|
132
|
-
const o = (t.month - A(n) + 12) % 12;
|
|
133
|
-
return m({ ...r, day: 1 }, -(o % 3));
|
|
134
|
-
}
|
|
135
|
-
case "year": {
|
|
136
|
-
const o = A(n);
|
|
137
|
-
return {
|
|
138
|
-
...r,
|
|
139
|
-
year: t.month >= o ? t.year : t.year - 1,
|
|
140
|
-
month: o,
|
|
141
|
-
day: 1
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function _(t, e, n, r = 0) {
|
|
147
|
-
const o = w[e];
|
|
148
|
-
if (o !== void 0) {
|
|
149
|
-
const u = g(t, n.tz), L = u.millisecond + (e === "second" ? 0 : u.second * 1e3) + (e === "hour" ? u.minute * 6e4 : 0), C = t.getTime() - L + r * o;
|
|
150
|
-
return { start: new Date(C), endExclusive: new Date(C + o) };
|
|
151
|
-
}
|
|
152
|
-
const a = e, i = f(
|
|
153
|
-
Y(g(t, n.tz), a, n),
|
|
154
|
-
r,
|
|
155
|
-
e
|
|
156
|
-
);
|
|
157
|
-
return {
|
|
158
|
-
start: d(i, n.tz),
|
|
159
|
-
endExclusive: d(f(i, 1, e), n.tz)
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
function ct(t, e, n) {
|
|
163
|
-
return _(t, e, n).start;
|
|
164
|
-
}
|
|
165
|
-
function dt(t, e, n) {
|
|
166
|
-
return new Date(_(t, e, n).endExclusive.getTime() - 1);
|
|
167
|
-
}
|
|
168
|
-
function ft(t, e, n, r) {
|
|
169
|
-
return e === 0 ? t : d(
|
|
170
|
-
f(g(t, r.tz), e, n),
|
|
171
|
-
r.tz
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
function lt(t, e, n) {
|
|
175
|
-
const r = (o) => {
|
|
176
|
-
const { year: a, month: i, day: u } = y(o, n);
|
|
177
|
-
return s({ year: a, month: i, day: u, hour: 0, minute: 0, second: 0 });
|
|
178
|
-
};
|
|
179
|
-
return Math.round((r(e) - r(t)) / D);
|
|
180
|
-
}
|
|
181
|
-
const B = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
182
|
-
function mt(t, e) {
|
|
183
|
-
const { year: n, month: r, day: o } = y(t, e);
|
|
184
|
-
return `${String(n).padStart(4, "0")}-${String(r).padStart(2, "0")}-${String(o).padStart(2, "0")}`;
|
|
185
|
-
}
|
|
186
|
-
function q(t) {
|
|
187
|
-
const e = B.exec(t);
|
|
188
|
-
if (!e) return null;
|
|
189
|
-
const n = Number(e[1]), r = Number(e[2]), o = Number(e[3]);
|
|
190
|
-
return r < 1 || r > 12 || o < 1 || o > S(n, r) ? null : { year: n, month: r, day: o };
|
|
191
|
-
}
|
|
192
|
-
function ht(t, e) {
|
|
193
|
-
const n = q(t);
|
|
194
|
-
if (!n) return null;
|
|
195
|
-
const r = { ...n, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
196
|
-
return {
|
|
197
|
-
start: d(r, e),
|
|
198
|
-
endExclusive: d(f(r, 1, "day"), e)
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
const yt = {
|
|
202
|
-
direction: "last",
|
|
203
|
-
count: 7,
|
|
204
|
-
unit: "day",
|
|
205
|
-
includeCurrent: !0,
|
|
206
|
-
toDate: !1
|
|
207
|
-
}, V = /* @__PURE__ */ new Set(["minute", "hour"]), T = (t) => V.has(t);
|
|
208
|
-
function z(t) {
|
|
209
|
-
const { direction: e, unit: n } = t;
|
|
210
|
-
return T(n) ? { direction: "last", count: t.count, unit: n, includeCurrent: !0, toDate: !1 } : e === "this" || t.count === 1 && t.includeCurrent ? { direction: "this", count: 1, unit: n, includeCurrent: !0, toDate: e === "this" && t.toDate } : { direction: e, count: t.count, unit: n, includeCurrent: t.includeCurrent, toDate: !1 };
|
|
211
|
-
}
|
|
212
|
-
function H(t) {
|
|
213
|
-
const { direction: e, count: n, unit: r } = t;
|
|
214
|
-
if (T(r) && e !== "last") return `Only the last ${r}s can be picked.`;
|
|
215
|
-
if (e === "this") return;
|
|
216
|
-
if (!Number.isInteger(n) || n < 1) return "Enter a whole number, 1 or more.";
|
|
217
|
-
const o = E[r];
|
|
218
|
-
if (n > o) return `At most ${o.toLocaleString("en-US")} ${r}s (ten years).`;
|
|
219
|
-
}
|
|
220
|
-
function Tt(t) {
|
|
221
|
-
if (H(t)) return;
|
|
222
|
-
const e = z(t);
|
|
223
|
-
if (T(e.unit)) return { kind: "rolling", unit: e.unit, n: e.count, anchor: "now" };
|
|
224
|
-
const n = e.unit;
|
|
225
|
-
if (e.direction === "this") return { kind: "periods", unit: n, from: 0, to: 0, ...e.toDate ? { toDate: !0 } : {}, anchor: "now" };
|
|
226
|
-
const [r, o] = e.direction === "last" ? e.includeCurrent ? [-(e.count - 1), 0] : [-e.count, -1] : e.includeCurrent ? [0, e.count - 1] : [1, e.count];
|
|
227
|
-
return { kind: "periods", unit: n, from: r, to: o, anchor: "now" };
|
|
228
|
-
}
|
|
229
|
-
function pt(t) {
|
|
230
|
-
if (t.kind === "rolling")
|
|
231
|
-
return t.anchor === "now" && T(t.unit) ? { direction: "last", count: t.n, unit: t.unit, includeCurrent: !0, toDate: !1 } : void 0;
|
|
232
|
-
if (t.kind !== "periods" || t.anchor !== "now") return;
|
|
233
|
-
const { unit: e, from: n, to: r } = t, o = (a, i, u) => ({
|
|
234
|
-
direction: a,
|
|
235
|
-
count: i,
|
|
236
|
-
unit: e,
|
|
237
|
-
includeCurrent: u,
|
|
238
|
-
toDate: !1
|
|
239
|
-
});
|
|
240
|
-
if (n === 0 && r === 0) return { ...o("this", 1, !0), toDate: !!t.toDate };
|
|
241
|
-
if (!t.toDate) {
|
|
242
|
-
if (r === 0 && n < 0) return o("last", 1 - n, !0);
|
|
243
|
-
if (r === -1 && n <= -1) return o("last", -n, !1);
|
|
244
|
-
if (n === 0 && r > 0) return o("next", r + 1, !0);
|
|
245
|
-
if (n === 1 && r >= 1) return o("next", r, !1);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
const vt = {
|
|
249
|
-
side: "before",
|
|
250
|
-
point: { kind: "ago", count: 30, unit: "day" },
|
|
251
|
-
inclusive: !1
|
|
252
|
-
};
|
|
253
|
-
function Z(t) {
|
|
254
|
-
const { point: e } = t;
|
|
255
|
-
if (e.kind === "now" || e.kind === "current") return;
|
|
256
|
-
if (!Number.isInteger(e.count) || e.count < 1) return "Enter a whole number, 1 or more.";
|
|
257
|
-
const n = E[e.unit];
|
|
258
|
-
if (e.count > n) return `At most ${n.toLocaleString("en-US")} ${e.unit}s (ten years).`;
|
|
259
|
-
}
|
|
260
|
-
function R(t) {
|
|
261
|
-
if (t === "<" || t === "<=") return { side: "before", inclusive: t === "<=" };
|
|
262
|
-
if (t === ">" || t === ">=") return { side: "after", inclusive: t === ">=" };
|
|
263
|
-
}
|
|
264
|
-
const h = (t, e) => t === "before" ? e ? "<=" : "<" : e ? ">=" : ">";
|
|
265
|
-
function Dt(t) {
|
|
266
|
-
if (Z(t)) return;
|
|
267
|
-
const { side: e, point: n, inclusive: r } = t;
|
|
268
|
-
if (n.kind === "now")
|
|
269
|
-
return {
|
|
270
|
-
operator: h(e, e === "before"),
|
|
271
|
-
window: { kind: "periods", unit: "day", from: 0, to: 0, toDate: !0, anchor: "now" }
|
|
272
|
-
};
|
|
273
|
-
const o = n.kind === "current" ? 0 : n.kind === "ago" ? -n.count : n.count;
|
|
274
|
-
return {
|
|
275
|
-
operator: h(e, r),
|
|
276
|
-
window: { kind: "periods", unit: n.unit, from: o, to: o, anchor: "now" }
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
function G(t, e) {
|
|
280
|
-
var i;
|
|
281
|
-
const n = (i = R(t)) == null ? void 0 : i.side;
|
|
282
|
-
if (!n || e.kind !== "periods" || e.anchor !== "now" || e.from !== e.to) return;
|
|
283
|
-
const { unit: r, from: o } = e;
|
|
284
|
-
if (e.toDate)
|
|
285
|
-
return r === "day" && o === 0 && t === h(n, n === "before") ? { side: n, point: { kind: "now" }, inclusive: !1 } : void 0;
|
|
286
|
-
const a = o === 0 ? { kind: "current", unit: r } : { kind: o < 0 ? "ago" : "ahead", count: Math.abs(o), unit: r };
|
|
287
|
-
return { side: n, point: a, inclusive: t === "<=" || t === ">=" };
|
|
288
|
-
}
|
|
289
|
-
function J(t) {
|
|
290
|
-
if (t.kind === "now") return "now";
|
|
291
|
-
const { unit: e } = t;
|
|
292
|
-
if (t.kind === "current") return e === "day" ? "today" : `this ${e}`;
|
|
293
|
-
const { count: n } = t;
|
|
294
|
-
return e === "day" && n === 1 ? t.kind === "ago" ? "yesterday" : "tomorrow" : `${n} ${n === 1 ? e : `${e}s`} ${t.kind === "ago" ? "ago" : "from now"}`;
|
|
295
|
-
}
|
|
296
|
-
const X = {
|
|
297
|
-
"<": "Before",
|
|
298
|
-
"<=": "On or before",
|
|
299
|
-
">": "After",
|
|
300
|
-
">=": "On or after"
|
|
301
|
-
};
|
|
302
|
-
function N(t) {
|
|
303
|
-
return X[t];
|
|
304
|
-
}
|
|
305
|
-
function Q(t) {
|
|
306
|
-
const e = t.point.kind === "now" ? t.side === "before" ? "<" : ">" : h(t.side, t.inclusive);
|
|
307
|
-
return `${N(e)} ${J(t.point)}`;
|
|
308
|
-
}
|
|
309
|
-
function gt(t, e) {
|
|
310
|
-
if (!R(t)) return;
|
|
311
|
-
const r = G(t, e);
|
|
312
|
-
if (r) return Q(r);
|
|
313
|
-
const o = U(e).label;
|
|
314
|
-
return `${N(t)} the ${W(t)} of ${o.charAt(0).toLowerCase()}${o.slice(1)}`;
|
|
315
|
-
}
|
|
316
|
-
class c extends Error {
|
|
317
|
-
constructor(n) {
|
|
318
|
-
super(n);
|
|
319
|
-
b(this, "code");
|
|
320
|
-
this.name = "RawTemporalMetadataContractError", this.code = x.invalidMetadata;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function tt(t) {
|
|
324
|
-
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
325
|
-
return !1;
|
|
326
|
-
const e = Object.getPrototypeOf(t);
|
|
327
|
-
return e === null || e === Object.prototype;
|
|
328
|
-
}
|
|
329
|
-
function et(t) {
|
|
330
|
-
if (!tt(t))
|
|
331
|
-
throw new c(
|
|
332
|
-
"Raw temporal metadata must be an object."
|
|
333
|
-
);
|
|
334
|
-
const e = Object.keys(t);
|
|
335
|
-
if (e.length !== 2 || !e.includes("kind") || !e.includes("valueKind"))
|
|
336
|
-
throw new c(
|
|
337
|
-
"Raw temporal metadata must contain only kind and valueKind."
|
|
338
|
-
);
|
|
339
|
-
if (t.kind !== "raw_temporal")
|
|
340
|
-
throw new c(
|
|
341
|
-
"Raw temporal metadata kind must be raw_temporal."
|
|
342
|
-
);
|
|
343
|
-
if (t.valueKind !== "date" && t.valueKind !== "wall_datetime" && t.valueKind !== "instant")
|
|
344
|
-
throw new c(
|
|
345
|
-
"Raw temporal valueKind must be date, wall_datetime, or instant."
|
|
346
|
-
);
|
|
347
|
-
return {
|
|
348
|
-
kind: "raw_temporal",
|
|
349
|
-
valueKind: t.valueKind
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
function Ct(t, e) {
|
|
353
|
-
if (!t.rawTemporal) {
|
|
354
|
-
if (e.metadataRequired)
|
|
355
|
-
throw new c(
|
|
356
|
-
"Activated raw temporal result is missing metadata."
|
|
357
|
-
);
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
if (t.temporalBucket)
|
|
361
|
-
throw new c(
|
|
362
|
-
"A result column cannot carry both raw and grouped temporal metadata."
|
|
363
|
-
);
|
|
364
|
-
const n = et(t.rawTemporal), r = n.valueKind === "date" ? "date" : "datetime";
|
|
365
|
-
if (t.dataType !== r)
|
|
366
|
-
throw new c(
|
|
367
|
-
`${n.valueKind} raw temporal values require dataType ${r}.`
|
|
368
|
-
);
|
|
369
|
-
return n;
|
|
370
|
-
}
|
|
371
|
-
const M = /^(\d{4})-(\d{2})-(\d{2})$/, $ = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?$/, I = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
372
|
-
function bt(t) {
|
|
373
|
-
if (M.test(t)) return "date";
|
|
374
|
-
if (I.test(t)) return "instant";
|
|
375
|
-
if ($.test(t)) return "wall_datetime";
|
|
376
|
-
}
|
|
377
|
-
function nt(t) {
|
|
378
|
-
return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
|
|
379
|
-
}
|
|
380
|
-
function rt(t, e) {
|
|
381
|
-
return e === 2 ? nt(t) ? 29 : 28 : [4, 6, 9, 11].includes(e) ? 30 : 31;
|
|
382
|
-
}
|
|
383
|
-
function ot(t) {
|
|
384
|
-
return t.year >= 1 && t.year <= 9999 && t.month >= 1 && t.month <= 12 && t.day >= 1 && t.day <= rt(t.year, t.month) && t.hour >= 0 && t.hour <= 23 && t.minute >= 0 && t.minute <= 59 && t.second >= 0 && t.second <= 59;
|
|
385
|
-
}
|
|
386
|
-
function at(t) {
|
|
387
|
-
return {
|
|
388
|
-
year: Number(t[1]),
|
|
389
|
-
month: Number(t[2]),
|
|
390
|
-
day: Number(t[3]),
|
|
391
|
-
hour: Number(t[4] ?? 0),
|
|
392
|
-
minute: Number(t[5] ?? 0),
|
|
393
|
-
second: Number(t[6] ?? 0),
|
|
394
|
-
fraction: t[7] ?? ""
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
function kt(t, e) {
|
|
398
|
-
const n = e === "date" ? t.match(M) : e === "wall_datetime" ? t.match($) : t.match(I);
|
|
399
|
-
if (!n) return { status: "invalid_shape" };
|
|
400
|
-
const r = at(n);
|
|
401
|
-
if (!ot(r)) return { status: "out_of_range" };
|
|
402
|
-
if (e === "instant") {
|
|
403
|
-
const o = n[8];
|
|
404
|
-
if (o && o !== "Z") {
|
|
405
|
-
const [i, u] = o.slice(1).split(":").map(Number);
|
|
406
|
-
if (i > 23 || u > 59) return { status: "out_of_range" };
|
|
407
|
-
}
|
|
408
|
-
const a = new Date(t.replace(" ", "T"));
|
|
409
|
-
return Number.isNaN(a.getTime()) ? { status: "out_of_range" } : { status: "valid", fields: r, instant: a };
|
|
410
|
-
}
|
|
411
|
-
return { status: "valid", fields: r };
|
|
412
|
-
}
|
|
413
|
-
export {
|
|
414
|
-
S as A,
|
|
415
|
-
j as B,
|
|
416
|
-
Y as C,
|
|
417
|
-
vt as D,
|
|
418
|
-
w as E,
|
|
419
|
-
_ as F,
|
|
420
|
-
ct as G,
|
|
421
|
-
dt as H,
|
|
422
|
-
ft as I,
|
|
423
|
-
lt as J,
|
|
424
|
-
mt as K,
|
|
425
|
-
q as L,
|
|
426
|
-
ht as M,
|
|
427
|
-
c as R,
|
|
428
|
-
kt as a,
|
|
429
|
-
Dt as b,
|
|
430
|
-
bt as c,
|
|
431
|
-
gt as d,
|
|
432
|
-
Z as e,
|
|
433
|
-
N as f,
|
|
434
|
-
h as g,
|
|
435
|
-
R as h,
|
|
436
|
-
d as i,
|
|
437
|
-
Q as j,
|
|
438
|
-
J as k,
|
|
439
|
-
yt as l,
|
|
440
|
-
H as m,
|
|
441
|
-
T as n,
|
|
442
|
-
z as o,
|
|
443
|
-
et as p,
|
|
444
|
-
pt as q,
|
|
445
|
-
G as r,
|
|
446
|
-
f as s,
|
|
447
|
-
Tt as t,
|
|
448
|
-
y as u,
|
|
449
|
-
Ct as v,
|
|
450
|
-
g as w,
|
|
451
|
-
s as x,
|
|
452
|
-
K as y,
|
|
453
|
-
F as z
|
|
454
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
const m = 1280, r = {
|
|
2
|
-
minCssWidth: 320,
|
|
3
|
-
minCssHeight: 120,
|
|
4
|
-
maxCardCssWidth: 4096,
|
|
5
|
-
maxCardCssHeight: 4096,
|
|
6
|
-
maxSheetCssWidth: 4096,
|
|
7
|
-
/** Chromium's largest capture in device pixels, either side. */
|
|
8
|
-
maxDevicePixels: 16384
|
|
9
|
-
}, f = 1024, n = { fit: "imageFit", width: "imageWidth", height: "imageHeight" };
|
|
10
|
-
function c(t, e) {
|
|
11
|
-
if (t instanceof URLSearchParams) return t.get(e) ?? void 0;
|
|
12
|
-
const i = t[e];
|
|
13
|
-
return typeof i == "string" ? i : void 0;
|
|
14
|
-
}
|
|
15
|
-
function u(t) {
|
|
16
|
-
if (!(t === void 0 || !/^\d{1,6}$/.test(t.trim())))
|
|
17
|
-
return Number(t.trim());
|
|
18
|
-
}
|
|
19
|
-
function o(t, e, i) {
|
|
20
|
-
return Math.min(Math.max(t, e), i);
|
|
21
|
-
}
|
|
22
|
-
function g(t) {
|
|
23
|
-
const { minCssWidth: e, minCssHeight: i, maxCardCssWidth: s, maxCardCssHeight: a } = r;
|
|
24
|
-
return {
|
|
25
|
-
cssWidth: o(Math.round(t.cssWidth), e, s),
|
|
26
|
-
cssHeight: o(Math.round(t.cssHeight), i, a)
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function l(t) {
|
|
30
|
-
return o(Math.round(t), r.minCssWidth, r.maxSheetCssWidth);
|
|
31
|
-
}
|
|
32
|
-
function p(t) {
|
|
33
|
-
const e = c(t, n.fit), i = u(c(t, n.width)), s = c(t, n.height), a = u(s);
|
|
34
|
-
if (i === void 0) return null;
|
|
35
|
-
switch (e) {
|
|
36
|
-
case "card":
|
|
37
|
-
return a === void 0 ? null : { fit: "card", ...g({ cssWidth: i, cssHeight: a }) };
|
|
38
|
-
case "layout":
|
|
39
|
-
return s !== void 0 ? null : { fit: "layout", dashboardWidth: l(i) };
|
|
40
|
-
case "sheet":
|
|
41
|
-
return s !== void 0 ? null : { fit: "sheet", cssWidth: l(i) };
|
|
42
|
-
default:
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function W(t, e) {
|
|
47
|
-
switch (e.set(n.fit, t.fit), e.delete(n.height), t.fit) {
|
|
48
|
-
case "card":
|
|
49
|
-
e.set(n.width, String(t.cssWidth)), e.set(n.height, String(t.cssHeight));
|
|
50
|
-
return;
|
|
51
|
-
case "layout":
|
|
52
|
-
e.set(n.width, String(t.dashboardWidth));
|
|
53
|
-
return;
|
|
54
|
-
case "sheet":
|
|
55
|
-
e.set(n.width, String(t.cssWidth));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function d(t, e) {
|
|
59
|
-
const i = r.maxDevicePixels;
|
|
60
|
-
return t * 2 <= i && e * 2 <= i ? { status: "ready", viewport: { width: t, height: e, deviceScaleFactor: 2 } } : t <= i && e <= i ? { status: "ready", viewport: { width: t, height: e, deviceScaleFactor: 1 } } : { status: "too_large", cssWidth: t, cssHeight: e };
|
|
61
|
-
}
|
|
62
|
-
function x(t, e) {
|
|
63
|
-
switch (t.fit) {
|
|
64
|
-
case "card":
|
|
65
|
-
return d(t.cssWidth, t.cssHeight);
|
|
66
|
-
case "layout":
|
|
67
|
-
return d(t.dashboardWidth, f);
|
|
68
|
-
case "sheet": {
|
|
69
|
-
if (e === void 0 || !Number.isFinite(e))
|
|
70
|
-
throw new Error("A sheet image needs the measured sheet height.");
|
|
71
|
-
const i = Math.max(Math.ceil(e), r.minCssHeight);
|
|
72
|
-
return d(t.cssWidth, i);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
const I = ["pdf", "png", "zip"], h = {
|
|
77
|
-
pdf: Object.freeze({ kind: "pdf", extension: "pdf", contentType: "application/pdf", label: "PDF" }),
|
|
78
|
-
png: Object.freeze({ kind: "png", extension: "png", contentType: "image/png", label: "PNG image" }),
|
|
79
|
-
zip: Object.freeze({
|
|
80
|
-
kind: "zip",
|
|
81
|
-
extension: "zip",
|
|
82
|
-
contentType: "application/zip",
|
|
83
|
-
label: "PNG images (zip)"
|
|
84
|
-
})
|
|
85
|
-
};
|
|
86
|
-
function S(t) {
|
|
87
|
-
return { ...h[t] };
|
|
88
|
-
}
|
|
89
|
-
function C(t) {
|
|
90
|
-
var i;
|
|
91
|
-
return `${(i = t.title) != null && i.trim() ? t.title : "Report"}-${t.at.toISOString()}.${h[t.kind].extension}`;
|
|
92
|
-
}
|
|
93
|
-
function H(t) {
|
|
94
|
-
const e = (t.title ?? "").replace(/[\\/:*?"<>|\u0000-\u001f]+/g, "_").replace(/\s+/g, " ").trim().slice(0, 120) || "Sheet";
|
|
95
|
-
return `${String(t.position).padStart(2, "0")} ${e}.${h.png.extension}`;
|
|
96
|
-
}
|
|
97
|
-
export {
|
|
98
|
-
m as E,
|
|
99
|
-
r as I,
|
|
100
|
-
I as R,
|
|
101
|
-
x as a,
|
|
102
|
-
C as b,
|
|
103
|
-
g as c,
|
|
104
|
-
p,
|
|
105
|
-
S as r,
|
|
106
|
-
H as s,
|
|
107
|
-
W as w
|
|
108
|
-
};
|