Comparing version 2.4.1 to 2.5.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("luxon")):"function"==typeof define&&define.amd?define(["luxon"],e):"object"==typeof exports?exports.rrule=e(require("luxon")):t.rrule=e(t.luxon)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";n.d(e,"f",function(){return r}),n.d(e,"e",function(){return i}),n.d(e,"d",function(){return o}),n.d(e,"j",function(){return a}),n.d(e,"k",function(){return s}),n.d(e,"m",function(){return h}),n.d(e,"h",function(){return u}),n.d(e,"l",function(){return c}),n.d(e,"i",function(){return l}),n.d(e,"a",function(){return d}),n.d(e,"b",function(){return y}),n.d(e,"g",function(){return f}),n.d(e,"c",function(){return b});var r=function(t){return null!==t&&void 0!==t},i=function(t){return"number"==typeof t},o=Array.isArray,a=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},s=function(t,e){var n=0,r=[];if(o(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r},h=function(t){return o(t)?t:[t]};function u(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+=s(n,e/n.length)),n.slice(0,e)+String(r))}var c=function(t,e,n){var r=t.split(e);return n?r.slice(0,n).concat([r.slice(n).join(e)]):r},l=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:l(t,e)}},y=function(t){return!r(t)||0===t.length},f=function(t){return!y(t)},b=function(t,e){return f(t)&&-1!==t.indexOf(e)}},function(t,e,n){"use strict";n.r(e);var r,i=n(0),o=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!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.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[Object(i.h)(n.getUTCFullYear().toString(),4,"0"),Object(i.h)(n.getUTCMonth()+1,2,"0"),Object(i.h)(n.getUTCDate(),2,"0"),"T",Object(i.h)(n.getUTCHours(),2,"0"),Object(i.h)(n.getUTCMinutes(),2,"0"),Object(i.h)(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: "+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))};var e=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}();t.Time=e;var n=function(e){function n(t,n,r,i,o,a,s){var h=e.call(this,i,o,a,s)||this;return h.year=t,h.month=n,h.day=r,h}return o(n,e),n.prototype.getWeekday=function(){return t.getWeekday(new Date(this.getTime()))},n.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},n.prototype.getDay=function(){return this.day},n.prototype.getMonth=function(){return this.month},n.prototype.getYear=function(){return this.year},n.prototype.addYears=function(t){this.year+=t},n.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var e=Math.floor(this.month/12),n=Object(i.i)(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},n.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()},n.prototype.addDaily=function(t){this.day+=t,this.fixDay()},n.prototype.addHours=function(t,e,n){var r=!1;for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var o=Object(i.a)(this.hour,24),a=o.div,s=o.mod;if(a&&(this.hour=s,this.addDaily(a),r=!0),Object(i.b)(n)||Object(i.c)(n,this.hour))break}return r},n.prototype.addMinutes=function(t,e,n,r){var o=!1;for(e&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var a=Object(i.a)(this.minute,60),s=a.div,h=a.mod;if(s&&(this.minute=h,o=this.addHours(s,!1,n)),(Object(i.b)(n)||Object(i.c)(n,this.hour))&&(Object(i.b)(r)||Object(i.c)(r,this.minute)))break}return o},n.prototype.addSeconds=function(t,e,n,r,o){var a=!1;for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var s=Object(i.a)(this.second,60),h=s.div,u=s.mod;if(h&&(this.second=u,a=this.addMinutes(h,!1,n,r)),(Object(i.b)(n)||Object(i.c)(n,this.hour))&&(Object(i.b)(r)||Object(i.c)(r,this.minute))&&(Object(i.b)(o)||Object(i.c)(o,this.second)))break}return a},n.prototype.fixDay=function(){if(!(this.day<=28)){var e=t.monthRange(this.year,this.month-1)[1];if(!(this.day<=e))for(;this.day>e;){if(this.day-=e,++this.month,13===this.month&&(this.month=1,++this.year,this.year>t.MAXYEAR))return;e=t.monthRange(this.year,this.month-1)[1]}}},n}(e);t.DateTime=n}(r||(r={}));var a,s=r,h=Object(i.k)(1,31).concat(Object(i.k)(2,28),Object(i.k)(3,31),Object(i.k)(4,30),Object(i.k)(5,31),Object(i.k)(6,30),Object(i.k)(7,31),Object(i.k)(8,31),Object(i.k)(9,30),Object(i.k)(10,31),Object(i.k)(11,30),Object(i.k)(12,31),Object(i.k)(1,7)),u=Object(i.k)(1,31).concat(Object(i.k)(2,29),Object(i.k)(3,31),Object(i.k)(4,30),Object(i.k)(5,31),Object(i.k)(6,30),Object(i.k)(7,31),Object(i.k)(8,31),Object(i.k)(9,30),Object(i.k)(10,31),Object(i.k)(11,30),Object(i.k)(12,31),Object(i.k)(1,7)),c=Object(i.j)(1,29),l=Object(i.j)(1,30),d=Object(i.j)(1,31),y=Object(i.j)(1,32),f=y.concat(l,y,d,y,d,y,y,d,y,d,y,y.slice(0,7)),b=y.concat(c,y,d,y,d,y,y,d,y,d,y,y.slice(0,7)),p=Object(i.j)(-28,0),m=Object(i.j)(-29,0),w=Object(i.j)(-30,0),O=Object(i.j)(-31,0),g=O.concat(m,O,w,O,w,O,O,w,O,w,O,O.slice(0,7)),k=O.concat(p,O,w,O,w,O,O,w,O,w,O,O.slice(0,7)),v=[0,31,60,91,121,152,182,213,244,274,305,335,366],E=[0,31,59,90,120,151,181,212,243,273,304,334,365],T=function(){for(var t=[],e=0;e<55;e++)t=t.concat(Object(i.j)(7));return t}(),_=function(){function t(t){this.yearlen=365,this.nextyearlen=365,this.rrule=t,this.mmask=null,this.mrange=null,this.mdaymask=null,this.nmdaymask=null,this.wdaymask=null,this.wnomask=null,this.nwdaymask=null,this.eastermask=null}return t.prototype.easter=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),h=Math.floor((r-s+1)/3),u=Math.floor(19*n+r-o-h+15)%30,c=Math.floor(i/4),l=i%4,d=Math.floor(32+2*a+2*c-u-l)%7,y=Math.floor((n+11*u+22*d)/451),f=Math.floor((u+d-7*y+114)/31),b=(u+d-7*y+114)%31+1,p=Date.UTC(t,f-1,b+e),m=Date.UTC(t,0,1);return[Math.ceil((p-m)/864e5)]},t.prototype.rebuild=function(t,e){var n=this.rrule;t!==this.lastyear&&this.rebuildYear(t),!Object(i.g)(n.options.bynweekday)||e===this.lastmonth&&t===this.lastyear||this.rebuildMonth(t,e),Object(i.f)(n.options.byeaster)&&(this.eastermask=this.easter(t,n.options.byeaster))},t.prototype.rebuildYear=function(t){var e=this.rrule;this.yearlen=s.isLeapYear(t)?366:365,this.nextyearlen=s.isLeapYear(t+1)?366:365;var n=new Date(Date.UTC(t,0,1));this.yearordinal=s.toOrdinal(n),this.yearweekday=s.getWeekday(n);var r=s.getWeekday(n);if(365===this.yearlen?(this.mmask=h,this.mdaymask=b,this.nmdaymask=k,this.wdaymask=T.slice(r),this.mrange=E):(this.mmask=u,this.mdaymask=f,this.nmdaymask=g,this.wdaymask=T.slice(r),this.mrange=v),Object(i.b)(e.options.byweekno))this.wnomask=null;else{this.wnomask=Object(i.k)(0,this.yearlen+7);var o,a=void 0,c=void 0;(a=o=Object(i.i)(7-this.yearweekday+e.options.wkst,7))>=4?(a=0,c=this.yearlen+Object(i.i)(this.yearweekday-e.options.wkst,7)):c=this.yearlen-a;for(var l=Math.floor(c/7),d=Object(i.i)(c,7),y=Math.floor(l+d/4),p=0;p<e.options.byweekno.length;p++){var m=void 0,w=e.options.byweekno[p];if(w<0&&(w+=y+1),w>0&&w<=y){w>1?(m=a+7*(w-1),a!==o&&(m-=7-o)):m=a;for(var O=0;O<7&&(this.wnomask[m]=1,m++,this.wdaymask[m]!==e.options.wkst);O++);}}if(Object(i.c)(e.options.byweekno,1)){m=a+7*y;if(a!==o&&(m-=7-o),m<this.yearlen)for(p=0;p<7&&(this.wnomask[m]=1,m+=1,this.wdaymask[m]!==e.options.wkst);p++);}if(a){var _=void 0;if(Object(i.c)(e.options.byweekno,-1))_=-1;else{var j=s.getWeekday(new Date(Date.UTC(t-1,0,1))),Y=Object(i.i)(7-j.valueOf()+e.options.wkst,7),D=s.isLeapYear(t-1)?366:365;Y>=4?(Y=0,_=Math.floor(52+Object(i.i)(D+Object(i.i)(j-e.options.wkst,7),7)/4)):_=Math.floor(52+Object(i.i)(this.yearlen-a,7)/4)}if(Object(i.c)(e.options.byweekno,_))for(m=0;m<a;m++)this.wnomask[m]=1}}},t.prototype.rebuildMonth=function(t,e){var n=this.rrule,r=[];if(n.options.freq===H.YEARLY)if(Object(i.g)(n.options.bymonth))for(var o=0;o<n.options.bymonth.length;o++)e=n.options.bymonth[o],r.push(this.mrange.slice(e-1,e+1));else r=[[0,this.yearlen]];else n.options.freq===H.MONTHLY&&(r=[this.mrange.slice(e-1,e+1)]);if(Object(i.g)(r)){this.nwdaymask=Object(i.k)(0,this.yearlen);for(o=0;o<r.length;o++){var a=r[o],s=a[0],h=a[1];h-=1;for(var u=0;u<n.options.bynweekday.length;u++){var c=void 0,l=n.options.bynweekday[u][0],d=n.options.bynweekday[u][1];d<0?(c=h+7*(d+1),c-=Object(i.i)(this.wdaymask[c]-l,7)):(c=s+7*(d-1),c+=Object(i.i)(7-this.wdaymask[c]+l,7)),s<=c&&c<=h&&(this.nwdaymask[c]=1)}}}this.lastyear=t,this.lastmonth=e},t.prototype.ydayset=function(){return[Object(i.j)(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e,n){for(var r=this.mrange[e-1],o=this.mrange[e],a=Object(i.k)(null,this.yearlen),s=r;s<o;s++)a[s]=s;return[a,r,o]},t.prototype.wdayset=function(t,e,n){for(var r=Object(i.k)(null,this.yearlen+7),o=s.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal,a=o,h=0;h<7&&(r[o]=o,++o,this.wdaymask[o]!==this.rrule.options.wkst);h++);return[r,a,o]},t.prototype.ddayset=function(t,e,n){var r=Object(i.k)(null,this.yearlen),o=s.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal;return r[o]=o,[r,o,o+1]},t.prototype.htimeset=function(t,e,n,r){for(var i=[],o=this.rrule,a=0;a<o.options.byminute.length;a++){e=o.options.byminute[a];for(var h=0;h<o.options.bysecond.length;h++)n=o.options.bysecond[h],i.push(new s.Time(t,e,n,r))}return s.sort(i),i},t.prototype.mtimeset=function(t,e,n,r){for(var i=[],o=this.rrule,a=0;a<o.options.bysecond.length;a++)n=o.options.bysecond[a],i.push(new s.Time(t,e,n,r));return s.sort(i),i},t.prototype.stimeset=function(t,e,n,r){return[new s.Time(t,e,n,r)]},t}(),j=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;case"before":case"after":return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}(),Y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.iterator=r,i}return Y(e,t),e.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},e}(j);!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"}(a||(a={}));var x=["MO","TU","WE","TH","FR","SA","SU"],S=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.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=x[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}();function L(t){var e=[],n={};if(Object.keys(t).forEach(function(r){n[r]=t[r],Object(i.c)(W,r)||e.push(r)}),e.length)throw new Error("Invalid options: "+e.join(", "));return n}function U(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e={},n=/^DTSTART;TZID=(.+?):([^;]+)$/.exec(t);if(n){n[0];var r=n[1],i=n[2];return e.tzid=r,e.dtstart=s.untilStringToDate(i),e}for(var o=t.split(";"),h=0;h<o.length;h++){var u=o[h].split("="),c=u[0],l=u[1];switch(c){case"FREQ":e.freq=a[l];break;case"WKST":e.wkst=I[l];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var d=void 0;if(-1!==l.indexOf(","))d=l.split(",").map(function(t){return/^[+-]?\d+$/.test(t.toString())?Number(t):t});else d=/^[+-]?\d+$/.test(l)?Number(l):l;e[c.toLowerCase()]=d;break;case"BYDAY":var y=void 0,f=void 0,b=void 0,p=l.split(",");e.byweekday=[];for(var m=0;m<p.length;m++)if(2===(b=p[m]).length)f=I[b],e.byweekday.push(f);else{var w=b.match(/^([+-]?\d)([A-Z]{2})$/);y=Number(w[1]);var O=w[2];f=I[O].weekday,e.byweekday.push(new S(f,y))}break;case"DTSTART":e.dtstart=s.untilStringToDate(l);break;case"UNTIL":e.until=s.untilStringToDate(l);break;case"BYEASTER":e.byeaster=Number(l);break;default:throw new Error("Unknown RRULE property '"+c+"'")}}return e}function R(t){for(var e=[],n=Object.keys(t),r=Object.keys(C),o=0;o<n.length;o++)if("tzid"!==n[o]&&Object(i.c)(r,n[o])){var a=n[o].toUpperCase(),h=t[n[o]],u="";if(Object(i.f)(h)&&(!Object(i.d)(h)||h.length)){switch(a){case"FREQ":u=H.FREQUENCIES[t.freq];break;case"WKST":u=Object(i.e)(h)?new S(h).toString():h.toString();break;case"BYWEEKDAY":a="BYDAY";Object(i.m)(h);u=Object(i.m)(h).map(function(t){return t instanceof S?t:Object(i.d)(t)?new S(t[0],t[1]):new S(t)}).toString();break;case"DTSTART":case"UNTIL":u=s.timeToUntilString(h,!t.tzid),t.tzid&&(u=";TZID="+t.tzid+":"+u);break;default:if(Object(i.d)(h)){for(var c=[],l=0;l<h.length;l++)c[l]=String(h[l]);u=c.toString()}else u=String(h)}e.push([a,u])}}var d=[];for(o=0;o<e.length;o++){var y=e[o];a=y[0];0===(h=y[1]).indexOf(";")?d.push(""+a+h):d.push(a+"="+h.toString())}return d.join(";")}var M=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?s.clone(e):s.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):[],o=function(t){for(var n=0;n<r.length;n++){var i=r[n];if(String(e[i])!==String(t[i]))return!0}return!1},a=this[t];if("all"===t)n=this.all;else if(Object(i.d)(a))for(var h=0;h<a.length;h++){var u=a[h];if(!r.length||!o(u)){n=u._value;break}}if(!n&&this.all){var c=new j(t,e);for(h=0;h<this.all.length&&c.accept(this.all[h]);h++);n=c.getValue(),this._cacheAdd(t,n,e)}return Object(i.d)(n)?s.cloneDates(n):n instanceof Date?s.clone(n):n},t}(),A=n(2),N=function(){return N._nlp||(N._nlp=n(3)),N._nlp},I={MO:new S(0),TU:new S(1),WE:new S(2),TH:new S(3),FR:new S(4),SA:new S(5),SU:new S(6)},C={freq:a.YEARLY,dtstart:null,interval:1,wkst:I.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},W=Object.keys(C),H=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._string=null,this._cache=e?null:new M,this.origOptions=L(t);var n=function(t){var e=L(t),n=Object.keys(t);if(W.forEach(function(t){Object(i.c)(n,t)||(e[t]=C[t])}),Object(i.f)(e.byeaster)&&(e.freq=H.YEARLY),!Object(i.f)(e.freq)||!H.FREQUENCIES[e.freq])throw new Error("Invalid frequency: "+e.freq);e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0)));var r,o=e.dtstart.getTime()%1e3;if(Object(i.f)(e.wkst)?Object(i.e)(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=H.MO.weekday,Object(i.f)(e.bysetpos)){Object(i.e)(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var a=0;a<e.bysetpos.length;a++)if(0===(c=e.bysetpos[a])||!(c>=-366&&c<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}if(!(Boolean(e.byweekno)||Object(i.g)(e.byweekno)||Object(i.g)(e.byyearday)||Boolean(e.bymonthday)||Object(i.g)(e.bymonthday)||Object(i.f)(e.byweekday)||Object(i.f)(e.byeaster)))switch(e.freq){case H.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case H.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case H.WEEKLY:e.byweekday=[s.getWeekday(e.dtstart)]}if(Object(i.f)(e.bymonth)&&!Object(i.d)(e.bymonth)&&(e.bymonth=[e.bymonth]),Object(i.f)(e.byyearday)&&!Object(i.d)(e.byyearday)&&Object(i.e)(e.byyearday)&&(e.byyearday=[e.byyearday]),Object(i.f)(e.bymonthday))if(Object(i.d)(e.bymonthday)){var h=[],u=[];for(a=0;a<e.bymonthday.length;a++){var c;(c=e.bymonthday[a])>0?h.push(c):c<0&&u.push(c)}e.bymonthday=h,e.bynmonthday=u}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(Object(i.f)(e.byweekno)&&!Object(i.d)(e.byweekno)&&(e.byweekno=[e.byweekno]),Object(i.f)(e.byweekday))if(Object(i.e)(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(e.byweekday instanceof S)!e.byweekday.n||e.freq>H.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var l=[],d=[];for(a=0;a<e.byweekday.length;a++){var y=e.byweekday[a];if(Object(i.e)(y))l.push(y);else{var f=y;!f.n||e.freq>H.MONTHLY?l.push(f.weekday):d.push([f.weekday,f.n])}}e.byweekday=Object(i.g)(l)?l:null,e.bynweekday=Object(i.g)(d)?d:null}else e.bynweekday=null;if(Object(i.f)(e.byhour)?Object(i.e)(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<H.HOURLY?[e.dtstart.getUTCHours()]:null,Object(i.f)(e.byminute)?Object(i.e)(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<H.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Object(i.f)(e.bysecond)?Object(i.e)(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<H.SECONDLY?[e.dtstart.getUTCSeconds()]:null,e.freq>=H.HOURLY)r=null;else{for(r=[],a=0;a<e.byhour.length;a++)for(var b=e.byhour[a],p=0;p<e.byminute.length;p++)for(var m=e.byminute[p],w=0;w<e.bysecond.length;w++){var O=e.bysecond[w];r.push(new s.Time(b,m,O,o))}s.sort(r)}return{parsedOptions:e,timeset:r}}(t),r=n.parsedOptions,o=n.timeset;this.options=r,this.timeset=o}return t.parseText=function(t,e){return N().parseText(t,e)},t.fromText=function(t,e){return N().fromText(t,e)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},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 D("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new j("all",{})),this._cacheAdd("all",e)),e},t.prototype.between=function(t,e,n,r){void 0===n&&(n=!1);var i={before:e,after:t,inc:n};if(r)return this._iter(new D("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new j("between",i)),this._cacheAdd("between",o,i)),o},t.prototype.before=function(t,e){void 0===e&&(e=!1);var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new j("before",n)),this._cacheAdd("before",r,n)),r},t.prototype.after=function(t,e){void 0===e&&(e=!1);var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new j("after",n)),this._cacheAdd("after",r,n)),r},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return R(this.origOptions)},t.prototype.toText=function(t,e){return N().toText(this,t,e)},t.prototype.isFullyConvertibleToText=function(){return N().isFullyConvertible(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.prototype._iter=function(e){var n,r,o=this.options.dtstart,a=new s.DateTime(o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate(),o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.valueOf()%1e3),h=this.options,u=h.freq,c=h.interval,l=h.wkst,d=h.until,y=h.bymonth,f=h.byweekno,b=h.byyearday,p=h.byweekday,m=h.byeaster,w=h.bymonthday,O=h.bynmonthday,g=h.bysetpos,k=h.byhour,v=h.byminute,E=h.bysecond,T=new _(this);T.rebuild(a.year,a.month);var j,Y,D,x=(n={},n[t.YEARLY]=T.ydayset,n[t.MONTHLY]=T.mdayset,n[t.WEEKLY]=T.wdayset,n[t.DAILY]=T.ddayset,n[t.HOURLY]=T.ddayset,n[t.MINUTELY]=T.ddayset,n[t.SECONDLY]=T.ddayset,n)[u];u<t.HOURLY?j=this.timeset:(Y=(r={},r[t.HOURLY]=T.htimeset,r[t.MINUTELY]=T.mtimeset,r[t.SECONDLY]=T.stimeset,r)[u],j=u>=t.HOURLY&&Object(i.g)(k)&&!Object(i.c)(k,a.hour)||u>=t.MINUTELY&&Object(i.g)(v)&&!Object(i.c)(v,a.minute)||u>=t.SECONDLY&&Object(i.g)(E)&&!Object(i.c)(E,a.second)?[]:Y.call(T,a.hour,a.minute,a.second,a.millisecond));for(var S,L=this.options.count;;){for(var U=x.call(T,a.year,a.month,a.day),R=U[0],M=U[1],A=U[2],N=!1,I=M;I<A;I++)(N=q(y,T,D=R[I],f,p,m,w,O,b))&&(R[D]=null);if(Object(i.g)(g)&&Object(i.g)(j)){for(var C=void 0,W=void 0,H=[],F=0;F<g.length;F++){(S=g[F])<0?(C=Math.floor(S/j.length),W=Object(i.i)(S,j.length)):(C=Math.floor((S-1)/j.length),W=Object(i.i)(S-1,j.length));for(var B=[],P=M;P<A;P++){var K=R[P];Object(i.f)(K)&&B.push(K)}var z=void 0;z=C<0?B.slice(C)[0]:B[C];var Z=j[W],V=s.fromOrdinal(T.yearordinal+z),X=s.combine(V,Z);Object(i.c)(H,X)||H.push(X)}s.sort(H);for(F=0;F<H.length;F++){X=H[F];if(d&&X>d)return this.emitResult(e);if(X>=o){var $=this.rezoneIfNeeded(X);if(!e.accept($))return this.emitResult(e);if(L&&!--L)return this.emitResult(e)}}}else for(F=M;F<A;F++)if(D=R[F],Object(i.f)(D)){var J=s.fromOrdinal(T.yearordinal+D);for(P=0;P<j.length;P++){Z=j[P],X=s.combine(J,Z);if(d&&X>d)return this.emitResult(e);if(X>=o){$=this.rezoneIfNeeded(X);if(!e.accept($))return this.emitResult(e);if(L&&!--L)return this.emitResult(e)}}}if(u===t.YEARLY?a.addYears(c):u===t.MONTHLY?a.addMonths(c):u===t.WEEKLY?a.addWeekly(c,l):u===t.DAILY?a.addDaily(c):u===t.HOURLY?(a.addHours(c,N,k),j=Y.call(T,a.hour,a.minute,a.second)):u===t.MINUTELY?(a.addMinutes(c,N,k,v)&&(N=!1),j=Y.call(T,a.hour,a.minute,a.second)):u===t.SECONDLY&&(a.addSeconds(c,N,k,v,E)&&(N=!1),j=Y.call(T,a.hour,a.minute,a.second)),a.year>s.MAXYEAR)return this.emitResult(e);T.rebuild(a.year,a.month)}},t.prototype.emitResult=function(t){return this._len=t.total,t.getValue()},t.prototype.rezoneIfNeeded=function(t){var e=this.options.tzid;if(!e)return t;try{return A.DateTime.fromJSDate(t).setZone(e,{keepLocalTime:!0}).toJSDate()}catch(e){return e instanceof TypeError&&console.error("Using TZID without Luxon available is unsupported. Returned times are in UTC, not the requested time zone"),t}},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=a.YEARLY,t.MONTHLY=a.MONTHLY,t.WEEKLY=a.WEEKLY,t.DAILY=a.DAILY,t.HOURLY=a.HOURLY,t.MINUTELY=a.MINUTELY,t.SECONDLY=a.SECONDLY,t.MO=I.MO,t.TU=I.TU,t.WE=I.WE,t.TH=I.TH,t.FR=I.FR,t.SA=I.SA,t.SU=I.SU,t.parseString=U,t.optionsToString=R,t}();function q(t,e,n,r,o,a,s,h,u){return Object(i.g)(t)&&!Object(i.c)(t,e.mmask[n])||Object(i.g)(r)&&!e.wnomask[n]||Object(i.g)(o)&&!Object(i.c)(o,e.wdaymask[n])||Object(i.g)(e.nwdaymask)&&!e.nwdaymask[n]||null!==a&&!Object(i.c)(e.eastermask,n)||(Object(i.g)(s)||Object(i.g)(h))&&!Object(i.c)(s,e.mdaymask[n])&&!Object(i.c)(h,e.nmdaymask[n])||Object(i.g)(u)&&(n<e.yearlen&&!Object(i.c)(u,n+1)&&!Object(i.c)(u,-e.yearlen+n)||n>=e.yearlen&&!Object(i.c)(u,n+1-e.yearlen)&&!Object(i.c)(u,-e.nextyearlen+n-e.yearlen))}var F=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),B=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this,{},e)||this;return n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return F(e,t),e.prototype.rrule=function(t){if(!(t instanceof H))throw new TypeError(String(t)+" is not RRule instance");Object(i.c)(this._rrule.map(String),String(t))||this._rrule.push(t)},e.prototype.rdate=function(t){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");Object(i.c)(this._rdate.map(Number),Number(t))||(this._rdate.push(t),s.sort(this._rdate))},e.prototype.exrule=function(t){if(!(t instanceof H))throw new TypeError(String(t)+" is not RRule instance");Object(i.c)(this._exrule.map(String),String(t))||this._exrule.push(t)},e.prototype.exdate=function(t){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");Object(i.c)(this._exdate.map(Number),Number(t))||(this._exdate.push(t),s.sort(this._exdate))},e.prototype.valueOf=function(){var t=[];return this._rrule.length&&this._rrule.forEach(function(e){t.push("RRULE:"+e)}),this._rdate.length&&t.push("RDATE:"+this._rdate.map(function(t){return s.timeToUntilString(t.valueOf())}).join(",")),this._exrule.length&&this._exrule.forEach(function(e){t.push("EXRULE:"+e)}),this._exdate.length&&t.push("EXDATE:"+this._exdate.map(function(t){return s.timeToUntilString(t.valueOf())}).join(",")),t},e.prototype.toString=function(){return JSON.stringify(this.valueOf())},e.prototype._iter=function(t){var e={},n=this._exrule,r=t.accept;function i(t,r){n.forEach(function(n){n.between(t,r,!0).forEach(function(t){e[Number(t)]=!0})})}this._exdate.forEach(function(t){e[Number(t)]=!0}),t.accept=function(t){var n=Number(t);return!(!e[n]&&(i(new Date(n-1),new Date(n+1)),!e[n]))||(e[n]=!0,r.call(this,t))},"between"===t.method&&(i(t.args.after,t.args.before),t.accept=function(t){var n=Number(t);return!!e[n]||(e[n]=!0,r.call(this,t))});for(var o=0;o<this._rdate.length&&t.accept(new Date(this._rdate[o].valueOf()));o++);this._rrule.forEach(function(e){e._iter(t)});var a=t._result;switch(s.sort(a),t.method){case"all":case"between":return a;case"before":return a.length&&a[a.length-1]||null;case"after":return a.length&&a[0]||null;default:return null}},e.prototype.clone=function(){var t,n=new e(!!this._cache);for(t=0;t<this._rrule.length;t++)n.rrule(this._rrule[t].clone());for(t=0;t<this._rdate.length;t++)n.rdate(new Date(this._rdate[t].valueOf()));for(t=0;t<this._exrule.length;t++)n.exrule(this._exrule[t].clone());for(t=0;t<this._exdate.length;t++)n.exdate(new Date(this._exdate[t].valueOf()));return n},e}(H),P=function(){function t(){this._handle_BYDAY=this._handle_BYWEEKDAY,this._handle_INTERVAL=this._handle_int,this._handle_COUNT=this._handle_int,this._handle_BYSETPOS=this._handle_int_list,this._handle_BYMONTH=this._handle_int_list,this._handle_BYMONTHDAY=this._handle_int_list,this._handle_BYYEARDAY=this._handle_int_list,this._handle_BYEASTER=this._handle_int_list,this._handle_BYWEEKNO=this._handle_int_list,this._handle_BYHOUR=this._handle_int_list,this._handle_BYMINUTE=this._handle_int_list,this._handle_BYSECOND=this._handle_int_list}return t.prototype._handle_DTSTART=function(t,e,n,r){var i=/^DTSTART(?:;TZID=([^:=]+))?(?::|=)(.*)/.exec(n),o=(i[0],i[1]),a=i[2];t.dtstart=s.untilStringToDate(a),o&&(t.tzid=o)},t.prototype._handle_int=function(t,e,n){t[e.toLowerCase()]=parseInt(n,10)},t.prototype._handle_int_list=function(t,e,n){t[e.toLowerCase()]=n.split(",").map(function(t){return parseInt(t,10)})},t.prototype._handle_FREQ=function(e,n,r,i){e.freq=t._freq_map[r]},t.prototype._handle_UNTIL=function(t,e,n,r){try{t.until=s.untilStringToDate(n)}catch(t){throw new Error("invalid until date")}},t.prototype._handle_WKST=function(e,n,r,i){e.wkst=t._weekday_map[r]},t.prototype._handle_BYWEEKDAY=function(e,n,r,i){var o,a,s,h,u,c,l=[],d=r.split(",");for(a=0;a<d.length;a++){if((c=d[a]).indexOf("(")>-1)u=(o=c.split("("))[0],h=parseInt(o.slice(1,-1)[0],10);else{for(s=0;s<c.length&&-1!=="+-0123456789".indexOf(c[s]);s++);h=c.slice(0,s)||null,u=c.slice(s),h&&(h=parseInt(h,10))}var y=new S(t._weekday_map[u],h);l.push(y)}e.byweekday=l},t.prototype._parseRfcRRule=function(t,e){var n,r,i;void 0===e&&(e={}),e.dtstart=e.dtstart||null,e.cache=e.cache||!1;var o=/^([A-Z]+):(.*)$/.exec(t);if(o&&o.length>=3){if(n=o[1],r=o[2],"RRULE"!==n)throw new Error("unknown parameter name "+n)}else r=t;var a={},s=/DTSTART(?:;TZID=[^:]+:)?[^;]+/.exec(t);if(s&&s.length>0){var h=s[0];this._handle_DTSTART(a,"DTSTART",h)}for(var u=r.split(";"),c=0;c<u.length;c++)if(n=(i=u[c].split("="))[0].toUpperCase(),!/DTSTART|TZID/.test(n)){r=i[1].toUpperCase();var l=this["_handle_"+n];if("function"!=typeof l)throw new Error("unknown parameter '"+n+"':"+r);l(a,n,r)}return a.dtstart=a.dtstart||e.dtstart,a.tzid=a.tzid||e.tzid,new H(a,!e.cache)},t.prototype._parseRfc=function(t,e){if(e.compatible&&(e.forceset=!0,e.unfold=!0),!(t=t&&t.trim()))throw new Error("Invalid empty string");var n,r,o=0;if(e.unfold)for(r=t.split("\n");o<r.length;)(n=r[o]=r[o].replace(/\s+$/g,""))?o>0&&" "===n[0]?(r[o-1]+=n.slice(1),r.splice(o,1)):o+=1:r.splice(o,1);else r=t.split(/\s/);var a,h,u,c,l,d,y,f,b,p,m=[],w=[],O=[],g=[];if(e.forceset||1!==r.length||-1!==t.indexOf(":")&&0!==t.indexOf("RRULE:")){for(var k=0;k<r.length;k++)if(n=r[k]){-1===n.indexOf(":")?(a="RRULE",h=n):(a=(u=Object(i.l)(n,":",1))[0],h=u[1]);var v=a.split(";");if(!v)throw new Error("empty property name");if(a=v[0].toUpperCase(),v=v.slice(1),"RRULE"===a){for(y=0;y<v.length;y++){var E=v[y];throw new Error("unsupported RRULE parm: "+E)}m.push(h)}else if("RDATE"===a){for(y=0;y<v.length;y++){if("VALUE=DATE-TIME"!==(E=v[y])&&"VALUE=DATE"!==E)throw new Error("unsupported RDATE parm: "+E)}w.push(h)}else if("EXRULE"===a){for(y=0;y<v.length;y++){E=v[y];throw new Error("unsupported EXRULE parm: "+E)}O.push(h)}else if("EXDATE"===a){for(y=0;y<v.length;y++){if("VALUE=DATE-TIME"!==(E=v[y])&&"VALUE=DATE"!==E)throw new Error("unsupported EXDATE parm: "+E)}g.push(h)}else{if("DTSTART"!==a)throw new Error("unsupported property: "+a);if(c=s.untilStringToDate(h),v.length){var T=v[0].split("="),_=T[0],j=T[1];"TZID"===_&&(l=j)}}}if(e.forceset||m.length>1||w.length||O.length||g.length){for(d=new B(!e.cache),y=0;y<m.length;y++)d.rrule(this._parseRfcRRule(m[y],{dtstart:e.dtstart||c}));for(y=0;y<w.length;y++)for(b=w[y].split(","),f=0;f<b.length;f++)p=b[f],d.rdate(s.untilStringToDate(p));for(y=0;y<O.length;y++)d.exrule(this._parseRfcRRule(O[y],{dtstart:e.dtstart||c}));for(y=0;y<g.length;y++)for(b=g[y].split(","),f=0;f<b.length;f++)p=b[f],d.exdate(s.untilStringToDate(p));return e.compatible&&e.dtstart&&d.rdate(c),d}return this._parseRfcRRule(m[0],{dtstart:e.dtstart||c,cache:e.cache,tzid:e.tzid||l})}return this._parseRfcRRule(r[0],{cache:e.cache,dtstart:e.dtstart})},t.prototype.parse=function(e,n){void 0===n&&(n={});var r=[],o=Object.keys(n),a=Object.keys(t.DEFAULT_OPTIONS);if(o.forEach(function(t){Object(i.c)(a,t)||r.push(t)},this),r.length)throw new Error("Invalid options: "+r.join(", "));return a.forEach(function(e){Object(i.c)(o,e)||(n[e]=t.DEFAULT_OPTIONS[e])}),this._parseRfc(e,n)},t._weekday_map={MO:0,TU:1,WE:2,TH:3,FR:4,SA:5,SU:6},t._freq_map={YEARLY:H.YEARLY,MONTHLY:H.MONTHLY,WEEKLY:H.WEEKLY,DAILY:H.DAILY,HOURLY:H.HOURLY,MINUTELY:H.MINUTELY,SECONDLY:H.SECONDLY},t.DEFAULT_OPTIONS={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null},t}();n.d(e,"rrulestr",function(){return z}),n.d(e,"Frequency",function(){return a}),n.d(e,"Weekday",function(){return S}),n.d(e,"RRule",function(){return H}),n.d(e,"RRuleSet",function(){return B}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("luxon")):"function"==typeof define&&define.amd?define(["luxon"],e):"object"==typeof exports?exports.rrule=e(require("luxon")):t.rrule=e(t.luxon)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";n.d(e,"f",function(){return r}),n.d(e,"e",function(){return i}),n.d(e,"d",function(){return o}),n.d(e,"j",function(){return a}),n.d(e,"k",function(){return s}),n.d(e,"m",function(){return u}),n.d(e,"h",function(){return c}),n.d(e,"l",function(){return h}),n.d(e,"i",function(){return d}),n.d(e,"a",function(){return l}),n.d(e,"b",function(){return y}),n.d(e,"g",function(){return f}),n.d(e,"c",function(){return b});var r=function(t){return null!==t&&void 0!==t},i=function(t){return"number"==typeof t},o=Array.isArray,a=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},s=function(t,e){var n=0,r=[];if(o(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r},u=function(t){return o(t)?t:[t]};function c(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+=s(n,e/n.length)),n.slice(0,e)+String(r))}var h=function(t,e,n){var r=t.split(e);return n?r.slice(0,n).concat([r.slice(n).join(e)]):r},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)}},y=function(t){return!r(t)||0===t.length},f=function(t){return!y(t)},b=function(t,e){return f(t)&&-1!==t.indexOf(e)}},function(t,e,n){"use strict";n.r(e);var r,i=n(0),o=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!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.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[Object(i.h)(n.getUTCFullYear().toString(),4,"0"),Object(i.h)(n.getUTCMonth()+1,2,"0"),Object(i.h)(n.getUTCDate(),2,"0"),"T",Object(i.h)(n.getUTCHours(),2,"0"),Object(i.h)(n.getUTCMinutes(),2,"0"),Object(i.h)(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: "+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))};var e=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}();t.Time=e;var n=function(e){function n(t,n,r,i,o,a,s){var u=e.call(this,i,o,a,s)||this;return u.year=t,u.month=n,u.day=r,u}return o(n,e),n.prototype.getWeekday=function(){return t.getWeekday(new Date(this.getTime()))},n.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},n.prototype.getDay=function(){return this.day},n.prototype.getMonth=function(){return this.month},n.prototype.getYear=function(){return this.year},n.prototype.addYears=function(t){this.year+=t},n.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var e=Math.floor(this.month/12),n=Object(i.i)(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},n.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()},n.prototype.addDaily=function(t){this.day+=t,this.fixDay()},n.prototype.addHours=function(t,e,n){var r=!1;for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var o=Object(i.a)(this.hour,24),a=o.div,s=o.mod;if(a&&(this.hour=s,this.addDaily(a),r=!0),Object(i.b)(n)||Object(i.c)(n,this.hour))break}return r},n.prototype.addMinutes=function(t,e,n,r){var o=!1;for(e&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var a=Object(i.a)(this.minute,60),s=a.div,u=a.mod;if(s&&(this.minute=u,o=this.addHours(s,!1,n)),(Object(i.b)(n)||Object(i.c)(n,this.hour))&&(Object(i.b)(r)||Object(i.c)(r,this.minute)))break}return o},n.prototype.addSeconds=function(t,e,n,r,o){var a=!1;for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var s=Object(i.a)(this.second,60),u=s.div,c=s.mod;if(u&&(this.second=c,a=this.addMinutes(u,!1,n,r)),(Object(i.b)(n)||Object(i.c)(n,this.hour))&&(Object(i.b)(r)||Object(i.c)(r,this.minute))&&(Object(i.b)(o)||Object(i.c)(o,this.second)))break}return a},n.prototype.fixDay=function(){if(!(this.day<=28)){var e=t.monthRange(this.year,this.month-1)[1];if(!(this.day<=e))for(;this.day>e;){if(this.day-=e,++this.month,13===this.month&&(this.month=1,++this.year,this.year>t.MAXYEAR))return;e=t.monthRange(this.year,this.month-1)[1]}}},n}(e);t.DateTime=n}(r||(r={}));var a,s=r,u=Object(i.k)(1,31).concat(Object(i.k)(2,28),Object(i.k)(3,31),Object(i.k)(4,30),Object(i.k)(5,31),Object(i.k)(6,30),Object(i.k)(7,31),Object(i.k)(8,31),Object(i.k)(9,30),Object(i.k)(10,31),Object(i.k)(11,30),Object(i.k)(12,31),Object(i.k)(1,7)),c=Object(i.k)(1,31).concat(Object(i.k)(2,29),Object(i.k)(3,31),Object(i.k)(4,30),Object(i.k)(5,31),Object(i.k)(6,30),Object(i.k)(7,31),Object(i.k)(8,31),Object(i.k)(9,30),Object(i.k)(10,31),Object(i.k)(11,30),Object(i.k)(12,31),Object(i.k)(1,7)),h=Object(i.j)(1,29),d=Object(i.j)(1,30),l=Object(i.j)(1,31),y=Object(i.j)(1,32),f=y.concat(d,y,l,y,l,y,y,l,y,l,y,y.slice(0,7)),b=y.concat(h,y,l,y,l,y,y,l,y,l,y,y.slice(0,7)),p=Object(i.j)(-28,0),m=Object(i.j)(-29,0),w=Object(i.j)(-30,0),O=Object(i.j)(-31,0),v=O.concat(m,O,w,O,w,O,O,w,O,w,O,O.slice(0,7)),k=O.concat(p,O,w,O,w,O,O,w,O,w,O,O.slice(0,7)),g=[0,31,60,91,121,152,182,213,244,274,305,335,366],j=[0,31,59,90,120,151,181,212,243,273,304,334,365],E=function(){for(var t=[],e=0;e<55;e++)t=t.concat(Object(i.j)(7));return t}(),T=function(){function t(t){this.yearlen=365,this.nextyearlen=365,this.rrule=t,this.mmask=null,this.mrange=null,this.mdaymask=null,this.nmdaymask=null,this.wdaymask=null,this.wnomask=null,this.nwdaymask=null,this.eastermask=null}return t.prototype.easter=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),c=Math.floor(19*n+r-o-u+15)%30,h=Math.floor(i/4),d=i%4,l=Math.floor(32+2*a+2*h-c-d)%7,y=Math.floor((n+11*c+22*l)/451),f=Math.floor((c+l-7*y+114)/31),b=(c+l-7*y+114)%31+1,p=Date.UTC(t,f-1,b+e),m=Date.UTC(t,0,1);return[Math.ceil((p-m)/864e5)]},t.prototype.rebuild=function(t,e){var n=this.rrule;t!==this.lastyear&&this.rebuildYear(t),!Object(i.g)(n.options.bynweekday)||e===this.lastmonth&&t===this.lastyear||this.rebuildMonth(t,e),Object(i.f)(n.options.byeaster)&&(this.eastermask=this.easter(t,n.options.byeaster))},t.prototype.rebuildYear=function(t){var e=this.rrule;this.yearlen=s.isLeapYear(t)?366:365,this.nextyearlen=s.isLeapYear(t+1)?366:365;var n=new Date(Date.UTC(t,0,1));this.yearordinal=s.toOrdinal(n),this.yearweekday=s.getWeekday(n);var r=s.getWeekday(n);if(365===this.yearlen?(this.mmask=u,this.mdaymask=b,this.nmdaymask=k,this.wdaymask=E.slice(r),this.mrange=j):(this.mmask=c,this.mdaymask=f,this.nmdaymask=v,this.wdaymask=E.slice(r),this.mrange=g),Object(i.b)(e.options.byweekno))this.wnomask=null;else{this.wnomask=Object(i.k)(0,this.yearlen+7);var o,a=void 0,h=void 0;(a=o=Object(i.i)(7-this.yearweekday+e.options.wkst,7))>=4?(a=0,h=this.yearlen+Object(i.i)(this.yearweekday-e.options.wkst,7)):h=this.yearlen-a;for(var d=Math.floor(h/7),l=Object(i.i)(h,7),y=Math.floor(d+l/4),p=0;p<e.options.byweekno.length;p++){var m=void 0,w=e.options.byweekno[p];if(w<0&&(w+=y+1),w>0&&w<=y){w>1?(m=a+7*(w-1),a!==o&&(m-=7-o)):m=a;for(var O=0;O<7&&(this.wnomask[m]=1,m++,this.wdaymask[m]!==e.options.wkst);O++);}}if(Object(i.c)(e.options.byweekno,1)){m=a+7*y;if(a!==o&&(m-=7-o),m<this.yearlen)for(p=0;p<7&&(this.wnomask[m]=1,m+=1,this.wdaymask[m]!==e.options.wkst);p++);}if(a){var T=void 0;if(Object(i.c)(e.options.byweekno,-1))T=-1;else{var x=s.getWeekday(new Date(Date.UTC(t-1,0,1))),D=Object(i.i)(7-x.valueOf()+e.options.wkst,7),Y=s.isLeapYear(t-1)?366:365;D>=4?(D=0,T=Math.floor(52+Object(i.i)(Y+Object(i.i)(x-e.options.wkst,7),7)/4)):T=Math.floor(52+Object(i.i)(this.yearlen-a,7)/4)}if(Object(i.c)(e.options.byweekno,T))for(m=0;m<a;m++)this.wnomask[m]=1}}},t.prototype.rebuildMonth=function(t,e){var n=this.rrule,r=[];if(n.options.freq===B.YEARLY)if(Object(i.g)(n.options.bymonth))for(var o=0;o<n.options.bymonth.length;o++)e=n.options.bymonth[o],r.push(this.mrange.slice(e-1,e+1));else r=[[0,this.yearlen]];else n.options.freq===B.MONTHLY&&(r=[this.mrange.slice(e-1,e+1)]);if(Object(i.g)(r)){this.nwdaymask=Object(i.k)(0,this.yearlen);for(o=0;o<r.length;o++){var a=r[o],s=a[0],u=a[1];u-=1;for(var c=0;c<n.options.bynweekday.length;c++){var h=void 0,d=n.options.bynweekday[c][0],l=n.options.bynweekday[c][1];l<0?(h=u+7*(l+1),h-=Object(i.i)(this.wdaymask[h]-d,7)):(h=s+7*(l-1),h+=Object(i.i)(7-this.wdaymask[h]+d,7)),s<=h&&h<=u&&(this.nwdaymask[h]=1)}}}this.lastyear=t,this.lastmonth=e},t.prototype.ydayset=function(){return[Object(i.j)(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e,n){for(var r=this.mrange[e-1],o=this.mrange[e],a=Object(i.k)(null,this.yearlen),s=r;s<o;s++)a[s]=s;return[a,r,o]},t.prototype.wdayset=function(t,e,n){for(var r=Object(i.k)(null,this.yearlen+7),o=s.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal,a=o,u=0;u<7&&(r[o]=o,++o,this.wdaymask[o]!==this.rrule.options.wkst);u++);return[r,a,o]},t.prototype.ddayset=function(t,e,n){var r=Object(i.k)(null,this.yearlen),o=s.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal;return r[o]=o,[r,o,o+1]},t.prototype.htimeset=function(t,e,n,r){for(var i=[],o=this.rrule,a=0;a<o.options.byminute.length;a++){e=o.options.byminute[a];for(var u=0;u<o.options.bysecond.length;u++)n=o.options.bysecond[u],i.push(new s.Time(t,e,n,r))}return s.sort(i),i},t.prototype.mtimeset=function(t,e,n,r){for(var i=[],o=this.rrule,a=0;a<o.options.bysecond.length;a++)n=o.options.bysecond[a],i.push(new s.Time(t,e,n,r));return s.sort(i),i},t.prototype.stimeset=function(t,e,n,r){return[new s.Time(t,e,n,r)]},t}(),x=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;case"before":case"after":return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}(),D=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.iterator=r,i}return D(e,t),e.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},e}(x);!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"}(a||(a={}));var S=["MO","TU","WE","TH","FR","SA","SU"],U=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.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=S[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}();function _(t){var e=[],n={};if(Object.keys(t).forEach(function(r){n[r]=t[r],Object(i.c)(K,r)||e.push(r)}),e.length)throw new Error("Invalid options: "+e.join(", "));return n}var L=function(){return(L=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}).apply(this,arguments)};function M(t){var e=t.split("\n").map(N).filter(function(t){return null!==t});return L({},e[0],e[1])}function R(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;n[0];var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=s.untilStringToDate(i),e}function N(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return A(t);e[0];var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return A(t);case"DTSTART":return R(t);default:throw new Error("Unsupported RFC prop "+n+" in "+t)}}function A(t){var e=R(t.replace(/^RRULE:/i,""));return t.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach(function(n){var r=n.split("="),i=r[0],o=r[1];switch(i.toUpperCase()){case"FREQ":e.freq=a[o.toUpperCase()];break;case"WKST":e.wkst=F[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var u=function(t){if(-1!==t.indexOf(",")){var e=t.split(",");return e.map(function(t){return/^[+-]?\d+$/.test(t.toString())?Number(t):t})}if(/^[+-]?\d+$/.test(t))return Number(t);return t}(o),c=i.toLowerCase();e[c]=u;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=function(t){return t.split(",").map(function(t){if(2===t.length)return F[t];var e=t.match(/^([+-]?\d)([A-Z]{2})$/),n=Number(e[1]),r=e[2],i=F[r].weekday;return new U(i,n)})}(o);break;case"DTSTART":case"TZID":var h=R(t);e.tzid=h.tzid,e.dtstart=h.dtstart;break;case"UNTIL":e.until=s.untilStringToDate(o);break;case"BYEASTER":e.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+i+"'")}}),e}var C=n(2),I=function(){function t(t,e){this.date=t,this.tzid=e}return t.prototype.toString=function(){var t=s.timeToUntilString(this.date.getTime(),!this.tzid);return this.tzid?";TZID="+this.tzid+":"+t:":"+t},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){if(!this.tzid)return this.date;try{return C.DateTime.fromJSDate(this.date).setZone(this.tzid,{keepLocalTime:!0}).toJSDate()}catch(t){return t instanceof TypeError&&console.error("Using TZID without Luxon available is unsupported. Returned times are in UTC, not the requested time zone"),this.date}},t}();function W(t){for(var e=[],n="",r=Object.keys(t),o=Object.keys(P),a=0;a<r.length;a++)if("tzid"!==r[a]&&Object(i.c)(o,r[a])){var u=r[a].toUpperCase(),c=t[r[a]],h="";if(Object(i.f)(c)&&(!Object(i.d)(c)||c.length)){switch(u){case"FREQ":h=B.FREQUENCIES[t.freq];break;case"WKST":h=Object(i.e)(c)?new U(c).toString():c.toString();break;case"BYWEEKDAY":u="BYDAY",h=Object(i.m)(c).map(function(t){return t instanceof U?t:Object(i.d)(t)?new U(t[0],t[1]):new U(t)}).toString();break;case"DTSTART":n=H(c,t.tzid);break;case"UNTIL":h=s.timeToUntilString(c,!t.tzid);break;default:if(Object(i.d)(c)){for(var d=[],l=0;l<c.length;l++)d[l]=String(c[l]);h=d.toString()}else h=String(c)}h&&e.push([u,h])}}var y=e.map(function(t){return t[0]+"="+t[1].toString()}).join(";"),f="";return""!==y&&(f="RRULE:"+y),[n,f].filter(function(t){return!!t}).join("\n")}function H(t,e){return t?"DTSTART"+new I(new Date(t),e).toString():""}var q=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?s.clone(e):s.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):[],o=function(t){for(var n=0;n<r.length;n++){var i=r[n];if(String(e[i])!==String(t[i]))return!0}return!1},a=this[t];if("all"===t)n=this.all;else if(Object(i.d)(a))for(var u=0;u<a.length;u++){var c=a[u];if(!r.length||!o(c)){n=c._value;break}}if(!n&&this.all){var h=new x(t,e);for(u=0;u<this.all.length&&h.accept(this.all[u]);u++);n=h.getValue(),this._cacheAdd(t,n,e)}return Object(i.d)(n)?s.cloneDates(n):n instanceof Date?s.clone(n):n},t}(),z=function(){return z._nlp||(z._nlp=n(3)),z._nlp},F={MO:new U(0),TU:new U(1),WE:new U(2),TH:new U(3),FR:new U(4),SA:new U(5),SU:new U(6)},P={freq:a.YEARLY,dtstart:null,interval:1,wkst:F.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},K=Object.keys(P),B=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._string=null,this._cache=e?null:new q,this.origOptions=_(t);var n=function(t){var e=_(t),n=Object.keys(t);if(K.forEach(function(t){Object(i.c)(n,t)&&Object(i.f)(e[t])||(e[t]=P[t])}),Object(i.f)(e.byeaster)&&(e.freq=B.YEARLY),!Object(i.f)(e.freq)||!B.FREQUENCIES[e.freq])throw new Error("Invalid frequency: "+e.freq+" "+t.freq);e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0)));var r,o=e.dtstart.getTime()%1e3;if(Object(i.f)(e.wkst)?Object(i.e)(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=B.MO.weekday,Object(i.f)(e.bysetpos)){Object(i.e)(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var a=0;a<e.bysetpos.length;a++)if(0===(h=e.bysetpos[a])||!(h>=-366&&h<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}if(!(Boolean(e.byweekno)||Object(i.g)(e.byweekno)||Object(i.g)(e.byyearday)||Boolean(e.bymonthday)||Object(i.g)(e.bymonthday)||Object(i.f)(e.byweekday)||Object(i.f)(e.byeaster)))switch(e.freq){case B.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case B.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case B.WEEKLY:e.byweekday=[s.getWeekday(e.dtstart)]}if(Object(i.f)(e.bymonth)&&!Object(i.d)(e.bymonth)&&(e.bymonth=[e.bymonth]),Object(i.f)(e.byyearday)&&!Object(i.d)(e.byyearday)&&Object(i.e)(e.byyearday)&&(e.byyearday=[e.byyearday]),Object(i.f)(e.bymonthday))if(Object(i.d)(e.bymonthday)){var u=[],c=[];for(a=0;a<e.bymonthday.length;a++){var h;(h=e.bymonthday[a])>0?u.push(h):h<0&&c.push(h)}e.bymonthday=u,e.bynmonthday=c}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(Object(i.f)(e.byweekno)&&!Object(i.d)(e.byweekno)&&(e.byweekno=[e.byweekno]),Object(i.f)(e.byweekday))if(Object(i.e)(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(e.byweekday instanceof U)!e.byweekday.n||e.freq>B.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var d=[],l=[];for(a=0;a<e.byweekday.length;a++){var y=e.byweekday[a];if(Object(i.e)(y))d.push(y);else{var f=y;!f.n||e.freq>B.MONTHLY?d.push(f.weekday):l.push([f.weekday,f.n])}}e.byweekday=Object(i.g)(d)?d:null,e.bynweekday=Object(i.g)(l)?l:null}else e.bynweekday=null;if(Object(i.f)(e.byhour)?Object(i.e)(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<B.HOURLY?[e.dtstart.getUTCHours()]:null,Object(i.f)(e.byminute)?Object(i.e)(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<B.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Object(i.f)(e.bysecond)?Object(i.e)(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<B.SECONDLY?[e.dtstart.getUTCSeconds()]:null,e.freq>=B.HOURLY)r=null;else{for(r=[],a=0;a<e.byhour.length;a++)for(var b=e.byhour[a],p=0;p<e.byminute.length;p++)for(var m=e.byminute[p],w=0;w<e.bysecond.length;w++){var O=e.bysecond[w];r.push(new s.Time(b,m,O,o))}s.sort(r)}return{parsedOptions:e,timeset:r}}(t),r=n.parsedOptions,o=n.timeset;this.options=r,this.timeset=o}return t.parseText=function(t,e){return z().parseText(t,e)},t.fromText=function(t,e){return z().fromText(t,e)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},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 Y("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new x("all",{})),this._cacheAdd("all",e)),e},t.prototype.between=function(t,e,n,r){void 0===n&&(n=!1);var i={before:e,after:t,inc:n};if(r)return this._iter(new Y("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new x("between",i)),this._cacheAdd("between",o,i)),o},t.prototype.before=function(t,e){void 0===e&&(e=!1);var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new x("before",n)),this._cacheAdd("before",r,n)),r},t.prototype.after=function(t,e){void 0===e&&(e=!1);var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new x("after",n)),this._cacheAdd("after",r,n)),r},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return W(this.origOptions)},t.prototype.toText=function(t,e){return z().toText(this,t,e)},t.prototype.isFullyConvertibleToText=function(){return z().isFullyConvertible(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.prototype._iter=function(e){var n,r,o=this.options.dtstart,a=new s.DateTime(o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate(),o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.valueOf()%1e3),u=this.options,c=u.freq,h=u.interval,d=u.wkst,l=u.until,y=u.bymonth,f=u.byweekno,b=u.byyearday,p=u.byweekday,m=u.byeaster,w=u.bymonthday,O=u.bynmonthday,v=u.bysetpos,k=u.byhour,g=u.byminute,j=u.bysecond,E=new T(this);E.rebuild(a.year,a.month);var x,D,Y,S=(n={},n[t.YEARLY]=E.ydayset,n[t.MONTHLY]=E.mdayset,n[t.WEEKLY]=E.wdayset,n[t.DAILY]=E.ddayset,n[t.HOURLY]=E.ddayset,n[t.MINUTELY]=E.ddayset,n[t.SECONDLY]=E.ddayset,n)[c];c<t.HOURLY?x=this.timeset:(D=(r={},r[t.HOURLY]=E.htimeset,r[t.MINUTELY]=E.mtimeset,r[t.SECONDLY]=E.stimeset,r)[c],x=c>=t.HOURLY&&Object(i.g)(k)&&!Object(i.c)(k,a.hour)||c>=t.MINUTELY&&Object(i.g)(g)&&!Object(i.c)(g,a.minute)||c>=t.SECONDLY&&Object(i.g)(j)&&!Object(i.c)(j,a.second)?[]:D.call(E,a.hour,a.minute,a.second,a.millisecond));for(var U,_=this.options.count;;){for(var L=S.call(E,a.year,a.month,a.day),M=L[0],R=L[1],N=L[2],A=!1,C=R;C<N;C++)(A=X(y,E,Y=M[C],f,p,m,w,O,b))&&(M[Y]=null);if(Object(i.g)(v)&&Object(i.g)(x)){for(var I=void 0,W=void 0,H=[],q=0;q<v.length;q++){(U=v[q])<0?(I=Math.floor(U/x.length),W=Object(i.i)(U,x.length)):(I=Math.floor((U-1)/x.length),W=Object(i.i)(U-1,x.length));for(var z=[],F=R;F<N;F++){var P=M[F];Object(i.f)(P)&&z.push(P)}var K=void 0;K=I<0?z.slice(I)[0]:z[I];var B=x[W],Z=s.fromOrdinal(E.yearordinal+K),G=s.combine(Z,B);Object(i.c)(H,G)||H.push(G)}s.sort(H);for(q=0;q<H.length;q++){G=H[q];if(l&&G>l)return this.emitResult(e);if(G>=o){var J=this.rezoneIfNeeded(G);if(!e.accept(J))return this.emitResult(e);if(_&&!--_)return this.emitResult(e)}}}else for(q=R;q<N;q++)if(Y=M[q],Object(i.f)(Y)){var $=s.fromOrdinal(E.yearordinal+Y);for(F=0;F<x.length;F++){B=x[F],G=s.combine($,B);if(l&&G>l)return this.emitResult(e);if(G>=o){J=this.rezoneIfNeeded(G);if(!e.accept(J))return this.emitResult(e);if(_&&!--_)return this.emitResult(e)}}}if(c===t.YEARLY?a.addYears(h):c===t.MONTHLY?a.addMonths(h):c===t.WEEKLY?a.addWeekly(h,d):c===t.DAILY?a.addDaily(h):c===t.HOURLY?(a.addHours(h,A,k),x=D.call(E,a.hour,a.minute,a.second)):c===t.MINUTELY?(a.addMinutes(h,A,k,g)&&(A=!1),x=D.call(E,a.hour,a.minute,a.second)):c===t.SECONDLY&&(a.addSeconds(h,A,k,g,j)&&(A=!1),x=D.call(E,a.hour,a.minute,a.second)),a.year>s.MAXYEAR)return this.emitResult(e);E.rebuild(a.year,a.month)}},t.prototype.emitResult=function(t){return this._len=t.total,t.getValue()},t.prototype.rezoneIfNeeded=function(t){return new I(t,this.options.tzid).rezonedDate()},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=a.YEARLY,t.MONTHLY=a.MONTHLY,t.WEEKLY=a.WEEKLY,t.DAILY=a.DAILY,t.HOURLY=a.HOURLY,t.MINUTELY=a.MINUTELY,t.SECONDLY=a.SECONDLY,t.MO=F.MO,t.TU=F.TU,t.WE=F.WE,t.TH=F.TH,t.FR=F.FR,t.SA=F.SA,t.SU=F.SU,t.parseString=M,t.optionsToString=W,t}();function X(t,e,n,r,o,a,s,u,c){return Object(i.g)(t)&&!Object(i.c)(t,e.mmask[n])||Object(i.g)(r)&&!e.wnomask[n]||Object(i.g)(o)&&!Object(i.c)(o,e.wdaymask[n])||Object(i.g)(e.nwdaymask)&&!e.nwdaymask[n]||null!==a&&!Object(i.c)(e.eastermask,n)||(Object(i.g)(s)||Object(i.g)(u))&&!Object(i.c)(s,e.mdaymask[n])&&!Object(i.c)(u,e.nmdaymask[n])||Object(i.g)(c)&&(n<e.yearlen&&!Object(i.c)(c,n+1)&&!Object(i.c)(c,-e.yearlen+n)||n>=e.yearlen&&!Object(i.c)(c,n+1-e.yearlen)&&!Object(i.c)(c,-e.nextyearlen+n-e.yearlen))}var Z=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),G=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this,{},e)||this;return n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return Z(e,t),e.prototype.tzid=function(){for(var t=0;t<this._rrule.length;t++){var e=this._rrule[t].origOptions.tzid;if(e)return e}},e.prototype.rrule=function(t){if(!(t instanceof B))throw new TypeError(String(t)+" is not RRule instance");Object(i.c)(this._rrule.map(String),String(t))||this._rrule.push(t)},e.prototype.rdate=function(t){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");Object(i.c)(this._rdate.map(Number),Number(t))||(this._rdate.push(t),s.sort(this._rdate))},e.prototype.exrule=function(t){if(!(t instanceof B))throw new TypeError(String(t)+" is not RRule instance");Object(i.c)(this._exrule.map(String),String(t))||this._exrule.push(t)},e.prototype.exdate=function(t){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");Object(i.c)(this._exdate.map(Number),Number(t))||(this._exdate.push(t),s.sort(this._exdate))},e.prototype.rdatesToString=function(t,e){var n=this,r=this.tzid();return""+(r?t+";TZID="+r+":":t+":")+e.map(function(t){return s.timeToUntilString(t.valueOf(),!n.tzid())}).join(",")},e.prototype.valueOf=function(){var t=[];return this._rrule.forEach(function(e){t=t.concat(e.toString().split("\n"))}),this._rdate.length&&t.push(this.rdatesToString("RDATE",this._rdate)),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._exdate.length&&t.push(this.rdatesToString("EXDATE",this._exdate)),t},e.prototype.toString=function(){return this.valueOf().join("\n")},e.prototype._iter=function(t){var e={},n=this._exrule,r=t.accept,i=this.tzid();function o(t,r){n.forEach(function(n){n.between(t,r,!0).forEach(function(t){e[Number(t)]=!0})})}this._exdate.forEach(function(t){var n=new I(t,i).rezonedDate();e[Number(n)]=!0}),t.accept=function(t){var n=Number(t);return!(!e[n]&&(o(new Date(n-1),new Date(n+1)),!e[n]))||(e[n]=!0,r.call(this,t))},"between"===t.method&&(o(t.args.after,t.args.before),t.accept=function(t){var n=Number(t);return!!e[n]||(e[n]=!0,r.call(this,t))});for(var a=0;a<this._rdate.length;a++){var u=new I(this._rdate[a],i).rezonedDate();if(!t.accept(new Date(u.getTime())))break}this._rrule.forEach(function(e){e._iter(t)});var c=t._result;switch(s.sort(c),t.method){case"all":case"between":return c;case"before":return c.length&&c[c.length-1]||null;case"after":return c.length&&c[0]||null;default:return null}},e.prototype.clone=function(){var t,n=new e(!!this._cache);for(t=0;t<this._rrule.length;t++)n.rrule(this._rrule[t].clone());for(t=0;t<this._rdate.length;t++)n.rdate(new Date(this._rdate[t].getTime()));for(t=0;t<this._exrule.length;t++)n.exrule(this._exrule[t].clone());for(t=0;t<this._exdate.length;t++)n.exdate(new Date(this._exdate[t].getTime()));return n},e}(B),J=function(){return(J=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}).apply(this,arguments)},$={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function Q(t,e){var n=[],r=[],o=[],a=[],s=R(t),u=s.dtstart,c=s.tzid;return 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).forEach(function(t){if(t){var e=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=Object(i.l)(t,":",1),n=e[0],r=e[1];return{name:n,value:r}}(t),n=e.name,r=e.value,o=n.split(";");if(!o)throw new Error("empty property name");return{name:o[0].toUpperCase(),parms:o.slice(1),value:r}}(t),s=e.name,u=e.parms,c=e.value;switch(s.toUpperCase()){case"RRULE":if(u.length)throw new Error("unsupported RRULE parm: "+u.join(","));n.push(M(t));break;case"RDATE":r=r.concat(et(c,u));break;case"EXRULE":if(u.length)throw new Error("unsupported EXRULE parm: "+u.join(","));o.push(M(c));break;case"EXDATE":a=a.concat(et(c,u));break;case"DTSTART":break;default:throw new Error("unsupported property: "+s)}}}),{dtstart:u,tzid:c,rrulevals:n,rdatevals:r,exrulevals:o,exdatevals:a}}function V(t,e){return void 0===e&&(e={}),function(t,e){var n=Q(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,u=n.tzid,c=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||r.length>1||i.length||o.length||a.length){var h=new G(c);return r.forEach(function(t){h.rrule(new B(tt(t,s,u),c))}),i.forEach(function(t){h.rdate(t)}),o.forEach(function(t){h.exrule(new B(tt(t,s,u),c))}),a.forEach(function(t){h.exdate(t)}),e.compatible&&e.dtstart&&h.rdate(s),h}var d=r[0];return new B(tt(d,d.dtstart||e.dtstart||s,d.tzid||e.tzid||u),c)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys($);if(n.forEach(function(t){Object(i.c)(r,t)||e.push(t)}),e.length)throw new Error("Invalid options: "+e.join(", "));var o=J({},t);return r.forEach(function(t){Object(i.c)(n,t)||(o[t]=$[t])}),o}(e))}function tt(t,e,n){return J({},t,{dtstart:e,tzid:n})}function et(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 s.untilStringToDate(t)})}n.d(e,"Frequency",function(){return a}),n.d(e,"Weekday",function(){return U}),n.d(e,"RRule",function(){return B}),n.d(e,"RRuleSet",function(){return G}),n.d(e,"rrulestr",function(){return V}); | ||
/*! | ||
@@ -16,4 +16,3 @@ * rrule.js - Library for working with recurrence rules for calendar dates. | ||
* | ||
*/ | ||
var K=new P,z=function(){return K.parse.apply(K,arguments)};e.default=H},function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e);var r={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}},i=n(1),o=n(0),a=function(t,e){return-1!==t.indexOf(e)},s=function(t){return t.toString()},h=function(){function t(t,e,n){if(void 0===e&&(e=s),void 0===n&&(n=r),this.text=[],this.language=n||r,this.gettext=e,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);i.sort(function(t,e){return t-e}),a.sort(function(t,e){return e-t}),this.bymonthday=i.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Object(o.f)(this.origOptions.byweekday)){var h=Object(o.d)(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],u=String(h);this.byweekday={allWeeks:h.filter(function(t){return!t.n}),someWeeks:h.filter(function(t){return Boolean(t.n)}),isWeekdays:-1!==u.indexOf("MO")&&-1!==u.indexOf("TU")&&-1!==u.indexOf("WE")&&-1!==u.indexOf("TH")&&-1!==u.indexOf("FR")&&-1===u.indexOf("SA")&&-1===u.indexOf("SU"),isEveryDay:-1!==u.indexOf("MO")&&-1!==u.indexOf("TU")&&-1!==u.indexOf("WE")&&-1!==u.indexOf("TH")&&-1!==u.indexOf("FR")&&-1!==u.indexOf("SA")&&-1!==u.indexOf("SU")};var c=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(c),this.byweekday.someWeeks.sort(c),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(a(["dtstart","wkst","freq"],n))return!0;if(!a(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[i.default.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.language.monthNames[n.getUTCMonth()]).add(n.getUTCDate()+",").add(n.getUTCFullYear().toString())}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.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,n;t=parseInt(t.toString(),10);var r=this.gettext;if(-1===t)return r("last");switch(n=Math.abs(t)){case 1:case 21:case 31:e=n+r("st");break;case 2:case 22:e=n+r("nd");break;case 3:case 23:e=n+r("rd");break;default:e=n+r("th")}return t<0?e+" "+r("last"):e},t.prototype.monthtext=function(t){return this.language.monthNames[t-1]},t.prototype.weekdaytext=function(t){var e=Object(o.e)(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){void 0===r&&(r=","),Object(o.d)(t)||(t=[t]);e=e||function(t){return t.toString()};var i=this,a=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(a),r,n):t.map(a).join(r+" ")},t}(),u=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 c(t,e){void 0===e&&(e=r);var n={},o=new u(e.tokens);return o.start(t)?(function(){o.expect("every");var t=o.acceptNumber();t&&(n.interval=parseInt(t[0],10));if(o.isDone())throw new Error("Unexpected end");switch(o.symbol){case"day(s)":n.freq=i.default.DAILY,o.nextSymbol()&&(!function(){if(!o.accept("at"))return;do{var t=o.acceptNumber();if(!t)throw new Error("Unexpected symbol "+o.symbol+", expected hour");for(n.byhour=[parseInt(t[0],10)];o.accept("comma");){if(!(t=o.acceptNumber()))throw new Error("Unexpected symbol "+o.symbol+"; expected hour");n.byhour.push(parseInt(t[0],10))}}while(o.accept("comma")||o.accept("at"))}(),l());break;case"weekday(s)":n.freq=i.default.WEEKLY,n.byweekday=[i.default.MO,i.default.TU,i.default.WE,i.default.TH,i.default.FR],o.nextSymbol(),l();break;case"week(s)":n.freq=i.default.WEEKLY,o.nextSymbol()&&(a(),l());break;case"hour(s)":n.freq=i.default.HOURLY,o.nextSymbol()&&(a(),l());break;case"minute(s)":n.freq=i.default.MINUTELY,o.nextSymbol()&&(a(),l());break;case"month(s)":n.freq=i.default.MONTHLY,o.nextSymbol()&&(a(),l());break;case"year(s)":n.freq=i.default.YEARLY,o.nextSymbol()&&(a(),l());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=i.default.WEEKLY;var e=o.symbol.substr(0,2).toUpperCase();if(n.byweekday=[i.default[e]],!o.nextSymbol())return;for(;o.accept("comma");){if(o.isDone())throw new Error("Unexpected end");var r=h();if(!r)throw new Error("Unexpected symbol "+o.symbol+", expected weekday");n.byweekday.push(i.default[r]),o.nextSymbol()}!function(){o.accept("on"),o.accept("the");var t=c();if(!t)return;n.bymonthday=[t],o.nextSymbol();for(;o.accept("comma");){if(!(t=c()))throw new Error("Unexpected symbol "+o.symbol+"; expected monthday");n.bymonthday.push(t),o.nextSymbol()}}(),l();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=i.default.YEARLY,n.bymonth=[s()],!o.nextSymbol())return;for(;o.accept("comma");){if(o.isDone())throw new Error("Unexpected end");var u=s();if(!u)throw new Error("Unexpected symbol "+o.symbol+", expected month");n.bymonth.push(u),o.nextSymbol()}a(),l();break;default:throw new Error("Unknown symbol")}}(),n):null;function a(){var t=o.accept("on"),e=o.accept("the");if(t||e)do{var r=c(),a=h(),u=s();if(r)a?(o.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(i.default[a].nth(r))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(r),o.accept("day(s)"));else if(a)o.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(i.default[a]);else if("weekday(s)"===o.symbol)o.nextSymbol(),n.byweekday||(n.byweekday=[i.default.MO,i.default.TU,i.default.WE,i.default.TH,i.default.FR]);else if("week(s)"===o.symbol){o.nextSymbol();var l=o.acceptNumber();if(!l)throw new Error("Unexpected symbol "+o.symbol+", expected week number");for(n.byweekno=[parseInt(l[0],10)];o.accept("comma");){if(!(l=o.acceptNumber()))throw new Error("Unexpected symbol "+o.symbol+"; expected monthday");n.byweekno.push(parseInt(l[0],10))}}else{if(!u)return;o.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(u)}}while(o.accept("comma")||o.accept("the")||o.accept("on"))}function s(){switch(o.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 h(){switch(o.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return o.symbol.substr(0,2).toUpperCase();default:return!1}}function c(){switch(o.symbol){case"last":return o.nextSymbol(),-1;case"first":return o.nextSymbol(),1;case"second":return o.nextSymbol(),o.accept("last")?-2:2;case"third":return o.nextSymbol(),o.accept("last")?-3:3;case"nth":var t=parseInt(o.value[1],10);if(t<-366||t>366)throw new Error("Nth out of range: "+t);return o.nextSymbol(),o.accept("last")?-t:t;default:return!1}}function l(){if("until"===o.symbol){var t=Date.parse(o.text);if(!t)throw new Error("Cannot parse until date:"+o.text);n.until=new Date(t)}else o.accept("for")&&(n.count=parseInt(o.value[0],10),o.expect("number"))}}n.d(e,"fromText",function(){return l}),n.d(e,"isFullyConvertible",function(){return f}),n.d(e,"toText",function(){return y}),n.d(e,"parseText",function(){return c}); | ||
*/e.default=B},function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e);var r={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}},i=n(1),o=n(0),a=function(t,e){return-1!==t.indexOf(e)},s=function(t){return t.toString()},u=function(){function t(t,e,n){if(void 0===e&&(e=s),void 0===n&&(n=r),this.text=[],this.language=n||r,this.gettext=e,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);i.sort(function(t,e){return t-e}),a.sort(function(t,e){return e-t}),this.bymonthday=i.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Object(o.f)(this.origOptions.byweekday)){var u=Object(o.d)(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],c=String(u);this.byweekday={allWeeks:u.filter(function(t){return!t.n}),someWeeks:u.filter(function(t){return Boolean(t.n)}),isWeekdays:-1!==c.indexOf("MO")&&-1!==c.indexOf("TU")&&-1!==c.indexOf("WE")&&-1!==c.indexOf("TH")&&-1!==c.indexOf("FR")&&-1===c.indexOf("SA")&&-1===c.indexOf("SU"),isEveryDay:-1!==c.indexOf("MO")&&-1!==c.indexOf("TU")&&-1!==c.indexOf("WE")&&-1!==c.indexOf("TH")&&-1!==c.indexOf("FR")&&-1!==c.indexOf("SA")&&-1!==c.indexOf("SU")};var h=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(h),this.byweekday.someWeeks.sort(h),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}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(a(["dtstart","wkst","freq"],n))return!0;if(!a(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[i.default.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.language.monthNames[n.getUTCMonth()]).add(n.getUTCDate()+",").add(n.getUTCFullYear().toString())}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.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,n;t=parseInt(t.toString(),10);var r=this.gettext;if(-1===t)return r("last");switch(n=Math.abs(t)){case 1:case 21:case 31:e=n+r("st");break;case 2:case 22:e=n+r("nd");break;case 3:case 23:e=n+r("rd");break;default:e=n+r("th")}return t<0?e+" "+r("last"):e},t.prototype.monthtext=function(t){return this.language.monthNames[t-1]},t.prototype.weekdaytext=function(t){var e=Object(o.e)(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){void 0===r&&(r=","),Object(o.d)(t)||(t=[t]);e=e||function(t){return t.toString()};var i=this,a=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(a),r,n):t.map(a).join(r+" ")},t}(),c=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 h(t,e){void 0===e&&(e=r);var n={},o=new c(e.tokens);return o.start(t)?(function(){o.expect("every");var t=o.acceptNumber();t&&(n.interval=parseInt(t[0],10));if(o.isDone())throw new Error("Unexpected end");switch(o.symbol){case"day(s)":n.freq=i.default.DAILY,o.nextSymbol()&&(!function(){if(!o.accept("at"))return;do{var t=o.acceptNumber();if(!t)throw new Error("Unexpected symbol "+o.symbol+", expected hour");for(n.byhour=[parseInt(t[0],10)];o.accept("comma");){if(!(t=o.acceptNumber()))throw new Error("Unexpected symbol "+o.symbol+"; expected hour");n.byhour.push(parseInt(t[0],10))}}while(o.accept("comma")||o.accept("at"))}(),d());break;case"weekday(s)":n.freq=i.default.WEEKLY,n.byweekday=[i.default.MO,i.default.TU,i.default.WE,i.default.TH,i.default.FR],o.nextSymbol(),d();break;case"week(s)":n.freq=i.default.WEEKLY,o.nextSymbol()&&(a(),d());break;case"hour(s)":n.freq=i.default.HOURLY,o.nextSymbol()&&(a(),d());break;case"minute(s)":n.freq=i.default.MINUTELY,o.nextSymbol()&&(a(),d());break;case"month(s)":n.freq=i.default.MONTHLY,o.nextSymbol()&&(a(),d());break;case"year(s)":n.freq=i.default.YEARLY,o.nextSymbol()&&(a(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=i.default.WEEKLY;var e=o.symbol.substr(0,2).toUpperCase();if(n.byweekday=[i.default[e]],!o.nextSymbol())return;for(;o.accept("comma");){if(o.isDone())throw new Error("Unexpected end");var r=u();if(!r)throw new Error("Unexpected symbol "+o.symbol+", expected weekday");n.byweekday.push(i.default[r]),o.nextSymbol()}!function(){o.accept("on"),o.accept("the");var t=h();if(!t)return;n.bymonthday=[t],o.nextSymbol();for(;o.accept("comma");){if(!(t=h()))throw new Error("Unexpected symbol "+o.symbol+"; expected monthday");n.bymonthday.push(t),o.nextSymbol()}}(),d();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=i.default.YEARLY,n.bymonth=[s()],!o.nextSymbol())return;for(;o.accept("comma");){if(o.isDone())throw new Error("Unexpected end");var c=s();if(!c)throw new Error("Unexpected symbol "+o.symbol+", expected month");n.bymonth.push(c),o.nextSymbol()}a(),d();break;default:throw new Error("Unknown symbol")}}(),n):null;function a(){var t=o.accept("on"),e=o.accept("the");if(t||e)do{var r=h(),a=u(),c=s();if(r)a?(o.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(i.default[a].nth(r))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(r),o.accept("day(s)"));else if(a)o.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(i.default[a]);else if("weekday(s)"===o.symbol)o.nextSymbol(),n.byweekday||(n.byweekday=[i.default.MO,i.default.TU,i.default.WE,i.default.TH,i.default.FR]);else if("week(s)"===o.symbol){o.nextSymbol();var d=o.acceptNumber();if(!d)throw new Error("Unexpected symbol "+o.symbol+", expected week number");for(n.byweekno=[parseInt(d[0],10)];o.accept("comma");){if(!(d=o.acceptNumber()))throw new Error("Unexpected symbol "+o.symbol+"; expected monthday");n.byweekno.push(parseInt(d[0],10))}}else{if(!c)return;o.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(c)}}while(o.accept("comma")||o.accept("the")||o.accept("on"))}function s(){switch(o.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 u(){switch(o.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return o.symbol.substr(0,2).toUpperCase();default:return!1}}function h(){switch(o.symbol){case"last":return o.nextSymbol(),-1;case"first":return o.nextSymbol(),1;case"second":return o.nextSymbol(),o.accept("last")?-2:2;case"third":return o.nextSymbol(),o.accept("last")?-3:3;case"nth":var t=parseInt(o.value[1],10);if(t<-366||t>366)throw new Error("Nth out of range: "+t);return o.nextSymbol(),o.accept("last")?-t:t;default:return!1}}function d(){if("until"===o.symbol){var t=Date.parse(o.text);if(!t)throw new Error("Cannot parse until date:"+o.text);n.until=new Date(t)}else o.accept("for")&&(n.count=parseInt(o.value[0],10),o.expect("number"))}}n.d(e,"fromText",function(){return d}),n.d(e,"isFullyConvertible",function(){return f}),n.d(e,"toText",function(){return y}),n.d(e,"parseText",function(){return h}); | ||
/*! | ||
@@ -28,2 +27,2 @@ * rrule.js - Library for working with recurrence rules for calendar dates. | ||
*/ | ||
var l=function(t,e){return void 0===e&&(e=r),new i.default(c(t,e)||void 0)},d=["count","until","interval","byweekday","bymonthday","bymonth"];h.IMPLEMENTED=[],h.IMPLEMENTED[i.default.HOURLY]=d,h.IMPLEMENTED[i.default.MINUTELY]=d,h.IMPLEMENTED[i.default.DAILY]=["byhour"].concat(d),h.IMPLEMENTED[i.default.WEEKLY]=d,h.IMPLEMENTED[i.default.MONTHLY]=d,h.IMPLEMENTED[i.default.YEARLY]=["byweekno","byyearday"].concat(d);var y=function(t,e,n){return new h(t,e,n).toString()},f=h.isFullyConvertible}])}); | ||
var d=function(t,e){return void 0===e&&(e=r),new i.default(h(t,e)||void 0)},l=["count","until","interval","byweekday","bymonthday","bymonth"];u.IMPLEMENTED=[],u.IMPLEMENTED[i.default.HOURLY]=l,u.IMPLEMENTED[i.default.MINUTELY]=l,u.IMPLEMENTED[i.default.DAILY]=["byhour"].concat(l),u.IMPLEMENTED[i.default.WEEKLY]=l,u.IMPLEMENTED[i.default.MONTHLY]=l,u.IMPLEMENTED[i.default.YEARLY]=["byweekno","byyearday"].concat(l);var y=function(t,e,n){return new u(t,e,n).toString()},f=u.isFullyConvertible}])}); |
@@ -18,9 +18,7 @@ /*! | ||
import RRuleSet from './rruleset'; | ||
import RRuleStr from './rrulestr'; | ||
import { rrulestr } from './rrulestr'; | ||
export { Frequency, ByWeekday, Options } from './types'; | ||
export { Weekday, WeekdayStr } from './weekday'; | ||
export { RRuleStrOptions } from './rrulestr'; | ||
declare const rruleStr: RRuleStr; | ||
declare const rrulestr: typeof rruleStr.parse; | ||
export { RRule, RRuleSet, rrulestr }; | ||
export default RRule; |
@@ -18,3 +18,3 @@ /*! | ||
import RRuleSet from './rruleset'; | ||
import RRuleStr from './rrulestr'; | ||
import { rrulestr } from './rrulestr'; | ||
export { Frequency } from './types'; | ||
@@ -25,9 +25,4 @@ export { Weekday } from './weekday'; | ||
// ============================================================================= | ||
// Only one RRuleStr instance for all rrule string parsing work. | ||
var rruleStr = new RRuleStr(); | ||
var rrulestr = function () { | ||
return rruleStr.parse.apply(rruleStr, arguments); | ||
}; | ||
export { RRule, RRuleSet, rrulestr }; | ||
export default RRule; | ||
//# sourceMappingURL=index.js.map |
@@ -5,4 +5,6 @@ import RRule, { DEFAULT_OPTIONS } from './rrule'; | ||
import dateutil from './dateutil'; | ||
import { DateWithZone } from './datewithzone'; | ||
export function optionsToString(options) { | ||
var pairs = []; | ||
var rrule = []; | ||
var dtstart = ''; | ||
var keys = Object.keys(options); | ||
@@ -45,3 +47,2 @@ var defaultKeys = Object.keys(DEFAULT_OPTIONS); | ||
key = 'BYDAY'; | ||
var arrayValue = toArray(value); | ||
outValue = toArray(value).map(function (wday) { | ||
@@ -60,7 +61,6 @@ if (wday instanceof Weekday) { | ||
case 'DTSTART': | ||
dtstart = buildDtstart(value, options.tzid); | ||
break; | ||
case 'UNTIL': | ||
outValue = dateutil.timeToUntilString(value, !options.tzid); | ||
if (options.tzid) { | ||
outValue = ";TZID=" + options.tzid + ":" + outValue; | ||
} | ||
break; | ||
@@ -79,16 +79,22 @@ default: | ||
} | ||
pairs.push([key, outValue]); | ||
} | ||
var strings = []; | ||
for (var i = 0; i < pairs.length; i++) { | ||
var _a = pairs[i], key = _a[0], value = _a[1]; | ||
if (value.indexOf(';') === 0) { | ||
strings.push("" + key + value); | ||
if (outValue) { | ||
rrule.push([key, outValue]); | ||
} | ||
else { | ||
strings.push(key + "=" + value.toString()); | ||
} | ||
} | ||
return strings.join(';'); | ||
var rules = rrule.map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return key + "=" + value.toString(); | ||
}).join(';'); | ||
var ruleString = ''; | ||
if (rules !== '') { | ||
ruleString = "RRULE:" + rules; | ||
} | ||
return [dtstart, ruleString].filter(function (x) { return !!x; }).join('\n'); | ||
} | ||
function buildDtstart(dtstart, tzid) { | ||
if (!dtstart) { | ||
return ''; | ||
} | ||
return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString(); | ||
} | ||
//# sourceMappingURL=optionstostring.js.map |
@@ -25,3 +25,3 @@ import { includes, notEmpty, isPresent, isNumber, isArray } from './helpers'; | ||
defaultKeys.forEach(function (key) { | ||
if (!includes(keys, key)) | ||
if (!includes(keys, key) || !isPresent(opts[key])) | ||
opts[key] = DEFAULT_OPTIONS[key]; | ||
@@ -32,3 +32,3 @@ }); | ||
if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) { | ||
throw new Error("Invalid frequency: " + opts.freq); | ||
throw new Error("Invalid frequency: " + opts.freq + " " + options.freq); | ||
} | ||
@@ -35,0 +35,0 @@ if (!opts.dtstart) |
import { Options } from './types'; | ||
export declare function parseString(rfcString: string): Partial<Options> | null; | ||
export declare function parseString(rfcString: string): Partial<Options>; | ||
export declare function parseDtstart(line: string): Partial<Options>; |
@@ -0,1 +1,12 @@ | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
import { Frequency } from './types'; | ||
@@ -6,24 +17,49 @@ import { Weekday } from './weekday'; | ||
export function parseString(rfcString) { | ||
var options = rfcString.split('\n').map(parseLine).filter(function (x) { return x !== null; }); | ||
return __assign({}, options[0], options[1]); | ||
} | ||
export function parseDtstart(line) { | ||
var options = {}; | ||
var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(line); | ||
if (!dtstartWithZone) { | ||
return options; | ||
} | ||
var _ = dtstartWithZone[0], tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2]; | ||
if (tzid) { | ||
options.tzid = tzid; | ||
} | ||
options.dtstart = dateutil.untilStringToDate(dtstart); | ||
return options; | ||
} | ||
function parseLine(rfcString) { | ||
rfcString = rfcString.replace(/^\s+|\s+$/, ''); | ||
if (!rfcString.length) | ||
return null; | ||
var options = {}; | ||
var dtstartWithZone = /^DTSTART;TZID=(.+?):([^;]+)$/.exec(rfcString); | ||
if (dtstartWithZone) { | ||
var _ = dtstartWithZone[0], tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2]; | ||
options.tzid = tzid; | ||
options.dtstart = dateutil.untilStringToDate(dtstart); | ||
return options; | ||
var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase()); | ||
if (!header) { | ||
return parseRrule(rfcString); | ||
} | ||
var attrs = rfcString.split(';'); | ||
for (var i = 0; i < attrs.length; i++) { | ||
var attr = attrs[i].split('='); | ||
var key = attr[0]; | ||
var value = attr[1]; | ||
switch (key) { | ||
var _ = header[0], key = header[1]; | ||
switch (key.toUpperCase()) { | ||
case 'RRULE': | ||
case 'EXRULE': | ||
return parseRrule(rfcString); | ||
case 'DTSTART': | ||
return parseDtstart(rfcString); | ||
default: | ||
throw new Error("Unsupported RFC prop " + key + " in " + rfcString); | ||
} | ||
} | ||
function parseRrule(line) { | ||
var strippedLine = line.replace(/^RRULE:/i, ''); | ||
var options = parseDtstart(strippedLine); | ||
var attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';'); | ||
attrs.forEach(function (attr) { | ||
var _a = attr.split('='), key = _a[0], value = _a[1]; | ||
switch (key.toUpperCase()) { | ||
case 'FREQ': | ||
options.freq = Frequency[value]; | ||
options.freq = Frequency[value.toUpperCase()]; | ||
break; | ||
case 'WKST': | ||
options.wkst = Days[value]; | ||
options.wkst = Days[value.toUpperCase()]; | ||
break; | ||
@@ -40,20 +76,3 @@ case 'COUNT': | ||
case 'BYSECOND': | ||
var num = void 0; | ||
if (value.indexOf(',') !== -1) { | ||
var values = value.split(','); | ||
num = values.map(function (val) { | ||
if (/^[+-]?\d+$/.test(val.toString())) { | ||
return Number(val); | ||
} | ||
else { | ||
return val; | ||
} | ||
}); | ||
} | ||
else if (/^[+-]?\d+$/.test(value)) { | ||
num = Number(value); | ||
} | ||
else { | ||
num = value; | ||
} | ||
var num = parseNumber(value); | ||
var optionKey = key.toLowerCase(); | ||
@@ -63,27 +82,12 @@ // @ts-ignore | ||
break; | ||
case 'BYDAY': // => byweekday | ||
var n = void 0; | ||
var wday = void 0; | ||
var day = void 0; | ||
var days = value.split(','); | ||
options.byweekday = []; | ||
for (var j = 0; j < days.length; j++) { | ||
day = days[j]; | ||
if (day.length === 2) { | ||
// MO, TU, ... | ||
wday = Days[day]; // wday instanceof Weekday | ||
options.byweekday.push(wday); | ||
} | ||
else { | ||
// -1MO, +3FR, 1SO, ... | ||
var parts = day.match(/^([+-]?\d)([A-Z]{2})$/); | ||
n = Number(parts[1]); | ||
var wdaypart = parts[2]; | ||
wday = Days[wdaypart].weekday; | ||
options.byweekday.push(new Weekday(wday, n)); | ||
} | ||
} | ||
case 'BYWEEKDAY': | ||
case 'BYDAY': | ||
options.byweekday = parseWeekday(value); | ||
break; | ||
case 'DTSTART': | ||
options.dtstart = dateutil.untilStringToDate(value); | ||
case 'TZID': | ||
// for backwards compatibility | ||
var dtstart = parseDtstart(line); | ||
options.tzid = dtstart.tzid; | ||
options.dtstart = dtstart.dtstart; | ||
break; | ||
@@ -99,5 +103,39 @@ case 'UNTIL': | ||
} | ||
} | ||
}); | ||
return options; | ||
} | ||
function parseNumber(value) { | ||
if (value.indexOf(',') !== -1) { | ||
var values = value.split(','); | ||
return values.map(function (val) { | ||
if (/^[+-]?\d+$/.test(val.toString())) { | ||
return Number(val); | ||
} | ||
else { | ||
return val; | ||
} | ||
}); | ||
} | ||
else if (/^[+-]?\d+$/.test(value)) { | ||
return Number(value); | ||
} | ||
return value; | ||
} | ||
function parseWeekday(value) { | ||
var days = value.split(','); | ||
return days.map(function (day) { | ||
if (day.length === 2) { | ||
// MO, TU, ... | ||
return Days[day]; // wday instanceof Weekday | ||
} | ||
else { | ||
// -1MO, +3FR, 1SO, ... | ||
var parts = day.match(/^([+-]?\d)([A-Z]{2})$/); | ||
var n = Number(parts[1]); | ||
var wdaypart = parts[2]; | ||
var wday = Days[wdaypart].weekday; | ||
return new Weekday(wday, n); | ||
} | ||
}); | ||
} | ||
//# sourceMappingURL=parsestring.js.map |
@@ -20,3 +20,3 @@ import dateutil from './dateutil'; | ||
export declare const DEFAULT_OPTIONS: Options; | ||
export declare const defaultKeys: ("bymonthday" | "freq" | "dtstart" | "interval" | "wkst" | "count" | "until" | "tzid" | "bysetpos" | "bymonth" | "bynmonthday" | "byyearday" | "byweekno" | "byweekday" | "bynweekday" | "byhour" | "byminute" | "bysecond" | "byeaster")[]; | ||
export declare const defaultKeys: ("until" | "bymonthday" | "freq" | "dtstart" | "interval" | "wkst" | "count" | "tzid" | "bysetpos" | "bymonth" | "bynmonthday" | "byyearday" | "byweekno" | "byweekday" | "bynweekday" | "byhour" | "byminute" | "bysecond" | "byeaster")[]; | ||
/** | ||
@@ -23,0 +23,0 @@ * |
@@ -12,3 +12,3 @@ import dateutil from './dateutil'; | ||
import { Weekday } from './weekday'; | ||
import { DateTime } from 'luxon'; | ||
import { DateWithZone } from './datewithzone'; | ||
var getnlp = function () { | ||
@@ -390,18 +390,3 @@ // Lazy, runtime import to avoid circular refs. | ||
RRule.prototype.rezoneIfNeeded = function (date) { | ||
var tzid = this.options.tzid; | ||
if (!tzid) { | ||
return date; | ||
} | ||
try { | ||
var datetime = DateTime | ||
.fromJSDate(date); | ||
var rezoned = datetime.setZone(tzid, { keepLocalTime: true }); | ||
return rezoned.toJSDate(); | ||
} | ||
catch (e) { | ||
if (e instanceof TypeError) { | ||
console.error('Using TZID without Luxon available is unsupported. Returned times are in UTC, not the requested time zone'); | ||
} | ||
return date; | ||
} | ||
return new DateWithZone(date, this.options.tzid).rezonedDate(); | ||
}; | ||
@@ -408,0 +393,0 @@ // RRule class 'constants' |
import RRule from './rrule'; | ||
import IterResult from './iterresult'; | ||
/** | ||
* | ||
* @param {Boolean?} noCache | ||
* The same stratagy as RRule on cache, default to false | ||
* @constructor | ||
*/ | ||
export default class RRuleSet extends RRule { | ||
@@ -14,3 +8,10 @@ readonly _rrule: RRule[]; | ||
readonly _exdate: Date[]; | ||
/** | ||
* | ||
* @param {Boolean?} noCache | ||
* The same stratagy as RRule on cache, default to false | ||
* @constructor | ||
*/ | ||
constructor(noCache?: boolean); | ||
tzid(): string | undefined; | ||
/** | ||
@@ -40,5 +41,6 @@ * Adds an RRule to the set | ||
exdate(date: Date): void; | ||
private rdatesToString; | ||
valueOf(): string[]; | ||
/** | ||
* to generate recurrence field sush as: | ||
* to generate recurrence field such as: | ||
* ["RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU;DTSTART=19970902T010000Z","RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH;DTSTART=19970902T010000Z"] | ||
@@ -45,0 +47,0 @@ */ |
@@ -17,10 +17,11 @@ var __extends = (this && this.__extends) || (function () { | ||
import { includes } from './helpers'; | ||
/** | ||
* | ||
* @param {Boolean?} noCache | ||
* The same stratagy as RRule on cache, default to false | ||
* @constructor | ||
*/ | ||
import { DateWithZone } from './datewithzone'; | ||
var RRuleSet = /** @class */ (function (_super) { | ||
__extends(RRuleSet, _super); | ||
/** | ||
* | ||
* @param {Boolean?} noCache | ||
* The same stratagy as RRule on cache, default to false | ||
* @constructor | ||
*/ | ||
function RRuleSet(noCache) { | ||
@@ -35,2 +36,11 @@ if (noCache === void 0) { noCache = false; } | ||
} | ||
RRuleSet.prototype.tzid = function () { | ||
for (var i = 0; i < this._rrule.length; i++) { | ||
var tzid = this._rrule[i].origOptions.tzid; | ||
if (tzid) { | ||
return tzid; | ||
} | ||
} | ||
return undefined; | ||
}; | ||
/** | ||
@@ -90,29 +100,26 @@ * Adds an RRule to the set | ||
}; | ||
RRuleSet.prototype.rdatesToString = function (param, rdates) { | ||
var _this = this; | ||
var tzid = this.tzid(); | ||
var header = tzid ? param + ";TZID=" + tzid + ":" : param + ":"; | ||
var dateString = rdates | ||
.map(function (rdate) { return dateutil.timeToUntilString(rdate.valueOf(), !_this.tzid()); }) | ||
.join(','); | ||
return "" + header + dateString; | ||
}; | ||
RRuleSet.prototype.valueOf = function () { | ||
var result = []; | ||
if (this._rrule.length) { | ||
this._rrule.forEach(function (rrule) { | ||
result.push('RRULE:' + rrule); | ||
}); | ||
} | ||
this._rrule.forEach(function (rrule) { | ||
result = result.concat(rrule.toString().split('\n')); | ||
}); | ||
if (this._rdate.length) { | ||
result.push('RDATE:' + | ||
this._rdate | ||
.map(function (rdate) { | ||
return dateutil.timeToUntilString(rdate.valueOf()); | ||
}) | ||
.join(',')); | ||
result.push(this.rdatesToString('RDATE', this._rdate)); | ||
} | ||
if (this._exrule.length) { | ||
this._exrule.forEach(function (exrule) { | ||
result.push('EXRULE:' + exrule); | ||
}); | ||
} | ||
this._exrule.forEach(function (exrule) { | ||
result = result.concat(exrule.toString().split('\n') | ||
.map(function (line) { return line.replace(/^RRULE:/, 'EXRULE:'); }) | ||
.filter(function (line) { return !/^DTSTART/.test(line); })); | ||
}); | ||
if (this._exdate.length) { | ||
result.push('EXDATE:' + | ||
this._exdate | ||
.map(function (exdate) { | ||
return dateutil.timeToUntilString(exdate.valueOf()); | ||
}) | ||
.join(',')); | ||
result.push(this.rdatesToString('EXDATE', this._exdate)); | ||
} | ||
@@ -122,7 +129,7 @@ return result; | ||
/** | ||
* to generate recurrence field sush as: | ||
* to generate recurrence field such as: | ||
* ["RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU;DTSTART=19970902T010000Z","RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH;DTSTART=19970902T010000Z"] | ||
*/ | ||
RRuleSet.prototype.toString = function () { | ||
return JSON.stringify(this.valueOf()); | ||
return this.valueOf().join('\n'); | ||
}; | ||
@@ -133,2 +140,3 @@ RRuleSet.prototype._iter = function (iterResult) { | ||
var _accept = iterResult.accept; | ||
var tzid = this.tzid(); | ||
function evalExdate(after, before) { | ||
@@ -142,3 +150,4 @@ _exrule.forEach(function (rrule) { | ||
this._exdate.forEach(function (date) { | ||
_exdateHash[Number(date)] = true; | ||
var zonedDate = new DateWithZone(date, tzid).rezonedDate(); | ||
_exdateHash[Number(zonedDate)] = true; | ||
}); | ||
@@ -168,3 +177,4 @@ iterResult.accept = function (date) { | ||
for (var i = 0; i < this._rdate.length; i++) { | ||
if (!iterResult.accept(new Date(this._rdate[i].valueOf()))) | ||
var zonedDate = new DateWithZone(this._rdate[i], tzid).rezonedDate(); | ||
if (!iterResult.accept(new Date(zonedDate.getTime()))) | ||
break; | ||
@@ -199,3 +209,3 @@ } | ||
for (i = 0; i < this._rdate.length; i++) { | ||
rrs.rdate(new Date(this._rdate[i].valueOf())); | ||
rrs.rdate(new Date(this._rdate[i].getTime())); | ||
} | ||
@@ -206,3 +216,3 @@ for (i = 0; i < this._exrule.length; i++) { | ||
for (i = 0; i < this._exdate.length; i++) { | ||
rrs.exdate(new Date(this._exdate[i].valueOf())); | ||
rrs.exdate(new Date(this._exdate[i].getTime())); | ||
} | ||
@@ -209,0 +219,0 @@ return rrs; |
import RRule from './rrule'; | ||
import RRuleSet from './rruleset'; | ||
import { Options } from './types'; | ||
export interface RRuleStrOptions { | ||
@@ -11,32 +12,10 @@ dtstart: Date | null; | ||
} | ||
/** | ||
* RRuleStr | ||
* To parse a set of rrule strings | ||
*/ | ||
export default class RRuleStr { | ||
private _handle_DTSTART; | ||
private static _weekday_map; | ||
private static _freq_map; | ||
private static DEFAULT_OPTIONS; | ||
private _handle_int; | ||
private _handle_int_list; | ||
private _handle_FREQ; | ||
private _handle_UNTIL; | ||
private _handle_WKST; | ||
private _handle_BYWEEKDAY; | ||
private _parseRfcRRule; | ||
private _parseRfc; | ||
parse(s: string, options?: Partial<RRuleStrOptions>): RRule | RRuleSet; | ||
private _handle_BYDAY; | ||
private _handle_INTERVAL; | ||
private _handle_COUNT; | ||
private _handle_BYSETPOS; | ||
private _handle_BYMONTH; | ||
private _handle_BYMONTHDAY; | ||
private _handle_BYYEARDAY; | ||
private _handle_BYEASTER; | ||
private _handle_BYWEEKNO; | ||
private _handle_BYHOUR; | ||
private _handle_BYMINUTE; | ||
private _handle_BYSECOND; | ||
} | ||
export declare function parseInput(s: string, options: Partial<RRuleStrOptions>): { | ||
dtstart: Date | null | undefined; | ||
tzid: string | null | undefined; | ||
rrulevals: Partial<Options>[]; | ||
rdatevals: Date[]; | ||
exrulevals: Partial<Options>[]; | ||
exdatevals: Date[]; | ||
}; | ||
export declare function rrulestr(s: string, options?: Partial<RRuleStrOptions>): RRule | RRuleSet; |
@@ -0,6 +1,17 @@ | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
import RRule from './rrule'; | ||
import RRuleSet from './rruleset'; | ||
import dateutil from './dateutil'; | ||
import { Weekday } from './weekday'; | ||
import { includes, split } from './helpers'; | ||
import { parseString, parseDtstart } from './parsestring'; | ||
/** | ||
@@ -10,344 +21,182 @@ * RRuleStr | ||
*/ | ||
var RRuleStr = /** @class */ (function () { | ||
function RRuleStr() { | ||
// tslint:disable:variable-name | ||
this._handle_BYDAY = this._handle_BYWEEKDAY; | ||
this._handle_INTERVAL = this._handle_int; | ||
this._handle_COUNT = this._handle_int; | ||
this._handle_BYSETPOS = this._handle_int_list; | ||
this._handle_BYMONTH = this._handle_int_list; | ||
this._handle_BYMONTHDAY = this._handle_int_list; | ||
this._handle_BYYEARDAY = this._handle_int_list; | ||
this._handle_BYEASTER = this._handle_int_list; | ||
this._handle_BYWEEKNO = this._handle_int_list; | ||
this._handle_BYHOUR = this._handle_int_list; | ||
this._handle_BYMINUTE = this._handle_int_list; | ||
this._handle_BYSECOND = this._handle_int_list; | ||
// tslint:enable:variable-name | ||
} | ||
// tslint:disable-next-line:variable-name | ||
RRuleStr.prototype._handle_DTSTART = function (rrkwargs, _, value, __) { | ||
var parms = /^DTSTART(?:;TZID=([^:=]+))?(?::|=)(.*)/.exec(value); | ||
var ___ = parms[0], tzid = parms[1], dtstart = parms[2]; | ||
rrkwargs['dtstart'] = dateutil.untilStringToDate(dtstart); | ||
if (tzid) { | ||
rrkwargs['tzid'] = tzid; | ||
var DEFAULT_OPTIONS = { | ||
dtstart: null, | ||
cache: false, | ||
unfold: false, | ||
forceset: false, | ||
compatible: false, | ||
tzid: null | ||
}; | ||
export function parseInput(s, options) { | ||
var rrulevals = []; | ||
var rdatevals = []; | ||
var exrulevals = []; | ||
var exdatevals = []; | ||
var _a = parseDtstart(s), dtstart = _a.dtstart, tzid = _a.tzid; | ||
var lines = splitIntoLines(s, options.unfold); | ||
lines.forEach(function (line) { | ||
if (!line) | ||
return; | ||
var _a = breakDownLine(line), name = _a.name, parms = _a.parms, value = _a.value; | ||
switch (name.toUpperCase()) { | ||
case 'RRULE': | ||
if (parms.length) { | ||
throw new Error("unsupported RRULE parm: " + parms.join(',')); | ||
} | ||
rrulevals.push(parseString(line)); | ||
break; | ||
case 'RDATE': | ||
rdatevals = rdatevals.concat(parseRDate(value, parms)); | ||
break; | ||
case 'EXRULE': | ||
if (parms.length) { | ||
throw new Error("unsupported EXRULE parm: " + parms.join(',')); | ||
} | ||
exrulevals.push(parseString(value)); | ||
break; | ||
case 'EXDATE': | ||
exdatevals = exdatevals.concat(parseRDate(value, parms)); | ||
break; | ||
case 'DTSTART': | ||
break; | ||
default: | ||
throw new Error('unsupported property: ' + name); | ||
} | ||
}; | ||
RRuleStr.prototype._handle_int = function (rrkwargs, name, value) { | ||
}); | ||
return { | ||
// @ts-ignore | ||
rrkwargs[name.toLowerCase()] = parseInt(value, 10); | ||
dtstart: dtstart, | ||
// @ts-ignore | ||
tzid: tzid, | ||
rrulevals: rrulevals, | ||
rdatevals: rdatevals, | ||
exrulevals: exrulevals, | ||
exdatevals: exdatevals | ||
}; | ||
RRuleStr.prototype._handle_int_list = function (rrkwargs, name, value) { | ||
} | ||
function buildRule(s, options) { | ||
var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid; | ||
var noCache = options.cache === false; | ||
if (options.compatible) { | ||
options.forceset = true; | ||
options.unfold = true; | ||
} | ||
if (options.forceset || | ||
rrulevals.length > 1 || | ||
rdatevals.length || | ||
exrulevals.length || | ||
exdatevals.length) { | ||
var rset_1 = new RRuleSet(noCache); | ||
rrulevals.forEach(function (val) { | ||
rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache)); | ||
}); | ||
rdatevals.forEach(function (date) { | ||
rset_1.rdate(date); | ||
}); | ||
exrulevals.forEach(function (val) { | ||
rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache)); | ||
}); | ||
exdatevals.forEach(function (date) { | ||
rset_1.exdate(date); | ||
}); | ||
// @ts-ignore | ||
rrkwargs[name.toLowerCase()] = value.split(',').map(function (x) { return parseInt(x, 10); }); | ||
if (options.compatible && options.dtstart) | ||
rset_1.rdate(dtstart); | ||
return rset_1; | ||
} | ||
var val = rrulevals[0]; | ||
return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache); | ||
} | ||
export function rrulestr(s, options) { | ||
if (options === void 0) { options = {}; } | ||
return buildRule(s, initializeOptions(options)); | ||
} | ||
function groomRruleOptions(val, dtstart, tzid) { | ||
return __assign({}, val, { dtstart: dtstart, | ||
tzid: tzid }); | ||
} | ||
function initializeOptions(options) { | ||
var invalid = []; | ||
var keys = Object.keys(options); | ||
var defaultKeys = Object.keys(DEFAULT_OPTIONS); | ||
keys.forEach(function (key) { | ||
if (!includes(defaultKeys, key)) | ||
invalid.push(key); | ||
}); | ||
if (invalid.length) { | ||
throw new Error('Invalid options: ' + invalid.join(', ')); | ||
} | ||
var initializedOptions = __assign({}, options); | ||
// Merge in default options | ||
defaultKeys.forEach(function (key) { | ||
if (!includes(keys, key)) | ||
initializedOptions[key] = DEFAULT_OPTIONS[key]; | ||
}); | ||
return initializedOptions; | ||
} | ||
function extractName(line) { | ||
if (line.indexOf(':') === -1) { | ||
return { | ||
name: 'RRULE', | ||
value: line | ||
}; | ||
} | ||
var _a = split(line, ':', 1), name = _a[0], value = _a[1]; | ||
return { | ||
name: name, | ||
value: value | ||
}; | ||
RRuleStr.prototype._handle_FREQ = function (rrkwargs, _, value, __) { | ||
rrkwargs['freq'] = RRuleStr._freq_map[value]; | ||
} | ||
function breakDownLine(line) { | ||
var _a = extractName(line), name = _a.name, value = _a.value; | ||
var parms = name.split(';'); | ||
if (!parms) | ||
throw new Error('empty property name'); | ||
return { | ||
name: parms[0].toUpperCase(), | ||
parms: parms.slice(1), | ||
value: value | ||
}; | ||
RRuleStr.prototype._handle_UNTIL = function (rrkwargs, _, value, __) { | ||
try { | ||
rrkwargs['until'] = dateutil.untilStringToDate(value); | ||
} | ||
function splitIntoLines(s, unfold) { | ||
if (unfold === void 0) { unfold = false; } | ||
s = s && s.trim(); | ||
if (!s) | ||
throw new Error('Invalid empty string'); | ||
// More info about 'unfold' option | ||
// Go head to http://www.ietf.org/rfc/rfc2445.txt | ||
if (!unfold) { | ||
return s.split(/\s/); | ||
} | ||
var lines = s.split('\n'); | ||
var i = 0; | ||
while (i < lines.length) { | ||
// TODO | ||
var line = (lines[i] = lines[i].replace(/\s+$/g, '')); | ||
if (!line) { | ||
lines.splice(i, 1); | ||
} | ||
catch (error) { | ||
throw new Error('invalid until date'); | ||
else if (i > 0 && line[0] === ' ') { | ||
lines[i - 1] += line.slice(1); | ||
lines.splice(i, 1); | ||
} | ||
}; | ||
RRuleStr.prototype._handle_WKST = function (rrkwargs, _, value, __) { | ||
rrkwargs['wkst'] = RRuleStr._weekday_map[value]; | ||
}; | ||
RRuleStr.prototype._handle_BYWEEKDAY = function (rrkwargs, _, value, __) { | ||
// Two ways to specify this: +1MO or MO(+1) | ||
var splt; | ||
var i; | ||
var j; | ||
var n; | ||
var w; | ||
var wday; | ||
var l = []; | ||
var wdays = value.split(','); | ||
for (i = 0; i < wdays.length; i++) { | ||
wday = wdays[i]; | ||
if (wday.indexOf('(') > -1) { | ||
// If it's of the form TH(+1), etc. | ||
splt = wday.split('('); | ||
w = splt[0]; | ||
n = parseInt(splt.slice(1, -1)[0], 10); | ||
} | ||
else { | ||
// # If it's of the form +1MO | ||
for (j = 0; j < wday.length; j++) { | ||
if ('+-0123456789'.indexOf(wday[j]) === -1) | ||
break; | ||
} | ||
n = wday.slice(0, j) || null; | ||
w = wday.slice(j); | ||
if (n) | ||
n = parseInt(n, 10); | ||
} | ||
var weekday = new Weekday(RRuleStr._weekday_map[w], n); | ||
l.push(weekday); | ||
} | ||
rrkwargs['byweekday'] = l; | ||
}; | ||
RRuleStr.prototype._parseRfcRRule = function (line, options) { | ||
if (options === void 0) { options = {}; } | ||
options.dtstart = options.dtstart || null; | ||
options.cache = options.cache || false; | ||
var name; | ||
var value; | ||
var parts; | ||
var nameRegex = /^([A-Z]+):(.*)$/; | ||
var nameParts = nameRegex.exec(line); | ||
if (nameParts && nameParts.length >= 3) { | ||
name = nameParts[1]; | ||
value = nameParts[2]; | ||
if (name !== 'RRULE') | ||
throw new Error("unknown parameter name " + name); | ||
} | ||
else { | ||
value = line; | ||
i += 1; | ||
} | ||
var rrkwargs = {}; | ||
var dtstart = /DTSTART(?:;TZID=[^:]+:)?[^;]+/.exec(line); | ||
if (dtstart && dtstart.length > 0) { | ||
var dtstartClause = dtstart[0]; | ||
this._handle_DTSTART(rrkwargs, 'DTSTART', dtstartClause); | ||
} | ||
return lines; | ||
} | ||
function validateDateParm(parms) { | ||
parms.forEach(function (parm) { | ||
if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) { | ||
throw new Error('unsupported RDATE/EXDATE parm: ' + parm); | ||
} | ||
var pairs = value.split(';'); | ||
for (var i = 0; i < pairs.length; i++) { | ||
parts = pairs[i].split('='); | ||
name = parts[0].toUpperCase(); | ||
if (/DTSTART|TZID/.test(name)) { | ||
continue; | ||
} | ||
value = parts[1].toUpperCase(); | ||
// @ts-ignore | ||
var paramHandler = this["_handle_" + name]; | ||
if (typeof paramHandler !== 'function') { | ||
throw new Error("unknown parameter '" + name + "':" + value); | ||
} | ||
paramHandler(rrkwargs, name, value); | ||
} | ||
rrkwargs.dtstart = rrkwargs.dtstart || options.dtstart; | ||
rrkwargs.tzid = rrkwargs.tzid || options.tzid; | ||
return new RRule(rrkwargs, !options.cache); | ||
}; | ||
RRuleStr.prototype._parseRfc = function (s, options) { | ||
if (options.compatible) { | ||
options.forceset = true; | ||
options.unfold = true; | ||
} | ||
s = s && s.trim(); | ||
if (!s) | ||
throw new Error('Invalid empty string'); | ||
var i = 0; | ||
var line; | ||
var lines; | ||
// More info about 'unfold' option | ||
// Go head to http://www.ietf.org/rfc/rfc2445.txt | ||
if (options.unfold) { | ||
lines = s.split('\n'); | ||
while (i < lines.length) { | ||
// TODO | ||
line = lines[i] = lines[i].replace(/\s+$/g, ''); | ||
if (!line) { | ||
lines.splice(i, 1); | ||
} | ||
else if (i > 0 && line[0] === ' ') { | ||
lines[i - 1] += line.slice(1); | ||
lines.splice(i, 1); | ||
} | ||
else { | ||
i += 1; | ||
} | ||
} | ||
} | ||
else { | ||
lines = s.split(/\s/); | ||
} | ||
var rrulevals = []; | ||
var rdatevals = []; | ||
var exrulevals = []; | ||
var exdatevals = []; | ||
var name; | ||
var value; | ||
var parts; | ||
var dtstart; | ||
var tzid; | ||
var rset; | ||
var j; | ||
var k; | ||
var datestrs; | ||
var datestr; | ||
if (!options.forceset && | ||
lines.length === 1 && | ||
(s.indexOf(':') === -1 || s.indexOf('RRULE:') === 0)) { | ||
return this._parseRfcRRule(lines[0], { | ||
cache: options.cache, | ||
dtstart: options.dtstart | ||
}); | ||
} | ||
else { | ||
for (var i_1 = 0; i_1 < lines.length; i_1++) { | ||
line = lines[i_1]; | ||
if (!line) | ||
continue; | ||
if (line.indexOf(':') === -1) { | ||
name = 'RRULE'; | ||
value = line; | ||
} | ||
else { | ||
parts = split(line, ':', 1); | ||
name = parts[0]; | ||
value = parts[1]; | ||
} | ||
var parms = name.split(';'); | ||
if (!parms) | ||
throw new Error('empty property name'); | ||
name = parms[0].toUpperCase(); | ||
parms = parms.slice(1); | ||
if (name === 'RRULE') { | ||
for (j = 0; j < parms.length; j++) { | ||
var parm = parms[j]; | ||
throw new Error('unsupported RRULE parm: ' + parm); | ||
} | ||
rrulevals.push(value); | ||
} | ||
else if (name === 'RDATE') { | ||
for (j = 0; j < parms.length; j++) { | ||
var parm = parms[j]; | ||
if (parm !== 'VALUE=DATE-TIME' && parm !== 'VALUE=DATE') { | ||
throw new Error('unsupported RDATE parm: ' + parm); | ||
} | ||
} | ||
rdatevals.push(value); | ||
} | ||
else if (name === 'EXRULE') { | ||
for (j = 0; j < parms.length; j++) { | ||
var parm = parms[j]; | ||
throw new Error('unsupported EXRULE parm: ' + parm); | ||
} | ||
exrulevals.push(value); | ||
} | ||
else if (name === 'EXDATE') { | ||
for (j = 0; j < parms.length; j++) { | ||
var parm = parms[j]; | ||
if (parm !== 'VALUE=DATE-TIME' && parm !== 'VALUE=DATE') { | ||
throw new Error('unsupported EXDATE parm: ' + parm); | ||
} | ||
} | ||
exdatevals.push(value); | ||
} | ||
else if (name === 'DTSTART') { | ||
dtstart = dateutil.untilStringToDate(value); | ||
if (parms.length) { | ||
var _a = parms[0].split('='), key = _a[0], value_1 = _a[1]; | ||
if (key === 'TZID') { | ||
tzid = value_1; | ||
} | ||
} | ||
} | ||
else { | ||
throw new Error('unsupported property: ' + name); | ||
} | ||
} | ||
if (options.forceset || | ||
rrulevals.length > 1 || | ||
rdatevals.length || | ||
exrulevals.length || | ||
exdatevals.length) { | ||
rset = new RRuleSet(!options.cache); | ||
for (j = 0; j < rrulevals.length; j++) { | ||
rset.rrule(this._parseRfcRRule(rrulevals[j], { | ||
// @ts-ignore | ||
dtstart: options.dtstart || dtstart | ||
})); | ||
} | ||
for (j = 0; j < rdatevals.length; j++) { | ||
datestrs = rdatevals[j].split(','); | ||
for (k = 0; k < datestrs.length; k++) { | ||
datestr = datestrs[k]; | ||
rset.rdate(dateutil.untilStringToDate(datestr)); | ||
} | ||
} | ||
for (j = 0; j < exrulevals.length; j++) { | ||
rset.exrule(this._parseRfcRRule(exrulevals[j], { | ||
// @ts-ignore | ||
dtstart: options.dtstart || dtstart | ||
})); | ||
} | ||
for (j = 0; j < exdatevals.length; j++) { | ||
datestrs = exdatevals[j].split(','); | ||
for (k = 0; k < datestrs.length; k++) { | ||
datestr = datestrs[k]; | ||
rset.exdate(dateutil.untilStringToDate(datestr)); | ||
} | ||
} | ||
// @ts-ignore | ||
if (options.compatible && options.dtstart) | ||
rset.rdate(dtstart); | ||
return rset; | ||
} | ||
else { | ||
return this._parseRfcRRule(rrulevals[0], { | ||
// @ts-ignore | ||
dtstart: options.dtstart || dtstart, | ||
cache: options.cache, | ||
// @ts-ignore | ||
tzid: options.tzid || tzid | ||
}); | ||
} | ||
} | ||
}; | ||
RRuleStr.prototype.parse = function (s, options) { | ||
if (options === void 0) { options = {}; } | ||
var invalid = []; | ||
var keys = Object.keys(options); | ||
var defaultKeys = Object.keys(RRuleStr.DEFAULT_OPTIONS); | ||
keys.forEach(function (key) { | ||
if (!includes(defaultKeys, key)) | ||
invalid.push(key); | ||
}, this); | ||
if (invalid.length) { | ||
throw new Error('Invalid options: ' + invalid.join(', ')); | ||
} | ||
// Merge in default options | ||
defaultKeys.forEach(function (key) { | ||
if (!includes(keys, key)) | ||
options[key] = RRuleStr.DEFAULT_OPTIONS[key]; | ||
}); | ||
return this._parseRfc(s, options); | ||
}; | ||
// tslint:disable-next-line:variable-name | ||
RRuleStr._weekday_map = { | ||
MO: 0, | ||
TU: 1, | ||
WE: 2, | ||
TH: 3, | ||
FR: 4, | ||
SA: 5, | ||
SU: 6 | ||
}; | ||
// tslint:disable-next-line:variable-name | ||
RRuleStr._freq_map = { | ||
YEARLY: RRule.YEARLY, | ||
MONTHLY: RRule.MONTHLY, | ||
WEEKLY: RRule.WEEKLY, | ||
DAILY: RRule.DAILY, | ||
HOURLY: RRule.HOURLY, | ||
MINUTELY: RRule.MINUTELY, | ||
SECONDLY: RRule.SECONDLY | ||
}; | ||
RRuleStr.DEFAULT_OPTIONS = { | ||
dtstart: null, | ||
cache: false, | ||
unfold: false, | ||
forceset: false, | ||
compatible: false, | ||
tzid: null | ||
}; | ||
return RRuleStr; | ||
}()); | ||
export default RRuleStr; | ||
}); | ||
} | ||
function parseRDate(rdateval, parms) { | ||
validateDateParm(parms); | ||
return rdateval | ||
.split(',') | ||
.map(function (datestr) { return dateutil.untilStringToDate(datestr); }); | ||
} | ||
//# sourceMappingURL=rrulestr.js.map |
{ | ||
"name": "rrule", | ||
"version": "2.4.1", | ||
"version": "2.5.0", | ||
"description": "JavaScript library for working with recurrence rules for calendar dates.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://jakubroztocil.github.io/rrule/", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83
19030
2122352