@belonguniverseai/react-sdk 0.1.6 → 0.1.7

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 (96) hide show
  1. package/dist/api/agent-grants.d.ts +18 -23
  2. package/dist/api/client.d.ts +1049 -30
  3. package/dist/api/query-keys.d.ts +5 -0
  4. package/dist/api/task-schedules.d.ts +313 -0
  5. package/dist/app/dock-outlet.d.ts +18 -0
  6. package/dist/component/{arc-CTDwT0LX.js → arc-D26RO7cK.js} +2 -2
  7. package/dist/component/{architectureDiagram-3BPJPVTR-osyB2zKw.js → architectureDiagram-3BPJPVTR-uiXhyHDF.js} +3 -3
  8. package/dist/component/{blockDiagram-GPEHLZMM-ChWpzkC_.js → blockDiagram-GPEHLZMM-Bm1HEObg.js} +4 -4
  9. package/dist/component/{c4Diagram-AAUBKEIU-TBt2Sr1T.js → c4Diagram-AAUBKEIU-BypAuFIJ.js} +3 -3
  10. package/dist/component/{channel-DKYVGzgk.js → channel-MvxNOfHS.js} +2 -2
  11. package/dist/component/{chunk-2J33WTMH-D-qMyfG9.js → chunk-2J33WTMH-MxAoh_Eu.js} +2 -2
  12. package/dist/component/{chunk-4BX2VUAB-BYTeOCro.js → chunk-4BX2VUAB-BHpzlyda.js} +2 -2
  13. package/dist/component/{chunk-55IACEB6-CkLaQSjG.js → chunk-55IACEB6-igXCAYDB.js} +2 -2
  14. package/dist/component/{chunk-727SXJPM-CzkWgEIS.js → chunk-727SXJPM-BPq4W66f.js} +6 -6
  15. package/dist/component/{chunk-AQP2D5EJ-d-zIc-67.js → chunk-AQP2D5EJ-Y9AksdXf.js} +4 -4
  16. package/dist/component/{chunk-FMBD7UC4-amGyEMTp.js → chunk-FMBD7UC4-DHrfutng.js} +2 -2
  17. package/dist/component/{chunk-ND2GUHAM-DjPCor9N.js → chunk-ND2GUHAM-Ch9c4OTL.js} +2 -2
  18. package/dist/component/{chunk-QZHKN3VN-B0LrqJFz.js → chunk-QZHKN3VN-DCe5OD8b.js} +2 -2
  19. package/dist/component/{classDiagram-4FO5ZUOK-BLW37dmc.js → classDiagram-4FO5ZUOK-wW5NdcaU.js} +3 -3
  20. package/dist/component/{classDiagram-v2-Q7XG4LA2-BLW37dmc.js → classDiagram-v2-Q7XG4LA2-wW5NdcaU.js} +3 -3
  21. package/dist/component/{cose-bilkent-S5V4N54A-BrAZZB3S.js → cose-bilkent-S5V4N54A-BkRr9q6q.js} +2 -2
  22. package/dist/component/{dagre-BM42HDAG-lt_pmFeQ.js → dagre-BM42HDAG-BaUecTLo.js} +2 -2
  23. package/dist/component/{diagram-2AECGRRQ-DfMdC1rS.js → diagram-2AECGRRQ-BaAo02me.js} +3 -3
  24. package/dist/component/{diagram-5GNKFQAL-CORXCu1y.js → diagram-5GNKFQAL-DKerYV9c.js} +4 -4
  25. package/dist/component/{diagram-KO2AKTUF-Dt8oiVky.js → diagram-KO2AKTUF-jeKVSHu1.js} +3 -3
  26. package/dist/component/{diagram-LMA3HP47-Bu-XSRd6.js → diagram-LMA3HP47-wsR18sOb.js} +3 -3
  27. package/dist/component/{diagram-OG6HWLK6-DiOgJz8h.js → diagram-OG6HWLK6-D6kALGxL.js} +4 -4
  28. package/dist/component/{erDiagram-TEJ5UH35-DSrXX--n.js → erDiagram-TEJ5UH35-CQb_EY79.js} +5 -5
  29. package/dist/component/{flowDiagram-I6XJVG4X-D1E_ZfMU.js → flowDiagram-I6XJVG4X-B52f9IhS.js} +7 -7
  30. package/dist/component/{ganttDiagram-6RSMTGT7-BzGCGwAi.js → ganttDiagram-6RSMTGT7-B6szKgV7.js} +3 -3
  31. package/dist/component/{gitGraphDiagram-PVQCEYII-C6qUOG7K.js → gitGraphDiagram-PVQCEYII-Cso6Oo6v.js} +4 -4
  32. package/dist/component/{highlighted-body-OFNGDK62-D1SvZ8C_.js → highlighted-body-OFNGDK62-CD0QHket.js} +2 -2
  33. package/dist/component/index-Dips44uG.js +2208 -0
  34. package/dist/component/index.js +2 -2
  35. package/dist/component/{infoDiagram-5YYISTIA-D0l96um1.js → infoDiagram-5YYISTIA-BGNkBFoP.js} +2 -2
  36. package/dist/component/{ishikawaDiagram-YF4QCWOH-BDHAOBaC.js → ishikawaDiagram-YF4QCWOH-CDk8KSNE.js} +2 -2
  37. package/dist/component/{journeyDiagram-JHISSGLW-BtN73bIc.js → journeyDiagram-JHISSGLW-lPfVcAq5.js} +5 -5
  38. package/dist/component/{kanban-definition-UN3LZRKU-Dll6IAhM.js → kanban-definition-UN3LZRKU-DN_BkNHr.js} +3 -3
  39. package/dist/component/{linear-ChreRr3h.js → linear-C9Fv-7qu.js} +2 -2
  40. package/dist/component/{mermaid-GHXKKRXX-C0Oq2bpl.js → mermaid-GHXKKRXX-bJrxMXXe.js} +35640 -32099
  41. package/dist/component/{mindmap-definition-RKZ34NQL-DC9K87bN.js → mindmap-definition-RKZ34NQL-Duh3XRoZ.js} +4 -4
  42. package/dist/component/{pieDiagram-4H26LBE5-BNGHaTmE.js → pieDiagram-4H26LBE5-BkKLjdAW.js} +4 -4
  43. package/dist/component/{quadrantDiagram-W4KKPZXB-D23AXzE2.js → quadrantDiagram-W4KKPZXB-DAvb8fUN.js} +3 -3
  44. package/dist/component/{requirementDiagram-4Y6WPE33-DRe6Bcy7.js → requirementDiagram-4Y6WPE33-BtRuiyP2.js} +4 -4
  45. package/dist/component/{sankeyDiagram-5OEKKPKP-Ca--29t-.js → sankeyDiagram-5OEKKPKP-N0AD4yPI.js} +2 -2
  46. package/dist/component/{sequenceDiagram-3UESZ5HK-Cv6WVN5T.js → sequenceDiagram-3UESZ5HK-BHfCscqu.js} +4 -4
  47. package/dist/component/{stateDiagram-AJRCARHV-Ba_3WUjf.js → stateDiagram-AJRCARHV-CogCGofy.js} +3 -3
  48. package/dist/component/{stateDiagram-v2-BHNVJYJU-C8G1MQa8.js → stateDiagram-v2-BHNVJYJU-B1mCX7fI.js} +3 -3
  49. package/dist/component/{timeline-definition-PNZ67QCA-Bfh6fz9g.js → timeline-definition-PNZ67QCA-CCbxae4K.js} +3 -3
  50. package/dist/component/{vennDiagram-CIIHVFJN-D1U-PuFV.js → vennDiagram-CIIHVFJN-4A3Z5NhT.js} +2 -2
  51. package/dist/component/{wardleyDiagram-YWT4CUSO-DTwXmrGn.js → wardleyDiagram-YWT4CUSO-D2FUxcv8.js} +3 -3
  52. package/dist/component/{xychartDiagram-2RQKCTM6-Dy8C7cbo.js → xychartDiagram-2RQKCTM6-DELqVNap.js} +3 -3
  53. package/dist/components/embed/AgentGrantAutoConnect.d.ts +1 -0
  54. package/dist/components/embed/CapabilityHints.d.ts +4 -1
  55. package/dist/components/embed/EmbedConversation.d.ts +11 -11
  56. package/dist/components/embed/EmbedRail.d.ts +1 -1
  57. package/dist/components/embed/FilePreview.d.ts +7 -2
  58. package/dist/components/embed/FilePreviewDialog.d.ts +6 -2
  59. package/dist/components/embed/HtmlPreviewFrame.d.ts +7 -0
  60. package/dist/components/embed/MentionInput.d.ts +8 -1
  61. package/dist/components/embed/PreviewContent.d.ts +9 -21
  62. package/dist/components/embed/WelcomeIntro.d.ts +5 -3
  63. package/dist/components/embed/WelcomeSkills.d.ts +7 -0
  64. package/dist/components/embed/file-preview-kind.d.ts +7 -3
  65. package/dist/components/embed/onboarding-story-dock.d.ts +5 -2
  66. package/dist/components/embed/preview-content-kind.d.ts +5 -7
  67. package/dist/components/embed/use-inline-preview-url.d.ts +20 -0
  68. package/dist/components/scheduled/ConfirmDeleteScheduleDialog.d.ts +7 -0
  69. package/dist/components/scheduled/ScheduleDialog.d.ts +13 -0
  70. package/dist/components/scheduled/ScheduledDetailSurface.d.ts +8 -0
  71. package/dist/components/scheduled/ScheduledListSurface.d.ts +7 -0
  72. package/dist/components/scheduled/TimezoneCombobox.d.ts +7 -0
  73. package/dist/components/scheduled/schedule-dialog-model.d.ts +11 -0
  74. package/dist/components/scheduled/schedule-format.d.ts +38 -0
  75. package/dist/embed/agent-grant-refresh.d.ts +7 -7
  76. package/dist/embed/composer-submit.d.ts +7 -0
  77. package/dist/embed/copy.d.ts +92 -15
  78. package/dist/embed/dock-state.d.ts +1 -1
  79. package/dist/embed/slash-commands.d.ts +20 -6
  80. package/dist/embed/task-schedule-command.d.ts +32 -0
  81. package/dist/embed/task-schedule-store.d.ts +29 -0
  82. package/dist/embed/theme-preview-params.d.ts +2 -0
  83. package/dist/embed/voice-narration.d.ts +15 -0
  84. package/dist/i18n/messages/en.d.ts +106 -22
  85. package/dist/i18n/messages/surfaces/embedMisc.d.ts +0 -12
  86. package/dist/i18n/messages/surfaces/header.d.ts +9 -0
  87. package/dist/i18n/messages/surfaces/scheduled.d.ts +253 -0
  88. package/dist/lib/use-debounced-value.d.ts +2 -0
  89. package/dist/routes/chat.d.ts +3 -2
  90. package/dist/routes/scheduled-detail.d.ts +2 -0
  91. package/dist/routes/scheduled.d.ts +2 -0
  92. package/dist/stream/stream-state-store.d.ts +9 -0
  93. package/dist/types/public.d.ts +44 -9
  94. package/package.json +1 -1
  95. package/dist/components/embed/AgentGrantCard.d.ts +0 -27
  96. package/dist/i18n/messages/surfaces/agentGrant.d.ts +0 -58
@@ -0,0 +1,2208 @@
1
+ globalThis.process = globalThis.process || { env: {} };
2
+ globalThis.global = globalThis.global || globalThis;
3
+ var c;
4
+ (function(r) {
5
+ r[r.AM = 0] = "AM", r[r.PM = 1] = "PM";
6
+ })(c || (c = {}));
7
+ var f;
8
+ (function(r) {
9
+ r[r.SUNDAY = 0] = "SUNDAY", r[r.MONDAY = 1] = "MONDAY", r[r.TUESDAY = 2] = "TUESDAY", r[r.WEDNESDAY = 3] = "WEDNESDAY", r[r.THURSDAY = 4] = "THURSDAY", r[r.FRIDAY = 5] = "FRIDAY", r[r.SATURDAY = 6] = "SATURDAY";
10
+ })(f || (f = {}));
11
+ var p;
12
+ (function(r) {
13
+ r[r.JANUARY = 1] = "JANUARY", r[r.FEBRUARY = 2] = "FEBRUARY", r[r.MARCH = 3] = "MARCH", r[r.APRIL = 4] = "APRIL", r[r.MAY = 5] = "MAY", r[r.JUNE = 6] = "JUNE", r[r.JULY = 7] = "JULY", r[r.AUGUST = 8] = "AUGUST", r[r.SEPTEMBER = 9] = "SEPTEMBER", r[r.OCTOBER = 10] = "OCTOBER", r[r.NOVEMBER = 11] = "NOVEMBER", r[r.DECEMBER = 12] = "DECEMBER";
14
+ })(p || (p = {}));
15
+ function P(r, e) {
16
+ r.assign("day", e.getDate()), r.assign("month", e.getMonth() + 1), r.assign("year", e.getFullYear());
17
+ }
18
+ function ve(r, e) {
19
+ r.assign("hour", e.getHours()), r.assign("minute", e.getMinutes()), r.assign("second", e.getSeconds()), r.assign("millisecond", e.getMilliseconds()), r.assign("meridiem", e.getHours() < 12 ? c.AM : c.PM);
20
+ }
21
+ function N(r, e) {
22
+ r.imply("day", e.getDate()), r.imply("month", e.getMonth() + 1), r.imply("year", e.getFullYear());
23
+ }
24
+ function S(r, e) {
25
+ r.imply("hour", e.getHours()), r.imply("minute", e.getMinutes()), r.imply("second", e.getSeconds()), r.imply("millisecond", e.getMilliseconds()), r.imply("meridiem", e.getHours() < 12 ? c.AM : c.PM);
26
+ }
27
+ const at = {
28
+ ACDT: 630,
29
+ ACST: 570,
30
+ ADT: -180,
31
+ AEDT: 660,
32
+ AEST: 600,
33
+ AFT: 270,
34
+ AKDT: -480,
35
+ AKST: -540,
36
+ ALMT: 360,
37
+ AMST: -180,
38
+ AMT: -240,
39
+ ANAST: 720,
40
+ ANAT: 720,
41
+ AQTT: 300,
42
+ ART: -180,
43
+ AST: -240,
44
+ AWDT: 540,
45
+ AWST: 480,
46
+ AZOST: 0,
47
+ AZOT: -60,
48
+ AZST: 300,
49
+ AZT: 240,
50
+ BNT: 480,
51
+ BOT: -240,
52
+ BRST: -120,
53
+ BRT: -180,
54
+ BST: 60,
55
+ BTT: 360,
56
+ CAST: 480,
57
+ CAT: 120,
58
+ CCT: 390,
59
+ CDT: -300,
60
+ CEST: 120,
61
+ CET: {
62
+ timezoneOffsetDuringDst: 120,
63
+ timezoneOffsetNonDst: 60,
64
+ dstStart: (r) => me(r, p.MARCH, f.SUNDAY, 2),
65
+ dstEnd: (r) => me(r, p.OCTOBER, f.SUNDAY, 3)
66
+ },
67
+ CHADT: 825,
68
+ CHAST: 765,
69
+ CKT: -600,
70
+ CLST: -180,
71
+ CLT: -240,
72
+ COT: -300,
73
+ CST: -360,
74
+ CT: {
75
+ timezoneOffsetDuringDst: -300,
76
+ timezoneOffsetNonDst: -360,
77
+ dstStart: (r) => R(r, p.MARCH, f.SUNDAY, 2, 2),
78
+ dstEnd: (r) => R(r, p.NOVEMBER, f.SUNDAY, 1, 2)
79
+ },
80
+ CVT: -60,
81
+ CXT: 420,
82
+ ChST: 600,
83
+ DAVT: 420,
84
+ EASST: -300,
85
+ EAST: -360,
86
+ EAT: 180,
87
+ ECT: -300,
88
+ EDT: -240,
89
+ EEST: 180,
90
+ EET: 120,
91
+ EGST: 0,
92
+ EGT: -60,
93
+ EST: -300,
94
+ ET: {
95
+ timezoneOffsetDuringDst: -240,
96
+ timezoneOffsetNonDst: -300,
97
+ dstStart: (r) => R(r, p.MARCH, f.SUNDAY, 2, 2),
98
+ dstEnd: (r) => R(r, p.NOVEMBER, f.SUNDAY, 1, 2)
99
+ },
100
+ FJST: 780,
101
+ FJT: 720,
102
+ FKST: -180,
103
+ FKT: -240,
104
+ FNT: -120,
105
+ GALT: -360,
106
+ GAMT: -540,
107
+ GET: 240,
108
+ GFT: -180,
109
+ GILT: 720,
110
+ GMT: 0,
111
+ GST: 240,
112
+ GYT: -240,
113
+ HAA: -180,
114
+ HAC: -300,
115
+ HADT: -540,
116
+ HAE: -240,
117
+ HAP: -420,
118
+ HAR: -360,
119
+ HAST: -600,
120
+ HAT: -90,
121
+ HAY: -480,
122
+ HKT: 480,
123
+ HLV: -210,
124
+ HNA: -240,
125
+ HNC: -360,
126
+ HNE: -300,
127
+ HNP: -480,
128
+ HNR: -420,
129
+ HNT: -150,
130
+ HNY: -540,
131
+ HOVT: 420,
132
+ ICT: 420,
133
+ IDT: 180,
134
+ IOT: 360,
135
+ IRDT: 270,
136
+ IRKST: 540,
137
+ IRKT: 540,
138
+ IRST: 210,
139
+ IST: 330,
140
+ JST: 540,
141
+ KGT: 360,
142
+ KRAST: 480,
143
+ KRAT: 480,
144
+ KST: 540,
145
+ KUYT: 240,
146
+ LHDT: 660,
147
+ LHST: 630,
148
+ LINT: 840,
149
+ MAGST: 720,
150
+ MAGT: 720,
151
+ MART: -510,
152
+ MAWT: 300,
153
+ MDT: -360,
154
+ MESZ: 120,
155
+ MEZ: 60,
156
+ MHT: 720,
157
+ MMT: 390,
158
+ MSD: 240,
159
+ MSK: 180,
160
+ MST: -420,
161
+ MT: {
162
+ timezoneOffsetDuringDst: -360,
163
+ timezoneOffsetNonDst: -420,
164
+ dstStart: (r) => R(r, p.MARCH, f.SUNDAY, 2, 2),
165
+ dstEnd: (r) => R(r, p.NOVEMBER, f.SUNDAY, 1, 2)
166
+ },
167
+ MUT: 240,
168
+ MVT: 300,
169
+ MYT: 480,
170
+ NCT: 660,
171
+ NDT: -90,
172
+ NFT: 690,
173
+ NOVST: 420,
174
+ NOVT: 360,
175
+ NPT: 345,
176
+ NST: -150,
177
+ NUT: -660,
178
+ NZDT: 780,
179
+ NZST: 720,
180
+ OMSST: 420,
181
+ OMST: 420,
182
+ PDT: -420,
183
+ PET: -300,
184
+ PETST: 720,
185
+ PETT: 720,
186
+ PGT: 600,
187
+ PHOT: 780,
188
+ PHT: 480,
189
+ PKT: 300,
190
+ PMDT: -120,
191
+ PMST: -180,
192
+ PONT: 660,
193
+ PST: -480,
194
+ PT: {
195
+ timezoneOffsetDuringDst: -420,
196
+ timezoneOffsetNonDst: -480,
197
+ dstStart: (r) => R(r, p.MARCH, f.SUNDAY, 2, 2),
198
+ dstEnd: (r) => R(r, p.NOVEMBER, f.SUNDAY, 1, 2)
199
+ },
200
+ PWT: 540,
201
+ PYST: -180,
202
+ PYT: -240,
203
+ RET: 240,
204
+ SAMT: 240,
205
+ SAST: 120,
206
+ SBT: 660,
207
+ SCT: 240,
208
+ SGT: 480,
209
+ SRT: -180,
210
+ SST: -660,
211
+ TAHT: -600,
212
+ TFT: 300,
213
+ TJT: 300,
214
+ TKT: 780,
215
+ TLT: 540,
216
+ TMT: 300,
217
+ TVT: 720,
218
+ ULAT: 480,
219
+ UTC: 0,
220
+ UYST: -120,
221
+ UYT: -180,
222
+ UZT: 300,
223
+ VET: -210,
224
+ VLAST: 660,
225
+ VLAT: 660,
226
+ VUT: 660,
227
+ WAST: 120,
228
+ WAT: 60,
229
+ WEST: 60,
230
+ WESZ: 60,
231
+ WET: 0,
232
+ WEZ: 0,
233
+ WFT: 720,
234
+ WGST: -120,
235
+ WGT: -180,
236
+ WIB: 420,
237
+ WIT: 540,
238
+ WITA: 480,
239
+ WST: 780,
240
+ WT: 0,
241
+ YAKST: 600,
242
+ YAKT: 600,
243
+ YAPT: 600,
244
+ YEKST: 360,
245
+ YEKT: 360
246
+ };
247
+ function R(r, e, t, n, s = 0) {
248
+ let i = 0, a = 0;
249
+ for (; a < n; )
250
+ i++, new Date(r, e - 1, i).getDay() === t && a++;
251
+ return new Date(r, e - 1, i, s);
252
+ }
253
+ function me(r, e, t, n = 0) {
254
+ const s = t === 0 ? 7 : t, i = new Date(r, e - 1 + 1, 1, 12), a = i.getDay() === 0 ? 7 : i.getDay();
255
+ let o;
256
+ return a === s ? o = 7 : a < s ? o = 7 + a - s : o = a - s, i.setDate(i.getDate() - o), new Date(r, e - 1, i.getDate(), n);
257
+ }
258
+ function ze(r, e, t = {}) {
259
+ if (r == null)
260
+ return null;
261
+ if (typeof r == "number")
262
+ return r;
263
+ const n = t[r] ?? at[r];
264
+ return n == null ? null : typeof n == "number" ? n : e == null ? null : e > n.dstStart(e.getFullYear()) && !(e > n.dstEnd(e.getFullYear())) ? n.timezoneOffsetDuringDst : n.timezoneOffsetNonDst;
265
+ }
266
+ const ot = {
267
+ day: 0,
268
+ second: 0,
269
+ millisecond: 0
270
+ };
271
+ function T(r, e) {
272
+ let t = new Date(r);
273
+ if (e.y && (e.year = e.y, delete e.y), e.mo && (e.month = e.mo, delete e.mo), e.M && (e.month = e.M, delete e.M), e.w && (e.week = e.w, delete e.w), e.d && (e.day = e.d, delete e.d), e.h && (e.hour = e.h, delete e.h), e.m && (e.minute = e.m, delete e.m), e.s && (e.second = e.s, delete e.s), e.ms && (e.millisecond = e.ms, delete e.ms), "year" in e) {
274
+ const n = Math.floor(e.year);
275
+ t.setFullYear(t.getFullYear() + n);
276
+ const s = e.year - n;
277
+ s > 0 && (e.month = e?.month ?? 0, e.month += s * 12);
278
+ }
279
+ if ("quarter" in e) {
280
+ const n = Math.floor(e.quarter);
281
+ t.setMonth(t.getMonth() + n * 3);
282
+ }
283
+ if ("month" in e) {
284
+ const n = Math.floor(e.month);
285
+ t.setMonth(t.getMonth() + n);
286
+ const s = e.month - n;
287
+ s > 0 && (e.week = e?.week ?? 0, e.week += s * 4);
288
+ }
289
+ if ("week" in e) {
290
+ const n = Math.floor(e.week);
291
+ t.setDate(t.getDate() + n * 7);
292
+ const s = e.week - n;
293
+ s > 0 && (e.day = e?.day ?? 0, e.day += Math.round(s * 7));
294
+ }
295
+ if ("day" in e) {
296
+ const n = Math.floor(e.day);
297
+ t.setDate(t.getDate() + n);
298
+ const s = e.day - n;
299
+ s > 0 && (e.hour = e?.hour ?? 0, e.hour += Math.round(s * 24));
300
+ }
301
+ if ("hour" in e) {
302
+ const n = Math.floor(e.hour);
303
+ t.setHours(t.getHours() + n);
304
+ const s = e.hour - n;
305
+ s > 0 && (e.minute = e?.minute ?? 0, e.minute += Math.round(s * 60));
306
+ }
307
+ if ("minute" in e) {
308
+ const n = Math.floor(e.minute);
309
+ t.setMinutes(t.getMinutes() + n);
310
+ const s = e.minute - n;
311
+ s > 0 && (e.second = e?.second ?? 0, e.second += Math.round(s * 60));
312
+ }
313
+ if ("second" in e) {
314
+ const n = Math.floor(e.second);
315
+ t.setSeconds(t.getSeconds() + n);
316
+ const s = e.second - n;
317
+ s > 0 && (e.millisecond = e?.millisecond ?? 0, e.millisecond += Math.round(s * 1e3));
318
+ }
319
+ if ("millisecond" in e) {
320
+ const n = Math.floor(e.millisecond);
321
+ t.setMilliseconds(t.getMilliseconds() + n);
322
+ }
323
+ return t;
324
+ }
325
+ function k(r) {
326
+ const e = {};
327
+ for (const t in r)
328
+ e[t] = -r[t];
329
+ return e;
330
+ }
331
+ class E {
332
+ instant;
333
+ timezoneOffset;
334
+ constructor(e, t) {
335
+ this.instant = e ?? /* @__PURE__ */ new Date(), this.timezoneOffset = t ?? null;
336
+ }
337
+ static fromDate(e) {
338
+ return new E(e);
339
+ }
340
+ static fromInput(e, t) {
341
+ if (e instanceof Date)
342
+ return E.fromDate(e);
343
+ const n = e?.instant ?? /* @__PURE__ */ new Date(), s = ze(e?.timezone, n, t);
344
+ return new E(n, s);
345
+ }
346
+ getDateWithAdjustedTimezone() {
347
+ const e = new Date(this.instant);
348
+ return this.timezoneOffset !== null && e.setMinutes(e.getMinutes() - this.getSystemTimezoneAdjustmentMinute(this.instant)), e;
349
+ }
350
+ getSystemTimezoneAdjustmentMinute(e, t) {
351
+ e || (e = /* @__PURE__ */ new Date());
352
+ const n = -e.getTimezoneOffset(), s = t ?? this.timezoneOffset ?? n;
353
+ return n - s;
354
+ }
355
+ getTimezoneOffset() {
356
+ return this.timezoneOffset ?? -this.instant.getTimezoneOffset();
357
+ }
358
+ }
359
+ class d {
360
+ knownValues;
361
+ impliedValues;
362
+ reference;
363
+ _tags = /* @__PURE__ */ new Set();
364
+ constructor(e, t) {
365
+ if (this.reference = e, this.knownValues = {}, this.impliedValues = {}, t)
366
+ for (const s in t)
367
+ this.knownValues[s] = t[s];
368
+ const n = e.getDateWithAdjustedTimezone();
369
+ this.imply("day", n.getDate()), this.imply("month", n.getMonth() + 1), this.imply("year", n.getFullYear()), this.imply("hour", 12), this.imply("minute", 0), this.imply("second", 0), this.imply("millisecond", 0);
370
+ }
371
+ static createRelativeFromReference(e, t = ot) {
372
+ let n = T(e.getDateWithAdjustedTimezone(), t);
373
+ const s = new d(e);
374
+ return s.addTag("result/relativeDate"), "hour" in t || "minute" in t || "second" in t || "millisecond" in t ? (s.addTag("result/relativeDateAndTime"), ve(s, n), P(s, n), s.assign("timezoneOffset", e.getTimezoneOffset())) : (S(s, n), s.imply("timezoneOffset", e.getTimezoneOffset()), "day" in t ? (s.assign("day", n.getDate()), s.assign("month", n.getMonth() + 1), s.assign("year", n.getFullYear()), s.assign("weekday", n.getDay())) : "week" in t ? (s.assign("day", n.getDate()), s.assign("month", n.getMonth() + 1), s.assign("year", n.getFullYear()), s.imply("weekday", n.getDay())) : (s.imply("day", n.getDate()), "month" in t ? (s.assign("month", n.getMonth() + 1), s.assign("year", n.getFullYear())) : (s.imply("month", n.getMonth() + 1), "year" in t ? s.assign("year", n.getFullYear()) : s.imply("year", n.getFullYear())))), s;
375
+ }
376
+ get(e) {
377
+ return e in this.knownValues ? this.knownValues[e] : e in this.impliedValues ? this.impliedValues[e] : null;
378
+ }
379
+ isCertain(e) {
380
+ return e in this.knownValues;
381
+ }
382
+ getCertainComponents() {
383
+ return Object.keys(this.knownValues);
384
+ }
385
+ imply(e, t) {
386
+ return e in this.knownValues ? this : (this.impliedValues[e] = t, this);
387
+ }
388
+ assign(e, t) {
389
+ return this.knownValues[e] = t, delete this.impliedValues[e], this;
390
+ }
391
+ addDurationAsImplied(e) {
392
+ const t = this.dateWithoutTimezoneAdjustment(), n = T(t, e);
393
+ return ("day" in e || "week" in e || "month" in e || "year" in e) && (this.delete(["day", "weekday", "month", "year"]), this.imply("day", n.getDate()), this.imply("weekday", n.getDay()), this.imply("month", n.getMonth() + 1), this.imply("year", n.getFullYear())), ("second" in e || "minute" in e || "hour" in e) && (this.delete(["second", "minute", "hour"]), this.imply("second", n.getSeconds()), this.imply("minute", n.getMinutes()), this.imply("hour", n.getHours())), this;
394
+ }
395
+ delete(e) {
396
+ typeof e == "string" && (e = [e]);
397
+ for (const t of e)
398
+ delete this.knownValues[t], delete this.impliedValues[t];
399
+ }
400
+ clone() {
401
+ const e = new d(this.reference);
402
+ e.knownValues = {}, e.impliedValues = {};
403
+ for (const t in this.knownValues)
404
+ e.knownValues[t] = this.knownValues[t];
405
+ for (const t in this.impliedValues)
406
+ e.impliedValues[t] = this.impliedValues[t];
407
+ return e;
408
+ }
409
+ isOnlyDate() {
410
+ return !this.isCertain("hour") && !this.isCertain("minute") && !this.isCertain("second");
411
+ }
412
+ isOnlyTime() {
413
+ return !this.isCertain("weekday") && !this.isCertain("day") && !this.isCertain("month") && !this.isCertain("year");
414
+ }
415
+ isOnlyWeekdayComponent() {
416
+ return this.isCertain("weekday") && !this.isCertain("day") && !this.isCertain("month");
417
+ }
418
+ isDateWithUnknownYear() {
419
+ return this.isCertain("month") && !this.isCertain("year");
420
+ }
421
+ isValidDate() {
422
+ const e = new Date(Date.UTC(this.get("year"), this.get("month") - 1, this.get("day"), this.get("hour"), this.get("minute"), this.get("second"), this.get("millisecond")));
423
+ return e.setUTCFullYear(this.get("year")), !(e.getUTCFullYear() !== this.get("year") || e.getUTCMonth() !== this.get("month") - 1 || e.getUTCDate() !== this.get("day") || this.get("hour") != null && e.getUTCHours() != this.get("hour") || this.get("minute") != null && e.getUTCMinutes() != this.get("minute"));
424
+ }
425
+ toString() {
426
+ return `[ParsingComponents {
427
+ tags: ${JSON.stringify(Array.from(this._tags).sort())},
428
+ knownValues: ${JSON.stringify(this.knownValues)},
429
+ impliedValues: ${JSON.stringify(this.impliedValues)}},
430
+ reference: ${JSON.stringify(this.reference)}]`;
431
+ }
432
+ date() {
433
+ const e = this.get("timezoneOffset") ?? this.reference.timezoneOffset;
434
+ if (e == null)
435
+ return this.dateWithoutTimezoneAdjustment();
436
+ const t = new Date(Date.UTC(this.get("year"), this.get("month") - 1, this.get("day"), this.get("hour"), this.get("minute"), this.get("second"), this.get("millisecond")));
437
+ return t.setUTCFullYear(this.get("year")), new Date(t.getTime() - e * 6e4);
438
+ }
439
+ addTag(e) {
440
+ return this._tags.add(e), this;
441
+ }
442
+ addTags(e) {
443
+ for (const t of e)
444
+ this._tags.add(t);
445
+ return this;
446
+ }
447
+ tags() {
448
+ return new Set(this._tags);
449
+ }
450
+ dateWithoutTimezoneAdjustment() {
451
+ const e = new Date(this.get("year"), this.get("month") - 1, this.get("day"), this.get("hour"), this.get("minute"), this.get("second"), this.get("millisecond"));
452
+ return e.setFullYear(this.get("year")), e;
453
+ }
454
+ }
455
+ class D {
456
+ refDate;
457
+ index;
458
+ text;
459
+ reference;
460
+ start;
461
+ end;
462
+ constructor(e, t, n, s, i) {
463
+ this.reference = e, this.refDate = e.instant, this.index = t, this.text = n, this.start = s || new d(e), this.end = i;
464
+ }
465
+ clone() {
466
+ const e = new D(this.reference, this.index, this.text);
467
+ return e.start = this.start ? this.start.clone() : null, e.end = this.end ? this.end.clone() : null, e;
468
+ }
469
+ date() {
470
+ return this.start.date();
471
+ }
472
+ addTag(e) {
473
+ return this.start.addTag(e), this.end && this.end.addTag(e), this;
474
+ }
475
+ addTags(e) {
476
+ return this.start.addTags(e), this.end && this.end.addTags(e), this;
477
+ }
478
+ tags() {
479
+ const e = new Set(this.start.tags());
480
+ if (this.end)
481
+ for (const t of this.end.tags())
482
+ e.add(t);
483
+ return e;
484
+ }
485
+ toString() {
486
+ const e = Array.from(this.tags()).sort();
487
+ return `[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(e)} ...}]`;
488
+ }
489
+ }
490
+ function Q(r, e, t = "\\s{0,5},?\\s{0,5}") {
491
+ const n = e.replace(/\((?!\?)/g, "(?:");
492
+ return `${r}${n}(?:${t}${n}){0,10}`;
493
+ }
494
+ function lt(r) {
495
+ let e;
496
+ return r instanceof Array ? e = [...r] : r instanceof Map ? e = Array.from(r.keys()) : e = Object.keys(r), e;
497
+ }
498
+ function h(r) {
499
+ return `(?:${lt(r).sort((t, n) => n.length - t.length).join("|").replace(/\./g, "\\.")})`;
500
+ }
501
+ function Be(r) {
502
+ return r < 100 && (r > 50 ? r = r + 1900 : r = r + 2e3), r;
503
+ }
504
+ function M(r, e, t) {
505
+ let n = new Date(r);
506
+ n.setMonth(t - 1), n.setDate(e);
507
+ const s = T(n, { year: 1 }), i = T(n, { year: -1 });
508
+ return Math.abs(s.getTime() - r.getTime()) < Math.abs(n.getTime() - r.getTime()) ? n = s : Math.abs(i.getTime() - r.getTime()) < Math.abs(n.getTime() - r.getTime()) && (n = i), n.getFullYear();
509
+ }
510
+ const K = {
511
+ sunday: 0,
512
+ sun: 0,
513
+ "sun.": 0,
514
+ monday: 1,
515
+ mon: 1,
516
+ "mon.": 1,
517
+ tuesday: 2,
518
+ tue: 2,
519
+ "tue.": 2,
520
+ wednesday: 3,
521
+ wed: 3,
522
+ "wed.": 3,
523
+ thursday: 4,
524
+ thurs: 4,
525
+ "thurs.": 4,
526
+ thur: 4,
527
+ "thur.": 4,
528
+ thu: 4,
529
+ "thu.": 4,
530
+ friday: 5,
531
+ fri: 5,
532
+ "fri.": 5,
533
+ saturday: 6,
534
+ sat: 6,
535
+ "sat.": 6
536
+ }, Le = {
537
+ january: 1,
538
+ february: 2,
539
+ march: 3,
540
+ april: 4,
541
+ may: 5,
542
+ june: 6,
543
+ july: 7,
544
+ august: 8,
545
+ september: 9,
546
+ october: 10,
547
+ november: 11,
548
+ december: 12
549
+ }, w = {
550
+ ...Le,
551
+ jan: 1,
552
+ "jan.": 1,
553
+ feb: 2,
554
+ "feb.": 2,
555
+ mar: 3,
556
+ "mar.": 3,
557
+ apr: 4,
558
+ "apr.": 4,
559
+ jun: 6,
560
+ "jun.": 6,
561
+ jul: 7,
562
+ "jul.": 7,
563
+ aug: 8,
564
+ "aug.": 8,
565
+ sep: 9,
566
+ "sep.": 9,
567
+ sept: 9,
568
+ "sept.": 9,
569
+ oct: 10,
570
+ "oct.": 10,
571
+ nov: 11,
572
+ "nov.": 11,
573
+ dec: 12,
574
+ "dec.": 12
575
+ }, Z = {
576
+ one: 1,
577
+ two: 2,
578
+ three: 3,
579
+ four: 4,
580
+ five: 5,
581
+ six: 6,
582
+ seven: 7,
583
+ eight: 8,
584
+ nine: 9,
585
+ ten: 10,
586
+ eleven: 11,
587
+ twelve: 12
588
+ }, q = {
589
+ first: 1,
590
+ second: 2,
591
+ third: 3,
592
+ fourth: 4,
593
+ fifth: 5,
594
+ sixth: 6,
595
+ seventh: 7,
596
+ eighth: 8,
597
+ ninth: 9,
598
+ tenth: 10,
599
+ eleventh: 11,
600
+ twelfth: 12,
601
+ thirteenth: 13,
602
+ fourteenth: 14,
603
+ fifteenth: 15,
604
+ sixteenth: 16,
605
+ seventeenth: 17,
606
+ eighteenth: 18,
607
+ nineteenth: 19,
608
+ twentieth: 20,
609
+ "twenty first": 21,
610
+ "twenty-first": 21,
611
+ "twenty second": 22,
612
+ "twenty-second": 22,
613
+ "twenty third": 23,
614
+ "twenty-third": 23,
615
+ "twenty fourth": 24,
616
+ "twenty-fourth": 24,
617
+ "twenty fifth": 25,
618
+ "twenty-fifth": 25,
619
+ "twenty sixth": 26,
620
+ "twenty-sixth": 26,
621
+ "twenty seventh": 27,
622
+ "twenty-seventh": 27,
623
+ "twenty eighth": 28,
624
+ "twenty-eighth": 28,
625
+ "twenty ninth": 29,
626
+ "twenty-ninth": 29,
627
+ thirtieth: 30,
628
+ "thirty first": 31,
629
+ "thirty-first": 31
630
+ }, He = {
631
+ second: "second",
632
+ seconds: "second",
633
+ minute: "minute",
634
+ minutes: "minute",
635
+ hour: "hour",
636
+ hours: "hour",
637
+ day: "day",
638
+ days: "day",
639
+ week: "week",
640
+ weeks: "week",
641
+ month: "month",
642
+ months: "month",
643
+ quarter: "quarter",
644
+ quarters: "quarter",
645
+ year: "year",
646
+ years: "year"
647
+ }, G = {
648
+ s: "second",
649
+ sec: "second",
650
+ second: "second",
651
+ seconds: "second",
652
+ m: "minute",
653
+ min: "minute",
654
+ mins: "minute",
655
+ minute: "minute",
656
+ minutes: "minute",
657
+ h: "hour",
658
+ hr: "hour",
659
+ hrs: "hour",
660
+ hour: "hour",
661
+ hours: "hour",
662
+ d: "day",
663
+ day: "day",
664
+ days: "day",
665
+ w: "week",
666
+ week: "week",
667
+ weeks: "week",
668
+ mo: "month",
669
+ mon: "month",
670
+ mos: "month",
671
+ month: "month",
672
+ months: "month",
673
+ qtr: "quarter",
674
+ quarter: "quarter",
675
+ quarters: "quarter",
676
+ y: "year",
677
+ yr: "year",
678
+ year: "year",
679
+ years: "year",
680
+ ...He
681
+ }, je = `(?:${h(Z)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;
682
+ function ct(r) {
683
+ const e = r.toLowerCase();
684
+ return Z[e] !== void 0 ? Z[e] : e === "a" || e === "an" || e == "the" ? 1 : e.match(/few/) ? 3 : e.match(/half/) ? 0.5 : e.match(/couple/) ? 2 : e.match(/several/) ? 7 : parseFloat(e);
685
+ }
686
+ const F = `(?:${h(q)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;
687
+ function W(r) {
688
+ let e = r.toLowerCase();
689
+ return q[e] !== void 0 ? q[e] : (e = e.replace(/(?:st|nd|rd|th)$/i, ""), parseInt(e));
690
+ }
691
+ const v = "(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3}|[5-9][0-9]|2[0-5])";
692
+ function _(r) {
693
+ if (/BE/i.test(r))
694
+ return r = r.replace(/BE/i, ""), parseInt(r) - 543;
695
+ if (/BCE?/i.test(r))
696
+ return r = r.replace(/BCE?/i, ""), -parseInt(r);
697
+ if (/(AD|CE)/i.test(r))
698
+ return r = r.replace(/(AD|CE)/i, ""), parseInt(r);
699
+ const e = parseInt(r);
700
+ return Be(e);
701
+ }
702
+ const Ve = `(${je})\\s{0,3}(${h(G)})`, he = new RegExp(Ve, "i"), ut = `(${je})\\s{0,3}(${h(He)})`, Ke = "\\s{0,5},?(?:\\s*and)?\\s{0,5}", U = Q("(?:(?:about|around)\\s{0,3})?", Ve, Ke), z = Q("(?:(?:about|around)\\s{0,3})?", ut, Ke);
703
+ function $(r) {
704
+ const e = {};
705
+ let t = r, n = he.exec(t);
706
+ for (; n; )
707
+ dt(e, n), t = t.substring(n[0].length).trim(), n = he.exec(t);
708
+ return Object.keys(e).length == 0 ? null : e;
709
+ }
710
+ function dt(r, e) {
711
+ if (e[0].match(/^[a-zA-Z]+$/))
712
+ return;
713
+ const t = ct(e[1]), n = G[e[2].toLowerCase()];
714
+ r[n] = t;
715
+ }
716
+ class g {
717
+ innerPatternHasChange(e, t) {
718
+ return this.innerPattern(e) !== t;
719
+ }
720
+ patternLeftBoundary() {
721
+ return "(\\W|^)";
722
+ }
723
+ cachedInnerPattern = null;
724
+ cachedPattern = null;
725
+ pattern(e) {
726
+ return this.cachedInnerPattern && !this.innerPatternHasChange(e, this.cachedInnerPattern) ? this.cachedPattern : (this.cachedInnerPattern = this.innerPattern(e), this.cachedPattern = new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`, this.cachedInnerPattern.flags), this.cachedPattern);
727
+ }
728
+ extract(e, t) {
729
+ const n = t[1] ?? "";
730
+ t.index = t.index + n.length, t[0] = t[0].substring(n.length);
731
+ for (let s = 2; s < t.length; s++)
732
+ t[s - 1] = t[s];
733
+ return this.innerExtract(e, t);
734
+ }
735
+ }
736
+ const ft = new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${U})(?=\\W|$)`, "i"), gt = new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${U})(?=\\W|$)`, "i"), mt = new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${z})(?=\\W|$)`, "i");
737
+ class ht extends g {
738
+ strictMode;
739
+ constructor(e) {
740
+ super(), this.strictMode = e;
741
+ }
742
+ innerPattern(e) {
743
+ return this.strictMode ? mt : e.option.forwardDate ? ft : gt;
744
+ }
745
+ innerExtract(e, t) {
746
+ if (t[0].match(/^for\s*the\s*\w+/))
747
+ return null;
748
+ const n = $(t[1]);
749
+ return n ? d.createRelativeFromReference(e.reference, n) : null;
750
+ }
751
+ }
752
+ const Tt = new RegExp(`(?:on\\s{0,3})?(${F})(?:\\s{0,3}(?:to|\\-|\\–|until|through|till)\\s{0,3}(${F}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${h(w)})(?:(?:-|/|,?\\s{0,3})(${v}(?!\\w)))?(?=\\W|$)`, "i"), Te = 1, ye = 2, yt = 3, pe = 4;
753
+ class pt extends g {
754
+ innerPattern() {
755
+ return Tt;
756
+ }
757
+ innerExtract(e, t) {
758
+ const n = e.createParsingResult(t.index, t[0]), s = w[t[yt].toLowerCase()], i = W(t[Te]);
759
+ if (i > 31)
760
+ return t.index = t.index + t[Te].length, null;
761
+ if (n.start.assign("month", s), n.start.assign("day", i), t[pe]) {
762
+ const a = _(t[pe]);
763
+ n.start.assign("year", a);
764
+ } else {
765
+ const a = M(e.refDate, i, s);
766
+ n.start.imply("year", a);
767
+ }
768
+ if (t[ye]) {
769
+ const a = W(t[ye]);
770
+ n.end = n.start.clone(), n.end.assign("day", a);
771
+ }
772
+ return n;
773
+ }
774
+ }
775
+ const Et = new RegExp(`(${h(w)})(?:-|/|\\s*,?\\s*)(${F})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${F})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${v}))?(?=\\W|$)(?!\\:\\d)`, "i"), wt = 1, Ee = 2, L = 3, H = 4;
776
+ class Pt extends g {
777
+ shouldSkipYearLikeDate;
778
+ constructor(e) {
779
+ super(), this.shouldSkipYearLikeDate = e;
780
+ }
781
+ innerPattern() {
782
+ return Et;
783
+ }
784
+ innerExtract(e, t) {
785
+ const n = w[t[wt].toLowerCase()], s = W(t[Ee]);
786
+ if (s > 31 || this.shouldSkipYearLikeDate && !t[L] && !t[H] && t[Ee].match(/^2[0-5]$/))
787
+ return null;
788
+ const i = e.createParsingComponents({
789
+ day: s,
790
+ month: n
791
+ }).addTag("parser/ENMonthNameMiddleEndianParser");
792
+ if (t[H]) {
793
+ const l = _(t[H]);
794
+ i.assign("year", l);
795
+ } else {
796
+ const l = M(e.refDate, s, n);
797
+ i.imply("year", l);
798
+ }
799
+ if (!t[L])
800
+ return i;
801
+ const a = W(t[L]), o = e.createParsingResult(t.index, t[0]);
802
+ return o.start = i, o.end = i.clone(), o.end.assign("day", a), o;
803
+ }
804
+ }
805
+ const Dt = new RegExp(`((?:in)\\s*)?(${h(w)})\\s*(?:(?:,|-|of)?\\s*(${v})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`, "i"), Rt = 1, At = 2, we = 3;
806
+ class xt extends g {
807
+ innerPattern() {
808
+ return Dt;
809
+ }
810
+ innerExtract(e, t) {
811
+ const n = t[At].toLowerCase();
812
+ if (t[0].length <= 3 && !Le[n])
813
+ return null;
814
+ const s = e.createParsingResult(t.index + (t[Rt] || "").length, t.index + t[0].length);
815
+ s.start.imply("day", 1), s.start.addTag("parser/ENMonthNameParser");
816
+ const i = w[n];
817
+ if (s.start.assign("month", i), t[we]) {
818
+ const a = _(t[we]);
819
+ s.start.assign("year", a);
820
+ } else {
821
+ const a = M(e.refDate, 1, i);
822
+ s.start.imply("year", a);
823
+ }
824
+ return s;
825
+ }
826
+ }
827
+ const Nt = new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${h(w)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`, "i"), Ot = 1, Mt = 2, Pe = 3, $t = 4;
828
+ class Ct extends g {
829
+ strictMonthDateOrder;
830
+ constructor(e) {
831
+ super(), this.strictMonthDateOrder = e;
832
+ }
833
+ innerPattern() {
834
+ return Nt;
835
+ }
836
+ innerExtract(e, t) {
837
+ const n = parseInt(t[Ot]);
838
+ let s = parseInt(t[$t]), i = t[Pe] ? parseInt(t[Pe]) : w[t[Mt].toLowerCase()];
839
+ if (i < 1 || i > 12) {
840
+ if (this.strictMonthDateOrder)
841
+ return null;
842
+ s >= 1 && s <= 12 && ([i, s] = [s, i]);
843
+ }
844
+ return s < 1 || s > 31 ? null : {
845
+ day: s,
846
+ month: i,
847
+ year: n
848
+ };
849
+ }
850
+ }
851
+ const St = "(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3})", _t = new RegExp(`(${St})(?:\\s*[-.\\/,]?\\s*|\\s+of\\s+)(${h(w)})(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`, "i"), Ut = 1, It = 2;
852
+ class bt extends g {
853
+ innerPattern() {
854
+ return _t;
855
+ }
856
+ innerExtract(e, t) {
857
+ const n = _(t[Ut]), s = t[It].toLowerCase(), i = w[s], a = e.createParsingResult(t.index, t[0]);
858
+ return a.start.imply("day", 1), a.start.assign("month", i), a.start.assign("year", n), a.start.addTag("parser/ENYearMonthNameParser"), a;
859
+ }
860
+ }
861
+ const Yt = new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})", "i"), Ft = 1, Wt = 2;
862
+ class kt extends g {
863
+ innerPattern() {
864
+ return Yt;
865
+ }
866
+ innerExtract(e, t) {
867
+ const n = parseInt(t[Wt]), s = parseInt(t[Ft]);
868
+ return e.createParsingComponents().imply("day", 1).assign("month", s).assign("year", n);
869
+ }
870
+ }
871
+ function Gt(r, e, t, n) {
872
+ return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|:)(\\d{1,2})(?:(?::|:)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`, n);
873
+ }
874
+ function vt(r, e) {
875
+ return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`, "i");
876
+ }
877
+ const j = 2, A = 3, b = 4, Y = 5, x = 6;
878
+ class ee {
879
+ strictMode;
880
+ constructor(e = !1) {
881
+ this.strictMode = e;
882
+ }
883
+ patternFlags() {
884
+ return "i";
885
+ }
886
+ primaryPatternLeftBoundary() {
887
+ return "(^|\\s|T|\\b)";
888
+ }
889
+ primarySuffix() {
890
+ return "(?!/)(?=\\W|$)";
891
+ }
892
+ followingSuffix() {
893
+ return "(?!/)(?=\\W|$)";
894
+ }
895
+ pattern(e) {
896
+ return this.getPrimaryTimePatternThroughCache();
897
+ }
898
+ extract(e, t) {
899
+ const n = this.extractPrimaryTimeComponents(e, t);
900
+ if (!n)
901
+ return t[0].match(/^\d{4}/) ? (t.index += 4, null) : (t.index += t[0].length, null);
902
+ const s = t.index + t[1].length, i = t[0].substring(t[1].length), a = e.createParsingResult(s, i, n);
903
+ t.index += t[0].length;
904
+ const o = e.text.substring(t.index), u = this.getFollowingTimePatternThroughCache().exec(o);
905
+ return i.match(/^\d{3,4}/) && u && (u[0].match(/^\s*([+-])\s*\d{2,4}$/) || u[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/)) ? null : !u || u[0].match(/^\s*([+-])\s*\d{3,4}$/) ? this.checkAndReturnWithoutFollowingPattern(a) : (a.end = this.extractFollowingTimeComponents(e, u, a), a.end && (a.text += u[0]), this.checkAndReturnWithFollowingPattern(a));
906
+ }
907
+ extractPrimaryTimeComponents(e, t, n = !1) {
908
+ const s = e.createParsingComponents();
909
+ let i = 0, a = null, o = parseInt(t[j]);
910
+ if (o > 100) {
911
+ if (t[j].length == 4 && t[A] == null && !t[x] || this.strictMode || t[A] != null)
912
+ return null;
913
+ i = o % 100, o = Math.floor(o / 100);
914
+ }
915
+ if (o > 24)
916
+ return null;
917
+ if (t[A] != null) {
918
+ if (t[A].length == 1 && !t[x])
919
+ return null;
920
+ i = parseInt(t[A]);
921
+ }
922
+ if (i >= 60)
923
+ return null;
924
+ if (o > 12 && (a = c.PM), t[x] != null) {
925
+ if (o > 12)
926
+ return null;
927
+ const l = t[x][0].toLowerCase();
928
+ l == "a" && (a = c.AM, o == 12 && (o = 0)), l == "p" && (a = c.PM, o != 12 && (o += 12));
929
+ }
930
+ if (s.assign("hour", o), s.assign("minute", i), a !== null ? s.assign("meridiem", a) : o < 12 ? s.imply("meridiem", c.AM) : s.imply("meridiem", c.PM), t[Y] != null) {
931
+ const l = parseInt(t[Y].substring(0, 3));
932
+ if (l >= 1e3)
933
+ return null;
934
+ s.assign("millisecond", l);
935
+ }
936
+ if (t[b] != null) {
937
+ const l = parseInt(t[b]);
938
+ if (l >= 60)
939
+ return null;
940
+ s.assign("second", l);
941
+ }
942
+ return s;
943
+ }
944
+ extractFollowingTimeComponents(e, t, n) {
945
+ const s = e.createParsingComponents();
946
+ if (t[Y] != null) {
947
+ const l = parseInt(t[Y].substring(0, 3));
948
+ if (l >= 1e3)
949
+ return null;
950
+ s.assign("millisecond", l);
951
+ }
952
+ if (t[b] != null) {
953
+ const l = parseInt(t[b]);
954
+ if (l >= 60)
955
+ return null;
956
+ s.assign("second", l);
957
+ }
958
+ let i = parseInt(t[j]), a = 0, o = -1;
959
+ if (t[A] != null ? a = parseInt(t[A]) : i > 100 && (a = i % 100, i = Math.floor(i / 100)), a >= 60 || i > 24)
960
+ return null;
961
+ if (i >= 12 && (o = c.PM), t[x] != null) {
962
+ if (i > 12)
963
+ return null;
964
+ const l = t[x][0].toLowerCase();
965
+ l == "a" && (o = c.AM, i == 12 && (i = 0, s.isCertain("day") || s.imply("day", s.get("day") + 1))), l == "p" && (o = c.PM, i != 12 && (i += 12)), n.start.isCertain("meridiem") || (o == c.AM ? (n.start.imply("meridiem", c.AM), n.start.get("hour") == 12 && n.start.assign("hour", 0)) : (n.start.imply("meridiem", c.PM), n.start.get("hour") != 12 && n.start.assign("hour", n.start.get("hour") + 12)));
966
+ }
967
+ return s.assign("hour", i), s.assign("minute", a), o >= 0 ? s.assign("meridiem", o) : n.start.isCertain("meridiem") && n.start.get("hour") > 12 ? n.start.get("hour") - 12 > i ? s.imply("meridiem", c.AM) : i <= 12 && (s.assign("hour", i + 12), s.assign("meridiem", c.PM)) : i > 12 ? s.imply("meridiem", c.PM) : i <= 12 && s.imply("meridiem", c.AM), s.date().getTime() < n.start.date().getTime() && s.imply("day", s.get("day") + 1), s;
968
+ }
969
+ checkAndReturnWithoutFollowingPattern(e) {
970
+ if (e.text.match(/^\d$/) || e.text.match(/^\d\d\d+$/) || e.text.match(/\d[apAP]$/))
971
+ return null;
972
+ const t = e.text.match(/[^\d:.](\d[\d.]+)$/);
973
+ if (t) {
974
+ const n = t[1];
975
+ if (this.strictMode || n.includes(".") && !n.match(/\d(\.\d{2})+$/) || parseInt(n) > 24)
976
+ return null;
977
+ }
978
+ return e;
979
+ }
980
+ checkAndReturnWithFollowingPattern(e) {
981
+ if (e.text.match(/^\d+-\d+$/))
982
+ return null;
983
+ const t = e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);
984
+ if (t) {
985
+ if (this.strictMode)
986
+ return null;
987
+ const n = t[1], s = t[2];
988
+ if (s.includes(".") && !s.match(/\d(\.\d{2})+$/))
989
+ return null;
990
+ const i = parseInt(s), a = parseInt(n);
991
+ if (i > 24 || a > 24)
992
+ return null;
993
+ }
994
+ return e;
995
+ }
996
+ cachedPrimaryPrefix = null;
997
+ cachedPrimarySuffix = null;
998
+ cachedPrimaryTimePattern = null;
999
+ getPrimaryTimePatternThroughCache() {
1000
+ const e = this.primaryPrefix(), t = this.primarySuffix();
1001
+ return this.cachedPrimaryPrefix === e && this.cachedPrimarySuffix === t ? this.cachedPrimaryTimePattern : (this.cachedPrimaryTimePattern = Gt(this.primaryPatternLeftBoundary(), e, t, this.patternFlags()), this.cachedPrimaryPrefix = e, this.cachedPrimarySuffix = t, this.cachedPrimaryTimePattern);
1002
+ }
1003
+ cachedFollowingPhase = null;
1004
+ cachedFollowingSuffix = null;
1005
+ cachedFollowingTimePatten = null;
1006
+ getFollowingTimePatternThroughCache() {
1007
+ const e = this.followingPhase(), t = this.followingSuffix();
1008
+ return this.cachedFollowingPhase === e && this.cachedFollowingSuffix === t ? this.cachedFollowingTimePatten : (this.cachedFollowingTimePatten = vt(e, t), this.cachedFollowingPhase = e, this.cachedFollowingSuffix = t, this.cachedFollowingTimePatten);
1009
+ }
1010
+ }
1011
+ class zt extends ee {
1012
+ constructor(e) {
1013
+ super(e);
1014
+ }
1015
+ followingPhase() {
1016
+ return "\\s*(?:\\-|\\–|\\~|\\〜|to|until|through|till|\\?)\\s*";
1017
+ }
1018
+ primaryPrefix() {
1019
+ return "(?:(?:at|from)\\s*)??";
1020
+ }
1021
+ primarySuffix() {
1022
+ return "(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)";
1023
+ }
1024
+ extractPrimaryTimeComponents(e, t) {
1025
+ const n = super.extractPrimaryTimeComponents(e, t);
1026
+ if (!n)
1027
+ return n;
1028
+ if (t[0].endsWith("night")) {
1029
+ const s = n.get("hour");
1030
+ s >= 6 && s < 12 ? (n.assign("hour", n.get("hour") + 12), n.assign("meridiem", c.PM)) : s < 6 && n.assign("meridiem", c.AM);
1031
+ }
1032
+ if (t[0].endsWith("afternoon")) {
1033
+ n.assign("meridiem", c.PM);
1034
+ const s = n.get("hour");
1035
+ s >= 0 && s <= 6 && n.assign("hour", n.get("hour") + 12);
1036
+ }
1037
+ return t[0].endsWith("morning") && (n.assign("meridiem", c.AM), n.get("hour") < 12 && n.assign("hour", n.get("hour"))), n.addTag("parser/ENTimeExpressionParser");
1038
+ }
1039
+ extractFollowingTimeComponents(e, t, n) {
1040
+ const s = super.extractFollowingTimeComponents(e, t, n);
1041
+ return s && s.addTag("parser/ENTimeExpressionParser"), s;
1042
+ }
1043
+ }
1044
+ const Bt = new RegExp(`(${U})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`, "i"), Lt = new RegExp(`(${z})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`, "i");
1045
+ class Ht extends g {
1046
+ strictMode;
1047
+ constructor(e) {
1048
+ super(), this.strictMode = e;
1049
+ }
1050
+ innerPattern() {
1051
+ return this.strictMode ? Lt : Bt;
1052
+ }
1053
+ innerExtract(e, t) {
1054
+ const n = $(t[1]);
1055
+ return n ? d.createRelativeFromReference(e.reference, k(n)) : null;
1056
+ }
1057
+ }
1058
+ const jt = new RegExp(`(${U})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`, "i"), Vt = new RegExp(`(${z})\\s{0,5}(later|after|from now)(?=\\W|$)`, "i"), Kt = 1;
1059
+ class Zt extends g {
1060
+ strictMode;
1061
+ constructor(e) {
1062
+ super(), this.strictMode = e;
1063
+ }
1064
+ innerPattern() {
1065
+ return this.strictMode ? Vt : jt;
1066
+ }
1067
+ innerExtract(e, t) {
1068
+ const n = $(t[Kt]);
1069
+ return n ? d.createRelativeFromReference(e.reference, n) : null;
1070
+ }
1071
+ }
1072
+ class Ze {
1073
+ refine(e, t) {
1074
+ return t.filter((n) => this.isValid(e, n));
1075
+ }
1076
+ }
1077
+ class I {
1078
+ refine(e, t) {
1079
+ if (t.length < 2)
1080
+ return t;
1081
+ const n = [];
1082
+ let s = t[0], i = null;
1083
+ for (let a = 1; a < t.length; a++) {
1084
+ i = t[a];
1085
+ const o = e.text.substring(s.index + s.text.length, i.index);
1086
+ if (!this.shouldMergeResults(o, s, i, e))
1087
+ n.push(s), s = i;
1088
+ else {
1089
+ const l = s, u = i, m = this.mergeResults(o, l, u, e);
1090
+ e.debug(() => {
1091
+ console.log(`${this.constructor.name} merged ${l} and ${u} into ${m}`);
1092
+ }), s = m;
1093
+ }
1094
+ }
1095
+ return s != null && n.push(s), n;
1096
+ }
1097
+ }
1098
+ class te extends I {
1099
+ shouldMergeResults(e, t, n) {
1100
+ return !t.end && !n.end && e.match(this.patternBetween()) != null;
1101
+ }
1102
+ mergeResults(e, t, n) {
1103
+ if (!t.start.isOnlyWeekdayComponent() && !n.start.isOnlyWeekdayComponent() && (n.start.getCertainComponents().forEach((i) => {
1104
+ t.start.isCertain(i) || t.start.imply(i, n.start.get(i));
1105
+ }), t.start.getCertainComponents().forEach((i) => {
1106
+ n.start.isCertain(i) || n.start.imply(i, t.start.get(i));
1107
+ })), t.start.date() > n.start.date()) {
1108
+ let i = t.start.date(), a = n.start.date();
1109
+ n.start.isOnlyWeekdayComponent() && T(a, { day: 7 }) > i ? (a = T(a, { day: 7 }), n.start.imply("day", a.getDate()), n.start.imply("month", a.getMonth() + 1), n.start.imply("year", a.getFullYear())) : t.start.isOnlyWeekdayComponent() && T(i, { day: -7 }) < a ? (i = T(i, { day: -7 }), t.start.imply("day", i.getDate()), t.start.imply("month", i.getMonth() + 1), t.start.imply("year", i.getFullYear())) : n.start.isDateWithUnknownYear() && T(a, { year: 1 }) > i ? (a = T(a, { year: 1 }), n.start.imply("year", a.getFullYear())) : t.start.isDateWithUnknownYear() && T(i, { year: -1 }) < a ? (i = T(i, { year: -1 }), t.start.imply("year", i.getFullYear())) : [n, t] = [t, n];
1110
+ }
1111
+ const s = t.clone();
1112
+ return s.start = t.start, s.end = n.start, s.index = Math.min(t.index, n.index), t.index < n.index ? s.text = t.text + e + n.text : s.text = n.text + e + t.text, s;
1113
+ }
1114
+ }
1115
+ class qt extends te {
1116
+ patternBetween() {
1117
+ return /^\s*(to|-|–|until|through|till)\s*$/i;
1118
+ }
1119
+ }
1120
+ function De(r, e) {
1121
+ const t = r.clone(), n = r.start, s = e.start;
1122
+ if (t.start = Re(n, s), r.end != null || e.end != null) {
1123
+ const i = r.end == null ? r.start : r.end, a = e.end == null ? e.start : e.end, o = Re(i, a);
1124
+ if (r.end == null && o.date().getTime() < t.start.date().getTime()) {
1125
+ const l = new Date(o.date().getTime());
1126
+ l.setDate(l.getDate() + 1), o.isCertain("day") ? P(o, l) : N(o, l);
1127
+ }
1128
+ t.end = o;
1129
+ }
1130
+ return t;
1131
+ }
1132
+ function Re(r, e) {
1133
+ const t = r.clone();
1134
+ e.isCertain("hour") ? (t.assign("hour", e.get("hour")), t.assign("minute", e.get("minute")), e.isCertain("second") ? (t.assign("second", e.get("second")), e.isCertain("millisecond") ? t.assign("millisecond", e.get("millisecond")) : t.imply("millisecond", e.get("millisecond"))) : (t.imply("second", e.get("second")), t.imply("millisecond", e.get("millisecond")))) : (t.imply("hour", e.get("hour")), t.imply("minute", e.get("minute")), t.imply("second", e.get("second")), t.imply("millisecond", e.get("millisecond"))), e.isCertain("timezoneOffset") && t.assign("timezoneOffset", e.get("timezoneOffset"));
1135
+ const n = r.get("meridiem") != null && (r.isCertain("meridiem") || Array.from(r.tags()).some((s) => s.startsWith("casualReference/")));
1136
+ return e.isCertain("meridiem") ? t.assign("meridiem", e.get("meridiem")) : e.get("meridiem") != null && !n && t.imply("meridiem", e.get("meridiem")), t.get("meridiem") == c.PM && t.get("hour") < 12 && (e.isCertain("hour") ? t.assign("hour", t.get("hour") + 12) : t.imply("hour", t.get("hour") + 12)), t.addTags(r.tags()), t.addTags(e.tags()), t;
1137
+ }
1138
+ class ne extends I {
1139
+ shouldMergeResults(e, t, n) {
1140
+ return (t.start.isOnlyDate() && n.start.isOnlyTime() || n.start.isOnlyDate() && t.start.isOnlyTime()) && e.match(this.patternBetween()) != null;
1141
+ }
1142
+ mergeResults(e, t, n) {
1143
+ const s = t.start.isOnlyDate() ? De(t, n) : De(n, t);
1144
+ return s.index = t.index, s.text = t.text + e + n.text, s;
1145
+ }
1146
+ }
1147
+ class Ae extends ne {
1148
+ patternBetween() {
1149
+ return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|∙|:)?\\s*$");
1150
+ }
1151
+ }
1152
+ const Jt = new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)", "i");
1153
+ class Xt {
1154
+ timezoneOverrides;
1155
+ constructor(e) {
1156
+ this.timezoneOverrides = e;
1157
+ }
1158
+ refine(e, t) {
1159
+ const n = e.option.timezones ?? {};
1160
+ return t.forEach((s) => {
1161
+ const i = e.text.substring(s.index + s.text.length), a = Jt.exec(i);
1162
+ if (!a)
1163
+ return;
1164
+ const o = a[1].toUpperCase(), l = s.start.date() ?? s.refDate ?? /* @__PURE__ */ new Date(), u = { ...this.timezoneOverrides, ...n }, m = ze(o, l, u);
1165
+ if (m == null)
1166
+ return;
1167
+ e.debug(() => {
1168
+ console.log(`Extracting timezone: '${o}' into: ${m} for: ${s.start}`);
1169
+ });
1170
+ const C = s.start.get("timezoneOffset");
1171
+ C !== null && m != C && (s.start.isCertain("timezoneOffset") || o != a[1]) || s.start.isOnlyDate() && o != a[1] || (s.text += a[0], s.start.isCertain("timezoneOffset") || s.start.assign("timezoneOffset", m), s.end != null && !s.end.isCertain("timezoneOffset") && s.end.assign("timezoneOffset", m));
1172
+ }), t;
1173
+ }
1174
+ }
1175
+ const Qt = new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?", "i"), en = 1, tn = 2, nn = 3;
1176
+ class sn {
1177
+ refine(e, t) {
1178
+ return t.forEach(function(n) {
1179
+ if (n.start.isCertain("timezoneOffset"))
1180
+ return;
1181
+ const s = e.text.substring(n.index + n.text.length), i = Qt.exec(s);
1182
+ if (!i)
1183
+ return;
1184
+ e.debug(() => {
1185
+ console.log(`Extracting timezone: '${i[0]}' into : ${n}`);
1186
+ });
1187
+ const a = parseInt(i[tn]), o = parseInt(i[nn] || "0");
1188
+ let l = a * 60 + o;
1189
+ l > 840 || (i[en] === "-" && (l = -l), n.end != null && n.end.assign("timezoneOffset", l), n.start.assign("timezoneOffset", l), n.text += i[0]);
1190
+ }), t;
1191
+ }
1192
+ }
1193
+ class J {
1194
+ refine(e, t) {
1195
+ if (t.length < 2)
1196
+ return t;
1197
+ const n = [];
1198
+ let s = t[0];
1199
+ for (let i = 1; i < t.length; i++) {
1200
+ const a = t[i];
1201
+ if (a.index >= s.index + s.text.length) {
1202
+ n.push(s), s = a;
1203
+ continue;
1204
+ }
1205
+ let o = null, l = null;
1206
+ a.text.length > s.text.length ? (o = a, l = s) : (o = s, l = a), e.debug(() => {
1207
+ console.log(`${this.constructor.name} remove ${l} by ${o}`);
1208
+ }), s = o;
1209
+ }
1210
+ return s != null && n.push(s), n;
1211
+ }
1212
+ }
1213
+ function se(r, e, t) {
1214
+ const n = r.getDateWithAdjustedTimezone(), s = rn(n, e, t);
1215
+ let i = new d(r);
1216
+ return i = i.addDurationAsImplied({ day: s }), i.assign("weekday", e), i;
1217
+ }
1218
+ function rn(r, e, t) {
1219
+ const n = r.getDay();
1220
+ switch (t) {
1221
+ case "this":
1222
+ return O(r, e);
1223
+ case "last":
1224
+ return qe(r, e);
1225
+ case "next":
1226
+ return n == f.SUNDAY ? e == f.SUNDAY ? 7 : e : n == f.SATURDAY ? e == f.SATURDAY ? 7 : e == f.SUNDAY ? 8 : 1 + e : e < n && e != f.SUNDAY ? O(r, e) : O(r, e) + 7;
1227
+ }
1228
+ return an(r, e);
1229
+ }
1230
+ function an(r, e) {
1231
+ const t = qe(r, e), n = O(r, e);
1232
+ return n < -t ? n : t;
1233
+ }
1234
+ function O(r, e) {
1235
+ const t = r.getDay();
1236
+ let n = e - t;
1237
+ return n < 0 && (n += 7), n;
1238
+ }
1239
+ function qe(r, e) {
1240
+ const t = r.getDay();
1241
+ let n = e - t;
1242
+ return n >= 0 && (n -= 7), n;
1243
+ }
1244
+ class on {
1245
+ refine(e, t) {
1246
+ return e.option.forwardDate && t.forEach((n) => {
1247
+ let s = e.reference.getDateWithAdjustedTimezone();
1248
+ if (n.start.isOnlyTime() && e.reference.instant > n.start.date()) {
1249
+ const i = e.reference.getDateWithAdjustedTimezone(), a = new Date(i);
1250
+ a.setDate(a.getDate() + 1), N(n.start, a), e.debug(() => {
1251
+ console.log(`${this.constructor.name} adjusted ${n} time from the ref date (${i}) to the following day (${a})`);
1252
+ }), n.end && n.end.isOnlyTime() && (N(n.end, a), n.start.date() > n.end.date() && (a.setDate(a.getDate() + 1), N(n.end, a)));
1253
+ }
1254
+ if (n.start.isOnlyWeekdayComponent() && s > n.start.date()) {
1255
+ let i = O(s, n.start.get("weekday")) || 7;
1256
+ const a = T(s, { day: i });
1257
+ if (N(n.start, a), e.debug(() => {
1258
+ console.log(`${this.constructor.name} adjusted ${n} weekday (${n.start})`);
1259
+ }), n.end && n.start.date() > n.end.date()) {
1260
+ let o = O(s, n.start.get("weekday")) || 7;
1261
+ const l = T(s, { day: o });
1262
+ N(n.end, l), e.debug(() => {
1263
+ console.log(`${this.constructor.name} adjusted ${n} weekday (${n.end})`);
1264
+ });
1265
+ }
1266
+ }
1267
+ if (n.start.isDateWithUnknownYear() && s > n.start.date())
1268
+ for (let i = 0; i < 3 && s > n.start.date(); i++)
1269
+ n.start.imply("year", n.start.get("year") + 1), e.debug(() => {
1270
+ console.log(`${this.constructor.name} adjusted ${n} year (${n.start})`);
1271
+ }), n.end && !n.end.isCertain("year") && (n.end.imply("year", n.end.get("year") + 1), e.debug(() => {
1272
+ console.log(`${this.constructor.name} adjusted ${n} month (${n.start})`);
1273
+ }));
1274
+ }), t;
1275
+ }
1276
+ }
1277
+ class ln extends Ze {
1278
+ strictMode;
1279
+ constructor(e) {
1280
+ super(), this.strictMode = e;
1281
+ }
1282
+ isValid(e, t) {
1283
+ return t.text.replace(" ", "").match(/^\d*(\.\d*)?$/) ? (e.debug(() => {
1284
+ console.log(`Removing unlikely result '${t.text}'`);
1285
+ }), !1) : t.start.isValidDate() ? t.end && !t.end.isValidDate() ? (e.debug(() => {
1286
+ console.log(`Removing invalid result: ${t} (${t.end})`);
1287
+ }), !1) : this.strictMode ? this.isStrictModeValid(e, t) : !0 : (e.debug(() => {
1288
+ console.log(`Removing invalid result: ${t} (${t.start})`);
1289
+ }), !1);
1290
+ }
1291
+ isStrictModeValid(e, t) {
1292
+ return t.start.isOnlyWeekdayComponent() ? (e.debug(() => {
1293
+ console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`);
1294
+ }), !1) : !0;
1295
+ }
1296
+ }
1297
+ const cn = new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)", "i"), un = 1, dn = 2, fn = 3, xe = 4, gn = 5, Ne = 6, Oe = 7, mn = 8, Me = 9, $e = 10;
1298
+ class hn extends g {
1299
+ innerPattern() {
1300
+ return cn;
1301
+ }
1302
+ innerExtract(e, t) {
1303
+ const n = e.createParsingComponents({
1304
+ year: parseInt(t[un]),
1305
+ month: parseInt(t[dn]),
1306
+ day: parseInt(t[fn])
1307
+ });
1308
+ if (t[xe] != null && (n.assign("hour", parseInt(t[xe])), n.assign("minute", parseInt(t[gn])), t[Ne] != null && n.assign("second", parseInt(t[Ne])), t[Oe] != null && n.assign("millisecond", parseInt(t[Oe])), t[mn] != null)) {
1309
+ let s = 0;
1310
+ if (t[Me]) {
1311
+ const i = parseInt(t[Me]);
1312
+ let a = 0;
1313
+ t[$e] != null && (a = parseInt(t[$e])), s = i * 60, s < 0 ? s -= a : s += a;
1314
+ }
1315
+ n.assign("timezoneOffset", s);
1316
+ }
1317
+ return n.addTag("parser/ISOFormatParser");
1318
+ }
1319
+ }
1320
+ class Tn extends I {
1321
+ mergeResults(e, t, n) {
1322
+ const s = n.clone();
1323
+ return s.index = t.index, s.text = t.text + e + s.text, s.start.assign("weekday", t.start.get("weekday")), s.end && s.end.assign("weekday", t.start.get("weekday")), s;
1324
+ }
1325
+ shouldMergeResults(e, t, n) {
1326
+ return t.start.isOnlyWeekdayComponent() && !t.start.isCertain("hour") && n.start.isCertain("day") && e.match(/^,?\s*$/) != null;
1327
+ }
1328
+ }
1329
+ function re(r, e = !1) {
1330
+ return r.parsers.unshift(new hn()), r.refiners.unshift(new Tn()), r.refiners.unshift(new sn()), r.refiners.unshift(new J()), r.refiners.push(new Xt()), r.refiners.push(new J()), r.refiners.push(new on()), r.refiners.push(new ln(e)), r;
1331
+ }
1332
+ function ie(r) {
1333
+ const e = r.getDateWithAdjustedTimezone(), t = new d(r, {});
1334
+ return P(t, e), ve(t, e), t.assign("timezoneOffset", r.getTimezoneOffset()), t.addTag("casualReference/now"), t;
1335
+ }
1336
+ function ae(r) {
1337
+ const e = r.getDateWithAdjustedTimezone(), t = new d(r, {});
1338
+ return P(t, e), S(t, e), t.delete("meridiem"), t.addTag("casualReference/today"), t;
1339
+ }
1340
+ function oe(r) {
1341
+ return yn(r).addTag("casualReference/yesterday");
1342
+ }
1343
+ function le(r) {
1344
+ return ce(r, 1).addTag("casualReference/tomorrow");
1345
+ }
1346
+ function yn(r, e) {
1347
+ return ce(r, -1);
1348
+ }
1349
+ function ce(r, e) {
1350
+ const t = r.getDateWithAdjustedTimezone(), n = new d(r, {}), s = new Date(t.getTime());
1351
+ return s.setDate(s.getDate() + e), P(n, s), S(n, s), n.delete("meridiem"), n;
1352
+ }
1353
+ function pn(r, e = 22) {
1354
+ const t = r.getDateWithAdjustedTimezone(), n = new d(r, {});
1355
+ return P(n, t), n.imply("hour", e), n.imply("meridiem", c.PM), n.addTag("casualReference/tonight"), n;
1356
+ }
1357
+ function En(r, e = 20) {
1358
+ const t = new d(r, {});
1359
+ return t.imply("meridiem", c.PM), t.imply("hour", e), t.addTag("casualReference/evening"), t;
1360
+ }
1361
+ function wn(r) {
1362
+ const e = new d(r, {});
1363
+ return r.getDateWithAdjustedTimezone().getHours() > 2 && e.addDurationAsImplied({ day: 1 }), e.assign("hour", 0), e.imply("minute", 0), e.imply("second", 0), e.imply("millisecond", 0), e.addTag("casualReference/midnight"), e;
1364
+ }
1365
+ function Pn(r, e = 6) {
1366
+ const t = new d(r, {});
1367
+ return t.imply("meridiem", c.AM), t.imply("hour", e), t.imply("minute", 0), t.imply("second", 0), t.imply("millisecond", 0), t.addTag("casualReference/morning"), t;
1368
+ }
1369
+ function Dn(r, e = 15) {
1370
+ const t = new d(r, {});
1371
+ return t.imply("meridiem", c.PM), t.imply("hour", e), t.imply("minute", 0), t.imply("second", 0), t.imply("millisecond", 0), t.addTag("casualReference/afternoon"), t;
1372
+ }
1373
+ function Rn(r) {
1374
+ const e = new d(r, {});
1375
+ return e.imply("meridiem", c.AM), e.assign("hour", 12), e.imply("minute", 0), e.imply("second", 0), e.imply("millisecond", 0), e.addTag("casualReference/noon"), e;
1376
+ }
1377
+ const An = /(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i;
1378
+ class xn extends g {
1379
+ innerPattern(e) {
1380
+ return An;
1381
+ }
1382
+ innerExtract(e, t) {
1383
+ let n = e.refDate;
1384
+ const s = t[0].toLowerCase();
1385
+ let i = e.createParsingComponents();
1386
+ switch (s) {
1387
+ case "now":
1388
+ i = ie(e.reference);
1389
+ break;
1390
+ case "today":
1391
+ i = ae(e.reference);
1392
+ break;
1393
+ case "yesterday":
1394
+ i = oe(e.reference);
1395
+ break;
1396
+ case "tomorrow":
1397
+ case "tmr":
1398
+ case "tmrw":
1399
+ i = le(e.reference);
1400
+ break;
1401
+ case "tonight":
1402
+ i = pn(e.reference);
1403
+ break;
1404
+ case "overmorrow":
1405
+ i = ce(e.reference, 2);
1406
+ break;
1407
+ default:
1408
+ if (s.match(/last\s*night/)) {
1409
+ if (n.getHours() > 6) {
1410
+ const a = new Date(n.getTime());
1411
+ a.setDate(a.getDate() - 1), n = a;
1412
+ }
1413
+ P(i, n), i.imply("hour", 0);
1414
+ }
1415
+ break;
1416
+ }
1417
+ return i.addTag("parser/ENCasualDateParser"), i;
1418
+ }
1419
+ }
1420
+ const Nn = /(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i;
1421
+ class On extends g {
1422
+ innerPattern() {
1423
+ return Nn;
1424
+ }
1425
+ innerExtract(e, t) {
1426
+ let n = null;
1427
+ switch (t[1].toLowerCase()) {
1428
+ case "afternoon":
1429
+ n = Dn(e.reference);
1430
+ break;
1431
+ case "evening":
1432
+ case "night":
1433
+ n = En(e.reference);
1434
+ break;
1435
+ case "midnight":
1436
+ n = wn(e.reference);
1437
+ break;
1438
+ case "morning":
1439
+ n = Pn(e.reference);
1440
+ break;
1441
+ case "noon":
1442
+ case "midday":
1443
+ n = Rn(e.reference);
1444
+ break;
1445
+ }
1446
+ return n && n.addTag("parser/ENCasualTimeParser"), n;
1447
+ }
1448
+ }
1449
+ const Mn = new RegExp(`(?:(?:\\,|\\(|\\()\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${h(K)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\)))?(?:\\s*(?:of\\s*)?(this|last|past|next)\\s*week)?(?=\\W|$)`, "i"), $n = 1, Cn = 2, Sn = 3;
1450
+ class _n extends g {
1451
+ innerPattern() {
1452
+ return Mn;
1453
+ }
1454
+ innerExtract(e, t) {
1455
+ const n = t[$n], s = t[Sn];
1456
+ let i = n || s;
1457
+ i = i || "", i = i.toLowerCase();
1458
+ let a = null;
1459
+ i == "last" || i == "past" ? a = "last" : i == "next" ? a = "next" : i == "this" && (a = "this");
1460
+ const o = t[Cn].toLowerCase();
1461
+ let l;
1462
+ if (K[o] !== void 0)
1463
+ l = K[o];
1464
+ else if (o == "weekend")
1465
+ l = a == "last" ? f.SUNDAY : f.SATURDAY;
1466
+ else if (o == "weekday") {
1467
+ const u = e.reference.getDateWithAdjustedTimezone().getDay();
1468
+ u == f.SUNDAY || u == f.SATURDAY ? l = a == "last" ? f.FRIDAY : f.MONDAY : (l = u - 1, l = a == "last" ? l - 1 : l + 1, l = l % 5 + 1);
1469
+ } else
1470
+ return null;
1471
+ return se(e.reference, l, a);
1472
+ }
1473
+ }
1474
+ const Un = new RegExp(`(this|last|past|next|after\\s*this)\\s*(${h(G)})(?=\\s*)(?=\\W|$)`, "i"), In = 1, bn = 2;
1475
+ class Yn extends g {
1476
+ innerPattern() {
1477
+ return Un;
1478
+ }
1479
+ innerExtract(e, t) {
1480
+ const n = t[In].toLowerCase(), s = t[bn].toLowerCase(), i = G[s];
1481
+ if (n == "next" || n.startsWith("after")) {
1482
+ const l = {};
1483
+ return l[i] = 1, d.createRelativeFromReference(e.reference, l);
1484
+ }
1485
+ if (n == "last" || n == "past") {
1486
+ const l = {};
1487
+ return l[i] = -1, d.createRelativeFromReference(e.reference, l);
1488
+ }
1489
+ const a = e.createParsingComponents();
1490
+ let o = new Date(e.reference.instant.getTime());
1491
+ return s.match(/week/i) ? (o.setDate(o.getDate() - o.getDay()), a.imply("day", o.getDate()), a.imply("month", o.getMonth() + 1), a.imply("year", o.getFullYear())) : s.match(/month/i) ? (o.setDate(1), a.imply("day", o.getDate()), a.assign("year", o.getFullYear()), a.assign("month", o.getMonth() + 1)) : s.match(/year/i) && (o.setDate(1), o.setMonth(0), a.imply("day", o.getDate()), a.imply("month", o.getMonth() + 1), a.assign("year", o.getFullYear())), a;
1492
+ }
1493
+ }
1494
+ const Fn = new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)", "i"), Wn = 1, kn = 5, Ce = 2, Se = 3, V = 4;
1495
+ class ue {
1496
+ groupNumberMonth;
1497
+ groupNumberDay;
1498
+ constructor(e) {
1499
+ this.groupNumberMonth = e ? Se : Ce, this.groupNumberDay = e ? Ce : Se;
1500
+ }
1501
+ pattern() {
1502
+ return Fn;
1503
+ }
1504
+ extract(e, t) {
1505
+ const n = t.index + t[Wn].length, s = t.index + t[0].length - t[kn].length;
1506
+ if (n > 0 && e.text.substring(0, n).match("\\d/?$") || s < e.text.length && e.text.substring(s).match("^/?\\d"))
1507
+ return;
1508
+ const i = e.text.substring(n, s);
1509
+ if (i.match(/^\d\.\d$/) || i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/) || !t[V] && i.indexOf("/") < 0)
1510
+ return;
1511
+ const a = e.createParsingResult(n, i);
1512
+ let o = parseInt(t[this.groupNumberMonth]), l = parseInt(t[this.groupNumberDay]);
1513
+ if ((o < 1 || o > 12) && o > 12)
1514
+ if (l >= 1 && l <= 12 && o <= 31)
1515
+ [l, o] = [o, l];
1516
+ else
1517
+ return null;
1518
+ if (l < 1 || l > 31)
1519
+ return null;
1520
+ if (a.start.assign("day", l), a.start.assign("month", o), t[V]) {
1521
+ const u = parseInt(t[V]), m = Be(u);
1522
+ a.start.assign("year", m);
1523
+ } else {
1524
+ const u = M(e.refDate, l, o);
1525
+ a.start.imply("year", u);
1526
+ }
1527
+ return a.addTag("parser/SlashDateFormatParser");
1528
+ }
1529
+ }
1530
+ const Gn = new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${U})(?=\\W|$)`, "i"), vn = new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${z})(?=\\W|$)`, "i");
1531
+ class zn extends g {
1532
+ allowAbbreviations;
1533
+ constructor(e = !0) {
1534
+ super(), this.allowAbbreviations = e;
1535
+ }
1536
+ innerPattern() {
1537
+ return this.allowAbbreviations ? Gn : vn;
1538
+ }
1539
+ innerExtract(e, t) {
1540
+ const n = t[1].toLowerCase();
1541
+ let s = $(t[2]);
1542
+ if (!s)
1543
+ return null;
1544
+ switch (n) {
1545
+ case "last":
1546
+ case "past":
1547
+ case "-":
1548
+ s = k(s);
1549
+ break;
1550
+ }
1551
+ return d.createRelativeFromReference(e.reference, s);
1552
+ }
1553
+ }
1554
+ function Bn(r) {
1555
+ return r.text.match(/^[+-]/i) != null;
1556
+ }
1557
+ function _e(r) {
1558
+ return r.text.match(/^-/i) != null;
1559
+ }
1560
+ class Ln extends I {
1561
+ shouldMergeResults(e, t, n) {
1562
+ return e.match(/^\s*$/i) ? Bn(n) || _e(n) : !1;
1563
+ }
1564
+ mergeResults(e, t, n, s) {
1565
+ let i = $(n.text);
1566
+ _e(n) && (i = k(i));
1567
+ const a = d.createRelativeFromReference(E.fromDate(t.start.date()), i);
1568
+ return new D(t.reference, t.index, `${t.text}${e}${n.text}`, a);
1569
+ }
1570
+ }
1571
+ function Ue(r) {
1572
+ return r.text.match(/\s+(before|from)$/i) != null;
1573
+ }
1574
+ function Hn(r) {
1575
+ return r.text.match(/\s+(after|since)$/i) != null;
1576
+ }
1577
+ class jn extends I {
1578
+ patternBetween() {
1579
+ return /^\s*$/i;
1580
+ }
1581
+ shouldMergeResults(e, t, n) {
1582
+ return !e.match(this.patternBetween()) || !Ue(t) && !Hn(t) ? !1 : !!n.start.get("day") && !!n.start.get("month") && !!n.start.get("year");
1583
+ }
1584
+ mergeResults(e, t, n) {
1585
+ let s = $(t.text);
1586
+ Ue(t) && (s = k(s));
1587
+ const i = d.createRelativeFromReference(E.fromDate(n.start.date()), s);
1588
+ return new D(n.reference, t.index, `${t.text}${e}${n.text}`, i);
1589
+ }
1590
+ }
1591
+ const Vn = new RegExp(`^\\s*(${v})`, "i"), Kn = 1;
1592
+ class Zn {
1593
+ refine(e, t) {
1594
+ return t.forEach(function(n) {
1595
+ if (!n.start.isDateWithUnknownYear())
1596
+ return;
1597
+ const s = e.text.substring(n.index + n.text.length), i = Vn.exec(s);
1598
+ if (!i || i[0].trim().length <= 3)
1599
+ return;
1600
+ e.debug(() => {
1601
+ console.log(`Extracting year: '${i[0]}' into : ${n}`);
1602
+ });
1603
+ const a = _(i[Kn]);
1604
+ n.end != null && n.end.assign("year", a), n.start.assign("year", a), n.text += i[0];
1605
+ }), t;
1606
+ }
1607
+ }
1608
+ class qn extends Ze {
1609
+ constructor() {
1610
+ super();
1611
+ }
1612
+ isValid(e, t) {
1613
+ const n = t.text.trim();
1614
+ return n === e.text.trim() ? !0 : n.toLowerCase() === "may" && !e.text.substring(0, t.index).trim().match(/\b(in)$/i) ? (e.debug(() => {
1615
+ console.log(`Removing unlikely result: ${t}`);
1616
+ }), !1) : n.toLowerCase().endsWith("the second") ? (e.text.substring(t.index + t.text.length).trim().length > 0 && e.debug(() => {
1617
+ console.log(`Removing unlikely result: ${t}`);
1618
+ }), !1) : !0;
1619
+ }
1620
+ }
1621
+ class Je {
1622
+ createCasualConfiguration(e = !1) {
1623
+ const t = this.createConfiguration(!1, e);
1624
+ return t.parsers.push(new xn()), t.parsers.push(new On()), t.parsers.push(new xt()), t.parsers.push(new Yn()), t.parsers.push(new zn()), t.refiners.push(new qn()), t;
1625
+ }
1626
+ createConfiguration(e = !0, t = !1) {
1627
+ const n = re({
1628
+ parsers: [
1629
+ new ue(t),
1630
+ new ht(e),
1631
+ new pt(),
1632
+ new Pt(t),
1633
+ new _n(),
1634
+ new kt(),
1635
+ new zt(e),
1636
+ new Ht(e),
1637
+ new Zt(e),
1638
+ new bt()
1639
+ ],
1640
+ refiners: [new Ae()]
1641
+ }, e);
1642
+ return n.parsers.unshift(new Ct(e)), n.refiners.unshift(new jn()), n.refiners.unshift(new Ln()), n.refiners.unshift(new J()), n.refiners.push(new Ae()), n.refiners.push(new Zn()), n.refiners.push(new qt()), n;
1643
+ }
1644
+ }
1645
+ class y {
1646
+ parsers;
1647
+ refiners;
1648
+ defaultConfig = new Je();
1649
+ constructor(e) {
1650
+ e = e || this.defaultConfig.createCasualConfiguration(), this.parsers = [...e.parsers], this.refiners = [...e.refiners];
1651
+ }
1652
+ clone() {
1653
+ return new y({
1654
+ parsers: [...this.parsers],
1655
+ refiners: [...this.refiners]
1656
+ });
1657
+ }
1658
+ parseDate(e, t, n) {
1659
+ const s = this.parse(e, t, n);
1660
+ return s.length > 0 ? s[0].start.date() : null;
1661
+ }
1662
+ parse(e, t, n) {
1663
+ const s = new Jn(e, t, n);
1664
+ let i = [];
1665
+ return this.parsers.forEach((a) => {
1666
+ const o = y.executeParser(s, a);
1667
+ i = i.concat(o);
1668
+ }), i.sort((a, o) => a.index - o.index), this.refiners.forEach(function(a) {
1669
+ i = a.refine(s, i);
1670
+ }), i;
1671
+ }
1672
+ static executeParser(e, t) {
1673
+ const n = [], s = t.pattern(e), i = e.text;
1674
+ let a = e.text, o = s.exec(a);
1675
+ for (; o; ) {
1676
+ const l = o.index + i.length - a.length;
1677
+ o.index = l;
1678
+ const u = t.extract(e, o);
1679
+ if (!u) {
1680
+ a = i.substring(o.index + 1), o = s.exec(a);
1681
+ continue;
1682
+ }
1683
+ let m = null;
1684
+ u instanceof D ? m = u : u instanceof d ? (m = e.createParsingResult(o.index, o[0]), m.start = u) : m = e.createParsingResult(o.index, o[0], u);
1685
+ const C = m.index, ge = m.text;
1686
+ e.debug(() => console.log(`${t.constructor.name} extracted (at index=${C}) '${ge}'`)), n.push(m), a = i.substring(C + ge.length), o = s.exec(a);
1687
+ }
1688
+ return n;
1689
+ }
1690
+ }
1691
+ class Jn {
1692
+ text;
1693
+ option;
1694
+ reference;
1695
+ refDate;
1696
+ constructor(e, t, n) {
1697
+ this.text = e, this.option = n ?? {}, this.reference = E.fromInput(t, this.option.timezones), this.refDate = this.reference.instant;
1698
+ }
1699
+ createParsingComponents(e) {
1700
+ return e instanceof d ? e : new d(this.reference, e);
1701
+ }
1702
+ createParsingResult(e, t, n, s) {
1703
+ const i = typeof t == "string" ? t : this.text.substring(e, t), a = n ? this.createParsingComponents(n) : null, o = s ? this.createParsingComponents(s) : null;
1704
+ return new D(this.reference, e, i, a, o);
1705
+ }
1706
+ debug(e) {
1707
+ this.option.debug && (this.option.debug instanceof Function ? this.option.debug(e) : this.option.debug.debug(e));
1708
+ }
1709
+ }
1710
+ const B = new Je(), Xn = new y(B.createCasualConfiguration(!1));
1711
+ new y(B.createConfiguration(!0, !1));
1712
+ new y(B.createCasualConfiguration(!0));
1713
+ const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1714
+ __proto__: null,
1715
+ Chrono: y,
1716
+ get Meridiem() {
1717
+ return c;
1718
+ },
1719
+ ParsingComponents: d,
1720
+ ParsingResult: D,
1721
+ ReferenceWithTimezone: E,
1722
+ get Weekday() {
1723
+ return f;
1724
+ },
1725
+ casual: Xn,
1726
+ configuration: B
1727
+ }, Symbol.toStringTag, { value: "Module" })), Xe = {
1728
+ domingo: 0,
1729
+ dom: 0,
1730
+ segunda: 1,
1731
+ "segunda-feira": 1,
1732
+ seg: 1,
1733
+ terça: 2,
1734
+ "terça-feira": 2,
1735
+ ter: 2,
1736
+ quarta: 3,
1737
+ "quarta-feira": 3,
1738
+ qua: 3,
1739
+ quinta: 4,
1740
+ "quinta-feira": 4,
1741
+ qui: 4,
1742
+ sexta: 5,
1743
+ "sexta-feira": 5,
1744
+ sex: 5,
1745
+ sábado: 6,
1746
+ sabado: 6,
1747
+ sab: 6
1748
+ }, Qe = {
1749
+ janeiro: 1,
1750
+ jan: 1,
1751
+ "jan.": 1,
1752
+ fevereiro: 2,
1753
+ fev: 2,
1754
+ "fev.": 2,
1755
+ março: 3,
1756
+ mar: 3,
1757
+ "mar.": 3,
1758
+ abril: 4,
1759
+ abr: 4,
1760
+ "abr.": 4,
1761
+ maio: 5,
1762
+ mai: 5,
1763
+ "mai.": 5,
1764
+ junho: 6,
1765
+ jun: 6,
1766
+ "jun.": 6,
1767
+ julho: 7,
1768
+ jul: 7,
1769
+ "jul.": 7,
1770
+ agosto: 8,
1771
+ ago: 8,
1772
+ "ago.": 8,
1773
+ setembro: 9,
1774
+ set: 9,
1775
+ "set.": 9,
1776
+ outubro: 10,
1777
+ out: 10,
1778
+ "out.": 10,
1779
+ novembro: 11,
1780
+ nov: 11,
1781
+ "nov.": 11,
1782
+ dezembro: 12,
1783
+ dez: 12,
1784
+ "dez.": 12
1785
+ }, Qn = "[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";
1786
+ function es(r) {
1787
+ if (r.match(/^[0-9]{1,4}$/)) {
1788
+ let e = parseInt(r);
1789
+ return e < 100 && (e > 50 ? e = e + 1900 : e = e + 2e3), e;
1790
+ }
1791
+ return r.match(/a\.?\s*c\.?/i) ? (r = r.replace(/a\.?\s*c\.?/i, ""), -parseInt(r)) : parseInt(r);
1792
+ }
1793
+ const ts = new RegExp(`(?:(?:\\,|\\(|\\()\\s*)?(?:(este|esta|passado|pr[oó]ximo)\\s*)?(${h(Xe)})(?:\\s*(?:\\,|\\)|\\)))?(?:\\s*(este|esta|passado|pr[óo]ximo)\\s*semana)?(?=\\W|\\d|$)`, "i"), ns = 1, ss = 2, rs = 3;
1794
+ class is extends g {
1795
+ innerPattern() {
1796
+ return ts;
1797
+ }
1798
+ innerExtract(e, t) {
1799
+ const n = t[ss].toLowerCase(), s = Xe[n];
1800
+ if (s === void 0)
1801
+ return null;
1802
+ const i = t[ns], a = t[rs];
1803
+ let o = i || a || "";
1804
+ o = o.toLowerCase();
1805
+ let l = null;
1806
+ return o == "passado" ? l = "this" : o == "próximo" || o == "proximo" ? l = "next" : o == "este" && (l = "this"), se(e.reference, s, l);
1807
+ }
1808
+ }
1809
+ class as extends ee {
1810
+ primaryPrefix() {
1811
+ return "(?:(?:ao?|às?|das|da|de|do)\\s*)?";
1812
+ }
1813
+ followingPhase() {
1814
+ return "\\s*(?:\\-|\\–|\\~|\\〜|a(?:o)?|\\?)\\s*";
1815
+ }
1816
+ }
1817
+ class os extends ne {
1818
+ patternBetween() {
1819
+ return new RegExp("^\\s*(?:,|à)?\\s*$");
1820
+ }
1821
+ }
1822
+ class ls extends te {
1823
+ patternBetween() {
1824
+ return /^\s*(?:-)\s*$/i;
1825
+ }
1826
+ }
1827
+ const cs = new RegExp(`([0-9]{1,2})(?:º|ª|°)?(?:\\s*(?:desde|de|\\-|\\–|ao?|\\s)\\s*([0-9]{1,2})(?:º|ª|°)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${h(Qe)})(?:\\s*(?:de|,)?\\s*(${Qn}))?(?=\\W|$)`, "i"), Ie = 1, be = 2, us = 3, Ye = 4;
1828
+ class ds extends g {
1829
+ innerPattern() {
1830
+ return cs;
1831
+ }
1832
+ innerExtract(e, t) {
1833
+ const n = e.createParsingResult(t.index, t[0]), s = Qe[t[us].toLowerCase()], i = parseInt(t[Ie]);
1834
+ if (i > 31)
1835
+ return t.index = t.index + t[Ie].length, null;
1836
+ if (n.start.assign("month", s), n.start.assign("day", i), t[Ye]) {
1837
+ const a = es(t[Ye]);
1838
+ n.start.assign("year", a);
1839
+ } else {
1840
+ const a = M(e.refDate, i, s);
1841
+ n.start.imply("year", a);
1842
+ }
1843
+ if (t[be]) {
1844
+ const a = parseInt(t[be]);
1845
+ n.end = n.start.clone(), n.end.assign("day", a);
1846
+ }
1847
+ return n;
1848
+ }
1849
+ }
1850
+ class fs extends g {
1851
+ innerPattern(e) {
1852
+ return /(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i;
1853
+ }
1854
+ innerExtract(e, t) {
1855
+ const n = t[0].toLowerCase(), s = e.createParsingComponents();
1856
+ switch (n) {
1857
+ case "agora":
1858
+ return ie(e.reference);
1859
+ case "hoje":
1860
+ return ae(e.reference);
1861
+ case "amanha":
1862
+ case "amanhã":
1863
+ return le(e.reference);
1864
+ case "ontem":
1865
+ return oe(e.reference);
1866
+ }
1867
+ return s;
1868
+ }
1869
+ }
1870
+ class gs extends g {
1871
+ innerPattern() {
1872
+ return /(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i;
1873
+ }
1874
+ innerExtract(e, t) {
1875
+ const n = e.refDate, s = e.createParsingComponents();
1876
+ switch (t[1].toLowerCase()) {
1877
+ case "tarde":
1878
+ s.imply("meridiem", c.PM), s.imply("hour", 15), s.addTag("casualReference/afternoon");
1879
+ break;
1880
+ case "noite":
1881
+ s.imply("meridiem", c.PM), s.imply("hour", 22), s.addTag("casualReference/evening");
1882
+ break;
1883
+ case "manha":
1884
+ case "manhã":
1885
+ s.imply("meridiem", c.AM), s.imply("hour", 6), s.addTag("casualReference/morning");
1886
+ break;
1887
+ case "meia-noite":
1888
+ const i = new Date(n.getTime());
1889
+ i.setDate(i.getDate() + 1), P(s, i), S(s, i), s.imply("hour", 0), s.imply("minute", 0), s.imply("second", 0), s.addTag("casualReference/midnight");
1890
+ break;
1891
+ case "meio-dia":
1892
+ s.imply("meridiem", c.AM), s.imply("hour", 12), s.addTag("casualReference/noon");
1893
+ break;
1894
+ }
1895
+ return s;
1896
+ }
1897
+ }
1898
+ const ms = new y(et());
1899
+ new y(de(!0));
1900
+ function et(r = !0) {
1901
+ const e = de(!1, r);
1902
+ return e.parsers.push(new fs()), e.parsers.push(new gs()), e;
1903
+ }
1904
+ function de(r = !0, e = !0) {
1905
+ return re({
1906
+ parsers: [
1907
+ new ue(e),
1908
+ new is(),
1909
+ new as(),
1910
+ new ds()
1911
+ ],
1912
+ refiners: [new os(), new ls()]
1913
+ }, r);
1914
+ }
1915
+ const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1916
+ __proto__: null,
1917
+ Chrono: y,
1918
+ get Meridiem() {
1919
+ return c;
1920
+ },
1921
+ ParsingComponents: d,
1922
+ ParsingResult: D,
1923
+ ReferenceWithTimezone: E,
1924
+ get Weekday() {
1925
+ return f;
1926
+ },
1927
+ casual: ms,
1928
+ createCasualConfiguration: et,
1929
+ createConfiguration: de
1930
+ }, Symbol.toStringTag, { value: "Module" })), tt = {
1931
+ domingo: 0,
1932
+ dom: 0,
1933
+ lunes: 1,
1934
+ lun: 1,
1935
+ martes: 2,
1936
+ mar: 2,
1937
+ miércoles: 3,
1938
+ miercoles: 3,
1939
+ mié: 3,
1940
+ mie: 3,
1941
+ jueves: 4,
1942
+ jue: 4,
1943
+ viernes: 5,
1944
+ vie: 5,
1945
+ sábado: 6,
1946
+ sabado: 6,
1947
+ sáb: 6,
1948
+ sab: 6
1949
+ }, nt = {
1950
+ enero: 1,
1951
+ ene: 1,
1952
+ "ene.": 1,
1953
+ febrero: 2,
1954
+ feb: 2,
1955
+ "feb.": 2,
1956
+ marzo: 3,
1957
+ mar: 3,
1958
+ "mar.": 3,
1959
+ abril: 4,
1960
+ abr: 4,
1961
+ "abr.": 4,
1962
+ mayo: 5,
1963
+ may: 5,
1964
+ "may.": 5,
1965
+ junio: 6,
1966
+ jun: 6,
1967
+ "jun.": 6,
1968
+ julio: 7,
1969
+ jul: 7,
1970
+ "jul.": 7,
1971
+ agosto: 8,
1972
+ ago: 8,
1973
+ "ago.": 8,
1974
+ septiembre: 9,
1975
+ setiembre: 9,
1976
+ sep: 9,
1977
+ "sep.": 9,
1978
+ octubre: 10,
1979
+ oct: 10,
1980
+ "oct.": 10,
1981
+ noviembre: 11,
1982
+ nov: 11,
1983
+ "nov.": 11,
1984
+ diciembre: 12,
1985
+ dic: 12,
1986
+ "dic.": 12
1987
+ }, X = {
1988
+ uno: 1,
1989
+ dos: 2,
1990
+ tres: 3,
1991
+ cuatro: 4,
1992
+ cinco: 5,
1993
+ seis: 6,
1994
+ siete: 7,
1995
+ ocho: 8,
1996
+ nueve: 9,
1997
+ diez: 10,
1998
+ once: 11,
1999
+ doce: 12,
2000
+ trece: 13
2001
+ }, st = {
2002
+ sec: "second",
2003
+ segundo: "second",
2004
+ segundos: "second",
2005
+ min: "minute",
2006
+ mins: "minute",
2007
+ minuto: "minute",
2008
+ minutos: "minute",
2009
+ h: "hour",
2010
+ hr: "hour",
2011
+ hrs: "hour",
2012
+ hora: "hour",
2013
+ horas: "hour",
2014
+ día: "day",
2015
+ días: "day",
2016
+ semana: "week",
2017
+ semanas: "week",
2018
+ mes: "month",
2019
+ meses: "month",
2020
+ cuarto: "quarter",
2021
+ cuartos: "quarter",
2022
+ año: "year",
2023
+ años: "year"
2024
+ }, hs = `(?:${h(X)}|[0-9]+|[0-9]+\\.[0-9]+|un?|uno?|una?|algunos?|unos?|demi-?)`;
2025
+ function Ts(r) {
2026
+ const e = r.toLowerCase();
2027
+ return X[e] !== void 0 ? X[e] : e === "un" || e === "una" || e === "uno" ? 1 : e.match(/algunos?/) || e.match(/unos?/) ? 3 : e.match(/media?/) ? 0.5 : parseFloat(e);
2028
+ }
2029
+ const ys = "[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";
2030
+ function ps(r) {
2031
+ if (r.match(/^[0-9]{1,4}$/)) {
2032
+ let e = parseInt(r);
2033
+ return e < 100 && (e > 50 ? e = e + 1900 : e = e + 2e3), e;
2034
+ }
2035
+ return r.match(/a\.?\s*c\.?/i) ? (r = r.replace(/a\.?\s*c\.?/i, ""), -parseInt(r)) : parseInt(r);
2036
+ }
2037
+ const rt = `(${hs})\\s{0,5}(${h(st)})\\s{0,5}`, Fe = new RegExp(rt, "i"), Es = Q("", rt);
2038
+ function ws(r) {
2039
+ const e = {};
2040
+ let t = r, n = Fe.exec(t);
2041
+ for (; n; )
2042
+ Ps(e, n), t = t.substring(n[0].length), n = Fe.exec(t);
2043
+ return e;
2044
+ }
2045
+ function Ps(r, e) {
2046
+ const t = Ts(e[1]), n = st[e[2].toLowerCase()];
2047
+ r[n] = t;
2048
+ }
2049
+ const Ds = new RegExp(`(?:(?:\\,|\\(|\\()\\s*)?(?:(este|esta|pasado|pr[oó]ximo)\\s*)?(${h(tt)})(?:\\s*(?:\\,|\\)|\\)))?(?:\\s*(este|esta|pasado|pr[óo]ximo)\\s*semana)?(?=\\W|\\d|$)`, "i"), Rs = 1, As = 2, xs = 3;
2050
+ class Ns extends g {
2051
+ innerPattern() {
2052
+ return Ds;
2053
+ }
2054
+ innerExtract(e, t) {
2055
+ const n = t[As].toLowerCase(), s = tt[n];
2056
+ if (s === void 0)
2057
+ return null;
2058
+ const i = t[Rs], a = t[xs];
2059
+ let o = i || a || "";
2060
+ o = o.toLowerCase();
2061
+ let l = null;
2062
+ return o == "pasado" ? l = "this" : o == "próximo" || o == "proximo" ? l = "next" : o == "este" && (l = "this"), se(e.reference, s, l);
2063
+ }
2064
+ }
2065
+ class Os extends ee {
2066
+ primaryPrefix() {
2067
+ return "(?:(?:aslas|deslas|las?|al?|de|del)\\s*)?";
2068
+ }
2069
+ followingPhase() {
2070
+ return "\\s*(?:\\-|\\–|\\~|\\〜|a(?:l)?|\\?)\\s*";
2071
+ }
2072
+ }
2073
+ class Ms extends ne {
2074
+ patternBetween() {
2075
+ return new RegExp("^\\s*(?:,|de|aslas|a)?\\s*$");
2076
+ }
2077
+ }
2078
+ class $s extends te {
2079
+ patternBetween() {
2080
+ return /^\s*(?:-)\s*$/i;
2081
+ }
2082
+ }
2083
+ const Cs = new RegExp(`([0-9]{1,2})(?:º|ª|°)?(?:\\s*(?:desde|de|\\-|\\–|ao?|\\s)\\s*([0-9]{1,2})(?:º|ª|°)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${h(nt)})(?:\\s*(?:de|,)?\\s*(${ys}))?(?=\\W|$)`, "i"), We = 1, ke = 2, Ss = 3, Ge = 4;
2084
+ class _s extends g {
2085
+ innerPattern() {
2086
+ return Cs;
2087
+ }
2088
+ innerExtract(e, t) {
2089
+ const n = e.createParsingResult(t.index, t[0]), s = nt[t[Ss].toLowerCase()], i = parseInt(t[We]);
2090
+ if (i > 31)
2091
+ return t.index = t.index + t[We].length, null;
2092
+ if (n.start.assign("month", s), n.start.assign("day", i), t[Ge]) {
2093
+ const a = ps(t[Ge]);
2094
+ n.start.assign("year", a);
2095
+ } else {
2096
+ const a = M(e.refDate, i, s);
2097
+ n.start.imply("year", a);
2098
+ }
2099
+ if (t[ke]) {
2100
+ const a = parseInt(t[ke]);
2101
+ n.end = n.start.clone(), n.end.assign("day", a);
2102
+ }
2103
+ return n;
2104
+ }
2105
+ }
2106
+ class Us extends g {
2107
+ innerPattern(e) {
2108
+ return /(ahora|hoy|mañana|ayer)(?=\W|$)/i;
2109
+ }
2110
+ innerExtract(e, t) {
2111
+ const n = t[0].toLowerCase(), s = e.createParsingComponents();
2112
+ switch (n) {
2113
+ case "ahora":
2114
+ return ie(e.reference);
2115
+ case "hoy":
2116
+ return ae(e.reference);
2117
+ case "mañana":
2118
+ return le(e.reference);
2119
+ case "ayer":
2120
+ return oe(e.reference);
2121
+ }
2122
+ return s;
2123
+ }
2124
+ }
2125
+ class Is extends g {
2126
+ innerPattern() {
2127
+ return /(?:esta\s*)?(mañana|tarde|medianoche|mediodia|mediodía|noche)(?=\W|$)/i;
2128
+ }
2129
+ innerExtract(e, t) {
2130
+ const n = e.refDate, s = e.createParsingComponents();
2131
+ switch (t[1].toLowerCase()) {
2132
+ case "tarde":
2133
+ s.imply("meridiem", c.PM), s.imply("hour", 15), s.addTag("casualReference/afternoon");
2134
+ break;
2135
+ case "noche":
2136
+ s.imply("meridiem", c.PM), s.imply("hour", 22), s.addTag("casualReference/evening");
2137
+ break;
2138
+ case "mañana":
2139
+ s.imply("meridiem", c.AM), s.imply("hour", 6), s.addTag("casualReference/morning");
2140
+ break;
2141
+ case "medianoche":
2142
+ const i = new Date(n.getTime());
2143
+ i.setDate(i.getDate() + 1), P(s, i), S(s, i), s.imply("hour", 0), s.imply("minute", 0), s.imply("second", 0), s.addTag("casualReference/midnight");
2144
+ break;
2145
+ case "mediodia":
2146
+ case "mediodía":
2147
+ s.imply("meridiem", c.AM), s.imply("hour", 12), s.addTag("casualReference/noon");
2148
+ break;
2149
+ }
2150
+ return s;
2151
+ }
2152
+ }
2153
+ class bs extends g {
2154
+ innerPattern() {
2155
+ return new RegExp(`(?:en|por|durante|de|dentro de)\\s*(${Es})(?=\\W|$)`, "i");
2156
+ }
2157
+ innerExtract(e, t) {
2158
+ const n = ws(t[1]);
2159
+ return d.createRelativeFromReference(e.reference, n);
2160
+ }
2161
+ }
2162
+ const Ys = new y(it());
2163
+ new y(fe(!0));
2164
+ function it(r = !0) {
2165
+ const e = fe(!1, r);
2166
+ return e.parsers.push(new Us()), e.parsers.push(new Is()), e;
2167
+ }
2168
+ function fe(r = !0, e = !0) {
2169
+ return re({
2170
+ parsers: [
2171
+ new ue(e),
2172
+ new Ns(),
2173
+ new Os(),
2174
+ new _s(),
2175
+ new bs()
2176
+ ],
2177
+ refiners: [new Ms(), new $s()]
2178
+ }, r);
2179
+ }
2180
+ const ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2181
+ __proto__: null,
2182
+ Chrono: y,
2183
+ get Meridiem() {
2184
+ return c;
2185
+ },
2186
+ ParsingComponents: d,
2187
+ ParsingResult: D,
2188
+ ReferenceWithTimezone: E,
2189
+ get Weekday() {
2190
+ return f;
2191
+ },
2192
+ casual: Ys,
2193
+ createCasualConfiguration: it,
2194
+ createConfiguration: fe
2195
+ }, Symbol.toStringTag, { value: "Module" }));
2196
+ export {
2197
+ y as Chrono,
2198
+ c as Meridiem,
2199
+ d as ParsingComponents,
2200
+ Jn as ParsingContext,
2201
+ D as ParsingResult,
2202
+ E as ReferenceWithTimezone,
2203
+ f as Weekday,
2204
+ Fs as en,
2205
+ ks as es,
2206
+ Ws as pt
2207
+ };
2208
+ //# sourceMappingURL=index-Dips44uG.js.map