react-semaphor 0.1.526 → 0.1.528

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.
Files changed (180) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1190 -296
  3. package/dist/brand-studio/index.js +15 -15
  4. package/dist/briefings/index.js +50 -49
  5. package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DUu-tCQw.js} +66 -65
  6. package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BdPceiw8.js} +68 -65
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-BkskKMck.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-Bb0RhGRC.js} +372 -359
  10. package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-loWTHPMi.js} +739 -686
  11. package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DUci_SOR.js} +10 -10
  12. package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-z9WN26w7.js} +6603 -6572
  13. package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-CGSFK9S-.js} +266 -267
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-CdXSo1pb.js} +19 -19
  15. package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
  16. package/dist/chunks/{index-CbjuruKe.js → index-CTYnXU85.js} +781 -780
  17. package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
  18. package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DhykwdZs.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BV9ywFtJ.js} +11 -11
  20. package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
  21. package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-1Mm8x8w7.js} +655 -511
  22. package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
  23. package/dist/chunks/matrix-operation-contract-Dp7kFpVk.js +1383 -0
  24. package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
  25. package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
  26. package/dist/chunks/pivot-header-presentation-CZa3556D.js +618 -0
  27. package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-Bqdtknud.js} +259 -204
  29. package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
  30. package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
  31. package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
  32. package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-VV0-Ro6F.js} +131 -132
  33. package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
  34. package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-IZjBSU6Z.js} +47 -26
  35. package/dist/chunks/semantic-format-BBLvfwua.js +192 -0
  36. package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-DbA4mVQL.js} +49909 -46207
  37. package/dist/chunks/{slider-BYIH4icg.js → slider-DpiJG8lv.js} +81 -82
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/switch-C4YH-W1X.js +24003 -0
  40. package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
  41. package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
  42. package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
  43. package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
  44. package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
  45. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  46. package/dist/dashboard/index.js +1 -1
  47. package/dist/dashboard-authoring/index.js +138 -137
  48. package/dist/data-app-sdk/index.js +12 -12
  49. package/dist/data-app-sdk-adapters/index.js +23 -22
  50. package/dist/data-app-sdk-validation/index.js +27 -26
  51. package/dist/format-utils/index.js +247 -329
  52. package/dist/index.js +165 -168
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +1 -1
  56. package/dist/types/briefings/index.d.ts +3 -0
  57. package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
  58. package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
  59. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  60. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
  61. package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
  62. package/dist/types/components/surfboard/filter/types.d.ts +8 -29
  63. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
  64. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
  65. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
  66. package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
  67. package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
  68. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  69. package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
  70. package/dist/types/index.js +5 -5
  71. package/dist/types/lib/api/exports-api.d.ts +3 -0
  72. package/dist/types/lib/csv-download.d.ts +9 -0
  73. package/dist/types/lib/csv-encoding-options.d.ts +6 -0
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
  75. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
  76. package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
  77. package/dist/types/lib/export-utils.d.ts +17 -15
  78. package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
  79. package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
  80. package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
  81. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
  83. package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
  84. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
  85. package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
  86. package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
  87. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
  88. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
  89. package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
  90. package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
  91. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  92. package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
  93. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
  94. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
  95. package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
  96. package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
  97. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
  98. package/dist/types/lib/types/common-types.d.ts +5 -0
  99. package/dist/types/lib/types/explorer-types.d.ts +14 -0
  100. package/dist/types/lib/types/semantic-types.d.ts +4 -2
  101. package/dist/types/lib/types/token-types.d.ts +0 -1
  102. package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
  103. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  104. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  105. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  106. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  107. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  108. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +89 -0
  109. package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
  110. package/dist/types/shared/analytics-protocol/contracts.d.ts +48 -7
  111. package/dist/types/shared/analytics-protocol/index.d.ts +15 -1
  112. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  113. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  114. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  115. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +61 -6
  116. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
  117. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  118. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  119. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  120. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  121. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  124. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  125. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  126. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  127. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  128. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  129. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  130. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  131. package/dist/types/shared/temporal/index.d.ts +5 -0
  132. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  133. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  134. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  135. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  136. package/package.json +1 -17
  137. package/src/data-app-sdk/README.md +6 -3
  138. package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
  139. package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
  140. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  141. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  142. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  143. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  144. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  145. package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
  146. package/dist/chunks/search-CJz-QQ0Q.js +0 -24
  147. package/dist/chunks/switch-XaAACBrJ.js +0 -2234
  148. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  149. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  150. package/dist/data-app-builder/index.js +0 -3666
  151. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  152. package/dist/data-app-codegen/index.js +0 -22
  153. package/dist/data-app-codegen-node/index.js +0 -1807
  154. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  155. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  156. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  157. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  158. package/dist/types/data-app-builder/constants.d.ts +0 -14
  159. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  160. package/dist/types/data-app-builder/index.d.ts +0 -1
  161. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  162. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  163. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  164. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  165. package/dist/types/data-app-builder/types.d.ts +0 -558
  166. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  167. package/dist/types/data-app-builder.d.ts +0 -2
  168. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  169. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  170. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  171. package/dist/types/data-app-codegen/index.d.ts +0 -6
  172. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  173. package/dist/types/data-app-codegen/node.d.ts +0 -2
  174. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  175. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  176. package/dist/types/data-app-codegen-node.d.ts +0 -2
  177. package/dist/types/data-app-codegen.d.ts +0 -2
  178. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  179. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  180. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -1,222 +0,0 @@
1
- import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as D } from "../value-format-preferences/index.js";
2
- import { v as w, f as T, r as E, a as I } from "./raw-temporal-7bFbXd2a.js";
3
- import { i as R, f as A, r as U } from "./temporal-bucket-PcLFSYWX.js";
4
- const b = /* @__PURE__ */ new Set(["short", "medium", "long"]), z = /^(\d{4})-(\d{2})-(\d{2})$/, F = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, L = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, h = " – ";
5
- function Q(t) {
6
- if (!R(t)) return;
7
- const e = Object.keys(t);
8
- if (t.mode === "period_label" && e.length === 1)
9
- return { mode: "period_label" };
10
- if (t.mode === "style" && e.length === 2 && typeof t.dateStyle == "string" && b.has(t.dateStyle))
11
- return { mode: "style", dateStyle: t.dateStyle };
12
- if (t.mode === "pattern" && e.length === 3 && t.dialect === "semaphor_tokens" && typeof t.pattern == "string" && N(t.pattern) === null)
13
- return {
14
- mode: "pattern",
15
- dialect: "semaphor_tokens",
16
- pattern: t.pattern
17
- };
18
- }
19
- function N(t) {
20
- try {
21
- return w({ dialect: "semaphor_tokens", pattern: t }), null;
22
- } catch (e) {
23
- return e instanceof Error ? e.message : "The pattern is invalid.";
24
- }
25
- }
26
- function X(t) {
27
- const { value: e, part: n, presentation: r, preferences: a, calendar: o } = t;
28
- if ((r == null ? void 0 : r.mode) === "period_label" && e.periodLabel && n === "range")
29
- return { ok: !0, text: e.periodLabel };
30
- const [l, m] = e.bounds, s = m === void 0 || n === "start" ? [{ raw: l, role: "start" }] : n === "end" ? [{ raw: m, role: "end" }] : [
31
- { raw: l, role: "start" },
32
- { raw: m, role: "end" }
33
- ], c = s.map(({ raw: i }) => M(i, o.tz));
34
- if (c.some((i) => i === null))
35
- return {
36
- ok: !1,
37
- text: s.map(({ raw: i }) => i).join(h),
38
- diagnostic: {
39
- code: "invalid_temporal_input_value",
40
- message: "A date input bound is not a date or an instant."
41
- }
42
- };
43
- const f = e.precision === "day" ? c.map(
44
- (i, C) => Z(i, s[C].role, o.tz)
45
- ) : [], g = f.length > 0 && f.every((i) => i !== null) ? f : null;
46
- return { ok: !0, text: g ? $(g, r, a, o) : P(
47
- c.map((i) => V(i, o.tz)),
48
- r,
49
- a,
50
- o
51
- ) };
52
- }
53
- function $(t, e, n, r) {
54
- const [a, o = a] = t;
55
- if ((e == null ? void 0 : e.mode) === "pattern")
56
- return v(
57
- t.map(
58
- (d) => p(y(d), "date", e.pattern, n, r)
59
- )
60
- );
61
- const l = (e == null ? void 0 : e.mode) === "style" ? e.dateStyle : n.dateStyle;
62
- if (!e || e.mode === "period_label") {
63
- const d = x(a, o, r);
64
- if (d)
65
- return A({
66
- value: y(a),
67
- metadata: {
68
- kind: "temporal_bucket",
69
- granularity: d,
70
- calendar: { tz: r.tz, weekStart: r.weekStart ?? 1 }
71
- },
72
- format: U({
73
- metadata: {
74
- kind: "temporal_bucket",
75
- granularity: d,
76
- calendar: { tz: r.tz, weekStart: r.weekStart ?? 1 }
77
- },
78
- locale: n.locale,
79
- styles: { dateStyle: l, dateTime: { ...n.dateTime } }
80
- }).format
81
- });
82
- }
83
- const m = new Intl.DateTimeFormat(n.locale, {
84
- calendar: "gregory",
85
- timeZone: "UTC",
86
- dateStyle: l
87
- });
88
- return H(a, o) ? m.format(u(a)) : k(m, u(a), u(o));
89
- }
90
- function P(t, e, n, r) {
91
- if ((e == null ? void 0 : e.mode) === "pattern")
92
- return v(
93
- t.map(
94
- (m) => p(
95
- m.toISOString(),
96
- "instant",
97
- e.pattern,
98
- n,
99
- r
100
- )
101
- )
102
- );
103
- const a = new Intl.DateTimeFormat(n.locale, {
104
- calendar: "gregory",
105
- timeZone: r.tz,
106
- dateStyle: (e == null ? void 0 : e.mode) === "style" ? e.dateStyle : n.dateTime.dateStyle,
107
- timeStyle: n.dateTime.timeStyle
108
- }), [o, l] = t;
109
- return l && l.getTime() !== o.getTime() ? k(a, o, l) : a.format(o);
110
- }
111
- function k(t, e, n) {
112
- const r = t;
113
- return typeof r.formatRange == "function" ? r.formatRange(e, n) : `${t.format(e)}${h}${t.format(n)}`;
114
- }
115
- function p(t, e, n, r, a) {
116
- const o = E({
117
- format: {
118
- type: "raw_temporal",
119
- presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: n }
120
- },
121
- // Temporal formatting reads no currency.
122
- preferences: {
123
- ...r,
124
- defaultCurrency: D.defaultCurrency
125
- },
126
- calendar: { tz: a.tz }
127
- }), l = e === "date" && O(n) ? "instant" : e;
128
- return I({
129
- value: l === e ? t : T(`${t}T00:00:00`, a.tz).toISOString(),
130
- metadata: { kind: "raw_temporal", valueKind: l },
131
- format: o
132
- }).text;
133
- }
134
- function O(t) {
135
- return /HH|mm|ss/.test(t);
136
- }
137
- function v(t) {
138
- return t[1] === void 0 || t[0] === t[1] ? t[0] : t.join(h);
139
- }
140
- function M(t, e) {
141
- const n = z.exec(t);
142
- if (n) {
143
- const a = {
144
- year: Number(n[1]),
145
- month: Number(n[2]),
146
- day: Number(n[3])
147
- };
148
- return Y(a) ? { kind: "date", date: a } : null;
149
- }
150
- const r = L.test(t) ? new Date(t.replace(" ", "T")) : F.test(t) ? T(t.replace(" ", "T"), e) : null;
151
- return r && !Number.isNaN(r.getTime()) ? { kind: "instant", instant: r } : null;
152
- }
153
- function V(t, e) {
154
- return t.kind === "instant" ? t.instant : T(`${y(t.date)}T00:00:00`, e);
155
- }
156
- function Z(t, e, n) {
157
- if (t.kind === "date") return t.date;
158
- const r = j(t.instant, n), a = { year: r.year, month: r.month, day: r.day };
159
- if (r.hour === 0 && r.minute === 0 && r.second === 0 && t.instant.getUTCMilliseconds() === 0) return e === "start" ? a : B(a, -1);
160
- const l = r.hour === 23 && r.minute === 59 && r.second === 59;
161
- return e === "end" && l ? a : null;
162
- }
163
- const S = /* @__PURE__ */ new Map();
164
- function j(t, e) {
165
- let n = S.get(e);
166
- n || (n = new Intl.DateTimeFormat("en-CA", {
167
- calendar: "gregory",
168
- numberingSystem: "latn",
169
- timeZone: e,
170
- year: "numeric",
171
- month: "2-digit",
172
- day: "2-digit",
173
- hour: "2-digit",
174
- minute: "2-digit",
175
- second: "2-digit",
176
- hourCycle: "h23"
177
- }), S.set(e, n));
178
- const r = n.formatToParts(t), a = (o) => {
179
- var l;
180
- return Number((l = r.find((m) => m.type === o)) == null ? void 0 : l.value);
181
- };
182
- return {
183
- year: a("year"),
184
- month: a("month"),
185
- day: a("day"),
186
- hour: a("hour"),
187
- minute: a("minute"),
188
- second: a("second")
189
- };
190
- }
191
- function x(t, e, n) {
192
- return n.fiscalCalendar || t.day !== 1 || t.year !== e.year || e.day !== _(e.year, e.month) ? null : t.month === e.month ? "month" : t.month % 3 === 1 && e.month === t.month + 2 ? "quarter" : t.month === 1 && e.month === 12 ? "year" : null;
193
- }
194
- function y(t) {
195
- return `${String(t.year).padStart(4, "0")}-${String(t.month).padStart(2, "0")}-${String(t.day).padStart(2, "0")}`;
196
- }
197
- function u(t) {
198
- const e = /* @__PURE__ */ new Date(0);
199
- return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(0, 0, 0, 0), e;
200
- }
201
- function B(t, e) {
202
- const n = u(t);
203
- return n.setUTCDate(n.getUTCDate() + e), {
204
- year: n.getUTCFullYear(),
205
- month: n.getUTCMonth() + 1,
206
- day: n.getUTCDate()
207
- };
208
- }
209
- function H(t, e) {
210
- return t.year === e.year && t.month === e.month && t.day === e.day;
211
- }
212
- function _(t, e) {
213
- return new Date(Date.UTC(t, e, 0)).getUTCDate();
214
- }
215
- function Y(t) {
216
- return t.year >= 1 && t.month >= 1 && t.month <= 12 && t.day >= 1 && t.day <= _(t.year, t.month);
217
- }
218
- export {
219
- X as f,
220
- Q as p,
221
- N as v
222
- };