Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rrule

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrule - npm Package Compare versions

Comparing version 2.7.1 to 2.7.2

4

CHANGELOG.md
### Changelog
- 2.7.2 (2023-02-10)
- Fix rezonedDate (#523)
- 2.7.1 (2022-07-10)

@@ -4,0 +8,0 @@

2

dist/es5/rrule.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rrule=e():t.rrule=e()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Frequency:()=>U,RRule:()=>Dt,RRuleSet:()=>Mt,Weekday:()=>r,rrulestr:()=>Yt});var n=["MO","TU","WE","TH","FR","SA","SU"],r=function(){function t(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}return t.fromStr=function(e){return new t(n.indexOf(e))},t.prototype.nth=function(e){return this.n===e?this:new t(this.weekday,e)},t.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},t.prototype.toString=function(){var t=n[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},t.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},t}(),i=function(t){return null!=t},o=function(t){return"number"==typeof t},a=function(t){return"string"==typeof t&&n.includes(t)},s=Array.isArray,u=function(t,e){void 0===e&&(e=t),1===arguments.length&&(e=t,t=0);for(var n=[],r=t;r<e;r++)n.push(r);return n},h=function(t,e){var n=0,r=[];if(s(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r};function y(t,e,n){void 0===n&&(n=" ");var r=String(t);return e>>=0,r.length>e?String(r):((e-=r.length)>n.length&&(n+=h(n,e/n.length)),n.slice(0,e)+String(r))}var c,d=function(t,e){var n=t%e;return n*e<0?n+e:n},l=function(t,e){return{div:Math.floor(t/e),mod:d(t,e)}},f=function(t){return!i(t)||0===t.length},p=function(t){return!f(t)},m=function(t,e){return p(t)&&-1!==t.indexOf(e)};!function(t){t.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],t.ONE_DAY=864e5,t.MAXYEAR=9999,t.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),t.PY_WEEKDAYS=[6,0,1,2,3,4,5],t.getYearDay=function(e){var n=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.ceil((n.valueOf()-new Date(e.getUTCFullYear(),0,1).valueOf())/t.ONE_DAY)+1},t.isLeapYear=function(t){return t%4==0&&t%100!=0||t%400==0},t.isDate=function(t){return t instanceof Date},t.isValidDate=function(e){return t.isDate(e)&&!isNaN(e.getTime())},t.tzOffset=function(t){return 60*t.getTimezoneOffset()*1e3},t.daysBetween=function(e,n){var r=e.getTime()-t.tzOffset(e)-(n.getTime()-t.tzOffset(n));return Math.round(r/t.ONE_DAY)},t.toOrdinal=function(e){return t.daysBetween(e,t.ORDINAL_BASE)},t.fromOrdinal=function(e){return new Date(t.ORDINAL_BASE.getTime()+e*t.ONE_DAY)},t.getMonthDays=function(e){var n=e.getUTCMonth();return 1===n&&t.isLeapYear(e.getUTCFullYear())?29:t.MONTH_DAYS[n]},t.getWeekday=function(e){return t.PY_WEEKDAYS[e.getUTCDay()]},t.monthRange=function(e,n){var r=new Date(Date.UTC(e,n,1));return[t.getWeekday(r),t.getMonthDays(r)]},t.combine=function(t,e){return e=e||t,new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},t.clone=function(t){return new Date(t.getTime())},t.cloneDates=function(e){for(var n=[],r=0;r<e.length;r++)n.push(t.clone(e[r]));return n},t.sort=function(t){t.sort((function(t,e){return t.getTime()-e.getTime()}))},t.timeToUntilString=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[y(n.getUTCFullYear().toString(),4,"0"),y(n.getUTCMonth()+1,2,"0"),y(n.getUTCDate(),2,"0"),"T",y(n.getUTCHours(),2,"0"),y(n.getUTCMinutes(),2,"0"),y(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},t.untilStringToDate=function(t){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(t);if(!e)throw new Error("Invalid UNTIL value: ".concat(t));return new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0))}}(c||(c={}));const b=c;const w=function(){function t(t,e){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=t,this.args=e,"between"===t?(this.maxDate=e.inc?e.before:new Date(e.before.getTime()-1),this.minDate=e.inc?e.after:new Date(e.after.getTime()+1)):"before"===t?this.maxDate=e.inc?e.dt:new Date(e.dt.getTime()-1):"after"===t&&(this.minDate=e.inc?e.dt:new Date(e.dt.getTime()+1))}return t.prototype.accept=function(t){++this.total;var e=this.minDate&&t<this.minDate,n=this.maxDate&&t>this.maxDate;if("between"===this.method){if(e)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!e||(this.add(t),!1);return this.add(t)},t.prototype.add=function(t){return this._result.push(t),!0},t.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;default:return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}();var v=function(t,e){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},v(t,e)};function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var k=function(){return k=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},k.apply(this,arguments)};Object.create;function E(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;const T=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.iterator=r,i}return g(e,t),e.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},e}(w);const D={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}};var O=function(t,e){return-1!==t.indexOf(e)},x=function(t){return t.toString()},Y=function(t,e,n){return"".concat(e," ").concat(n,", ").concat(t)};const S=function(){function t(t,e,n,r){if(void 0===e&&(e=x),void 0===n&&(n=D),void 0===r&&(r=Y),this.text=[],this.language=n||D,this.gettext=e,this.dateFormatter=r,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort((function(t,e){return t-e})),a.sort((function(t,e){return e-t})),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(i(this.origOptions.byweekday)){var u=s(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],h=String(u);this.byweekday={allWeeks:u.filter((function(t){return!t.n})),someWeeks:u.filter((function(t){return Boolean(t.n)})),isWeekdays:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1===h.indexOf("SA")&&-1===h.indexOf("SU"),isEveryDay:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1!==h.indexOf("SA")&&-1!==h.indexOf("SU")};var y=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(y),this.byweekday.someWeeks.sort(y),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return t.isFullyConvertible=function(e){if(!(e.options.freq in t.IMPLEMENTED))return!1;if(e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(O(["dtstart","wkst","freq"],n))return!0;if(!O(t.IMPLEMENTED[e.options.freq],n))return!1}return!0},t.prototype.isFullyConvertible=function(){return t.isFullyConvertible(this.rrule)},t.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in t.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[Dt.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},t.prototype.HOURLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},t.prototype.MINUTELY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},t.prototype.DAILY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},t.prototype.WEEKLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(1===this.options.interval&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},t.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},t.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},t.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},t.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},t.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},t.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},t.prototype.nth=function(t){var e;t=parseInt(t.toString(),10);var n=this.gettext;if(-1===t)return n("last");var r=Math.abs(t);switch(r){case 1:case 21:case 31:e=r+n("st");break;case 2:case 22:e=r+n("nd");break;case 3:case 23:e=r+n("rd");break;default:e=r+n("th")}return t<0?e+" "+n("last"):e},t.prototype.monthtext=function(t){return this.language.monthNames[t-1]},t.prototype.weekdaytext=function(t){var e=o(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[e]},t.prototype.plural=function(t){return t%100!=1},t.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},t.prototype.list=function(t,e,n,r){var i=this;void 0===r&&(r=","),s(t)||(t=[t]);e=e||function(t){return t.toString()};var o=function(t){return e&&e.call(i,t)};return n?function(t,e,n){for(var r="",i=0;i<t.length;i++)0!==i&&(i===t.length-1?r+=" "+n+" ":r+=e+" "),r+=t[i];return r}(t.map(o),r,n):t.map(o).join(r+" ")},t}();var U,L=function(){function t(t){this.done=!0,this.rules=t}return t.prototype.start=function(t){return this.text=t,this.done=!1,this.nextSymbol()},t.prototype.isDone=function(){return this.done&&null===this.symbol},t.prototype.nextSymbol=function(){var t,e;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in t=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===t||r[0].length>t[0].length)&&(t=r,e=n)}if(null!=t&&(this.text=this.text.substr(t[0].length),""===this.text&&(this.done=!0)),null==t)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===e);return this.symbol=e,this.value=t,!0},t.prototype.accept=function(t){if(this.symbol===t){if(this.value){var e=this.value;return this.nextSymbol(),e}return this.nextSymbol(),!0}return!1},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},t}();function M(t,e){void 0===e&&(e=D);var n={},r=new L(e.tokens);return r.start(t)?(function(){r.expect("every");var t=r.acceptNumber();t&&(n.interval=parseInt(t[0],10));if(r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=Dt.DAILY,r.nextSymbol()&&(!function(){if(!r.accept("at"))return;do{var t=r.acceptNumber();if(!t)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(t[0],10)];r.accept("comma");){if(!(t=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(t[0],10))}}while(r.accept("comma")||r.accept("at"))}(),u());break;case"weekday(s)":n.freq=Dt.WEEKLY,n.byweekday=[Dt.MO,Dt.TU,Dt.WE,Dt.TH,Dt.FR],r.nextSymbol(),u();break;case"week(s)":n.freq=Dt.WEEKLY,r.nextSymbol()&&(i(),u());break;case"hour(s)":n.freq=Dt.HOURLY,r.nextSymbol()&&(i(),u());break;case"minute(s)":n.freq=Dt.MINUTELY,r.nextSymbol()&&(i(),u());break;case"month(s)":n.freq=Dt.MONTHLY,r.nextSymbol()&&(i(),u());break;case"year(s)":n.freq=Dt.YEARLY,r.nextSymbol()&&(i(),u());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Dt.WEEKLY;var e=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Dt[e]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var h=a();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(Dt[h]),r.nextSymbol()}!function(){r.accept("on"),r.accept("the");var t=s();if(!t)return;n.bymonthday=[t],r.nextSymbol();for(;r.accept("comma");){if(!(t=s()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(t),r.nextSymbol()}}(),u();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=Dt.YEARLY,n.bymonth=[o()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=o();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(y),r.nextSymbol()}i(),u();break;default:throw new Error("Unknown symbol")}}(),n):null;function i(){var t=r.accept("on"),e=r.accept("the");if(t||e)do{var i=s(),u=a(),h=o();if(i)u?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Dt[u].nth(i))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(i),r.accept("day(s)"));else if(u)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Dt[u]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[Dt.MO,Dt.TU,Dt.WE,Dt.TH,Dt.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var y=r.acceptNumber();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(y[0],10)];r.accept("comma");){if(!(y=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(y[0],10))}}else{if(!h)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(h)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function o(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function a(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function s(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var t=parseInt(r.value[1],10);if(t<-366||t>366)throw new Error("Nth out of range: "+t);return r.nextSymbol(),r.accept("last")?-t:t;default:return!1}}function u(){if("until"===r.symbol){var t=Date.parse(r.text);if(!t)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(t)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}function _(t){return t<U.HOURLY}!function(t){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"}(U||(U={}));var R=function(t,e){return void 0===e&&(e=D),new Dt(M(t,e)||void 0)},A=["count","until","interval","byweekday","bymonthday","bymonth"];S.IMPLEMENTED=[],S.IMPLEMENTED[U.HOURLY]=A,S.IMPLEMENTED[U.MINUTELY]=A,S.IMPLEMENTED[U.DAILY]=["byhour"].concat(A),S.IMPLEMENTED[U.WEEKLY]=A,S.IMPLEMENTED[U.MONTHLY]=A,S.IMPLEMENTED[U.YEARLY]=["byweekno","byyearday"].concat(A);var N=S.isFullyConvertible,C=function(){function t(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}return t.prototype.getHours=function(){return this.hour},t.prototype.getMinutes=function(){return this.minute},t.prototype.getSeconds=function(){return this.second},t.prototype.getMilliseconds=function(){return this.millisecond},t.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},t}(),I=function(t){function e(e,n,r,i,o,a,s){var u=t.call(this,i,o,a,s)||this;return u.year=e,u.month=n,u.day=r,u}return g(e,t),e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return c.getWeekday(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var e=Math.floor(this.month/12),n=d(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,e){e>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-e))+7*t:this.day+=-(this.getWeekday()-e)+7*t,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=l(this.hour,24),i=r.div,o=r.mod;if(i&&(this.hour=o,this.addDaily(i)),f(n)||m(n,this.hour))break}},e.prototype.addMinutes=function(t,e,n,r){for(e&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var i=l(this.minute,60),o=i.div,a=i.mod;if(o&&(this.minute=a,this.addHours(o,!1,n)),(f(n)||m(n,this.hour))&&(f(r)||m(r,this.minute)))break}},e.prototype.addSeconds=function(t,e,n,r,i){for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var o=l(this.second,60),a=o.div,s=o.mod;if(a&&(this.second=s,this.addMinutes(a,!1,n,r)),(f(n)||m(n,this.hour))&&(f(r)||m(r,this.minute))&&(f(i)||m(i,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=c.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,13===this.month&&(this.month=1,++this.year,this.year>c.MAXYEAR))return;t=c.monthRange(this.year,this.month-1)[1]}}},e.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,o=t.byhour,a=t.byminute,s=t.bysecond;switch(n){case U.YEARLY:return this.addYears(r);case U.MONTHLY:return this.addMonths(r);case U.WEEKLY:return this.addWeekly(r,i);case U.DAILY:return this.addDaily(r);case U.HOURLY:return this.addHours(r,e,o);case U.MINUTELY:return this.addMinutes(r,e,o,a);case U.SECONDLY:return this.addSeconds(r,e,o,a,s)}},e}(C);function W(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];m(Tt,i)||e.push(i),b.isDate(t[i])&&!b.isValidDate(t[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return k({},t)}function j(t){var e=k(k({},Et),W(t));if(i(e.byeaster)&&(e.freq=Dt.YEARLY),!i(e.freq)||!Dt.FREQUENCIES[e.freq])throw new Error("Invalid frequency: ".concat(e.freq," ").concat(t.freq));if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),i(e.wkst)?o(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=Dt.MO.weekday,i(e.bysetpos)){o(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){if(0===(y=e.bysetpos[n])||!(y>=-366&&y<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||p(e.byweekno)||p(e.byyearday)||Boolean(e.bymonthday)||p(e.bymonthday)||i(e.byweekday)||i(e.byeaster)))switch(e.freq){case Dt.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Dt.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Dt.WEEKLY:e.byweekday=[b.getWeekday(e.dtstart)]}if(i(e.bymonth)&&!s(e.bymonth)&&(e.bymonth=[e.bymonth]),i(e.byyearday)&&!s(e.byyearday)&&o(e.byyearday)&&(e.byyearday=[e.byyearday]),i(e.bymonthday))if(s(e.bymonthday)){var u=[],h=[];for(n=0;n<e.bymonthday.length;n++){var y;(y=e.bymonthday[n])>0?u.push(y):y<0&&h.push(y)}e.bymonthday=u,e.bynmonthday=h}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(i(e.byweekno)&&!s(e.byweekno)&&(e.byweekno=[e.byweekno]),i(e.byweekday))if(o(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(a(e.byweekday))e.byweekday=[r.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof r)!e.byweekday.n||e.freq>Dt.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var c=[],d=[];for(n=0;n<e.byweekday.length;n++){var l=e.byweekday[n];o(l)?c.push(l):a(l)?c.push(r.fromStr(l).weekday):!l.n||e.freq>Dt.MONTHLY?c.push(l.weekday):d.push([l.weekday,l.n])}e.byweekday=p(c)?c:null,e.bynweekday=p(d)?d:null}else e.bynweekday=null;return i(e.byhour)?o(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<Dt.HOURLY?[e.dtstart.getUTCHours()]:null,i(e.byminute)?o(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<Dt.MINUTELY?[e.dtstart.getUTCMinutes()]:null,i(e.bysecond)?o(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<Dt.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function H(t){var e=t.split("\n").map(P).filter((function(t){return null!==t}));return k(k({},e[0]),e[1])}function q(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=b.untilStringToDate(i),e}function P(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return z(t);var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return z(t);case"DTSTART":return q(t);default:throw new Error("Unsupported RFC prop ".concat(n," in ").concat(t))}}function z(t){var e=q(t.replace(/^RRULE:/i,""));return t.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach((function(n){var i=n.split("="),o=i[0],a=i[1];switch(o.toUpperCase()){case"FREQ":e.freq=U[a.toUpperCase()];break;case"WKST":e.wkst=kt[a.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var s=function(t){if(-1!==t.indexOf(",")){return t.split(",").map(F)}return F(t)}(a),u=o.toLowerCase();e[u]=s;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=function(t){return t.split(",").map((function(t){if(2===t.length)return kt[t];var e=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!e||e.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var n=Number(e[1]),i=e[2],o=kt[i].weekday;return new r(o,n)}))}(a);break;case"DTSTART":case"TZID":var h=q(t);e.tzid=h.tzid,e.dtstart=h.dtstart;break;case"UNTIL":e.until=b.untilStringToDate(a);break;case"BYEASTER":e.byeaster=Number(a);break;default:throw new Error("Unknown RRULE property '"+o+"'")}})),e}function F(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var K=function(){function t(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=b.timeToUntilString(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){var t;if(this.isUTC)return this.date;var e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(this.date.toLocaleString(void 0,{timeZone:e})),r=new Date(this.date.toLocaleString(void 0,{timeZone:null!==(t=this.tzid)&&void 0!==t?t:"UTC"})).getTime()-n.getTime();return new Date(this.date.getTime()-r)},t}();function B(t){for(var e,n=[],a="",u=Object.keys(t),h=Object.keys(Et),y=0;y<u.length;y++)if("tzid"!==u[y]&&m(h,u[y])){var c=u[y].toUpperCase(),d=t[u[y]],l="";if(i(d)&&(!s(d)||d.length)){switch(c){case"FREQ":l=Dt.FREQUENCIES[t.freq];break;case"WKST":l=o(d)?new r(d).toString():d.toString();break;case"BYWEEKDAY":c="BYDAY",l=(e=d,s(e)?e:[e]).map((function(t){return t instanceof r?t:s(t)?new r(t[0],t[1]):new r(t)})).toString();break;case"DTSTART":a=Z(d,t.tzid);break;case"UNTIL":l=b.timeToUntilString(d,!t.tzid);break;default:if(s(d)){for(var f=[],p=0;p<d.length;p++)f[p]=String(d[p]);l=f.toString()}else l=String(d)}l&&n.push([c,l])}}var w=n.map((function(t){var e=t[0],n=t[1];return"".concat(e,"=").concat(n.toString())})).join(";"),v="";return""!==w&&(v="RRULE:".concat(w)),[a,v].filter((function(t){return!!t})).join("\n")}function Z(t,e){return t?"DTSTART"+new K(new Date(t),e).toString():""}function V(t,e){return Array.isArray(t)?!!Array.isArray(e)&&(t.length===e.length&&t.every((function(t,n){return t.getTime()===e[n].getTime()}))):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():t===e}var X=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?b.clone(e):b.cloneDates(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},t.prototype._cacheGet=function(t,e){var n=!1,r=e?Object.keys(e):[],i=function(t){for(var n=0;n<r.length;n++){var i=r[n];if(!V(e[i],t[i]))return!0}return!1},o=this[t];if("all"===t)n=this.all;else if(s(o))for(var a=0;a<o.length;a++){var u=o[a];if(!r.length||!i(u)){n=u._value;break}}if(!n&&this.all){var h=new w(t,e);for(a=0;a<this.all.length&&h.accept(this.all[a]);a++);n=h.getValue(),this._cacheAdd(t,n,e)}return s(n)?b.cloneDates(n):n instanceof Date?b.clone(n):n},t}(),G=E(E(E(E(E(E(E(E(E(E(E(E(E([],h(1,31),!0),h(2,28),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),Q=E(E(E(E(E(E(E(E(E(E(E(E(E([],h(1,31),!0),h(2,29),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),$=u(1,29),J=u(1,30),tt=u(1,31),et=u(1,32),nt=E(E(E(E(E(E(E(E(E(E(E(E(E([],et,!0),J,!0),et,!0),tt,!0),et,!0),tt,!0),et,!0),et,!0),tt,!0),et,!0),tt,!0),et,!0),et.slice(0,7),!0),rt=E(E(E(E(E(E(E(E(E(E(E(E(E([],et,!0),$,!0),et,!0),tt,!0),et,!0),tt,!0),et,!0),et,!0),tt,!0),et,!0),tt,!0),et,!0),et.slice(0,7),!0),it=u(-28,0),ot=u(-29,0),at=u(-30,0),st=u(-31,0),ut=E(E(E(E(E(E(E(E(E(E(E(E(E([],st,!0),ot,!0),st,!0),at,!0),st,!0),at,!0),st,!0),st,!0),at,!0),st,!0),at,!0),st,!0),st.slice(0,7),!0),ht=E(E(E(E(E(E(E(E(E(E(E(E(E([],st,!0),it,!0),st,!0),at,!0),st,!0),at,!0),st,!0),st,!0),at,!0),st,!0),at,!0),st,!0),st.slice(0,7),!0),yt=[0,31,60,91,121,152,182,213,244,274,305,335,366],ct=[0,31,59,90,120,151,181,212,243,273,304,334,365],dt=function(){for(var t=[],e=0;e<55;e++)t=t.concat(u(7));return t}();function lt(t,e){var n,r,i=new Date(Date.UTC(t,0,1)),o=b.isLeapYear(t)?366:365,a=b.isLeapYear(t+1)?366:365,s=b.toOrdinal(i),u=b.getWeekday(i),y=k(k({yearlen:o,nextyearlen:a,yearordinal:s,yearweekday:u},function(t){var e=b.isLeapYear(t)?366:365,n=new Date(Date.UTC(t,0,1)),r=b.getWeekday(n);if(365===e)return{mmask:G,mdaymask:rt,nmdaymask:ht,wdaymask:dt.slice(r),mrange:ct};return{mmask:Q,mdaymask:nt,nmdaymask:ut,wdaymask:dt.slice(r),mrange:yt}}(t)),{wnomask:null});if(f(e.byweekno))return y;y.wnomask=h(0,o+7);var c=n=d(7-u+e.wkst,7);c>=4?(c=0,r=y.yearlen+d(u-e.wkst,7)):r=o-c;for(var l=Math.floor(r/7),p=d(r,7),w=Math.floor(l+p/4),v=0;v<e.byweekno.length;v++){var g=e.byweekno[v];if(g<0&&(g+=w+1),g>0&&g<=w){var E=void 0;g>1?(E=c+7*(g-1),c!==n&&(E-=7-n)):E=c;for(var T=0;T<7&&(y.wnomask[E]=1,E++,y.wdaymask[E]!==e.wkst);T++);}}if(m(e.byweekno,1)){E=c+7*w;if(c!==n&&(E-=7-n),E<o)for(v=0;v<7&&(y.wnomask[E]=1,E+=1,y.wdaymask[E]!==e.wkst);v++);}if(c){var D=void 0;if(m(e.byweekno,-1))D=-1;else{var O=b.getWeekday(new Date(Date.UTC(t-1,0,1))),x=d(7-O.valueOf()+e.wkst,7),Y=b.isLeapYear(t-1)?366:365,S=void 0;x>=4?(x=0,S=Y+d(O-e.wkst,7)):S=o-c,D=Math.floor(52+d(S,7)/4)}if(m(e.byweekno,D))for(E=0;E<c;E++)y.wnomask[E]=1}return y}const ft=function(){function t(t){this.options=t}return t.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=lt(t,n)),p(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,o=r.yearlen,a=r.mrange,s=r.wdaymask;this.monthinfo=function(t,e,n,r,i,o){var a={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(o.freq===Dt.YEARLY)if(f(o.bymonth))s=[[0,n]];else for(var u=0;u<o.bymonth.length;u++)e=o.bymonth[u],s.push(r.slice(e-1,e+1));else o.freq===Dt.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(f(s))return a;for(a.nwdaymask=h(0,n),u=0;u<s.length;u++)for(var y=s[u],c=y[0],l=y[1]-1,p=0;p<o.bynweekday.length;p++){var m=void 0,b=o.bynweekday[p],w=b[0],v=b[1];v<0?(m=l+7*(v+1),m-=d(i[m]-w,7)):(m=c+7*(v-1),m+=d(7-i[m]+w,7)),c<=m&&m<=l&&(a.nwdaymask[m]=1)}return a}(t,e,o,a,s,n)}i(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,o=Math.floor(r/4),a=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),h=Math.floor(19*n+r-o-u+15)%30,y=Math.floor(i/4),c=i%4,d=Math.floor(32+2*a+2*y-h-c)%7,l=Math.floor((n+11*h+22*d)/451),f=Math.floor((h+d-7*l+114)/31),p=(h+d-7*l+114)%31+1,m=Date.UTC(t,f-1,p+e),b=Date.UTC(t,0,1);return[Math.ceil((m-b)/864e5)]}(t,n.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),t.prototype.ydayset=function(){return[u(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e){for(var n=this.mrange[e-1],r=this.mrange[e],i=h(null,this.yearlen),o=n;o<r;o++)i[o]=o;return[i,n,r]},t.prototype.wdayset=function(t,e,n){for(var r=h(null,this.yearlen+7),i=b.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal,o=i,a=0;a<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);a++);return[r,o,i]},t.prototype.ddayset=function(t,e,n){var r=h(null,this.yearlen),i=b.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal;return r[i]=i,[r,i,i+1]},t.prototype.htimeset=function(t,e,n,r){var i=this,o=[];return this.options.byminute.forEach((function(e){o=o.concat(i.mtimeset(t,e,n,r))})),b.sort(o),o},t.prototype.mtimeset=function(t,e,n,r){var i=this.options.bysecond.map((function(n){return new C(t,e,n,r)}));return b.sort(i),i},t.prototype.stimeset=function(t,e,n,r){return[new C(t,e,n,r)]},t.prototype.getdayset=function(t){switch(t){case U.YEARLY:return this.ydayset.bind(this);case U.MONTHLY:return this.mdayset.bind(this);case U.WEEKLY:return this.wdayset.bind(this);case U.DAILY:default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(t){switch(t){case U.HOURLY:return this.htimeset.bind(this);case U.MINUTELY:return this.mtimeset.bind(this);case U.SECONDLY:return this.stimeset.bind(this)}},t}();function pt(t,e,n,r,o,a){for(var s=[],u=0;u<t.length;u++){var h=void 0,y=void 0,c=t[u];c<0?(h=Math.floor(c/e.length),y=d(c,e.length)):(h=Math.floor((c-1)/e.length),y=d(c-1,e.length));for(var l=[],f=n;f<r;f++){var p=a[f];i(p)&&l.push(p)}var w=void 0;w=h<0?l.slice(h)[0]:l[h];var v=e[y],g=b.fromOrdinal(o.yearordinal+w),k=b.combine(g,v);m(s,k)||s.push(k)}return b.sort(s),s}function mt(t,e){var n=e.dtstart,r=e.freq,o=e.interval,a=e.until,s=e.bysetpos,u=e.count;if(0===u||0===o)return vt(t);var h=I.fromDate(n),y=new ft(e);y.rebuild(h.year,h.month);for(var c=function(t,e,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;if(_(r))return function(t){var e=t.dtstart.getTime()%1e3;if(!_(t.freq))return[];var n=[];return t.byhour.forEach((function(r){t.byminute.forEach((function(i){t.bysecond.forEach((function(t){n.push(new C(r,i,t,e))}))}))})),n}(n);if(r>=Dt.HOURLY&&p(i)&&!m(i,e.hour)||r>=Dt.MINUTELY&&p(o)&&!m(o,e.minute)||r>=Dt.SECONDLY&&p(a)&&!m(a,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(y,h,e);;){var d=y.getdayset(r)(h.year,h.month,h.day),l=d[0],f=d[1],w=d[2],v=gt(l,f,w,y,e);if(p(s))for(var g=pt(s,c,f,w,y,l),k=0;k<g.length;k++){var E=g[k];if(a&&E>a)return vt(t);if(E>=n){var T=wt(E,e);if(!t.accept(T))return vt(t);if(u&&!--u)return vt(t)}}else for(k=f;k<w;k++){var D=l[k];if(i(D))for(var O=b.fromOrdinal(y.yearordinal+D),x=0;x<c.length;x++){var Y=c[x];E=b.combine(O,Y);if(a&&E>a)return vt(t);if(E>=n){T=wt(E,e);if(!t.accept(T))return vt(t);if(u&&!--u)return vt(t)}}}if(0===e.interval)return vt(t);if(h.add(e,v),h.year>b.MAXYEAR)return vt(t);_(r)||(c=y.gettimeset(r)(h.hour,h.minute,h.second,0)),y.rebuild(h.year,h.month)}}function bt(t,e,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,s=n.bymonthday,u=n.bynmonthday,h=n.byyearday;return p(r)&&!m(r,t.mmask[e])||p(i)&&!t.wnomask[e]||p(o)&&!m(o,t.wdaymask[e])||p(t.nwdaymask)&&!t.nwdaymask[e]||null!==a&&!m(t.eastermask,e)||(p(s)||p(u))&&!m(s,t.mdaymask[e])&&!m(u,t.nmdaymask[e])||p(h)&&(e<t.yearlen&&!m(h,e+1)&&!m(h,-t.yearlen+e)||e>=t.yearlen&&!m(h,e+1-t.yearlen)&&!m(h,-t.nextyearlen+e-t.yearlen))}function wt(t,e){return new K(t,e.tzid).rezonedDate()}function vt(t){return t.getValue()}function gt(t,e,n,r,i){for(var o=!1,a=e;a<n;a++){var s=t[a];(o=bt(r,s,i))&&(t[s]=null)}return o}var kt={MO:new r(0),TU:new r(1),WE:new r(2),TH:new r(3),FR:new r(4),SA:new r(5),SU:new r(6)},Et={freq:U.YEARLY,dtstart:null,interval:1,wkst:kt.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Tt=Object.keys(Et),Dt=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new X,this.origOptions=W(t);var n=j(t).parsedOptions;this.options=n}return t.parseText=function(t,e){return M(t,e)},t.fromText=function(t,e){return R(t,e)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(t){return mt(t,this.options)},t.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},t.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},t.prototype.all=function(t){if(t)return this._iter(new T("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new w("all",{})),this._cacheAdd("all",e)),e},t.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!b.isValidDate(t)||!b.isValidDate(e))throw new Error("Invalid date passed in to RRule.between");var i={before:e,after:t,inc:n};if(r)return this._iter(new T("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new w("between",i)),this._cacheAdd("between",o,i)),o},t.prototype.before=function(t,e){if(void 0===e&&(e=!1),!b.isValidDate(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new w("before",n)),this._cacheAdd("before",r,n)),r},t.prototype.after=function(t,e){if(void 0===e&&(e=!1),!b.isValidDate(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new w("after",n)),this._cacheAdd("after",r,n)),r},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return B(this.origOptions)},t.prototype.toText=function(t,e,n){return function(t,e,n,r){return new S(t,e,n,r).toString()}(this,t,e,n)},t.prototype.isFullyConvertibleToText=function(){return N(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=U.YEARLY,t.MONTHLY=U.MONTHLY,t.WEEKLY=U.WEEKLY,t.DAILY=U.DAILY,t.HOURLY=U.HOURLY,t.MINUTELY=U.MINUTELY,t.SECONDLY=U.SECONDLY,t.MO=kt.MO,t.TU=kt.TU,t.WE=kt.WE,t.TH=kt.TH,t.FR=kt.FR,t.SA=kt.SA,t.SU=kt.SU,t.parseString=H,t.optionsToString=B,t}();var Ot={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function xt(t,e){var n=[],r=[],i=[],o=[],a=q(t),s=a.dtstart,u=a.tzid,h=function(t,e){void 0===e&&(e=!1);if(!(t=t&&t.trim()))throw new Error("Invalid empty string");if(!e)return t.split(/\s/);var n=t.split("\n"),r=0;for(;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?r>0&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold);return h.forEach((function(t){var e;if(t){var a=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=(i=t,o=":",a=1,s=i.split(o),a?s.slice(0,a).concat([s.slice(a).join(o)]):s),n=e[0],r=e[1];var i,o,a,s;return{name:n,value:r}}(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}(t),s=a.name,h=a.parms,y=a.value;switch(s.toUpperCase()){case"RRULE":if(h.length)throw new Error("unsupported RRULE parm: ".concat(h.join(",")));n.push(H(t));break;case"RDATE":var c=(null!==(e=/RDATE(?:;TZID=([^:=]+))?/i.exec(t))&&void 0!==e?e:[])[1];c&&!u&&(u=c),r=r.concat(Ut(y,h));break;case"EXRULE":if(h.length)throw new Error("unsupported EXRULE parm: ".concat(h.join(",")));i.push(H(y));break;case"EXDATE":o=o.concat(Ut(y,h));break;case"DTSTART":break;default:throw new Error("unsupported property: "+s)}}})),{dtstart:s,tzid:u,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:o}}function Yt(t,e){return void 0===e&&(e={}),function(t,e){var n=xt(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,u=n.tzid,h=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||r.length>1||i.length||o.length||a.length){var y=new Mt(h);return y.dtstart(s),y.tzid(u||void 0),r.forEach((function(t){y.rrule(new Dt(St(t,s,u),h))})),i.forEach((function(t){y.rdate(t)})),o.forEach((function(t){y.exrule(new Dt(St(t,s,u),h))})),a.forEach((function(t){y.exdate(t)})),e.compatible&&e.dtstart&&y.rdate(s),y}var c=r[0]||{};return new Dt(St(c,c.dtstart||e.dtstart||s,c.tzid||e.tzid||u),h)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(Ot);if(n.forEach((function(t){m(r,t)||e.push(t)})),e.length)throw new Error("Invalid options: "+e.join(", "));return k(k({},Ot),t)}(e))}function St(t,e,n){return k(k({},t),{dtstart:e,tzid:n})}function Ut(t,e){return function(t){t.forEach((function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}))}(e),t.split(",").map((function(t){return b.untilStringToDate(t)}))}function Lt(t){var e=this;return function(n){if(void 0!==n&&(e["_".concat(t)]=n),void 0!==e["_".concat(t)])return e["_".concat(t)];for(var r=0;r<e._rrule.length;r++){var i=e._rrule[r].origOptions[t];if(i)return i}}}var Mt=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this,{},e)||this;return n.dtstart=Lt.apply(n,["dtstart"]),n.tzid=Lt.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return g(e,t),e.prototype._iter=function(t){return function(t,e,n,r,i,o){var a={},s=t.accept;function u(t,e){n.forEach((function(n){n.between(t,e,!0).forEach((function(t){a[Number(t)]=!0}))}))}i.forEach((function(t){var e=new K(t,o).rezonedDate();a[Number(e)]=!0})),t.accept=function(t){var e=Number(t);return isNaN(e)?s.call(this,t):!(!a[e]&&(u(new Date(e-1),new Date(e+1)),!a[e]))||(a[e]=!0,s.call(this,t))},"between"===t.method&&(u(t.args.after,t.args.before),t.accept=function(t){var e=Number(t);return!!a[e]||(a[e]=!0,s.call(this,t))});for(var h=0;h<r.length;h++){var y=new K(r[h],o).rezonedDate();if(!t.accept(new Date(y.getTime())))break}e.forEach((function(e){mt(t,e.options)}));var c=t._result;switch(b.sort(c),t.method){case"all":case"between":return c;case"before":return c.length&&c[c.length-1]||null;default:return c.length&&c[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){_t(t,this._rrule)},e.prototype.exrule=function(t){_t(t,this._exrule)},e.prototype.rdate=function(t){Rt(t,this._rdate)},e.prototype.exdate=function(t){Rt(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map((function(t){return Yt(t.toString())}))},e.prototype.exrules=function(){return this._exrule.map((function(t){return Yt(t.toString())}))},e.prototype.rdates=function(){return this._rdate.map((function(t){return new Date(t.getTime())}))},e.prototype.exdates=function(){return this._exdate.map((function(t){return new Date(t.getTime())}))},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(B({dtstart:this._dtstart}))),this._rrule.forEach((function(e){t=t.concat(e.toString().split("\n"))})),this._exrule.forEach((function(e){t=t.concat(e.toString().split("\n").map((function(t){return t.replace(/^RRULE:/,"EXRULE:")})).filter((function(t){return!/^DTSTART/.test(t)})))})),this._rdate.length&&t.push(At("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(At("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join("\n")},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach((function(e){return t.rrule(e.clone())})),this._exrule.forEach((function(e){return t.exrule(e.clone())})),this._rdate.forEach((function(e){return t.rdate(new Date(e.getTime()))})),this._exdate.forEach((function(e){return t.exdate(new Date(e.getTime()))})),t},e}(Dt);function _t(t,e){if(!(t instanceof Dt))throw new TypeError(String(t)+" is not RRule instance");m(e.map(String),String(t))||e.push(t)}function Rt(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");m(e.map(Number),Number(t))||(e.push(t),b.sort(e))}function At(t,e,n){var r=!n||"UTC"===n.toUpperCase(),i=r?"".concat(t,":"):"".concat(t,";TZID=").concat(n,":"),o=e.map((function(t){return b.timeToUntilString(t.valueOf(),r)})).join(",");return"".concat(i).concat(o)}return e})()));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rrule=e():t.rrule=e()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Frequency:()=>X,RRule:()=>Ft,RRuleSet:()=>Qt,Weekday:()=>r,datetime:()=>b,rrulestr:()=>Bt});var n=["MO","TU","WE","TH","FR","SA","SU"],r=function(){function t(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}return t.fromStr=function(e){return new t(n.indexOf(e))},t.prototype.nth=function(e){return this.n===e?this:new t(this.weekday,e)},t.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},t.prototype.toString=function(){var t=n[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},t.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},t}(),i=function(t){return null!=t},o=function(t){return"number"==typeof t},a=function(t){return"string"==typeof t&&n.includes(t)},s=Array.isArray,u=function(t,e){void 0===e&&(e=t),1===arguments.length&&(e=t,t=0);for(var n=[],r=t;r<e;r++)n.push(r);return n},h=function(t,e){var n=0,r=[];if(s(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r};function y(t,e,n){void 0===n&&(n=" ");var r=String(t);return e>>=0,r.length>e?String(r):((e-=r.length)>n.length&&(n+=h(n,e/n.length)),n.slice(0,e)+String(r))}var c=function(t,e){var n=t%e;return n*e<0?n+e:n},d=function(t,e){return{div:Math.floor(t/e),mod:c(t,e)}},l=function(t){return!i(t)||0===t.length},f=function(t){return!l(t)},p=function(t,e){return f(t)&&-1!==t.indexOf(e)},b=function(t,e,n,r,i,o){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),new Date(Date.UTC(t,e-1,n,r,i,o))},m=[31,28,31,30,31,30,31,31,30,31,30,31],w=864e5,v=b(1970,1,1),g=[6,0,1,2,3,4,5],k=function(t){return t%4==0&&t%100!=0||t%400==0},E=function(t){return t instanceof Date},T=function(t){return E(t)&&!isNaN(t.getTime())},x=function(t){return 60*t.getTimezoneOffset()*1e3},O=function(t){return n=v,r=(e=t).getTime()-x(e)-(n.getTime()-x(n)),Math.round(r/w);var e,n,r},D=function(t){return new Date(v.getTime()+t*w)},S=function(t){var e=t.getUTCMonth();return 1===e&&k(t.getUTCFullYear())?29:m[e]},U=function(t){return g[t.getUTCDay()]},Y=function(t,e){var n=b(t,e+1,1);return[U(n),S(n)]},L=function(t,e){return e=e||t,new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},M=function(t){return new Date(t.getTime())},_=function(t){for(var e=[],n=0;n<t.length;n++)e.push(M(t[n]));return e},R=function(t){t.sort((function(t,e){return t.getTime()-e.getTime()}))},N=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[y(n.getUTCFullYear().toString(),4,"0"),y(n.getUTCMonth()+1,2,"0"),y(n.getUTCDate(),2,"0"),"T",y(n.getUTCHours(),2,"0"),y(n.getUTCMinutes(),2,"0"),y(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},A=function(t){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(t);if(!e)throw new Error("Invalid UNTIL value: ".concat(t));return new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0))},C=function(t,e){return t.toLocaleString("sv-SE",{timeZone:e}).replace(" ","T")+"Z"};const I=function(){function t(t,e){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=t,this.args=e,"between"===t?(this.maxDate=e.inc?e.before:new Date(e.before.getTime()-1),this.minDate=e.inc?e.after:new Date(e.after.getTime()+1)):"before"===t?this.maxDate=e.inc?e.dt:new Date(e.dt.getTime()-1):"after"===t&&(this.minDate=e.inc?e.dt:new Date(e.dt.getTime()+1))}return t.prototype.accept=function(t){++this.total;var e=this.minDate&&t<this.minDate,n=this.maxDate&&t>this.maxDate;if("between"===this.method){if(e)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!e||(this.add(t),!1);return this.add(t)},t.prototype.add=function(t){return this._result.push(t),!0},t.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;default:return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}();var j=function(t,e){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},j(t,e)};function W(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var H=function(){return H=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},H.apply(this,arguments)};Object.create;function q(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;const P=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.iterator=r,i}return W(e,t),e.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},e}(I);const F={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}};var z=function(t,e){return-1!==t.indexOf(e)},K=function(t){return t.toString()},B=function(t,e,n){return"".concat(e," ").concat(n,", ").concat(t)};const Z=function(){function t(t,e,n,r){if(void 0===e&&(e=K),void 0===n&&(n=F),void 0===r&&(r=B),this.text=[],this.language=n||F,this.gettext=e,this.dateFormatter=r,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort((function(t,e){return t-e})),a.sort((function(t,e){return e-t})),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(i(this.origOptions.byweekday)){var u=s(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],h=String(u);this.byweekday={allWeeks:u.filter((function(t){return!t.n})),someWeeks:u.filter((function(t){return Boolean(t.n)})),isWeekdays:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1===h.indexOf("SA")&&-1===h.indexOf("SU"),isEveryDay:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1!==h.indexOf("SA")&&-1!==h.indexOf("SU")};var y=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(y),this.byweekday.someWeeks.sort(y),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return t.isFullyConvertible=function(e){if(!(e.options.freq in t.IMPLEMENTED))return!1;if(e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(z(["dtstart","wkst","freq"],n))return!0;if(!z(t.IMPLEMENTED[e.options.freq],n))return!1}return!0},t.prototype.isFullyConvertible=function(){return t.isFullyConvertible(this.rrule)},t.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in t.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[Ft.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},t.prototype.HOURLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},t.prototype.MINUTELY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},t.prototype.DAILY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},t.prototype.WEEKLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(1===this.options.interval&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},t.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},t.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},t.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},t.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},t.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},t.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},t.prototype.nth=function(t){var e;t=parseInt(t.toString(),10);var n=this.gettext;if(-1===t)return n("last");var r=Math.abs(t);switch(r){case 1:case 21:case 31:e=r+n("st");break;case 2:case 22:e=r+n("nd");break;case 3:case 23:e=r+n("rd");break;default:e=r+n("th")}return t<0?e+" "+n("last"):e},t.prototype.monthtext=function(t){return this.language.monthNames[t-1]},t.prototype.weekdaytext=function(t){var e=o(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[e]},t.prototype.plural=function(t){return t%100!=1},t.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},t.prototype.list=function(t,e,n,r){var i=this;void 0===r&&(r=","),s(t)||(t=[t]);e=e||function(t){return t.toString()};var o=function(t){return e&&e.call(i,t)};return n?function(t,e,n){for(var r="",i=0;i<t.length;i++)0!==i&&(i===t.length-1?r+=" "+n+" ":r+=e+" "),r+=t[i];return r}(t.map(o),r,n):t.map(o).join(r+" ")},t}();var X,G=function(){function t(t){this.done=!0,this.rules=t}return t.prototype.start=function(t){return this.text=t,this.done=!1,this.nextSymbol()},t.prototype.isDone=function(){return this.done&&null===this.symbol},t.prototype.nextSymbol=function(){var t,e;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in t=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===t||r[0].length>t[0].length)&&(t=r,e=n)}if(null!=t&&(this.text=this.text.substr(t[0].length),""===this.text&&(this.done=!0)),null==t)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===e);return this.symbol=e,this.value=t,!0},t.prototype.accept=function(t){if(this.symbol===t){if(this.value){var e=this.value;return this.nextSymbol(),e}return this.nextSymbol(),!0}return!1},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},t}();function Q(t,e){void 0===e&&(e=F);var n={},r=new G(e.tokens);return r.start(t)?(function(){r.expect("every");var t=r.acceptNumber();t&&(n.interval=parseInt(t[0],10));if(r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=Ft.DAILY,r.nextSymbol()&&(!function(){if(!r.accept("at"))return;do{var t=r.acceptNumber();if(!t)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(t[0],10)];r.accept("comma");){if(!(t=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(t[0],10))}}while(r.accept("comma")||r.accept("at"))}(),u());break;case"weekday(s)":n.freq=Ft.WEEKLY,n.byweekday=[Ft.MO,Ft.TU,Ft.WE,Ft.TH,Ft.FR],r.nextSymbol(),u();break;case"week(s)":n.freq=Ft.WEEKLY,r.nextSymbol()&&(i(),u());break;case"hour(s)":n.freq=Ft.HOURLY,r.nextSymbol()&&(i(),u());break;case"minute(s)":n.freq=Ft.MINUTELY,r.nextSymbol()&&(i(),u());break;case"month(s)":n.freq=Ft.MONTHLY,r.nextSymbol()&&(i(),u());break;case"year(s)":n.freq=Ft.YEARLY,r.nextSymbol()&&(i(),u());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Ft.WEEKLY;var e=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Ft[e]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var h=a();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(Ft[h]),r.nextSymbol()}!function(){r.accept("on"),r.accept("the");var t=s();if(!t)return;n.bymonthday=[t],r.nextSymbol();for(;r.accept("comma");){if(!(t=s()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(t),r.nextSymbol()}}(),u();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=Ft.YEARLY,n.bymonth=[o()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=o();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(y),r.nextSymbol()}i(),u();break;default:throw new Error("Unknown symbol")}}(),n):null;function i(){var t=r.accept("on"),e=r.accept("the");if(t||e)do{var i=s(),u=a(),h=o();if(i)u?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Ft[u].nth(i))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(i),r.accept("day(s)"));else if(u)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Ft[u]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[Ft.MO,Ft.TU,Ft.WE,Ft.TH,Ft.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var y=r.acceptNumber();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(y[0],10)];r.accept("comma");){if(!(y=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(y[0],10))}}else{if(!h)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(h)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function o(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function a(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function s(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var t=parseInt(r.value[1],10);if(t<-366||t>366)throw new Error("Nth out of range: "+t);return r.nextSymbol(),r.accept("last")?-t:t;default:return!1}}function u(){if("until"===r.symbol){var t=Date.parse(r.text);if(!t)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(t)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}function $(t){return t<X.HOURLY}!function(t){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"}(X||(X={}));var J=function(t,e){return void 0===e&&(e=F),new Ft(Q(t,e)||void 0)},V=["count","until","interval","byweekday","bymonthday","bymonth"];Z.IMPLEMENTED=[],Z.IMPLEMENTED[X.HOURLY]=V,Z.IMPLEMENTED[X.MINUTELY]=V,Z.IMPLEMENTED[X.DAILY]=["byhour"].concat(V),Z.IMPLEMENTED[X.WEEKLY]=V,Z.IMPLEMENTED[X.MONTHLY]=V,Z.IMPLEMENTED[X.YEARLY]=["byweekno","byyearday"].concat(V);var tt=Z.isFullyConvertible,et=function(){function t(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}return t.prototype.getHours=function(){return this.hour},t.prototype.getMinutes=function(){return this.minute},t.prototype.getSeconds=function(){return this.second},t.prototype.getMilliseconds=function(){return this.millisecond},t.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},t}(),nt=function(t){function e(e,n,r,i,o,a,s){var u=t.call(this,i,o,a,s)||this;return u.year=e,u.month=n,u.day=r,u}return W(e,t),e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return U(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var e=Math.floor(this.month/12),n=c(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,e){e>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-e))+7*t:this.day+=-(this.getWeekday()-e)+7*t,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=d(this.hour,24),i=r.div,o=r.mod;if(i&&(this.hour=o,this.addDaily(i)),l(n)||p(n,this.hour))break}},e.prototype.addMinutes=function(t,e,n,r){for(e&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var i=d(this.minute,60),o=i.div,a=i.mod;if(o&&(this.minute=a,this.addHours(o,!1,n)),(l(n)||p(n,this.hour))&&(l(r)||p(r,this.minute)))break}},e.prototype.addSeconds=function(t,e,n,r,i){for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var o=d(this.second,60),a=o.div,s=o.mod;if(a&&(this.second=s,this.addMinutes(a,!1,n,r)),(l(n)||p(n,this.hour))&&(l(r)||p(r,this.minute))&&(l(i)||p(i,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=Y(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,13===this.month&&(this.month=1,++this.year,this.year>9999))return;t=Y(this.year,this.month-1)[1]}}},e.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,o=t.byhour,a=t.byminute,s=t.bysecond;switch(n){case X.YEARLY:return this.addYears(r);case X.MONTHLY:return this.addMonths(r);case X.WEEKLY:return this.addWeekly(r,i);case X.DAILY:return this.addDaily(r);case X.HOURLY:return this.addHours(r,e,o);case X.MINUTELY:return this.addMinutes(r,e,o,a);case X.SECONDLY:return this.addSeconds(r,e,o,a,s)}},e}(et);function rt(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];p(Pt,i)||e.push(i),E(t[i])&&!T(t[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return H({},t)}function it(t){var e=H(H({},qt),rt(t));if(i(e.byeaster)&&(e.freq=Ft.YEARLY),!i(e.freq)||!Ft.FREQUENCIES[e.freq])throw new Error("Invalid frequency: ".concat(e.freq," ").concat(t.freq));if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),i(e.wkst)?o(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=Ft.MO.weekday,i(e.bysetpos)){o(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){if(0===(y=e.bysetpos[n])||!(y>=-366&&y<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||f(e.byweekno)||f(e.byyearday)||Boolean(e.bymonthday)||f(e.bymonthday)||i(e.byweekday)||i(e.byeaster)))switch(e.freq){case Ft.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Ft.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Ft.WEEKLY:e.byweekday=[U(e.dtstart)]}if(i(e.bymonth)&&!s(e.bymonth)&&(e.bymonth=[e.bymonth]),i(e.byyearday)&&!s(e.byyearday)&&o(e.byyearday)&&(e.byyearday=[e.byyearday]),i(e.bymonthday))if(s(e.bymonthday)){var u=[],h=[];for(n=0;n<e.bymonthday.length;n++){var y;(y=e.bymonthday[n])>0?u.push(y):y<0&&h.push(y)}e.bymonthday=u,e.bynmonthday=h}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(i(e.byweekno)&&!s(e.byweekno)&&(e.byweekno=[e.byweekno]),i(e.byweekday))if(o(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(a(e.byweekday))e.byweekday=[r.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof r)!e.byweekday.n||e.freq>Ft.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var c=[],d=[];for(n=0;n<e.byweekday.length;n++){var l=e.byweekday[n];o(l)?c.push(l):a(l)?c.push(r.fromStr(l).weekday):!l.n||e.freq>Ft.MONTHLY?c.push(l.weekday):d.push([l.weekday,l.n])}e.byweekday=f(c)?c:null,e.bynweekday=f(d)?d:null}else e.bynweekday=null;return i(e.byhour)?o(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<Ft.HOURLY?[e.dtstart.getUTCHours()]:null,i(e.byminute)?o(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<Ft.MINUTELY?[e.dtstart.getUTCMinutes()]:null,i(e.bysecond)?o(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<Ft.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function ot(t){var e=t.split("\n").map(st).filter((function(t){return null!==t}));return H(H({},e[0]),e[1])}function at(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=A(i),e}function st(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return ut(t);var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return ut(t);case"DTSTART":return at(t);default:throw new Error("Unsupported RFC prop ".concat(n," in ").concat(t))}}function ut(t){var e=at(t.replace(/^RRULE:/i,""));return t.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach((function(n){var i=n.split("="),o=i[0],a=i[1];switch(o.toUpperCase()){case"FREQ":e.freq=X[a.toUpperCase()];break;case"WKST":e.wkst=Ht[a.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var s=function(t){if(-1!==t.indexOf(",")){return t.split(",").map(ht)}return ht(t)}(a),u=o.toLowerCase();e[u]=s;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=function(t){return t.split(",").map((function(t){if(2===t.length)return Ht[t];var e=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!e||e.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var n=Number(e[1]),i=e[2],o=Ht[i].weekday;return new r(o,n)}))}(a);break;case"DTSTART":case"TZID":var h=at(t);e.tzid=h.tzid,e.dtstart=h.dtstart;break;case"UNTIL":e.until=A(a);break;case"BYEASTER":e.byeaster=Number(a);break;default:throw new Error("Unknown RRULE property '"+o+"'")}})),e}function ht(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var yt=function(){function t(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=N(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){return this.isUTC?this.date:function(t,e){var n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=new Date(C(t,n)),i=new Date(C(t,null!=e?e:"UTC")).getTime()-r.getTime();return new Date(t.getTime()-i)}(this.date,this.tzid)},t}();function ct(t){for(var e,n=[],a="",u=Object.keys(t),h=Object.keys(qt),y=0;y<u.length;y++)if("tzid"!==u[y]&&p(h,u[y])){var c=u[y].toUpperCase(),d=t[u[y]],l="";if(i(d)&&(!s(d)||d.length)){switch(c){case"FREQ":l=Ft.FREQUENCIES[t.freq];break;case"WKST":l=o(d)?new r(d).toString():d.toString();break;case"BYWEEKDAY":c="BYDAY",l=(e=d,s(e)?e:[e]).map((function(t){return t instanceof r?t:s(t)?new r(t[0],t[1]):new r(t)})).toString();break;case"DTSTART":a=dt(d,t.tzid);break;case"UNTIL":l=N(d,!t.tzid);break;default:if(s(d)){for(var f=[],b=0;b<d.length;b++)f[b]=String(d[b]);l=f.toString()}else l=String(d)}l&&n.push([c,l])}}var m=n.map((function(t){var e=t[0],n=t[1];return"".concat(e,"=").concat(n.toString())})).join(";"),w="";return""!==m&&(w="RRULE:".concat(m)),[a,w].filter((function(t){return!!t})).join("\n")}function dt(t,e){return t?"DTSTART"+new yt(new Date(t),e).toString():""}function lt(t,e){return Array.isArray(t)?!!Array.isArray(e)&&(t.length===e.length&&t.every((function(t,n){return t.getTime()===e[n].getTime()}))):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():t===e}var ft=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?M(e):_(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},t.prototype._cacheGet=function(t,e){var n=!1,r=e?Object.keys(e):[],i=function(t){for(var n=0;n<r.length;n++){var i=r[n];if(!lt(e[i],t[i]))return!0}return!1},o=this[t];if("all"===t)n=this.all;else if(s(o))for(var a=0;a<o.length;a++){var u=o[a];if(!r.length||!i(u)){n=u._value;break}}if(!n&&this.all){var h=new I(t,e);for(a=0;a<this.all.length&&h.accept(this.all[a]);a++);n=h.getValue(),this._cacheAdd(t,n,e)}return s(n)?_(n):n instanceof Date?M(n):n},t}(),pt=q(q(q(q(q(q(q(q(q(q(q(q(q([],h(1,31),!0),h(2,28),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),bt=q(q(q(q(q(q(q(q(q(q(q(q(q([],h(1,31),!0),h(2,29),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),mt=u(1,29),wt=u(1,30),vt=u(1,31),gt=u(1,32),kt=q(q(q(q(q(q(q(q(q(q(q(q(q([],gt,!0),wt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt.slice(0,7),!0),Et=q(q(q(q(q(q(q(q(q(q(q(q(q([],gt,!0),mt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt.slice(0,7),!0),Tt=u(-28,0),xt=u(-29,0),Ot=u(-30,0),Dt=u(-31,0),St=q(q(q(q(q(q(q(q(q(q(q(q(q([],Dt,!0),xt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt.slice(0,7),!0),Ut=q(q(q(q(q(q(q(q(q(q(q(q(q([],Dt,!0),Tt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt.slice(0,7),!0),Yt=[0,31,60,91,121,152,182,213,244,274,305,335,366],Lt=[0,31,59,90,120,151,181,212,243,273,304,334,365],Mt=function(){for(var t=[],e=0;e<55;e++)t=t.concat(u(7));return t}();function _t(t,e){var n,r,i=b(t,1,1),o=k(t)?366:365,a=k(t+1)?366:365,s=O(i),u=U(i),y=H(H({yearlen:o,nextyearlen:a,yearordinal:s,yearweekday:u},function(t){var e=k(t)?366:365,n=b(t,1,1),r=U(n);if(365===e)return{mmask:pt,mdaymask:Et,nmdaymask:Ut,wdaymask:Mt.slice(r),mrange:Lt};return{mmask:bt,mdaymask:kt,nmdaymask:St,wdaymask:Mt.slice(r),mrange:Yt}}(t)),{wnomask:null});if(l(e.byweekno))return y;y.wnomask=h(0,o+7);var d=n=c(7-u+e.wkst,7);d>=4?(d=0,r=y.yearlen+c(u-e.wkst,7)):r=o-d;for(var f=Math.floor(r/7),m=c(r,7),w=Math.floor(f+m/4),v=0;v<e.byweekno.length;v++){var g=e.byweekno[v];if(g<0&&(g+=w+1),g>0&&g<=w){var E=void 0;g>1?(E=d+7*(g-1),d!==n&&(E-=7-n)):E=d;for(var T=0;T<7&&(y.wnomask[E]=1,E++,y.wdaymask[E]!==e.wkst);T++);}}if(p(e.byweekno,1)){E=d+7*w;if(d!==n&&(E-=7-n),E<o)for(v=0;v<7&&(y.wnomask[E]=1,E+=1,y.wdaymask[E]!==e.wkst);v++);}if(d){var x=void 0;if(p(e.byweekno,-1))x=-1;else{var D=U(b(t-1,1,1)),S=c(7-D.valueOf()+e.wkst,7),Y=k(t-1)?366:365,L=void 0;S>=4?(S=0,L=Y+c(D-e.wkst,7)):L=o-d,x=Math.floor(52+c(L,7)/4)}if(p(e.byweekno,x))for(E=0;E<d;E++)y.wnomask[E]=1}return y}const Rt=function(){function t(t){this.options=t}return t.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=_t(t,n)),f(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,o=r.yearlen,a=r.mrange,s=r.wdaymask;this.monthinfo=function(t,e,n,r,i,o){var a={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(o.freq===Ft.YEARLY)if(l(o.bymonth))s=[[0,n]];else for(var u=0;u<o.bymonth.length;u++)e=o.bymonth[u],s.push(r.slice(e-1,e+1));else o.freq===Ft.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(l(s))return a;for(a.nwdaymask=h(0,n),u=0;u<s.length;u++)for(var y=s[u],d=y[0],f=y[1]-1,p=0;p<o.bynweekday.length;p++){var b=void 0,m=o.bynweekday[p],w=m[0],v=m[1];v<0?(b=f+7*(v+1),b-=c(i[b]-w,7)):(b=d+7*(v-1),b+=c(7-i[b]+w,7)),d<=b&&b<=f&&(a.nwdaymask[b]=1)}return a}(t,e,o,a,s,n)}i(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,o=Math.floor(r/4),a=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),h=Math.floor(19*n+r-o-u+15)%30,y=Math.floor(i/4),c=i%4,d=Math.floor(32+2*a+2*y-h-c)%7,l=Math.floor((n+11*h+22*d)/451),f=Math.floor((h+d-7*l+114)/31),p=(h+d-7*l+114)%31+1,b=Date.UTC(t,f-1,p+e),m=Date.UTC(t,0,1);return[Math.ceil((b-m)/864e5)]}(t,n.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),t.prototype.ydayset=function(){return[u(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e){for(var n=this.mrange[e-1],r=this.mrange[e],i=h(null,this.yearlen),o=n;o<r;o++)i[o]=o;return[i,n,r]},t.prototype.wdayset=function(t,e,n){for(var r=h(null,this.yearlen+7),i=O(b(t,e,n))-this.yearordinal,o=i,a=0;a<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);a++);return[r,o,i]},t.prototype.ddayset=function(t,e,n){var r=h(null,this.yearlen),i=O(b(t,e,n))-this.yearordinal;return r[i]=i,[r,i,i+1]},t.prototype.htimeset=function(t,e,n,r){var i=this,o=[];return this.options.byminute.forEach((function(e){o=o.concat(i.mtimeset(t,e,n,r))})),R(o),o},t.prototype.mtimeset=function(t,e,n,r){var i=this.options.bysecond.map((function(n){return new et(t,e,n,r)}));return R(i),i},t.prototype.stimeset=function(t,e,n,r){return[new et(t,e,n,r)]},t.prototype.getdayset=function(t){switch(t){case X.YEARLY:return this.ydayset.bind(this);case X.MONTHLY:return this.mdayset.bind(this);case X.WEEKLY:return this.wdayset.bind(this);case X.DAILY:default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(t){switch(t){case X.HOURLY:return this.htimeset.bind(this);case X.MINUTELY:return this.mtimeset.bind(this);case X.SECONDLY:return this.stimeset.bind(this)}},t}();function Nt(t,e,n,r,o,a){for(var s=[],u=0;u<t.length;u++){var h=void 0,y=void 0,d=t[u];d<0?(h=Math.floor(d/e.length),y=c(d,e.length)):(h=Math.floor((d-1)/e.length),y=c(d-1,e.length));for(var l=[],f=n;f<r;f++){var b=a[f];i(b)&&l.push(b)}var m=void 0;m=h<0?l.slice(h)[0]:l[h];var w=e[y],v=D(o.yearordinal+m),g=L(v,w);p(s,g)||s.push(g)}return R(s),s}function At(t,e){var n=e.dtstart,r=e.freq,o=e.interval,a=e.until,s=e.bysetpos,u=e.count;if(0===u||0===o)return jt(t);var h=nt.fromDate(n),y=new Rt(e);y.rebuild(h.year,h.month);for(var c=function(t,e,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;if($(r))return function(t){var e=t.dtstart.getTime()%1e3;if(!$(t.freq))return[];var n=[];return t.byhour.forEach((function(r){t.byminute.forEach((function(i){t.bysecond.forEach((function(t){n.push(new et(r,i,t,e))}))}))})),n}(n);if(r>=Ft.HOURLY&&f(i)&&!p(i,e.hour)||r>=Ft.MINUTELY&&f(o)&&!p(o,e.minute)||r>=Ft.SECONDLY&&f(a)&&!p(a,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(y,h,e);;){var d=y.getdayset(r)(h.year,h.month,h.day),l=d[0],b=d[1],m=d[2],w=Wt(l,b,m,y,e);if(f(s))for(var v=Nt(s,c,b,m,y,l),g=0;g<v.length;g++){var k=v[g];if(a&&k>a)return jt(t);if(k>=n){var E=It(k,e);if(!t.accept(E))return jt(t);if(u&&!--u)return jt(t)}}else for(g=b;g<m;g++){var T=l[g];if(i(T))for(var x=D(y.yearordinal+T),O=0;O<c.length;O++){var S=c[O];k=L(x,S);if(a&&k>a)return jt(t);if(k>=n){E=It(k,e);if(!t.accept(E))return jt(t);if(u&&!--u)return jt(t)}}}if(0===e.interval)return jt(t);if(h.add(e,w),h.year>9999)return jt(t);$(r)||(c=y.gettimeset(r)(h.hour,h.minute,h.second,0)),y.rebuild(h.year,h.month)}}function Ct(t,e,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,s=n.bymonthday,u=n.bynmonthday,h=n.byyearday;return f(r)&&!p(r,t.mmask[e])||f(i)&&!t.wnomask[e]||f(o)&&!p(o,t.wdaymask[e])||f(t.nwdaymask)&&!t.nwdaymask[e]||null!==a&&!p(t.eastermask,e)||(f(s)||f(u))&&!p(s,t.mdaymask[e])&&!p(u,t.nmdaymask[e])||f(h)&&(e<t.yearlen&&!p(h,e+1)&&!p(h,-t.yearlen+e)||e>=t.yearlen&&!p(h,e+1-t.yearlen)&&!p(h,-t.nextyearlen+e-t.yearlen))}function It(t,e){return new yt(t,e.tzid).rezonedDate()}function jt(t){return t.getValue()}function Wt(t,e,n,r,i){for(var o=!1,a=e;a<n;a++){var s=t[a];(o=Ct(r,s,i))&&(t[s]=null)}return o}var Ht={MO:new r(0),TU:new r(1),WE:new r(2),TH:new r(3),FR:new r(4),SA:new r(5),SU:new r(6)},qt={freq:X.YEARLY,dtstart:null,interval:1,wkst:Ht.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Pt=Object.keys(qt),Ft=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new ft,this.origOptions=rt(t);var n=it(t).parsedOptions;this.options=n}return t.parseText=function(t,e){return Q(t,e)},t.fromText=function(t,e){return J(t,e)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(t){return At(t,this.options)},t.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},t.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},t.prototype.all=function(t){if(t)return this._iter(new P("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new I("all",{})),this._cacheAdd("all",e)),e},t.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!T(t)||!T(e))throw new Error("Invalid date passed in to RRule.between");var i={before:e,after:t,inc:n};if(r)return this._iter(new P("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new I("between",i)),this._cacheAdd("between",o,i)),o},t.prototype.before=function(t,e){if(void 0===e&&(e=!1),!T(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new I("before",n)),this._cacheAdd("before",r,n)),r},t.prototype.after=function(t,e){if(void 0===e&&(e=!1),!T(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new I("after",n)),this._cacheAdd("after",r,n)),r},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return ct(this.origOptions)},t.prototype.toText=function(t,e,n){return function(t,e,n,r){return new Z(t,e,n,r).toString()}(this,t,e,n)},t.prototype.isFullyConvertibleToText=function(){return tt(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=X.YEARLY,t.MONTHLY=X.MONTHLY,t.WEEKLY=X.WEEKLY,t.DAILY=X.DAILY,t.HOURLY=X.HOURLY,t.MINUTELY=X.MINUTELY,t.SECONDLY=X.SECONDLY,t.MO=Ht.MO,t.TU=Ht.TU,t.WE=Ht.WE,t.TH=Ht.TH,t.FR=Ht.FR,t.SA=Ht.SA,t.SU=Ht.SU,t.parseString=ot,t.optionsToString=ct,t}();var zt={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function Kt(t,e){var n=[],r=[],i=[],o=[],a=at(t),s=a.dtstart,u=a.tzid,h=function(t,e){void 0===e&&(e=!1);if(!(t=t&&t.trim()))throw new Error("Invalid empty string");if(!e)return t.split(/\s/);var n=t.split("\n"),r=0;for(;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?r>0&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold);return h.forEach((function(t){var e;if(t){var a=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=(i=t,o=":",a=1,s=i.split(o),a?s.slice(0,a).concat([s.slice(a).join(o)]):s),n=e[0],r=e[1];var i,o,a,s;return{name:n,value:r}}(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}(t),s=a.name,h=a.parms,y=a.value;switch(s.toUpperCase()){case"RRULE":if(h.length)throw new Error("unsupported RRULE parm: ".concat(h.join(",")));n.push(ot(t));break;case"RDATE":var c=(null!==(e=/RDATE(?:;TZID=([^:=]+))?/i.exec(t))&&void 0!==e?e:[])[1];c&&!u&&(u=c),r=r.concat(Xt(y,h));break;case"EXRULE":if(h.length)throw new Error("unsupported EXRULE parm: ".concat(h.join(",")));i.push(ot(y));break;case"EXDATE":o=o.concat(Xt(y,h));break;case"DTSTART":break;default:throw new Error("unsupported property: "+s)}}})),{dtstart:s,tzid:u,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:o}}function Bt(t,e){return void 0===e&&(e={}),function(t,e){var n=Kt(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,u=n.tzid,h=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||r.length>1||i.length||o.length||a.length){var y=new Qt(h);return y.dtstart(s),y.tzid(u||void 0),r.forEach((function(t){y.rrule(new Ft(Zt(t,s,u),h))})),i.forEach((function(t){y.rdate(t)})),o.forEach((function(t){y.exrule(new Ft(Zt(t,s,u),h))})),a.forEach((function(t){y.exdate(t)})),e.compatible&&e.dtstart&&y.rdate(s),y}var c=r[0]||{};return new Ft(Zt(c,c.dtstart||e.dtstart||s,c.tzid||e.tzid||u),h)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(zt);if(n.forEach((function(t){p(r,t)||e.push(t)})),e.length)throw new Error("Invalid options: "+e.join(", "));return H(H({},zt),t)}(e))}function Zt(t,e,n){return H(H({},t),{dtstart:e,tzid:n})}function Xt(t,e){return function(t){t.forEach((function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}))}(e),t.split(",").map((function(t){return A(t)}))}function Gt(t){var e=this;return function(n){if(void 0!==n&&(e["_".concat(t)]=n),void 0!==e["_".concat(t)])return e["_".concat(t)];for(var r=0;r<e._rrule.length;r++){var i=e._rrule[r].origOptions[t];if(i)return i}}}var Qt=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this,{},e)||this;return n.dtstart=Gt.apply(n,["dtstart"]),n.tzid=Gt.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return W(e,t),e.prototype._iter=function(t){return function(t,e,n,r,i,o){var a={},s=t.accept;function u(t,e){n.forEach((function(n){n.between(t,e,!0).forEach((function(t){a[Number(t)]=!0}))}))}i.forEach((function(t){var e=new yt(t,o).rezonedDate();a[Number(e)]=!0})),t.accept=function(t){var e=Number(t);return isNaN(e)?s.call(this,t):!(!a[e]&&(u(new Date(e-1),new Date(e+1)),!a[e]))||(a[e]=!0,s.call(this,t))},"between"===t.method&&(u(t.args.after,t.args.before),t.accept=function(t){var e=Number(t);return!!a[e]||(a[e]=!0,s.call(this,t))});for(var h=0;h<r.length;h++){var y=new yt(r[h],o).rezonedDate();if(!t.accept(new Date(y.getTime())))break}e.forEach((function(e){At(t,e.options)}));var c=t._result;switch(R(c),t.method){case"all":case"between":return c;case"before":return c.length&&c[c.length-1]||null;default:return c.length&&c[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){$t(t,this._rrule)},e.prototype.exrule=function(t){$t(t,this._exrule)},e.prototype.rdate=function(t){Jt(t,this._rdate)},e.prototype.exdate=function(t){Jt(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map((function(t){return Bt(t.toString())}))},e.prototype.exrules=function(){return this._exrule.map((function(t){return Bt(t.toString())}))},e.prototype.rdates=function(){return this._rdate.map((function(t){return new Date(t.getTime())}))},e.prototype.exdates=function(){return this._exdate.map((function(t){return new Date(t.getTime())}))},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(ct({dtstart:this._dtstart}))),this._rrule.forEach((function(e){t=t.concat(e.toString().split("\n"))})),this._exrule.forEach((function(e){t=t.concat(e.toString().split("\n").map((function(t){return t.replace(/^RRULE:/,"EXRULE:")})).filter((function(t){return!/^DTSTART/.test(t)})))})),this._rdate.length&&t.push(Vt("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(Vt("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join("\n")},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach((function(e){return t.rrule(e.clone())})),this._exrule.forEach((function(e){return t.exrule(e.clone())})),this._rdate.forEach((function(e){return t.rdate(new Date(e.getTime()))})),this._exdate.forEach((function(e){return t.exdate(new Date(e.getTime()))})),t},e}(Ft);function $t(t,e){if(!(t instanceof Ft))throw new TypeError(String(t)+" is not RRule instance");p(e.map(String),String(t))||e.push(t)}function Jt(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");p(e.map(Number),Number(t))||(e.push(t),R(e))}function Vt(t,e,n){var r=!n||"UTC"===n.toUpperCase(),i=r?"".concat(t,":"):"".concat(t,";TZID=").concat(n,":"),o=e.map((function(t){return N(t.valueOf(),r)})).join(",");return"".concat(i).concat(o)}return e})()));
//# sourceMappingURL=rrule.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rrule=e():t.rrule=e()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Frequency:()=>U,RRule:()=>Dt,RRuleSet:()=>Mt,Weekday:()=>r,rrulestr:()=>Yt});var n=["MO","TU","WE","TH","FR","SA","SU"],r=function(){function t(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}return t.fromStr=function(e){return new t(n.indexOf(e))},t.prototype.nth=function(e){return this.n===e?this:new t(this.weekday,e)},t.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},t.prototype.toString=function(){var t=n[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},t.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},t}(),i=function(t){return null!=t},o=function(t){return"number"==typeof t},a=function(t){return"string"==typeof t&&n.includes(t)},s=Array.isArray,u=function(t,e){void 0===e&&(e=t),1===arguments.length&&(e=t,t=0);for(var n=[],r=t;r<e;r++)n.push(r);return n},h=function(t,e){var n=0,r=[];if(s(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r};function y(t,e,n){void 0===n&&(n=" ");var r=String(t);return e>>=0,r.length>e?String(r):((e-=r.length)>n.length&&(n+=h(n,e/n.length)),n.slice(0,e)+String(r))}var c,d=function(t,e){var n=t%e;return n*e<0?n+e:n},l=function(t,e){return{div:Math.floor(t/e),mod:d(t,e)}},f=function(t){return!i(t)||0===t.length},p=function(t){return!f(t)},m=function(t,e){return p(t)&&-1!==t.indexOf(e)};!function(t){t.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],t.ONE_DAY=864e5,t.MAXYEAR=9999,t.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),t.PY_WEEKDAYS=[6,0,1,2,3,4,5],t.getYearDay=function(e){var n=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.ceil((n.valueOf()-new Date(e.getUTCFullYear(),0,1).valueOf())/t.ONE_DAY)+1},t.isLeapYear=function(t){return t%4==0&&t%100!=0||t%400==0},t.isDate=function(t){return t instanceof Date},t.isValidDate=function(e){return t.isDate(e)&&!isNaN(e.getTime())},t.tzOffset=function(t){return 60*t.getTimezoneOffset()*1e3},t.daysBetween=function(e,n){var r=e.getTime()-t.tzOffset(e)-(n.getTime()-t.tzOffset(n));return Math.round(r/t.ONE_DAY)},t.toOrdinal=function(e){return t.daysBetween(e,t.ORDINAL_BASE)},t.fromOrdinal=function(e){return new Date(t.ORDINAL_BASE.getTime()+e*t.ONE_DAY)},t.getMonthDays=function(e){var n=e.getUTCMonth();return 1===n&&t.isLeapYear(e.getUTCFullYear())?29:t.MONTH_DAYS[n]},t.getWeekday=function(e){return t.PY_WEEKDAYS[e.getUTCDay()]},t.monthRange=function(e,n){var r=new Date(Date.UTC(e,n,1));return[t.getWeekday(r),t.getMonthDays(r)]},t.combine=function(t,e){return e=e||t,new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},t.clone=function(t){return new Date(t.getTime())},t.cloneDates=function(e){for(var n=[],r=0;r<e.length;r++)n.push(t.clone(e[r]));return n},t.sort=function(t){t.sort((function(t,e){return t.getTime()-e.getTime()}))},t.timeToUntilString=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[y(n.getUTCFullYear().toString(),4,"0"),y(n.getUTCMonth()+1,2,"0"),y(n.getUTCDate(),2,"0"),"T",y(n.getUTCHours(),2,"0"),y(n.getUTCMinutes(),2,"0"),y(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},t.untilStringToDate=function(t){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(t);if(!e)throw new Error("Invalid UNTIL value: ".concat(t));return new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0))}}(c||(c={}));const b=c;const w=function(){function t(t,e){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=t,this.args=e,"between"===t?(this.maxDate=e.inc?e.before:new Date(e.before.getTime()-1),this.minDate=e.inc?e.after:new Date(e.after.getTime()+1)):"before"===t?this.maxDate=e.inc?e.dt:new Date(e.dt.getTime()-1):"after"===t&&(this.minDate=e.inc?e.dt:new Date(e.dt.getTime()+1))}return t.prototype.accept=function(t){++this.total;var e=this.minDate&&t<this.minDate,n=this.maxDate&&t>this.maxDate;if("between"===this.method){if(e)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!e||(this.add(t),!1);return this.add(t)},t.prototype.add=function(t){return this._result.push(t),!0},t.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;default:return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}();var v=function(t,e){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},v(t,e)};function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var k=function(){return k=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},k.apply(this,arguments)};Object.create;function E(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;const T=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.iterator=r,i}return g(e,t),e.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},e}(w);const D={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}};var O=function(t,e){return-1!==t.indexOf(e)},x=function(t){return t.toString()},Y=function(t,e,n){return"".concat(e," ").concat(n,", ").concat(t)};const S=function(){function t(t,e,n,r){if(void 0===e&&(e=x),void 0===n&&(n=D),void 0===r&&(r=Y),this.text=[],this.language=n||D,this.gettext=e,this.dateFormatter=r,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort((function(t,e){return t-e})),a.sort((function(t,e){return e-t})),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(i(this.origOptions.byweekday)){var u=s(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],h=String(u);this.byweekday={allWeeks:u.filter((function(t){return!t.n})),someWeeks:u.filter((function(t){return Boolean(t.n)})),isWeekdays:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1===h.indexOf("SA")&&-1===h.indexOf("SU"),isEveryDay:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1!==h.indexOf("SA")&&-1!==h.indexOf("SU")};var y=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(y),this.byweekday.someWeeks.sort(y),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return t.isFullyConvertible=function(e){if(!(e.options.freq in t.IMPLEMENTED))return!1;if(e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(O(["dtstart","wkst","freq"],n))return!0;if(!O(t.IMPLEMENTED[e.options.freq],n))return!1}return!0},t.prototype.isFullyConvertible=function(){return t.isFullyConvertible(this.rrule)},t.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in t.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[Dt.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},t.prototype.HOURLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},t.prototype.MINUTELY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},t.prototype.DAILY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},t.prototype.WEEKLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(1===this.options.interval&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},t.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},t.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},t.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},t.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},t.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},t.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},t.prototype.nth=function(t){var e;t=parseInt(t.toString(),10);var n=this.gettext;if(-1===t)return n("last");var r=Math.abs(t);switch(r){case 1:case 21:case 31:e=r+n("st");break;case 2:case 22:e=r+n("nd");break;case 3:case 23:e=r+n("rd");break;default:e=r+n("th")}return t<0?e+" "+n("last"):e},t.prototype.monthtext=function(t){return this.language.monthNames[t-1]},t.prototype.weekdaytext=function(t){var e=o(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[e]},t.prototype.plural=function(t){return t%100!=1},t.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},t.prototype.list=function(t,e,n,r){var i=this;void 0===r&&(r=","),s(t)||(t=[t]);e=e||function(t){return t.toString()};var o=function(t){return e&&e.call(i,t)};return n?function(t,e,n){for(var r="",i=0;i<t.length;i++)0!==i&&(i===t.length-1?r+=" "+n+" ":r+=e+" "),r+=t[i];return r}(t.map(o),r,n):t.map(o).join(r+" ")},t}();var U,L=function(){function t(t){this.done=!0,this.rules=t}return t.prototype.start=function(t){return this.text=t,this.done=!1,this.nextSymbol()},t.prototype.isDone=function(){return this.done&&null===this.symbol},t.prototype.nextSymbol=function(){var t,e;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in t=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===t||r[0].length>t[0].length)&&(t=r,e=n)}if(null!=t&&(this.text=this.text.substr(t[0].length),""===this.text&&(this.done=!0)),null==t)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===e);return this.symbol=e,this.value=t,!0},t.prototype.accept=function(t){if(this.symbol===t){if(this.value){var e=this.value;return this.nextSymbol(),e}return this.nextSymbol(),!0}return!1},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},t}();function M(t,e){void 0===e&&(e=D);var n={},r=new L(e.tokens);return r.start(t)?(function(){r.expect("every");var t=r.acceptNumber();t&&(n.interval=parseInt(t[0],10));if(r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=Dt.DAILY,r.nextSymbol()&&(!function(){if(!r.accept("at"))return;do{var t=r.acceptNumber();if(!t)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(t[0],10)];r.accept("comma");){if(!(t=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(t[0],10))}}while(r.accept("comma")||r.accept("at"))}(),u());break;case"weekday(s)":n.freq=Dt.WEEKLY,n.byweekday=[Dt.MO,Dt.TU,Dt.WE,Dt.TH,Dt.FR],r.nextSymbol(),u();break;case"week(s)":n.freq=Dt.WEEKLY,r.nextSymbol()&&(i(),u());break;case"hour(s)":n.freq=Dt.HOURLY,r.nextSymbol()&&(i(),u());break;case"minute(s)":n.freq=Dt.MINUTELY,r.nextSymbol()&&(i(),u());break;case"month(s)":n.freq=Dt.MONTHLY,r.nextSymbol()&&(i(),u());break;case"year(s)":n.freq=Dt.YEARLY,r.nextSymbol()&&(i(),u());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Dt.WEEKLY;var e=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Dt[e]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var h=a();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(Dt[h]),r.nextSymbol()}!function(){r.accept("on"),r.accept("the");var t=s();if(!t)return;n.bymonthday=[t],r.nextSymbol();for(;r.accept("comma");){if(!(t=s()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(t),r.nextSymbol()}}(),u();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=Dt.YEARLY,n.bymonth=[o()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=o();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(y),r.nextSymbol()}i(),u();break;default:throw new Error("Unknown symbol")}}(),n):null;function i(){var t=r.accept("on"),e=r.accept("the");if(t||e)do{var i=s(),u=a(),h=o();if(i)u?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Dt[u].nth(i))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(i),r.accept("day(s)"));else if(u)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Dt[u]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[Dt.MO,Dt.TU,Dt.WE,Dt.TH,Dt.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var y=r.acceptNumber();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(y[0],10)];r.accept("comma");){if(!(y=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(y[0],10))}}else{if(!h)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(h)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function o(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function a(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function s(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var t=parseInt(r.value[1],10);if(t<-366||t>366)throw new Error("Nth out of range: "+t);return r.nextSymbol(),r.accept("last")?-t:t;default:return!1}}function u(){if("until"===r.symbol){var t=Date.parse(r.text);if(!t)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(t)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}function _(t){return t<U.HOURLY}!function(t){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"}(U||(U={}));var R=function(t,e){return void 0===e&&(e=D),new Dt(M(t,e)||void 0)},A=["count","until","interval","byweekday","bymonthday","bymonth"];S.IMPLEMENTED=[],S.IMPLEMENTED[U.HOURLY]=A,S.IMPLEMENTED[U.MINUTELY]=A,S.IMPLEMENTED[U.DAILY]=["byhour"].concat(A),S.IMPLEMENTED[U.WEEKLY]=A,S.IMPLEMENTED[U.MONTHLY]=A,S.IMPLEMENTED[U.YEARLY]=["byweekno","byyearday"].concat(A);var N=S.isFullyConvertible,C=function(){function t(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}return t.prototype.getHours=function(){return this.hour},t.prototype.getMinutes=function(){return this.minute},t.prototype.getSeconds=function(){return this.second},t.prototype.getMilliseconds=function(){return this.millisecond},t.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},t}(),I=function(t){function e(e,n,r,i,o,a,s){var u=t.call(this,i,o,a,s)||this;return u.year=e,u.month=n,u.day=r,u}return g(e,t),e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return c.getWeekday(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var e=Math.floor(this.month/12),n=d(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,e){e>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-e))+7*t:this.day+=-(this.getWeekday()-e)+7*t,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=l(this.hour,24),i=r.div,o=r.mod;if(i&&(this.hour=o,this.addDaily(i)),f(n)||m(n,this.hour))break}},e.prototype.addMinutes=function(t,e,n,r){for(e&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var i=l(this.minute,60),o=i.div,a=i.mod;if(o&&(this.minute=a,this.addHours(o,!1,n)),(f(n)||m(n,this.hour))&&(f(r)||m(r,this.minute)))break}},e.prototype.addSeconds=function(t,e,n,r,i){for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var o=l(this.second,60),a=o.div,s=o.mod;if(a&&(this.second=s,this.addMinutes(a,!1,n,r)),(f(n)||m(n,this.hour))&&(f(r)||m(r,this.minute))&&(f(i)||m(i,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=c.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,13===this.month&&(this.month=1,++this.year,this.year>c.MAXYEAR))return;t=c.monthRange(this.year,this.month-1)[1]}}},e.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,o=t.byhour,a=t.byminute,s=t.bysecond;switch(n){case U.YEARLY:return this.addYears(r);case U.MONTHLY:return this.addMonths(r);case U.WEEKLY:return this.addWeekly(r,i);case U.DAILY:return this.addDaily(r);case U.HOURLY:return this.addHours(r,e,o);case U.MINUTELY:return this.addMinutes(r,e,o,a);case U.SECONDLY:return this.addSeconds(r,e,o,a,s)}},e}(C);function W(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];m(Tt,i)||e.push(i),b.isDate(t[i])&&!b.isValidDate(t[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return k({},t)}function j(t){var e=k(k({},Et),W(t));if(i(e.byeaster)&&(e.freq=Dt.YEARLY),!i(e.freq)||!Dt.FREQUENCIES[e.freq])throw new Error("Invalid frequency: ".concat(e.freq," ").concat(t.freq));if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),i(e.wkst)?o(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=Dt.MO.weekday,i(e.bysetpos)){o(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){if(0===(y=e.bysetpos[n])||!(y>=-366&&y<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||p(e.byweekno)||p(e.byyearday)||Boolean(e.bymonthday)||p(e.bymonthday)||i(e.byweekday)||i(e.byeaster)))switch(e.freq){case Dt.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Dt.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Dt.WEEKLY:e.byweekday=[b.getWeekday(e.dtstart)]}if(i(e.bymonth)&&!s(e.bymonth)&&(e.bymonth=[e.bymonth]),i(e.byyearday)&&!s(e.byyearday)&&o(e.byyearday)&&(e.byyearday=[e.byyearday]),i(e.bymonthday))if(s(e.bymonthday)){var u=[],h=[];for(n=0;n<e.bymonthday.length;n++){var y;(y=e.bymonthday[n])>0?u.push(y):y<0&&h.push(y)}e.bymonthday=u,e.bynmonthday=h}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(i(e.byweekno)&&!s(e.byweekno)&&(e.byweekno=[e.byweekno]),i(e.byweekday))if(o(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(a(e.byweekday))e.byweekday=[r.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof r)!e.byweekday.n||e.freq>Dt.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var c=[],d=[];for(n=0;n<e.byweekday.length;n++){var l=e.byweekday[n];o(l)?c.push(l):a(l)?c.push(r.fromStr(l).weekday):!l.n||e.freq>Dt.MONTHLY?c.push(l.weekday):d.push([l.weekday,l.n])}e.byweekday=p(c)?c:null,e.bynweekday=p(d)?d:null}else e.bynweekday=null;return i(e.byhour)?o(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<Dt.HOURLY?[e.dtstart.getUTCHours()]:null,i(e.byminute)?o(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<Dt.MINUTELY?[e.dtstart.getUTCMinutes()]:null,i(e.bysecond)?o(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<Dt.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function H(t){var e=t.split("\n").map(P).filter((function(t){return null!==t}));return k(k({},e[0]),e[1])}function q(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=b.untilStringToDate(i),e}function P(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return z(t);var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return z(t);case"DTSTART":return q(t);default:throw new Error("Unsupported RFC prop ".concat(n," in ").concat(t))}}function z(t){var e=q(t.replace(/^RRULE:/i,""));return t.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach((function(n){var i=n.split("="),o=i[0],a=i[1];switch(o.toUpperCase()){case"FREQ":e.freq=U[a.toUpperCase()];break;case"WKST":e.wkst=kt[a.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var s=function(t){if(-1!==t.indexOf(",")){return t.split(",").map(F)}return F(t)}(a),u=o.toLowerCase();e[u]=s;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=function(t){return t.split(",").map((function(t){if(2===t.length)return kt[t];var e=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!e||e.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var n=Number(e[1]),i=e[2],o=kt[i].weekday;return new r(o,n)}))}(a);break;case"DTSTART":case"TZID":var h=q(t);e.tzid=h.tzid,e.dtstart=h.dtstart;break;case"UNTIL":e.until=b.untilStringToDate(a);break;case"BYEASTER":e.byeaster=Number(a);break;default:throw new Error("Unknown RRULE property '"+o+"'")}})),e}function F(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var K=function(){function t(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=b.timeToUntilString(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){var t;if(this.isUTC)return this.date;var e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(this.date.toLocaleString(void 0,{timeZone:e})),r=new Date(this.date.toLocaleString(void 0,{timeZone:null!==(t=this.tzid)&&void 0!==t?t:"UTC"})).getTime()-n.getTime();return new Date(this.date.getTime()-r)},t}();function B(t){for(var e,n=[],a="",u=Object.keys(t),h=Object.keys(Et),y=0;y<u.length;y++)if("tzid"!==u[y]&&m(h,u[y])){var c=u[y].toUpperCase(),d=t[u[y]],l="";if(i(d)&&(!s(d)||d.length)){switch(c){case"FREQ":l=Dt.FREQUENCIES[t.freq];break;case"WKST":l=o(d)?new r(d).toString():d.toString();break;case"BYWEEKDAY":c="BYDAY",l=(e=d,s(e)?e:[e]).map((function(t){return t instanceof r?t:s(t)?new r(t[0],t[1]):new r(t)})).toString();break;case"DTSTART":a=Z(d,t.tzid);break;case"UNTIL":l=b.timeToUntilString(d,!t.tzid);break;default:if(s(d)){for(var f=[],p=0;p<d.length;p++)f[p]=String(d[p]);l=f.toString()}else l=String(d)}l&&n.push([c,l])}}var w=n.map((function(t){var e=t[0],n=t[1];return"".concat(e,"=").concat(n.toString())})).join(";"),v="";return""!==w&&(v="RRULE:".concat(w)),[a,v].filter((function(t){return!!t})).join("\n")}function Z(t,e){return t?"DTSTART"+new K(new Date(t),e).toString():""}function V(t,e){return Array.isArray(t)?!!Array.isArray(e)&&(t.length===e.length&&t.every((function(t,n){return t.getTime()===e[n].getTime()}))):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():t===e}var X=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?b.clone(e):b.cloneDates(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},t.prototype._cacheGet=function(t,e){var n=!1,r=e?Object.keys(e):[],i=function(t){for(var n=0;n<r.length;n++){var i=r[n];if(!V(e[i],t[i]))return!0}return!1},o=this[t];if("all"===t)n=this.all;else if(s(o))for(var a=0;a<o.length;a++){var u=o[a];if(!r.length||!i(u)){n=u._value;break}}if(!n&&this.all){var h=new w(t,e);for(a=0;a<this.all.length&&h.accept(this.all[a]);a++);n=h.getValue(),this._cacheAdd(t,n,e)}return s(n)?b.cloneDates(n):n instanceof Date?b.clone(n):n},t}(),G=E(E(E(E(E(E(E(E(E(E(E(E(E([],h(1,31),!0),h(2,28),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),Q=E(E(E(E(E(E(E(E(E(E(E(E(E([],h(1,31),!0),h(2,29),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),$=u(1,29),J=u(1,30),tt=u(1,31),et=u(1,32),nt=E(E(E(E(E(E(E(E(E(E(E(E(E([],et,!0),J,!0),et,!0),tt,!0),et,!0),tt,!0),et,!0),et,!0),tt,!0),et,!0),tt,!0),et,!0),et.slice(0,7),!0),rt=E(E(E(E(E(E(E(E(E(E(E(E(E([],et,!0),$,!0),et,!0),tt,!0),et,!0),tt,!0),et,!0),et,!0),tt,!0),et,!0),tt,!0),et,!0),et.slice(0,7),!0),it=u(-28,0),ot=u(-29,0),at=u(-30,0),st=u(-31,0),ut=E(E(E(E(E(E(E(E(E(E(E(E(E([],st,!0),ot,!0),st,!0),at,!0),st,!0),at,!0),st,!0),st,!0),at,!0),st,!0),at,!0),st,!0),st.slice(0,7),!0),ht=E(E(E(E(E(E(E(E(E(E(E(E(E([],st,!0),it,!0),st,!0),at,!0),st,!0),at,!0),st,!0),st,!0),at,!0),st,!0),at,!0),st,!0),st.slice(0,7),!0),yt=[0,31,60,91,121,152,182,213,244,274,305,335,366],ct=[0,31,59,90,120,151,181,212,243,273,304,334,365],dt=function(){for(var t=[],e=0;e<55;e++)t=t.concat(u(7));return t}();function lt(t,e){var n,r,i=new Date(Date.UTC(t,0,1)),o=b.isLeapYear(t)?366:365,a=b.isLeapYear(t+1)?366:365,s=b.toOrdinal(i),u=b.getWeekday(i),y=k(k({yearlen:o,nextyearlen:a,yearordinal:s,yearweekday:u},function(t){var e=b.isLeapYear(t)?366:365,n=new Date(Date.UTC(t,0,1)),r=b.getWeekday(n);if(365===e)return{mmask:G,mdaymask:rt,nmdaymask:ht,wdaymask:dt.slice(r),mrange:ct};return{mmask:Q,mdaymask:nt,nmdaymask:ut,wdaymask:dt.slice(r),mrange:yt}}(t)),{wnomask:null});if(f(e.byweekno))return y;y.wnomask=h(0,o+7);var c=n=d(7-u+e.wkst,7);c>=4?(c=0,r=y.yearlen+d(u-e.wkst,7)):r=o-c;for(var l=Math.floor(r/7),p=d(r,7),w=Math.floor(l+p/4),v=0;v<e.byweekno.length;v++){var g=e.byweekno[v];if(g<0&&(g+=w+1),g>0&&g<=w){var E=void 0;g>1?(E=c+7*(g-1),c!==n&&(E-=7-n)):E=c;for(var T=0;T<7&&(y.wnomask[E]=1,E++,y.wdaymask[E]!==e.wkst);T++);}}if(m(e.byweekno,1)){E=c+7*w;if(c!==n&&(E-=7-n),E<o)for(v=0;v<7&&(y.wnomask[E]=1,E+=1,y.wdaymask[E]!==e.wkst);v++);}if(c){var D=void 0;if(m(e.byweekno,-1))D=-1;else{var O=b.getWeekday(new Date(Date.UTC(t-1,0,1))),x=d(7-O.valueOf()+e.wkst,7),Y=b.isLeapYear(t-1)?366:365,S=void 0;x>=4?(x=0,S=Y+d(O-e.wkst,7)):S=o-c,D=Math.floor(52+d(S,7)/4)}if(m(e.byweekno,D))for(E=0;E<c;E++)y.wnomask[E]=1}return y}const ft=function(){function t(t){this.options=t}return t.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=lt(t,n)),p(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,o=r.yearlen,a=r.mrange,s=r.wdaymask;this.monthinfo=function(t,e,n,r,i,o){var a={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(o.freq===Dt.YEARLY)if(f(o.bymonth))s=[[0,n]];else for(var u=0;u<o.bymonth.length;u++)e=o.bymonth[u],s.push(r.slice(e-1,e+1));else o.freq===Dt.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(f(s))return a;for(a.nwdaymask=h(0,n),u=0;u<s.length;u++)for(var y=s[u],c=y[0],l=y[1]-1,p=0;p<o.bynweekday.length;p++){var m=void 0,b=o.bynweekday[p],w=b[0],v=b[1];v<0?(m=l+7*(v+1),m-=d(i[m]-w,7)):(m=c+7*(v-1),m+=d(7-i[m]+w,7)),c<=m&&m<=l&&(a.nwdaymask[m]=1)}return a}(t,e,o,a,s,n)}i(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,o=Math.floor(r/4),a=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),h=Math.floor(19*n+r-o-u+15)%30,y=Math.floor(i/4),c=i%4,d=Math.floor(32+2*a+2*y-h-c)%7,l=Math.floor((n+11*h+22*d)/451),f=Math.floor((h+d-7*l+114)/31),p=(h+d-7*l+114)%31+1,m=Date.UTC(t,f-1,p+e),b=Date.UTC(t,0,1);return[Math.ceil((m-b)/864e5)]}(t,n.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),t.prototype.ydayset=function(){return[u(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e){for(var n=this.mrange[e-1],r=this.mrange[e],i=h(null,this.yearlen),o=n;o<r;o++)i[o]=o;return[i,n,r]},t.prototype.wdayset=function(t,e,n){for(var r=h(null,this.yearlen+7),i=b.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal,o=i,a=0;a<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);a++);return[r,o,i]},t.prototype.ddayset=function(t,e,n){var r=h(null,this.yearlen),i=b.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal;return r[i]=i,[r,i,i+1]},t.prototype.htimeset=function(t,e,n,r){var i=this,o=[];return this.options.byminute.forEach((function(e){o=o.concat(i.mtimeset(t,e,n,r))})),b.sort(o),o},t.prototype.mtimeset=function(t,e,n,r){var i=this.options.bysecond.map((function(n){return new C(t,e,n,r)}));return b.sort(i),i},t.prototype.stimeset=function(t,e,n,r){return[new C(t,e,n,r)]},t.prototype.getdayset=function(t){switch(t){case U.YEARLY:return this.ydayset.bind(this);case U.MONTHLY:return this.mdayset.bind(this);case U.WEEKLY:return this.wdayset.bind(this);case U.DAILY:default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(t){switch(t){case U.HOURLY:return this.htimeset.bind(this);case U.MINUTELY:return this.mtimeset.bind(this);case U.SECONDLY:return this.stimeset.bind(this)}},t}();function pt(t,e,n,r,o,a){for(var s=[],u=0;u<t.length;u++){var h=void 0,y=void 0,c=t[u];c<0?(h=Math.floor(c/e.length),y=d(c,e.length)):(h=Math.floor((c-1)/e.length),y=d(c-1,e.length));for(var l=[],f=n;f<r;f++){var p=a[f];i(p)&&l.push(p)}var w=void 0;w=h<0?l.slice(h)[0]:l[h];var v=e[y],g=b.fromOrdinal(o.yearordinal+w),k=b.combine(g,v);m(s,k)||s.push(k)}return b.sort(s),s}function mt(t,e){var n=e.dtstart,r=e.freq,o=e.interval,a=e.until,s=e.bysetpos,u=e.count;if(0===u||0===o)return vt(t);var h=I.fromDate(n),y=new ft(e);y.rebuild(h.year,h.month);for(var c=function(t,e,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;if(_(r))return function(t){var e=t.dtstart.getTime()%1e3;if(!_(t.freq))return[];var n=[];return t.byhour.forEach((function(r){t.byminute.forEach((function(i){t.bysecond.forEach((function(t){n.push(new C(r,i,t,e))}))}))})),n}(n);if(r>=Dt.HOURLY&&p(i)&&!m(i,e.hour)||r>=Dt.MINUTELY&&p(o)&&!m(o,e.minute)||r>=Dt.SECONDLY&&p(a)&&!m(a,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(y,h,e);;){var d=y.getdayset(r)(h.year,h.month,h.day),l=d[0],f=d[1],w=d[2],v=gt(l,f,w,y,e);if(p(s))for(var g=pt(s,c,f,w,y,l),k=0;k<g.length;k++){var E=g[k];if(a&&E>a)return vt(t);if(E>=n){var T=wt(E,e);if(!t.accept(T))return vt(t);if(u&&!--u)return vt(t)}}else for(k=f;k<w;k++){var D=l[k];if(i(D))for(var O=b.fromOrdinal(y.yearordinal+D),x=0;x<c.length;x++){var Y=c[x];E=b.combine(O,Y);if(a&&E>a)return vt(t);if(E>=n){T=wt(E,e);if(!t.accept(T))return vt(t);if(u&&!--u)return vt(t)}}}if(0===e.interval)return vt(t);if(h.add(e,v),h.year>b.MAXYEAR)return vt(t);_(r)||(c=y.gettimeset(r)(h.hour,h.minute,h.second,0)),y.rebuild(h.year,h.month)}}function bt(t,e,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,s=n.bymonthday,u=n.bynmonthday,h=n.byyearday;return p(r)&&!m(r,t.mmask[e])||p(i)&&!t.wnomask[e]||p(o)&&!m(o,t.wdaymask[e])||p(t.nwdaymask)&&!t.nwdaymask[e]||null!==a&&!m(t.eastermask,e)||(p(s)||p(u))&&!m(s,t.mdaymask[e])&&!m(u,t.nmdaymask[e])||p(h)&&(e<t.yearlen&&!m(h,e+1)&&!m(h,-t.yearlen+e)||e>=t.yearlen&&!m(h,e+1-t.yearlen)&&!m(h,-t.nextyearlen+e-t.yearlen))}function wt(t,e){return new K(t,e.tzid).rezonedDate()}function vt(t){return t.getValue()}function gt(t,e,n,r,i){for(var o=!1,a=e;a<n;a++){var s=t[a];(o=bt(r,s,i))&&(t[s]=null)}return o}var kt={MO:new r(0),TU:new r(1),WE:new r(2),TH:new r(3),FR:new r(4),SA:new r(5),SU:new r(6)},Et={freq:U.YEARLY,dtstart:null,interval:1,wkst:kt.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Tt=Object.keys(Et),Dt=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new X,this.origOptions=W(t);var n=j(t).parsedOptions;this.options=n}return t.parseText=function(t,e){return M(t,e)},t.fromText=function(t,e){return R(t,e)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(t){return mt(t,this.options)},t.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},t.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},t.prototype.all=function(t){if(t)return this._iter(new T("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new w("all",{})),this._cacheAdd("all",e)),e},t.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!b.isValidDate(t)||!b.isValidDate(e))throw new Error("Invalid date passed in to RRule.between");var i={before:e,after:t,inc:n};if(r)return this._iter(new T("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new w("between",i)),this._cacheAdd("between",o,i)),o},t.prototype.before=function(t,e){if(void 0===e&&(e=!1),!b.isValidDate(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new w("before",n)),this._cacheAdd("before",r,n)),r},t.prototype.after=function(t,e){if(void 0===e&&(e=!1),!b.isValidDate(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new w("after",n)),this._cacheAdd("after",r,n)),r},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return B(this.origOptions)},t.prototype.toText=function(t,e,n){return function(t,e,n,r){return new S(t,e,n,r).toString()}(this,t,e,n)},t.prototype.isFullyConvertibleToText=function(){return N(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=U.YEARLY,t.MONTHLY=U.MONTHLY,t.WEEKLY=U.WEEKLY,t.DAILY=U.DAILY,t.HOURLY=U.HOURLY,t.MINUTELY=U.MINUTELY,t.SECONDLY=U.SECONDLY,t.MO=kt.MO,t.TU=kt.TU,t.WE=kt.WE,t.TH=kt.TH,t.FR=kt.FR,t.SA=kt.SA,t.SU=kt.SU,t.parseString=H,t.optionsToString=B,t}();var Ot={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function xt(t,e){var n=[],r=[],i=[],o=[],a=q(t),s=a.dtstart,u=a.tzid,h=function(t,e){void 0===e&&(e=!1);if(!(t=t&&t.trim()))throw new Error("Invalid empty string");if(!e)return t.split(/\s/);var n=t.split("\n"),r=0;for(;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?r>0&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold);return h.forEach((function(t){var e;if(t){var a=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=(i=t,o=":",a=1,s=i.split(o),a?s.slice(0,a).concat([s.slice(a).join(o)]):s),n=e[0],r=e[1];var i,o,a,s;return{name:n,value:r}}(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}(t),s=a.name,h=a.parms,y=a.value;switch(s.toUpperCase()){case"RRULE":if(h.length)throw new Error("unsupported RRULE parm: ".concat(h.join(",")));n.push(H(t));break;case"RDATE":var c=(null!==(e=/RDATE(?:;TZID=([^:=]+))?/i.exec(t))&&void 0!==e?e:[])[1];c&&!u&&(u=c),r=r.concat(Ut(y,h));break;case"EXRULE":if(h.length)throw new Error("unsupported EXRULE parm: ".concat(h.join(",")));i.push(H(y));break;case"EXDATE":o=o.concat(Ut(y,h));break;case"DTSTART":break;default:throw new Error("unsupported property: "+s)}}})),{dtstart:s,tzid:u,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:o}}function Yt(t,e){return void 0===e&&(e={}),function(t,e){var n=xt(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,u=n.tzid,h=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||r.length>1||i.length||o.length||a.length){var y=new Mt(h);return y.dtstart(s),y.tzid(u||void 0),r.forEach((function(t){y.rrule(new Dt(St(t,s,u),h))})),i.forEach((function(t){y.rdate(t)})),o.forEach((function(t){y.exrule(new Dt(St(t,s,u),h))})),a.forEach((function(t){y.exdate(t)})),e.compatible&&e.dtstart&&y.rdate(s),y}var c=r[0]||{};return new Dt(St(c,c.dtstart||e.dtstart||s,c.tzid||e.tzid||u),h)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(Ot);if(n.forEach((function(t){m(r,t)||e.push(t)})),e.length)throw new Error("Invalid options: "+e.join(", "));return k(k({},Ot),t)}(e))}function St(t,e,n){return k(k({},t),{dtstart:e,tzid:n})}function Ut(t,e){return function(t){t.forEach((function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}))}(e),t.split(",").map((function(t){return b.untilStringToDate(t)}))}function Lt(t){var e=this;return function(n){if(void 0!==n&&(e["_".concat(t)]=n),void 0!==e["_".concat(t)])return e["_".concat(t)];for(var r=0;r<e._rrule.length;r++){var i=e._rrule[r].origOptions[t];if(i)return i}}}var Mt=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this,{},e)||this;return n.dtstart=Lt.apply(n,["dtstart"]),n.tzid=Lt.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return g(e,t),e.prototype._iter=function(t){return function(t,e,n,r,i,o){var a={},s=t.accept;function u(t,e){n.forEach((function(n){n.between(t,e,!0).forEach((function(t){a[Number(t)]=!0}))}))}i.forEach((function(t){var e=new K(t,o).rezonedDate();a[Number(e)]=!0})),t.accept=function(t){var e=Number(t);return isNaN(e)?s.call(this,t):!(!a[e]&&(u(new Date(e-1),new Date(e+1)),!a[e]))||(a[e]=!0,s.call(this,t))},"between"===t.method&&(u(t.args.after,t.args.before),t.accept=function(t){var e=Number(t);return!!a[e]||(a[e]=!0,s.call(this,t))});for(var h=0;h<r.length;h++){var y=new K(r[h],o).rezonedDate();if(!t.accept(new Date(y.getTime())))break}e.forEach((function(e){mt(t,e.options)}));var c=t._result;switch(b.sort(c),t.method){case"all":case"between":return c;case"before":return c.length&&c[c.length-1]||null;default:return c.length&&c[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){_t(t,this._rrule)},e.prototype.exrule=function(t){_t(t,this._exrule)},e.prototype.rdate=function(t){Rt(t,this._rdate)},e.prototype.exdate=function(t){Rt(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map((function(t){return Yt(t.toString())}))},e.prototype.exrules=function(){return this._exrule.map((function(t){return Yt(t.toString())}))},e.prototype.rdates=function(){return this._rdate.map((function(t){return new Date(t.getTime())}))},e.prototype.exdates=function(){return this._exdate.map((function(t){return new Date(t.getTime())}))},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(B({dtstart:this._dtstart}))),this._rrule.forEach((function(e){t=t.concat(e.toString().split("\n"))})),this._exrule.forEach((function(e){t=t.concat(e.toString().split("\n").map((function(t){return t.replace(/^RRULE:/,"EXRULE:")})).filter((function(t){return!/^DTSTART/.test(t)})))})),this._rdate.length&&t.push(At("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(At("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join("\n")},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach((function(e){return t.rrule(e.clone())})),this._exrule.forEach((function(e){return t.exrule(e.clone())})),this._rdate.forEach((function(e){return t.rdate(new Date(e.getTime()))})),this._exdate.forEach((function(e){return t.exdate(new Date(e.getTime()))})),t},e}(Dt);function _t(t,e){if(!(t instanceof Dt))throw new TypeError(String(t)+" is not RRule instance");m(e.map(String),String(t))||e.push(t)}function Rt(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");m(e.map(Number),Number(t))||(e.push(t),b.sort(e))}function At(t,e,n){var r=!n||"UTC"===n.toUpperCase(),i=r?"".concat(t,":"):"".concat(t,";TZID=").concat(n,":"),o=e.map((function(t){return b.timeToUntilString(t.valueOf(),r)})).join(",");return"".concat(i).concat(o)}return e})()));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rrule=e():t.rrule=e()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Frequency:()=>X,RRule:()=>Ft,RRuleSet:()=>Qt,Weekday:()=>r,datetime:()=>b,rrulestr:()=>Bt});var n=["MO","TU","WE","TH","FR","SA","SU"],r=function(){function t(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}return t.fromStr=function(e){return new t(n.indexOf(e))},t.prototype.nth=function(e){return this.n===e?this:new t(this.weekday,e)},t.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},t.prototype.toString=function(){var t=n[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},t.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},t}(),i=function(t){return null!=t},o=function(t){return"number"==typeof t},a=function(t){return"string"==typeof t&&n.includes(t)},s=Array.isArray,u=function(t,e){void 0===e&&(e=t),1===arguments.length&&(e=t,t=0);for(var n=[],r=t;r<e;r++)n.push(r);return n},h=function(t,e){var n=0,r=[];if(s(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r};function y(t,e,n){void 0===n&&(n=" ");var r=String(t);return e>>=0,r.length>e?String(r):((e-=r.length)>n.length&&(n+=h(n,e/n.length)),n.slice(0,e)+String(r))}var c=function(t,e){var n=t%e;return n*e<0?n+e:n},d=function(t,e){return{div:Math.floor(t/e),mod:c(t,e)}},l=function(t){return!i(t)||0===t.length},f=function(t){return!l(t)},p=function(t,e){return f(t)&&-1!==t.indexOf(e)},b=function(t,e,n,r,i,o){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),new Date(Date.UTC(t,e-1,n,r,i,o))},m=[31,28,31,30,31,30,31,31,30,31,30,31],w=864e5,v=b(1970,1,1),g=[6,0,1,2,3,4,5],k=function(t){return t%4==0&&t%100!=0||t%400==0},E=function(t){return t instanceof Date},T=function(t){return E(t)&&!isNaN(t.getTime())},x=function(t){return 60*t.getTimezoneOffset()*1e3},O=function(t){return n=v,r=(e=t).getTime()-x(e)-(n.getTime()-x(n)),Math.round(r/w);var e,n,r},D=function(t){return new Date(v.getTime()+t*w)},S=function(t){var e=t.getUTCMonth();return 1===e&&k(t.getUTCFullYear())?29:m[e]},U=function(t){return g[t.getUTCDay()]},Y=function(t,e){var n=b(t,e+1,1);return[U(n),S(n)]},L=function(t,e){return e=e||t,new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},M=function(t){return new Date(t.getTime())},_=function(t){for(var e=[],n=0;n<t.length;n++)e.push(M(t[n]));return e},R=function(t){t.sort((function(t,e){return t.getTime()-e.getTime()}))},N=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[y(n.getUTCFullYear().toString(),4,"0"),y(n.getUTCMonth()+1,2,"0"),y(n.getUTCDate(),2,"0"),"T",y(n.getUTCHours(),2,"0"),y(n.getUTCMinutes(),2,"0"),y(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},A=function(t){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(t);if(!e)throw new Error("Invalid UNTIL value: ".concat(t));return new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0))},C=function(t,e){return t.toLocaleString("sv-SE",{timeZone:e}).replace(" ","T")+"Z"};const I=function(){function t(t,e){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=t,this.args=e,"between"===t?(this.maxDate=e.inc?e.before:new Date(e.before.getTime()-1),this.minDate=e.inc?e.after:new Date(e.after.getTime()+1)):"before"===t?this.maxDate=e.inc?e.dt:new Date(e.dt.getTime()-1):"after"===t&&(this.minDate=e.inc?e.dt:new Date(e.dt.getTime()+1))}return t.prototype.accept=function(t){++this.total;var e=this.minDate&&t<this.minDate,n=this.maxDate&&t>this.maxDate;if("between"===this.method){if(e)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!e||(this.add(t),!1);return this.add(t)},t.prototype.add=function(t){return this._result.push(t),!0},t.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;default:return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}();var j=function(t,e){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},j(t,e)};function W(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var H=function(){return H=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},H.apply(this,arguments)};Object.create;function q(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;const P=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.iterator=r,i}return W(e,t),e.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},e}(I);const F={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}};var z=function(t,e){return-1!==t.indexOf(e)},K=function(t){return t.toString()},B=function(t,e,n){return"".concat(e," ").concat(n,", ").concat(t)};const Z=function(){function t(t,e,n,r){if(void 0===e&&(e=K),void 0===n&&(n=F),void 0===r&&(r=B),this.text=[],this.language=n||F,this.gettext=e,this.dateFormatter=r,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort((function(t,e){return t-e})),a.sort((function(t,e){return e-t})),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(i(this.origOptions.byweekday)){var u=s(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],h=String(u);this.byweekday={allWeeks:u.filter((function(t){return!t.n})),someWeeks:u.filter((function(t){return Boolean(t.n)})),isWeekdays:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1===h.indexOf("SA")&&-1===h.indexOf("SU"),isEveryDay:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1!==h.indexOf("SA")&&-1!==h.indexOf("SU")};var y=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(y),this.byweekday.someWeeks.sort(y),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return t.isFullyConvertible=function(e){if(!(e.options.freq in t.IMPLEMENTED))return!1;if(e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(z(["dtstart","wkst","freq"],n))return!0;if(!z(t.IMPLEMENTED[e.options.freq],n))return!1}return!0},t.prototype.isFullyConvertible=function(){return t.isFullyConvertible(this.rrule)},t.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in t.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[Ft.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},t.prototype.HOURLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},t.prototype.MINUTELY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},t.prototype.DAILY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},t.prototype.WEEKLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(1===this.options.interval&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},t.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},t.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},t.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},t.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},t.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},t.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},t.prototype.nth=function(t){var e;t=parseInt(t.toString(),10);var n=this.gettext;if(-1===t)return n("last");var r=Math.abs(t);switch(r){case 1:case 21:case 31:e=r+n("st");break;case 2:case 22:e=r+n("nd");break;case 3:case 23:e=r+n("rd");break;default:e=r+n("th")}return t<0?e+" "+n("last"):e},t.prototype.monthtext=function(t){return this.language.monthNames[t-1]},t.prototype.weekdaytext=function(t){var e=o(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[e]},t.prototype.plural=function(t){return t%100!=1},t.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},t.prototype.list=function(t,e,n,r){var i=this;void 0===r&&(r=","),s(t)||(t=[t]);e=e||function(t){return t.toString()};var o=function(t){return e&&e.call(i,t)};return n?function(t,e,n){for(var r="",i=0;i<t.length;i++)0!==i&&(i===t.length-1?r+=" "+n+" ":r+=e+" "),r+=t[i];return r}(t.map(o),r,n):t.map(o).join(r+" ")},t}();var X,G=function(){function t(t){this.done=!0,this.rules=t}return t.prototype.start=function(t){return this.text=t,this.done=!1,this.nextSymbol()},t.prototype.isDone=function(){return this.done&&null===this.symbol},t.prototype.nextSymbol=function(){var t,e;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in t=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===t||r[0].length>t[0].length)&&(t=r,e=n)}if(null!=t&&(this.text=this.text.substr(t[0].length),""===this.text&&(this.done=!0)),null==t)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===e);return this.symbol=e,this.value=t,!0},t.prototype.accept=function(t){if(this.symbol===t){if(this.value){var e=this.value;return this.nextSymbol(),e}return this.nextSymbol(),!0}return!1},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},t}();function Q(t,e){void 0===e&&(e=F);var n={},r=new G(e.tokens);return r.start(t)?(function(){r.expect("every");var t=r.acceptNumber();t&&(n.interval=parseInt(t[0],10));if(r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=Ft.DAILY,r.nextSymbol()&&(!function(){if(!r.accept("at"))return;do{var t=r.acceptNumber();if(!t)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(t[0],10)];r.accept("comma");){if(!(t=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(t[0],10))}}while(r.accept("comma")||r.accept("at"))}(),u());break;case"weekday(s)":n.freq=Ft.WEEKLY,n.byweekday=[Ft.MO,Ft.TU,Ft.WE,Ft.TH,Ft.FR],r.nextSymbol(),u();break;case"week(s)":n.freq=Ft.WEEKLY,r.nextSymbol()&&(i(),u());break;case"hour(s)":n.freq=Ft.HOURLY,r.nextSymbol()&&(i(),u());break;case"minute(s)":n.freq=Ft.MINUTELY,r.nextSymbol()&&(i(),u());break;case"month(s)":n.freq=Ft.MONTHLY,r.nextSymbol()&&(i(),u());break;case"year(s)":n.freq=Ft.YEARLY,r.nextSymbol()&&(i(),u());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Ft.WEEKLY;var e=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Ft[e]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var h=a();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(Ft[h]),r.nextSymbol()}!function(){r.accept("on"),r.accept("the");var t=s();if(!t)return;n.bymonthday=[t],r.nextSymbol();for(;r.accept("comma");){if(!(t=s()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(t),r.nextSymbol()}}(),u();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=Ft.YEARLY,n.bymonth=[o()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=o();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(y),r.nextSymbol()}i(),u();break;default:throw new Error("Unknown symbol")}}(),n):null;function i(){var t=r.accept("on"),e=r.accept("the");if(t||e)do{var i=s(),u=a(),h=o();if(i)u?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Ft[u].nth(i))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(i),r.accept("day(s)"));else if(u)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Ft[u]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[Ft.MO,Ft.TU,Ft.WE,Ft.TH,Ft.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var y=r.acceptNumber();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(y[0],10)];r.accept("comma");){if(!(y=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(y[0],10))}}else{if(!h)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(h)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function o(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function a(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function s(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var t=parseInt(r.value[1],10);if(t<-366||t>366)throw new Error("Nth out of range: "+t);return r.nextSymbol(),r.accept("last")?-t:t;default:return!1}}function u(){if("until"===r.symbol){var t=Date.parse(r.text);if(!t)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(t)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}function $(t){return t<X.HOURLY}!function(t){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"}(X||(X={}));var J=function(t,e){return void 0===e&&(e=F),new Ft(Q(t,e)||void 0)},V=["count","until","interval","byweekday","bymonthday","bymonth"];Z.IMPLEMENTED=[],Z.IMPLEMENTED[X.HOURLY]=V,Z.IMPLEMENTED[X.MINUTELY]=V,Z.IMPLEMENTED[X.DAILY]=["byhour"].concat(V),Z.IMPLEMENTED[X.WEEKLY]=V,Z.IMPLEMENTED[X.MONTHLY]=V,Z.IMPLEMENTED[X.YEARLY]=["byweekno","byyearday"].concat(V);var tt=Z.isFullyConvertible,et=function(){function t(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}return t.prototype.getHours=function(){return this.hour},t.prototype.getMinutes=function(){return this.minute},t.prototype.getSeconds=function(){return this.second},t.prototype.getMilliseconds=function(){return this.millisecond},t.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},t}(),nt=function(t){function e(e,n,r,i,o,a,s){var u=t.call(this,i,o,a,s)||this;return u.year=e,u.month=n,u.day=r,u}return W(e,t),e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return U(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var e=Math.floor(this.month/12),n=c(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,e){e>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-e))+7*t:this.day+=-(this.getWeekday()-e)+7*t,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=d(this.hour,24),i=r.div,o=r.mod;if(i&&(this.hour=o,this.addDaily(i)),l(n)||p(n,this.hour))break}},e.prototype.addMinutes=function(t,e,n,r){for(e&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var i=d(this.minute,60),o=i.div,a=i.mod;if(o&&(this.minute=a,this.addHours(o,!1,n)),(l(n)||p(n,this.hour))&&(l(r)||p(r,this.minute)))break}},e.prototype.addSeconds=function(t,e,n,r,i){for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var o=d(this.second,60),a=o.div,s=o.mod;if(a&&(this.second=s,this.addMinutes(a,!1,n,r)),(l(n)||p(n,this.hour))&&(l(r)||p(r,this.minute))&&(l(i)||p(i,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=Y(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,13===this.month&&(this.month=1,++this.year,this.year>9999))return;t=Y(this.year,this.month-1)[1]}}},e.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,o=t.byhour,a=t.byminute,s=t.bysecond;switch(n){case X.YEARLY:return this.addYears(r);case X.MONTHLY:return this.addMonths(r);case X.WEEKLY:return this.addWeekly(r,i);case X.DAILY:return this.addDaily(r);case X.HOURLY:return this.addHours(r,e,o);case X.MINUTELY:return this.addMinutes(r,e,o,a);case X.SECONDLY:return this.addSeconds(r,e,o,a,s)}},e}(et);function rt(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];p(Pt,i)||e.push(i),E(t[i])&&!T(t[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return H({},t)}function it(t){var e=H(H({},qt),rt(t));if(i(e.byeaster)&&(e.freq=Ft.YEARLY),!i(e.freq)||!Ft.FREQUENCIES[e.freq])throw new Error("Invalid frequency: ".concat(e.freq," ").concat(t.freq));if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),i(e.wkst)?o(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=Ft.MO.weekday,i(e.bysetpos)){o(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){if(0===(y=e.bysetpos[n])||!(y>=-366&&y<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||f(e.byweekno)||f(e.byyearday)||Boolean(e.bymonthday)||f(e.bymonthday)||i(e.byweekday)||i(e.byeaster)))switch(e.freq){case Ft.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Ft.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Ft.WEEKLY:e.byweekday=[U(e.dtstart)]}if(i(e.bymonth)&&!s(e.bymonth)&&(e.bymonth=[e.bymonth]),i(e.byyearday)&&!s(e.byyearday)&&o(e.byyearday)&&(e.byyearday=[e.byyearday]),i(e.bymonthday))if(s(e.bymonthday)){var u=[],h=[];for(n=0;n<e.bymonthday.length;n++){var y;(y=e.bymonthday[n])>0?u.push(y):y<0&&h.push(y)}e.bymonthday=u,e.bynmonthday=h}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(i(e.byweekno)&&!s(e.byweekno)&&(e.byweekno=[e.byweekno]),i(e.byweekday))if(o(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(a(e.byweekday))e.byweekday=[r.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof r)!e.byweekday.n||e.freq>Ft.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var c=[],d=[];for(n=0;n<e.byweekday.length;n++){var l=e.byweekday[n];o(l)?c.push(l):a(l)?c.push(r.fromStr(l).weekday):!l.n||e.freq>Ft.MONTHLY?c.push(l.weekday):d.push([l.weekday,l.n])}e.byweekday=f(c)?c:null,e.bynweekday=f(d)?d:null}else e.bynweekday=null;return i(e.byhour)?o(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<Ft.HOURLY?[e.dtstart.getUTCHours()]:null,i(e.byminute)?o(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<Ft.MINUTELY?[e.dtstart.getUTCMinutes()]:null,i(e.bysecond)?o(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<Ft.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function ot(t){var e=t.split("\n").map(st).filter((function(t){return null!==t}));return H(H({},e[0]),e[1])}function at(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=A(i),e}function st(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return ut(t);var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return ut(t);case"DTSTART":return at(t);default:throw new Error("Unsupported RFC prop ".concat(n," in ").concat(t))}}function ut(t){var e=at(t.replace(/^RRULE:/i,""));return t.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach((function(n){var i=n.split("="),o=i[0],a=i[1];switch(o.toUpperCase()){case"FREQ":e.freq=X[a.toUpperCase()];break;case"WKST":e.wkst=Ht[a.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var s=function(t){if(-1!==t.indexOf(",")){return t.split(",").map(ht)}return ht(t)}(a),u=o.toLowerCase();e[u]=s;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=function(t){return t.split(",").map((function(t){if(2===t.length)return Ht[t];var e=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!e||e.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var n=Number(e[1]),i=e[2],o=Ht[i].weekday;return new r(o,n)}))}(a);break;case"DTSTART":case"TZID":var h=at(t);e.tzid=h.tzid,e.dtstart=h.dtstart;break;case"UNTIL":e.until=A(a);break;case"BYEASTER":e.byeaster=Number(a);break;default:throw new Error("Unknown RRULE property '"+o+"'")}})),e}function ht(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var yt=function(){function t(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=N(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){return this.isUTC?this.date:function(t,e){var n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=new Date(C(t,n)),i=new Date(C(t,null!=e?e:"UTC")).getTime()-r.getTime();return new Date(t.getTime()-i)}(this.date,this.tzid)},t}();function ct(t){for(var e,n=[],a="",u=Object.keys(t),h=Object.keys(qt),y=0;y<u.length;y++)if("tzid"!==u[y]&&p(h,u[y])){var c=u[y].toUpperCase(),d=t[u[y]],l="";if(i(d)&&(!s(d)||d.length)){switch(c){case"FREQ":l=Ft.FREQUENCIES[t.freq];break;case"WKST":l=o(d)?new r(d).toString():d.toString();break;case"BYWEEKDAY":c="BYDAY",l=(e=d,s(e)?e:[e]).map((function(t){return t instanceof r?t:s(t)?new r(t[0],t[1]):new r(t)})).toString();break;case"DTSTART":a=dt(d,t.tzid);break;case"UNTIL":l=N(d,!t.tzid);break;default:if(s(d)){for(var f=[],b=0;b<d.length;b++)f[b]=String(d[b]);l=f.toString()}else l=String(d)}l&&n.push([c,l])}}var m=n.map((function(t){var e=t[0],n=t[1];return"".concat(e,"=").concat(n.toString())})).join(";"),w="";return""!==m&&(w="RRULE:".concat(m)),[a,w].filter((function(t){return!!t})).join("\n")}function dt(t,e){return t?"DTSTART"+new yt(new Date(t),e).toString():""}function lt(t,e){return Array.isArray(t)?!!Array.isArray(e)&&(t.length===e.length&&t.every((function(t,n){return t.getTime()===e[n].getTime()}))):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():t===e}var ft=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?M(e):_(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},t.prototype._cacheGet=function(t,e){var n=!1,r=e?Object.keys(e):[],i=function(t){for(var n=0;n<r.length;n++){var i=r[n];if(!lt(e[i],t[i]))return!0}return!1},o=this[t];if("all"===t)n=this.all;else if(s(o))for(var a=0;a<o.length;a++){var u=o[a];if(!r.length||!i(u)){n=u._value;break}}if(!n&&this.all){var h=new I(t,e);for(a=0;a<this.all.length&&h.accept(this.all[a]);a++);n=h.getValue(),this._cacheAdd(t,n,e)}return s(n)?_(n):n instanceof Date?M(n):n},t}(),pt=q(q(q(q(q(q(q(q(q(q(q(q(q([],h(1,31),!0),h(2,28),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),bt=q(q(q(q(q(q(q(q(q(q(q(q(q([],h(1,31),!0),h(2,29),!0),h(3,31),!0),h(4,30),!0),h(5,31),!0),h(6,30),!0),h(7,31),!0),h(8,31),!0),h(9,30),!0),h(10,31),!0),h(11,30),!0),h(12,31),!0),h(1,7),!0),mt=u(1,29),wt=u(1,30),vt=u(1,31),gt=u(1,32),kt=q(q(q(q(q(q(q(q(q(q(q(q(q([],gt,!0),wt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt.slice(0,7),!0),Et=q(q(q(q(q(q(q(q(q(q(q(q(q([],gt,!0),mt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt,!0),vt,!0),gt,!0),vt,!0),gt,!0),gt.slice(0,7),!0),Tt=u(-28,0),xt=u(-29,0),Ot=u(-30,0),Dt=u(-31,0),St=q(q(q(q(q(q(q(q(q(q(q(q(q([],Dt,!0),xt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt.slice(0,7),!0),Ut=q(q(q(q(q(q(q(q(q(q(q(q(q([],Dt,!0),Tt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt,!0),Ot,!0),Dt,!0),Ot,!0),Dt,!0),Dt.slice(0,7),!0),Yt=[0,31,60,91,121,152,182,213,244,274,305,335,366],Lt=[0,31,59,90,120,151,181,212,243,273,304,334,365],Mt=function(){for(var t=[],e=0;e<55;e++)t=t.concat(u(7));return t}();function _t(t,e){var n,r,i=b(t,1,1),o=k(t)?366:365,a=k(t+1)?366:365,s=O(i),u=U(i),y=H(H({yearlen:o,nextyearlen:a,yearordinal:s,yearweekday:u},function(t){var e=k(t)?366:365,n=b(t,1,1),r=U(n);if(365===e)return{mmask:pt,mdaymask:Et,nmdaymask:Ut,wdaymask:Mt.slice(r),mrange:Lt};return{mmask:bt,mdaymask:kt,nmdaymask:St,wdaymask:Mt.slice(r),mrange:Yt}}(t)),{wnomask:null});if(l(e.byweekno))return y;y.wnomask=h(0,o+7);var d=n=c(7-u+e.wkst,7);d>=4?(d=0,r=y.yearlen+c(u-e.wkst,7)):r=o-d;for(var f=Math.floor(r/7),m=c(r,7),w=Math.floor(f+m/4),v=0;v<e.byweekno.length;v++){var g=e.byweekno[v];if(g<0&&(g+=w+1),g>0&&g<=w){var E=void 0;g>1?(E=d+7*(g-1),d!==n&&(E-=7-n)):E=d;for(var T=0;T<7&&(y.wnomask[E]=1,E++,y.wdaymask[E]!==e.wkst);T++);}}if(p(e.byweekno,1)){E=d+7*w;if(d!==n&&(E-=7-n),E<o)for(v=0;v<7&&(y.wnomask[E]=1,E+=1,y.wdaymask[E]!==e.wkst);v++);}if(d){var x=void 0;if(p(e.byweekno,-1))x=-1;else{var D=U(b(t-1,1,1)),S=c(7-D.valueOf()+e.wkst,7),Y=k(t-1)?366:365,L=void 0;S>=4?(S=0,L=Y+c(D-e.wkst,7)):L=o-d,x=Math.floor(52+c(L,7)/4)}if(p(e.byweekno,x))for(E=0;E<d;E++)y.wnomask[E]=1}return y}const Rt=function(){function t(t){this.options=t}return t.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=_t(t,n)),f(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,o=r.yearlen,a=r.mrange,s=r.wdaymask;this.monthinfo=function(t,e,n,r,i,o){var a={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(o.freq===Ft.YEARLY)if(l(o.bymonth))s=[[0,n]];else for(var u=0;u<o.bymonth.length;u++)e=o.bymonth[u],s.push(r.slice(e-1,e+1));else o.freq===Ft.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(l(s))return a;for(a.nwdaymask=h(0,n),u=0;u<s.length;u++)for(var y=s[u],d=y[0],f=y[1]-1,p=0;p<o.bynweekday.length;p++){var b=void 0,m=o.bynweekday[p],w=m[0],v=m[1];v<0?(b=f+7*(v+1),b-=c(i[b]-w,7)):(b=d+7*(v-1),b+=c(7-i[b]+w,7)),d<=b&&b<=f&&(a.nwdaymask[b]=1)}return a}(t,e,o,a,s,n)}i(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,o=Math.floor(r/4),a=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),h=Math.floor(19*n+r-o-u+15)%30,y=Math.floor(i/4),c=i%4,d=Math.floor(32+2*a+2*y-h-c)%7,l=Math.floor((n+11*h+22*d)/451),f=Math.floor((h+d-7*l+114)/31),p=(h+d-7*l+114)%31+1,b=Date.UTC(t,f-1,p+e),m=Date.UTC(t,0,1);return[Math.ceil((b-m)/864e5)]}(t,n.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),t.prototype.ydayset=function(){return[u(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e){for(var n=this.mrange[e-1],r=this.mrange[e],i=h(null,this.yearlen),o=n;o<r;o++)i[o]=o;return[i,n,r]},t.prototype.wdayset=function(t,e,n){for(var r=h(null,this.yearlen+7),i=O(b(t,e,n))-this.yearordinal,o=i,a=0;a<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);a++);return[r,o,i]},t.prototype.ddayset=function(t,e,n){var r=h(null,this.yearlen),i=O(b(t,e,n))-this.yearordinal;return r[i]=i,[r,i,i+1]},t.prototype.htimeset=function(t,e,n,r){var i=this,o=[];return this.options.byminute.forEach((function(e){o=o.concat(i.mtimeset(t,e,n,r))})),R(o),o},t.prototype.mtimeset=function(t,e,n,r){var i=this.options.bysecond.map((function(n){return new et(t,e,n,r)}));return R(i),i},t.prototype.stimeset=function(t,e,n,r){return[new et(t,e,n,r)]},t.prototype.getdayset=function(t){switch(t){case X.YEARLY:return this.ydayset.bind(this);case X.MONTHLY:return this.mdayset.bind(this);case X.WEEKLY:return this.wdayset.bind(this);case X.DAILY:default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(t){switch(t){case X.HOURLY:return this.htimeset.bind(this);case X.MINUTELY:return this.mtimeset.bind(this);case X.SECONDLY:return this.stimeset.bind(this)}},t}();function Nt(t,e,n,r,o,a){for(var s=[],u=0;u<t.length;u++){var h=void 0,y=void 0,d=t[u];d<0?(h=Math.floor(d/e.length),y=c(d,e.length)):(h=Math.floor((d-1)/e.length),y=c(d-1,e.length));for(var l=[],f=n;f<r;f++){var b=a[f];i(b)&&l.push(b)}var m=void 0;m=h<0?l.slice(h)[0]:l[h];var w=e[y],v=D(o.yearordinal+m),g=L(v,w);p(s,g)||s.push(g)}return R(s),s}function At(t,e){var n=e.dtstart,r=e.freq,o=e.interval,a=e.until,s=e.bysetpos,u=e.count;if(0===u||0===o)return jt(t);var h=nt.fromDate(n),y=new Rt(e);y.rebuild(h.year,h.month);for(var c=function(t,e,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;if($(r))return function(t){var e=t.dtstart.getTime()%1e3;if(!$(t.freq))return[];var n=[];return t.byhour.forEach((function(r){t.byminute.forEach((function(i){t.bysecond.forEach((function(t){n.push(new et(r,i,t,e))}))}))})),n}(n);if(r>=Ft.HOURLY&&f(i)&&!p(i,e.hour)||r>=Ft.MINUTELY&&f(o)&&!p(o,e.minute)||r>=Ft.SECONDLY&&f(a)&&!p(a,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(y,h,e);;){var d=y.getdayset(r)(h.year,h.month,h.day),l=d[0],b=d[1],m=d[2],w=Wt(l,b,m,y,e);if(f(s))for(var v=Nt(s,c,b,m,y,l),g=0;g<v.length;g++){var k=v[g];if(a&&k>a)return jt(t);if(k>=n){var E=It(k,e);if(!t.accept(E))return jt(t);if(u&&!--u)return jt(t)}}else for(g=b;g<m;g++){var T=l[g];if(i(T))for(var x=D(y.yearordinal+T),O=0;O<c.length;O++){var S=c[O];k=L(x,S);if(a&&k>a)return jt(t);if(k>=n){E=It(k,e);if(!t.accept(E))return jt(t);if(u&&!--u)return jt(t)}}}if(0===e.interval)return jt(t);if(h.add(e,w),h.year>9999)return jt(t);$(r)||(c=y.gettimeset(r)(h.hour,h.minute,h.second,0)),y.rebuild(h.year,h.month)}}function Ct(t,e,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,s=n.bymonthday,u=n.bynmonthday,h=n.byyearday;return f(r)&&!p(r,t.mmask[e])||f(i)&&!t.wnomask[e]||f(o)&&!p(o,t.wdaymask[e])||f(t.nwdaymask)&&!t.nwdaymask[e]||null!==a&&!p(t.eastermask,e)||(f(s)||f(u))&&!p(s,t.mdaymask[e])&&!p(u,t.nmdaymask[e])||f(h)&&(e<t.yearlen&&!p(h,e+1)&&!p(h,-t.yearlen+e)||e>=t.yearlen&&!p(h,e+1-t.yearlen)&&!p(h,-t.nextyearlen+e-t.yearlen))}function It(t,e){return new yt(t,e.tzid).rezonedDate()}function jt(t){return t.getValue()}function Wt(t,e,n,r,i){for(var o=!1,a=e;a<n;a++){var s=t[a];(o=Ct(r,s,i))&&(t[s]=null)}return o}var Ht={MO:new r(0),TU:new r(1),WE:new r(2),TH:new r(3),FR:new r(4),SA:new r(5),SU:new r(6)},qt={freq:X.YEARLY,dtstart:null,interval:1,wkst:Ht.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Pt=Object.keys(qt),Ft=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new ft,this.origOptions=rt(t);var n=it(t).parsedOptions;this.options=n}return t.parseText=function(t,e){return Q(t,e)},t.fromText=function(t,e){return J(t,e)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(t){return At(t,this.options)},t.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},t.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},t.prototype.all=function(t){if(t)return this._iter(new P("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new I("all",{})),this._cacheAdd("all",e)),e},t.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!T(t)||!T(e))throw new Error("Invalid date passed in to RRule.between");var i={before:e,after:t,inc:n};if(r)return this._iter(new P("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new I("between",i)),this._cacheAdd("between",o,i)),o},t.prototype.before=function(t,e){if(void 0===e&&(e=!1),!T(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new I("before",n)),this._cacheAdd("before",r,n)),r},t.prototype.after=function(t,e){if(void 0===e&&(e=!1),!T(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new I("after",n)),this._cacheAdd("after",r,n)),r},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return ct(this.origOptions)},t.prototype.toText=function(t,e,n){return function(t,e,n,r){return new Z(t,e,n,r).toString()}(this,t,e,n)},t.prototype.isFullyConvertibleToText=function(){return tt(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=X.YEARLY,t.MONTHLY=X.MONTHLY,t.WEEKLY=X.WEEKLY,t.DAILY=X.DAILY,t.HOURLY=X.HOURLY,t.MINUTELY=X.MINUTELY,t.SECONDLY=X.SECONDLY,t.MO=Ht.MO,t.TU=Ht.TU,t.WE=Ht.WE,t.TH=Ht.TH,t.FR=Ht.FR,t.SA=Ht.SA,t.SU=Ht.SU,t.parseString=ot,t.optionsToString=ct,t}();var zt={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function Kt(t,e){var n=[],r=[],i=[],o=[],a=at(t),s=a.dtstart,u=a.tzid,h=function(t,e){void 0===e&&(e=!1);if(!(t=t&&t.trim()))throw new Error("Invalid empty string");if(!e)return t.split(/\s/);var n=t.split("\n"),r=0;for(;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?r>0&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold);return h.forEach((function(t){var e;if(t){var a=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=(i=t,o=":",a=1,s=i.split(o),a?s.slice(0,a).concat([s.slice(a).join(o)]):s),n=e[0],r=e[1];var i,o,a,s;return{name:n,value:r}}(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}(t),s=a.name,h=a.parms,y=a.value;switch(s.toUpperCase()){case"RRULE":if(h.length)throw new Error("unsupported RRULE parm: ".concat(h.join(",")));n.push(ot(t));break;case"RDATE":var c=(null!==(e=/RDATE(?:;TZID=([^:=]+))?/i.exec(t))&&void 0!==e?e:[])[1];c&&!u&&(u=c),r=r.concat(Xt(y,h));break;case"EXRULE":if(h.length)throw new Error("unsupported EXRULE parm: ".concat(h.join(",")));i.push(ot(y));break;case"EXDATE":o=o.concat(Xt(y,h));break;case"DTSTART":break;default:throw new Error("unsupported property: "+s)}}})),{dtstart:s,tzid:u,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:o}}function Bt(t,e){return void 0===e&&(e={}),function(t,e){var n=Kt(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,u=n.tzid,h=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||r.length>1||i.length||o.length||a.length){var y=new Qt(h);return y.dtstart(s),y.tzid(u||void 0),r.forEach((function(t){y.rrule(new Ft(Zt(t,s,u),h))})),i.forEach((function(t){y.rdate(t)})),o.forEach((function(t){y.exrule(new Ft(Zt(t,s,u),h))})),a.forEach((function(t){y.exdate(t)})),e.compatible&&e.dtstart&&y.rdate(s),y}var c=r[0]||{};return new Ft(Zt(c,c.dtstart||e.dtstart||s,c.tzid||e.tzid||u),h)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(zt);if(n.forEach((function(t){p(r,t)||e.push(t)})),e.length)throw new Error("Invalid options: "+e.join(", "));return H(H({},zt),t)}(e))}function Zt(t,e,n){return H(H({},t),{dtstart:e,tzid:n})}function Xt(t,e){return function(t){t.forEach((function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}))}(e),t.split(",").map((function(t){return A(t)}))}function Gt(t){var e=this;return function(n){if(void 0!==n&&(e["_".concat(t)]=n),void 0!==e["_".concat(t)])return e["_".concat(t)];for(var r=0;r<e._rrule.length;r++){var i=e._rrule[r].origOptions[t];if(i)return i}}}var Qt=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this,{},e)||this;return n.dtstart=Gt.apply(n,["dtstart"]),n.tzid=Gt.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return W(e,t),e.prototype._iter=function(t){return function(t,e,n,r,i,o){var a={},s=t.accept;function u(t,e){n.forEach((function(n){n.between(t,e,!0).forEach((function(t){a[Number(t)]=!0}))}))}i.forEach((function(t){var e=new yt(t,o).rezonedDate();a[Number(e)]=!0})),t.accept=function(t){var e=Number(t);return isNaN(e)?s.call(this,t):!(!a[e]&&(u(new Date(e-1),new Date(e+1)),!a[e]))||(a[e]=!0,s.call(this,t))},"between"===t.method&&(u(t.args.after,t.args.before),t.accept=function(t){var e=Number(t);return!!a[e]||(a[e]=!0,s.call(this,t))});for(var h=0;h<r.length;h++){var y=new yt(r[h],o).rezonedDate();if(!t.accept(new Date(y.getTime())))break}e.forEach((function(e){At(t,e.options)}));var c=t._result;switch(R(c),t.method){case"all":case"between":return c;case"before":return c.length&&c[c.length-1]||null;default:return c.length&&c[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){$t(t,this._rrule)},e.prototype.exrule=function(t){$t(t,this._exrule)},e.prototype.rdate=function(t){Jt(t,this._rdate)},e.prototype.exdate=function(t){Jt(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map((function(t){return Bt(t.toString())}))},e.prototype.exrules=function(){return this._exrule.map((function(t){return Bt(t.toString())}))},e.prototype.rdates=function(){return this._rdate.map((function(t){return new Date(t.getTime())}))},e.prototype.exdates=function(){return this._exdate.map((function(t){return new Date(t.getTime())}))},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(ct({dtstart:this._dtstart}))),this._rrule.forEach((function(e){t=t.concat(e.toString().split("\n"))})),this._exrule.forEach((function(e){t=t.concat(e.toString().split("\n").map((function(t){return t.replace(/^RRULE:/,"EXRULE:")})).filter((function(t){return!/^DTSTART/.test(t)})))})),this._rdate.length&&t.push(Vt("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(Vt("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join("\n")},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach((function(e){return t.rrule(e.clone())})),this._exrule.forEach((function(e){return t.exrule(e.clone())})),this._rdate.forEach((function(e){return t.rdate(new Date(e.getTime()))})),this._exdate.forEach((function(e){return t.exdate(new Date(e.getTime()))})),t},e}(Ft);function $t(t,e){if(!(t instanceof Ft))throw new TypeError(String(t)+" is not RRule instance");p(e.map(String),String(t))||e.push(t)}function Jt(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");p(e.map(Number),Number(t))||(e.push(t),R(e))}function Vt(t,e,n){var r=!n||"UTC"===n.toUpperCase(),i=r?"".concat(t,":"):"".concat(t,";TZID=").concat(n,":"),o=e.map((function(t){return N(t.valueOf(),r)})).join(",");return"".concat(i).concat(o)}return e})()));
//# sourceMappingURL=rrule.min.js.map
import IterResult from './iterresult';
import dateutil from './dateutil';
import { clone, cloneDates } from './dateutil';
import { isArray } from './helpers';

@@ -31,6 +31,3 @@ function argsMatch(left, right) {

if (value) {
value =
value instanceof Date
? dateutil.clone(value)
: dateutil.cloneDates(value);
value = value instanceof Date ? clone(value) : cloneDates(value);
}

@@ -91,5 +88,5 @@ if (what === 'all') {

return isArray(cached)
? dateutil.cloneDates(cached)
? cloneDates(cached)
: cached instanceof Date
? dateutil.clone(cached)
? clone(cached)
: cached;

@@ -96,0 +93,0 @@ };

import { __extends } from "tslib";
import { Frequency } from './types';
import { pymod, divmod, empty, includes } from './helpers';
import { dateutil } from './dateutil';
import { getWeekday, MAXYEAR, monthRange } from './dateutil';
var Time = /** @class */ (function () {

@@ -44,3 +44,3 @@ function Time(hour, minute, second, millisecond) {

DateTime.prototype.getWeekday = function () {
return dateutil.getWeekday(new Date(this.getTime()));
return getWeekday(new Date(this.getTime()));
};

@@ -148,3 +148,3 @@ DateTime.prototype.getTime = function () {

}
var daysinmonth = dateutil.monthRange(this.year, this.month - 1)[1];
var daysinmonth = monthRange(this.year, this.month - 1)[1];
if (this.day <= daysinmonth) {

@@ -159,7 +159,7 @@ return;

++this.year;
if (this.year > dateutil.MAXYEAR) {
if (this.year > MAXYEAR) {
return;
}
}
daysinmonth = dateutil.monthRange(this.year, this.month - 1)[1];
daysinmonth = monthRange(this.year, this.month - 1)[1];
}

@@ -166,0 +166,0 @@ };

import { Time } from './datetime';
declare type Datelike = Pick<Date, 'getTime'>;
export declare const datetime: (y: number, m: number, d: number, h?: number, i?: number, s?: number) => Date;
/**

@@ -8,69 +9,68 @@ * General date-related utilities.

*/
export declare namespace dateutil {
const MONTH_DAYS: number[];
/**
* Number of milliseconds of one day
*/
const ONE_DAY: number;
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.MAXYEAR>
*/
const MAXYEAR = 9999;
/**
* Python uses 1-Jan-1 as the base for calculating ordinals but we don't
* want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,
* therefore we use 1-Jan-1970 instead
*/
const ORDINAL_BASE: Date;
/**
* Python: MO-SU: 0 - 6
* JS: SU-SAT 0 - 6
*/
const PY_WEEKDAYS: number[];
/**
* py_date.timetuple()[7]
*/
const getYearDay: (date: Date) => number;
const isLeapYear: (year: number) => boolean;
const isDate: (value: unknown) => value is Date;
const isValidDate: (value: unknown) => value is Date;
/**
* @return {Number} the date's timezone offset in ms
*/
const tzOffset: (date: Date) => number;
/**
* @see: <http://www.mcfedries.com/JavaScript/DaysBetween.asp>
*/
const daysBetween: (date1: Date, date2: Date) => number;
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.date.toordinal>
*/
const toOrdinal: (date: Date) => number;
/**
* @see - <http://docs.python.org/library/datetime.html#datetime.date.fromordinal>
*/
const fromOrdinal: (ordinal: number) => Date;
const getMonthDays: (date: Date) => number;
/**
* @return {Number} python-like weekday
*/
const getWeekday: (date: Date) => number;
/**
* @see: <http://docs.python.org/library/calendar.html#calendar.monthrange>
*/
const monthRange: (year: number, month: number) => number[];
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.datetime.combine>
*/
const combine: (date: Date, time: Date | Time) => Date;
const clone: (date: Date | Time) => Date;
const cloneDates: (dates: Date[] | Time[]) => Date[];
/**
* Sorts an array of Date or dateutil.Time objects
*/
const sort: <T extends Datelike>(dates: T[]) => void;
const timeToUntilString: (time: number, utc?: boolean) => string;
const untilStringToDate: (until: string) => Date;
}
export default dateutil;
export declare const MONTH_DAYS: number[];
/**
* Number of milliseconds of one day
*/
export declare const ONE_DAY: number;
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.MAXYEAR>
*/
export declare const MAXYEAR = 9999;
/**
* Python uses 1-Jan-1 as the base for calculating ordinals but we don't
* want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,
* therefore we use 1-Jan-1970 instead
*/
export declare const ORDINAL_BASE: Date;
/**
* Python: MO-SU: 0 - 6
* JS: SU-SAT 0 - 6
*/
export declare const PY_WEEKDAYS: number[];
/**
* py_date.timetuple()[7]
*/
export declare const getYearDay: (date: Date) => number;
export declare const isLeapYear: (year: number) => boolean;
export declare const isDate: (value: unknown) => value is Date;
export declare const isValidDate: (value: unknown) => value is Date;
/**
* @return {Number} the date's timezone offset in ms
*/
export declare const tzOffset: (date: Date) => number;
/**
* @see: <http://www.mcfedries.com/JavaScript/DaysBetween.asp>
*/
export declare const daysBetween: (date1: Date, date2: Date) => number;
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.date.toordinal>
*/
export declare const toOrdinal: (date: Date) => number;
/**
* @see - <http://docs.python.org/library/datetime.html#datetime.date.fromordinal>
*/
export declare const fromOrdinal: (ordinal: number) => Date;
export declare const getMonthDays: (date: Date) => number;
/**
* @return {Number} python-like weekday
*/
export declare const getWeekday: (date: Date) => number;
/**
* @see: <http://docs.python.org/library/calendar.html#calendar.monthrange>
*/
export declare const monthRange: (year: number, month: number) => number[];
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.datetime.combine>
*/
export declare const combine: (date: Date, time: Date | Time) => Date;
export declare const clone: (date: Date | Time) => Date;
export declare const cloneDates: (dates: Date[] | Time[]) => Date[];
/**
* Sorts an array of Date or Time objects
*/
export declare const sort: <T extends Datelike>(dates: T[]) => void;
export declare const timeToUntilString: (time: number, utc?: boolean) => string;
export declare const untilStringToDate: (until: string) => Date;
export declare const dateInTimeZone: (date: Date, timeZone: string) => Date;
export {};
//# sourceMappingURL=dateutil.d.ts.map

@@ -1,3 +0,8 @@

/* eslint-disable @typescript-eslint/no-namespace */
import { padStart } from './helpers';
export var datetime = function (y, m, d, h, i, s) {
if (h === void 0) { h = 0; }
if (i === void 0) { i = 0; }
if (s === void 0) { s = 0; }
return new Date(Date.UTC(y, m - 1, d, h, i, s));
};
/**

@@ -8,141 +13,150 @@ * General date-related utilities.

*/
export var dateutil;
(function (dateutil) {
dateutil.MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
/**
* Number of milliseconds of one day
*/
dateutil.ONE_DAY = 1000 * 60 * 60 * 24;
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.MAXYEAR>
*/
dateutil.MAXYEAR = 9999;
/**
* Python uses 1-Jan-1 as the base for calculating ordinals but we don't
* want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,
* therefore we use 1-Jan-1970 instead
*/
dateutil.ORDINAL_BASE = new Date(Date.UTC(1970, 0, 1));
/**
* Python: MO-SU: 0 - 6
* JS: SU-SAT 0 - 6
*/
dateutil.PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5];
/**
* py_date.timetuple()[7]
*/
dateutil.getYearDay = function (date) {
var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
return (Math.ceil((dateNoTime.valueOf() -
new Date(date.getUTCFullYear(), 0, 1).valueOf()) /
dateutil.ONE_DAY) + 1);
};
dateutil.isLeapYear = function (year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
};
dateutil.isDate = function (value) {
return value instanceof Date;
};
dateutil.isValidDate = function (value) {
return dateutil.isDate(value) && !isNaN(value.getTime());
};
/**
* @return {Number} the date's timezone offset in ms
*/
dateutil.tzOffset = function (date) {
return date.getTimezoneOffset() * 60 * 1000;
};
/**
* @see: <http://www.mcfedries.com/JavaScript/DaysBetween.asp>
*/
dateutil.daysBetween = function (date1, date2) {
// The number of milliseconds in one day
// Convert both dates to milliseconds
var date1ms = date1.getTime() - dateutil.tzOffset(date1);
var date2ms = date2.getTime() - dateutil.tzOffset(date2);
// Calculate the difference in milliseconds
var differencems = date1ms - date2ms;
// Convert back to days and return
return Math.round(differencems / dateutil.ONE_DAY);
};
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.date.toordinal>
*/
dateutil.toOrdinal = function (date) {
return dateutil.daysBetween(date, dateutil.ORDINAL_BASE);
};
/**
* @see - <http://docs.python.org/library/datetime.html#datetime.date.fromordinal>
*/
dateutil.fromOrdinal = function (ordinal) {
return new Date(dateutil.ORDINAL_BASE.getTime() + ordinal * dateutil.ONE_DAY);
};
dateutil.getMonthDays = function (date) {
var month = date.getUTCMonth();
return month === 1 && dateutil.isLeapYear(date.getUTCFullYear())
? 29
: dateutil.MONTH_DAYS[month];
};
/**
* @return {Number} python-like weekday
*/
dateutil.getWeekday = function (date) {
return dateutil.PY_WEEKDAYS[date.getUTCDay()];
};
/**
* @see: <http://docs.python.org/library/calendar.html#calendar.monthrange>
*/
dateutil.monthRange = function (year, month) {
var date = new Date(Date.UTC(year, month, 1));
return [dateutil.getWeekday(date), dateutil.getMonthDays(date)];
};
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.datetime.combine>
*/
dateutil.combine = function (date, time) {
time = time || date;
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds()));
};
dateutil.clone = function (date) {
var dolly = new Date(date.getTime());
return dolly;
};
dateutil.cloneDates = function (dates) {
var clones = [];
for (var i = 0; i < dates.length; i++) {
clones.push(dateutil.clone(dates[i]));
}
return clones;
};
/**
* Sorts an array of Date or dateutil.Time objects
*/
dateutil.sort = function (dates) {
dates.sort(function (a, b) {
return a.getTime() - b.getTime();
});
};
dateutil.timeToUntilString = function (time, utc) {
if (utc === void 0) { utc = true; }
var date = new Date(time);
return [
padStart(date.getUTCFullYear().toString(), 4, '0'),
padStart(date.getUTCMonth() + 1, 2, '0'),
padStart(date.getUTCDate(), 2, '0'),
'T',
padStart(date.getUTCHours(), 2, '0'),
padStart(date.getUTCMinutes(), 2, '0'),
padStart(date.getUTCSeconds(), 2, '0'),
utc ? 'Z' : '',
].join('');
};
dateutil.untilStringToDate = function (until) {
var re = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/;
var bits = re.exec(until);
if (!bits)
throw new Error("Invalid UNTIL value: ".concat(until));
return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0));
};
})(dateutil || (dateutil = {}));
export default dateutil;
export var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
/**
* Number of milliseconds of one day
*/
export var ONE_DAY = 1000 * 60 * 60 * 24;
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.MAXYEAR>
*/
export var MAXYEAR = 9999;
/**
* Python uses 1-Jan-1 as the base for calculating ordinals but we don't
* want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,
* therefore we use 1-Jan-1970 instead
*/
export var ORDINAL_BASE = datetime(1970, 1, 1);
/**
* Python: MO-SU: 0 - 6
* JS: SU-SAT 0 - 6
*/
export var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5];
/**
* py_date.timetuple()[7]
*/
export var getYearDay = function (date) {
var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
return (Math.ceil((dateNoTime.valueOf() - new Date(date.getUTCFullYear(), 0, 1).valueOf()) /
ONE_DAY) + 1);
};
export var isLeapYear = function (year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
};
export var isDate = function (value) {
return value instanceof Date;
};
export var isValidDate = function (value) {
return isDate(value) && !isNaN(value.getTime());
};
/**
* @return {Number} the date's timezone offset in ms
*/
export var tzOffset = function (date) {
return date.getTimezoneOffset() * 60 * 1000;
};
/**
* @see: <http://www.mcfedries.com/JavaScript/DaysBetween.asp>
*/
export var daysBetween = function (date1, date2) {
// The number of milliseconds in one day
// Convert both dates to milliseconds
var date1ms = date1.getTime() - tzOffset(date1);
var date2ms = date2.getTime() - tzOffset(date2);
// Calculate the difference in milliseconds
var differencems = date1ms - date2ms;
// Convert back to days and return
return Math.round(differencems / ONE_DAY);
};
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.date.toordinal>
*/
export var toOrdinal = function (date) {
return daysBetween(date, ORDINAL_BASE);
};
/**
* @see - <http://docs.python.org/library/datetime.html#datetime.date.fromordinal>
*/
export var fromOrdinal = function (ordinal) {
return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY);
};
export var getMonthDays = function (date) {
var month = date.getUTCMonth();
return month === 1 && isLeapYear(date.getUTCFullYear())
? 29
: MONTH_DAYS[month];
};
/**
* @return {Number} python-like weekday
*/
export var getWeekday = function (date) {
return PY_WEEKDAYS[date.getUTCDay()];
};
/**
* @see: <http://docs.python.org/library/calendar.html#calendar.monthrange>
*/
export var monthRange = function (year, month) {
var date = datetime(year, month + 1, 1);
return [getWeekday(date), getMonthDays(date)];
};
/**
* @see: <http://docs.python.org/library/datetime.html#datetime.datetime.combine>
*/
export var combine = function (date, time) {
time = time || date;
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds()));
};
export var clone = function (date) {
var dolly = new Date(date.getTime());
return dolly;
};
export var cloneDates = function (dates) {
var clones = [];
for (var i = 0; i < dates.length; i++) {
clones.push(clone(dates[i]));
}
return clones;
};
/**
* Sorts an array of Date or Time objects
*/
export var sort = function (dates) {
dates.sort(function (a, b) {
return a.getTime() - b.getTime();
});
};
export var timeToUntilString = function (time, utc) {
if (utc === void 0) { utc = true; }
var date = new Date(time);
return [
padStart(date.getUTCFullYear().toString(), 4, '0'),
padStart(date.getUTCMonth() + 1, 2, '0'),
padStart(date.getUTCDate(), 2, '0'),
'T',
padStart(date.getUTCHours(), 2, '0'),
padStart(date.getUTCMinutes(), 2, '0'),
padStart(date.getUTCSeconds(), 2, '0'),
utc ? 'Z' : '',
].join('');
};
export var untilStringToDate = function (until) {
var re = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/;
var bits = re.exec(until);
if (!bits)
throw new Error("Invalid UNTIL value: ".concat(until));
return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0));
};
var dateTZtoISO8601 = function (date, timeZone) {
// date format for sv-SE is almost ISO8601
var dateStr = date.toLocaleString('sv-SE', { timeZone: timeZone });
// '2023-02-07 10:41:36'
return dateStr.replace(' ', 'T') + 'Z';
};
export var dateInTimeZone = function (date, timeZone) {
var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
// Date constructor can only reliably parse dates in ISO8601 format
var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone));
var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : 'UTC'));
var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime();
return new Date(date.getTime() - tzOffset);
};
//# sourceMappingURL=dateutil.js.map

@@ -1,2 +0,2 @@

import dateutil from './dateutil';
import { dateInTimeZone, timeToUntilString } from './dateutil';
var DateWithZone = /** @class */ (function () {

@@ -18,3 +18,3 @@ function DateWithZone(date, tzid) {

DateWithZone.prototype.toString = function () {
var datestr = dateutil.timeToUntilString(this.date.getTime(), this.isUTC);
var datestr = timeToUntilString(this.date.getTime(), this.isUTC);
if (!this.isUTC) {

@@ -29,11 +29,6 @@ return ";TZID=".concat(this.tzid, ":").concat(datestr);

DateWithZone.prototype.rezonedDate = function () {
var _a;
if (this.isUTC) {
return this.date;
}
var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
var dateInLocalTZ = new Date(this.date.toLocaleString(undefined, { timeZone: localTimeZone }));
var dateInTargetTZ = new Date(this.date.toLocaleString(undefined, { timeZone: (_a = this.tzid) !== null && _a !== void 0 ? _a : 'UTC' }));
var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime();
return new Date(this.date.getTime() - tzOffset);
return dateInTimeZone(this.date, this.tzid);
};

@@ -40,0 +35,0 @@ return DateWithZone;

@@ -7,2 +7,3 @@ export { RRule } from './rrule';

export { RRuleStrOptions } from './rrulestr';
export { datetime } from './dateutil';
//# sourceMappingURL=index.d.ts.map

@@ -21,2 +21,3 @@ /* !

export { Weekday } from './weekday';
export { datetime } from './dateutil';
//# sourceMappingURL=index.js.map
import { freqIsDailyOrGreater } from '../types';
import dateutil from '../dateutil';
import { combine, fromOrdinal, MAXYEAR } from '../dateutil';
import Iterinfo from '../iterinfo/index';

@@ -50,6 +50,6 @@ import { RRule } from '../rrule';

}
var date = dateutil.fromOrdinal(ii.yearordinal + currentDay);
var date = fromOrdinal(ii.yearordinal + currentDay);
for (var k = 0; k < timeset.length; k++) {
var time = timeset[k];
var res = dateutil.combine(date, time);
var res = combine(date, time);
if (until && res > until) {

@@ -78,3 +78,3 @@ return emitResult(iterResult);

counterDate.add(options, filtered);
if (counterDate.year > dateutil.MAXYEAR) {
if (counterDate.year > MAXYEAR) {
return emitResult(iterResult);

@@ -81,0 +81,0 @@ }

@@ -1,2 +0,2 @@

import dateutil from '../dateutil';
import { combine, fromOrdinal, sort } from '../dateutil';
import { pymod, isPresent, includes } from '../helpers';

@@ -32,4 +32,4 @@ export function buildPoslist(bysetpos, timeset, start, end, ii, dayset) {

var time = timeset[timepos];
var date = dateutil.fromOrdinal(ii.yearordinal + i);
var res = dateutil.combine(date, time);
var date = fromOrdinal(ii.yearordinal + i);
var res = combine(date, time);
// XXX: can this ever be in the array?

@@ -40,5 +40,5 @@ // - compare the actual date instead?

}
dateutil.sort(poslist);
sort(poslist);
return poslist;
}
//# sourceMappingURL=poslist.js.map

@@ -1,2 +0,1 @@

import dateutil from '../dateutil';
import { notEmpty, repeat, range, isPresent } from '../helpers';

@@ -8,2 +7,3 @@ import { Frequency } from '../types';

import { Time } from '../datetime';
import { datetime, sort, toOrdinal } from '../dateutil';
// =============================================================================

@@ -129,4 +129,3 @@ // Iterinfo

var set = repeat(null, this.yearlen + 7);
var i = dateutil.toOrdinal(new Date(Date.UTC(year, month - 1, day))) -
this.yearordinal;
var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;
var start = i;

@@ -143,4 +142,3 @@ for (var j = 0; j < 7; j++) {

var set = repeat(null, this.yearlen);
var i = dateutil.toOrdinal(new Date(Date.UTC(year, month - 1, day))) -
this.yearordinal;
var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;
set[i] = i;

@@ -155,3 +153,3 @@ return [set, i, i + 1];

});
dateutil.sort(set);
sort(set);
return set;

@@ -161,3 +159,3 @@ };

var set = this.options.bysecond.map(function (second) { return new Time(hour, minute, second, millisecond); });
dateutil.sort(set);
sort(set);
return set;

@@ -164,0 +162,0 @@ };

import { __assign } from "tslib";
import dateutil from '../dateutil';
import { datetime, getWeekday, isLeapYear, toOrdinal } from '../dateutil';
import { empty, repeat, pymod, includes } from '../helpers';
import { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE, } from '../masks';
export function rebuildYear(year, options) {
var firstyday = new Date(Date.UTC(year, 0, 1));
var yearlen = dateutil.isLeapYear(year) ? 366 : 365;
var nextyearlen = dateutil.isLeapYear(year + 1) ? 366 : 365;
var yearordinal = dateutil.toOrdinal(firstyday);
var yearweekday = dateutil.getWeekday(firstyday);
var firstyday = datetime(year, 1, 1);
var yearlen = isLeapYear(year) ? 366 : 365;
var nextyearlen = isLeapYear(year + 1) ? 366 : 365;
var yearordinal = toOrdinal(firstyday);
var yearweekday = getWeekday(firstyday);
var result = __assign(__assign({ yearlen: yearlen, nextyearlen: nextyearlen, yearordinal: yearordinal, yearweekday: yearweekday }, baseYearMasks(year)), { wnomask: null });

@@ -84,5 +84,5 @@ if (empty(options.byweekno)) {

if (!includes(options.byweekno, -1)) {
var lyearweekday = dateutil.getWeekday(new Date(Date.UTC(year - 1, 0, 1)));
var lyearweekday = getWeekday(datetime(year - 1, 1, 1));
var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7);
var lyearlen = dateutil.isLeapYear(year - 1) ? 366 : 365;
var lyearlen = isLeapYear(year - 1) ? 366 : 365;
var weekst = void 0;

@@ -109,5 +109,5 @@ if (lno1wkst >= 4) {

function baseYearMasks(year) {
var yearlen = dateutil.isLeapYear(year) ? 366 : 365;
var firstyday = new Date(Date.UTC(year, 0, 1));
var wday = dateutil.getWeekday(firstyday);
var yearlen = isLeapYear(year) ? 366 : 365;
var firstyday = datetime(year, 1, 1);
var wday = getWeekday(firstyday);
if (yearlen === 365) {

@@ -114,0 +114,0 @@ return {

import { DateWithZone } from './datewithzone';
import { iter } from './iter';
import dateutil from './dateutil';
import { sort } from './dateutil';
export function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) {

@@ -51,3 +51,3 @@ var _exdateHash = {};

var res = iterResult._result;
dateutil.sort(res);
sort(res);
switch (iterResult.method) {

@@ -54,0 +54,0 @@ case 'all':

import { RRule, DEFAULT_OPTIONS } from './rrule';
import { includes, isPresent, isArray, isNumber, toArray } from './helpers';
import { Weekday } from './weekday';
import dateutil from './dateutil';
import { timeToUntilString } from './dateutil';
import { DateWithZone } from './datewithzone';

@@ -62,3 +62,3 @@ export function optionsToString(options) {

case 'UNTIL':
outValue = dateutil.timeToUntilString(value, !options.tzid);
outValue = timeToUntilString(value, !options.tzid);
break;

@@ -65,0 +65,0 @@ default:

@@ -5,3 +5,3 @@ import { __assign } from "tslib";

import { RRule, defaultKeys, DEFAULT_OPTIONS } from './rrule';
import dateutil from './dateutil';
import { getWeekday, isDate, isValidDate } from './dateutil';
import { Weekday } from './weekday';

@@ -17,3 +17,3 @@ import { Time } from './datetime';

invalid.push(key);
if (dateutil.isDate(options[key]) && !dateutil.isValidDate(options[key])) {
if (isDate(options[key]) && !isValidDate(options[key])) {
invalid.push(key);

@@ -72,3 +72,3 @@ }

case RRule.WEEKLY:
opts.byweekday = [dateutil.getWeekday(opts.dtstart)];
opts.byweekday = [getWeekday(opts.dtstart)];
break;

@@ -75,0 +75,0 @@ }

import { __assign } from "tslib";
import { Frequency } from './types';
import { Weekday } from './weekday';
import dateutil from './dateutil';
import { untilStringToDate } from './dateutil';
import { Days } from './rrule';

@@ -23,3 +23,3 @@ export function parseString(rfcString) {

}
options.dtstart = dateutil.untilStringToDate(dtstart);
options.dtstart = untilStringToDate(dtstart);
return options;

@@ -87,3 +87,3 @@ }

case 'UNTIL':
options.until = dateutil.untilStringToDate(value);
options.until = untilStringToDate(value);
break;

@@ -90,0 +90,0 @@ case 'BYEASTER':

@@ -77,3 +77,3 @@ import IterResult, { IterArgs } from './iterresult';

*/
before(dt: Date, inc?: boolean): Date;
before(dt: Date, inc?: boolean): Date | null;
/**

@@ -86,3 +86,3 @@ * Returns the first recurrence after the given datetime instance.

*/
after(dt: Date, inc?: boolean): Date;
after(dt: Date, inc?: boolean): Date | null;
/**

@@ -89,0 +89,0 @@ * Returns the number of recurrences in this set. It will have go trough

@@ -1,2 +0,2 @@

import dateutil from './dateutil';
import { isValidDate } from './dateutil';
import IterResult from './iterresult';

@@ -112,3 +112,3 @@ import CallbackIterResult from './callbackiterresult';

if (inc === void 0) { inc = false; }
if (!dateutil.isValidDate(after) || !dateutil.isValidDate(before)) {
if (!isValidDate(after) || !isValidDate(before)) {
throw new Error('Invalid date passed in to RRule.between');

@@ -140,3 +140,3 @@ }

if (inc === void 0) { inc = false; }
if (!dateutil.isValidDate(dt)) {
if (!isValidDate(dt)) {
throw new Error('Invalid date passed in to RRule.before');

@@ -161,3 +161,3 @@ }

if (inc === void 0) { inc = false; }
if (!dateutil.isValidDate(dt)) {
if (!isValidDate(dt)) {
throw new Error('Invalid date passed in to RRule.after');

@@ -164,0 +164,0 @@ }

import { __extends } from "tslib";
import { RRule } from './rrule';
import dateutil from './dateutil';
import { sort, timeToUntilString } from './dateutil';
import { includes } from './helpers';

@@ -171,3 +171,3 @@ import { iterSet } from './iterset';

collection.push(date);
dateutil.sort(collection);
sort(collection);
}

@@ -179,3 +179,3 @@ }

var dateString = rdates
.map(function (rdate) { return dateutil.timeToUntilString(rdate.valueOf(), isUTC); })
.map(function (rdate) { return timeToUntilString(rdate.valueOf(), isUTC); })
.join(',');

@@ -182,0 +182,0 @@ return "".concat(header).concat(dateString);

import { __assign } from "tslib";
import { RRule } from './rrule';
import { RRuleSet } from './rruleset';
import dateutil from './dateutil';
import { untilStringToDate } from './dateutil';
import { includes, split } from './helpers';

@@ -186,6 +186,4 @@ import { parseString, parseDtstart } from './parsestring';

validateDateParm(parms);
return rdateval
.split(',')
.map(function (datestr) { return dateutil.untilStringToDate(datestr); });
return rdateval.split(',').map(function (datestr) { return untilStringToDate(datestr); });
}
//# sourceMappingURL=rrulestr.js.map

@@ -5,4 +5,4 @@ import { Weekday, WeekdayStr } from './weekday';

between(after: Date, before: Date, inc: boolean): Date[];
before(date: Date, inc: boolean): Date;
after(date: Date, inc: boolean): Date;
before(date: Date, inc: boolean): Date | null;
after(date: Date, inc: boolean): Date | null;
}

@@ -9,0 +9,0 @@ export declare type QueryMethodTypes = keyof QueryMethods;

{
"name": "rrule",
"version": "2.7.1",
"version": "2.7.2",
"description": "JavaScript library for working with recurrence rules for calendar dates.",

@@ -5,0 +5,0 @@ "homepage": "http://jakubroztocil.github.io/rrule/",

@@ -57,3 +57,3 @@ # rrule.js

```es6
import { RRule, RRuleSet, rrulestr } from 'rrule'
import { datetime, RRule, RRuleSet, rrulestr } from 'rrule'

@@ -65,4 +65,4 @@ // Create a rule:

byweekday: [RRule.MO, RRule.FR],
dtstart: new Date(Date.UTC(2012, 1, 1, 10, 30)),
until: new Date(Date.UTC(2012, 12, 31))
dtstart: datetime(2012, 2, 1, 10, 30),
until: datetime(2012, 12, 31)
})

@@ -83,3 +83,3 @@

// Get a slice:
rule.between(new Date(Date.UTC(2012, 7, 1)), new Date(Date.UTC(2012, 8, 1)))
rule.between(datetime(2012, 8, 1), datetime(2012, 9, 1))
['2012-08-27T10:30:00.000Z',

@@ -109,3 +109,3 @@ '2012-08-31T10:30:00.000Z']

count: 5,
dtstart: new Date(Date.UTC(2012, 1, 1, 10, 30)),
dtstart: datetime(2012, 2, 1, 10, 30),
})

@@ -115,6 +115,6 @@ )

// Add a date to rruleSet
rruleSet.rdate(new Date(Date.UTC(2012, 6, 1, 10, 30)))
rruleSet.rdate(datetime(2012, 7, 1, 10, 30))
// Add another date to rruleSet
rruleSet.rdate(new Date(Date.UTC(2012, 6, 2, 10, 30)))
rruleSet.rdate(datetime(2012, 7, 2, 10, 30))

@@ -126,3 +126,3 @@ // Add a exclusion rrule to rruleSet

count: 2,
dtstart: new Date(Date.UTC(2012, 2, 1, 10, 30)),
dtstart: datetime(2012, 3, 1, 10, 30),
})

@@ -132,3 +132,3 @@ )

// Add a exclusion date to rruleSet
rruleSet.exdate(new Date(Date.UTC(2012, 5, 1, 10, 30)))
rruleSet.exdate(datetime(2012, 5, 1, 10, 30))

@@ -144,6 +144,5 @@ // Get all occurrence dates (Date instances):

// Get a slice:
rruleSet.between(
new Date(Date.UTC(2012, 2, 1)),
new Date(Date.UTC(2012, 6, 2))
)[('2012-05-01T10:30:00.000Z', '2012-07-01T10:30:00.000Z')]
rruleSet.between(datetime(2012, 2, 1), datetime(2012, 6, 2))[
('2012-05-01T10:30:00.000Z', '2012-07-01T10:30:00.000Z')
]

@@ -187,5 +186,6 @@ // To string

**The bottom line is the returned "UTC" dates are always meant to be interpreted as dates in your local timezone. This may mean you have to do additional conversion to get the "correct" local time with offset applied.**
**THE BOTTOM LINE: Returned "UTC" dates are always meant to be interpreted as dates in your local timezone. This may mean you have to do additional conversion to get the "correct" local time with offset applied.**
For this reason, it is highly recommended to use timestamps in UTC eg. `new Date(Date.UTC(...))`. Returned dates will likewise be in UTC (except on Chrome, which always returns dates with a timezone offset).
For this reason, it is highly recommended to use timestamps in UTC eg. `new Date(Date.UTC(...))`. Returned dates will likewise be in UTC (except on Chrome, which always returns dates with a timezone offset). It's recommended to use the provided `datetime()` helper, which
creates dates in the correct format using a 1-based month.

@@ -214,3 +214,3 @@ For example:

If you want to get the same times in true UTC, you may do so eg. using [Luxon](https://moment.github.io/luxon/#/):
If you want to get the same times in true UTC, you may do so (e.g., using [Luxon](https://moment.github.io/luxon/#/)):

@@ -248,3 +248,3 @@ ```ts

new RRule({
dtstart: new Date(Date.UTC(2018, 1, 1, 10, 30)),
dtstart: datetime(2018, 2, 1, 10, 30),
count: 1,

@@ -273,4 +273,4 @@ tzid: 'Asia/Tokyo',

freq: RRule.MONTHLY,
dtstart: new Date(Date.UTC(2018, 1, 1, 10, 30)),
until: new Date(Date.UTC(2018, 2, 31)),
dtstart: datetime(2018, 2, 1, 10, 30),
until: datetime(2018, 3, 31),
}).all()[('2018-02-01T10:30:00.000Z', '2018-03-01T10:30:00.000Z')]

@@ -297,3 +297,3 @@ ```

</tr>
<thead>
</thead>
<tbody>

@@ -507,3 +507,3 @@ <tr>

Returns all the occurrences of the rrule between `after` and `before`.
The inc keyword defines what happens if `after` and/or `before` are
The `inc` keyword defines what happens if `after` and/or `before` are
themselves occurrences. With `inc == true`, they will be included in the

@@ -516,3 +516,3 @@ list, if they are found in the recurrence set.

```javascript
rule.between(new Date(Date.UTC(2012, 7, 1)), new Date(Date.UTC(2012, 8, 1)))[
rule.between(datetime(2012, 8, 1), datetime(2012, 9, 1))[
('2012-08-27T10:30:00.000Z', '2012-08-31T10:30:00.000Z')

@@ -592,3 +592,3 @@ ]

var options = RRule.parseString('FREQ=DAILY;INTERVAL=6')
options.dtstart = new Date(Date.UTC(2000, 1, 1))
options.dtstart = datetime(2000, 2, 1)
var rule = new RRule(options)

@@ -601,4 +601,4 @@ ```

These methods provide an incomplete support for text–`RRule` and
`RRule`–text conversion. You should test them with your input to see
These methods provide an incomplete support for text→`RRule` and
`RRule`→text conversion. You should test them with your input to see
whether the result is acceptable.

@@ -642,3 +642,3 @@

// {freq: 3, count: "3"}
options.dtstart = new Date(Date.UTC(2000, 1, 1))
options.dtstart = datetime(2000, 2, 1)
var rule = new RRule(options)

@@ -655,3 +655,3 @@ ```

The RRuleSet instance allows more complex recurrence setups, mixing multiple
The `RRuleSet` instance allows more complex recurrence setups, mixing multiple
rules, dates, exclusion rules, and exclusion dates.

@@ -664,21 +664,21 @@

Include the given rrule instance in the recurrence set generation.
Include the given `rrule` instance in the recurrence set generation.
##### `RRuleSet.prototype.rdate(dt)`
Include the given datetime instance in the recurrence set generation.
Include the given datetime instance `dt` in the recurrence set generation.
##### `RRuleSet.prototype.exrule(rrule)`
Include the given rrule instance in the recurrence set exclusion list. Dates
Include the given `rrule` instance in the recurrence set exclusion list. Dates
which are part of the given recurrence rules will not be generated, even if
some inclusive rrule or rdate matches them. NOTE: EXRULE has been (deprecated
some inclusive rrule or rdate matches them. **NOTE:** `EXRULE` has been (deprecated
in RFC 5545)[https://icalendar.org/iCalendar-RFC-5545/a-3-deprecated-features.html]
and does not support a DTSTART property.
and does not support a `DTSTART` property.
##### `RRuleSet.prototype.exdate(dt)`
Include the given datetime instance in the recurrence set exclusion list. Dates
included that way will not be generated, even if some inclusive rrule or
rdate matches them.
Include the given datetime instance `dt` in the recurrence set exclusion list. Dates
included that way will not be generated, even if some inclusive `rrule` or
`rdate` matches them.

@@ -688,3 +688,3 @@ ##### `RRuleSet.prototype.tzid(tz?)`

Sets or overrides the timezone identifier. Useful if there are no rrules in this
RRuleSet and thus no DTSTART.
`RRuleSet` and thus no `DTSTART`.

@@ -733,33 +733,54 @@ ##### `RRuleSet.prototype.all([iterator])`

as parameter may be a multiple line string, a single line string, or just the
RRULE property value.
`RRULE` property value.
Additionally, it accepts the following keyword arguments:
`cache`
If True, the rruleset or rrule created instance will cache its results.
<dl>
<dt><code>cache</code></dt>
<dd>
If <code>true</code>, the <code>rruleset</code> or <code>rrule</code> created instance
will cache its results.
Default is not to cache.
</dd>
`dtstart`
If given, it must be a datetime instance that will be used when no DTSTART
property is found in the parsed string. If it is not given, and the property
is not found, datetime.now() will be used instead.
<dt><code>dtstart</code></dt>
<dd>
If given, it must be a datetime instance that will be used when no
<code>DTSTART</code> property is found in the parsed string.
If it is not given, and the property is not found,
<code>datetime.now()</code> will be used instead.
</dd>
`unfold`
If set to True, lines will be unfolded following the RFC specification. It
defaults to False, meaning that spaces before every line will be stripped.
<dt><code>unfold</code></dt>
<dd>
If set to <code>true</code>, lines will be unfolded following the RFC specification.
It defaults to <code>false</code>, meaning that spaces before every line will be stripped.
</dd>
`forceset`
If set to True a rruleset instance will be returned, even if only a single rule
is found. The default is to return an rrule if possible, and an rruleset if necessary.
<dt><code>forceset</code></dt>
<dd>
If set to <code>true</code>, an <code>rruleset</code> instance will be returned,
even if only a single rule is found.
The default is to return an <code>rrule</code> if possible, and
an <code>rruleset</code> if necessary.
</dd>
`compatible`
If set to True, the parser will operate in RFC-compatible mode. Right now it
means that unfold will be turned on, and if a DTSTART is found, it will be
considered the first recurrence instance, as documented in the RFC.
<dt><code>compatible</code></dt>
<dd>
If set to <code>true</code>, the parser will operate in RFC-compatible mode.
Right now it means that unfold will be turned on, and if a <code>DTSTART</code> is found,
it will be considered the first recurrence instance, as documented in the RFC.
</dd>
`tzid`
If given, it must be a string that will be used when no `TZID` property is found
in the parsed string. If it is not given, and the property is not found, `'UTC'`
will be used by default.
<dt><code>tzid</code></dt>
<dd>
If given, it must be a string that will be used when no <code>TZID</code>
property is found in the parsed string.
If it is not given, and the property is not found, <code>'UTC'</code> will
be used by default.
</dd>
</dl>
---

@@ -781,3 +802,3 @@

var rruleSet = new RRuleSet()
var start = new Date(Date.UTC(2012, 1, 1, 10, 30))
var start = datetime(2012, 2, 1, 10, 30)

@@ -797,4 +818,4 @@ // Add a rrule to rruleSet

- Unlike documented in the RFC, every keyword is valid on every frequency (the
RFC documents that `byweekno` is only valid on yearly frequencies, for example).
- Unlike documented in the RFC, every keyword is valid on every frequency. (The
RFC documents that `byweekno` is only valid on yearly frequencies, for example.)

@@ -825,3 +846,3 @@ ### Development

- [Jakub Roztocil](http://roztocil.co/)
- [Jakub Roztocil](http://roztocil.co)
([@jakubroztocil](http://twitter.com/jakubroztocil))

@@ -832,3 +853,3 @@ - Lars Schöning ([@lyschoening](http://twitter.com/lyschoening))

Python `dateutil` is written by [Gustavo
Niemeyer](http://niemeyer.net/).
Niemeyer](http://niemeyer.net).

@@ -851,2 +872,2 @@ See [LICENCE](https://github.com/jakubroztocil/rrule/blob/master/LICENCE) for

- https://rrules.com/ — RESTful API to get back occurrences of RRULEs that conform to RFC 5545.
- https://rrules.com — RESTful API to get back occurrences of RRULEs that conform to RFC 5545.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc