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