prometeo-design-system 2.9.5 → 2.9.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 (60) hide show
  1. package/dist/Button.es.js +9 -9
  2. package/dist/{CardProfile-CsytJlKZ.js → CardProfile-WHoeSibd.js} +8 -8
  3. package/dist/CardProfile.es.js +1 -1
  4. package/dist/CheckBox.es.js +4 -4
  5. package/dist/DatePicker-CbXUUnv7.js +3568 -0
  6. package/dist/DatePicker.es.js +3 -3439
  7. package/dist/DrawerDesktop.d.ts +6 -0
  8. package/dist/DrawerDesktop.es.js +211 -0
  9. package/dist/DrawerMobile.d.ts +6 -0
  10. package/dist/DrawerMobile.es.js +242 -0
  11. package/dist/DropZone.es.js +5 -5
  12. package/dist/FAButton.es.js +1 -1
  13. package/dist/{HelperComponent-g_xuKWzK.js → HelperComponent-BeNlTMqI.js} +7 -7
  14. package/dist/Icons/Icons.d.ts +1 -1
  15. package/dist/Icons.d.ts +0 -4
  16. package/dist/Icons.es.js +1119 -3
  17. package/dist/Image.es.js +29 -29
  18. package/dist/{ImageGallery-Ckxg9OIC.js → ImageGallery-WKzUevOQ.js} +34 -34
  19. package/dist/ImageGallery.es.js +1 -1
  20. package/dist/{Input-Cck37DpG.js → Input-Cf8P1QJv.js} +30 -31
  21. package/dist/Input.es.js +1 -1
  22. package/dist/InputMultiple.es.js +34 -34
  23. package/dist/Logo.es.js +1 -1
  24. package/dist/OtpInput.es.js +43 -43
  25. package/dist/RadioButton.es.js +1 -1
  26. package/dist/RecurrentDatePicker.d.ts +2 -0
  27. package/dist/RecurrentDatePicker.es.js +694 -0
  28. package/dist/RecurrentDatePickerRRule.d.ts +2 -0
  29. package/dist/RecurrentDatePickerRRule.es.js +1684 -0
  30. package/dist/{Select-BD5FTxVw.js → Select-DeKi15Iu.js} +31 -32
  31. package/dist/Select.es.js +1 -1
  32. package/dist/SelectSearch.es.js +1 -1
  33. package/dist/Spinner.es.js +172 -46
  34. package/dist/Steps.es.js +1 -1
  35. package/dist/Toast.es.js +22 -22
  36. package/dist/Tooltip.es.js +1 -1
  37. package/dist/components/Drawer/DrawerDesktop.d.ts +1 -0
  38. package/dist/components/Drawer/useDrawerDesktop.d.ts +1 -1
  39. package/dist/components/RecurrentDatePicker/PreviewCalendar.d.ts +4 -1
  40. package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +4 -4
  41. package/dist/components/RecurrentDatePicker/RecurrentDatePickerRRule.d.ts +13 -0
  42. package/dist/components/RecurrentDatePicker/recurrentDatePicker.validations.d.ts +3 -3
  43. package/dist/components/Spinner/Spinner.d.ts +6 -6
  44. package/dist/exports/DrawerDesktop.d.ts +4 -0
  45. package/dist/exports/DrawerMobile.d.ts +4 -0
  46. package/dist/exports/Icons.d.ts +1 -2
  47. package/dist/exports/RecurrentDatePicker.d.ts +5 -0
  48. package/dist/exports/RecurrentDatePickerRRule.d.ts +2 -0
  49. package/dist/exports/Spinner.d.ts +2 -1
  50. package/dist/index.d.ts +8 -3
  51. package/dist/prometeo-design-system.es.js +412 -762
  52. package/dist/styles.css +1 -0
  53. package/dist/styles.d.ts +1 -0
  54. package/package.json +27 -6
  55. package/src/styles/app.css +1 -1313
  56. package/src/styles/base.css +1331 -0
  57. package/src/styles/utilities.css +24 -36
  58. package/dist/Icons-DtFC5DJ7.js +0 -1079
  59. package/dist/components/Spinner/SpinnerV2.d.ts +0 -12
  60. package/dist/prometeo-design-system.css +0 -1
@@ -0,0 +1,1684 @@
1
+ import { j as J } from "./jsx-runtime-DKDX3adD.js";
2
+ import { memo as Ie, useState as he, useRef as _e, useEffect as ye } from "react";
3
+ import { RecurrentDatePicker as We } from "./RecurrentDatePicker.es.js";
4
+ import { C as He } from "./DatePicker-CbXUUnv7.js";
5
+ var re = [
6
+ "MO",
7
+ "TU",
8
+ "WE",
9
+ "TH",
10
+ "FR",
11
+ "SA",
12
+ "SU"
13
+ ], S = (
14
+ /** @class */
15
+ (function() {
16
+ function t(e, r) {
17
+ if (r === 0)
18
+ throw new Error("Can't create weekday with n == 0");
19
+ this.weekday = e, this.n = r;
20
+ }
21
+ return t.fromStr = function(e) {
22
+ return new t(re.indexOf(e));
23
+ }, t.prototype.nth = function(e) {
24
+ return this.n === e ? this : new t(this.weekday, e);
25
+ }, t.prototype.equals = function(e) {
26
+ return this.weekday === e.weekday && this.n === e.n;
27
+ }, t.prototype.toString = function() {
28
+ var e = re[this.weekday];
29
+ return this.n && (e = (this.n > 0 ? "+" : "") + String(this.n) + e), e;
30
+ }, t.prototype.getJsWeekday = function() {
31
+ return this.weekday === 6 ? 0 : this.weekday + 1;
32
+ }, t;
33
+ })()
34
+ ), T = function(t) {
35
+ return t != null;
36
+ }, L = function(t) {
37
+ return typeof t == "number";
38
+ }, le = function(t) {
39
+ return typeof t == "string" && re.includes(t);
40
+ }, M = Array.isArray, R = function(t, e) {
41
+ e === void 0 && (e = t), arguments.length === 1 && (e = t, t = 0);
42
+ for (var r = [], n = t; n < e; n++)
43
+ r.push(n);
44
+ return r;
45
+ }, p = function(t, e) {
46
+ var r = 0, n = [];
47
+ if (M(t))
48
+ for (; r < e; r++)
49
+ n[r] = [].concat(t);
50
+ else
51
+ for (; r < e; r++)
52
+ n[r] = t;
53
+ return n;
54
+ }, qe = function(t) {
55
+ return M(t) ? t : [t];
56
+ };
57
+ function K(t, e, r) {
58
+ r === void 0 && (r = " ");
59
+ var n = String(t);
60
+ return e = e >> 0, n.length > e ? String(n) : (e = e - n.length, e > r.length && (r += p(r, e / r.length)), r.slice(0, e) + String(n));
61
+ }
62
+ var U = function(t, e) {
63
+ var r = t % e;
64
+ return r * e < 0 ? r + e : r;
65
+ }, ee = function(t, e) {
66
+ return { div: Math.floor(t / e), mod: U(t, e) };
67
+ }, A = function(t) {
68
+ return !T(t) || t.length === 0;
69
+ }, D = function(t) {
70
+ return !A(t);
71
+ }, E = function(t, e) {
72
+ return D(t) && t.indexOf(e) !== -1;
73
+ }, P = function(t, e, r, n, a, i) {
74
+ return n === void 0 && (n = 0), a === void 0 && (a = 0), i === void 0 && (i = 0), new Date(Date.UTC(t, e - 1, r, n, a, i));
75
+ }, Pe = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Te = 1e3 * 60 * 60 * 24, De = 9999, Oe = P(1970, 1, 1), je = [6, 0, 1, 2, 3, 4, 5], Q = function(t) {
76
+ return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0;
77
+ }, Ye = function(t) {
78
+ return t instanceof Date;
79
+ }, G = function(t) {
80
+ return Ye(t) && !isNaN(t.getTime());
81
+ }, Ke = function(t, e) {
82
+ var r = t.getTime(), n = e.getTime(), a = r - n;
83
+ return Math.round(a / Te);
84
+ }, ne = function(t) {
85
+ return Ke(t, Oe);
86
+ }, Se = function(t) {
87
+ return new Date(Oe.getTime() + t * Te);
88
+ }, Fe = function(t) {
89
+ var e = t.getUTCMonth();
90
+ return e === 1 && Q(t.getUTCFullYear()) ? 29 : Pe[e];
91
+ }, z = function(t) {
92
+ return je[t.getUTCDay()];
93
+ }, de = function(t, e) {
94
+ var r = P(t, e + 1, 1);
95
+ return [z(r), Fe(r)];
96
+ }, xe = function(t, e) {
97
+ return e = e || t, new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
98
+ }, ie = function(t) {
99
+ var e = new Date(t.getTime());
100
+ return e;
101
+ }, ce = function(t) {
102
+ for (var e = [], r = 0; r < t.length; r++)
103
+ e.push(ie(t[r]));
104
+ return e;
105
+ }, ae = function(t) {
106
+ t.sort(function(e, r) {
107
+ return e.getTime() - r.getTime();
108
+ });
109
+ }, Me = function(t, e) {
110
+ e === void 0 && (e = !0);
111
+ var r = new Date(t);
112
+ return [
113
+ K(r.getUTCFullYear().toString(), 4, "0"),
114
+ K(r.getUTCMonth() + 1, 2, "0"),
115
+ K(r.getUTCDate(), 2, "0"),
116
+ "T",
117
+ K(r.getUTCHours(), 2, "0"),
118
+ K(r.getUTCMinutes(), 2, "0"),
119
+ K(r.getUTCSeconds(), 2, "0"),
120
+ e ? "Z" : ""
121
+ ].join("");
122
+ }, Ue = function(t) {
123
+ var e = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/, r = e.exec(t);
124
+ if (!r)
125
+ throw new Error("Invalid UNTIL value: ".concat(t));
126
+ return new Date(Date.UTC(parseInt(r[1], 10), parseInt(r[2], 10) - 1, parseInt(r[3], 10), parseInt(r[5], 10) || 0, parseInt(r[6], 10) || 0, parseInt(r[7], 10) || 0));
127
+ }, me = function(t, e) {
128
+ var r = t.toLocaleString("sv-SE", { timeZone: e });
129
+ return r.replace(" ", "T") + "Z";
130
+ }, ze = function(t, e) {
131
+ var r = Intl.DateTimeFormat().resolvedOptions().timeZone, n = new Date(me(t, r)), a = new Date(me(t, e ?? "UTC")), i = a.getTime() - n.getTime();
132
+ return new Date(t.getTime() - i);
133
+ }, F = (
134
+ /** @class */
135
+ (function() {
136
+ function t(e, r) {
137
+ this.minDate = null, this.maxDate = null, this._result = [], this.total = 0, this.method = e, this.args = r, e === "between" ? (this.maxDate = r.inc ? r.before : new Date(r.before.getTime() - 1), this.minDate = r.inc ? r.after : new Date(r.after.getTime() + 1)) : e === "before" ? this.maxDate = r.inc ? r.dt : new Date(r.dt.getTime() - 1) : e === "after" && (this.minDate = r.inc ? r.dt : new Date(r.dt.getTime() + 1));
138
+ }
139
+ return t.prototype.accept = function(e) {
140
+ ++this.total;
141
+ var r = this.minDate && e < this.minDate, n = this.maxDate && e > this.maxDate;
142
+ if (this.method === "between") {
143
+ if (r)
144
+ return !0;
145
+ if (n)
146
+ return !1;
147
+ } else if (this.method === "before") {
148
+ if (n)
149
+ return !1;
150
+ } else if (this.method === "after")
151
+ return r ? !0 : (this.add(e), !1);
152
+ return this.add(e);
153
+ }, t.prototype.add = function(e) {
154
+ return this._result.push(e), !0;
155
+ }, t.prototype.getValue = function() {
156
+ var e = this._result;
157
+ switch (this.method) {
158
+ case "all":
159
+ case "between":
160
+ return e;
161
+ case "before":
162
+ case "after":
163
+ default:
164
+ return e.length ? e[e.length - 1] : null;
165
+ }
166
+ }, t.prototype.clone = function() {
167
+ return new t(this.method, this.args);
168
+ }, t;
169
+ })()
170
+ ), se = function(t, e) {
171
+ return se = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
172
+ r.__proto__ = n;
173
+ } || function(r, n) {
174
+ for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (r[a] = n[a]);
175
+ }, se(t, e);
176
+ };
177
+ function Ne(t, e) {
178
+ if (typeof e != "function" && e !== null)
179
+ throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
180
+ se(t, e);
181
+ function r() {
182
+ this.constructor = t;
183
+ }
184
+ t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
185
+ }
186
+ var I = function() {
187
+ return I = Object.assign || function(e) {
188
+ for (var r, n = 1, a = arguments.length; n < a; n++) {
189
+ r = arguments[n];
190
+ for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
191
+ }
192
+ return e;
193
+ }, I.apply(this, arguments);
194
+ };
195
+ function f(t, e, r) {
196
+ if (r || arguments.length === 2) for (var n = 0, a = e.length, i; n < a; n++)
197
+ (i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
198
+ return t.concat(i || Array.prototype.slice.call(e));
199
+ }
200
+ var be = (
201
+ /** @class */
202
+ (function(t) {
203
+ Ne(e, t);
204
+ function e(r, n, a) {
205
+ var i = t.call(this, r, n) || this;
206
+ return i.iterator = a, i;
207
+ }
208
+ return e.prototype.add = function(r) {
209
+ return this.iterator(r, this._result.length) ? (this._result.push(r), !0) : !1;
210
+ }, e;
211
+ })(F)
212
+ ), V = {
213
+ dayNames: [
214
+ "Sunday",
215
+ "Monday",
216
+ "Tuesday",
217
+ "Wednesday",
218
+ "Thursday",
219
+ "Friday",
220
+ "Saturday"
221
+ ],
222
+ monthNames: [
223
+ "January",
224
+ "February",
225
+ "March",
226
+ "April",
227
+ "May",
228
+ "June",
229
+ "July",
230
+ "August",
231
+ "September",
232
+ "October",
233
+ "November",
234
+ "December"
235
+ ],
236
+ tokens: {
237
+ SKIP: /^[ \r\n\t]+|^\.$/,
238
+ number: /^[1-9][0-9]*/,
239
+ numberAsText: /^(one|two|three)/i,
240
+ every: /^every/i,
241
+ "day(s)": /^days?/i,
242
+ "weekday(s)": /^weekdays?/i,
243
+ "week(s)": /^weeks?/i,
244
+ "hour(s)": /^hours?/i,
245
+ "minute(s)": /^minutes?/i,
246
+ "month(s)": /^months?/i,
247
+ "year(s)": /^years?/i,
248
+ on: /^(on|in)/i,
249
+ at: /^(at)/i,
250
+ the: /^the/i,
251
+ first: /^first/i,
252
+ second: /^second/i,
253
+ third: /^third/i,
254
+ nth: /^([1-9][0-9]*)(\.|th|nd|rd|st)/i,
255
+ last: /^last/i,
256
+ for: /^for/i,
257
+ "time(s)": /^times?/i,
258
+ until: /^(un)?til/i,
259
+ monday: /^mo(n(day)?)?/i,
260
+ tuesday: /^tu(e(s(day)?)?)?/i,
261
+ wednesday: /^we(d(n(esday)?)?)?/i,
262
+ thursday: /^th(u(r(sday)?)?)?/i,
263
+ friday: /^fr(i(day)?)?/i,
264
+ saturday: /^sa(t(urday)?)?/i,
265
+ sunday: /^su(n(day)?)?/i,
266
+ january: /^jan(uary)?/i,
267
+ february: /^feb(ruary)?/i,
268
+ march: /^mar(ch)?/i,
269
+ april: /^apr(il)?/i,
270
+ may: /^may/i,
271
+ june: /^june?/i,
272
+ july: /^july?/i,
273
+ august: /^aug(ust)?/i,
274
+ september: /^sep(t(ember)?)?/i,
275
+ october: /^oct(ober)?/i,
276
+ november: /^nov(ember)?/i,
277
+ december: /^dec(ember)?/i,
278
+ comma: /^(,\s*|(and|or)\s*)+/i
279
+ }
280
+ }, pe = function(t, e) {
281
+ return t.indexOf(e) !== -1;
282
+ }, Be = function(t) {
283
+ return t.toString();
284
+ }, Ze = function(t, e, r) {
285
+ return "".concat(e, " ").concat(r, ", ").concat(t);
286
+ }, _ = (
287
+ /** @class */
288
+ (function() {
289
+ function t(e, r, n, a) {
290
+ if (r === void 0 && (r = Be), n === void 0 && (n = V), a === void 0 && (a = Ze), this.text = [], this.language = n || V, this.gettext = r, this.dateFormatter = a, this.rrule = e, this.options = e.options, this.origOptions = e.origOptions, this.origOptions.bymonthday) {
291
+ var i = [].concat(this.options.bymonthday), o = [].concat(this.options.bynmonthday);
292
+ i.sort(function(d, m) {
293
+ return d - m;
294
+ }), o.sort(function(d, m) {
295
+ return m - d;
296
+ }), this.bymonthday = i.concat(o), this.bymonthday.length || (this.bymonthday = null);
297
+ }
298
+ if (T(this.origOptions.byweekday)) {
299
+ var s = M(this.origOptions.byweekday) ? this.origOptions.byweekday : [this.origOptions.byweekday], u = String(s);
300
+ this.byweekday = {
301
+ allWeeks: s.filter(function(d) {
302
+ return !d.n;
303
+ }),
304
+ someWeeks: s.filter(function(d) {
305
+ return !!d.n;
306
+ }),
307
+ isWeekdays: u.indexOf("MO") !== -1 && u.indexOf("TU") !== -1 && u.indexOf("WE") !== -1 && u.indexOf("TH") !== -1 && u.indexOf("FR") !== -1 && u.indexOf("SA") === -1 && u.indexOf("SU") === -1,
308
+ isEveryDay: u.indexOf("MO") !== -1 && u.indexOf("TU") !== -1 && u.indexOf("WE") !== -1 && u.indexOf("TH") !== -1 && u.indexOf("FR") !== -1 && u.indexOf("SA") !== -1 && u.indexOf("SU") !== -1
309
+ };
310
+ var h = function(d, m) {
311
+ return d.weekday - m.weekday;
312
+ };
313
+ this.byweekday.allWeeks.sort(h), this.byweekday.someWeeks.sort(h), this.byweekday.allWeeks.length || (this.byweekday.allWeeks = null), this.byweekday.someWeeks.length || (this.byweekday.someWeeks = null);
314
+ } else
315
+ this.byweekday = null;
316
+ }
317
+ return t.isFullyConvertible = function(e) {
318
+ var r = !0;
319
+ if (!(e.options.freq in t.IMPLEMENTED) || e.origOptions.until && e.origOptions.count)
320
+ return !1;
321
+ for (var n in e.origOptions) {
322
+ if (pe(["dtstart", "tzid", "wkst", "freq"], n))
323
+ return !0;
324
+ if (!pe(t.IMPLEMENTED[e.options.freq], n))
325
+ return !1;
326
+ }
327
+ return r;
328
+ }, t.prototype.isFullyConvertible = function() {
329
+ return t.isFullyConvertible(this.rrule);
330
+ }, t.prototype.toString = function() {
331
+ var e = this.gettext;
332
+ if (!(this.options.freq in t.IMPLEMENTED))
333
+ return e("RRule error: Unable to fully convert this rrule to text");
334
+ if (this.text = [e("every")], this[y.FREQUENCIES[this.options.freq]](), this.options.until) {
335
+ this.add(e("until"));
336
+ var r = this.options.until;
337
+ this.add(this.dateFormatter(r.getUTCFullYear(), this.language.monthNames[r.getUTCMonth()], r.getUTCDate()));
338
+ } else this.options.count && this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count) ? e("times") : e("time"));
339
+ return this.isFullyConvertible() || this.add(e("(~ approximate)")), this.text.join("");
340
+ }, t.prototype.HOURLY = function() {
341
+ var e = this.gettext;
342
+ this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? e("hours") : e("hour"));
343
+ }, t.prototype.MINUTELY = function() {
344
+ var e = this.gettext;
345
+ this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? e("minutes") : e("minute"));
346
+ }, t.prototype.DAILY = function() {
347
+ var e = this.gettext;
348
+ this.options.interval !== 1 && this.add(this.options.interval.toString()), this.byweekday && this.byweekday.isWeekdays ? this.add(this.plural(this.options.interval) ? e("weekdays") : e("weekday")) : this.add(this.plural(this.options.interval) ? e("days") : e("day")), this.origOptions.bymonth && (this.add(e("in")), this._bymonth()), this.bymonthday ? this._bymonthday() : this.byweekday ? this._byweekday() : this.origOptions.byhour && this._byhour();
349
+ }, t.prototype.WEEKLY = function() {
350
+ var e = this.gettext;
351
+ this.options.interval !== 1 && this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? e("weeks") : e("week")), this.byweekday && this.byweekday.isWeekdays ? this.options.interval === 1 ? this.add(this.plural(this.options.interval) ? e("weekdays") : e("weekday")) : this.add(e("on")).add(e("weekdays")) : this.byweekday && this.byweekday.isEveryDay ? this.add(this.plural(this.options.interval) ? e("days") : e("day")) : (this.options.interval === 1 && this.add(e("week")), this.origOptions.bymonth && (this.add(e("in")), this._bymonth()), this.bymonthday ? this._bymonthday() : this.byweekday && this._byweekday(), this.origOptions.byhour && this._byhour());
352
+ }, t.prototype.MONTHLY = function() {
353
+ var e = this.gettext;
354
+ this.origOptions.bymonth ? (this.options.interval !== 1 && (this.add(this.options.interval.toString()).add(e("months")), this.plural(this.options.interval) && this.add(e("in"))), this._bymonth()) : (this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? e("months") : e("month"))), this.bymonthday ? this._bymonthday() : this.byweekday && this.byweekday.isWeekdays ? this.add(e("on")).add(e("weekdays")) : this.byweekday && this._byweekday();
355
+ }, t.prototype.YEARLY = function() {
356
+ var e = this.gettext;
357
+ this.origOptions.bymonth ? (this.options.interval !== 1 && (this.add(this.options.interval.toString()), this.add(e("years"))), this._bymonth()) : (this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? e("years") : e("year"))), this.bymonthday ? this._bymonthday() : this.byweekday && this._byweekday(), this.options.byyearday && this.add(e("on the")).add(this.list(this.options.byyearday, this.nth, e("and"))).add(e("day")), this.options.byweekno && this.add(e("in")).add(this.plural(this.options.byweekno.length) ? e("weeks") : e("week")).add(this.list(this.options.byweekno, void 0, e("and")));
358
+ }, t.prototype._bymonthday = function() {
359
+ var e = this.gettext;
360
+ this.byweekday && this.byweekday.allWeeks ? this.add(e("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext, e("or"))).add(e("the")).add(this.list(this.bymonthday, this.nth, e("or"))) : this.add(e("on the")).add(this.list(this.bymonthday, this.nth, e("and")));
361
+ }, t.prototype._byweekday = function() {
362
+ var e = this.gettext;
363
+ this.byweekday.allWeeks && !this.byweekday.isWeekdays && this.add(e("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext)), this.byweekday.someWeeks && (this.byweekday.allWeeks && this.add(e("and")), this.add(e("on the")).add(this.list(this.byweekday.someWeeks, this.weekdaytext, e("and"))));
364
+ }, t.prototype._byhour = function() {
365
+ var e = this.gettext;
366
+ this.add(e("at")).add(this.list(this.origOptions.byhour, void 0, e("and")));
367
+ }, t.prototype._bymonth = function() {
368
+ this.add(this.list(this.options.bymonth, this.monthtext, this.gettext("and")));
369
+ }, t.prototype.nth = function(e) {
370
+ e = parseInt(e.toString(), 10);
371
+ var r, n = this.gettext;
372
+ if (e === -1)
373
+ return n("last");
374
+ var a = Math.abs(e);
375
+ switch (a) {
376
+ case 1:
377
+ case 21:
378
+ case 31:
379
+ r = a + n("st");
380
+ break;
381
+ case 2:
382
+ case 22:
383
+ r = a + n("nd");
384
+ break;
385
+ case 3:
386
+ case 23:
387
+ r = a + n("rd");
388
+ break;
389
+ default:
390
+ r = a + n("th");
391
+ }
392
+ return e < 0 ? r + " " + n("last") : r;
393
+ }, t.prototype.monthtext = function(e) {
394
+ return this.language.monthNames[e - 1];
395
+ }, t.prototype.weekdaytext = function(e) {
396
+ var r = L(e) ? (e + 1) % 7 : e.getJsWeekday();
397
+ return (e.n ? this.nth(e.n) + " " : "") + this.language.dayNames[r];
398
+ }, t.prototype.plural = function(e) {
399
+ return e % 100 !== 1;
400
+ }, t.prototype.add = function(e) {
401
+ return this.text.push(" "), this.text.push(e), this;
402
+ }, t.prototype.list = function(e, r, n, a) {
403
+ var i = this;
404
+ a === void 0 && (a = ","), M(e) || (e = [e]);
405
+ var o = function(u, h, d) {
406
+ for (var m = "", l = 0; l < u.length; l++)
407
+ l !== 0 && (l === u.length - 1 ? m += " " + d + " " : m += h + " "), m += u[l];
408
+ return m;
409
+ };
410
+ r = r || function(u) {
411
+ return u.toString();
412
+ };
413
+ var s = function(u) {
414
+ return r && r.call(i, u);
415
+ };
416
+ return n ? o(e.map(s), a, n) : e.map(s).join(a + " ");
417
+ }, t;
418
+ })()
419
+ ), Ge = (
420
+ /** @class */
421
+ (function() {
422
+ function t(e) {
423
+ this.done = !0, this.rules = e;
424
+ }
425
+ return t.prototype.start = function(e) {
426
+ return this.text = e, this.done = !1, this.nextSymbol();
427
+ }, t.prototype.isDone = function() {
428
+ return this.done && this.symbol === null;
429
+ }, t.prototype.nextSymbol = function() {
430
+ var e, r;
431
+ this.symbol = null, this.value = null;
432
+ do {
433
+ if (this.done)
434
+ return !1;
435
+ var n = void 0;
436
+ e = null;
437
+ for (var a in this.rules) {
438
+ n = this.rules[a];
439
+ var i = n.exec(this.text);
440
+ i && (e === null || i[0].length > e[0].length) && (e = i, r = a);
441
+ }
442
+ if (e != null && (this.text = this.text.substr(e[0].length), this.text === "" && (this.done = !0)), e == null) {
443
+ this.done = !0, this.symbol = null, this.value = null;
444
+ return;
445
+ }
446
+ } while (r === "SKIP");
447
+ return this.symbol = r, this.value = e, !0;
448
+ }, t.prototype.accept = function(e) {
449
+ if (this.symbol === e) {
450
+ if (this.value) {
451
+ var r = this.value;
452
+ return this.nextSymbol(), r;
453
+ }
454
+ return this.nextSymbol(), !0;
455
+ }
456
+ return !1;
457
+ }, t.prototype.acceptNumber = function() {
458
+ return this.accept("number");
459
+ }, t.prototype.expect = function(e) {
460
+ if (this.accept(e))
461
+ return !0;
462
+ throw new Error("expected " + e + " but found " + this.symbol);
463
+ }, t;
464
+ })()
465
+ );
466
+ function Le(t, e) {
467
+ e === void 0 && (e = V);
468
+ var r = {}, n = new Ge(e.tokens);
469
+ if (!n.start(t))
470
+ return null;
471
+ return a(), r;
472
+ function a() {
473
+ n.expect("every");
474
+ var l = n.acceptNumber();
475
+ if (l && (r.interval = parseInt(l[0], 10)), n.isDone())
476
+ throw new Error("Unexpected end");
477
+ switch (n.symbol) {
478
+ case "day(s)":
479
+ r.freq = y.DAILY, n.nextSymbol() && (o(), m());
480
+ break;
481
+ // FIXME Note: every 2 weekdays != every two weeks on weekdays.
482
+ // DAILY on weekdays is not a valid rule
483
+ case "weekday(s)":
484
+ r.freq = y.WEEKLY, r.byweekday = [y.MO, y.TU, y.WE, y.TH, y.FR], n.nextSymbol(), o(), m();
485
+ break;
486
+ case "week(s)":
487
+ r.freq = y.WEEKLY, n.nextSymbol() && (i(), o(), m());
488
+ break;
489
+ case "hour(s)":
490
+ r.freq = y.HOURLY, n.nextSymbol() && (i(), m());
491
+ break;
492
+ case "minute(s)":
493
+ r.freq = y.MINUTELY, n.nextSymbol() && (i(), m());
494
+ break;
495
+ case "month(s)":
496
+ r.freq = y.MONTHLY, n.nextSymbol() && (i(), m());
497
+ break;
498
+ case "year(s)":
499
+ r.freq = y.YEARLY, n.nextSymbol() && (i(), m());
500
+ break;
501
+ case "monday":
502
+ case "tuesday":
503
+ case "wednesday":
504
+ case "thursday":
505
+ case "friday":
506
+ case "saturday":
507
+ case "sunday":
508
+ r.freq = y.WEEKLY;
509
+ var c = n.symbol.substr(0, 2).toUpperCase();
510
+ if (r.byweekday = [y[c]], !n.nextSymbol())
511
+ return;
512
+ for (; n.accept("comma"); ) {
513
+ if (n.isDone())
514
+ throw new Error("Unexpected end");
515
+ var w = u();
516
+ if (!w)
517
+ throw new Error("Unexpected symbol " + n.symbol + ", expected weekday");
518
+ r.byweekday.push(y[w]), n.nextSymbol();
519
+ }
520
+ o(), d(), m();
521
+ break;
522
+ case "january":
523
+ case "february":
524
+ case "march":
525
+ case "april":
526
+ case "may":
527
+ case "june":
528
+ case "july":
529
+ case "august":
530
+ case "september":
531
+ case "october":
532
+ case "november":
533
+ case "december":
534
+ if (r.freq = y.YEARLY, r.bymonth = [s()], !n.nextSymbol())
535
+ return;
536
+ for (; n.accept("comma"); ) {
537
+ if (n.isDone())
538
+ throw new Error("Unexpected end");
539
+ var k = s();
540
+ if (!k)
541
+ throw new Error("Unexpected symbol " + n.symbol + ", expected month");
542
+ r.bymonth.push(k), n.nextSymbol();
543
+ }
544
+ i(), m();
545
+ break;
546
+ default:
547
+ throw new Error("Unknown symbol");
548
+ }
549
+ }
550
+ function i() {
551
+ var l = n.accept("on"), c = n.accept("the");
552
+ if (l || c)
553
+ do {
554
+ var w = h(), k = u(), b = s();
555
+ if (w)
556
+ k ? (n.nextSymbol(), r.byweekday || (r.byweekday = []), r.byweekday.push(y[k].nth(w))) : (r.bymonthday || (r.bymonthday = []), r.bymonthday.push(w), n.accept("day(s)"));
557
+ else if (k)
558
+ n.nextSymbol(), r.byweekday || (r.byweekday = []), r.byweekday.push(y[k]);
559
+ else if (n.symbol === "weekday(s)")
560
+ n.nextSymbol(), r.byweekday || (r.byweekday = [y.MO, y.TU, y.WE, y.TH, y.FR]);
561
+ else if (n.symbol === "week(s)") {
562
+ n.nextSymbol();
563
+ var g = n.acceptNumber();
564
+ if (!g)
565
+ throw new Error("Unexpected symbol " + n.symbol + ", expected week number");
566
+ for (r.byweekno = [parseInt(g[0], 10)]; n.accept("comma"); ) {
567
+ if (g = n.acceptNumber(), !g)
568
+ throw new Error("Unexpected symbol " + n.symbol + "; expected monthday");
569
+ r.byweekno.push(parseInt(g[0], 10));
570
+ }
571
+ } else if (b)
572
+ n.nextSymbol(), r.bymonth || (r.bymonth = []), r.bymonth.push(b);
573
+ else
574
+ return;
575
+ } while (n.accept("comma") || n.accept("the") || n.accept("on"));
576
+ }
577
+ function o() {
578
+ var l = n.accept("at");
579
+ if (l)
580
+ do {
581
+ var c = n.acceptNumber();
582
+ if (!c)
583
+ throw new Error("Unexpected symbol " + n.symbol + ", expected hour");
584
+ for (r.byhour = [parseInt(c[0], 10)]; n.accept("comma"); ) {
585
+ if (c = n.acceptNumber(), !c)
586
+ throw new Error("Unexpected symbol " + n.symbol + "; expected hour");
587
+ r.byhour.push(parseInt(c[0], 10));
588
+ }
589
+ } while (n.accept("comma") || n.accept("at"));
590
+ }
591
+ function s() {
592
+ switch (n.symbol) {
593
+ case "january":
594
+ return 1;
595
+ case "february":
596
+ return 2;
597
+ case "march":
598
+ return 3;
599
+ case "april":
600
+ return 4;
601
+ case "may":
602
+ return 5;
603
+ case "june":
604
+ return 6;
605
+ case "july":
606
+ return 7;
607
+ case "august":
608
+ return 8;
609
+ case "september":
610
+ return 9;
611
+ case "october":
612
+ return 10;
613
+ case "november":
614
+ return 11;
615
+ case "december":
616
+ return 12;
617
+ default:
618
+ return !1;
619
+ }
620
+ }
621
+ function u() {
622
+ switch (n.symbol) {
623
+ case "monday":
624
+ case "tuesday":
625
+ case "wednesday":
626
+ case "thursday":
627
+ case "friday":
628
+ case "saturday":
629
+ case "sunday":
630
+ return n.symbol.substr(0, 2).toUpperCase();
631
+ default:
632
+ return !1;
633
+ }
634
+ }
635
+ function h() {
636
+ switch (n.symbol) {
637
+ case "last":
638
+ return n.nextSymbol(), -1;
639
+ case "first":
640
+ return n.nextSymbol(), 1;
641
+ case "second":
642
+ return n.nextSymbol(), n.accept("last") ? -2 : 2;
643
+ case "third":
644
+ return n.nextSymbol(), n.accept("last") ? -3 : 3;
645
+ case "nth":
646
+ var l = parseInt(n.value[1], 10);
647
+ if (l < -366 || l > 366)
648
+ throw new Error("Nth out of range: " + l);
649
+ return n.nextSymbol(), n.accept("last") ? -l : l;
650
+ default:
651
+ return !1;
652
+ }
653
+ }
654
+ function d() {
655
+ n.accept("on"), n.accept("the");
656
+ var l = h();
657
+ if (l)
658
+ for (r.bymonthday = [l], n.nextSymbol(); n.accept("comma"); ) {
659
+ if (l = h(), !l)
660
+ throw new Error("Unexpected symbol " + n.symbol + "; expected monthday");
661
+ r.bymonthday.push(l), n.nextSymbol();
662
+ }
663
+ }
664
+ function m() {
665
+ if (n.symbol === "until") {
666
+ var l = Date.parse(n.text);
667
+ if (!l)
668
+ throw new Error("Cannot parse until date:" + n.text);
669
+ r.until = new Date(l);
670
+ } else n.accept("for") && (r.count = parseInt(n.value[0], 10), n.expect("number"));
671
+ }
672
+ }
673
+ var v;
674
+ (function(t) {
675
+ t[t.YEARLY = 0] = "YEARLY", t[t.MONTHLY = 1] = "MONTHLY", t[t.WEEKLY = 2] = "WEEKLY", t[t.DAILY = 3] = "DAILY", t[t.HOURLY = 4] = "HOURLY", t[t.MINUTELY = 5] = "MINUTELY", t[t.SECONDLY = 6] = "SECONDLY";
676
+ })(v || (v = {}));
677
+ function ue(t) {
678
+ return t < v.HOURLY;
679
+ }
680
+ var Je = function(t, e) {
681
+ return e === void 0 && (e = V), new y(Le(t, e) || void 0);
682
+ }, B = [
683
+ "count",
684
+ "until",
685
+ "interval",
686
+ "byweekday",
687
+ "bymonthday",
688
+ "bymonth"
689
+ ];
690
+ _.IMPLEMENTED = [];
691
+ _.IMPLEMENTED[v.HOURLY] = B;
692
+ _.IMPLEMENTED[v.MINUTELY] = B;
693
+ _.IMPLEMENTED[v.DAILY] = ["byhour"].concat(B);
694
+ _.IMPLEMENTED[v.WEEKLY] = B;
695
+ _.IMPLEMENTED[v.MONTHLY] = B;
696
+ _.IMPLEMENTED[v.YEARLY] = ["byweekno", "byyearday"].concat(B);
697
+ var Qe = function(t, e, r, n) {
698
+ return new _(t, e, r, n).toString();
699
+ }, Ve = _.isFullyConvertible, $ = (
700
+ /** @class */
701
+ (function() {
702
+ function t(e, r, n, a) {
703
+ this.hour = e, this.minute = r, this.second = n, this.millisecond = a || 0;
704
+ }
705
+ return t.prototype.getHours = function() {
706
+ return this.hour;
707
+ }, t.prototype.getMinutes = function() {
708
+ return this.minute;
709
+ }, t.prototype.getSeconds = function() {
710
+ return this.second;
711
+ }, t.prototype.getMilliseconds = function() {
712
+ return this.millisecond;
713
+ }, t.prototype.getTime = function() {
714
+ return (this.hour * 60 * 60 + this.minute * 60 + this.second) * 1e3 + this.millisecond;
715
+ }, t;
716
+ })()
717
+ ), $e = (
718
+ /** @class */
719
+ (function(t) {
720
+ Ne(e, t);
721
+ function e(r, n, a, i, o, s, u) {
722
+ var h = t.call(this, i, o, s, u) || this;
723
+ return h.year = r, h.month = n, h.day = a, h;
724
+ }
725
+ return e.fromDate = function(r) {
726
+ return new this(r.getUTCFullYear(), r.getUTCMonth() + 1, r.getUTCDate(), r.getUTCHours(), r.getUTCMinutes(), r.getUTCSeconds(), r.valueOf() % 1e3);
727
+ }, e.prototype.getWeekday = function() {
728
+ return z(new Date(this.getTime()));
729
+ }, e.prototype.getTime = function() {
730
+ return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();
731
+ }, e.prototype.getDay = function() {
732
+ return this.day;
733
+ }, e.prototype.getMonth = function() {
734
+ return this.month;
735
+ }, e.prototype.getYear = function() {
736
+ return this.year;
737
+ }, e.prototype.addYears = function(r) {
738
+ this.year += r;
739
+ }, e.prototype.addMonths = function(r) {
740
+ if (this.month += r, this.month > 12) {
741
+ var n = Math.floor(this.month / 12), a = U(this.month, 12);
742
+ this.month = a, this.year += n, this.month === 0 && (this.month = 12, --this.year);
743
+ }
744
+ }, e.prototype.addWeekly = function(r, n) {
745
+ n > this.getWeekday() ? this.day += -(this.getWeekday() + 1 + (6 - n)) + r * 7 : this.day += -(this.getWeekday() - n) + r * 7, this.fixDay();
746
+ }, e.prototype.addDaily = function(r) {
747
+ this.day += r, this.fixDay();
748
+ }, e.prototype.addHours = function(r, n, a) {
749
+ for (n && (this.hour += Math.floor((23 - this.hour) / r) * r); ; ) {
750
+ this.hour += r;
751
+ var i = ee(this.hour, 24), o = i.div, s = i.mod;
752
+ if (o && (this.hour = s, this.addDaily(o)), A(a) || E(a, this.hour))
753
+ break;
754
+ }
755
+ }, e.prototype.addMinutes = function(r, n, a, i) {
756
+ for (n && (this.minute += Math.floor((1439 - (this.hour * 60 + this.minute)) / r) * r); ; ) {
757
+ this.minute += r;
758
+ var o = ee(this.minute, 60), s = o.div, u = o.mod;
759
+ if (s && (this.minute = u, this.addHours(s, !1, a)), (A(a) || E(a, this.hour)) && (A(i) || E(i, this.minute)))
760
+ break;
761
+ }
762
+ }, e.prototype.addSeconds = function(r, n, a, i, o) {
763
+ for (n && (this.second += Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) / r) * r); ; ) {
764
+ this.second += r;
765
+ var s = ee(this.second, 60), u = s.div, h = s.mod;
766
+ if (u && (this.second = h, this.addMinutes(u, !1, a, i)), (A(a) || E(a, this.hour)) && (A(i) || E(i, this.minute)) && (A(o) || E(o, this.second)))
767
+ break;
768
+ }
769
+ }, e.prototype.fixDay = function() {
770
+ if (!(this.day <= 28)) {
771
+ var r = de(this.year, this.month - 1)[1];
772
+ if (!(this.day <= r))
773
+ for (; this.day > r; ) {
774
+ if (this.day -= r, ++this.month, this.month === 13 && (this.month = 1, ++this.year, this.year > De))
775
+ return;
776
+ r = de(this.year, this.month - 1)[1];
777
+ }
778
+ }
779
+ }, e.prototype.add = function(r, n) {
780
+ var a = r.freq, i = r.interval, o = r.wkst, s = r.byhour, u = r.byminute, h = r.bysecond;
781
+ switch (a) {
782
+ case v.YEARLY:
783
+ return this.addYears(i);
784
+ case v.MONTHLY:
785
+ return this.addMonths(i);
786
+ case v.WEEKLY:
787
+ return this.addWeekly(i, o);
788
+ case v.DAILY:
789
+ return this.addDaily(i);
790
+ case v.HOURLY:
791
+ return this.addHours(i, n, s);
792
+ case v.MINUTELY:
793
+ return this.addMinutes(i, n, s, u);
794
+ case v.SECONDLY:
795
+ return this.addSeconds(i, n, s, u, h);
796
+ }
797
+ }, e;
798
+ })($)
799
+ );
800
+ function Ae(t) {
801
+ for (var e = [], r = Object.keys(t), n = 0, a = r; n < a.length; n++) {
802
+ var i = a[n];
803
+ E(Ut, i) || e.push(i), Ye(t[i]) && !G(t[i]) && e.push(i);
804
+ }
805
+ if (e.length)
806
+ throw new Error("Invalid options: " + e.join(", "));
807
+ return I({}, t);
808
+ }
809
+ function Xe(t) {
810
+ var e = I(I({}, fe), Ae(t));
811
+ if (T(e.byeaster) && (e.freq = y.YEARLY), !(T(e.freq) && y.FREQUENCIES[e.freq]))
812
+ throw new Error("Invalid frequency: ".concat(e.freq, " ").concat(t.freq));
813
+ if (e.dtstart || (e.dtstart = new Date((/* @__PURE__ */ new Date()).setMilliseconds(0))), T(e.wkst) ? L(e.wkst) || (e.wkst = e.wkst.weekday) : e.wkst = y.MO.weekday, T(e.bysetpos)) {
814
+ L(e.bysetpos) && (e.bysetpos = [e.bysetpos]);
815
+ for (var r = 0; r < e.bysetpos.length; r++) {
816
+ var n = e.bysetpos[r];
817
+ if (n === 0 || !(n >= -366 && n <= 366))
818
+ throw new Error("bysetpos must be between 1 and 366, or between -366 and -1");
819
+ }
820
+ }
821
+ if (!(e.byweekno || D(e.byweekno) || D(e.byyearday) || e.bymonthday || D(e.bymonthday) || T(e.byweekday) || T(e.byeaster)))
822
+ switch (e.freq) {
823
+ case y.YEARLY:
824
+ e.bymonth || (e.bymonth = e.dtstart.getUTCMonth() + 1), e.bymonthday = e.dtstart.getUTCDate();
825
+ break;
826
+ case y.MONTHLY:
827
+ e.bymonthday = e.dtstart.getUTCDate();
828
+ break;
829
+ case y.WEEKLY:
830
+ e.byweekday = [z(e.dtstart)];
831
+ break;
832
+ }
833
+ if (T(e.bymonth) && !M(e.bymonth) && (e.bymonth = [e.bymonth]), T(e.byyearday) && !M(e.byyearday) && L(e.byyearday) && (e.byyearday = [e.byyearday]), !T(e.bymonthday))
834
+ e.bymonthday = [], e.bynmonthday = [];
835
+ else if (M(e.bymonthday)) {
836
+ for (var a = [], i = [], r = 0; r < e.bymonthday.length; r++) {
837
+ var n = e.bymonthday[r];
838
+ n > 0 ? a.push(n) : n < 0 && i.push(n);
839
+ }
840
+ e.bymonthday = a, e.bynmonthday = i;
841
+ } else e.bymonthday < 0 ? (e.bynmonthday = [e.bymonthday], e.bymonthday = []) : (e.bynmonthday = [], e.bymonthday = [e.bymonthday]);
842
+ if (T(e.byweekno) && !M(e.byweekno) && (e.byweekno = [e.byweekno]), !T(e.byweekday))
843
+ e.bynweekday = null;
844
+ else if (L(e.byweekday))
845
+ e.byweekday = [e.byweekday], e.bynweekday = null;
846
+ else if (le(e.byweekday))
847
+ e.byweekday = [S.fromStr(e.byweekday).weekday], e.bynweekday = null;
848
+ else if (e.byweekday instanceof S)
849
+ !e.byweekday.n || e.freq > y.MONTHLY ? (e.byweekday = [e.byweekday.weekday], e.bynweekday = null) : (e.bynweekday = [[e.byweekday.weekday, e.byweekday.n]], e.byweekday = null);
850
+ else {
851
+ for (var o = [], s = [], r = 0; r < e.byweekday.length; r++) {
852
+ var u = e.byweekday[r];
853
+ if (L(u)) {
854
+ o.push(u);
855
+ continue;
856
+ } else if (le(u)) {
857
+ o.push(S.fromStr(u).weekday);
858
+ continue;
859
+ }
860
+ !u.n || e.freq > y.MONTHLY ? o.push(u.weekday) : s.push([u.weekday, u.n]);
861
+ }
862
+ e.byweekday = D(o) ? o : null, e.bynweekday = D(s) ? s : null;
863
+ }
864
+ return T(e.byhour) ? L(e.byhour) && (e.byhour = [e.byhour]) : e.byhour = e.freq < y.HOURLY ? [e.dtstart.getUTCHours()] : null, T(e.byminute) ? L(e.byminute) && (e.byminute = [e.byminute]) : e.byminute = e.freq < y.MINUTELY ? [e.dtstart.getUTCMinutes()] : null, T(e.bysecond) ? L(e.bysecond) && (e.bysecond = [e.bysecond]) : e.bysecond = e.freq < y.SECONDLY ? [e.dtstart.getUTCSeconds()] : null, { parsedOptions: e };
865
+ }
866
+ function et(t) {
867
+ var e = t.dtstart.getTime() % 1e3;
868
+ if (!ue(t.freq))
869
+ return [];
870
+ var r = [];
871
+ return t.byhour.forEach(function(n) {
872
+ t.byminute.forEach(function(a) {
873
+ t.bysecond.forEach(function(i) {
874
+ r.push(new $(n, a, i, e));
875
+ });
876
+ });
877
+ }), r;
878
+ }
879
+ function tt(t) {
880
+ var e = t.split(`
881
+ `).map(rt).filter(function(r) {
882
+ return r !== null;
883
+ });
884
+ return I(I({}, e[0]), e[1]);
885
+ }
886
+ function oe(t) {
887
+ var e = {}, r = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);
888
+ if (!r)
889
+ return e;
890
+ var n = r[1], a = r[2];
891
+ return n && (e.tzid = n), e.dtstart = Ue(a), e;
892
+ }
893
+ function rt(t) {
894
+ if (t = t.replace(/^\s+|\s+$/, ""), !t.length)
895
+ return null;
896
+ var e = /^([A-Z]+?)[:;]/.exec(t.toUpperCase());
897
+ if (!e)
898
+ return ve(t);
899
+ var r = e[1];
900
+ switch (r.toUpperCase()) {
901
+ case "RRULE":
902
+ case "EXRULE":
903
+ return ve(t);
904
+ case "DTSTART":
905
+ return oe(t);
906
+ default:
907
+ throw new Error("Unsupported RFC prop ".concat(r, " in ").concat(t));
908
+ }
909
+ }
910
+ function ve(t) {
911
+ var e = t.replace(/^RRULE:/i, ""), r = oe(e), n = t.replace(/^(?:RRULE|EXRULE):/i, "").split(";");
912
+ return n.forEach(function(a) {
913
+ var i = a.split("="), o = i[0], s = i[1];
914
+ switch (o.toUpperCase()) {
915
+ case "FREQ":
916
+ r.freq = v[s.toUpperCase()];
917
+ break;
918
+ case "WKST":
919
+ r.wkst = N[s.toUpperCase()];
920
+ break;
921
+ case "COUNT":
922
+ case "INTERVAL":
923
+ case "BYSETPOS":
924
+ case "BYMONTH":
925
+ case "BYMONTHDAY":
926
+ case "BYYEARDAY":
927
+ case "BYWEEKNO":
928
+ case "BYHOUR":
929
+ case "BYMINUTE":
930
+ case "BYSECOND":
931
+ var u = nt(s), h = o.toLowerCase();
932
+ r[h] = u;
933
+ break;
934
+ case "BYWEEKDAY":
935
+ case "BYDAY":
936
+ r.byweekday = it(s);
937
+ break;
938
+ case "DTSTART":
939
+ case "TZID":
940
+ var d = oe(t);
941
+ r.tzid = d.tzid, r.dtstart = d.dtstart;
942
+ break;
943
+ case "UNTIL":
944
+ r.until = Ue(s);
945
+ break;
946
+ case "BYEASTER":
947
+ r.byeaster = Number(s);
948
+ break;
949
+ default:
950
+ throw new Error("Unknown RRULE property '" + o + "'");
951
+ }
952
+ }), r;
953
+ }
954
+ function nt(t) {
955
+ if (t.indexOf(",") !== -1) {
956
+ var e = t.split(",");
957
+ return e.map(we);
958
+ }
959
+ return we(t);
960
+ }
961
+ function we(t) {
962
+ return /^[+-]?\d+$/.test(t) ? Number(t) : t;
963
+ }
964
+ function it(t) {
965
+ var e = t.split(",");
966
+ return e.map(function(r) {
967
+ if (r.length === 2)
968
+ return N[r];
969
+ var n = r.match(/^([+-]?\d{1,2})([A-Z]{2})$/);
970
+ if (!n || n.length < 3)
971
+ throw new SyntaxError("Invalid weekday string: ".concat(r));
972
+ var a = Number(n[1]), i = n[2], o = N[i].weekday;
973
+ return new S(o, a);
974
+ });
975
+ }
976
+ var Re = (
977
+ /** @class */
978
+ (function() {
979
+ function t(e, r) {
980
+ if (isNaN(e.getTime()))
981
+ throw new RangeError("Invalid date passed to DateWithZone");
982
+ this.date = e, this.tzid = r;
983
+ }
984
+ return Object.defineProperty(t.prototype, "isUTC", {
985
+ get: function() {
986
+ return !this.tzid || this.tzid.toUpperCase() === "UTC";
987
+ },
988
+ enumerable: !1,
989
+ configurable: !0
990
+ }), t.prototype.toString = function() {
991
+ var e = Me(this.date.getTime(), this.isUTC);
992
+ return this.isUTC ? ":".concat(e) : ";TZID=".concat(this.tzid, ":").concat(e);
993
+ }, t.prototype.getTime = function() {
994
+ return this.date.getTime();
995
+ }, t.prototype.rezonedDate = function() {
996
+ return this.isUTC ? this.date : ze(this.date, this.tzid);
997
+ }, t;
998
+ })()
999
+ );
1000
+ function ke(t) {
1001
+ for (var e = [], r = "", n = Object.keys(t), a = Object.keys(fe), i = 0; i < n.length; i++)
1002
+ if (n[i] !== "tzid" && E(a, n[i])) {
1003
+ var o = n[i].toUpperCase(), s = t[n[i]], u = "";
1004
+ if (!(!T(s) || M(s) && !s.length)) {
1005
+ switch (o) {
1006
+ case "FREQ":
1007
+ u = y.FREQUENCIES[t.freq];
1008
+ break;
1009
+ case "WKST":
1010
+ L(s) ? u = new S(s).toString() : u = s.toString();
1011
+ break;
1012
+ case "BYWEEKDAY":
1013
+ o = "BYDAY", u = qe(s).map(function(c) {
1014
+ return c instanceof S ? c : M(c) ? new S(c[0], c[1]) : new S(c);
1015
+ }).toString();
1016
+ break;
1017
+ case "DTSTART":
1018
+ r = at(s, t.tzid);
1019
+ break;
1020
+ case "UNTIL":
1021
+ u = Me(s, !t.tzid);
1022
+ break;
1023
+ default:
1024
+ if (M(s)) {
1025
+ for (var h = [], d = 0; d < s.length; d++)
1026
+ h[d] = String(s[d]);
1027
+ u = h.toString();
1028
+ } else
1029
+ u = String(s);
1030
+ }
1031
+ u && e.push([o, u]);
1032
+ }
1033
+ }
1034
+ var m = e.map(function(c) {
1035
+ var w = c[0], k = c[1];
1036
+ return "".concat(w, "=").concat(k.toString());
1037
+ }).join(";"), l = "";
1038
+ return m !== "" && (l = "RRULE:".concat(m)), [r, l].filter(function(c) {
1039
+ return !!c;
1040
+ }).join(`
1041
+ `);
1042
+ }
1043
+ function at(t, e) {
1044
+ return t ? "DTSTART" + new Re(new Date(t), e).toString() : "";
1045
+ }
1046
+ function st(t, e) {
1047
+ return Array.isArray(t) ? !Array.isArray(e) || t.length !== e.length ? !1 : t.every(function(r, n) {
1048
+ return r.getTime() === e[n].getTime();
1049
+ }) : t instanceof Date ? e instanceof Date && t.getTime() === e.getTime() : t === e;
1050
+ }
1051
+ var ot = (
1052
+ /** @class */
1053
+ (function() {
1054
+ function t() {
1055
+ this.all = !1, this.before = [], this.after = [], this.between = [];
1056
+ }
1057
+ return t.prototype._cacheAdd = function(e, r, n) {
1058
+ r && (r = r instanceof Date ? ie(r) : ce(r)), e === "all" ? this.all = r : (n._value = r, this[e].push(n));
1059
+ }, t.prototype._cacheGet = function(e, r) {
1060
+ var n = !1, a = r ? Object.keys(r) : [], i = function(d) {
1061
+ for (var m = 0; m < a.length; m++) {
1062
+ var l = a[m];
1063
+ if (!st(r[l], d[l]))
1064
+ return !0;
1065
+ }
1066
+ return !1;
1067
+ }, o = this[e];
1068
+ if (e === "all")
1069
+ n = this.all;
1070
+ else if (M(o))
1071
+ for (var s = 0; s < o.length; s++) {
1072
+ var u = o[s];
1073
+ if (!(a.length && i(u))) {
1074
+ n = u._value;
1075
+ break;
1076
+ }
1077
+ }
1078
+ if (!n && this.all) {
1079
+ for (var h = new F(e, r), s = 0; s < this.all.length && h.accept(this.all[s]); s++)
1080
+ ;
1081
+ n = h.getValue(), this._cacheAdd(e, n, r);
1082
+ }
1083
+ return M(n) ? ce(n) : n instanceof Date ? ie(n) : n;
1084
+ }, t;
1085
+ })()
1086
+ ), ut = f(f(f(f(f(f(f(f(f(f(f(f(f([], p(1, 31), !0), p(2, 28), !0), p(3, 31), !0), p(4, 30), !0), p(5, 31), !0), p(6, 30), !0), p(7, 31), !0), p(8, 31), !0), p(9, 30), !0), p(10, 31), !0), p(11, 30), !0), p(12, 31), !0), p(1, 7), !0), ft = f(f(f(f(f(f(f(f(f(f(f(f(f([], p(1, 31), !0), p(2, 29), !0), p(3, 31), !0), p(4, 30), !0), p(5, 31), !0), p(6, 30), !0), p(7, 31), !0), p(8, 31), !0), p(9, 30), !0), p(10, 31), !0), p(11, 30), !0), p(12, 31), !0), p(1, 7), !0), ht = R(1, 29), yt = R(1, 30), W = R(1, 31), O = R(1, 32), lt = f(f(f(f(f(f(f(f(f(f(f(f(f([], O, !0), yt, !0), O, !0), W, !0), O, !0), W, !0), O, !0), O, !0), W, !0), O, !0), W, !0), O, !0), O.slice(0, 7), !0), dt = f(f(f(f(f(f(f(f(f(f(f(f(f([], O, !0), ht, !0), O, !0), W, !0), O, !0), W, !0), O, !0), O, !0), W, !0), O, !0), W, !0), O, !0), O.slice(0, 7), !0), ct = R(-28, 0), mt = R(-29, 0), H = R(-30, 0), Y = R(-31, 0), bt = f(f(f(f(f(f(f(f(f(f(f(f(f([], Y, !0), mt, !0), Y, !0), H, !0), Y, !0), H, !0), Y, !0), Y, !0), H, !0), Y, !0), H, !0), Y, !0), Y.slice(0, 7), !0), pt = f(f(f(f(f(f(f(f(f(f(f(f(f([], Y, !0), ct, !0), Y, !0), H, !0), Y, !0), H, !0), Y, !0), Y, !0), H, !0), Y, !0), H, !0), Y, !0), Y.slice(0, 7), !0), vt = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366], wt = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365], ge = (function() {
1087
+ for (var t = [], e = 0; e < 55; e++)
1088
+ t = t.concat(R(7));
1089
+ return t;
1090
+ })();
1091
+ function kt(t, e) {
1092
+ var r = P(t, 1, 1), n = Q(t) ? 366 : 365, a = Q(t + 1) ? 366 : 365, i = ne(r), o = z(r), s = I(I({ yearlen: n, nextyearlen: a, yearordinal: i, yearweekday: o }, gt(t)), { wnomask: null });
1093
+ if (A(e.byweekno))
1094
+ return s;
1095
+ s.wnomask = p(0, n + 7);
1096
+ var u, h, d = u = U(7 - o + e.wkst, 7);
1097
+ d >= 4 ? (d = 0, h = s.yearlen + U(o - e.wkst, 7)) : h = n - d;
1098
+ for (var m = Math.floor(h / 7), l = U(h, 7), c = Math.floor(m + l / 4), w = 0; w < e.byweekno.length; w++) {
1099
+ var k = e.byweekno[w];
1100
+ if (k < 0 && (k += c + 1), k > 0 && k <= c) {
1101
+ var b = void 0;
1102
+ k > 1 ? (b = d + (k - 1) * 7, d !== u && (b -= 7 - u)) : b = d;
1103
+ for (var g = 0; g < 7 && (s.wnomask[b] = 1, b++, s.wdaymask[b] !== e.wkst); g++)
1104
+ ;
1105
+ }
1106
+ }
1107
+ if (E(e.byweekno, 1)) {
1108
+ var b = d + c * 7;
1109
+ if (d !== u && (b -= 7 - u), b < n)
1110
+ for (var w = 0; w < 7 && (s.wnomask[b] = 1, b += 1, s.wdaymask[b] !== e.wkst); w++)
1111
+ ;
1112
+ }
1113
+ if (d) {
1114
+ var x = void 0;
1115
+ if (E(e.byweekno, -1))
1116
+ x = -1;
1117
+ else {
1118
+ var j = z(P(t - 1, 1, 1)), Z = U(7 - j.valueOf() + e.wkst, 7), X = Q(t - 1) ? 366 : 365, q = void 0;
1119
+ Z >= 4 ? (Z = 0, q = X + U(j - e.wkst, 7)) : q = n - d, x = Math.floor(52 + U(q, 7) / 4);
1120
+ }
1121
+ if (E(e.byweekno, x))
1122
+ for (var b = 0; b < d; b++)
1123
+ s.wnomask[b] = 1;
1124
+ }
1125
+ return s;
1126
+ }
1127
+ function gt(t) {
1128
+ var e = Q(t) ? 366 : 365, r = P(t, 1, 1), n = z(r);
1129
+ return e === 365 ? {
1130
+ mmask: ut,
1131
+ mdaymask: dt,
1132
+ nmdaymask: pt,
1133
+ wdaymask: ge.slice(n),
1134
+ mrange: wt
1135
+ } : {
1136
+ mmask: ft,
1137
+ mdaymask: lt,
1138
+ nmdaymask: bt,
1139
+ wdaymask: ge.slice(n),
1140
+ mrange: vt
1141
+ };
1142
+ }
1143
+ function Et(t, e, r, n, a, i) {
1144
+ var o = {
1145
+ lastyear: t,
1146
+ lastmonth: e,
1147
+ nwdaymask: []
1148
+ }, s = [];
1149
+ if (i.freq === y.YEARLY)
1150
+ if (A(i.bymonth))
1151
+ s = [[0, r]];
1152
+ else
1153
+ for (var u = 0; u < i.bymonth.length; u++)
1154
+ e = i.bymonth[u], s.push(n.slice(e - 1, e + 1));
1155
+ else i.freq === y.MONTHLY && (s = [n.slice(e - 1, e + 1)]);
1156
+ if (A(s))
1157
+ return o;
1158
+ o.nwdaymask = p(0, r);
1159
+ for (var u = 0; u < s.length; u++)
1160
+ for (var h = s[u], d = h[0], m = h[1] - 1, l = 0; l < i.bynweekday.length; l++) {
1161
+ var c = void 0, w = i.bynweekday[l], k = w[0], b = w[1];
1162
+ b < 0 ? (c = m + (b + 1) * 7, c -= U(a[c] - k, 7)) : (c = d + (b - 1) * 7, c += U(7 - a[c] + k, 7)), d <= c && c <= m && (o.nwdaymask[c] = 1);
1163
+ }
1164
+ return o;
1165
+ }
1166
+ function Tt(t, e) {
1167
+ e === void 0 && (e = 0);
1168
+ var r = t % 19, n = Math.floor(t / 100), a = t % 100, i = Math.floor(n / 4), o = n % 4, s = Math.floor((n + 8) / 25), u = Math.floor((n - s + 1) / 3), h = Math.floor(19 * r + n - i - u + 15) % 30, d = Math.floor(a / 4), m = a % 4, l = Math.floor(32 + 2 * o + 2 * d - h - m) % 7, c = Math.floor((r + 11 * h + 22 * l) / 451), w = Math.floor((h + l - 7 * c + 114) / 31), k = (h + l - 7 * c + 114) % 31 + 1, b = Date.UTC(t, w - 1, k + e), g = Date.UTC(t, 0, 1);
1169
+ return [Math.ceil((b - g) / (1e3 * 60 * 60 * 24))];
1170
+ }
1171
+ var Dt = (
1172
+ /** @class */
1173
+ (function() {
1174
+ function t(e) {
1175
+ this.options = e;
1176
+ }
1177
+ return t.prototype.rebuild = function(e, r) {
1178
+ var n = this.options;
1179
+ if (e !== this.lastyear && (this.yearinfo = kt(e, n)), D(n.bynweekday) && (r !== this.lastmonth || e !== this.lastyear)) {
1180
+ var a = this.yearinfo, i = a.yearlen, o = a.mrange, s = a.wdaymask;
1181
+ this.monthinfo = Et(e, r, i, o, s, n);
1182
+ }
1183
+ T(n.byeaster) && (this.eastermask = Tt(e, n.byeaster));
1184
+ }, Object.defineProperty(t.prototype, "lastyear", {
1185
+ get: function() {
1186
+ return this.monthinfo ? this.monthinfo.lastyear : null;
1187
+ },
1188
+ enumerable: !1,
1189
+ configurable: !0
1190
+ }), Object.defineProperty(t.prototype, "lastmonth", {
1191
+ get: function() {
1192
+ return this.monthinfo ? this.monthinfo.lastmonth : null;
1193
+ },
1194
+ enumerable: !1,
1195
+ configurable: !0
1196
+ }), Object.defineProperty(t.prototype, "yearlen", {
1197
+ get: function() {
1198
+ return this.yearinfo.yearlen;
1199
+ },
1200
+ enumerable: !1,
1201
+ configurable: !0
1202
+ }), Object.defineProperty(t.prototype, "yearordinal", {
1203
+ get: function() {
1204
+ return this.yearinfo.yearordinal;
1205
+ },
1206
+ enumerable: !1,
1207
+ configurable: !0
1208
+ }), Object.defineProperty(t.prototype, "mrange", {
1209
+ get: function() {
1210
+ return this.yearinfo.mrange;
1211
+ },
1212
+ enumerable: !1,
1213
+ configurable: !0
1214
+ }), Object.defineProperty(t.prototype, "wdaymask", {
1215
+ get: function() {
1216
+ return this.yearinfo.wdaymask;
1217
+ },
1218
+ enumerable: !1,
1219
+ configurable: !0
1220
+ }), Object.defineProperty(t.prototype, "mmask", {
1221
+ get: function() {
1222
+ return this.yearinfo.mmask;
1223
+ },
1224
+ enumerable: !1,
1225
+ configurable: !0
1226
+ }), Object.defineProperty(t.prototype, "wnomask", {
1227
+ get: function() {
1228
+ return this.yearinfo.wnomask;
1229
+ },
1230
+ enumerable: !1,
1231
+ configurable: !0
1232
+ }), Object.defineProperty(t.prototype, "nwdaymask", {
1233
+ get: function() {
1234
+ return this.monthinfo ? this.monthinfo.nwdaymask : [];
1235
+ },
1236
+ enumerable: !1,
1237
+ configurable: !0
1238
+ }), Object.defineProperty(t.prototype, "nextyearlen", {
1239
+ get: function() {
1240
+ return this.yearinfo.nextyearlen;
1241
+ },
1242
+ enumerable: !1,
1243
+ configurable: !0
1244
+ }), Object.defineProperty(t.prototype, "mdaymask", {
1245
+ get: function() {
1246
+ return this.yearinfo.mdaymask;
1247
+ },
1248
+ enumerable: !1,
1249
+ configurable: !0
1250
+ }), Object.defineProperty(t.prototype, "nmdaymask", {
1251
+ get: function() {
1252
+ return this.yearinfo.nmdaymask;
1253
+ },
1254
+ enumerable: !1,
1255
+ configurable: !0
1256
+ }), t.prototype.ydayset = function() {
1257
+ return [R(this.yearlen), 0, this.yearlen];
1258
+ }, t.prototype.mdayset = function(e, r) {
1259
+ for (var n = this.mrange[r - 1], a = this.mrange[r], i = p(null, this.yearlen), o = n; o < a; o++)
1260
+ i[o] = o;
1261
+ return [i, n, a];
1262
+ }, t.prototype.wdayset = function(e, r, n) {
1263
+ for (var a = p(null, this.yearlen + 7), i = ne(P(e, r, n)) - this.yearordinal, o = i, s = 0; s < 7 && (a[i] = i, ++i, this.wdaymask[i] !== this.options.wkst); s++)
1264
+ ;
1265
+ return [a, o, i];
1266
+ }, t.prototype.ddayset = function(e, r, n) {
1267
+ var a = p(null, this.yearlen), i = ne(P(e, r, n)) - this.yearordinal;
1268
+ return a[i] = i, [a, i, i + 1];
1269
+ }, t.prototype.htimeset = function(e, r, n, a) {
1270
+ var i = this, o = [];
1271
+ return this.options.byminute.forEach(function(s) {
1272
+ o = o.concat(i.mtimeset(e, s, n, a));
1273
+ }), ae(o), o;
1274
+ }, t.prototype.mtimeset = function(e, r, n, a) {
1275
+ var i = this.options.bysecond.map(function(o) {
1276
+ return new $(e, r, o, a);
1277
+ });
1278
+ return ae(i), i;
1279
+ }, t.prototype.stimeset = function(e, r, n, a) {
1280
+ return [new $(e, r, n, a)];
1281
+ }, t.prototype.getdayset = function(e) {
1282
+ switch (e) {
1283
+ case v.YEARLY:
1284
+ return this.ydayset.bind(this);
1285
+ case v.MONTHLY:
1286
+ return this.mdayset.bind(this);
1287
+ case v.WEEKLY:
1288
+ return this.wdayset.bind(this);
1289
+ case v.DAILY:
1290
+ return this.ddayset.bind(this);
1291
+ default:
1292
+ return this.ddayset.bind(this);
1293
+ }
1294
+ }, t.prototype.gettimeset = function(e) {
1295
+ switch (e) {
1296
+ case v.HOURLY:
1297
+ return this.htimeset.bind(this);
1298
+ case v.MINUTELY:
1299
+ return this.mtimeset.bind(this);
1300
+ case v.SECONDLY:
1301
+ return this.stimeset.bind(this);
1302
+ }
1303
+ }, t;
1304
+ })()
1305
+ );
1306
+ function Ot(t, e, r, n, a, i) {
1307
+ for (var o = [], s = 0; s < t.length; s++) {
1308
+ var u = void 0, h = void 0, d = t[s];
1309
+ d < 0 ? (u = Math.floor(d / e.length), h = U(d, e.length)) : (u = Math.floor((d - 1) / e.length), h = U(d - 1, e.length));
1310
+ for (var m = [], l = r; l < n; l++) {
1311
+ var c = i[l];
1312
+ T(c) && m.push(c);
1313
+ }
1314
+ var w = void 0;
1315
+ u < 0 ? w = m.slice(u)[0] : w = m[u];
1316
+ var k = e[h], b = Se(a.yearordinal + w), g = xe(b, k);
1317
+ E(o, g) || o.push(g);
1318
+ }
1319
+ return ae(o), o;
1320
+ }
1321
+ function Yt(t, e) {
1322
+ var r = e.dtstart, n = e.freq, a = e.interval, i = e.until, o = e.bysetpos, s = e.count;
1323
+ if (s === 0 || a === 0)
1324
+ return C(t);
1325
+ var u = $e.fromDate(r), h = new Dt(e);
1326
+ h.rebuild(u.year, u.month);
1327
+ for (var d = Mt(h, u, e); ; ) {
1328
+ var m = h.getdayset(n)(u.year, u.month, u.day), l = m[0], c = m[1], w = m[2], k = xt(l, c, w, h, e);
1329
+ if (D(o))
1330
+ for (var b = Ot(o, d, c, w, h, l), g = 0; g < b.length; g++) {
1331
+ var x = b[g];
1332
+ if (i && x > i)
1333
+ return C(t);
1334
+ if (x >= r) {
1335
+ var j = Ee(x, e);
1336
+ if (!t.accept(j) || s && (--s, !s))
1337
+ return C(t);
1338
+ }
1339
+ }
1340
+ else
1341
+ for (var g = c; g < w; g++) {
1342
+ var Z = l[g];
1343
+ if (T(Z))
1344
+ for (var X = Se(h.yearordinal + Z), q = 0; q < d.length; q++) {
1345
+ var Ce = d[q], x = xe(X, Ce);
1346
+ if (i && x > i)
1347
+ return C(t);
1348
+ if (x >= r) {
1349
+ var j = Ee(x, e);
1350
+ if (!t.accept(j) || s && (--s, !s))
1351
+ return C(t);
1352
+ }
1353
+ }
1354
+ }
1355
+ if (e.interval === 0 || (u.add(e, k), u.year > De))
1356
+ return C(t);
1357
+ ue(n) || (d = h.gettimeset(n)(u.hour, u.minute, u.second, 0)), h.rebuild(u.year, u.month);
1358
+ }
1359
+ }
1360
+ function St(t, e, r) {
1361
+ var n = r.bymonth, a = r.byweekno, i = r.byweekday, o = r.byeaster, s = r.bymonthday, u = r.bynmonthday, h = r.byyearday;
1362
+ return D(n) && !E(n, t.mmask[e]) || D(a) && !t.wnomask[e] || D(i) && !E(i, t.wdaymask[e]) || D(t.nwdaymask) && !t.nwdaymask[e] || o !== null && !E(t.eastermask, e) || (D(s) || D(u)) && !E(s, t.mdaymask[e]) && !E(u, t.nmdaymask[e]) || D(h) && (e < t.yearlen && !E(h, e + 1) && !E(h, -t.yearlen + e) || e >= t.yearlen && !E(h, e + 1 - t.yearlen) && !E(h, -t.nextyearlen + e - t.yearlen));
1363
+ }
1364
+ function Ee(t, e) {
1365
+ return new Re(t, e.tzid).rezonedDate();
1366
+ }
1367
+ function C(t) {
1368
+ return t.getValue();
1369
+ }
1370
+ function xt(t, e, r, n, a) {
1371
+ for (var i = !1, o = e; o < r; o++) {
1372
+ var s = t[o];
1373
+ i = St(n, s, a), i && (t[s] = null);
1374
+ }
1375
+ return i;
1376
+ }
1377
+ function Mt(t, e, r) {
1378
+ var n = r.freq, a = r.byhour, i = r.byminute, o = r.bysecond;
1379
+ return ue(n) ? et(r) : n >= y.HOURLY && D(a) && !E(a, e.hour) || n >= y.MINUTELY && D(i) && !E(i, e.minute) || n >= y.SECONDLY && D(o) && !E(o, e.second) ? [] : t.gettimeset(n)(e.hour, e.minute, e.second, e.millisecond);
1380
+ }
1381
+ var N = {
1382
+ MO: new S(0),
1383
+ TU: new S(1),
1384
+ WE: new S(2),
1385
+ TH: new S(3),
1386
+ FR: new S(4),
1387
+ SA: new S(5),
1388
+ SU: new S(6)
1389
+ }, fe = {
1390
+ freq: v.YEARLY,
1391
+ dtstart: null,
1392
+ interval: 1,
1393
+ wkst: N.MO,
1394
+ count: null,
1395
+ until: null,
1396
+ tzid: null,
1397
+ bysetpos: null,
1398
+ bymonth: null,
1399
+ bymonthday: null,
1400
+ bynmonthday: null,
1401
+ byyearday: null,
1402
+ byweekno: null,
1403
+ byweekday: null,
1404
+ bynweekday: null,
1405
+ byhour: null,
1406
+ byminute: null,
1407
+ bysecond: null,
1408
+ byeaster: null
1409
+ }, Ut = Object.keys(fe), y = (
1410
+ /** @class */
1411
+ (function() {
1412
+ function t(e, r) {
1413
+ e === void 0 && (e = {}), r === void 0 && (r = !1), this._cache = r ? null : new ot(), this.origOptions = Ae(e);
1414
+ var n = Xe(e).parsedOptions;
1415
+ this.options = n;
1416
+ }
1417
+ return t.parseText = function(e, r) {
1418
+ return Le(e, r);
1419
+ }, t.fromText = function(e, r) {
1420
+ return Je(e, r);
1421
+ }, t.fromString = function(e) {
1422
+ return new t(t.parseString(e) || void 0);
1423
+ }, t.prototype._iter = function(e) {
1424
+ return Yt(e, this.options);
1425
+ }, t.prototype._cacheGet = function(e, r) {
1426
+ return this._cache ? this._cache._cacheGet(e, r) : !1;
1427
+ }, t.prototype._cacheAdd = function(e, r, n) {
1428
+ if (this._cache)
1429
+ return this._cache._cacheAdd(e, r, n);
1430
+ }, t.prototype.all = function(e) {
1431
+ if (e)
1432
+ return this._iter(new be("all", {}, e));
1433
+ var r = this._cacheGet("all");
1434
+ return r === !1 && (r = this._iter(new F("all", {})), this._cacheAdd("all", r)), r;
1435
+ }, t.prototype.between = function(e, r, n, a) {
1436
+ if (n === void 0 && (n = !1), !G(e) || !G(r))
1437
+ throw new Error("Invalid date passed in to RRule.between");
1438
+ var i = {
1439
+ before: r,
1440
+ after: e,
1441
+ inc: n
1442
+ };
1443
+ if (a)
1444
+ return this._iter(new be("between", i, a));
1445
+ var o = this._cacheGet("between", i);
1446
+ return o === !1 && (o = this._iter(new F("between", i)), this._cacheAdd("between", o, i)), o;
1447
+ }, t.prototype.before = function(e, r) {
1448
+ if (r === void 0 && (r = !1), !G(e))
1449
+ throw new Error("Invalid date passed in to RRule.before");
1450
+ var n = { dt: e, inc: r }, a = this._cacheGet("before", n);
1451
+ return a === !1 && (a = this._iter(new F("before", n)), this._cacheAdd("before", a, n)), a;
1452
+ }, t.prototype.after = function(e, r) {
1453
+ if (r === void 0 && (r = !1), !G(e))
1454
+ throw new Error("Invalid date passed in to RRule.after");
1455
+ var n = { dt: e, inc: r }, a = this._cacheGet("after", n);
1456
+ return a === !1 && (a = this._iter(new F("after", n)), this._cacheAdd("after", a, n)), a;
1457
+ }, t.prototype.count = function() {
1458
+ return this.all().length;
1459
+ }, t.prototype.toString = function() {
1460
+ return ke(this.origOptions);
1461
+ }, t.prototype.toText = function(e, r, n) {
1462
+ return Qe(this, e, r, n);
1463
+ }, t.prototype.isFullyConvertibleToText = function() {
1464
+ return Ve(this);
1465
+ }, t.prototype.clone = function() {
1466
+ return new t(this.origOptions);
1467
+ }, t.FREQUENCIES = [
1468
+ "YEARLY",
1469
+ "MONTHLY",
1470
+ "WEEKLY",
1471
+ "DAILY",
1472
+ "HOURLY",
1473
+ "MINUTELY",
1474
+ "SECONDLY"
1475
+ ], t.YEARLY = v.YEARLY, t.MONTHLY = v.MONTHLY, t.WEEKLY = v.WEEKLY, t.DAILY = v.DAILY, t.HOURLY = v.HOURLY, t.MINUTELY = v.MINUTELY, t.SECONDLY = v.SECONDLY, t.MO = N.MO, t.TU = N.TU, t.WE = N.WE, t.TH = N.TH, t.FR = N.FR, t.SA = N.SA, t.SU = N.SU, t.parseString = tt, t.optionsToString = ke, t;
1476
+ })()
1477
+ );
1478
+ const Nt = (t) => {
1479
+ const e = {};
1480
+ (!t.startDate || !(t.startDate instanceof Date) || isNaN(t.startDate.getTime())) && (e.startDate = "Debe seleccionar una fecha de inicio");
1481
+ const r = {};
1482
+ switch (t.frequency) {
1483
+ case "weekly": {
1484
+ const n = t.frequencySettings;
1485
+ (!n || n.length === 0) && (r.weeklyWeekdays = "Debe seleccionar al menos un día de la semana");
1486
+ break;
1487
+ }
1488
+ case "monthly": {
1489
+ const n = t.frequencySettings;
1490
+ if (!n) {
1491
+ r.monthlyDayOrder = "Configuración mensual incompleta";
1492
+ break;
1493
+ }
1494
+ n.type === "relative" && (n.dayOrder || (r.monthlyDayOrder = "Debe seleccionar un orden"), n.weekDay || (r.monthlyWeekDay = "Debe seleccionar un día de la semana")), n.type === "absolute" && (n.dayOfMonth || (r.monthlyDayOfMonth = "Debe seleccionar un día del mes"));
1495
+ break;
1496
+ }
1497
+ case "yearly": {
1498
+ const n = t.frequencySettings;
1499
+ (!n || !n.month) && (r.yearlyMonth = "Debe seleccionar un mes"), (!n || !n.day) && (r.yearlyDay = "Debe seleccionar un día");
1500
+ break;
1501
+ }
1502
+ case "custom": {
1503
+ const n = t.frequencySettings;
1504
+ (!n || !n.interval || n.interval < 1) && (r.customInterval = "Debe seleccionar un intervalo válido"), n?.frequency === "weekly" && (!n.weekdays || n.weekdays.length === 0) && (r.customWeekdays = "Debe seleccionar al menos un día de la semana"), n?.frequency === "monthly" && (n.dayOfMonth || (r.customDayOfMonth = "Debe seleccionar un día del mes"));
1505
+ break;
1506
+ }
1507
+ }
1508
+ return Object.keys(r).length > 0 && (e.frequencySettings = r), e;
1509
+ }, Lt = (t) => {
1510
+ const e = Nt(t);
1511
+ return !(e.startDate || e.frequencySettings && Object.keys(e.frequencySettings).length > 0);
1512
+ }, At = (t) => {
1513
+ const { selected: e } = t, r = e[0], n = e[e.length - 1];
1514
+ return /* @__PURE__ */ J.jsx("div", { className: "w-full ", children: /* @__PURE__ */ J.jsx(
1515
+ He,
1516
+ {
1517
+ className: "w-full! border-neutral-strong-default",
1518
+ mode: "multiple",
1519
+ selected: e,
1520
+ displayValue: e,
1521
+ startMonth: r,
1522
+ endMonth: n,
1523
+ readonly: !0
1524
+ }
1525
+ ) });
1526
+ }, Rt = 60, te = {
1527
+ monday: y.MO,
1528
+ tuesday: y.TU,
1529
+ wednesday: y.WE,
1530
+ thursday: y.TH,
1531
+ friday: y.FR,
1532
+ saturday: y.SA,
1533
+ sunday: y.SU
1534
+ }, Ct = {
1535
+ first: 1,
1536
+ second: 2,
1537
+ third: 3,
1538
+ fourth: 4,
1539
+ last: -1
1540
+ };
1541
+ function It(t) {
1542
+ const { startDate: e, frequency: r, frequencySettings: n } = t;
1543
+ if (!(e instanceof Date) || Number.isNaN(e.getTime()))
1544
+ return null;
1545
+ const a = {
1546
+ dtstart: new Date(e.setHours(0, 0, 0, 0))
1547
+ };
1548
+ switch (r) {
1549
+ case "weekly": {
1550
+ const o = (n ?? []).map((s) => te[s]);
1551
+ return o.length ? new y({
1552
+ ...a,
1553
+ freq: y.WEEKLY,
1554
+ interval: 1,
1555
+ byweekday: o
1556
+ }) : null;
1557
+ }
1558
+ case "monthly": {
1559
+ const i = n;
1560
+ if (!i)
1561
+ return null;
1562
+ if (i.type === "relative") {
1563
+ const u = te[i.weekDay], h = Ct[i.dayOrder];
1564
+ return !u || !h ? null : new y({
1565
+ ...a,
1566
+ freq: y.MONTHLY,
1567
+ interval: 1,
1568
+ byweekday: u,
1569
+ bysetpos: h
1570
+ });
1571
+ }
1572
+ const o = i.dayOfMonth;
1573
+ if (!o)
1574
+ return null;
1575
+ const s = o === "last" ? -1 : Number(o);
1576
+ return !s || Number.isNaN(s) ? null : new y({
1577
+ ...a,
1578
+ freq: y.MONTHLY,
1579
+ interval: 1,
1580
+ bymonthday: s
1581
+ });
1582
+ }
1583
+ case "yearly": {
1584
+ const i = n;
1585
+ return !i || !i.month || !i.day ? null : new y({
1586
+ ...a,
1587
+ freq: y.YEARLY,
1588
+ interval: 1,
1589
+ bymonth: i.month,
1590
+ bymonthday: Number(i.day)
1591
+ });
1592
+ }
1593
+ case "custom": {
1594
+ const i = n;
1595
+ if (!i || !i.interval || i.interval < 1)
1596
+ return null;
1597
+ if (i.frequency === "weekly") {
1598
+ const u = (i.weekdays ?? []).map((h) => te[h]);
1599
+ return u.length ? new y({
1600
+ ...a,
1601
+ freq: y.WEEKLY,
1602
+ interval: i.interval,
1603
+ byweekday: u
1604
+ }) : null;
1605
+ }
1606
+ const o = i.dayOfMonth;
1607
+ if (!o)
1608
+ return null;
1609
+ const s = o === "last" ? -1 : Number(o);
1610
+ return !s || Number.isNaN(s) ? null : new y({
1611
+ ...a,
1612
+ freq: y.MONTHLY,
1613
+ interval: i.interval,
1614
+ bymonthday: s
1615
+ });
1616
+ }
1617
+ default:
1618
+ return null;
1619
+ }
1620
+ }
1621
+ function _t(t, e, r, n) {
1622
+ const a = n ?? Rt, i = e;
1623
+ let o;
1624
+ r ? o = r : (o = new Date(i.getTime()), o.setFullYear(o.getFullYear() + 1));
1625
+ const s = t.between(i, o, !0);
1626
+ return s.length > a ? s.slice(0, a) : s;
1627
+ }
1628
+ const Wt = (t) => {
1629
+ const {
1630
+ value: e,
1631
+ defaultValue: r,
1632
+ onChange: n,
1633
+ errors: a,
1634
+ onRRuleChange: i,
1635
+ showPreview: o = !0,
1636
+ previewCount: s,
1637
+ previewUntil: u
1638
+ } = t, h = e !== void 0, [d, m] = he(
1639
+ () => e ?? r ?? {
1640
+ frequency: "weekly",
1641
+ startDate: /* @__PURE__ */ new Date(),
1642
+ frequencySettings: []
1643
+ }
1644
+ ), l = h ? e : d, c = _e(!1), [w, k] = he([]);
1645
+ ye(() => {
1646
+ if (!h) {
1647
+ if (!c.current) {
1648
+ c.current = !0;
1649
+ return;
1650
+ }
1651
+ n?.(d);
1652
+ }
1653
+ }, [d, h, n]), ye(() => {
1654
+ if (!l || !Lt(l)) {
1655
+ k([]);
1656
+ return;
1657
+ }
1658
+ const g = It(l);
1659
+ if (!g) {
1660
+ k([]);
1661
+ return;
1662
+ }
1663
+ if (i && i(g.toString()), o) {
1664
+ const x = _t(g, l.startDate, u, s);
1665
+ k(x);
1666
+ } else
1667
+ k([]);
1668
+ }, [l, i, o, u, s]);
1669
+ const b = (g) => {
1670
+ if (h) {
1671
+ n?.(g);
1672
+ return;
1673
+ }
1674
+ m(g);
1675
+ };
1676
+ return /* @__PURE__ */ J.jsxs("div", { className: "w-full flex flex-col gap-6 items-center", children: [
1677
+ /* @__PURE__ */ J.jsx(We, { value: l, onChange: b, errors: a }),
1678
+ o && /* @__PURE__ */ J.jsx(At, { selected: w })
1679
+ ] });
1680
+ }, Ht = Ie(Wt);
1681
+ Ht.displayName = "RecurrentDatePickerRRule";
1682
+ export {
1683
+ Ht as RecurrentDatePickerRRule
1684
+ };