You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
185 KiB

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
"use strict";var Qf=Object.create;var Yr=Object.defineProperty;var Lf=Object.getOwnPropertyDescriptor;var Nf=Object.getOwnPropertyNames;var Cf=Object.getPrototypeOf,If=Object.prototype.hasOwnProperty;var Bf=(n,e,r)=>e in n?Yr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r;var Pf=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Af=(n,e)=>{for(var r in e)Yr(n,r,{get:e[r],enumerable:!0})},Io=(n,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Nf(e))!If.call(n,o)&&o!==r&&Yr(n,o,{get:()=>e[o],enumerable:!(i=Lf(e,o))||i.enumerable});return n};var Wt=(n,e,r)=>(r=n!=null?Qf(Cf(n)):{},Io(e||!n||!n.__esModule?Yr(r,"default",{value:n,enumerable:!0}):r,n)),Wf=n=>Io(Yr({},"__esModule",{value:!0}),n);var g=(n,e,r)=>Bf(n,typeof e!="symbol"?e+"":e,r);var Ut=Pf((Gi,ar)=>{(function(n,e){typeof Gi=="object"&&typeof ar!="undefined"?ar.exports=e():typeof define=="function"&&define.amd?define(e):n.moment=e()})(Gi,function(){"use strict";var n;function e(){return n.apply(null,arguments)}function r(t){n=t}function i(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function o(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function l(t,s){return Object.prototype.hasOwnProperty.call(t,s)}function c(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var s;for(s in t)if(l(t,s))return!1;return!0}function f(t){return t===void 0}function m(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function h(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function y(t,s){var a=[],u,d=t.length;for(u=0;u<d;++u)a.push(s(t[u],u));return a}function w(t,s){for(var a in s)l(s,a)&&(t[a]=s[a]);return l(s,"toString")&&(t.toString=s.toString),l(s,"valueOf")&&(t.valueOf=s.valueOf),t}function _(t,s,a,u){return yo(t,s,a,u,!0).utc()}function x(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function b(t){return t._pf==null&&(t._pf=x()),t._pf}var T;Array.prototype.some?T=Array.prototype.some:T=function(t){var s=Object(this),a=s.length>>>0,u;for(u=0;u<a;u++)if(u in s&&t.call(this,s[u],u,s))return!0;return!1};function F(t){if(t._isValid==null){var s=b(t),a=T.call(s.parsedDateParts,function(d){return d!=null}),u=!isNaN(t._d.getTime())&&s.overflow<0&&!s.empty&&!s.invalidEra&&!s.invalidMonth&&!s.invalidWeekday&&!s.weekdayMismatch&&!s.nullInput&&!s.invalidFormat&&!s.userInvalidated&&(!s.meridiem||s.meridiem&&a);if(t._strict&&(u=u&&s.charsLeftOver===0&&s.unusedTokens.length===0&&s.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=u;else return u}return t._isValid}function S(t){var s=_(NaN);return t!=null?w(b(s),t):b(s).userInvalidated=!0,s}var j=e.momentProperties=[],q=!1;function U(t,s){var a,u,d,p=j.length;if(f(s._isAMomentObject)||(t._isAMomentObject=s._isAMomentObject),f(s._i)||(t._i=s._i),f(s._f)||(t._f=s._f),f(s._l)||(t._l=s._l),f(s._strict)||(t._strict=s._strict),f(s._tzm)||(t._tzm=s._tzm),f(s._isUTC)||(t._isUTC=s._isUTC),f(s._offset)||(t._offset=s._offset),f(s._pf)||(t._pf=b(s)),f(s._locale)||(t._locale=s._locale),p>0)for(a=0;a<p;a++)u=j[a],d=s[u],f(d)||(t[u]=d);return t}function I(t){U(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),q===!1&&(q=!0,e.updateOffset(this),q=!1)}function A(t){return t instanceof I||t!=null&&t._isAMomentObject!=null}function ke(t){e.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+t)}function de(t,s){var a=!0;return w(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,t),a){var u=[],d,p,v,L=arguments.length;for(p=0;p<L;p++){if(d="",typeof arguments[p]=="object"){d+=`
[`+p+"] ";for(v in arguments[0])l(arguments[0],v)&&(d+=v+": "+arguments[0][v]+", ");d=d.slice(0,-2)}else d=arguments[p];u.push(d)}ke(t+`
Arguments: `+Array.prototype.slice.call(u).join("")+`
`+new Error().stack),a=!1}return s.apply(this,arguments)},s)}var E={};function K(t,s){e.deprecationHandler!=null&&e.deprecationHandler(t,s),E[t]||(ke(s),E[t]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function Y(t){return typeof Function!="undefined"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function B(t){var s,a;for(a in t)l(t,a)&&(s=t[a],Y(s)?this[a]=s:this["_"+a]=s);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function pe(t,s){var a=w({},t),u;for(u in s)l(s,u)&&(o(t[u])&&o(s[u])?(a[u]={},w(a[u],t[u]),w(a[u],s[u])):s[u]!=null?a[u]=s[u]:delete a[u]);for(u in t)l(t,u)&&!l(s,u)&&o(t[u])&&(a[u]=w({},a[u]));return a}function z(t){t!=null&&this.set(t)}var dt;Object.keys?dt=Object.keys:dt=function(t){var s,a=[];for(s in t)l(t,s)&&a.push(s);return a};var Nl={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Cl(t,s,a){var u=this._calendar[t]||this._calendar.sameElse;return Y(u)?u.call(s,a):u}function it(t,s,a){var u=""+Math.abs(t),d=s-u.length,p=t>=0;return(p?a?"+":"":"-")+Math.pow(10,Math.max(0,d)).toString().substr(1)+u}var Ti=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,on=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Di={},Kt={};function Q(t,s,a,u){var d=u;typeof u=="string"&&(d=function(){return this[u]()}),t&&(Kt[t]=d),s&&(Kt[s[0]]=function(){return it(d.apply(this,arguments),s[1],s[2])}),a&&(Kt[a]=function(){return this.localeData().ordinal(d.apply(this,arguments),t)})}function Il(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function Bl(t){var s=t.match(Ti),a,u;for(a=0,u=s.length;a<u;a++)Kt[s[a]]?s[a]=Kt[s[a]]:s[a]=Il(s[a]);return function(d){var p="",v;for(v=0;v<u;v++)p+=Y(s[v])?s[v].call(d,t):s[v];return p}}function an(t,s){return t.isValid()?(s=Gs(s,t.localeData()),Di[s]=Di[s]||Bl(s),Di[s](t)):t.localeData().invalidDate()}function Gs(t,s){var a=5;function u(d){return s.longDateFormat(d)||d}for(on.lastIndex=0;a>=0&&on.test(t);)t=t.replace(on,u),on.lastIndex=0,a-=1;return t}var Pl={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Al(t){var s=this._longDateFormat[t],a=this._longDateFormat[t.toUpperCase()];return s||!a?s:(this._longDateFormat[t]=a.match(Ti).map(function(u){return u==="MMMM"||u==="MM"||u==="DD"||u==="dddd"?u.slice(1):u}).join(""),this._longDateFormat[t])}var Wl="Invalid date";function $l(){return this._invalidDate}var jl="%d",Vl=/\d{1,2}/;function Hl(t){return this._ordinal.replace("%d",t)}var Gl={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function zl(t,s,a,u){var d=this._relativeTime[a];return Y(d)?d(t,s,a,u):d.replace(/%d/i,t)}function Zl(t,s){var a=this._relativeTime[t>0?"future":"past"];return Y(a)?a(s):a.replace(/%s/i,s)}var Tr={};function Fe(t,s){var a=t.toLowerCase();Tr[a]=Tr[a+"s"]=Tr[s]=t}function He(t){return typeof t=="string"?Tr[t]||Tr[t.toLowerCase()]:void 0}function Si(t){var s={},a,u;for(u in t)l(t,u)&&(a=He(u),a&&(s[a]=t[u]));return s}var zs={};function Re(t,s){zs[t]=s}function Jl(t){var s=[],a;for(a in t)l(t,a)&&s.push({unit:a,priority:zs[a]});return s.sort(function(u,d){return u.priority-d.priority}),s}function ln(t){return t%4===0&&t%100!==0||t%400===0}function Ge(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function W(t){var s=+t,a=0;return s!==0&&isFinite(s)&&(a=Ge(s)),a}function Xt(t,s){return function(a){return a!=null?(Zs(this,t,a),e.updateOffset(this,s),this):un(this,t)}}function un(t,s){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+s]():NaN}function Zs(t,s,a){t.isValid()&&!isNaN(a)&&(s==="FullYear"&&ln(t.year())&&t.month()===1&&t.date()===29?(a=W(a),t._d["set"+(t._isUTC?"UTC":"")+s](a,t.month(),yn(a,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+s](a))}function ql(t){return t=He(t),Y(this[t])?this[t]():this}function Kl(t,s){if(typeof t=="object"){t=Si(t);var a=Jl(t),u,d=a.length;for(u=0;u<d;u++)this[a[u].unit](t[a[u].unit])}else if(t=He(t),Y(this[t]))return this[t](s);return this}var Js=/\d/,Ae=/\d\d/,qs=/\d{3}/,Fi=/\d{4}/,cn=/[+-]?\d{6}/,ae=/\d\d?/,Ks=/\d\d\d\d?/,Xs=/\d\d\d\d\d\d?/,dn=/\d{1,3}/,Ri=/\d{1,4}/,fn=/[+-]?\d{1,6}/,er=/\d+/,mn=/[+-]?\d+/,Xl=/Z|[+-]\d\d:?\d\d/gi,hn=/Z|[+-]\d\d(?::?\d\d)?/gi,eu=/[+-]?\d+(\.\d{1,3})?/,Dr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,pn;pn={};function R(t,s,a){pn[t]=Y(s)?s:function(u,d){return u&&a?a:s}}function tu(t,s){return l(pn,t)?pn[t](s._strict,s._locale):new RegExp(ru(t))}function ru(t){return We(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(s,a,u,d,p){return a||u||d||p}))}function We(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Ei={};function re(t,s){var a,u=s,d;for(typeof t=="string"&&(t=[t]),m(s)&&(u=function(p,v){v[s]=W(p)}),d=t.length,a=0;a<d;a++)Ei[t[a]]=u}function Sr(t,s){re(t,function(a,u,d,p){d._w=d._w||{},s(a,d._w,d,p)})}function nu(t,s,a){s!=null&&l(Ei,t)&&Ei[t](s,a._a,a,t)}var Ee=0,ft=1,st=2,ve=3,et=4,mt=5,Bt=6,iu=7,su=8;function ou(t,s){return(t%s+s)%s}var ye;Array.prototype.indexOf?ye=Array.prototype.indexOf:ye=function(t){var s;for(s=0;s<this.length;++s)if(this[s]===t)return s;return-1};function yn(t,s){if(isNaN(t)||isNaN(s))return NaN;var a=ou(s,12);return t+=(s-a)/12,a===1?ln(t)?29:28:31-a%7%2}Q("M",["MM",2],"Mo",function(){return this.month()+1}),Q("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),Q("MMMM",0,0,function(t){return this.localeData().months(this,t)}),Fe("month","M"),Re("month",8),R("M",ae),R("MM",ae,Ae),R("MMM",function(t,s){return s.monthsShortRegex(t)}),R("MMMM",function(t,s){return s.monthsRegex(t)}),re(["M","MM"],function(t,s){s[ft]=W(t)-1}),re(["MMM","MMMM"],function(t,s,a,u){var d=a._locale.monthsParse(t,u,a._strict);d!=null?s[ft]=d:b(a).invalidMonth=t});var au="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),eo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),to=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,lu=Dr,uu=Dr;function cu(t,s){return t?i(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||to).test(s)?"format":"standalone"][t.month()]:i(this._months)?this._months:this._months.standalone}function du(t,s){return t?i(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[to.test(s)?"format":"standalone"][t.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function fu(t,s,a){var u,d,p,v=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],u=0;u<12;++u)p=_([2e3,u]),this._shortMonthsParse[u]=this.monthsShort(p,"").toLocaleLowerCase(),this._longMonthsParse[u]=this.months(p,"").toLocaleLowerCase();return a?s==="MMM"?(d=ye.call(this._shortMonthsParse,v),d!==-1?d:null):(d=ye.call(this._longMonthsParse,v),d!==-1?d:null):s==="MMM"?(d=ye.call(this._shortMonthsParse,v),d!==-1?d:(d=ye.call(this._longMonthsParse,v),d!==-1?d:null)):(d=ye.call(this._longMonthsParse,v),d!==-1?d:(d=ye.call(this._shortMonthsParse,v),d!==-1?d:null))}function mu(t,s,a){var u,d,p;if(this._monthsParseExact)return fu.call(this,t,s,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),u=0;u<12;u++){if(d=_([2e3,u]),a&&!this._longMonthsParse[u]&&(this._longMonthsParse[u]=new RegExp("^"+this.months(d,"").replace(".","")+"$","i"),this._shortMonthsParse[u]=new RegExp("^"+this.monthsShort(d,"").replace(".","")+"$","i")),!a&&!this._monthsParse[u]&&(p="^"+this.months(d,"")+"|^"+this.monthsShort(d,""),this._monthsParse[u]=new RegExp(p.replace(".",""),"i")),a&&s==="MMMM"&&this._longMonthsParse[u].test(t))return u;if(a&&s==="MMM"&&this._shortMonthsParse[u].test(t))return u;if(!a&&this._monthsParse[u].test(t))return u}}function ro(t,s){var a;if(!t.isValid())return t;if(typeof s=="string"){if(/^\d+$/.test(s))s=W(s);else if(s=t.localeData().monthsParse(s),!m(s))return t}return a=Math.min(t.date(),yn(t.year(),s)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](s,a),t}function no(t){return t!=null?(ro(this,t),e.updateOffset(this,!0),this):un(this,"Month")}function hu(){return yn(this.year(),this.month())}function pu(t){return this._monthsParseExact?(l(this,"_monthsRegex")||io.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=lu),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function yu(t){return this._monthsParseExact?(l(this,"_monthsRegex")||io.call(this),t?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=uu),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function io(){function t(v,L){return L.length-v.length}var s=[],a=[],u=[],d,p;for(d=0;d<12;d++)p=_([2e3,d]),s.push(this.monthsShort(p,"")),a.push(this.months(p,"")),u.push(this.months(p,"")),u.push(this.monthsShort(p,""));for(s.sort(t),a.sort(t),u.sort(t),d=0;d<12;d++)s[d]=We(s[d]),a[d]=We(a[d]);for(d=0;d<24;d++)u[d]=We(u[d]);this._monthsRegex=new RegExp("^("+u.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}Q("Y",0,0,function(){var t=this.year();return t<=9999?it(t,4):"+"+t}),Q(0,["YY",2],0,function(){return this.year()%100}),Q(0,["YYYY",4],0,"year"),Q(0,["YYYYY",5],0,"year"),Q(0,["YYYYYY",6,!0],0,"year"),Fe("year","y"),Re("year",1),R("Y",mn),R("YY",ae,Ae),R("YYYY",Ri,Fi),R("YYYYY",fn,cn),R("YYYYYY",fn,cn),re(["YYYYY","YYYYYY"],Ee),re("YYYY",function(t,s){s[Ee]=t.length===2?e.parseTwoDigitYear(t):W(t)}),re("YY",function(t,s){s[Ee]=e.parseTwoDigitYear(t)}),re("Y",function(t,s){s[Ee]=parseInt(t,10)});function Fr(t){return ln(t)?366:365}e.parseTwoDigitYear=function(t){return W(t)+(W(t)>68?1900:2e3)};var so=Xt("FullYear",!0);function gu(){return ln(this.year())}function bu(t,s,a,u,d,p,v){var L;return t<100&&t>=0?(L=new Date(t+400,s,a,u,d,p,v),isFinite(L.getFullYear())&&L.setFullYear(t)):L=new Date(t,s,a,u,d,p,v),L}function Rr(t){var s,a;return t<100&&t>=0?(a=Array.prototype.slice.call(arguments),a[0]=t+400,s=new Date(Date.UTC.apply(null,a)),isFinite(s.getUTCFullYear())&&s.setUTCFullYear(t)):s=new Date(Date.UTC.apply(null,arguments)),s}function gn(t,s,a){var u=7+s-a,d=(7+Rr(t,0,u).getUTCDay()-s)%7;return-d+u-1}function oo(t,s,a,u,d){var p=(7+a-u)%7,v=gn(t,u,d),L=1+7*(s-1)+p+v,P,ne;return L<=0?(P=t-1,ne=Fr(P)+L):L>Fr(t)?(P=t+1,ne=L-Fr(t)):(P=t,ne=L),{year:P,dayOfYear:ne}}function Er(t,s,a){var u=gn(t.year(),s,a),d=Math.floor((t.dayOfYear()-u-1)/7)+1,p,v;return d<1?(v=t.year()-1,p=d+ht(v,s,a)):d>ht(t.year(),s,a)?(p=d-ht(t.year(),s,a),v=t.year()+1):(v=t.year(),p=d),{week:p,year:v}}function ht(t,s,a){var u=gn(t,s,a),d=gn(t+1,s,a);return(Fr(t)-u+d)/7}Q("w",["ww",2],"wo","week"),Q("W",["WW",2],"Wo","isoWeek"),Fe("week","w"),Fe("isoWeek","W"),Re("week",5),Re("isoWeek",5),R("w",ae),R("ww",ae,Ae),R("W",ae),R("WW",ae,Ae),Sr(["w","ww","W","WW"],function(t,s,a,u){s[u.substr(0,1)]=W(t)});function vu(t){return Er(t,this._week.dow,this._week.doy).week}var _u={dow:0,doy:6};function wu(){return this._week.dow}function xu(){return this._week.doy}function ku(t){var s=this.localeData().week(this);return t==null?s:this.add((t-s)*7,"d")}function Tu(t){var s=Er(this,1,4).week;return t==null?s:this.add((t-s)*7,"d")}Q("d",0,"do","day"),Q("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Q("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Q("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Q("e",0,0,"weekday"),Q("E",0,0,"isoWeekday"),Fe("day","d"),Fe("weekday","e"),Fe("isoWeekday","E"),Re("day",11),Re("weekday",11),Re("isoWeekday",11),R("d",ae),R("e",ae),R("E",ae),R("dd",function(t,s){return s.weekdaysMinRegex(t)}),R("ddd",function(t,s){return s.weekdaysShortRegex(t)}),R("dddd",function(t,s){return s.weekdaysRegex(t)}),Sr(["dd","ddd","dddd"],function(t,s,a,u){var d=a._locale.weekdaysParse(t,u,a._strict);d!=null?s.d=d:b(a).invalidWeekday=t}),Sr(["d","e","E"],function(t,s,a,u){s[u]=W(t)});function Du(t,s){return typeof t!="string"?t:isNaN(t)?(t=s.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function Su(t,s){return typeof t=="string"?s.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Mi(t,s){return t.slice(s,7).concat(t.slice(0,s))}var Fu="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ao="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ru="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Eu=Dr,Mu=Dr,Uu=Dr;function Ou(t,s){var a=i(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(s)?"format":"standalone"];return t===!0?Mi(a,this._week.dow):t?a[t.day()]:a}function Yu(t){return t===!0?Mi(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Qu(t){return t===!0?Mi(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Lu(t,s,a){var u,d,p,v=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],u=0;u<7;++u)p=_([2e3,1]).day(u),this._minWeekdaysParse[u]=this.weekdaysMin(p,"").toLocaleLowerCase(),this._shortWeekdaysParse[u]=this.weekdaysShort(p,"").toLocaleLowerCase(),this._weekdaysParse[u]=this.weekdays(p,"").toLocaleLowerCase();return a?s==="dddd"?(d=ye.call(this._weekdaysParse,v),d!==-1?d:null):s==="ddd"?(d=ye.call(this._shortWeekdaysParse,v),d!==-1?d:null):(d=ye.call(this._minWeekdaysParse,v),d!==-1?d:null):s==="dddd"?(d=ye.call(this._weekdaysParse,v),d!==-1||(d=ye.call(this._shortWeekdaysParse,v),d!==-1)?d:(d=ye.call(this._minWeekdaysParse,v),d!==-1?d:null)):s==="ddd"?(d=ye.call(this._shortWeekdaysParse,v),d!==-1||(d=ye.call(this._weekdaysParse,v),d!==-1)?d:(d=ye.call(this._minWeekdaysParse,v),d!==-1?d:null)):(d=ye.call(this._minWeekdaysParse,v),d!==-1||(d=ye.call(this._weekdaysParse,v),d!==-1)?d:(d=ye.call(this._shortWeekdaysParse,v),d!==-1?d:null))}function Nu(t,s,a){var u,d,p;if(this._weekdaysParseExact)return Lu.call(this,t,s,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),u=0;u<7;u++){if(d=_([2e3,1]).day(u),a&&!this._fullWeekdaysParse[u]&&(this._fullWeekdaysParse[u]=new RegExp("^"+this.weekdays(d,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[u]=new RegExp("^"+this.weekdaysShort(d,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[u]=new RegExp("^"+this.weekdaysMin(d,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[u]||(p="^"+this.weekdays(d,"")+"|^"+this.weekdaysShort(d,"")+"|^"+this.weekdaysMin(d,""),this._weekdaysParse[u]=new RegExp(p.replace(".",""),"i")),a&&s==="dddd"&&this._fullWeekdaysParse[u].test(t))return u;if(a&&s==="ddd"&&this._shortWeekdaysParse[u].test(t))return u;if(a&&s==="dd"&&this._minWeekdaysParse[u].test(t))return u;if(!a&&this._weekdaysParse[u].test(t))return u}}function Cu(t){if(!this.isValid())return t!=null?this:NaN;var s=this._isUTC?this._d.getUTCDay():this._d.getDay();return t!=null?(t=Du(t,this.localeData()),this.add(t-s,"d")):s}function Iu(t){if(!this.isValid())return t!=null?this:NaN;var s=(this.day()+7-this.localeData()._week.dow)%7;return t==null?s:this.add(t-s,"d")}function Bu(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var s=Su(t,this.localeData());return this.day(this.day()%7?s:s-7)}else return this.day()||7}function Pu(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Ui.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=Eu),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Au(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Ui.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Mu),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Wu(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Ui.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Uu),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ui(){function t(Le,vt){return vt.length-Le.length}var s=[],a=[],u=[],d=[],p,v,L,P,ne;for(p=0;p<7;p++)v=_([2e3,1]).day(p),L=We(this.weekdaysMin(v,"")),P=We(this.weekdaysShort(v,"")),ne=We(this.weekdays(v,"")),s.push(L),a.push(P),u.push(ne),d.push(L),d.push(P),d.push(ne);s.sort(t),a.sort(t),u.sort(t),d.sort(t),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Oi(){return this.hours()%12||12}function $u(){return this.hours()||24}Q("H",["HH",2],0,"hour"),Q("h",["hh",2],0,Oi),Q("k",["kk",2],0,$u),Q("hmm",0,0,function(){return""+Oi.apply(this)+it(this.minutes(),2)}),Q("hmmss",0,0,function(){return""+Oi.apply(this)+it(this.minutes(),2)+it(this.seconds(),2)}),Q("Hmm",0,0,function(){return""+this.hours()+it(this.minutes(),2)}),Q("Hmmss",0,0,function(){return""+this.hours()+it(this.minutes(),2)+it(this.seconds(),2)});function lo(t,s){Q(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),s)})}lo("a",!0),lo("A",!1),Fe("hour","h"),Re("hour",13);function uo(t,s){return s._meridiemParse}R("a",uo),R("A",uo),R("H",ae),R("h",ae),R("k",ae),R("HH",ae,Ae),R("hh",ae,Ae),R("kk",ae,Ae),R("hmm",Ks),R("hmmss",Xs),R("Hmm",Ks),R("Hmmss",Xs),re(["H","HH"],ve),re(["k","kk"],function(t,s,a){var u=W(t);s[ve]=u===24?0:u}),re(["a","A"],function(t,s,a){a._isPm=a._locale.isPM(t),a._meridiem=t}),re(["h","hh"],function(t,s,a){s[ve]=W(t),b(a).bigHour=!0}),re("hmm",function(t,s,a){var u=t.length-2;s[ve]=W(t.substr(0,u)),s[et]=W(t.substr(u)),b(a).bigHour=!0}),re("hmmss",function(t,s,a){var u=t.length-4,d=t.length-2;s[ve]=W(t.substr(0,u)),s[et]=W(t.substr(u,2)),s[mt]=W(t.substr(d)),b(a).bigHour=!0}),re("Hmm",function(t,s,a){var u=t.length-2;s[ve]=W(t.substr(0,u)),s[et]=W(t.substr(u))}),re("Hmmss",function(t,s,a){var u=t.length-4,d=t.length-2;s[ve]=W(t.substr(0,u)),s[et]=W(t.substr(u,2)),s[mt]=W(t.substr(d))});function ju(t){return(t+"").toLowerCase().charAt(0)==="p"}var Vu=/[ap]\.?m?\.?/i,Hu=Xt("Hours",!0);function Gu(t,s,a){return t>11?a?"pm":"PM":a?"am":"AM"}var co={calendar:Nl,longDateFormat:Pl,invalidDate:Wl,ordinal:jl,dayOfMonthOrdinalParse:Vl,relativeTime:Gl,months:au,monthsShort:eo,week:_u,weekdays:Fu,weekdaysMin:Ru,weekdaysShort:ao,meridiemParse:Vu},fe={},Mr={},Ur;function zu(t,s){var a,u=Math.min(t.length,s.length);for(a=0;a<u;a+=1)if(t[a]!==s[a])return a;return u}function fo(t){return t&&t.toLowerCase().replace("_","-")}function Zu(t){for(var s=0,a,u,d,p;s<t.length;){for(p=fo(t[s]).split("-"),a=p.length,u=fo(t[s+1]),u=u?u.split("-"):null;a>0;){if(d=bn(p.slice(0,a).join("-")),d)return d;if(u&&u.length>=a&&zu(p,u)>=a-1)break;a--}s++}return Ur}function Ju(t){return t.match("^[^/\\\\]*$")!=null}function bn(t){var s=null,a;if(fe[t]===void 0&&typeof ar!="undefined"&&ar&&ar.exports&&Ju(t))try{s=Ur._abbr,a=require,a("./locale/"+t),Ft(s)}catch(u){fe[t]=null}return fe[t]}function Ft(t,s){var a;return t&&(f(s)?a=pt(t):a=Yi(t,s),a?Ur=a:typeof console!="undefined"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Ur._abbr}function Yi(t,s){if(s!==null){var a,u=co;if(s.abbr=t,fe[t]!=null)K("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),u=fe[t]._config;else if(s.parentLocale!=null)if(fe[s.parentLocale]!=null)u=fe[s.parentLocale]._config;else if(a=bn(s.parentLocale),a!=null)u=a._config;else return Mr[s.parentLocale]||(Mr[s.parentLocale]=[]),Mr[s.parentLocale].push({name:t,config:s}),null;return fe[t]=new z(pe(u,s)),Mr[t]&&Mr[t].forEach(function(d){Yi(d.name,d.config)}),Ft(t),fe[t]}else return delete fe[t],null}function qu(t,s){if(s!=null){var a,u,d=co;fe[t]!=null&&fe[t].parentLocale!=null?fe[t].set(pe(fe[t]._config,s)):(u=bn(t),u!=null&&(d=u._config),s=pe(d,s),u==null&&(s.abbr=t),a=new z(s),a.parentLocale=fe[t],fe[t]=a),Ft(t)}else fe[t]!=null&&(fe[t].parentLocale!=null?(fe[t]=fe[t].parentLocale,t===Ft()&&Ft(t)):fe[t]!=null&&delete fe[t]);return fe[t]}function pt(t){var s;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Ur;if(!i(t)){if(s=bn(t),s)return s;t=[t]}return Zu(t)}function Ku(){return dt(fe)}function Qi(t){var s,a=t._a;return a&&b(t).overflow===-2&&(s=a[ft]<0||a[ft]>11?ft:a[st]<1||a[st]>yn(a[Ee],a[ft])?st:a[ve]<0||a[ve]>24||a[ve]===24&&(a[et]!==0||a[mt]!==0||a[Bt]!==0)?ve:a[et]<0||a[et]>59?et:a[mt]<0||a[mt]>59?mt:a[Bt]<0||a[Bt]>999?Bt:-1,b(t)._overflowDayOfYear&&(s<Ee||s>st)&&(s=st),b(t)._overflowWeeks&&s===-1&&(s=iu),b(t)._overflowWeekday&&s===-1&&(s=su),b(t).overflow=s),t}var Xu=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ec=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tc=/Z|[+-]\d\d(?::?\d\d)?/,vn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Li=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],rc=/^\/?Date\((-?\d+)/i,nc=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ic={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function mo(t){var s,a,u=t._i,d=Xu.exec(u)||ec.exec(u),p,v,L,P,ne=vn.length,Le=Li.length;if(d){for(b(t).iso=!0,s=0,a=ne;s<a;s++)if(vn[s][1].exec(d[1])){v=vn[s][0],p=vn[s][2]!==!1;break}if(v==null){t._isValid=!1;return}if(d[3]){for(s=0,a=Le;s<a;s++)if(Li[s][1].exec(d[3])){L=(d[2]||" ")+Li[s][0];break}if(L==null){t._isValid=!1;return}}if(!p&&L!=null){t._isValid=!1;return}if(d[4])if(tc.exec(d[4]))P="Z";else{t._isValid=!1;return}t._f=v+(L||"")+(P||""),Ci(t)}else t._isValid=!1}function sc(t,s,a,u,d,p){var v=[oc(t),eo.indexOf(s),parseInt(a,10),parseInt(u,10),parseInt(d,10)];return p&&v.push(parseInt(p,10)),v}function oc(t){var s=parseInt(t,10);return s<=49?2e3+s:s<=999?1900+s:s}function ac(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function lc(t,s,a){if(t){var u=ao.indexOf(t),d=new Date(s[0],s[1],s[2]).getDay();if(u!==d)return b(a).weekdayMismatch=!0,a._isValid=!1,!1}return!0}function uc(t,s,a){if(t)return ic[t];if(s)return 0;var u=parseInt(a,10),d=u%100,p=(u-d)/100;return p*60+d}function ho(t){var s=nc.exec(ac(t._i)),a;if(s){if(a=sc(s[4],s[3],s[2],s[5],s[6],s[7]),!lc(s[1],a,t))return;t._a=a,t._tzm=uc(s[8],s[9],s[10]),t._d=Rr.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),b(t).rfc2822=!0}else t._isValid=!1}function cc(t){var s=rc.exec(t._i);if(s!==null){t._d=new Date(+s[1]);return}if(mo(t),t._isValid===!1)delete t._isValid;else return;if(ho(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:e.createFromInputFallback(t)}e.createFromInputFallback=de("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function tr(t,s,a){return t!=null?t:s!=null?s:a}function dc(t){var s=new Date(e.now());return t._useUTC?[s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()]:[s.getFullYear(),s.getMonth(),s.getDate()]}function Ni(t){var s,a,u=[],d,p,v;if(!t._d){for(d=dc(t),t._w&&t._a[st]==null&&t._a[ft]==null&&fc(t),t._dayOfYear!=null&&(v=tr(t._a[Ee],d[Ee]),(t._dayOfYear>Fr(v)||t._dayOfYear===0)&&(b(t)._overflowDayOfYear=!0),a=Rr(v,0,t._dayOfYear),t._a[ft]=a.getUTCMonth(),t._a[st]=a.getUTCDate()),s=0;s<3&&t._a[s]==null;++s)t._a[s]=u[s]=d[s];for(;s<7;s++)t._a[s]=u[s]=t._a[s]==null?s===2?1:0:t._a[s];t._a[ve]===24&&t._a[et]===0&&t._a[mt]===0&&t._a[Bt]===0&&(t._nextDay=!0,t._a[ve]=0),t._d=(t._useUTC?Rr:bu).apply(null,u),p=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ve]=24),t._w&&typeof t._w.d!="undefined"&&t._w.d!==p&&(b(t).weekdayMismatch=!0)}}function fc(t){var s,a,u,d,p,v,L,P,ne;s=t._w,s.GG!=null||s.W!=null||s.E!=null?(p=1,v=4,a=tr(s.GG,t._a[Ee],Er(le(),1,4).year),u=tr(s.W,1),d=tr(s.E,1),(d<1||d>7)&&(P=!0)):(p=t._locale._week.dow,v=t._locale._week.doy,ne=Er(le(),p,v),a=tr(s.gg,t._a[Ee],ne.year),u=tr(s.w,ne.week),s.d!=null?(d=s.d,(d<0||d>6)&&(P=!0)):s.e!=null?(d=s.e+p,(s.e<0||s.e>6)&&(P=!0)):d=p),u<1||u>ht(a,p,v)?b(t)._overflowWeeks=!0:P!=null?b(t)._overflowWeekday=!0:(L=oo(a,u,d,p,v),t._a[Ee]=L.year,t._dayOfYear=L.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Ci(t){if(t._f===e.ISO_8601){mo(t);return}if(t._f===e.RFC_2822){ho(t);return}t._a=[],b(t).empty=!0;var s=""+t._i,a,u,d,p,v,L=s.length,P=0,ne,Le;for(d=Gs(t._f,t._locale).match(Ti)||[],Le=d.length,a=0;a<Le;a++)p=d[a],u=(s.match(tu(p,t))||[])[0],u&&(v=s.substr(0,s.indexOf(u)),v.length>0&&b(t).unusedInput.push(v),s=s.slice(s.indexOf(u)+u.length),P+=u.length),Kt[p]?(u?b(t).empty=!1:b(t).unusedTokens.push(p),nu(p,u,t)):t._strict&&!u&&b(t).unusedTokens.push(p);b(t).charsLeftOver=L-P,s.length>0&&b(t).unusedInput.push(s),t._a[ve]<=12&&b(t).bigHour===!0&&t._a[ve]>0&&(b(t).bigHour=void 0),b(t).parsedDateParts=t._a.slice(0),b(t).meridiem=t._meridiem,t._a[ve]=mc(t._locale,t._a[ve],t._meridiem),ne=b(t).era,ne!==null&&(t._a[Ee]=t._locale.erasConvertYear(ne,t._a[Ee])),Ni(t),Qi(t)}function mc(t,s,a){var u;return a==null?s:t.meridiemHour!=null?t.meridiemHour(s,a):(t.isPM!=null&&(u=t.isPM(a),u&&s<12&&(s+=12),!u&&s===12&&(s=0)),s)}function hc(t){var s,a,u,d,p,v,L=!1,P=t._f.length;if(P===0){b(t).invalidFormat=!0,t._d=new Date(NaN);return}for(d=0;d<P;d++)p=0,v=!1,s=U({},t),t._useUTC!=null&&(s._useUTC=t._useUTC),s._f=t._f[d],Ci(s),F(s)&&(v=!0),p+=b(s).charsLeftOver,p+=b(s).unusedTokens.length*10,b(s).score=p,L?p<u&&(u=p,a=s):(u==null||p<u||v)&&(u=p,a=s,v&&(L=!0));w(t,a||s)}function pc(t){if(!t._d){var s=Si(t._i),a=s.day===void 0?s.date:s.day;t._a=y([s.year,s.month,a,s.hour,s.minute,s.second,s.millisecond],function(u){return u&&parseInt(u,10)}),Ni(t)}}function yc(t){var s=new I(Qi(po(t)));return s._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function po(t){var s=t._i,a=t._f;return t._locale=t._locale||pt(t._l),s===null||a===void 0&&s===""?S({nullInput:!0}):(typeof s=="string"&&(t._i=s=t._locale.preparse(s)),A(s)?new I(Qi(s)):(h(s)?t._d=s:i(a)?hc(t):a?Ci(t):gc(t),F(t)||(t._d=null),t))}function gc(t){var s=t._i;f(s)?t._d=new Date(e.now()):h(s)?t._d=new Date(s.valueOf()):typeof s=="string"?cc(t):i(s)?(t._a=y(s.slice(0),function(a){return parseInt(a,10)}),Ni(t)):o(s)?pc(t):m(s)?t._d=new Date(s):e.createFromInputFallback(t)}function yo(t,s,a,u,d){var p={};return(s===!0||s===!1)&&(u=s,s=void 0),(a===!0||a===!1)&&(u=a,a=void 0),(o(t)&&c(t)||i(t)&&t.length===0)&&(t=void 0),p._isAMomentObject=!0,p._useUTC=p._isUTC=d,p._l=a,p._i=t,p._f=s,p._strict=u,yc(p)}function le(t,s,a,u){return yo(t,s,a,u,!1)}var bc=de("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=le.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:S()}),vc=de("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=le.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:S()});function go(t,s){var a,u;if(s.length===1&&i(s[0])&&(s=s[0]),!s.length)return le();for(a=s[0],u=1;u<s.length;++u)(!s[u].isValid()||s[u][t](a))&&(a=s[u]);return a}function _c(){var t=[].slice.call(arguments,0);return go("isBefore",t)}function wc(){var t=[].slice.call(arguments,0);return go("isAfter",t)}var xc=function(){return Date.now?Date.now():+new Date},Or=["year","quarter","month","week","day","hour","minute","second","millisecond"];function kc(t){var s,a=!1,u,d=Or.length;for(s in t)if(l(t,s)&&!(ye.call(Or,s)!==-1&&(t[s]==null||!isNaN(t[s]))))return!1;for(u=0;u<d;++u)if(t[Or[u]]){if(a)return!1;parseFloat(t[Or[u]])!==W(t[Or[u]])&&(a=!0)}return!0}function Tc(){return this._isValid}function Dc(){return tt(NaN)}function _n(t){var s=Si(t),a=s.year||0,u=s.quarter||0,d=s.month||0,p=s.week||s.isoWeek||0,v=s.day||0,L=s.hour||0,P=s.minute||0,ne=s.second||0,Le=s.millisecond||0;this._isValid=kc(s),this._milliseconds=+Le+ne*1e3+P*6e4+L*1e3*60*60,this._days=+v+p*7,this._months=+d+u*3+a*12,this._data={},this._locale=pt(),this._bubble()}function wn(t){return t instanceof _n}function Ii(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function Sc(t,s,a){var u=Math.min(t.length,s.length),d=Math.abs(t.length-s.length),p=0,v;for(v=0;v<u;v++)(a&&t[v]!==s[v]||!a&&W(t[v])!==W(s[v]))&&p++;return p+d}function bo(t,s){Q(t,0,0,function(){var a=this.utcOffset(),u="+";return a<0&&(a=-a,u="-"),u+it(~~(a/60),2)+s+it(~~a%60,2)})}bo("Z",":"),bo("ZZ",""),R("Z",hn),R("ZZ",hn),re(["Z","ZZ"],function(t,s,a){a._useUTC=!0,a._tzm=Bi(hn,t)});var Fc=/([\+\-]|\d\d)/gi;function Bi(t,s){var a=(s||"").match(t),u,d,p;return a===null?null:(u=a[a.length-1]||[],d=(u+"").match(Fc)||["-",0,0],p=+(d[1]*60)+W(d[2]),p===0?0:d[0]==="+"?p:-p)}function Pi(t,s){var a,u;return s._isUTC?(a=s.clone(),u=(A(t)||h(t)?t.valueOf():le(t).valueOf())-a.valueOf(),a._d.setTime(a._d.valueOf()+u),e.updateOffset(a,!1),a):le(t).local()}function Ai(t){return-Math.round(t._d.getTimezoneOffset())}e.updateOffset=function(){};function Rc(t,s,a){var u=this._offset||0,d;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=Bi(hn,t),t===null)return this}else Math.abs(t)<16&&!a&&(t=t*60);return!this._isUTC&&s&&(d=Ai(this)),this._offset=t,this._isUTC=!0,d!=null&&this.add(d,"m"),u!==t&&(!s||this._changeInProgress?xo(this,tt(t-u,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?u:Ai(this)}function Ec(t,s){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,s),this):-this.utcOffset()}function Mc(t){return this.utcOffset(0,t)}function Uc(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ai(this),"m")),this}function Oc(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Bi(Xl,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function Yc(t){return this.isValid()?(t=t?le(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Qc(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Lc(){if(!f(this._isDSTShifted))return this._isDSTShifted;var t={},s;return U(t,this),t=po(t),t._a?(s=t._isUTC?_(t._a):le(t._a),this._isDSTShifted=this.isValid()&&Sc(t._a,s.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Nc(){return this.isValid()?!this._isUTC:!1}function Cc(){return this.isValid()?this._isUTC:!1}function vo(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ic=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Bc=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function tt(t,s){var a=t,u=null,d,p,v;return wn(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:m(t)||!isNaN(+t)?(a={},s?a[s]=+t:a.milliseconds=+t):(u=Ic.exec(t))?(d=u[1]==="-"?-1:1,a={y:0,d:W(u[st])*d,h:W(u[ve])*d,m:W(u[et])*d,s:W(u[mt])*d,ms:W(Ii(u[Bt]*1e3))*d}):(u=Bc.exec(t))?(d=u[1]==="-"?-1:1,a={y:Pt(u[2],d),M:Pt(u[3],d),w:Pt(u[4],d),d:Pt(u[5],d),h:Pt(u[6],d),m:Pt(u[7],d),s:Pt(u[8],d)}):a==null?a={}:typeof a=="object"&&("from"in a||"to"in a)&&(v=Pc(le(a.from),le(a.to)),a={},a.ms=v.milliseconds,a.M=v.months),p=new _n(a),wn(t)&&l(t,"_locale")&&(p._locale=t._locale),wn(t)&&l(t,"_isValid")&&(p._isValid=t._isValid),p}tt.fn=_n.prototype,tt.invalid=Dc;function Pt(t,s){var a=t&&parseFloat(t.replace(",","."));return(isNaN(a)?0:a)*s}function _o(t,s){var a={};return a.months=s.month()-t.month()+(s.year()-t.year())*12,t.clone().add(a.months,"M").isAfter(s)&&--a.months,a.milliseconds=+s-+t.clone().add(a.months,"M"),a}function Pc(t,s){var a;return t.isValid()&&s.isValid()?(s=Pi(s,t),t.isBefore(s)?a=_o(t,s):(a=_o(s,t),a.milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function wo(t,s){return function(a,u){var d,p;return u!==null&&!isNaN(+u)&&(K(s,"moment()."+s+"(period, number) is deprecated. Please use moment()."+s+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),p=a,a=u,u=p),d=tt(a,u),xo(this,d,t),this}}function xo(t,s,a,u){var d=s._milliseconds,p=Ii(s._days),v=Ii(s._months);t.isValid()&&(u=u==null?!0:u,v&&ro(t,un(t,"Month")+v*a),p&&Zs(t,"Date",un(t,"Date")+p*a),d&&t._d.setTime(t._d.valueOf()+d*a),u&&e.updateOffset(t,p||v))}var Ac=wo(1,"add"),Wc=wo(-1,"subtract");function ko(t){return typeof t=="string"||t instanceof String}function $c(t){return A(t)||h(t)||ko(t)||m(t)||Vc(t)||jc(t)||t===null||t===void 0}function jc(t){var s=o(t)&&!c(t),a=!1,u=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],d,p,v=u.length;for(d=0;d<v;d+=1)p=u[d],a=a||l(t,p);return s&&a}function Vc(t){var s=i(t),a=!1;return s&&(a=t.filter(function(u){return!m(u)&&ko(t)}).length===0),s&&a}function Hc(t){var s=o(t)&&!c(t),a=!1,u=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],d,p;for(d=0;d<u.length;d+=1)p=u[d],a=a||l(t,p);return s&&a}function Gc(t,s){var a=t.diff(s,"days",!0);return a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse"}function zc(t,s){arguments.length===1&&(arguments[0]?$c(arguments[0])?(t=arguments[0],s=void 0):Hc(arguments[0])&&(s=arguments[0],t=void 0):(t=void 0,s=void 0));var a=t||le(),u=Pi(a,this).startOf("day"),d=e.calendarFormat(this,u)||"sameElse",p=s&&(Y(s[d])?s[d].call(this,a):s[d]);return this.format(p||this.localeData().calendar(d,this,le(a)))}function Zc(){return new I(this)}function Jc(t,s){var a=A(t)?t:le(t);return this.isValid()&&a.isValid()?(s=He(s)||"millisecond",s==="millisecond"?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(s).valueOf()):!1}function qc(t,s){var a=A(t)?t:le(t);return this.isValid()&&a.isValid()?(s=He(s)||"millisecond",s==="millisecond"?this.valueOf()<a.valueOf():this.clone().endOf(s).valueOf()<a.valueOf()):!1}function Kc(t,s,a,u){var d=A(t)?t:le(t),p=A(s)?s:le(s);return this.isValid()&&d.isValid()&&p.isValid()?(u=u||"()",(u[0]==="("?this.isAfter(d,a):!this.isBefore(d,a))&&(u[1]===")"?this.isBefore(p,a):!this.isAfter(p,a))):!1}function Xc(t,s){var a=A(t)?t:le(t),u;return this.isValid()&&a.isValid()?(s=He(s)||"millisecond",s==="millisecond"?this.valueOf()===a.valueOf():(u=a.valueOf(),this.clone().startOf(s).valueOf()<=u&&u<=this.clone().endOf(s).valueOf())):!1}function ed(t,s){return this.isSame(t,s)||this.isAfter(t,s)}function td(t,s){return this.isSame(t,s)||this.isBefore(t,s)}function rd(t,s,a){var u,d,p;if(!this.isValid())return NaN;if(u=Pi(t,this),!u.isValid())return NaN;switch(d=(u.utcOffset()-this.utcOffset())*6e4,s=He(s),s){case"year":p=xn(this,u)/12;break;case"month":p=xn(this,u);break;case"quarter":p=xn(this,u)/3;break;case"second":p=(this-u)/1e3;break;case"minute":p=(this-u)/6e4;break;case"hour":p=(this-u)/36e5;break;case"day":p=(this-u-d)/864e5;break;case"week":p=(this-u-d)/6048e5;break;default:p=this-u}return a?p:Ge(p)}function xn(t,s){if(t.date()<s.date())return-xn(s,t);var a=(s.year()-t.year())*12+(s.month()-t.month()),u=t.clone().add(a,"months"),d,p;return s-u<0?(d=t.clone().add(a-1,"months"),p=(s-u)/(u-d)):(d=t.clone().add(a+1,"months"),p=(s-u)/(d-u)),-(a+p)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function nd(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function id(t){if(!this.isValid())return null;var s=t!==!0,a=s?this.clone().utc():this;return a.year()<0||a.year()>9999?an(a,s?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Y(Date.prototype.toISOString)?s?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",an(a,"Z")):an(a,s?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function sd(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",s="",a,u,d,p;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",s="Z"),a="["+t+'("]',u=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",d="-MM-DD[T]HH:mm:ss.SSS",p=s+'[")]',this.format(a+u+d+p)}function od(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var s=an(this,t);return this.localeData().postformat(s)}function ad(t,s){return this.isValid()&&(A(t)&&t.isValid()||le(t).isValid())?tt({to:this,from:t}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function ld(t){return this.from(le(),t)}function ud(t,s){return this.isValid()&&(A(t)&&t.isValid()||le(t).isValid())?tt({from:this,to:t}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function cd(t){return this.to(le(),t)}function To(t){var s;return t===void 0?this._locale._abbr:(s=pt(t),s!=null&&(this._locale=s),this)}var Do=de("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function So(){return this._locale}var kn=1e3,rr=60*kn,Tn=60*rr,Fo=(365*400+97)*24*Tn;function nr(t,s){return(t%s+s)%s}function Ro(t,s,a){return t<100&&t>=0?new Date(t+400,s,a)-Fo:new Date(t,s,a).valueOf()}function Eo(t,s,a){return t<100&&t>=0?Date.UTC(t+400,s,a)-Fo:Date.UTC(t,s,a)}function dd(t){var s,a;if(t=He(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?Eo:Ro,t){case"year":s=a(this.year(),0,1);break;case"quarter":s=a(this.year(),this.month()-this.month()%3,1);break;case"month":s=a(this.year(),this.month(),1);break;case"week":s=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":s=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":s=a(this.year(),this.month(),this.date());break;case"hour":s=this._d.valueOf(),s-=nr(s+(this._isUTC?0:this.utcOffset()*rr),Tn);break;case"minute":s=this._d.valueOf(),s-=nr(s,rr);break;case"second":s=this._d.valueOf(),s-=nr(s,kn);break}return this._d.setTime(s),e.updateOffset(this,!0),this}function fd(t){var s,a;if(t=He(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?Eo:Ro,t){case"year":s=a(this.year()+1,0,1)-1;break;case"quarter":s=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":s=a(this.year(),this.month()+1,1)-1;break;case"week":s=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":s=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":s=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":s=this._d.valueOf(),s+=Tn-nr(s+(this._isUTC?0:this.utcOffset()*rr),Tn)-1;break;case"minute":s=this._d.valueOf(),s+=rr-nr(s,rr)-1;break;case"second":s=this._d.valueOf(),s+=kn-nr(s,kn)-1;break}return this._d.setTime(s),e.updateOffset(this,!0),this}function md(){return this._d.valueOf()-(this._offset||0)*6e4}function hd(){return Math.floor(this.valueOf()/1e3)}function pd(){return new Date(this.valueOf())}function yd(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function gd(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function bd(){return this.isValid()?this.toISOString():null}function vd(){return F(this)}function _d(){return w({},b(this))}function wd(){return b(this).overflow}function xd(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Q("N",0,0,"eraAbbr"),Q("NN",0,0,"eraAbbr"),Q("NNN",0,0,"eraAbbr"),Q("NNNN",0,0,"eraName"),Q("NNNNN",0,0,"eraNarrow"),Q("y",["y",1],"yo","eraYear"),Q("y",["yy",2],0,"eraYear"),Q("y",["yyy",3],0,"eraYear"),Q("y",["yyyy",4],0,"eraYear"),R("N",Wi),R("NN",Wi),R("NNN",Wi),R("NNNN",Yd),R("NNNNN",Qd),re(["N","NN","NNN","NNNN","NNNNN"],function(t,s,a,u){var d=a._locale.erasParse(t,u,a._strict);d?b(a).era=d:b(a).invalidEra=t}),R("y",er),R("yy",er),R("yyy",er),R("yyyy",er),R("yo",Ld),re(["y","yy","yyy","yyyy"],Ee),re(["yo"],function(t,s,a,u){var d;a._locale._eraYearOrdinalRegex&&(d=t.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?s[Ee]=a._locale.eraYearOrdinalParse(t,d):s[Ee]=parseInt(t,10)});function kd(t,s){var a,u,d,p=this._eras||pt("en")._eras;for(a=0,u=p.length;a<u;++a){switch(typeof p[a].since){case"string":d=e(p[a].since).startOf("day"),p[a].since=d.valueOf();break}switch(typeof p[a].until){case"undefined":p[a].until=1/0;break;case"string":d=e(p[a].until).startOf("day").valueOf(),p[a].until=d.valueOf();break}}return p}function Td(t,s,a){var u,d,p=this.eras(),v,L,P;for(t=t.toUpperCase(),u=0,d=p.length;u<d;++u)if(v=p[u].name.toUpperCase(),L=p[u].abbr.toUpperCase(),P=p[u].narrow.toUpperCase(),a)switch(s){case"N":case"NN":case"NNN":if(L===t)return p[u];break;case"NNNN":if(v===t)return p[u];break;case"NNNNN":if(P===t)return p[u];break}else if([v,L,P].indexOf(t)>=0)return p[u]}function Dd(t,s){var a=t.since<=t.until?1:-1;return s===void 0?e(t.since).year():e(t.since).year()+(s-t.offset)*a}function Sd(){var t,s,a,u=this.localeData().eras();for(t=0,s=u.length;t<s;++t)if(a=this.clone().startOf("day").valueOf(),u[t].since<=a&&a<=u[t].until||u[t].until<=a&&a<=u[t].since)return u[t].name;return""}function Fd(){var t,s,a,u=this.localeData().eras();for(t=0,s=u.length;t<s;++t)if(a=this.clone().startOf("day").valueOf(),u[t].since<=a&&a<=u[t].until||u[t].until<=a&&a<=u[t].since)return u[t].narrow;return""}function Rd(){var t,s,a,u=this.localeData().eras();for(t=0,s=u.length;t<s;++t)if(a=this.clone().startOf("day").valueOf(),u[t].since<=a&&a<=u[t].until||u[t].until<=a&&a<=u[t].since)return u[t].abbr;return""}function Ed(){var t,s,a,u,d=this.localeData().eras();for(t=0,s=d.length;t<s;++t)if(a=d[t].since<=d[t].until?1:-1,u=this.clone().startOf("day").valueOf(),d[t].since<=u&&u<=d[t].until||d[t].until<=u&&u<=d[t].since)return(this.year()-e(d[t].since).year())*a+d[t].offset;return this.year()}function Md(t){return l(this,"_erasNameRegex")||$i.call(this),t?this._erasNameRegex:this._erasRegex}function Ud(t){return l(this,"_erasAbbrRegex")||$i.call(this),t?this._erasAbbrRegex:this._erasRegex}function Od(t){return l(this,"_erasNarrowRegex")||$i.call(this),t?this._erasNarrowRegex:this._erasRegex}function Wi(t,s){return s.erasAbbrRegex(t)}function Yd(t,s){return s.erasNameRegex(t)}function Qd(t,s){return s.erasNarrowRegex(t)}function Ld(t,s){return s._eraYearOrdinalRegex||er}function $i(){var t=[],s=[],a=[],u=[],d,p,v=this.eras();for(d=0,p=v.length;d<p;++d)s.push(We(v[d].name)),t.push(We(v[d].abbr)),a.push(We(v[d].narrow)),u.push(We(v[d].name)),u.push(We(v[d].abbr)),u.push(We(v[d].narrow));this._erasRegex=new RegExp("^("+u.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+s.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}Q(0,["gg",2],0,function(){return this.weekYear()%100}),Q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Dn(t,s){Q(0,[t,t.length],0,s)}Dn("gggg","weekYear"),Dn("ggggg","weekYear"),Dn("GGGG","isoWeekYear"),Dn("GGGGG","isoWeekYear"),Fe("weekYear","gg"),Fe("isoWeekYear","GG"),Re("weekYear",1),Re("isoWeekYear",1),R("G",mn),R("g",mn),R("GG",ae,Ae),R("gg",ae,Ae),R("GGGG",Ri,Fi),R("gggg",Ri,Fi),R("GGGGG",fn,cn),R("ggggg",fn,cn),Sr(["gggg","ggggg","GGGG","GGGGG"],function(t,s,a,u){s[u.substr(0,2)]=W(t)}),Sr(["gg","GG"],function(t,s,a,u){s[u]=e.parseTwoDigitYear(t)});function Nd(t){return Mo.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Cd(t){return Mo.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Id(){return ht(this.year(),1,4)}function Bd(){return ht(this.isoWeekYear(),1,4)}function Pd(){var t=this.localeData()._week;return ht(this.year(),t.dow,t.doy)}function Ad(){var t=this.localeData()._week;return ht(this.weekYear(),t.dow,t.doy)}function Mo(t,s,a,u,d){var p;return t==null?Er(this,u,d).year:(p=ht(t,u,d),s>p&&(s=p),Wd.call(this,t,s,a,u,d))}function Wd(t,s,a,u,d){var p=oo(t,s,a,u,d),v=Rr(p.year,0,p.dayOfYear);return this.year(v.getUTCFullYear()),this.month(v.getUTCMonth()),this.date(v.getUTCDate()),this}Q("Q",0,"Qo","quarter"),Fe("quarter","Q"),Re("quarter",7),R("Q",Js),re("Q",function(t,s){s[ft]=(W(t)-1)*3});function $d(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Q("D",["DD",2],"Do","date"),Fe("date","D"),Re("date",9),R("D",ae),R("DD",ae,Ae),R("Do",function(t,s){return t?s._dayOfMonthOrdinalParse||s._ordinalParse:s._dayOfMonthOrdinalParseLenient}),re(["D","DD"],st),re("Do",function(t,s){s[st]=W(t.match(ae)[0])});var Uo=Xt("Date",!0);Q("DDD",["DDDD",3],"DDDo","dayOfYear"),Fe("dayOfYear","DDD"),Re("dayOfYear",4),R("DDD",dn),R("DDDD",qs),re(["DDD","DDDD"],function(t,s,a){a._dayOfYear=W(t)});function jd(t){var s=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?s:this.add(t-s,"d")}Q("m",["mm",2],0,"minute"),Fe("minute","m"),Re("minute",14),R("m",ae),R("mm",ae,Ae),re(["m","mm"],et);var Vd=Xt("Minutes",!1);Q("s",["ss",2],0,"second"),Fe("second","s"),Re("second",15),R("s",ae),R("ss",ae,Ae),re(["s","ss"],mt);var Hd=Xt("Seconds",!1);Q("S",0,0,function(){return~~(this.millisecond()/100)}),Q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Q(0,["SSS",3],0,"millisecond"),Q(0,["SSSS",4],0,function(){return this.millisecond()*10}),Q(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Fe("millisecond","ms"),Re("millisecond",16),R("S",dn,Js),R("SS",dn,Ae),R("SSS",dn,qs);var Rt,Oo;for(Rt="SSSS";Rt.length<=9;Rt+="S")R(Rt,er);function Gd(t,s){s[Bt]=W(("0."+t)*1e3)}for(Rt="S";Rt.length<=9;Rt+="S")re(Rt,Gd);Oo=Xt("Milliseconds",!1),Q("z",0,0,"zoneAbbr"),Q("zz",0,0,"zoneName");function zd(){return this._isUTC?"UTC":""}function Zd(){return this._isUTC?"Coordinated Universal Time":""}var k=I.prototype;k.add=Ac,k.calendar=zc,k.clone=Zc,k.diff=rd,k.endOf=fd,k.format=od,k.from=ad,k.fromNow=ld,k.to=ud,k.toNow=cd,k.get=ql,k.invalidAt=wd,k.isAfter=Jc,k.isBefore=qc,k.isBetween=Kc,k.isSame=Xc,k.isSameOrAfter=ed,k.isSameOrBefore=td,k.isValid=vd,k.lang=Do,k.locale=To,k.localeData=So,k.max=vc,k.min=bc,k.parsingFlags=_d,k.set=Kl,k.startOf=dd,k.subtract=Wc,k.toArray=yd,k.toObject=gd,k.toDate=pd,k.toISOString=id,k.inspect=sd,typeof Symbol!="undefined"&&Symbol.for!=null&&(k[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),k.toJSON=bd,k.toString=nd,k.unix=hd,k.valueOf=md,k.creationData=xd,k.eraName=Sd,k.eraNarrow=Fd,k.eraAbbr=Rd,k.eraYear=Ed,k.year=so,k.isLeapYear=gu,k.weekYear=Nd,k.isoWeekYear=Cd,k.quarter=k.quarters=$d,k.month=no,k.daysInMonth=hu,k.week=k.weeks=ku,k.isoWeek=k.isoWeeks=Tu,k.weeksInYear=Pd,k.weeksInWeekYear=Ad,k.isoWeeksInYear=Id,k.isoWeeksInISOWeekYear=Bd,k.date=Uo,k.day=k.days=Cu,k.weekday=Iu,k.isoWeekday=Bu,k.dayOfYear=jd,k.hour=k.hours=Hu,k.minute=k.minutes=Vd,k.second=k.seconds=Hd,k.millisecond=k.milliseconds=Oo,k.utcOffset=Rc,k.utc=Mc,k.local=Uc,k.parseZone=Oc,k.hasAlignedHourOffset=Yc,k.isDST=Qc,k.isLocal=Nc,k.isUtcOffset=Cc,k.isUtc=vo,k.isUTC=vo,k.zoneAbbr=zd,k.zoneName=Zd,k.dates=de("dates accessor is deprecated. Use date instead.",Uo),k.months=de("months accessor is deprecated. Use month instead",no),k.years=de("years accessor is deprecated. Use year instead",so),k.zone=de("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ec),k.isDSTShifted=de("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Lc);function Jd(t){return le(t*1e3)}function qd(){return le.apply(null,arguments).parseZone()}function Yo(t){return t}var J=z.prototype;J.calendar=Cl,J.longDateFormat=Al,J.invalidDate=$l,J.ordinal=Hl,J.preparse=Yo,J.postformat=Yo,J.relativeTime=zl,J.pastFuture=Zl,J.set=B,J.eras=kd,J.erasParse=Td,J.erasConvertYear=Dd,J.erasAbbrRegex=Ud,J.erasNameRegex=Md,J.erasNarrowRegex=Od,J.months=cu,J.monthsShort=du,J.monthsParse=mu,J.monthsRegex=yu,J.monthsShortRegex=pu,J.week=vu,J.firstDayOfYear=xu,J.firstDayOfWeek=wu,J.weekdays=Ou,J.weekdaysMin=Qu,J.weekdaysShort=Yu,J.weekdaysParse=Nu,J.weekdaysRegex=Pu,J.weekdaysShortRegex=Au,J.weekdaysMinRegex=Wu,J.isPM=ju,J.meridiem=Gu;function Sn(t,s,a,u){var d=pt(),p=_().set(u,s);return d[a](p,t)}function Qo(t,s,a){if(m(t)&&(s=t,t=void 0),t=t||"",s!=null)return Sn(t,s,a,"month");var u,d=[];for(u=0;u<12;u++)d[u]=Sn(t,u,a,"month");return d}function ji(t,s,a,u){typeof t=="boolean"?(m(s)&&(a=s,s=void 0),s=s||""):(s=t,a=s,t=!1,m(s)&&(a=s,s=void 0),s=s||"");var d=pt(),p=t?d._week.dow:0,v,L=[];if(a!=null)return Sn(s,(a+p)%7,u,"day");for(v=0;v<7;v++)L[v]=Sn(s,(v+p)%7,u,"day");return L}function Kd(t,s){return Qo(t,s,"months")}function Xd(t,s){return Qo(t,s,"monthsShort")}function ef(t,s,a){return ji(t,s,a,"weekdays")}function tf(t,s,a){return ji(t,s,a,"weekdaysShort")}function rf(t,s,a){return ji(t,s,a,"weekdaysMin")}Ft("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var s=t%10,a=W(t%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th";return t+a}}),e.lang=de("moment.lang is deprecated. Use moment.locale instead.",Ft),e.langData=de("moment.langData is deprecated. Use moment.localeData instead.",pt);var yt=Math.abs;function nf(){var t=this._data;return this._milliseconds=yt(this._milliseconds),this._days=yt(this._days),this._months=yt(this._months),t.milliseconds=yt(t.milliseconds),t.seconds=yt(t.seconds),t.minutes=yt(t.minutes),t.hours=yt(t.hours),t.months=yt(t.months),t.years=yt(t.years),this}function Lo(t,s,a,u){var d=tt(s,a);return t._milliseconds+=u*d._milliseconds,t._days+=u*d._days,t._months+=u*d._months,t._bubble()}function sf(t,s){return Lo(this,t,s,1)}function of(t,s){return Lo(this,t,s,-1)}function No(t){return t<0?Math.floor(t):Math.ceil(t)}function af(){var t=this._milliseconds,s=this._days,a=this._months,u=this._data,d,p,v,L,P;return t>=0&&s>=0&&a>=0||t<=0&&s<=0&&a<=0||(t+=No(Vi(a)+s)*864e5,s=0,a=0),u.milliseconds=t%1e3,d=Ge(t/1e3),u.seconds=d%60,p=Ge(d/60),u.minutes=p%60,v=Ge(p/60),u.hours=v%24,s+=Ge(v/24),P=Ge(Co(s)),a+=P,s-=No(Vi(P)),L=Ge(a/12),a%=12,u.days=s,u.months=a,u.years=L,this}function Co(t){return t*4800/146097}function Vi(t){return t*146097/4800}function lf(t){if(!this.isValid())return NaN;var s,a,u=this._milliseconds;if(t=He(t),t==="month"||t==="quarter"||t==="year")switch(s=this._days+u/864e5,a=this._months+Co(s),t){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(s=this._days+Math.round(Vi(this._months)),t){case"week":return s/7+u/6048e5;case"day":return s+u/864e5;case"hour":return s*24+u/36e5;case"minute":return s*1440+u/6e4;case"second":return s*86400+u/1e3;case"millisecond":return Math.floor(s*864e5)+u;default:throw new Error("Unknown unit "+t)}}function uf(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+W(this._months/12)*31536e6:NaN}function gt(t){return function(){return this.as(t)}}var cf=gt("ms"),df=gt("s"),ff=gt("m"),mf=gt("h"),hf=gt("d"),pf=gt("w"),yf=gt("M"),gf=gt("Q"),bf=gt("y");function vf(){return tt(this)}function _f(t){return t=He(t),this.isValid()?this[t+"s"]():NaN}function At(t){return function(){return this.isValid()?this._data[t]:NaN}}var wf=At("milliseconds"),xf=At("seconds"),kf=At("minutes"),Tf=At("hours"),Df=At("days"),Sf=At("months"),Ff=At("years");function Rf(){return Ge(this.days()/7)}var bt=Math.round,ir={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Ef(t,s,a,u,d){return d.relativeTime(s||1,!!a,t,u)}function Mf(t,s,a,u){var d=tt(t).abs(),p=bt(d.as("s")),v=bt(d.as("m")),L=bt(d.as("h")),P=bt(d.as("d")),ne=bt(d.as("M")),Le=bt(d.as("w")),vt=bt(d.as("y")),Et=p<=a.ss&&["s",p]||p<a.s&&["ss",p]||v<=1&&["m"]||v<a.m&&["mm",v]||L<=1&&["h"]||L<a.h&&["hh",L]||P<=1&&["d"]||P<a.d&&["dd",P];return a.w!=null&&(Et=Et||Le<=1&&["w"]||Le<a.w&&["ww",Le]),Et=Et||ne<=1&&["M"]||ne<a.M&&["MM",ne]||vt<=1&&["y"]||["yy",vt],Et[2]=s,Et[3]=+t>0,Et[4]=u,Ef.apply(null,Et)}function Uf(t){return t===void 0?bt:typeof t=="function"?(bt=t,!0):!1}function Of(t,s){return ir[t]===void 0?!1:s===void 0?ir[t]:(ir[t]=s,t==="s"&&(ir.ss=s-1),!0)}function Yf(t,s){if(!this.isValid())return this.localeData().invalidDate();var a=!1,u=ir,d,p;return typeof t=="object"&&(s=t,t=!1),typeof t=="boolean"&&(a=t),typeof s=="object"&&(u=Object.assign({},ir,s),s.s!=null&&s.ss==null&&(u.ss=s.s-1)),d=this.localeData(),p=Mf(this,!a,u,d),a&&(p=d.pastFuture(+this,p)),d.postformat(p)}var Hi=Math.abs;function sr(t){return(t>0)-(t<0)||+t}function Fn(){if(!this.isValid())return this.localeData().invalidDate();var t=Hi(this._milliseconds)/1e3,s=Hi(this._days),a=Hi(this._months),u,d,p,v,L=this.asSeconds(),P,ne,Le,vt;return L?(u=Ge(t/60),d=Ge(u/60),t%=60,u%=60,p=Ge(a/12),a%=12,v=t?t.toFixed(3).replace(/\.?0+$/,""):"",P=L<0?"-":"",ne=sr(this._months)!==sr(L)?"-":"",Le=sr(this._days)!==sr(L)?"-":"",vt=sr(this._milliseconds)!==sr(L)?"-":"",P+"P"+(p?ne+p+"Y":"")+(a?ne+a+"M":"")+(s?Le+s+"D":"")+(d||u||t?"T":"")+(d?vt+d+"H":"")+(u?vt+u+"M":"")+(t?vt+v+"S":"")):"P0D"}var Z=_n.prototype;Z.isValid=Tc,Z.abs=nf,Z.add=sf,Z.subtract=of,Z.as=lf,Z.asMilliseconds=cf,Z.asSeconds=df,Z.asMinutes=ff,Z.asHours=mf,Z.asDays=hf,Z.asWeeks=pf,Z.asMonths=yf,Z.asQuarters=gf,Z.asYears=bf,Z.valueOf=uf,Z._bubble=af,Z.clone=vf,Z.get=_f,Z.milliseconds=wf,Z.seconds=xf,Z.minutes=kf,Z.hours=Tf,Z.days=Df,Z.weeks=Rf,Z.months=Sf,Z.years=Ff,Z.humanize=Yf,Z.toISOString=Fn,Z.toString=Fn,Z.toJSON=Fn,Z.locale=To,Z.localeData=So,Z.toIsoString=de("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Fn),Z.lang=Do,Q("X",0,0,"unix"),Q("x",0,0,"valueOf"),R("x",mn),R("X",eu),re("X",function(t,s,a){a._d=new Date(parseFloat(t)*1e3)}),re("x",function(t,s,a){a._d=new Date(W(t))});return e.version="2.29.4",r(le),e.fn=k,e.min=_c,e.max=wc,e.now=xc,e.utc=_,e.unix=Jd,e.months=Kd,e.isDate=h,e.locale=Ft,e.invalid=S,e.duration=tt,e.isMoment=A,e.weekdays=ef,e.parseZone=qd,e.localeData=pt,e.isDuration=wn,e.monthsShort=Xd,e.weekdaysMin=rf,e.defineLocale=Yi,e.updateLocale=qu,e.locales=Ku,e.weekdaysShort=tf,e.normalizeUnits=He,e.relativeTimeRounding=Uf,e.relativeTimeThreshold=Of,e.calendarFormat=Gc,e.prototype=k,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var fh={};Af(fh,{default:()=>ki});module.exports=Wf(fh);var Qr=class{constructor(e){this.plugin=e}startPeriodicTask(){let e=!0;this.periodicTask().finally(()=>{e=!1}),this.plugin.registerInterval(window.setInterval(()=>{if(e){console.log("Skip reminder interval task because task is already running.");return}e=!0,this.periodicTask().finally(()=>{e=!1})},this.plugin.settings.reminderCheckIntervalSec.value*1e3))}async periodicTask(){if(this.plugin.ui.reload(!1),this.plugin.data.scanned.value||this.plugin.fileSystem.reloadRemindersInAllFiles().then(()=>{this.plugin.data.scanned.value=!0,this.plugin.data.save()}),this.plugin.data.save(!1),this.plugin.ui.isEditing())return;let e=this.plugin.reminders.getExpiredReminders(this.plugin.settings.reminderTime.value),r;for(let i of e)if(this.plugin.app.workspace.layoutReady){if(i.muteNotification)continue;if(r)for(;r.beingDisplayed;)await this.sleep(100);this.plugin.ui.showReminder(i),r=i}}async sleep(e){return new Promise(r=>setTimeout(r,e))}};var It=require("obsidian");var Wa=require("obsidian");function Bo(n,e){return n||e.fileSystem.reloadRemindersInAllFiles(),!0}function Po(n,e){return n||e.showReminderList(),!0}var Ao=window.require?window.require("electron"):void 0;async function Wo(n,e){return Ao&&(await Ao.remote.dialog.showMessageBox({type:"question",title:"Obsidian Reminder",message:n,detail:e,buttons:["OK","Cancel"],cancelId:1})).response===0?0:1}var Mt=class Mt{constructor(e,r,i,o,l){this.lineIndex=e;this.prefix=r;this.check=i;this.suffix=o;this.body=l}static parse(e,r){let i=Mt.regexp.exec(r);return i?new Mt(e,i.groups.prefix,i.groups.check,i.groups.suffix,i.groups.body):null}toMarkdown(){return`${this.prefix}${this.check}${this.suffix}${this.body}`}isChecked(){return Mt.checkedStatuses.some(e=>e===this.check)}setChecked(e){this.check=e?"x":" "}getHeaderLength(){return this.prefix.length+this.check.length+this.suffix.length}clone(){return Mt.parse(this.lineIndex,this.toMarkdown())}};g(Mt,"regexp",/^(?<prefix>((> ?)*)?\s*[-*][ ]+\[)(?<check>.)(?<suffix>\]\s+)(?<body>.*)$/),g(Mt,"checkedStatuses",["x","-"]);var Lr=Mt,Nr=class{constructor(e,r){this.file=e;g(this,"lines",[]);g(this,"todos",[]);this.parse(r)}parse(e){this.lines=e.split(`
`),this.todos=[],this.lines.forEach((r,i)=>{let o=Lr.parse(i,r);o&&this.todos.push(o)})}getTodos(){return this.todos}insertTodo(e,r){r.lineIndex=e,this.lines.splice(e,0,r.toMarkdown());let i=-1;for(let o in this.todos){let l=this.todos[o];l.lineIndex>=e&&(i<0&&(i=parseInt(o)),l.lineIndex++)}i<=0?this.todos.splice(0,0,r):this.todos.splice(i,0,r)}getTodo(e){let r=this.todos.find(i=>i.lineIndex===e);return r==null?null:r}applyChanges(){this.todos.forEach(e=>{this.lines[e.lineIndex]=e.toMarkdown()})}toMarkdown(){return this.applyChanges(),this.lines.join(`
`)}};var or=class{constructor(e){this._value=e}get value(){return this._value}},$t=class{constructor(e){this._value=e;g(this,"onChangeFunctions",[])}onChanged(e){this.onChangeFunctions.push(e)}get value(){return this._value}set value(e){let r=this._value;this._value=e,this.onChangeFunctions.forEach(i=>{i(r,e)})}};var ze=Wt(Ut(),1);var H=class n{constructor(e,r){this.time=e;this._hasTimePart=r}static now(){return new n((0,ze.default)(),!0)}static parse(e){return e.length>10?new n((0,ze.default)(e,"YYYY-MM-DD HH:mm"),!0):new n((0,ze.default)(e,"YYYY-MM-DD"),!1)}static duration(e,r,i,o){return r.fixedTime(o).diff(e.fixedTime(o),i)}getTimeInMillis(e){return this.fixedTime(e).valueOf()}format(e,r){return this.fixedTime(r).format(e)}toYYYYMMMM(e){return this.fixedTime(e).format("YYYY, MMMM")}toYYYYMMDD(e){return this.fixedTime(e).format("YYYY-MM-DD")}add(e,r,i){return new n(this.fixedTime(i).clone().add(e,r),this._hasTimePart)}fixedTime(e){return this._hasTimePart?this.time:e===void 0?this.time:this.time.clone().add(e.minutes,"minutes")}get hasTimePart(){return this._hasTimePart}moment(){return this.time}isValid(){return this.time.isValid()}clone(e){let r=e==null?this._hasTimePart:e,i=this.time.clone();return new n(i,r)}toString(){return this._hasTimePart?this.format("YYYY-MM-DD HH:mm"):this.format("YYYY-MM-DD")}equals(e){return this._hasTimePart===e._hasTimePart&&this.time.isSame(e.time)}},Rn=class n{constructor(e,r){this.hour=e;this.minute=r}static parse(e){if(!e.match(/^\d{1,2}:\d{1,2}$/))throw`Unexpected format time(${e}). Time must be HH:mm.`;let r=e.split(":");if(r.length!==2)throw`Unexpected format time(${e}). time must be HH:mm.`;let i=parseInt(r[0]),o=parseInt(r[1]);if(i>23||i<0)throw"hour must be 0~23";if(o>59||o<0)throw"minute must be 0~59";return new n(i,o)}get minutes(){return this.hour*60+this.minute}toString(){let e=r=>r<10?"0"+r:""+r;return`${e(this.hour)}:${e(this.minute)}`}};function lr(n,e){return()=>new H((0,ze.default)(),!0).add(n,e)}function $o(n){return lr(n,"minutes")}function zi(n){return lr(n,"hours")}function $f(n){return lr(n,"days")}function jf(n){return lr(n,"weeks")}function Vf(n){return lr(n,"months")}function Hf(n){return lr(n,"years")}function jt(n){return()=>{let e=(0,ze.default)();return e.isoWeekday()<=n?new H(e.isoWeekday(n),!1):new H(e.add(1,"weeks").isoWeekday(n),!1)}}function Zi(){return()=>new H((0,ze.default)().add(1,"days"),!1)}function jo(){return()=>new H((0,ze.default)().add(1,"weeks"),!1)}function Gf(){return()=>new H((0,ze.default)().add(1,"months"),!1)}function zf(){return()=>new H((0,ze.default)().add(1,"years"),!1)}var ue=class{constructor(e,r){this.label=e;this.later=r}};function Vo(n){return n.split(`
`).map(e=>Zf(e.trim()))}function Zf(n){if(n=n.toLowerCase(),n.startsWith("in")){let e=n.split(" ");if(e.length!==3)throw"Unsupported format. Should be 'In N (minutes|hours)'";let r=e[1]==="a"||e[1]==="an"?1:parseInt(e[1]);switch(e[2]){case"minute":case"minutes":{let i=r==1?"minute":"minutes";return new ue(`In ${r} ${i}`,$o(r))}case"hour":case"hours":{let i=r==1?"hour":"hours";return new ue(`In ${r} ${i}`,zi(r))}case"day":case"days":{let i=r==1?"day":"days";return new ue(`In ${r} ${i}`,$f(r))}case"week":case"weeks":{let i=r==1?"week":"weeks";return new ue(`In ${r} ${i}`,jf(r))}case"month":case"months":{let i=r==1?"month":"months";return new ue(`In ${r} ${i}`,Vf(r))}case"year":case"years":{let i=r==1?"year":"years";return new ue(`In ${r} ${i}`,Hf(r))}}}else if(n.startsWith("next")){let e=n.substring(5);switch(e){case"sunday":return new ue("Next Sunday",jt(0));case"monday":return new ue("Next Monday",jt(1));case"tuesday":return new ue("Next Tuesday",jt(2));case"wednesday":return new ue("Next Wednesday",jt(3));case"thursday":return new ue("Next Thursday",jt(4));case"friday":return new ue("Next Friday",jt(5));case"saturday":return new ue("Next Saturday",jt(6));case"day":return new ue("Tomorrow",Zi());case"week":return new ue("Next week",jo());case"month":return new ue("Next month",Gf());case"year":return new ue("Next year",zf());default:throw`Unsupported weekday: ${e}`}}else if(n==="tomorrow")return new ue("Tomorrow",Zi());throw`Unsupported format: ${n}`}var kh=[new ue("In 30 minutes",$o(30)),new ue("In 1 hours",zi(1)),new ue("In 3 hours",zi(3)),new ue("Tomorrow",Zi()),new ue("Next week",jo())],Ji=class{constructor(){g(this,"dateFormat",new or("YYYY-MM-DD"));g(this,"dateTimeFormat",new or("YYYY-MM-DD HH:mm"));g(this,"strict",new or(!1))}setTimeFormat(e,r,i){this.dateFormat=e,this.dateTimeFormat=r,this.strict=i}parse(e){let r=this.doParse(e,!0);return r!=null?r:this.strict.value?null:this.doParse(e,!1)}doParse(e,r){let i=(0,ze.default)(e,this.dateTimeFormat.value,r);if(i.isValid())return new H(i,!0);let o=(0,ze.default)(e,this.dateFormat.value,r);return o.isValid()?new H(o,!1):null}toString(e){return e.hasTimePart?e.format(this.dateTimeFormat.value):e.format(this.dateFormat.value)}},ot=new Ji;var ur=class{constructor(e,r,i,o,l){this.file=e;this.title=r;this.time=i;this.rowNumber=o;this.done=l;g(this,"muteNotification",!1);g(this,"beingDisplayed",!1)}key(){return this.file+this.title+this.time.toString()}equals(e){return this.rowNumber===e.rowNumber&&this.title===e.title&&this.time.equals(e.time)&&this.file===e.file}getFileName(){let e=this.file.split(/[/\\]/);return e[e.length-1].replace(/^(.*?)(\..+)?$/,"$1")}static extractFileName(e){let r=e.split(/[/\\]/);return r[r.length-1].replace(/^(.*?)(\..+)?$/,"$1")}},En=class{constructor(e){this.onChange=e;g(this,"fileToReminders",new Map);g(this,"reminders",[]);g(this,"reminderTime")}getExpiredReminders(e){let r=new Date().getTime(),i=[];for(let o=0;o<this.reminders.length;o++){let l=this.reminders[o];if(l.time.getTimeInMillis(e)<=r)i.push(l);else break}return i}byDate(e){return this.reminders.filter(r=>r.time.toYYYYMMDD()===e.toYYYYMMDD())}removeReminder(e){console.debug("Remove reminder: %o",e),this.reminders.remove(e);let r=this.fileToReminders.get(e.file);r&&(r.remove(e),r.length===0&&this.fileToReminders.delete(e.file)),this.onChange()}clear(){this.fileToReminders.clear(),this.reminders=[],this.onChange()}removeByFile(e){return this.fileToReminders.delete(e)?(this.sortReminders(),!0):!1}replaceFile(e,r){let i=this.fileToReminders.get(e);if(i){if(this.equals(i,r))return!1;let o=new Map;for(let l of i)o.set(l.key(),l.muteNotification);for(let l of r){let c=o.get(l.key());o.set(l.key(),l.muteNotification),c!==void 0&&(l.muteNotification=c)}}return this.fileToReminders.set(e,r),this.sortReminders(),!0}equals(e,r){if(e.length!==r.length)return!1;this.sort(e),this.sort(r);for(let i in e){let o=e[i],l=r[i];if(o==null&&l!=null||l==null&&o!=null)return!1;if(!(o==null&&l==null)&&!o.equals(l))return!1}return!0}sortReminders(){let e=[];for(let r of this.fileToReminders.values())e.push(...r);this.sort(e),this.reminders=e,this.onChange()}sort(e){e.sort((r,i)=>{var l,c;let o=r.time.getTimeInMillis((l=this.reminderTime)==null?void 0:l.value)-i.time.getTimeInMillis((c=this.reminderTime)==null?void 0:c.value);return o>0?1:o<0?-1:0})}};function Ho(n,e,r){let i=H.duration(e,n,"days",r);if(i>30)return new Ot(n.toYYYYMMMM(r),o=>o.format("MM/DD",r));if(i>=7)return new Ot("Over 1 week",o=>o.format("MM/DD",r));if(n.toYYYYMMDD(r)===e.toYYYYMMDD(r)){let o=new Ot("Today",l=>l.format("HH:mm",r));return o.isToday=!0,o}return n.toYYYYMMDD(r)===e.add(1,"days",r).toYYYYMMDD()?new Ot("Tomorrow",o=>o.format("HH:mm",r)):new Ot(n.format("M/DD (ddd)",r),o=>o.format("HH:mm",r))}var Ot=class{constructor(e,r){this.name=e;this.timeToStringFunc=r;g(this,"isToday",!1);g(this,"isOverdue",!1)}timeToString(e){return this.timeToStringFunc(e)}};function Go(n,e){let r=H.now(),i=[],o=[],l=[],c=Ho(r,r,e);for(let f=0;f<n.length;f++){let m=n[f];if(m.muteNotification){l.push(m);continue}let h=Ho(m.time,r,e);h.name!==c.name&&((o.length>0||c.isToday)&&i.push(new Cr(c,o)),o=[]),o.push(m),c=h}if(o.length>0&&i.push(new Cr(c,o)),l.length>0){let f=new Ot("Overdue",m=>m.format("HH:mm",e));f.isOverdue=!0,i.splice(0,0,new Cr(f,l)),console.log(f),console.log(i)}return i}var Cr=class{constructor(e,r){this.group=e;this.reminders=r}get name(){return this.group.name}get isOverdue(){return this.group.isOverdue}timeToString(e){return this.group.timeToString(e)}};var Ze=class Ze{constructor(e,r){this.key=e;this.defaultValue=r}};g(Ze,"now",new Ze("now",H.now())),g(Ze,"useCustomEmojiForTasksPlugin",new Ze("useCustomEmojiForTasksPlugin",!1)),g(Ze,"removeTagsForTasksPlugin",new Ze("removeTagsForTasksPlugin",!1)),g(Ze,"linkDatesToDailyNotes",new Ze("linkDatesToDailyNotes",!1)),g(Ze,"strictDateFormat",new Ze("strictDateFormat",!1));var Ne=Ze,Ir=class{constructor(){g(this,"parameters",new Map)}setParameter(e,r){this.parameters.set(e.key,()=>r.value)}setParameterFunc(e,r){this.parameters.set(e.key,r)}setParameterValue(e,r){this.parameters.set(e.key,()=>r)}getParameter(e){let r=this.parameters.get(e.key);return r==null?e.defaultValue:r()}},Yt=class{constructor(){g(this,"config",new Ir)}setConfig(e){this.config=e}parse(e){return e.getTodos().map(r=>{let i=this.parseValidReminder(r);if(i==null)return null;let o=i.getTitle();if(o==null)return null;let l=i.getTime();return l==null?null:new ur(e.file,o,l,r.lineIndex,r.isChecked())}).filter(r=>r!=null)}async modify(e,r,i){let o=e.getTodo(r.rowNumber);if(o===null)return console.warn("Not a todo: reminder=%o",r),!1;let l=this.parseValidReminder(o);return l===null||!this.modifyReminder(e,o,l,i)?!1:(o.body=l.toMarkdown(),!0)}parseValidReminder(e){let r=this.parseReminder(e);return r===null||!this.isValidReminder(r)?null:r}isValidReminder(e){return e.getTime()!==null}modifyReminder(e,r,i,o){if(o.rawTime!==void 0){if(!i.setRawTime(o.rawTime))return console.warn("The reminder doesn't support raw time: parsed=%o",i),!1}else o.time!==void 0&&i.setTime(o.time);return o.checked!==void 0&&r.setChecked(o.checked),!0}appendReminder(e,r,i){let o=Lr.parse(0,e);if(o==null)return null;let l=this.parseReminder(o),c=o.getHeaderLength();return i!=null&&(i-=c),l!=null?l.setTime(r,i):(l=this.newReminder(o.body,r,i),l.setTime(r)),o.body=l.toMarkdown(),{insertedLine:o.toMarkdown(),caretPosition:c+l.getEndOfTimeTextIndex()}}isStrictDateFormat(){return this.config.getParameter(Ne.strictDateFormat)}},Mn=class{constructor(){g(this,"config");g(this,"formats",[])}setConfig(e){this.config=e,this.syncConfig()}parse(e){let r=[];for(let i of this.formats){let o=i.parse(e);o!=null&&r.push(...o)}return r}async modify(e,r,i){for(let o of this.formats)if(await o.modify(e,r,i))return!0;return!1}resetFormat(e){this.formats=e,this.syncConfig()}syncConfig(){this.config!=null&&this.formats.forEach(e=>e.setConfig(this.config))}appendReminder(e,r){return this.formats[0]==null?null:this.formats[0].appendReminder(e,r)}};var Br=class Br{constructor(e,r,i,o){this.linkDatesToDailyNotes=e;this.title1=r;this.time=i;this.title2=o}static parse(e,r){r==null&&(r=!1);let i=Br.regexp.exec(e);if(i==null)return null;let o=i.groups.title1,l=i.groups.time;if(l==null)return null;let c=i.groups.title2;return r&&(l=l.replace("[[",""),l=l.replace("]]","")),new Br(r,o,l,c)}getTitle(){return`${this.title1.trim()} ${this.title2.trim()}`.trim()}getTime(){return ot.parse(this.time)}setTime(e){this.time=ot.toString(e)}setRawTime(e){return this.time=e,!0}getEndOfTimeTextIndex(){return this.toMarkdown().length-this.title2.length}toMarkdown(){let e=`${this.title1}(@${this.time})${this.title2}`;if(!this.linkDatesToDailyNotes)return e;let r=ot.parse(this.time);if(!r)return e;let i=ot.toString(r.clone(!1));return e.replace(i,`[[${i}]]`)}};g(Br,"regexp",/^(?<title1>.*?)\(@(?<time>.+?)\)(?<title2>.*)$/);var Un=Br,On=class On extends Yt{parseReminder(e){return Un.parse(e.body,this.linkDatesToDailyNotes())}newReminder(e,r,i){let o,l;return i!=null?(o=e.substring(0,i),l=e.substring(i)):(o=e,l=""),new Un(this.linkDatesToDailyNotes(),o,r.toString(),l)}linkDatesToDailyNotes(){return this.config.getParameter(Ne.linkDatesToDailyNotes)}};g(On,"instance",new On);var cr=On;var qi=Wt(Ut(),1);function Yn(n){return n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}var Jf=new class{get dateTrigger(){return this.get("date-trigger","@")}get dateFormat(){return this.get("date-format","YYYY-MM-DD")}get timeTrigger(){return this.get("time-trigger","@@")}get timeFormat(){return this.get("time-format","HH:mm")}get linkDateToDailyNote(){return this.get("link-date-to-daily-note",!1)}get(e,r){var f,m;if(!window)return r;let i=(m=(f=window==null?void 0:window.app)==null?void 0:f.plugins)==null?void 0:m.plugins;if(!i)return r;let o=i["obsidian-kanban"];if(!o||!o.settings)return r;let c=o.settings[e];return c==null?r:c}},Cn=class Cn{constructor(e){this.setting=e;g(this,"dateRegExp");g(this,"timeRegExp");let r;e.linkDateToDailyNote?r=`${Yn(this.setting.dateTrigger)}\\[\\[(?<date>.+?)\\]\\]`:r=`${Yn(this.setting.dateTrigger)}\\{(?<date>.+?)\\}`;let i=`${Yn(this.setting.timeTrigger)}\\{(?<time>.+?)\\}`;this.dateRegExp=new RegExp(r),this.timeRegExp=new RegExp(i)}format(e){let r;return this.setting.linkDateToDailyNote?r=`${this.setting.dateTrigger}[[${e.format(this.setting.dateFormat)}]]`:r=`${this.setting.dateTrigger}{${e.format(this.setting.dateFormat)}}`,e.hasTimePart?`${r} ${this.setting.timeTrigger}{${e.format(this.setting.timeFormat)}}`:r}split(e,r){let i=e,o,l,c=this.dateRegExp.exec(e);if(c)o=c.groups.date,e=e.replace(this.dateRegExp,"");else return{title:i};let f=this.timeRegExp.exec(e);f&&(l=f.groups.time,e=e.replace(this.timeRegExp,""));let m=e.trim(),h,y=r!=null?r:!0;return l?h=new H((0,qi.default)(`${o} ${l}`,`${this.setting.dateFormat} ${this.setting.timeFormat}`,y),!0):h=new H((0,qi.default)(o,this.setting.dateFormat,y),!1),h.isValid()?{title:m,time:h}:{title:i}}};g(Cn,"instance",new Cn(Jf));var Qn=Cn,Ln=class n{constructor(e,r){this.title=e;this.time=r}static parse(e,r){let i=Qn.instance.split(e,r);return i.time==null?null:new n(i.title,i.time)}getTitle(){return this.title.trim()}getTime(){return this.time?this.time:null}setTime(e){this.time=e}setRawTime(){return!1}getEndOfTimeTextIndex(){return this.toMarkdown().length}toMarkdown(){return`${this.title.trim()} ${Qn.instance.format(this.time)}`}},In=class In extends Yt{parseReminder(e){return Ln.parse(e.body,this.isStrictDateFormat())}newReminder(e,r){let i=new Ln(e,r);return i.setTime(r),i}};g(In,"instance",new In);var Nn=In;var Zr=Wt(Ut(),1);var Pr=["MO","TU","WE","TH","FR","SA","SU"],be=function(){function n(e,r){if(r===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=r}return n.fromStr=function(e){return new n(Pr.indexOf(e))},n.prototype.nth=function(e){return this.n===e?this:new n(this.weekday,e)},n.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},n.prototype.toString=function(){var e=Pr[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},n.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},n}();var se=function(n){return n!=null},$e=function(n){return typeof n=="number"},Ki=function(n){return typeof n=="string"&&Pr.includes(n)},Te=Array.isArray,Je=function(n,e){e===void 0&&(e=n),arguments.length===1&&(e=n,n=0);for(var r=[],i=n;i<e;i++)r.push(i);return r};var V=function(n,e){var r=0,i=[];if(Te(n))for(;r<e;r++)i[r]=[].concat(n);else for(;r<e;r++)i[r]=n;return i},zo=function(n){return Te(n)?n:[n]};function Vt(n,e,r){r===void 0&&(r=" ");var i=String(n);return e=e>>0,i.length>e?String(i):(e=e-i.length,e>r.length&&(r+=V(r,e/r.length)),r.slice(0,e)+String(i))}var Zo=function(n,e,r){var i=n.split(e);return r?i.slice(0,r).concat([i.slice(r).join(e)]):i},Me=function(n,e){var r=n%e;return r*e<0?r+e:r},Bn=function(n,e){return{div:Math.floor(n/e),mod:Me(n,e)}},je=function(n){return!se(n)||n.length===0},ge=function(n){return!je(n)},G=function(n,e){return ge(n)&&n.indexOf(e)!==-1};var at=function(n,e,r,i,o,l){return i===void 0&&(i=0),o===void 0&&(o=0),l===void 0&&(l=0),new Date(Date.UTC(n,e-1,r,i,o,l))},qf=[31,28,31,30,31,30,31,31,30,31,30,31],qo=1e3*60*60*24,Pn=9999,Ko=at(1970,1,1),Kf=[6,0,1,2,3,4,5];var dr=function(n){return n%4===0&&n%100!==0||n%400===0},Xi=function(n){return n instanceof Date},Ht=function(n){return Xi(n)&&!isNaN(n.getTime())};var Xf=function(n,e){var r=n.getTime(),i=e.getTime(),o=r-i;return Math.round(o/qo)},Ar=function(n){return Xf(n,Ko)},An=function(n){return new Date(Ko.getTime()+n*qo)},em=function(n){var e=n.getUTCMonth();return e===1&&dr(n.getUTCFullYear())?29:qf[e]},_t=function(n){return Kf[n.getUTCDay()]},es=function(n,e){var r=at(n,e+1,1);return[_t(r),em(r)]},Wn=function(n,e){return e=e||n,new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},$n=function(n){var e=new Date(n.getTime());return e},ts=function(n){for(var e=[],r=0;r<n.length;r++)e.push($n(n[r]));return e},wt=function(n){n.sort(function(e,r){return e.getTime()-r.getTime()})},fr=function(n,e){e===void 0&&(e=!0);var r=new Date(n);return[Vt(r.getUTCFullYear().toString(),4,"0"),Vt(r.getUTCMonth()+1,2,"0"),Vt(r.getUTCDate(),2,"0"),"T",Vt(r.getUTCHours(),2,"0"),Vt(r.getUTCMinutes(),2,"0"),Vt(r.getUTCSeconds(),2,"0"),e?"Z":""].join("")},Wr=function(n){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,r=e.exec(n);if(!r)throw new Error("Invalid UNTIL value: ".concat(n));return new Date(Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[5],10)||0,parseInt(r[6],10)||0,parseInt(r[7],10)||0))},Jo=function(n,e){var r=n.toLocaleString("sv-SE",{timeZone:e});return r.replace(" ","T")+"Z"},Xo=function(n,e){var r=Intl.DateTimeFormat().resolvedOptions().timeZone,i=new Date(Jo(n,r)),o=new Date(Jo(n,e!=null?e:"UTC")),l=o.getTime()-i.getTime();return new Date(n.getTime()-l)};var tm=function(){function n(e,r){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=r,e==="between"?(this.maxDate=r.inc?r.before:new Date(r.before.getTime()-1),this.minDate=r.inc?r.after:new Date(r.after.getTime()+1)):e==="before"?this.maxDate=r.inc?r.dt:new Date(r.dt.getTime()-1):e==="after"&&(this.minDate=r.inc?r.dt:new Date(r.dt.getTime()+1))}return n.prototype.accept=function(e){++this.total;var r=this.minDate&&e<this.minDate,i=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(r)return!0;if(i)return!1}else if(this.method==="before"){if(i)return!1}else if(this.method==="after")return r?!0:(this.add(e),!1);return this.add(e)},n.prototype.add=function(e){return this._result.push(e),!0},n.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},n.prototype.clone=function(){return new n(this.method,this.args)},n}(),xt=tm;var rs=function(n,e){return rs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},rs(n,e)};function mr(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rs(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var De=function(){return De=Object.assign||function(e){for(var r,i=1,o=arguments.length;i<o;i++){r=arguments[i];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e},De.apply(this,arguments)};function D(n,e,r){if(r||arguments.length===2)for(var i=0,o=e.length,l;i<o;i++)(l||!(i in e))&&(l||(l=Array.prototype.slice.call(e,0,i)),l[i]=e[i]);return n.concat(l||Array.prototype.slice.call(e))}var rm=function(n){mr(e,n);function e(r,i,o){var l=n.call(this,r,i)||this;return l.iterator=o,l}return e.prototype.add=function(r){return this.iterator(r,this._result.length)?(this._result.push(r),!0):!1},e}(xt),ns=rm;var nm={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}},Gt=nm;var ea=function(n,e){return n.indexOf(e)!==-1},im=function(n){return n.toString()},sm=function(n,e,r){return"".concat(e," ").concat(r,", ").concat(n)},om=function(){function n(e,r,i,o){if(r===void 0&&(r=im),i===void 0&&(i=Gt),o===void 0&&(o=sm),this.text=[],this.language=i||Gt,this.gettext=r,this.dateFormatter=o,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var l=[].concat(this.options.bymonthday),c=[].concat(this.options.bynmonthday);l.sort(function(y,w){return y-w}),c.sort(function(y,w){return w-y}),this.bymonthday=l.concat(c),this.bymonthday.length||(this.bymonthday=null)}if(se(this.origOptions.byweekday)){var f=Te(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],m=String(f);this.byweekday={allWeeks:f.filter(function(y){return!y.n}),someWeeks:f.filter(function(y){return!!y.n}),isWeekdays:m.indexOf("MO")!==-1&&m.indexOf("TU")!==-1&&m.indexOf("WE")!==-1&&m.indexOf("TH")!==-1&&m.indexOf("FR")!==-1&&m.indexOf("SA")===-1&&m.indexOf("SU")===-1,isEveryDay:m.indexOf("MO")!==-1&&m.indexOf("TU")!==-1&&m.indexOf("WE")!==-1&&m.indexOf("TH")!==-1&&m.indexOf("FR")!==-1&&m.indexOf("SA")!==-1&&m.indexOf("SU")!==-1};var h=function(y,w){return y.weekday-w.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 n.isFullyConvertible=function(e){var r=!0;if(!(e.options.freq in n.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var i in e.origOptions){if(ea(["dtstart","tzid","wkst","freq"],i))return!0;if(!ea(n.IMPLEMENTED[e.options.freq],i))return!1}return r},n.prototype.isFullyConvertible=function(){return n.isFullyConvertible(this.rrule)},n.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in n.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[O.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var r=this.options.until;this.add(this.dateFormatter(r.getUTCFullYear(),this.language.monthNames[r.getUTCMonth()],r.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},n.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},n.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},n.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},n.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},n.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},n.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},n.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},n.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},n.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},n.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},n.prototype.nth=function(e){e=parseInt(e.toString(),10);var r,i=this.gettext;if(e===-1)return i("last");var o=Math.abs(e);switch(o){case 1:case 21:case 31:r=o+i("st");break;case 2:case 22:r=o+i("nd");break;case 3:case 23:r=o+i("rd");break;default:r=o+i("th")}return e<0?r+" "+i("last"):r},n.prototype.monthtext=function(e){return this.language.monthNames[e-1]},n.prototype.weekdaytext=function(e){var r=$e(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[r]},n.prototype.plural=function(e){return e%100!==1},n.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},n.prototype.list=function(e,r,i,o){var l=this;o===void 0&&(o=","),Te(e)||(e=[e]);var c=function(m,h,y){for(var w="",_=0;_<m.length;_++)_!==0&&(_===m.length-1?w+=" "+y+" ":w+=h+" "),w+=m[_];return w};r=r||function(m){return m.toString()};var f=function(m){return r&&r.call(l,m)};return i?c(e.map(f),o,i):e.map(f).join(o+" ")},n}(),lt=om;var am=function(){function n(e){this.done=!0,this.rules=e}return n.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},n.prototype.isDone=function(){return this.done&&this.symbol===null},n.prototype.nextSymbol=function(){var e,r;this.symbol=null,this.value=null;do{if(this.done)return!1;var i=void 0;e=null;for(var o in this.rules){i=this.rules[o];var l=i.exec(this.text);l&&(e===null||l[0].length>e[0].length)&&(e=l,r=o)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(r==="SKIP");return this.symbol=r,this.value=e,!0},n.prototype.accept=function(e){if(this.symbol===e){if(this.value){var r=this.value;return this.nextSymbol(),r}return this.nextSymbol(),!0}return!1},n.prototype.acceptNumber=function(){return this.accept("number")},n.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},n}();function $r(n,e){e===void 0&&(e=Gt);var r={},i=new am(e.tokens);if(!i.start(n))return null;return o(),r;function o(){i.expect("every");var _=i.acceptNumber();if(_&&(r.interval=parseInt(_[0],10)),i.isDone())throw new Error("Unexpected end");switch(i.symbol){case"day(s)":r.freq=O.DAILY,i.nextSymbol()&&(c(),w());break;case"weekday(s)":r.freq=O.WEEKLY,r.byweekday=[O.MO,O.TU,O.WE,O.TH,O.FR],i.nextSymbol(),c(),w();break;case"week(s)":r.freq=O.WEEKLY,i.nextSymbol()&&(l(),c(),w());break;case"hour(s)":r.freq=O.HOURLY,i.nextSymbol()&&(l(),w());break;case"minute(s)":r.freq=O.MINUTELY,i.nextSymbol()&&(l(),w());break;case"month(s)":r.freq=O.MONTHLY,i.nextSymbol()&&(l(),w());break;case"year(s)":r.freq=O.YEARLY,i.nextSymbol()&&(l(),w());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":r.freq=O.WEEKLY;var x=i.symbol.substr(0,2).toUpperCase();if(r.byweekday=[O[x]],!i.nextSymbol())return;for(;i.accept("comma");){if(i.isDone())throw new Error("Unexpected end");var b=m();if(!b)throw new Error("Unexpected symbol "+i.symbol+", expected weekday");r.byweekday.push(O[b]),i.nextSymbol()}c(),y(),w();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(r.freq=O.YEARLY,r.bymonth=[f()],!i.nextSymbol())return;for(;i.accept("comma");){if(i.isDone())throw new Error("Unexpected end");var T=f();if(!T)throw new Error("Unexpected symbol "+i.symbol+", expected month");r.bymonth.push(T),i.nextSymbol()}l(),w();break;default:throw new Error("Unknown symbol")}}function l(){var _=i.accept("on"),x=i.accept("the");if(_||x)do{var b=h(),T=m(),F=f();if(b)T?(i.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(O[T].nth(b))):(r.bymonthday||(r.bymonthday=[]),r.bymonthday.push(b),i.accept("day(s)"));else if(T)i.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(O[T]);else if(i.symbol==="weekday(s)")i.nextSymbol(),r.byweekday||(r.byweekday=[O.MO,O.TU,O.WE,O.TH,O.FR]);else if(i.symbol==="week(s)"){i.nextSymbol();var S=i.acceptNumber();if(!S)throw new Error("Unexpected symbol "+i.symbol+", expected week number");for(r.byweekno=[parseInt(S[0],10)];i.accept("comma");){if(S=i.acceptNumber(),!S)throw new Error("Unexpected symbol "+i.symbol+"; expected monthday");r.byweekno.push(parseInt(S[0],10))}}else if(F)i.nextSymbol(),r.bymonth||(r.bymonth=[]),r.bymonth.push(F);else return}while(i.accept("comma")||i.accept("the")||i.accept("on"))}function c(){var _=i.accept("at");if(_)do{var x=i.acceptNumber();if(!x)throw new Error("Unexpected symbol "+i.symbol+", expected hour");for(r.byhour=[parseInt(x[0],10)];i.accept("comma");){if(x=i.acceptNumber(),!x)throw new Error("Unexpected symbol "+i.symbol+"; expected hour");r.byhour.push(parseInt(x[0],10))}}while(i.accept("comma")||i.accept("at"))}function f(){switch(i.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 m(){switch(i.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return i.symbol.substr(0,2).toUpperCase();default:return!1}}function h(){switch(i.symbol){case"last":return i.nextSymbol(),-1;case"first":return i.nextSymbol(),1;case"second":return i.nextSymbol(),i.accept("last")?-2:2;case"third":return i.nextSymbol(),i.accept("last")?-3:3;case"nth":var _=parseInt(i.value[1],10);if(_<-366||_>366)throw new Error("Nth out of range: "+_);return i.nextSymbol(),i.accept("last")?-_:_;default:return!1}}function y(){i.accept("on"),i.accept("the");var _=h();if(_)for(r.bymonthday=[_],i.nextSymbol();i.accept("comma");){if(_=h(),!_)throw new Error("Unexpected symbol "+i.symbol+"; expected monthday");r.bymonthday.push(_),i.nextSymbol()}}function w(){if(i.symbol==="until"){var _=Date.parse(i.text);if(!_)throw new Error("Cannot parse until date:"+i.text);r.until=new Date(_)}else i.accept("for")&&(r.count=parseInt(i.value[0],10),i.expect("number"))}}var $;(function(n){n[n.YEARLY=0]="YEARLY",n[n.MONTHLY=1]="MONTHLY",n[n.WEEKLY=2]="WEEKLY",n[n.DAILY=3]="DAILY",n[n.HOURLY=4]="HOURLY",n[n.MINUTELY=5]="MINUTELY",n[n.SECONDLY=6]="SECONDLY"})($||($={}));function jr(n){return n<$.HOURLY}var ta=function(n,e){return e===void 0&&(e=Gt),new O($r(n,e)||void 0)},hr=["count","until","interval","byweekday","bymonthday","bymonth"];lt.IMPLEMENTED=[];lt.IMPLEMENTED[$.HOURLY]=hr;lt.IMPLEMENTED[$.MINUTELY]=hr;lt.IMPLEMENTED[$.DAILY]=["byhour"].concat(hr);lt.IMPLEMENTED[$.WEEKLY]=hr;lt.IMPLEMENTED[$.MONTHLY]=hr;lt.IMPLEMENTED[$.YEARLY]=["byweekno","byyearday"].concat(hr);var ra=function(n,e,r,i){return new lt(n,e,r,i).toString()},na=lt.isFullyConvertible;var pr=function(){function n(e,r,i,o){this.hour=e,this.minute=r,this.second=i,this.millisecond=o||0}return n.prototype.getHours=function(){return this.hour},n.prototype.getMinutes=function(){return this.minute},n.prototype.getSeconds=function(){return this.second},n.prototype.getMilliseconds=function(){return this.millisecond},n.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},n}();var ia=function(n){mr(e,n);function e(r,i,o,l,c,f,m){var h=n.call(this,l,c,f,m)||this;return h.year=r,h.month=i,h.day=o,h}return e.fromDate=function(r){return new this(r.getUTCFullYear(),r.getUTCMonth()+1,r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.valueOf()%1e3)},e.prototype.getWeekday=function(){return _t(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(r){this.year+=r},e.prototype.addMonths=function(r){if(this.month+=r,this.month>12){var i=Math.floor(this.month/12),o=Me(this.month,12);this.month=o,this.year+=i,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(r,i){i>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-i))+r*7:this.day+=-(this.getWeekday()-i)+r*7,this.fixDay()},e.prototype.addDaily=function(r){this.day+=r,this.fixDay()},e.prototype.addHours=function(r,i,o){for(i&&(this.hour+=Math.floor((23-this.hour)/r)*r);;){this.hour+=r;var l=Bn(this.hour,24),c=l.div,f=l.mod;if(c&&(this.hour=f,this.addDaily(c)),je(o)||G(o,this.hour))break}},e.prototype.addMinutes=function(r,i,o,l){for(i&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/r)*r);;){this.minute+=r;var c=Bn(this.minute,60),f=c.div,m=c.mod;if(f&&(this.minute=m,this.addHours(f,!1,o)),(je(o)||G(o,this.hour))&&(je(l)||G(l,this.minute)))break}},e.prototype.addSeconds=function(r,i,o,l,c){for(i&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/r)*r);;){this.second+=r;var f=Bn(this.second,60),m=f.div,h=f.mod;if(m&&(this.second=h,this.addMinutes(m,!1,o,l)),(je(o)||G(o,this.hour))&&(je(l)||G(l,this.minute))&&(je(c)||G(c,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var r=es(this.year,this.month-1)[1];if(!(this.day<=r))for(;this.day>r;){if(this.day-=r,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Pn))return;r=es(this.year,this.month-1)[1]}}},e.prototype.add=function(r,i){var o=r.freq,l=r.interval,c=r.wkst,f=r.byhour,m=r.byminute,h=r.bysecond;switch(o){case $.YEARLY:return this.addYears(l);case $.MONTHLY:return this.addMonths(l);case $.WEEKLY:return this.addWeekly(l,c);case $.DAILY:return this.addDaily(l);case $.HOURLY:return this.addHours(l,i,f);case $.MINUTELY:return this.addMinutes(l,i,f,m);case $.SECONDLY:return this.addSeconds(l,i,f,m,h)}},e}(pr);function is(n){for(var e=[],r=Object.keys(n),i=0,o=r;i<o.length;i++){var l=o[i];G(aa,l)||e.push(l),Xi(n[l])&&!Ht(n[l])&&e.push(l)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return De({},n)}function sa(n){var e=De(De({},Vr),is(n));if(se(e.byeaster)&&(e.freq=O.YEARLY),!(se(e.freq)&&O.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(n.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),se(e.wkst)?$e(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=O.MO.weekday,se(e.bysetpos)){$e(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var r=0;r<e.bysetpos.length;r++){var i=e.bysetpos[r];if(i===0||!(i>=-366&&i<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(e.byweekno||ge(e.byweekno)||ge(e.byyearday)||e.bymonthday||ge(e.bymonthday)||se(e.byweekday)||se(e.byeaster)))switch(e.freq){case O.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case O.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case O.WEEKLY:e.byweekday=[_t(e.dtstart)];break}if(se(e.bymonth)&&!Te(e.bymonth)&&(e.bymonth=[e.bymonth]),se(e.byyearday)&&!Te(e.byyearday)&&$e(e.byyearday)&&(e.byyearday=[e.byyearday]),!se(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(Te(e.bymonthday)){for(var o=[],l=[],r=0;r<e.bymonthday.length;r++){var i=e.bymonthday[r];i>0?o.push(i):i<0&&l.push(i)}e.bymonthday=o,e.bynmonthday=l}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(se(e.byweekno)&&!Te(e.byweekno)&&(e.byweekno=[e.byweekno]),!se(e.byweekday))e.bynweekday=null;else if($e(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Ki(e.byweekday))e.byweekday=[be.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof be)!e.byweekday.n||e.freq>O.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var c=[],f=[],r=0;r<e.byweekday.length;r++){var m=e.byweekday[r];if($e(m)){c.push(m);continue}else if(Ki(m)){c.push(be.fromStr(m).weekday);continue}!m.n||e.freq>O.MONTHLY?c.push(m.weekday):f.push([m.weekday,m.n])}e.byweekday=ge(c)?c:null,e.bynweekday=ge(f)?f:null}return se(e.byhour)?$e(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<O.HOURLY?[e.dtstart.getUTCHours()]:null,se(e.byminute)?$e(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<O.MINUTELY?[e.dtstart.getUTCMinutes()]:null,se(e.bysecond)?$e(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<O.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function oa(n){var e=n.dtstart.getTime()%1e3;if(!jr(n.freq))return[];var r=[];return n.byhour.forEach(function(i){n.byminute.forEach(function(o){n.bysecond.forEach(function(l){r.push(new pr(i,o,l,e))})})}),r}function Gr(n){var e=n.split(`
`).map(lm).filter(function(r){return r!==null});return De(De({},e[0]),e[1])}function Hr(n){var e={},r=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(n);if(!r)return e;var i=r[1],o=r[2];return i&&(e.tzid=i),e.dtstart=Wr(o),e}function lm(n){if(n=n.replace(/^\s+|\s+$/,""),!n.length)return null;var e=/^([A-Z]+?)[:;]/.exec(n.toUpperCase());if(!e)return la(n);var r=e[1];switch(r.toUpperCase()){case"RRULE":case"EXRULE":return la(n);case"DTSTART":return Hr(n);default:throw new Error("Unsupported RFC prop ".concat(r," in ").concat(n))}}function la(n){var e=n.replace(/^RRULE:/i,""),r=Hr(e),i=n.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return i.forEach(function(o){var l=o.split("="),c=l[0],f=l[1];switch(c.toUpperCase()){case"FREQ":r.freq=$[f.toUpperCase()];break;case"WKST":r.wkst=qe[f.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var m=um(f),h=c.toLowerCase();r[h]=m;break;case"BYWEEKDAY":case"BYDAY":r.byweekday=cm(f);break;case"DTSTART":case"TZID":var y=Hr(n);r.tzid=y.tzid,r.dtstart=y.dtstart;break;case"UNTIL":r.until=Wr(f);break;case"BYEASTER":r.byeaster=Number(f);break;default:throw new Error("Unknown RRULE property '"+c+"'")}}),r}function um(n){if(n.indexOf(",")!==-1){var e=n.split(",");return e.map(ua)}return ua(n)}function ua(n){return/^[+-]?\d+$/.test(n)?Number(n):n}function cm(n){var e=n.split(",");return e.map(function(r){if(r.length===2)return qe[r];var i=r.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!i||i.length<3)throw new SyntaxError("Invalid weekday string: ".concat(r));var o=Number(i[1]),l=i[2],c=qe[l].weekday;return new be(c,o)})}var zt=function(){function n(e,r){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=r}return Object.defineProperty(n.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),n.prototype.toString=function(){var e=fr(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},n.prototype.getTime=function(){return this.date.getTime()},n.prototype.rezonedDate=function(){return this.isUTC?this.date:Xo(this.date,this.tzid)},n}();function zr(n){for(var e=[],r="",i=Object.keys(n),o=Object.keys(Vr),l=0;l<i.length;l++)if(i[l]!=="tzid"&&G(o,i[l])){var c=i[l].toUpperCase(),f=n[i[l]],m="";if(!(!se(f)||Te(f)&&!f.length)){switch(c){case"FREQ":m=O.FREQUENCIES[n.freq];break;case"WKST":$e(f)?m=new be(f).toString():m=f.toString();break;case"BYWEEKDAY":c="BYDAY",m=zo(f).map(function(x){return x instanceof be?x:Te(x)?new be(x[0],x[1]):new be(x)}).toString();break;case"DTSTART":r=dm(f,n.tzid);break;case"UNTIL":m=fr(f,!n.tzid);break;default:if(Te(f)){for(var h=[],y=0;y<f.length;y++)h[y]=String(f[y]);m=h.toString()}else m=String(f)}m&&e.push([c,m])}}var w=e.map(function(x){var b=x[0],T=x[1];return"".concat(b,"=").concat(T.toString())}).join(";"),_="";return w!==""&&(_="RRULE:".concat(w)),[r,_].filter(function(x){return!!x}).join(`
`)}function dm(n,e){return n?"DTSTART"+new zt(new Date(n),e).toString():""}function fm(n,e){return Array.isArray(n)?!Array.isArray(e)||n.length!==e.length?!1:n.every(function(r,i){return r.getTime()===e[i].getTime()}):n instanceof Date?e instanceof Date&&n.getTime()===e.getTime():n===e}var ca=function(){function n(){this.all=!1,this.before=[],this.after=[],this.between=[]}return n.prototype._cacheAdd=function(e,r,i){r&&(r=r instanceof Date?$n(r):ts(r)),e==="all"?this.all=r:(i._value=r,this[e].push(i))},n.prototype._cacheGet=function(e,r){var i=!1,o=r?Object.keys(r):[],l=function(y){for(var w=0;w<o.length;w++){var _=o[w];if(!fm(r[_],y[_]))return!0}return!1},c=this[e];if(e==="all")i=this.all;else if(Te(c))for(var f=0;f<c.length;f++){var m=c[f];if(!(o.length&&l(m))){i=m._value;break}}if(!i&&this.all){for(var h=new xt(e,r),f=0;f<this.all.length&&h.accept(this.all[f]);f++);i=h.getValue(),this._cacheAdd(e,i,r)}return Te(i)?ts(i):i instanceof Date?$n(i):i},n}();var da=D(D(D(D(D(D(D(D(D(D(D(D(D([],V(1,31),!0),V(2,28),!0),V(3,31),!0),V(4,30),!0),V(5,31),!0),V(6,30),!0),V(7,31),!0),V(8,31),!0),V(9,30),!0),V(10,31),!0),V(11,30),!0),V(12,31),!0),V(1,7),!0),fa=D(D(D(D(D(D(D(D(D(D(D(D(D([],V(1,31),!0),V(2,29),!0),V(3,31),!0),V(4,30),!0),V(5,31),!0),V(6,30),!0),V(7,31),!0),V(8,31),!0),V(9,30),!0),V(10,31),!0),V(11,30),!0),V(12,31),!0),V(1,7),!0),mm=Je(1,29),hm=Je(1,30),Qt=Je(1,31),Ue=Je(1,32),ma=D(D(D(D(D(D(D(D(D(D(D(D(D([],Ue,!0),hm,!0),Ue,!0),Qt,!0),Ue,!0),Qt,!0),Ue,!0),Ue,!0),Qt,!0),Ue,!0),Qt,!0),Ue,!0),Ue.slice(0,7),!0),ha=D(D(D(D(D(D(D(D(D(D(D(D(D([],Ue,!0),mm,!0),Ue,!0),Qt,!0),Ue,!0),Qt,!0),Ue,!0),Ue,!0),Qt,!0),Ue,!0),Qt,!0),Ue,!0),Ue.slice(0,7),!0),pm=Je(-28,0),ym=Je(-29,0),Lt=Je(-30,0),Oe=Je(-31,0),pa=D(D(D(D(D(D(D(D(D(D(D(D(D([],Oe,!0),ym,!0),Oe,!0),Lt,!0),Oe,!0),Lt,!0),Oe,!0),Oe,!0),Lt,!0),Oe,!0),Lt,!0),Oe,!0),Oe.slice(0,7),!0),ya=D(D(D(D(D(D(D(D(D(D(D(D(D([],Oe,!0),pm,!0),Oe,!0),Lt,!0),Oe,!0),Lt,!0),Oe,!0),Oe,!0),Lt,!0),Oe,!0),Lt,!0),Oe,!0),Oe.slice(0,7),!0),ga=[0,31,60,91,121,152,182,213,244,274,305,335,366],ba=[0,31,59,90,120,151,181,212,243,273,304,334,365],ss=function(){for(var n=[],e=0;e<55;e++)n=n.concat(Je(7));return n}();function va(n,e){var r=at(n,1,1),i=dr(n)?366:365,o=dr(n+1)?366:365,l=Ar(r),c=_t(r),f=De(De({yearlen:i,nextyearlen:o,yearordinal:l,yearweekday:c},gm(n)),{wnomask:null});if(je(e.byweekno))return f;f.wnomask=V(0,i+7);var m,h,y=m=Me(7-c+e.wkst,7);y>=4?(y=0,h=f.yearlen+Me(c-e.wkst,7)):h=i-y;for(var w=Math.floor(h/7),_=Me(h,7),x=Math.floor(w+_/4),b=0;b<e.byweekno.length;b++){var T=e.byweekno[b];if(T<0&&(T+=x+1),T>0&&T<=x){var F=void 0;T>1?(F=y+(T-1)*7,y!==m&&(F-=7-m)):F=y;for(var S=0;S<7&&(f.wnomask[F]=1,F++,f.wdaymask[F]!==e.wkst);S++);}}if(G(e.byweekno,1)){var F=y+x*7;if(y!==m&&(F-=7-m),F<i)for(var b=0;b<7&&(f.wnomask[F]=1,F+=1,f.wdaymask[F]!==e.wkst);b++);}if(y){var j=void 0;if(G(e.byweekno,-1))j=-1;else{var q=_t(at(n-1,1,1)),U=Me(7-q.valueOf()+e.wkst,7),I=dr(n-1)?366:365,A=void 0;U>=4?(U=0,A=I+Me(q-e.wkst,7)):A=i-y,j=Math.floor(52+Me(A,7)/4)}if(G(e.byweekno,j))for(var F=0;F<y;F++)f.wnomask[F]=1}return f}function gm(n){var e=dr(n)?366:365,r=at(n,1,1),i=_t(r);return e===365?{mmask:da,mdaymask:ha,nmdaymask:ya,wdaymask:ss.slice(i),mrange:ba}:{mmask:fa,mdaymask:ma,nmdaymask:pa,wdaymask:ss.slice(i),mrange:ga}}function _a(n,e,r,i,o,l){var c={lastyear:n,lastmonth:e,nwdaymask:[]},f=[];if(l.freq===O.YEARLY)if(je(l.bymonth))f=[[0,r]];else for(var m=0;m<l.bymonth.length;m++)e=l.bymonth[m],f.push(i.slice(e-1,e+1));else l.freq===O.MONTHLY&&(f=[i.slice(e-1,e+1)]);if(je(f))return c;c.nwdaymask=V(0,r);for(var m=0;m<f.length;m++)for(var h=f[m],y=h[0],w=h[1]-1,_=0;_<l.bynweekday.length;_++){var x=void 0,b=l.bynweekday[_],T=b[0],F=b[1];F<0?(x=w+(F+1)*7,x-=Me(o[x]-T,7)):(x=y+(F-1)*7,x+=Me(7-o[x]+T,7)),y<=x&&x<=w&&(c.nwdaymask[x]=1)}return c}function wa(n,e){e===void 0&&(e=0);var r=n%19,i=Math.floor(n/100),o=n%100,l=Math.floor(i/4),c=i%4,f=Math.floor((i+8)/25),m=Math.floor((i-f+1)/3),h=Math.floor(19*r+i-l-m+15)%30,y=Math.floor(o/4),w=o%4,_=Math.floor(32+2*c+2*y-h-w)%7,x=Math.floor((r+11*h+22*_)/451),b=Math.floor((h+_-7*x+114)/31),T=(h+_-7*x+114)%31+1,F=Date.UTC(n,b-1,T+e),S=Date.UTC(n,0,1);return[Math.ceil((F-S)/(1e3*60*60*24))]}var bm=function(){function n(e){this.options=e}return n.prototype.rebuild=function(e,r){var i=this.options;if(e!==this.lastyear&&(this.yearinfo=va(e,i)),ge(i.bynweekday)&&(r!==this.lastmonth||e!==this.lastyear)){var o=this.yearinfo,l=o.yearlen,c=o.mrange,f=o.wdaymask;this.monthinfo=_a(e,r,l,c,f,i)}se(i.byeaster)&&(this.eastermask=wa(e,i.byeaster))},Object.defineProperty(n.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),n.prototype.ydayset=function(){return[Je(this.yearlen),0,this.yearlen]},n.prototype.mdayset=function(e,r){for(var i=this.mrange[r-1],o=this.mrange[r],l=V(null,this.yearlen),c=i;c<o;c++)l[c]=c;return[l,i,o]},n.prototype.wdayset=function(e,r,i){for(var o=V(null,this.yearlen+7),l=Ar(at(e,r,i))-this.yearordinal,c=l,f=0;f<7&&(o[l]=l,++l,this.wdaymask[l]!==this.options.wkst);f++);return[o,c,l]},n.prototype.ddayset=function(e,r,i){var o=V(null,this.yearlen),l=Ar(at(e,r,i))-this.yearordinal;return o[l]=l,[o,l,l+1]},n.prototype.htimeset=function(e,r,i,o){var l=this,c=[];return this.options.byminute.forEach(function(f){c=c.concat(l.mtimeset(e,f,i,o))}),wt(c),c},n.prototype.mtimeset=function(e,r,i,o){var l=this.options.bysecond.map(function(c){return new pr(e,r,c,o)});return wt(l),l},n.prototype.stimeset=function(e,r,i,o){return[new pr(e,r,i,o)]},n.prototype.getdayset=function(e){switch(e){case $.YEARLY:return this.ydayset.bind(this);case $.MONTHLY:return this.mdayset.bind(this);case $.WEEKLY:return this.wdayset.bind(this);case $.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},n.prototype.gettimeset=function(e){switch(e){case $.HOURLY:return this.htimeset.bind(this);case $.MINUTELY:return this.mtimeset.bind(this);case $.SECONDLY:return this.stimeset.bind(this)}},n}(),xa=bm;function ka(n,e,r,i,o,l){for(var c=[],f=0;f<n.length;f++){var m=void 0,h=void 0,y=n[f];y<0?(m=Math.floor(y/e.length),h=Me(y,e.length)):(m=Math.floor((y-1)/e.length),h=Me(y-1,e.length));for(var w=[],_=r;_<i;_++){var x=l[_];se(x)&&w.push(x)}var b=void 0;m<0?b=w.slice(m)[0]:b=w[m];var T=e[h],F=An(o.yearordinal+b),S=Wn(F,T);G(c,S)||c.push(S)}return wt(c),c}function jn(n,e){var r=e.dtstart,i=e.freq,o=e.interval,l=e.until,c=e.bysetpos,f=e.count;if(f===0||o===0)return kt(n);var m=ia.fromDate(r),h=new xa(e);h.rebuild(m.year,m.month);for(var y=wm(h,m,e);;){var w=h.getdayset(i)(m.year,m.month,m.day),_=w[0],x=w[1],b=w[2],T=_m(_,x,b,h,e);if(ge(c))for(var F=ka(c,y,x,b,h,_),S=0;S<F.length;S++){var j=F[S];if(l&&j>l)return kt(n);if(j>=r){var q=Ta(j,e);if(!n.accept(q)||f&&(--f,!f))return kt(n)}}else for(var S=x;S<b;S++){var U=_[S];if(se(U))for(var I=An(h.yearordinal+U),A=0;A<y.length;A++){var ke=y[A],j=Wn(I,ke);if(l&&j>l)return kt(n);if(j>=r){var q=Ta(j,e);if(!n.accept(q)||f&&(--f,!f))return kt(n)}}}if(e.interval===0||(m.add(e,T),m.year>Pn))return kt(n);jr(i)||(y=h.gettimeset(i)(m.hour,m.minute,m.second,0)),h.rebuild(m.year,m.month)}}function vm(n,e,r){var i=r.bymonth,o=r.byweekno,l=r.byweekday,c=r.byeaster,f=r.bymonthday,m=r.bynmonthday,h=r.byyearday;return ge(i)&&!G(i,n.mmask[e])||ge(o)&&!n.wnomask[e]||ge(l)&&!G(l,n.wdaymask[e])||ge(n.nwdaymask)&&!n.nwdaymask[e]||c!==null&&!G(n.eastermask,e)||(ge(f)||ge(m))&&!G(f,n.mdaymask[e])&&!G(m,n.nmdaymask[e])||ge(h)&&(e<n.yearlen&&!G(h,e+1)&&!G(h,-n.yearlen+e)||e>=n.yearlen&&!G(h,e+1-n.yearlen)&&!G(h,-n.nextyearlen+e-n.yearlen))}function Ta(n,e){return new zt(n,e.tzid).rezonedDate()}function kt(n){return n.getValue()}function _m(n,e,r,i,o){for(var l=!1,c=e;c<r;c++){var f=n[c];l=vm(i,f,o),l&&(n[f]=null)}return l}function wm(n,e,r){var i=r.freq,o=r.byhour,l=r.byminute,c=r.bysecond;return jr(i)?oa(r):i>=O.HOURLY&&ge(o)&&!G(o,e.hour)||i>=O.MINUTELY&&ge(l)&&!G(l,e.minute)||i>=O.SECONDLY&&ge(c)&&!G(c,e.second)?[]:n.gettimeset(i)(e.hour,e.minute,e.second,e.millisecond)}var qe={MO:new be(0),TU:new be(1),WE:new be(2),TH:new be(3),FR:new be(4),SA:new be(5),SU:new be(6)},Vr={freq:$.YEARLY,dtstart:null,interval:1,wkst:qe.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},aa=Object.keys(Vr),O=function(){function n(e,r){e===void 0&&(e={}),r===void 0&&(r=!1),this._cache=r?null:new ca,this.origOptions=is(e);var i=sa(e).parsedOptions;this.options=i}return n.parseText=function(e,r){return $r(e,r)},n.fromText=function(e,r){return ta(e,r)},n.fromString=function(e){return new n(n.parseString(e)||void 0)},n.prototype._iter=function(e){return jn(e,this.options)},n.prototype._cacheGet=function(e,r){return this._cache?this._cache._cacheGet(e,r):!1},n.prototype._cacheAdd=function(e,r,i){if(this._cache)return this._cache._cacheAdd(e,r,i)},n.prototype.all=function(e){if(e)return this._iter(new ns("all",{},e));var r=this._cacheGet("all");return r===!1&&(r=this._iter(new xt("all",{})),this._cacheAdd("all",r)),r},n.prototype.between=function(e,r,i,o){if(i===void 0&&(i=!1),!Ht(e)||!Ht(r))throw new Error("Invalid date passed in to RRule.between");var l={before:r,after:e,inc:i};if(o)return this._iter(new ns("between",l,o));var c=this._cacheGet("between",l);return c===!1&&(c=this._iter(new xt("between",l)),this._cacheAdd("between",c,l)),c},n.prototype.before=function(e,r){if(r===void 0&&(r=!1),!Ht(e))throw new Error("Invalid date passed in to RRule.before");var i={dt:e,inc:r},o=this._cacheGet("before",i);return o===!1&&(o=this._iter(new xt("before",i)),this._cacheAdd("before",o,i)),o},n.prototype.after=function(e,r){if(r===void 0&&(r=!1),!Ht(e))throw new Error("Invalid date passed in to RRule.after");var i={dt:e,inc:r},o=this._cacheGet("after",i);return o===!1&&(o=this._iter(new xt("after",i)),this._cacheAdd("after",o,i)),o},n.prototype.count=function(){return this.all().length},n.prototype.toString=function(){return zr(this.origOptions)},n.prototype.toText=function(e,r,i){return ra(this,e,r,i)},n.prototype.isFullyConvertibleToText=function(){return na(this)},n.prototype.clone=function(){return new n(this.origOptions)},n.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],n.YEARLY=$.YEARLY,n.MONTHLY=$.MONTHLY,n.WEEKLY=$.WEEKLY,n.DAILY=$.DAILY,n.HOURLY=$.HOURLY,n.MINUTELY=$.MINUTELY,n.SECONDLY=$.SECONDLY,n.MO=qe.MO,n.TU=qe.TU,n.WE=qe.WE,n.TH=qe.TH,n.FR=qe.FR,n.SA=qe.SA,n.SU=qe.SU,n.parseString=Gr,n.optionsToString=zr,n}();function Da(n,e,r,i,o,l){var c={},f=n.accept;function m(_,x){r.forEach(function(b){b.between(_,x,!0).forEach(function(T){c[Number(T)]=!0})})}o.forEach(function(_){var x=new zt(_,l).rezonedDate();c[Number(x)]=!0}),n.accept=function(_){var x=Number(_);return isNaN(x)?f.call(this,_):!c[x]&&(m(new Date(x-1),new Date(x+1)),!c[x])?(c[x]=!0,f.call(this,_)):!0},n.method==="between"&&(m(n.args.after,n.args.before),n.accept=function(_){var x=Number(_);return c[x]?!0:(c[x]=!0,f.call(this,_))});for(var h=0;h<i.length;h++){var y=new zt(i[h],l).rezonedDate();if(!n.accept(new Date(y.getTime())))break}e.forEach(function(_){jn(n,_.options)});var w=n._result;switch(wt(w),n.method){case"all":case"between":return w;case"before":return w.length&&w[w.length-1]||null;case"after":default:return w.length&&w[0]||null}}var Sa={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function xm(n,e){var r=[],i=[],o=[],l=[],c=Hr(n),f=c.dtstart,m=c.tzid,h=Fm(n,e.unfold);return h.forEach(function(y){var w;if(y){var _=Sm(y),x=_.name,b=_.parms,T=_.value;switch(x.toUpperCase()){case"RRULE":if(b.length)throw new Error("unsupported RRULE parm: ".concat(b.join(",")));r.push(Gr(y));break;case"RDATE":var F=(w=/RDATE(?:;TZID=([^:=]+))?/i.exec(y))!==null&&w!==void 0?w:[],S=F[1];S&&!m&&(m=S),i=i.concat(Fa(T,b));break;case"EXRULE":if(b.length)throw new Error("unsupported EXRULE parm: ".concat(b.join(",")));o.push(Gr(T));break;case"EXDATE":l=l.concat(Fa(T,b));break;case"DTSTART":break;default:throw new Error("unsupported property: "+x)}}}),{dtstart:f,tzid:m,rrulevals:r,rdatevals:i,exrulevals:o,exdatevals:l}}function km(n,e){var r=xm(n,e),i=r.rrulevals,o=r.rdatevals,l=r.exrulevals,c=r.exdatevals,f=r.dtstart,m=r.tzid,h=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||i.length>1||o.length||l.length||c.length){var y=new as(h);return y.dtstart(f),y.tzid(m||void 0),i.forEach(function(_){y.rrule(new O(os(_,f,m),h))}),o.forEach(function(_){y.rdate(_)}),l.forEach(function(_){y.exrule(new O(os(_,f,m),h))}),c.forEach(function(_){y.exdate(_)}),e.compatible&&e.dtstart&&y.rdate(f),y}var w=i[0]||{};return new O(os(w,w.dtstart||e.dtstart||f,w.tzid||e.tzid||m),h)}function Vn(n,e){return e===void 0&&(e={}),km(n,Tm(e))}function os(n,e,r){return De(De({},n),{dtstart:e,tzid:r})}function Tm(n){var e=[],r=Object.keys(n),i=Object.keys(Sa);if(r.forEach(function(o){G(i,o)||e.push(o)}),e.length)throw new Error("Invalid options: "+e.join(", "));return De(De({},Sa),n)}function Dm(n){if(n.indexOf(":")===-1)return{name:"RRULE",value:n};var e=Zo(n,":",1),r=e[0],i=e[1];return{name:r,value:i}}function Sm(n){var e=Dm(n),r=e.name,i=e.value,o=r.split(";");if(!o)throw new Error("empty property name");return{name:o[0].toUpperCase(),parms:o.slice(1),value:i}}function Fm(n,e){if(e===void 0&&(e=!1),n=n&&n.trim(),!n)throw new Error("Invalid empty string");if(!e)return n.split(/\s/);for(var r=n.split(`
`),i=0;i<r.length;){var o=r[i]=r[i].replace(/\s+$/g,"");o?i>0&&o[0]===" "?(r[i-1]+=o.slice(1),r.splice(i,1)):i+=1:r.splice(i,1)}return r}function Rm(n){n.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Fa(n,e){return Rm(e),n.split(",").map(function(r){return Wr(r)})}function Ra(n){var e=this;return function(r){if(r!==void 0&&(e["_".concat(n)]=r),e["_".concat(n)]!==void 0)return e["_".concat(n)];for(var i=0;i<e._rrule.length;i++){var o=e._rrule[i].origOptions[n];if(o)return o}}}var as=function(n){mr(e,n);function e(r){r===void 0&&(r=!1);var i=n.call(this,{},r)||this;return i.dtstart=Ra.apply(i,["dtstart"]),i.tzid=Ra.apply(i,["tzid"]),i._rrule=[],i._rdate=[],i._exrule=[],i._exdate=[],i}return e.prototype._iter=function(r){return Da(r,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(r){Ea(r,this._rrule)},e.prototype.exrule=function(r){Ea(r,this._exrule)},e.prototype.rdate=function(r){Ma(r,this._rdate)},e.prototype.exdate=function(r){Ma(r,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(r){return Vn(r.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(r){return Vn(r.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(r){return new Date(r.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(r){return new Date(r.getTime())})},e.prototype.valueOf=function(){var r=[];return!this._rrule.length&&this._dtstart&&(r=r.concat(zr({dtstart:this._dtstart}))),this._rrule.forEach(function(i){r=r.concat(i.toString().split(`
`))}),this._exrule.forEach(function(i){r=r.concat(i.toString().split(`
`).map(function(o){return o.replace(/^RRULE:/,"EXRULE:")}).filter(function(o){return!/^DTSTART/.test(o)}))}),this._rdate.length&&r.push(Ua("RDATE",this._rdate,this.tzid())),this._exdate.length&&r.push(Ua("EXDATE",this._exdate,this.tzid())),r},e.prototype.toString=function(){return this.valueOf().join(`
`)},e.prototype.clone=function(){var r=new e(!!this._cache);return this._rrule.forEach(function(i){return r.rrule(i.clone())}),this._exrule.forEach(function(i){return r.exrule(i.clone())}),this._rdate.forEach(function(i){return r.rdate(new Date(i.getTime()))}),this._exdate.forEach(function(i){return r.exdate(new Date(i.getTime()))}),r},e}(O);function Ea(n,e){if(!(n instanceof O))throw new TypeError(String(n)+" is not RRule instance");G(e.map(String),String(n))||e.push(n)}function Ma(n,e){if(!(n instanceof Date))throw new TypeError(String(n)+" is not Date instance");G(e.map(Number),Number(n))||(e.push(n),wt(e))}function Ua(n,e,r){var i=!r||r.toUpperCase()==="UTC",o=i?"".concat(n,":"):"".concat(n,";TZID=").concat(r,":"),l=e.map(function(c){return fr(c.valueOf(),i)}).join(",");return"".concat(o).concat(l)}var rt=class n{constructor(e,r){this.primary=e;this.func=r}static ofChar(e){return new n(e,r=>r===e)}static ofChars(e){if(e.length===0)throw"empty symbol";if(e[0]==null)throw"ch mustn't be null";return e.length===0?this.ofChar(e[0]):new n(e[0],r=>e.filter(i=>r===i).length>0)}isSymbol(e){return this.func(e)}},Hn=class{constructor(e){this.tokens=e}setTokenText(e,r,i=!1,o=!1,l=!1,c){let f=this.getToken(e);if(f===null){if(!o)return null;if(e instanceof rt?f={symbol:e.primary,text:r}:f={symbol:e,text:r},l&&f.symbol!==""&&!f.text.startsWith(" ")&&(f.text=" "+f.text),this.tokens.length>0){let m=this.tokens[this.tokens.length-1];this.isTokenEndsWithSpace(m)||(m.text+=" ")}if(c==null)this.tokens.push(f);else{let m=0,h=-1,y=0;for(let w of this.tokens){let _=m+w.symbol.length+w.text.length;if(y>0&&_>c){h=y;break}m=_,y++}h==-1?this.tokens.push(f):(this.tokens.splice(h,0,f),h<this.tokens.length-1&&(f.text=f.text+" "))}return f}return this.replaceTokenText(f,r,i),f}length(){return this.tokens.length}replaceTokenText(e,r,i=!1){if(!i){e.text=r;return}e.text=e.text.replace(/^(\s*).*?(\s*)$/,`$1${r}$2`)}isTokenEndsWithSpace(e){return e.text.match(/^.*\s$/)}getToken(e){for(let r of this.tokens)if(e instanceof rt){if(e.isSymbol(r.symbol))return r}else if(e===r.symbol)return r;return null}getTokenText(e,r=!1){let i=this.getToken(e);return i===null?null:r?i.text.replace(/^\s*(.*?)\s*$/,"$1"):i.text}removeToken(e){this.tokens=this.tokens.filter(r=>!e.isSymbol(r.symbol))}forEachTokens(e){this.tokens.forEach(e)}rangeOfSymbol(e){let r=0;for(let i of this.tokens){let o=r+i.symbol.length+i.text.length;if(e.isSymbol(i.symbol))return{start:r,end:o};r=o}}join(){return this.tokens.map(e=>e.symbol+e.text).join("")}};function Oa(n,e){let r=[...n],i="",o=null,l=[],c=()=>{o===null?l.push({symbol:"",text:i}):o.text=i};return r.forEach(f=>{e.filter(h=>h.isSymbol(f)).length>0?(c(),o={symbol:f,text:""},l.push(o),i=""):i+=f}),i.length>0&&c(),l}function Em(n){return n.replace(/#\w+/g,"")}var X=class X{constructor(e,r,i,o){this.useCustomEmoji=e;this.removeTags=r;this.strictDateFormat=i;this.tokens=o}static parse(e,r,i,o){return new X(r!=null?r:!1,i!=null?i:!1,o!=null?o:!0,new Hn(Oa(e,this.allSymbols)))}getTitle(){let e=this.tokens.getTokenText("",!0);return e!=null&&this.removeTags&&(e=Em(e)),e}getTime(){return this.getDate(this.getReminderSymbol())}setTime(e,r){this.useCustomEmoji?this.setDate(this.getReminderSymbol(),e,1):this.setDate(this.getReminderSymbol(),e,r)}getDueDate(){return this.getDate(X.symbolDueDate)}setDueDate(e){this.setDate(X.symbolDueDate,e)}setRawTime(e){return this.setDate(this.getReminderSymbol(),e),!0}getReminderSymbol(){return this.useCustomEmoji?X.symbolReminder:X.symbolDueDate}getEndOfTimeTextIndex(){let e=X.symbolDueDate;this.useCustomEmoji&&(e=X.symbolReminder);let r=this.tokens.rangeOfSymbol(e);return r!=null?r.end:this.toMarkdown().length}toMarkdown(){return this.tokens.join()}setTitle(e){this.tokens.setTokenText("",e,!0,!0)}getDoneDate(){return this.getDate(X.symbolDoneDate)}setDoneDate(e){this.setDate(X.symbolDoneDate,e)}getRecurrence(){return this.tokens.getTokenText(X.symbolRecurrence,!0)}clone(){return X.parse(this.toMarkdown(),this.useCustomEmoji,this.removeTags,this.strictDateFormat)}getDate(e){let r=this.tokens.getTokenText(e,!0);if(r===null)return null;if(e===X.symbolReminder)return ot.parse(r);{let i=(0,Zr.default)(r,X.dateFormat,this.strictDateFormat);return i.isValid()?new H(i,!1):null}}setDate(e,r,i){if(r==null){this.tokens.removeToken(e);return}let o;r instanceof H?e===X.symbolReminder?o=ot.toString(r):o=r.format(X.dateFormat):o=r,this.tokens.setTokenText(e,o,!0,!0,this.shouldSplitBetweenSymbolAndText(),i)}shouldSplitBetweenSymbolAndText(){let e=0,r=0;return this.tokens.forEachTokens(i=>{i.symbol!==""&&(i.text.match(/^\s.*$/)?e+=1:r++)}),e>r?!0:!(e<r)}};g(X,"dateFormat","YYYY-MM-DD"),g(X,"symbolDueDate",rt.ofChars([..."\u{1F4C5}\u{1F4C6}\u{1F5D3}"])),g(X,"symbolDoneDate",rt.ofChar("\u2705")),g(X,"symbolRecurrence",rt.ofChar("\u{1F501}")),g(X,"symbolReminder",rt.ofChar("\u23F0")),g(X,"symbolScheduled",rt.ofChar("\u23F3")),g(X,"symbolStart",rt.ofChar("\u{1F6EB}")),g(X,"allSymbols",[X.symbolDueDate,X.symbolDoneDate,X.symbolRecurrence,X.symbolReminder,X.symbolStart,X.symbolScheduled]);var Gn=X,Zn=class Zn extends Yt{parseReminder(e){let r=Gn.parse(e.body,this.useCustomEmoji(),this.removeTagsEnabled(),this.isStrictDateFormat());return this.useCustomEmoji()&&r.getDueDate()==null?null:r}removeTagsEnabled(){return this.config.getParameter(Ne.removeTagsForTasksPlugin)}useCustomEmoji(){return this.config.getParameter(Ne.useCustomEmojiForTasksPlugin)}modifyReminder(e,r,i,o){if(!super.modifyReminder(e,r,i,o))return!1;if(o.checked!==void 0)if(o.checked){let l=i.getRecurrence();if(l!==null){let c=r.clone(),f=i.clone(),m=i.getDueDate();if(m==null)return!1;if(this.useCustomEmoji()){let h=i.getTime();if(h==null)return!1;let y=this.nextDate(l,h.moment()),w=this.nextDate(l,m.moment());if(y==null||w==null)return!1;f.setTime(new H((0,Zr.default)(y),!0)),f.setDueDate(new H((0,Zr.default)(w),!0))}else{let h=this.nextDate(l,m.moment());if(h==null)return!1;let y=new H((0,Zr.default)(h),!0);f.setTime(y)}c.body=f.toMarkdown(),c.setChecked(!1),e.insertTodo(r.lineIndex,c)}i.setDoneDate(this.config.getParameter(Ne.now))}else i.setDoneDate(void 0);return!0}nextDate(e,r){let i=O.parseText(e);if(!i)return;let o=this.config.getParameter(Ne.now).moment();o.set("hour",r.get("hour")),o.set("minute",r.get("minute")),o.set("second",r.get("second")),o.set("millisecond",r.get("millisecond")),o.isAfter(r)&&(r=o);let l=r.clone();i.dtstart=r.utc(!0).toDate();let f=new O(i).after(r.toDate(),!1);if(f==null)return;let m=f.getTime()-i.dtstart.getTime();return l.add(m,"millisecond"),l.toDate()}newReminder(e,r,i){let o=Gn.parse(e,this.useCustomEmoji(),this.removeTagsEnabled(),this.isStrictDateFormat());return o.setTime(r,i),this.useCustomEmoji()&&o.getDueDate()==null&&o.setDueDate(r),o.setTitle(e),o}};g(Zn,"instance",new Zn);var zn=Zn;var yr=new Mn;yr.resetFormat([cr.instance]);var Jr=class{constructor(e,r,i,o,l){this.name=e;this.description=r;this.example=i;this.format=o;this.defaultEnabled=l}};function Ya(n){return yr.parse(n)}async function Qa(n,e,r){return yr.modify(n,e,r)}function La(n){n.length===0?yr.resetFormat([cr.instance]):yr.resetFormat(n.map(e=>e.format))}function Na(n){yr.setConfig(n)}var ls=new Jr("ReminderPluginReminderFormat","Reminder plugin format","(@2021-09-08)",cr.instance,!0),us=new Jr("TasksPluginReminderFormat","Tasks plugin format","\u{1F4C5} 2021-09-08",zn.instance,!1),cs=new Jr("KanbanPluginReminderFormat","Kanban plugin format","@{2021-09-08}",Nn.instance,!1),qr=[ls,us,cs];var Tt=class{constructor(e,r){g(this,"doc");this.doc=new Nr(e,r)}getReminders(e=!0){let r=Ya(this.doc);return e?r.filter(i=>!i.done):r}getTodos(){return this.doc.getTodos()}async modifyReminderLines(e){for(let r of this.getReminders(!1)){let i=e(r);if(i===null)return;await this.modifyReminderLine(r,i)}}async updateReminder(e,r){await this.modifyReminderLine(e,r)}async modifyReminderLine(e,r){let i=await Qa(this.doc,e,r);return i?console.info("Reminder was updated: reminder=%o",e):console.warn("Cannot modify reminder because it's not a reminder todo: reminder=%o",e),i}getContent(){return this.doc.toMarkdown()}};var Ca=require("obsidian"),Jn=class extends Ca.FuzzySuggestModal{constructor(r,i,o){super(r);this.suggestions=i;this.onChooseSuggestionFunc=o}getItems(){return this.suggestions}getItemText(r){return r}onChooseItem(r){this.onChooseSuggestionFunc(r)}};function Ia(n,e){new Jn(n,["YYYY-MM-DD","YYYY/MM/DD","DD-MM-YYYY","DD/MM/YYYY"],r=>{new Jn(n,["YYYY-MM-DD HH:mm","YYYY/MM/DD HH:mm","DD-MM-YYYY HH:mm","DD/MM/YYYY HH:mm","YYYY-MM-DDTHH:mm:ss:SSS"],i=>{e(r,i)}).open()}).open()}async function Mm(n,e,r){let i=0,o=n.app.vault;for(let l of o.getMarkdownFiles()){let c=new Tt(l.path,await o.read(l)),f=0;await c.modifyReminderLines(m=>{let h;return m.time.hasTimePart?h=m.time.format(r):h=m.time.format(e),i++,f++,{rawTime:h}}),f>0&&await o.modify(l,c.getContent())}return n.settings.dateFormat.rawValue.value=e,n.settings.dateTimeFormat.rawValue.value=r,i>0&&await n.fileSystem.reloadRemindersInAllFiles(),i}function Ba(n,e){return n||Wo("Convert reminder time format","This command rewrite reminder dates in all markdown files. You should make a backup of your vault before you execute this. May I continue to convert?").then(r=>{r===0&&Ia(e.app,(i,o)=>{Mm(e,i,o).catch(()=>{})})}),!0}function Pa(n,e,r){if(n)return!0;r.showAutoComplete(e)}async function Um(n,e,r){if(!n.fileSystem.isMarkdownFile(e))return;let i=n.app.vault,o=new Tt(e.path,await i.read(e)),l=o.getReminders(!1).find(c=>c.rowNumber===r);if(l)await o.updateReminder(l,{checked:!l.done});else{let c=o.getTodos().find(f=>f.lineIndex===r);if(console.log(c),!c)return;c.setChecked(!c.isChecked())}await i.modify(e,o.getContent())}function Aa(n,e,r){if(n)return!0;e&&e.file&&Um(r,e.file,e.editor.getCursor().line)}function $a(n){n.addCommand({id:"scan-reminders",name:"Scan reminders",checkCallback:e=>Bo(e,n)}),n.addCommand({id:"show-reminders",name:"Show reminders",checkCallback:e=>Po(e,n.ui)}),n.addCommand({id:"convert-reminder-time-format",name:"Convert reminder time format",checkCallback:e=>Ba(e,n)}),n.addCommand({id:"show-date-chooser",name:"Show calendar popup",icon:"calendar-with-checkmark",hotkeys:[{modifiers:["Meta","Shift"],key:"2"}],editorCheckCallback:(e,r)=>Pa(e,r,n.ui)}),n.addCommand({id:"toggle-checklist-status",name:"Toggle checklist status",hotkeys:[{modifiers:["Meta","Shift"],key:"Enter"}],editorCheckCallback:(e,r,i)=>i instanceof Wa.MarkdownView?Aa(e,i,n):!1})}var ja=require("obsidian");function Va(n){if(!ja.Platform.isMobile)return;let e=`${n.manifest.dir}/logs.txt`,r=[],i=o=>(...l)=>{r.push(`
[${o}]`);for(let c of l)r.push(String(c));n.app.vault.adapter.write(e,r.join(" "))};console.debug=i("debug"),console.error=i("error"),console.info=i("info"),console.log=i("log"),console.warn=i("warn")}var ut="reminder-list";var li=require("obsidian");function me(){}function Om(n,e){for(let r in e)n[r]=e[r];return n}function ds(n){return n()}function qn(){return Object.create(null)}function _e(n){n.forEach(ds)}function Nt(n){return typeof n=="function"}function Ye(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}function Ha(n){return Object.keys(n).length===0}function Ga(n,e,r,i){if(n){let o=za(n,e,r,i);return n[0](o)}}function za(n,e,r,i){return n[1]&&i?Om(r.ctx.slice(),n[1](i(e))):r.ctx}function Za(n,e,r,i){if(n[2]&&i){let o=n[2](i(r));if(e.dirty===void 0)return o;if(typeof o=="object"){let l=[],c=Math.max(e.dirty.length,o.length);for(let f=0;f<c;f+=1)l[f]=e.dirty[f]|o[f];return l}return e.dirty|o}return e.dirty}function Ja(n,e,r,i,o,l){if(o){let c=za(e,r,i,l);n.p(c,o)}}function qa(n){if(n.ctx.length>32){let e=[],r=n.ctx.length/32;for(let i=0;i<r;i++)e[i]=-1;return e}return-1}var fs=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var Kn=class n{constructor(e){g(this,"_listeners","WeakMap"in fs?new WeakMap:void 0);g(this,"_observer");g(this,"options");this.options=e}observe(e,r){return this._listeners.set(e,r),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!=null?e:this._observer=new ResizeObserver(r=>{var i;for(let o of r)n.entries.set(o.target,o),(i=this._listeners.get(o.target))==null||i(o)})}};Kn.entries="WeakMap"in fs?new WeakMap:void 0;var Ka=!1;function Xa(){Ka=!0}function el(){Ka=!1}function M(n,e){n.appendChild(e)}function te(n,e,r){n.insertBefore(e,r||null)}function ee(n){n.parentNode&&n.parentNode.removeChild(n)}function nt(n,e){for(let r=0;r<n.length;r+=1)n[r]&&n[r].d(e)}function N(n){return document.createElement(n)}function Se(n){return document.createTextNode(n)}function ce(){return Se(" ")}function oe(n,e,r,i){return n.addEventListener(e,r,i),()=>n.removeEventListener(e,r,i)}function C(n,e,r){r==null?n.removeAttribute(e):n.getAttribute(e)!==r&&n.setAttribute(e,r)}function tl(n){return Array.from(n.childNodes)}function Ke(n,e){e=""+e,n.data!==e&&(n.data=e)}function Kr(n,e){n.value=e==null?"":e}function gr(n,e,r){for(let i=0;i<n.options.length;i+=1){let o=n.options[i];if(o.__value===e){o.selected=!0;return}}(!r||e!==void 0)&&(n.selectedIndex=-1)}function Xn(n){let e=n.querySelector(":checked");return e&&e.__value}function Xe(n,e,r){n.classList.toggle(e,!!r)}function ei(n,e,{bubbles:r=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:r,cancelable:i})}function rl(n){let e={};return n.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}var Ct;function Dt(n){Ct=n}function ti(){if(!Ct)throw new Error("Function called outside component initialization");return Ct}function Zt(n){ti().$$.on_mount.push(n)}function ms(n){ti().$$.after_update.push(n)}function Xr(){let n=ti();return(e,r,{cancelable:i=!1}={})=>{let o=n.$$.callbacks[e];if(o){let l=ei(e,r,{cancelable:i});return o.slice().forEach(c=>{c.call(n,l)}),!l.defaultPrevented}return!0}}var Jt=[];var Ie=[],vr=[],ps=[],nl=Promise.resolve(),ys=!1;function gs(){ys||(ys=!0,nl.then(ri))}function bs(){return gs(),nl}function St(n){vr.push(n)}function vs(n){ps.push(n)}var hs=new Set,br=0;function ri(){if(br!==0)return;let n=Ct;do{try{for(;br<Jt.length;){let e=Jt[br];br++,Dt(e),Pm(e.$$)}}catch(e){throw Jt.length=0,br=0,e}for(Dt(null),Jt.length=0,br=0;Ie.length;)Ie.pop()();for(let e=0;e<vr.length;e+=1){let r=vr[e];hs.has(r)||(hs.add(r),r())}vr.length=0}while(Jt.length);for(;ps.length;)ps.pop()();ys=!1,hs.clear(),Dt(n)}function Pm(n){if(n.fragment!==null){n.update(),_e(n.before_update);let e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(St)}}function il(n){let e=[],r=[];vr.forEach(i=>n.indexOf(i)===-1?e.push(i):r.push(i)),r.forEach(i=>i()),vr=e}var ni=new Set,qt;function _r(){qt={r:0,c:[],p:qt}}function wr(){qt.r||_e(qt.c),qt=qt.p}function ie(n,e){n&&n.i&&(ni.delete(n),n.i(e))}function he(n,e,r,i){if(n&&n.o){if(ni.has(n))return;ni.add(n),qt.c.push(()=>{ni.delete(n),i&&(r&&n.d(1),i())}),n.o(e)}else i&&i()}function we(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}var Am=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],Wm=new Set([...Am]);function ws(n,e,r){let i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=r,r(n.$$.ctx[i]))}function Ve(n){n&&n.c()}function Be(n,e,r){let{fragment:i,after_update:o}=n.$$;i&&i.m(e,r),St(()=>{let l=n.$$.on_mount.map(ds).filter(Nt);n.$$.on_destroy?n.$$.on_destroy.push(...l):_e(l),n.$$.on_mount=[]}),o.forEach(St)}function Pe(n,e){let r=n.$$;r.fragment!==null&&(il(r.after_update),_e(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function jm(n,e){n.$$.dirty[0]===-1&&(Jt.push(n),gs(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Qe(n,e,r,i,o,l,c=null,f=[-1]){let m=Ct;Dt(n);let h=n.$$={fragment:null,ctx:[],props:l,update:me,not_equal:o,bound:qn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(m?m.$$.context:[])),callbacks:qn(),dirty:f,skip_bound:!1,root:e.target||m.$$.root};c&&c(h.root);let y=!1;if(h.ctx=r?r(n,e.props||{},(w,_,...x)=>{let b=x.length?x[0]:_;return h.ctx&&o(h.ctx[w],h.ctx[w]=b)&&(!h.skip_bound&&h.bound[w]&&h.bound[w](b),y&&jm(n,w)),_}):[],h.update(),y=!0,_e(h.before_update),h.fragment=i?i(h.ctx):!1,e.target){if(e.hydrate){Xa();let w=tl(e.target);h.fragment&&h.fragment.l(w),w.forEach(ee)}else h.fragment&&h.fragment.c();e.intro&&ie(n.$$.fragment),Be(n,e.target,e.anchor),el(),ri()}Dt(m)}var Vm;typeof HTMLElement=="function"&&(Vm=class extends HTMLElement{constructor(e,r,i){super();g(this,"$$ctor");g(this,"$$s");g(this,"$$c");g(this,"$$cn",!1);g(this,"$$d",{});g(this,"$$r",!1);g(this,"$$p_d",{});g(this,"$$l",{});g(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=r,i&&this.attachShadow({mode:"open"})}addEventListener(e,r,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(r),this.$$c){let o=this.$$c.$on(e,r);this.$$l_u.set(r,o)}super.addEventListener(e,r,i)}removeEventListener(e,r,i){if(super.removeEventListener(e,r,i),this.$$c){let o=this.$$l_u.get(r);o&&(o(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let c;return{c:function(){c=N("slot"),l!=="default"&&C(c,"name",l)},m:function(h,y){te(h,c,y)},d:function(h){h&&ee(c)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let r={},i=rl(this);for(let l of this.$$s)l in i&&(r[l]=[e(l)]);for(let l of this.attributes){let c=this.$$g_p(l.name);c in this.$$d||(this.$$d[c]=_s(c,l.value,this.$$p_d,"toProp"))}for(let l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$scope:{ctx:[]}}});let o=()=>{this.$$r=!0;for(let l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){let c=_s(l,this.$$d[l],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,c)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(let l in this.$$l)for(let c of this.$$l[l]){let f=this.$$c.$on(l,c);this.$$l_u.set(c,f)}this.$$l={}}}attributeChangedCallback(e,r,i){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=_s(e,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(r=>this.$$p_d[r].attribute===e||!this.$$p_d[r].attribute&&r.toLowerCase()===e)||e}});function _s(n,e,r,i){var l;let o=(l=r[n])==null?void 0:l.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[n])return e;if(i==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var xe=class{constructor(){g(this,"$$");g(this,"$$set")}$destroy(){Pe(this,1),this.$destroy=me}$on(e,r){if(!Nt(r))return me;let i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(r),()=>{let o=i.indexOf(r);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!Ha(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var sl="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(sl);var ol=require("obsidian");function Hm(n){let e,r;return{c(){e=N("span"),r=N("span"),C(r,"class","reminder-markdown")},m(i,o){te(i,e,o),M(e,r),n[3](r)},p:me,i:me,o:me,d(i){i&&ee(e),n[3](null)}}}function Gm(n,e,r){let{sourcePath:i}=e,{markdown:o}=e,l;ms(()=>{l.empty(),ol.MarkdownRenderer.renderMarkdown(o,l,i,window.app.plugins.plugins["obsidian-reminder-plugin"]),l.childNodes.forEach(f=>{f instanceof HTMLElement&&(f.style.display="inline")})});function c(f){Ie[f?"unshift":"push"](()=>{l=f,r(0,l)})}return n.$$set=f=>{"sourcePath"in f&&r(1,i=f.sourcePath),"markdown"in f&&r(2,o=f.markdown)},[l,i,o,c]}var xs=class extends xe{constructor(e){super(),Qe(this,e,Gm,Hm,Ye,{sourcePath:1,markdown:2})}},ii=xs;function al(n,e,r){let i=n.slice();return i[6]=e[r],i}function zm(n){let e,r,i=we(n[0]),o=[];for(let c=0;c<i.length;c+=1)o[c]=ll(al(n,i,c));let l=c=>he(o[c],1,1,()=>{o[c]=null});return{c(){e=N("div");for(let c=0;c<o.length;c+=1)o[c].c()},m(c,f){te(c,e,f);for(let m=0;m<o.length;m+=1)o[m]&&o[m].m(e,null);r=!0},p(c,f){if(f&15){i=we(c[0]);let m;for(m=0;m<i.length;m+=1){let h=al(c,i,m);o[m]?(o[m].p(h,f),ie(o[m],1)):(o[m]=ll(h),o[m].c(),ie(o[m],1),o[m].m(e,null))}for(_r(),m=i.length;m<o.length;m+=1)l(m);wr()}},i(c){if(!r){for(let f=0;f<i.length;f+=1)ie(o[f]);r=!0}},o(c){o=o.filter(Boolean);for(let f=0;f<o.length;f+=1)he(o[f]);r=!1},d(c){c&&ee(e),nt(o,c)}}}function Zm(n){let e;return{c(){e=N("div"),e.textContent="No reminders",C(e,"class","reminder-list-item no-reminders svelte-15dajvg")},m(r,i){te(r,e,i)},p:me,i:me,o:me,d(r){r&&ee(e)}}}function ll(n){let e,r,i=n[2](n[6].time)+"",o,l,c,f,m,h,y,w=n[6].getFileName()+"",_,x,b,T,F,S;m=new ii({props:{markdown:n[6].title,sourcePath:n[6].file}});function j(...U){return n[4](n[6],...U)}function q(){return n[5](n[6])}return{c(){e=N("button"),r=N("span"),o=Se(i),l=ce(),c=N("div"),f=N("span"),Ve(m.$$.fragment),h=ce(),y=N("span"),_=Se(w),x=ce(),C(r,"class","reminder-time svelte-15dajvg"),C(f,"class","reminder-title svelte-15dajvg"),C(y,"class","reminder-file svelte-15dajvg"),C(c,"class","reminder-title-container svelte-15dajvg"),C(e,"class","reminder-list-item hover-highlight svelte-15dajvg"),C(e,"aria-label",b=`[${n[6].time.toString()}] ${n[6].title} - ${n[6].getFileName()}`),C(e,"draggable","true")},m(U,I){te(U,e,I),M(e,r),M(r,o),M(e,l),M(e,c),M(c,f),Be(m,f,null),M(c,h),M(c,y),M(y,_),M(e,x),T=!0,F||(S=[oe(e,"dragstart",j),oe(e,"click",q)],F=!0)},p(U,I){n=U,(!T||I&5)&&i!==(i=n[2](n[6].time)+"")&&Ke(o,i);let A={};I&1&&(A.markdown=n[6].title),I&1&&(A.sourcePath=n[6].file),m.$set(A),(!T||I&1)&&w!==(w=n[6].getFileName()+"")&&Ke(_,w),(!T||I&1&&b!==(b=`[${n[6].time.toString()}] ${n[6].title} - ${n[6].getFileName()}`))&&C(e,"aria-label",b)},i(U){T||(ie(m.$$.fragment,U),T=!0)},o(U){he(m.$$.fragment,U),T=!1},d(U){U&&ee(e),Pe(m),F=!1,_e(S)}}}function Jm(n){let e,r,i,o,l=[Zm,zm],c=[];function f(m,h){return m[0].length===0?0:1}return r=f(n,-1),i=c[r]=l[r](n),{c(){e=N("div"),i.c(),C(e,"class","reminder-group svelte-15dajvg")},m(m,h){te(m,e,h),c[r].m(e,null),o=!0},p(m,[h]){let y=r;r=f(m,h),r===y?c[r].p(m,h):(_r(),he(c[y],1,1,()=>{c[y]=null}),wr(),i=c[r],i?i.p(m,h):(i=c[r]=l[r](m),i.c()),ie(i,1),i.m(e,null))},i(m){o||(ie(i),o=!0)},o(m){he(i),o=!1},d(m){m&&ee(e),c[r].d()}}}function qm(n,e,r){let{reminders:i}=e,{onOpenReminder:o=()=>{}}=e,{timeToString:l=h=>h.format("HH:MM")}=e,{generateLink:c=()=>""}=e,f=(h,y)=>{var w;(w=y.dataTransfer)==null||w.setData("text/plain",c(h))},m=h=>{o(h)};return n.$$set=h=>{"reminders"in h&&r(0,i=h.reminders),"onOpenReminder"in h&&r(1,o=h.onOpenReminder),"timeToString"in h&&r(2,l=h.timeToString),"generateLink"in h&&r(3,c=h.generateLink)},[i,o,l,c,f,m]}var ks=class extends xe{constructor(e){super(),Qe(this,e,qm,Jm,Ye,{reminders:0,onOpenReminder:1,timeToString:2,generateLink:3})}},si=ks;function ul(n,e,r){let i=n.slice();return i[4]=e[r],i}function cl(n){let e,r=n[4].name+"",i,o,l,c;function f(...m){return n[3](n[4],...m)}return l=new si({props:{reminders:n[4].reminders,onOpenReminder:n[1],timeToString:f,generateLink:n[2]}}),{c(){e=N("div"),i=Se(r),o=ce(),Ve(l.$$.fragment),C(e,"class","group-name svelte-2zqui4"),Xe(e,"group-name-overdue",n[4].isOverdue)},m(m,h){te(m,e,h),M(e,i),te(m,o,h),Be(l,m,h),c=!0},p(m,h){n=m,(!c||h&1)&&r!==(r=n[4].name+"")&&Ke(i,r),(!c||h&1)&&Xe(e,"group-name-overdue",n[4].isOverdue);let y={};h&1&&(y.reminders=n[4].reminders),h&2&&(y.onOpenReminder=n[1]),h&1&&(y.timeToString=f),h&4&&(y.generateLink=n[2]),l.$set(y)},i(m){c||(ie(l.$$.fragment,m),c=!0)},o(m){he(l.$$.fragment,m),c=!1},d(m){m&&(ee(e),ee(o)),Pe(l,m)}}}function Km(n){let e,r,i,o=we(n[0]),l=[];for(let f=0;f<o.length;f+=1)l[f]=cl(ul(n,o,f));let c=f=>he(l[f],1,1,()=>{l[f]=null});return{c(){e=N("main"),r=N("div");for(let f=0;f<l.length;f+=1)l[f].c()},m(f,m){te(f,e,m),M(e,r);for(let h=0;h<l.length;h+=1)l[h]&&l[h].m(r,null);i=!0},p(f,[m]){if(m&7){o=we(f[0]);let h;for(h=0;h<o.length;h+=1){let y=ul(f,o,h);l[h]?(l[h].p(y,m),ie(l[h],1)):(l[h]=cl(y),l[h].c(),ie(l[h],1),l[h].m(r,null))}for(_r(),h=o.length;h<l.length;h+=1)c(h);wr()}},i(f){if(!i){for(let m=0;m<o.length;m+=1)ie(l[m]);i=!0}},o(f){l=l.filter(Boolean);for(let m=0;m<l.length;m+=1)he(l[m]);i=!1},d(f){f&&ee(e),nt(l,f)}}}function Xm(n,e,r){let{groups:i}=e,{onOpenReminder:o}=e,{generateLink:l}=e,c=(f,m)=>f.timeToString(m);return n.$$set=f=>{"groups"in f&&r(0,i=f.groups),"onOpenReminder"in f&&r(1,o=f.onOpenReminder),"generateLink"in f&&r(2,l=f.generateLink)},[i,o,l,c]}var Ts=class extends xe{constructor(e){super(),Qe(this,e,Xm,Km,Ye,{groups:0,onOpenReminder:1,generateLink:2})}},dl=Ts;var oi=class extends li.ItemView{constructor(r,i,o,l){super(r);this.reminders=i;this.reminderTime=o;this.onOpenReminder=l;g(this,"view")}getViewType(){return ut}getDisplayText(){return"Reminders"}getIcon(){return"clock"}async onOpen(){this.view=new dl({target:this.contentEl,props:{groups:this.remindersForView(),onOpenReminder:this.onOpenReminder,generateLink:r=>{let i=this.app.vault.getAbstractFileByPath(r.file),o=this.app.workspace.getActiveFile(),l;return!(i instanceof li.TFile)||o==null?l=`[[${r.getFileName()}]]`:l=this.app.fileManager.generateMarkdownLink(i,o.path),`${r.title} - ${l}`}}})}reload(){this.view!=null&&this.view.$set({groups:this.remindersForView(),onOpenReminder:this.onOpenReminder})}remindersForView(){return Go(this.reminders.reminders,this.reminderTime.value)}onClose(){return this.view&&this.view.$destroy(),Promise.resolve()}},ai=class{constructor(e,r,i,o){this.workspace=e;this.reminders=r;this.reminderTime=i;this.onOpenReminder=o;g(this,"valid",!1)}createView(e){return new oi(e,this.reminders,this.reminderTime,this.onOpenReminder)}openView(){var e;this.workspace.getLeavesOfType(ut).length||(e=this.workspace.getRightLeaf(!1))==null||e.setViewState({type:ut})}reload(e=!1){if(e||!this.valid){let r=this.getViews();r.length>0?(r.forEach(i=>i==null?void 0:i.reload()),this.valid=!0):(this.valid=!1,console.debug("view is null. Skipping reminder list view reload"))}}getViews(){return this.workspace.getLeavesOfType(ut).map(e=>e&&e.view instanceof oi?e.view:null).filter(e=>e!=null)}invalidate(){this.valid=!1}};var Tl=require("obsidian");var fi=require("obsidian");var xl=Wt(Ut());var Fs=Wt(Ut());var fl=Wt(Ut(),1);var Ds=class{constructor(e){this.date=e}isToday(e){return this.date===void 0?!1:this.date.date()===e.date()&&this.date.month()===e.month()&&this.date.year()===e.year()}isHoliday(){return this.date.weekday()===0||this.date.weekday()===6}},Ss=class{constructor(e){this.weekStart=e;g(this,"days",[]);let r=e.clone();for(let i=0;i<7;i++)this.days.push(new Ds(r.clone())),r.add(1,"day")}},ui=class{constructor(e){this.monthStart=e;g(this,"weeks",[]);let r=e.clone().add(-e.weekday(),"day");for(let i=0;i<6&&!(i>0&&!this.isThisMonth(r));i++)this.weeks.push(new Ss(r.clone())),r.add(1,"week")}isThisMonth(e){return this.monthStart.month()===e.month()&&this.monthStart.year()===e.year()}},ci=class n{constructor(e,r){g(this,"_current");g(this,"today");e?this.today=e:this.today=(0,fl.default)(),r?this._current=new ui(r.clone().set("date",1)):this._current=new ui(this.today.clone().set("date",1))}nextMonth(){return new n(this.today,this._current.monthStart.clone().add(1,"month"))}previousMonth(){return new n(this.today,this._current.monthStart.clone().add(-1,"month"))}calendarString(){let e=`${this._current.monthStart.format("YYYY, MMM")}
Sun Mon Tue Wed Thu Fri Sat
`;return this._current.weeks.forEach(r=>{let i=" ";r.days.forEach(o=>{let l;o.date&&this._current.isThisMonth(o.date)?l=o.date.format("DD"):l=" ",i=i+l+" "}),e=e+i+`
`}),e}get current(){return this._current}};var xr=class{constructor(){g(this,"digits",[]);g(this,"lastInput",0)}handle(e){let r=new Date().getTime();return r-this.lastInput>1e3&&this.clear(),this.lastInput=r,this.digits.push(e),this.digits.join("")}clear(){this.digits=[]}};var eh=n=>({}),ml=n=>({});function hl(n,e,r){let i=n.slice();return i[22]=e[r],i}function pl(n,e,r){let i=n.slice();return i[25]=e[r],i}function yl(n){let e,r,i=n[25].date.format("D")+"",o,l,c;function f(){return n[14](n[25])}function m(){return n[15](n[25])}return{c(){e=N("td"),r=N("button"),o=Se(i),C(r,"tabindex","-1"),C(r,"class","calendar-date svelte-kmxndl"),Xe(r,"is-selected",n[25].isToday(n[0])),Xe(r,"other-month",!n[3].current.isThisMonth(n[25].date)),Xe(r,"is-holiday",n[25].isHoliday()),Xe(r,"is-past",n[25].date.isBefore(n[3].today))},m(h,y){te(h,e,y),M(e,r),M(r,o),l||(c=[oe(r,"click",f),oe(r,"dblclick",m)],l=!0)},p(h,y){n=h,y&8&&i!==(i=n[25].date.format("D")+"")&&Ke(o,i),y&9&&Xe(r,"is-selected",n[25].isToday(n[0])),y&8&&Xe(r,"other-month",!n[3].current.isThisMonth(n[25].date)),y&8&&Xe(r,"is-holiday",n[25].isHoliday()),y&8&&Xe(r,"is-past",n[25].date.isBefore(n[3].today))},d(h){h&&ee(e),l=!1,_e(c)}}}function gl(n){let e,r,i=we(n[22].days),o=[];for(let l=0;l<i.length;l+=1)o[l]=yl(pl(n,i,l));return{c(){e=N("tr");for(let l=0;l<o.length;l+=1)o[l].c();r=ce()},m(l,c){te(l,e,c);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(e,null);M(e,r)},p(l,c){if(c&105){i=we(l[22].days);let f;for(f=0;f<i.length;f+=1){let m=pl(l,i,f);o[f]?o[f].p(m,c):(o[f]=yl(m),o[f].c(),o[f].m(e,r))}for(;f<o.length;f+=1)o[f].d(1);o.length=i.length}},d(l){l&&ee(e),nt(o,l)}}}function th(n){let e,r,i,o,l,c=n[3].current.monthStart.format("MMM")+"",f,m,h,y=n[3].current.monthStart.format("YYYY")+"",w,_,x,b,T,F,S,j,q,U,I,A,ke,de=we(n[3].current.weeks),E=[];for(let B=0;B<de.length;B+=1)E[B]=gl(hl(n,de,B));let K=n[11].footer,Y=Ga(K,n,n[10],ml);return{c(){e=N("div"),r=N("div"),i=N("button"),i.textContent="<",o=ce(),l=N("span"),f=Se(c),m=ce(),h=N("span"),w=Se(y),_=ce(),x=N("button"),x.textContent=">",b=ce(),T=N("table"),F=N("thead"),F.innerHTML='<tr><th class="svelte-kmxndl">SUN</th> <th class="svelte-kmxndl">MON</th> <th class="svelte-kmxndl">TUE</th> <th class="svelte-kmxndl">WED</th> <th class="svelte-kmxndl">THU</th> <th class="svelte-kmxndl">FRI</th> <th class="svelte-kmxndl">SAT</th></tr>',S=ce(),j=N("tbody");for(let B=0;B<E.length;B+=1)E[B].c();q=ce(),U=N("div"),Y&&Y.c(),C(i,"tabindex","-1"),C(i,"class","month-nav svelte-kmxndl"),C(l,"class","month svelte-kmxndl"),C(h,"class","year svelte-kmxndl"),C(x,"tabindex","-1"),C(x,"class","month-nav svelte-kmxndl"),C(r,"class","year-month svelte-kmxndl"),C(U,"class","footer"),C(e,"class","reminder-calendar svelte-kmxndl"),C(e,"tabindex","0"),C(e,"role","grid")},m(B,pe){te(B,e,pe),M(e,r),M(r,i),M(r,o),M(r,l),M(l,f),M(r,m),M(r,h),M(h,w),M(r,_),M(r,x),M(e,b),M(e,T),M(T,F),M(T,S),M(T,j);for(let z=0;z<E.length;z+=1)E[z]&&E[z].m(j,null);n[16](T),M(e,q),M(e,U),Y&&Y.m(U,null),n[17](U),I=!0,A||(ke=[oe(i,"click",n[12]),oe(x,"click",n[13]),oe(e,"focus",n[18]),oe(e,"blur",n[19]),oe(e,"keydown",n[9])],A=!0)},p(B,[pe]){if((!I||pe&8)&&c!==(c=B[3].current.monthStart.format("MMM")+"")&&Ke(f,c),(!I||pe&8)&&y!==(y=B[3].current.monthStart.format("YYYY")+"")&&Ke(w,y),pe&105){de=we(B[3].current.weeks);let z;for(z=0;z<de.length;z+=1){let dt=hl(B,de,z);E[z]?E[z].p(dt,pe):(E[z]=gl(dt),E[z].c(),E[z].m(j,null))}for(;z<E.length;z+=1)E[z].d(1);E.length=de.length}Y&&Y.p&&(!I||pe&1024)&&Ja(Y,K,B,B[10],I?Za(K,B[10],pe,eh):qa(B[10]),ml)},i(B){I||(ie(Y,B),I=!0)},o(B){he(Y,B),I=!1},d(B){B&&ee(e),nt(E,B),n[16](null),Y&&Y.d(B),n[17](null),A=!1,_e(ke)}}}function rh(n,e,r){let i,{$$slots:o={},$$scope:l}=e,{value:c=(0,Fs.default)()}=e,f=Xr(),m,h;function y(E){r(0,c=E)}function w(E){r(0,c=E),b()}function _(){r(0,c=c.add(-1,"month"))}function x(){r(0,c=c.add(1,"month"))}function b(){f("select",c)}let T=new xr;function F(E){if(E.key>="0"&&E.key<="9"){E.preventDefault();let K=T.handle(E.key);switch(K.length){case 1:{let Y=parseInt(K);Y>0&&r(0,c=c.set("date",Y));break}case 2:K.startsWith("0")&&(K=K.slice(1)),r(0,c=c.set("date",parseInt(K)));break;case 4:{let Y=K.slice(0,2),B=K.slice(2,4);Y.startsWith("0")&&(Y=Y.slice(1)),B.startsWith("0")&&(B=B.slice(1)),r(0,c=c.set("month",parseInt(Y)-1)),r(0,c=c.set("date",parseInt(B)))}break}return}T.clear(),E.key==="ArrowLeft"||E.ctrlKey&&E.key==="B"?(r(0,c=c.add(-1,"day")),E.preventDefault()):E.key==="ArrowRight"||E.ctrlKey&&E.key==="F"?(r(0,c=c.add(1,"day")),E.preventDefault()):E.key==="ArrowUp"||E.ctrlKey&&E.key==="P"?r(0,c=c.add(-7,"day")):E.key==="ArrowDown"||E.ctrlKey&&E.key==="N"?(r(0,c=c.add(7,"day")),E.preventDefault()):E.key==="Enter"&&(b(),E.preventDefault())}Zt(()=>{r(2,h.style.width=m.clientWidth+"px",h)});let S=()=>_(),j=()=>x(),q=E=>y(E.date),U=E=>w(E.date);function I(E){Ie[E?"unshift":"push"](()=>{m=E,r(1,m)})}function A(E){Ie[E?"unshift":"push"](()=>{h=E,r(2,h)})}let ke=()=>{f("focus")},de=()=>{f("blur")};return n.$$set=E=>{"value"in E&&r(0,c=E.value),"$$scope"in E&&r(10,l=E.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&r(3,i=new ci((0,Fs.default)().startOf("day"),c.startOf("day")))},[c,m,h,i,f,y,w,_,x,F,l,o,S,j,q,U,I,A,ke,de]}var Rs=class extends xe{constructor(e){super(),Qe(this,e,rh,th,Ye,{value:0})}},bl=Rs;function vl(n,e,r){let i=n.slice();return i[11]=e[r],i}function _l(n){let e,r=n[11]+"",i,o;return{c(){e=N("option"),i=Se(r),e.__value=o=n[11],Kr(e,e.__value)},m(l,c){te(l,e,c),M(e,i)},p:me,d(l){l&&ee(e)}}}function nh(n){let e,r,i,o=we(n[4]),l=[];for(let c=0;c<o.length;c+=1)l[c]=_l(vl(n,o,c));return{c(){e=N("select");for(let c=0;c<l.length;c+=1)l[c].c();C(e,"class","time-picker svelte-193wkl6"),n[0]===void 0&&St(()=>n[7].call(e))},m(c,f){te(c,e,f);for(let m=0;m<l.length;m+=1)l[m]&&l[m].m(e,null);gr(e,n[0],!0),r||(i=[oe(e,"change",n[7]),oe(e,"dblclick",n[1]),oe(e,"focus",n[2]),oe(e,"blur",n[3]),oe(e,"keydown",n[5])],r=!0)},p(c,[f]){if(f&16){o=we(c[4]);let m;for(m=0;m<o.length;m+=1){let h=vl(c,o,m);l[m]?l[m].p(h,f):(l[m]=_l(h),l[m].c(),l[m].m(e,null))}for(;m<l.length;m+=1)l[m].d(1);l.length=o.length}f&17&&gr(e,c[0])},i:me,o:me,d(c){c&&ee(e),nt(l,c),r=!1,_e(i)}}}function ih(n,e,r){let{value:i="00:00"}=e,{step:o=15}=e,l=Xr();function c(){l("select",i)}function f(){l("focus")}function m(){l("blur")}function h(){let b=[];for(let T=0;T<60*24;T+=o){let F=Math.floor(T/60),S=T%60;b.push(`${F.toString().padStart(2,"0")}:${S.toString().padStart(2,"0")}`)}return b}let y=h(),w=new xr;function _(b){if(b.key>="0"&&b.key<="9"){b.preventDefault();let T=w.handle(b.key);switch(T.length){case 1:{let F=T.padStart(2,"0"),S=y.filter(j=>j.startsWith(F));S.length>1&&r(0,i=S[0])}break;case 2:{let F=T+":",S=y.filter(j=>j.startsWith(F));S.length>1&&r(0,i=S[0]);break}case 4:{let F=T.slice(0,2)+":"+T.slice(2,4);y.includes(F)&&r(0,i=F)}break}return}if(w.clear(),b.key==="Enter"){c(),b.preventDefault();return}}function x(){i=Xn(this),r(0,i),r(4,y)}return n.$$set=b=>{"value"in b&&r(0,i=b.value),"step"in b&&r(6,o=b.step)},[i,c,f,m,y,_,o,x]}var Es=class extends xe{constructor(e){super(),Qe(this,e,ih,nh,Ye,{value:0,step:6})}},wl=Es;function sh(n){let e,r,i,o,l;return o=new si({props:{reminders:n[1].byDate(new H(n[0],!1))}}),{c(){e=N("div"),r=N("hr"),i=ce(),Ve(o.$$.fragment),C(r,"class","dtchooser-divider svelte-ps5dkj"),C(e,"slot","footer")},m(c,f){te(c,e,f),M(e,r),M(e,i),Be(o,e,null),l=!0},p(c,f){let m={};f&3&&(m.reminders=c[1].byDate(new H(c[0],!1))),o.$set(m)},i(c){l||(ie(o.$$.fragment,c),l=!0)},o(c){he(o.$$.fragment,c),l=!1},d(c){c&&ee(e),Pe(o)}}}function oh(n){let e,r,i,o,l,c,f,m,h,y,w,_,x,b,T;function F(U){n[7](U)}let S={$$slots:{footer:[sh]},$$scope:{ctx:n}};n[0]!==void 0&&(S.value=n[0]),r=new bl({props:S}),Ie.push(()=>ws(r,"value",F)),r.$on("select",n[8]);function j(U){n[9](U)}let q={step:n[2]};return n[3]!==void 0&&(q.value=n[3]),h=new wl({props:q}),Ie.push(()=>ws(h,"value",j)),h.$on("select",n[10]),h.$on("focus",n[11]),{c(){e=N("div"),Ve(r.$$.fragment),o=ce(),l=N("div"),c=N("div"),f=N("span"),f.textContent="Time:",m=ce(),Ve(h.$$.fragment),w=ce(),_=N("button"),_.textContent="OK",C(f,"class","svelte-ps5dkj"),C(c,"class","dtchooser-time-picker svelte-ps5dkj"),C(_,"class","mod-cta"),C(l,"class","dtchooser-wrapper svelte-ps5dkj"),C(e,"class","dtchooser svelte-ps5dkj")},m(U,I){te(U,e,I),Be(r,e,null),M(e,o),M(e,l),M(l,c),M(c,f),M(c,m),Be(h,c,null),M(l,w),M(l,_),x=!0,b||(T=oe(_,"click",n[5]),b=!0)},p(U,[I]){let A={};I&4099&&(A.$$scope={dirty:I,ctx:U}),!i&&I&1&&(i=!0,A.value=U[0],vs(()=>i=!1)),r.$set(A);let ke={};I&4&&(ke.step=U[2]),!y&&I&8&&(y=!0,ke.value=U[3],vs(()=>y=!1)),h.$set(ke)},i(U){x||(ie(r.$$.fragment,U),ie(h.$$.fragment,U),x=!0)},o(U){he(r.$$.fragment,U),he(h.$$.fragment,U),x=!1},d(U){U&&ee(e),Pe(r),Pe(h),b=!1,T()}}}function ah(n,e,r){var T,F;let{date:i=(0,xl.default)()}=e,{reminders:o}=e,{onSelect:l}=e,{timeStep:c=15}=e,f=(F=(T=o.reminderTime)==null?void 0:T.value.toString())!=null?F:"10:00",m=!1;function h(){let[S,j]=f.split(":"),q=i.clone();m?(q.set({hour:parseInt(S),minute:parseInt(j)}),l(new H(q,!0))):l(new H(q,!1))}function y(S){i=S,r(0,i)}let w=()=>h();function _(S){f=S,r(3,f)}let x=()=>{h()},b=()=>{r(4,m=!0)};return n.$$set=S=>{"date"in S&&r(0,i=S.date),"reminders"in S&&r(1,o=S.reminders),"onSelect"in S&&r(6,l=S.onSelect),"timeStep"in S&&r(2,c=S.timeStep)},[i,o,c,f,m,h,l,y,w,_,x,b]}var Ms=class extends xe{constructor(e){super(),Qe(this,e,ah,oh,Ye,{date:0,reminders:1,onSelect:6,timeStep:2})}},di=Ms;var Us=class extends fi.Modal{constructor(r,i,o,l,c){super(r);this.reminders=i;this.onSelect=o;this.onCancel=l;this.timeStep=c;g(this,"selected")}onOpen(){let r;fi.Platform.isDesktop?(this.modalEl.style.minWidth="0px",this.modalEl.style.minHeight="0px",this.modalEl.style.width="auto",r=this.contentEl):r=this.containerEl,new di({target:r,props:{onSelect:i=>{this.select(i)},reminders:this.reminders,timeStep:this.timeStep}})}select(r){this.selected=r,this.close()}onClose(){this.selected!=null?this.onSelect(this.selected):this.onCancel()}};function en(n,e,r=15){return new Promise((i,o)=>{new Us(n,e,i,o,r).open()})}var kl=Wt(Ut(),1);var mi=class{constructor(e,r){this.editor=e;g(this,"view");g(this,"dateTimeChooser");g(this,"resultResolve");g(this,"resultReject");this.view=document.createElement("div"),this.view.addClass("date-time-chooser-popup"),this.view.style.position="fixed",this.dateTimeChooser=new di({target:this.view,props:{onSelect:i=>{this.setResult(i),this.hide()},reminders:r}})}show(){this.setResult(null),this.hide(),this.dateTimeChooser.$set({date:(0,kl.default)()});let e=this.editor.getCursor(),r=this.editor.charCoords(e),i=document.body,o=i.getBoundingClientRect();return this.view.style.top=`${r.top-o.top+this.editor.defaultTextHeight()}px`,this.view.style.left=`${r.left-o.left}px`,i.appendChild(this.view),new Promise((l,c)=>{this.resultResolve=l,this.resultReject=c})}cancel(){this.setResult(null),this.hide()}setResult(e){this.resultReject==null||this.resultResolve==null||(e===null?this.resultReject():this.resultResolve(e),this.resultReject=void 0,this.resultResolve=void 0)}hide(){this.view.parentNode&&this.view.parentNode.removeChild(this.view)}};var hi=class{constructor(e,r,i){this.trigger=e;this.timeStep=r;this.primaryFormat=i}isTrigger(e,r){let i=this.trigger.value;if(i.length===0)return!1;if(r.text.contains(i.charAt(i.length-1))){let o=e.getLine(r.from.line).substring(0,r.to.ch)+r.text;if(!o.match(/^\s*- \[.\]\s.*/))return!1;if(o.endsWith(i))return!0}return!1}show(e,r,i){let o;if(Tl.Platform.isDesktopApp)try{let l=r.cm;if(l==null){console.error("Cannot get codemirror editor.");return}o=new mi(l,i).show()}catch(l){console.error(l),o=en(e,i,this.timeStep.value)}else o=en(e,i,this.timeStep.value);o.then(l=>{this.insert(r,l,!0)}).catch(()=>{})}insert(e,r,i=!1){var m;let o=e.getCursor(),l=e.getLine(o.line),c={line:o.line,ch:l.length};i||(l=l.substring(0,o.ch-this.trigger.value.length));let f=this.primaryFormat.value.format;try{let h=(m=f.appendReminder(l,r))==null?void 0:m.insertedLine;if(h==null){console.error("Cannot append reminder time to the line: line=%s, date=%s",l,r);return}e.replaceRange(h,{line:o.line,ch:0},c)}catch(h){console.error(h)}}};var Dl=require("@codemirror/state"),Sl=require("@codemirror/view");function Fl(n,e,r){return Sl.ViewPlugin.fromClass(class{update(i){i.docChanged&&i.changes.iterChanges((o,l,c,f,m)=>{let h=i.state.doc,y=h.sliceString(f-2,f);if(m.length===0)return;let w=r.autoCompleteTrigger.value,_=r.reminderTimeStep.value;w===y&&en(n,e,_).then(x=>{let b=r.primaryFormat.value.format;try{let T=h.lineAt(f),F=T.text.lastIndexOf(w),S=F+w.length;w.startsWith("(")&&T.text.charAt(S)===")"&&S++;let j=T.text.substring(0,F)+T.text.substring(S),q=b.appendReminder(j,x,F);if(q==null){console.error("Cannot append reminder time to the line: line=%s, date=%s",T.text,x);return}let U=i.view.state.update({changes:{from:T.from,to:T.to,insert:q.insertedLine},selection:Dl.EditorSelection.cursor(T.from+q.caretPosition)});i.view.update([U])}catch(T){console.error(T)}}).catch(()=>{})})}})}var Yl=require("obsidian");var Rl=require("obsidian");function lh(n){let e;return{c(){e=N("span"),C(e,"class","icon svelte-1wmvl6g")},m(r,i){te(r,e,i),n[2](e)},p:me,i:me,o:me,d(r){r&&ee(e),n[2](null)}}}function uh(n,e,r){let{icon:i=""}=e,o;Zt(()=>{(0,Rl.setIcon)(o,i)});function l(c){Ie[c?"unshift":"push"](()=>{o=c,r(0,o)})}return n.$$set=c=>{"icon"in c&&r(1,i=c.icon)},[o,i,l]}var Os=class extends xe{constructor(e){super(),Qe(this,e,uh,lh,Ye,{icon:1})}},pi=Os;function El(n,e,r){let i=n.slice();return i[11]=e[r],i[13]=r,i}function Ml(n){let e,r=n[11].label+"",i,o,l;return{c(){e=N("option"),i=Se(r),e.__value=o=n[13],Kr(e,e.__value),e.selected=l=n[5]===n[13]},m(c,f){te(c,e,f),M(e,i)},p(c,f){f&16&&r!==(r=c[11].label+"")&&Ke(i,r),f&32&&l!==(l=c[5]===c[13])&&(e.selected=l)},d(c){c&&ee(e)}}}function ch(n){let e,r,i,o,l,c,f,m=n[0].file+"",h,y,w,_,x,b,T,F,S,j,q,U,I,A,ke,de;i=new ii({props:{markdown:n[0].title,sourcePath:n[0].file}}),c=new pi({props:{icon:"link"}}),x=new pi({props:{icon:"check-small"}}),S=new pi({props:{icon:"minus-with-circle"}});let E=we(n[4]),K=[];for(let Y=0;Y<E.length;Y+=1)K[Y]=Ml(El(n,E,Y));return{c(){e=N("main"),r=N("h1"),Ve(i.$$.fragment),o=ce(),l=N("button"),Ve(c.$$.fragment),f=ce(),h=Se(m),y=ce(),w=N("div"),_=N("button"),Ve(x.$$.fragment),b=Se(" Mark as Done"),T=ce(),F=N("button"),Ve(S.$$.fragment),j=Se(" Mute"),q=ce(),U=N("select"),I=N("option"),I.textContent="Remind Me Later";for(let Y=0;Y<K.length;Y+=1)K[Y].c();C(r,"class","reminder-title svelte-32got5"),C(l,"class","reminder-file svelte-32got5"),C(_,"class","mod-cta"),I.selected=!0,I.disabled=!0,I.hidden=!0,I.__value="Remind Me Later",Kr(I,I.__value),C(U,"class","dropdown later-select svelte-32got5"),n[5]===void 0&&St(()=>n[10].call(U)),C(w,"class","reminder-actions svelte-32got5"),C(e,"class","svelte-32got5")},m(Y,B){te(Y,e,B),M(e,r),Be(i,r,null),M(e,o),M(e,l),Be(c,l,null),M(l,f),M(l,h),M(e,y),M(e,w),M(w,_),Be(x,_,null),M(_,b),n[9](_),M(w,T),M(w,F),Be(S,F,null),M(F,j),M(w,q),M(w,U),M(U,I);for(let pe=0;pe<K.length;pe+=1)K[pe]&&K[pe].m(U,null);gr(U,n[5],!0),A=!0,ke||(de=[oe(l,"click",function(){Nt(n[2])&&n[2].apply(this,arguments)}),oe(_,"click",function(){Nt(n[1])&&n[1].apply(this,arguments)}),oe(F,"click",function(){Nt(n[3])&&n[3].apply(this,arguments)}),oe(U,"change",n[10]),oe(U,"change",n[7])],ke=!0)},p(Y,[B]){n=Y;let pe={};if(B&1&&(pe.markdown=n[0].title),B&1&&(pe.sourcePath=n[0].file),i.$set(pe),(!A||B&1)&&m!==(m=n[0].file+"")&&Ke(h,m),B&48){E=we(n[4]);let z;for(z=0;z<E.length;z+=1){let dt=El(n,E,z);K[z]?K[z].p(dt,B):(K[z]=Ml(dt),K[z].c(),K[z].m(U,null))}for(;z<K.length;z+=1)K[z].d(1);K.length=E.length}B&32&&gr(U,n[5])},i(Y){A||(ie(i.$$.fragment,Y),ie(c.$$.fragment,Y),ie(x.$$.fragment,Y),ie(S.$$.fragment,Y),A=!0)},o(Y){he(i.$$.fragment,Y),he(c.$$.fragment,Y),he(x.$$.fragment,Y),he(S.$$.fragment,Y),A=!1},d(Y){Y&&ee(e),Pe(i),Pe(c),Pe(x),n[9](null),Pe(S),nt(K,Y),ke=!1,_e(de)}}}function dh(n,e,r){let{reminder:i}=e,{onRemindMeLater:o}=e,{onDone:l}=e,{onOpenFile:c}=e,{onMute:f}=e,m,{laters:h=[]}=e,y;function w(){let b=h[m];b!=null&&o(b.later())}Zt(async()=>{await bs(),y.focus()});function _(b){Ie[b?"unshift":"push"](()=>{y=b,r(6,y)})}function x(){m=Xn(this),r(5,m)}return n.$$set=b=>{"reminder"in b&&r(0,i=b.reminder),"onRemindMeLater"in b&&r(8,o=b.onRemindMeLater),"onDone"in b&&r(1,l=b.onDone),"onOpenFile"in b&&r(2,c=b.onOpenFile),"onMute"in b&&r(3,f=b.onMute),"laters"in b&&r(4,h=b.laters)},[i,l,c,f,h,m,y,w,o,_,x]}var Ys=class extends xe{constructor(e){super(),Qe(this,e,dh,ch,Ye,{reminder:0,onRemindMeLater:8,onDone:1,onOpenFile:2,onMute:3,laters:4})}},Ul=Ys;var Ol=window.require?window.require("electron"):void 0,yi=class{constructor(e,r,i){this.app=e;this.useSystemNotification=r;this.laters=i}show(e,r,i,o,l){if(!this.isSystemNotification())this.showBuiltinReminder(e,r,i,o,l);else{let c=Ol.remote.Notification,f=new c({title:"Obsidian Reminder",body:e.title});f.on("click",()=>{f.close(),this.showBuiltinReminder(e,r,i,o,l)}),f.on("close",()=>{o()});{let m=this.laters.value;f.on("action",(y,w)=>{if(w===0){i();return}let _=m[w-1];r(_.later())});let h=[{type:"button",text:"Mark as Done"}];m.forEach(y=>{h.push({type:"button",text:y.label})}),f.actions=h}f.show()}}showBuiltinReminder(e,r,i,o,l){new Qs(this.app,this.laters.value,e,r,i,o,l).open()}isSystemNotification(){return this.isMobile()?!1:this.useSystemNotification.value}isMobile(){return Ol===void 0}},Qs=class extends Yl.Modal{constructor(r,i,o,l,c,f,m){super(r);this.laters=i;this.reminder=o;this.onRemindMeLater=l;this.onDone=c;this.onCancel=f;this.onOpenFile=m;g(this,"canceled",!0)}onOpen(){this.reminder.beingDisplayed=!0;let{contentEl:r}=this;new Ul({target:r,props:{reminder:this.reminder,laters:this.laters,onRemindMeLater:i=>{this.onRemindMeLater(i),this.canceled=!1,this.close()},onDone:()=>{this.canceled=!1,this.onDone(),this.close()},onOpenFile:()=>{this.canceled=!0,this.onOpenFile(),this.close()},onMute:()=>{this.canceled=!0,this.close()}}})}onClose(){this.reminder.beingDisplayed=!1;let{contentEl:r}=this;r.empty(),this.canceled&&this.onCancel()}};var tn=class{constructor(e){this.plugin=e;g(this,"autoComplete");g(this,"editDetector");g(this,"reminderModal");g(this,"viewProxy");this.viewProxy=new ai(this.plugin.app.workspace,this.plugin.reminders,this.plugin.settings.reminderTime,r=>{if(r.muteNotification){this.showReminder(r);return}this.openReminderFile(r)}),this.autoComplete=new hi(e.settings.autoCompleteTrigger,e.settings.reminderTimeStep,e.settings.primaryFormat),this.editDetector=new Ls(e.settings.editDetectionSec),this.reminderModal=new yi(e.app,e.settings.useSystemNotification,e.settings.laters)}onload(){this.plugin.registerView(ut,e=>this.viewProxy.createView(e)),this.plugin.addSettingTab(new Ns(this.plugin.app,this.plugin)),this.plugin.registerDomEvent(document,"keydown",()=>{this.editDetector.fileChanged()}),It.Platform.isDesktopApp&&this.plugin.registerEditorExtension(Fl(this.plugin.app,this.plugin.reminders,this.plugin.settings)),$a(this.plugin)}onLayoutReady(){this.plugin.data.debug.value&&Va(this.plugin),this.viewProxy.openView()}onunload(){this.detachReminderList()}isEditing(){return this.editDetector.isEditing()}invalidate(){this.viewProxy.invalidate()}reload(e=!1){this.viewProxy.reload(e)}showAutoComplete(e){this.autoComplete.show(this.plugin.app,e,this.plugin.reminders)}showReminderModal(e,r,i,o,l){this.reminderModal.show(e,r,i,o,l)}showReminderList(){var e;this.plugin.app.workspace.getLeavesOfType(ut).length||(e=this.plugin.app.workspace.getRightLeaf(!1))==null||e.setViewState({type:ut})}detachReminderList(){this.plugin.app.workspace.getLeavesOfType(ut).forEach(e=>e.detach())}async openReminderFile(e){let r=this.plugin.app.workspace.getLeaf(!1);console.log("Open reminder: ",e);let i=this.plugin.app.vault.getAbstractFileByPath(e.file);if(!(i instanceof It.TFile)){console.error("Cannot open file because it isn't a TFile: %o",i);return}if(await r.openFile(i),!(r.view instanceof It.MarkdownView))return;let o=r.view.editor.getLine(e.rowNumber);r.view.editor.setSelection({line:e.rowNumber,ch:0},{line:e.rowNumber,ch:o.length})}showReminder(e){e.muteNotification=!0,this.showReminderModal(e,r=>{console.info("Remind me later: time=%o",r),e.time=r,e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!1),this.plugin.data.save(!0)},()=>{console.info("done"),e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!0),this.plugin.reminders.removeReminder(e),this.plugin.data.save(!0)},()=>{console.info("Mute"),e.muteNotification=!0,this.reload(!0)},()=>{console.info("Open"),this.openReminderFile(e)})}},Ls=class{constructor(e){this.editDetectionSec=e;g(this,"lastModified")}fileChanged(){this.lastModified=new Date}isEditing(){return this.editDetectionSec.value<=0||this.lastModified==null?!1:(new Date().getTime()-this.lastModified.getTime())/1e3<this.editDetectionSec.value}},Ns=class extends It.PluginSettingTab{constructor(r,i){super(r,i);this.plugin=i}display(){let{containerEl:r}=this;this.plugin.settings.settings.displayOn(r)}};var Cs=require("obsidian"),rn=class{constructor(e,r,i){this.vault=e;this.reminders=r;this.onRemindersChanged=i}onload(e){[this.vault.on("modify",async r=>{await this.reloadRemindersInFile(r)&&this.onRemindersChanged()}),this.vault.on("delete",async r=>{await this.removeRemindersByFile(r.path)&&this.onRemindersChanged()}),this.vault.on("rename",async(r,i)=>{await this.removeRemindersByFile(i)&&(await this.reloadRemindersInFile(r),this.onRemindersChanged())})].forEach(r=>{e.registerEvent(r)})}async removeRemindersByFile(e){return console.debug("Remove file: path=%s",e),this.reminders.removeByFile(e)}async reloadRemindersInFile(e){if(console.debug("Reload file and collect reminders: file=%s",e.path),!(e instanceof Cs.TFile))return console.debug("Cannot read file other than TFile: file=%o",e),!1;if(!this.isMarkdownFile(e))return console.debug("Not a markdown file: file=%o",e),!1;let i=new Tt(e.path,await this.vault.cachedRead(e)).getReminders();if(i.length>0){if(!this.reminders.replaceFile(e.path,i))return!1}else if(!this.reminders.removeByFile(e.path))return!1;return!0}async reloadRemindersInAllFiles(){console.debug("Reload all files and collect reminders"),this.reminders.clear();for(let e of this.vault.getMarkdownFiles())await this.reloadRemindersInFile(e);this.onRemindersChanged()}isMarkdownFile(e){return e.extension.toLowerCase()==="md"}async updateReminder(e,r){let i=this.vault.getAbstractFileByPath(e.file);if(!(i instanceof Cs.TFile)){console.error("file is not instance of TFile: %o",i);return}let o=new Tt(i.path,await this.vault.read(i));await o.updateReminder(e,{checked:r,time:e.time}),await this.vault.modify(i,o.getContent())}};var Ql=require("obsidian");var Is=class{constructor(){g(this,"settingContexts",[])}register(e){this.settingContexts.push(e)}findByKey(e){return this.settingContexts.find(r=>r.key===e)}forEach(e){this.settingContexts.forEach(e)}},Bs=class{constructor(e){this._settingRegistry=e;g(this,"validationEl");g(this,"infoEl");g(this,"_setting");g(this,"key");g(this,"name");g(this,"desc");g(this,"tags",[]);g(this,"settingModel");g(this,"anyValueChanged")}init(e,r,i){this.settingModel=e,this._setting=r,this.validationEl=i.createDiv("validation",o=>{o.style.color="var(--text-error)",o.style.marginBottom="1rem",o.style.fontSize="14px",o.style.display="none"}),this.infoEl=i.createDiv("info",o=>{o.style.color="var(--text-faint)",o.style.marginBottom="1rem",o.style.fontSize="14px",o.style.display="none"})}setValidationError(e){this.setText(this.validationEl,e)}setInfo(e){this.setText(this.infoEl,e)}setText(e,r){if(!e){console.error("element not created");return}r===null?e.style.display="none":(e.style.display="block",e.innerHTML=r)}get setting(){return this._setting}get registry(){return this._settingRegistry}hasTag(e){return this.tags.filter(r=>r===e).length>0}update(){this.anyValueChanged&&this.anyValueChanged(this)}setEnabled(e){this.setting.setDisabled(!e)}findContextByKey(e){return this._settingRegistry.findByKey(e)}booleanValue(){return this.settingModel.value}isInitialized(){return this.settingModel&&this.validationEl&&this.setting}},Ps=class{constructor(e){this.registry=e;g(this,"context");this.context=new Bs(this.registry),this.registry.register(this.context)}key(e){return this.context.key=e,this}name(e){return this.context.name=e,this}desc(e){return this.context.desc=e,this}tag(e){return this.context.tags.push(e),this}enableWhen(e){return this.context.anyValueChanged=e,this}text(e){return new gi(this.context,!1,e)}textArea(e){return new gi(this.context,!0,e)}number(e){return new As(this.context,e)}toggle(e){return new Ws(this.context,e)}dropdown(e){return new js(this.context,e)}},kr=class{constructor(e,r){this.context=e;this.initValue=r}onAnyValueChanged(e){return this.context.anyValueChanged=e,this}onValueChange(){this.context.registry.forEach(e=>{e.update()})}buildSettingModel(e,r){return new nn(this.context,e,this.initValue,r)}},gi=class extends kr{constructor(r,i,o){super(r,o);this.longText=i;g(this,"_placeHolder")}placeHolder(r){return this._placeHolder=r,this}build(r){return this.buildSettingModel(r,({setting:i,rawValue:o,context:l})=>{let c=f=>{var m;f.setPlaceholder((m=this._placeHolder)!=null?m:"").setValue(o.value).onChange(async h=>{try{r.unmarshal(h),o.value=h,l.setValidationError(null),this.onValueChange()}catch(y){y instanceof Error?l.setValidationError(y.message):typeof y=="string"&&l.setValidationError(y)}})};this.longText?i.addTextArea(f=>{c(f)}):i.addText(f=>{c(f)})})}},As=class extends kr{constructor(r,i){super(r,i);g(this,"_placeHolder")}placeHolder(r){return this._placeHolder=r,this}build(r){return this.buildSettingModel(r,({setting:i,rawValue:o,context:l})=>{let c=f=>{var m;f.setPlaceholder((m=this._placeHolder)!=null?m:"").setValue(o.value.toString()).onChange(async h=>{try{let y=parseInt(h);o.value=y,l.setValidationError(null),this.onValueChange()}catch(y){y instanceof Error?l.setValidationError(y.message):typeof y=="string"&&l.setValidationError(y)}})};i.addText(f=>{c(f)})})}},Ws=class extends kr{build(e){return new nn(this.context,e,this.initValue,({setting:r,rawValue:i})=>{r.addToggle(o=>o.setValue(i.value).onChange(async l=>{i.value=l,this.onValueChange()}))})}},$s=class{constructor(e,r){this.label=e;this.value=r}},js=class extends kr{constructor(){super(...arguments);g(this,"options",[])}addOption(r,i){return this.options.push(new $s(r,i)),this}build(r){return new nn(this.context,r,this.initValue,({setting:i,rawValue:o})=>{i.addDropdown(l=>{this.options.forEach(c=>{l.addOption(c.value,c.label)}),l.setValue(o.value),l.onChange(async c=>{o.value=c,this.onValueChange()})})})}},nn=class{constructor(e,r,i,o){this.context=e;this.serde=r;this.settingInitializer=o;g(this,"rawValue");if(this.rawValue=new $t(i),e.key==null)throw new Error("key is required.")}createSetting(e){var i,o;let r=new Ql.Setting(e).setName((i=this.context.name)!=null?i:"").setDesc((o=this.context.desc)!=null?o:"");return this.context.init(this,r,e),this.settingInitializer({setting:r,rawValue:this.rawValue,context:this.context}),r}get value(){return this.serde.unmarshal(this.rawValue.value)}get key(){return this.context.key}load(e){if(e===void 0)return;let r=e[this.key];r!==void 0&&(this.rawValue.value=r)}store(e){e[this.key]=this.rawValue.value}hasTag(e){return this.context.hasTag(e)}},Vs=class{constructor(e){this.name=e;g(this,"settings",[])}addSettings(...e){this.settings.push(...e)}},bi=class{constructor(){g(this,"groups",[]);g(this,"registry",new Is)}newSettingBuilder(){return new Ps(this.registry)}newGroup(e){let r=new Vs(e);return this.groups.push(r),r}displayOn(e){e.empty(),this.groups.forEach(r=>{e.createEl("h3",{text:r.name}),r.settings.forEach(i=>{i.createSetting(e)})}),this.registry.forEach(r=>r.update())}forEach(e){this.groups.forEach(r=>{r.settings.forEach(i=>{e(i)})})}},vi=class{unmarshal(e){return Rn.parse(e)}marshal(e){return e.toString()}},Ce=class{unmarshal(e){return e}marshal(e){return e}},_i=class{unmarshal(e){return Vo(e)}marshal(e){return e.map(r=>r.label).join(`
`)}},wi=class{unmarshal(e){return qr.find(i=>i.name===e)}marshal(e){return e.name}};var ct="re-scan",xi=class{constructor(){g(this,"settings",new bi);g(this,"reminderTime");g(this,"reminderTimeStep");g(this,"useSystemNotification");g(this,"laters");g(this,"dateFormat");g(this,"dateTimeFormat");g(this,"strictDateFormat");g(this,"autoCompleteTrigger");g(this,"primaryFormat");g(this,"useCustomEmojiForTasksPlugin");g(this,"removeTagsForTasksPlugin");g(this,"linkDatesToDailyNotes");g(this,"editDetectionSec");g(this,"reminderCheckIntervalSec");let e=new Hs(this.settings);this.reminderTime=this.settings.newSettingBuilder().key("reminderTime").name("Reminder Time").desc("Time when a reminder with no time part will show").tag(ct).text("09:00").placeHolder("Time (hh:mm)").build(new vi),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder Time Step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new Ce),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new Ce),this.laters=this.settings.newSettingBuilder().key("laters").name("Remind me later").desc("Line-separated list of remind me later items").textArea(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).placeHolder(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).build(new _i),this.dateFormat=this.settings.newSettingBuilder().key("dateFormat").name("Date format").desc("moment style date format: https://momentjs.com/docs/#/displaying/format/").tag(ct).text("YYYY-MM-DD").placeHolder("YYYY-MM-DD").onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ce),this.strictDateFormat=this.settings.newSettingBuilder().key("strictDateFormat").name("Strict Date format").desc("Strictly parse the date and time").tag(ct).toggle(!1).build(new Ce),this.dateTimeFormat=this.settings.newSettingBuilder().key("dateTimeFormat").name("Date and time format").desc("moment() style date time format: https://momentjs.com/docs/#/displaying/format/").tag(ct).text("YYYY-MM-DD HH:mm").placeHolder("YYYY-MM-DD HH:mm").onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ce),this.linkDatesToDailyNotes=this.settings.newSettingBuilder().key("linkDatesToDailyNotes").name("Link dates to daily notes").desc("When toggled, Dates link to daily notes.").tag(ct).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ce),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(o=>{let l=this.autoCompleteTrigger.value;o.setInfo(`Popup is ${l.length===0?"disabled":"enabled"}`)}).build(new Ce);let r=this.settings.newSettingBuilder().key("primaryReminderFormat").name("Primary reminder format").desc("Reminder format for generated reminder by calendar popup").dropdown(qr[0].name);qr.forEach(o=>r.addOption(`${o.description} - ${o.example}`,o.name)),this.primaryFormat=r.build(new wi),this.useCustomEmojiForTasksPlugin=this.settings.newSettingBuilder().key("useCustomEmojiForTasksPlugin").name("Distinguish between reminder date and due date").desc("Use custom emoji \u23F0 instead of \u{1F4C5} and distinguish between reminder date/time and Tasks Plugin's due date.").tag(ct).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new Ce),this.removeTagsForTasksPlugin=this.settings.newSettingBuilder().key("removeTagsForTasksPlugin").name("Remove tags from reminder title").desc("If checked, tags(#xxx) are removed from the reminder list view and notification.").tag(ct).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new Ce),this.editDetectionSec=this.settings.newSettingBuilder().key("editDetectionSec").name("Edit Detection Time").desc("The minimum amount of time (in seconds) after a key is typed that it will be identified as notifiable.").number(10).build(new Ce),this.reminderCheckIntervalSec=this.settings.newSettingBuilder().key("reminderCheckIntervalSec").name("Reminder check interval").desc("Interval(in seconds) to periodically check whether or not you should be notified of reminders. You will need to restart Obsidian for this setting to take effect.").number(5).build(new Ce),this.settings.newGroup("Notification Settings").addSettings(this.reminderTime,this.reminderTimeStep,this.laters,this.useSystemNotification),this.settings.newGroup("Editor").addSettings(this.autoCompleteTrigger,this.primaryFormat),this.settings.newGroup("Reminder Format - Reminder Plugin").addSettings(e.enableReminderPluginReminderFormat,this.dateFormat,this.dateTimeFormat,this.strictDateFormat,this.linkDatesToDailyNotes),this.settings.newGroup("Reminder Format - Tasks Plugin").addSettings(e.enableTasksPluginReminderFormat,this.useCustomEmojiForTasksPlugin,this.removeTagsForTasksPlugin),this.settings.newGroup("Reminder Format - Kanban Plugin").addSettings(e.enableKanbanPluginReminderFormat),this.settings.newGroup("Advanced").addSettings(this.editDetectionSec,this.reminderCheckIntervalSec);let i=new Ir;i.setParameterFunc(Ne.now,()=>H.now()),i.setParameter(Ne.useCustomEmojiForTasksPlugin,this.useCustomEmojiForTasksPlugin),i.setParameter(Ne.linkDatesToDailyNotes,this.linkDatesToDailyNotes),i.setParameter(Ne.removeTagsForTasksPlugin,this.removeTagsForTasksPlugin),Na(i)}forEach(e){this.settings.forEach(e)}},Hs=class{constructor(e){this.settings=e;g(this,"settingKeyToFormatName",new Map);g(this,"reminderFormatSettings",[]);g(this,"enableReminderPluginReminderFormat");g(this,"enableTasksPluginReminderFormat");g(this,"enableKanbanPluginReminderFormat");this.enableReminderPluginReminderFormat=this.createUseReminderFormatSetting(ls),this.enableTasksPluginReminderFormat=this.createUseReminderFormatSetting(us),this.enableKanbanPluginReminderFormat=this.createUseReminderFormatSetting(cs)}createUseReminderFormatSetting(e){let r=`enable${e.name}`,i=this.settings.newSettingBuilder().key(r).name(`Enable ${e.description}`).desc(`Enable ${e.description}`).tag(ct).toggle(e.defaultEnabled).onAnyValueChanged(o=>{var l;o.setInfo(`Example: ${(l=e.format.appendReminder("- [ ] Task 1",H.now()))==null?void 0:l.insertedLine}`)}).build(new Ce);return this.settingKeyToFormatName.set(r,e),this.reminderFormatSettings.push(i),i.rawValue.onChanged(()=>{this.updateReminderFormat()}),i}updateReminderFormat(){let e=this.reminderFormatSettings.filter(r=>r.value).map(r=>this.settingKeyToFormatName.get(r.key)).filter(r=>r!==void 0);La(e)}};var sn=class{constructor(e,r){this.plugin=e;this.reminders=r;g(this,"restoring",!0);g(this,"changed",!1);g(this,"scanned",new $t(!1));g(this,"debug",new $t(!1));g(this,"_settings",new xi);this.settings.forEach(i=>{i.rawValue.onChanged(()=>{this.restoring||(i.hasTag(ct)&&(this.scanned.value=!1),this.changed=!0)})})}async load(){console.debug("Load reminder plugin data");let e=await this.plugin.loadData();if(!e){this.scanned.value=!1;return}this.scanned.value=e.scanned,e.debug!=null&&(this.debug.value=e.debug);let r=e.settings;this.settings.forEach(i=>{i.load(r)}),e.reminders&&Object.keys(e.reminders).forEach(i=>{let o=e.reminders[i];o&&this.reminders.replaceFile(i,o.map(l=>new ur(i,l.title,H.parse(l.time),l.rowNumber,!1)))}),this.changed=!1,this.restoring&&(this.restoring=!1)}async save(e=!1){if(!e&&!this.changed)return;console.debug("Save reminder plugin data: force=%s, changed=%s",e,this.changed);let r={};this.reminders.fileToReminders.forEach((o,l)=>{r[l]=o.map(c=>({title:c.title,time:c.time.toString(),rowNumber:c.rowNumber}))});let i={};this.settings.forEach(o=>{o.store(i)}),await this.plugin.saveData({scanned:this.scanned.value,reminders:r,debug:this.debug.value,settings:i}),this.changed=!1}get settings(){return this._settings}};var Ll=require("obsidian");var ki=class extends Ll.Plugin{constructor(r,i){super(r,i);g(this,"_data");g(this,"_ui");g(this,"_reminders");g(this,"_fileSystem");g(this,"_notificationWorker");this._reminders=new En(()=>{this.ui&&this.ui.invalidate(),this.data.changed=!0}),this._data=new sn(this,this.reminders),this.reminders.reminderTime=this.settings.reminderTime,ot.setTimeFormat(this.settings.dateFormat,this.settings.dateTimeFormat,this.settings.strictDateFormat),this._ui=new tn(this),this._fileSystem=new rn(r.vault,this.reminders,()=>{this.ui.reload(!0)}),this._notificationWorker=new Qr(this)}async onload(){this.ui.onload(),this.app.workspace.onLayoutReady(async()=>{await this.data.load(),this.ui.onLayoutReady(),this.fileSystem.onload(this),this._notificationWorker.startPeriodicTask()})}onunload(){this.ui.onunload()}get reminders(){return this._reminders}get ui(){return this._ui}get fileSystem(){return this._fileSystem}get data(){return this._data}get settings(){return this.data.settings}};
/*! Bundled license information:
moment/moment.js:
(*! moment.js *)
(*! version : 2.29.4 *)
(*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
(*! license : MIT *)
(*! momentjs.com *)
*/
/* nosourcemap */